
_main:

;imo.c,23 :: 		void main()
;imo.c,25 :: 		lcd_init();
	CALL       _Lcd_Init+0
;imo.c,26 :: 		Lcd_Cmd(_LCD_CURSOR_OFF);
	MOVLW      12
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;imo.c,28 :: 		trisd=0b00000011;
	MOVLW      3
	MOVWF      TRISD+0
;imo.c,29 :: 		trisb=0;
	CLRF       TRISB+0
;imo.c,30 :: 		trisc=0;
	CLRF       TRISC+0
;imo.c,31 :: 		pwm1_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;imo.c,32 :: 		pwm2_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;imo.c,35 :: 		lcd_out(1,1,"Iman Abu_Ayyash");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr1_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,36 :: 		lcd_out(2,1,"1111568");
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr2_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,37 :: 		delay_ms(5000);
	MOVLW      26
	MOVWF      R11+0
	MOVLW      94
	MOVWF      R12+0
	MOVLW      110
	MOVWF      R13+0
L_main0:
	DECFSZ     R13+0, 1
	GOTO       L_main0
	DECFSZ     R12+0, 1
	GOTO       L_main0
	DECFSZ     R11+0, 1
	GOTO       L_main0
	NOP
;imo.c,38 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;imo.c,41 :: 		option_reg.f0=0;
	BCF        OPTION_REG+0, 0
;imo.c,42 :: 		option_reg.f1=0;
	BCF        OPTION_REG+0, 1
;imo.c,43 :: 		pwm1_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM1_Init+0
;imo.c,44 :: 		pwm2_init(1000);
	BSF        T2CON+0, 0
	BCF        T2CON+0, 1
	MOVLW      249
	MOVWF      PR2+0
	CALL       _PWM2_Init+0
;imo.c,45 :: 		for(;;){
L_main1:
;imo.c,46 :: 		x=ADC_Read(0);
	CLRF       FARG_ADC_Read_channel+0
	CALL       _ADC_Read+0
	MOVF       R0+0, 0
	MOVWF      _x+0
	MOVF       R0+1, 0
	MOVWF      _x+1
;imo.c,47 :: 		duty = x/4;
	MOVF       R0+0, 0
	MOVWF      R4+0
	MOVF       R0+1, 0
	MOVWF      R4+1
	RRF        R4+1, 1
	RRF        R4+0, 1
	BCF        R4+1, 7
	BTFSC      R4+1, 6
	BSF        R4+1, 7
	RRF        R4+1, 1
	RRF        R4+0, 1
	BCF        R4+1, 7
	BTFSC      R4+1, 6
	BSF        R4+1, 7
	MOVF       R4+0, 0
	MOVWF      _duty+0
	MOVF       R4+1, 0
	MOVWF      _duty+1
;imo.c,48 :: 		v=(duty/2.55);
	MOVF       R4+0, 0
	MOVWF      R0+0
	MOVF       R4+1, 0
	MOVWF      R0+1
	CALL       _Int2Double+0
	MOVLW      51
	MOVWF      R4+0
	MOVLW      51
	MOVWF      R4+1
	MOVLW      35
	MOVWF      R4+2
	MOVLW      128
	MOVWF      R4+3
	CALL       _Div_32x32_FP+0
	CALL       _Double2Int+0
	MOVF       R0+0, 0
	MOVWF      _v+0
	MOVF       R0+1, 0
	MOVWF      _v+1
;imo.c,49 :: 		intTostr(v,txt);
	MOVF       R0+0, 0
	MOVWF      FARG_IntToStr_input+0
	MOVF       R0+1, 0
	MOVWF      FARG_IntToStr_input+1
	MOVLW      _txt+0
	MOVWF      FARG_IntToStr_output+0
	CALL       _IntToStr+0
;imo.c,50 :: 		if(portd.b0==0) {
	BTFSC      PORTD+0, 0
	GOTO       L_main4
;imo.c,51 :: 		push1=0;
	CLRF       _push1+0
	CLRF       _push1+1
;imo.c,52 :: 		}
L_main4:
;imo.c,53 :: 		if(portd.b0==1){
	BTFSS      PORTD+0, 0
	GOTO       L_main5
;imo.c,54 :: 		if(push1==0)
	MOVLW      0
	XORWF      _push1+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main27
	MOVLW      0
	XORWF      _push1+0, 0
L__main27:
	BTFSS      STATUS+0, 2
	GOTO       L_main6
;imo.c,55 :: 		{on_state =~on_state;
	MOVLW
	XORWF      _on_state+0, 1
;imo.c,56 :: 		push1=1;
	MOVLW      1
	MOVWF      _push1+0
	MOVLW      0
	MOVWF      _push1+1
;imo.c,57 :: 		} }
L_main6:
L_main5:
;imo.c,58 :: 		if(portd.b1==0) {
	BTFSC      PORTD+0, 1
	GOTO       L_main7
;imo.c,59 :: 		push2=0;
	CLRF       _push2+0
	CLRF       _push2+1
;imo.c,60 :: 		}
L_main7:
;imo.c,62 :: 		if(portd.b1==1) {
	BTFSS      PORTD+0, 1
	GOTO       L_main8
;imo.c,63 :: 		if(push2==0)
	MOVLW      0
	XORWF      _push2+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main28
	MOVLW      0
	XORWF      _push2+0, 0
L__main28:
	BTFSS      STATUS+0, 2
	GOTO       L_main9
;imo.c,64 :: 		{direction_state =~direction_state;
	MOVLW
	XORWF      _direction_state+0, 1
;imo.c,65 :: 		push2=1;
	MOVLW      1
	MOVWF      _push2+0
	MOVLW      0
	MOVWF      _push2+1
;imo.c,66 :: 		} }
L_main9:
L_main8:
;imo.c,67 :: 		if (  on_state==1)
	BTFSS      _on_state+0, BitPos(_on_state+0)
	GOTO       L_main10
;imo.c,68 :: 		{  if ( direction_state==0)
	BTFSC      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main11
;imo.c,71 :: 		pwm1_start();
	CALL       _PWM1_Start+0
;imo.c,72 :: 		pwm1_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;imo.c,73 :: 		pwm2_stop();
	CALL       _PWM2_Stop+0
;imo.c,74 :: 		PORTd.b2=1;
	BSF        PORTD+0, 2
;imo.c,75 :: 		PORTd.b3=0;
	BCF        PORTD+0, 3
;imo.c,76 :: 		if(q==1||q==2)
	MOVLW      0
	XORWF      _q+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main29
	MOVLW      1
	XORWF      _q+0, 0
L__main29:
	BTFSC      STATUS+0, 2
	GOTO       L__main25
	MOVLW      0
	XORWF      _q+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main30
	MOVLW      2
	XORWF      _q+0, 0
L__main30:
	BTFSC      STATUS+0, 2
	GOTO       L__main25
	GOTO       L_main14
L__main25:
;imo.c,77 :: 		{q=0;
	CLRF       _q+0
	CLRF       _q+1
;imo.c,78 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;imo.c,79 :: 		}
L_main14:
;imo.c,80 :: 		lcd_out(1,1,"speed");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr3_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,81 :: 		lcd_out(1,6,txt);
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      6
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      _txt+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,82 :: 		lcd_out(1,7,"%");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      7
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr4_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,83 :: 		lcd_out(2,1,"ON,CW");
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr5_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,84 :: 		}
L_main11:
;imo.c,87 :: 		if (  direction_state==1)
	BTFSS      _direction_state+0, BitPos(_direction_state+0)
	GOTO       L_main15
;imo.c,89 :: 		pwm1_stop();
	CALL       _PWM1_Stop+0
;imo.c,90 :: 		pwm2_start();
	CALL       _PWM2_Start+0
;imo.c,92 :: 		pwm2_set_duty(duty);
	MOVF       _duty+0, 0
	MOVWF      FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;imo.c,93 :: 		PORTd.b3=1;
	BSF        PORTD+0, 3
;imo.c,94 :: 		PORTd.b2=0;
	BCF        PORTD+0, 2
;imo.c,95 :: 		if(q==0||q==2)
	MOVLW      0
	XORWF      _q+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main31
	MOVLW      0
	XORWF      _q+0, 0
L__main31:
	BTFSC      STATUS+0, 2
	GOTO       L__main24
	MOVLW      0
	XORWF      _q+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main32
	MOVLW      2
	XORWF      _q+0, 0
L__main32:
	BTFSC      STATUS+0, 2
	GOTO       L__main24
	GOTO       L_main18
L__main24:
;imo.c,96 :: 		{q=1;
	MOVLW      1
	MOVWF      _q+0
	MOVLW      0
	MOVWF      _q+1
;imo.c,97 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;imo.c,98 :: 		}
L_main18:
;imo.c,99 :: 		lcd_out(1,1,"Speed");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr6_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,100 :: 		lcd_out(1,6,txt);
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      6
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      _txt+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,101 :: 		lcd_out(1,7,"%");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      7
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr7_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,102 :: 		lcd_out(2,1,"on, CCW");}
	MOVLW      2
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr8_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
L_main15:
;imo.c,103 :: 		}
	GOTO       L_main19
L_main10:
;imo.c,108 :: 		pwm1_set_duty(0);
	CLRF       FARG_PWM1_Set_Duty_new_duty+0
	CALL       _PWM1_Set_Duty+0
;imo.c,109 :: 		pwm2_set_duty(0);
	CLRF       FARG_PWM2_Set_Duty_new_duty+0
	CALL       _PWM2_Set_Duty+0
;imo.c,110 :: 		PORTd.b3=0;
	BCF        PORTD+0, 3
;imo.c,111 :: 		PORTd.b2=0;
	BCF        PORTD+0, 2
;imo.c,112 :: 		if(q==0|| q==1)
	MOVLW      0
	XORWF      _q+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main33
	MOVLW      0
	XORWF      _q+0, 0
L__main33:
	BTFSC      STATUS+0, 2
	GOTO       L__main23
	MOVLW      0
	XORWF      _q+1, 0
	BTFSS      STATUS+0, 2
	GOTO       L__main34
	MOVLW      1
	XORWF      _q+0, 0
L__main34:
	BTFSC      STATUS+0, 2
	GOTO       L__main23
	GOTO       L_main22
L__main23:
;imo.c,113 :: 		{q=2;
	MOVLW      2
	MOVWF      _q+0
	MOVLW      0
	MOVWF      _q+1
;imo.c,114 :: 		lcd_cmd(_lcd_clear);
	MOVLW      1
	MOVWF      FARG_Lcd_Cmd_out_char+0
	CALL       _Lcd_Cmd+0
;imo.c,115 :: 		}
L_main22:
;imo.c,116 :: 		lcd_out(1,1,"OFF");
	MOVLW      1
	MOVWF      FARG_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_Lcd_Out_column+0
	MOVLW      ?lstr9_imo+0
	MOVWF      FARG_Lcd_Out_text+0
	CALL       _Lcd_Out+0
;imo.c,118 :: 		}}}
L_main19:
	GOTO       L_main1
L_end_main:
	GOTO       $+0
; end of _main
