;/////////////////////////////////////////////////////////////////////////////////
;// Code Generator: BoostC Compiler - http://www.sourceboost.com
;// Version       : 6.96
;// License Type  : Lite License (Unregistered)
;// Limitations   : PIC12,PIC16 max code size:2048 words, max RAM banks:2, Non commercial use only
;/////////////////////////////////////////////////////////////////////////////////

	include "P16F722.inc"
; Heap block 0, size:32 (0x0000005F - 0x0000007E)
__HEAP_BLOCK0_BANK               EQU	0x00000000
__HEAP_BLOCK0_START_OFFSET       EQU	0x0000005F
__HEAP_BLOCK0_END_OFFSET         EQU	0x0000007E
; Heap block 1, size:32 (0x000000A0 - 0x000000BF)
__HEAP_BLOCK1_BANK               EQU	0x00000001
__HEAP_BLOCK1_START_OFFSET       EQU	0x00000020
__HEAP_BLOCK1_END_OFFSET         EQU	0x0000003F
; Heap block 2, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK2_BANK               EQU	0x00000000
__HEAP_BLOCK2_START_OFFSET       EQU	0x00000000
__HEAP_BLOCK2_END_OFFSET         EQU	0x00000000
; Heap block 3, size:0 (0x00000000 - 0x00000000)
__HEAP_BLOCK3_BANK               EQU	0x00000000
__HEAP_BLOCK3_START_OFFSET       EQU	0x00000000
__HEAP_BLOCK3_END_OFFSET         EQU	0x00000000
gbl_status                       EQU	0x00000003 ; bytes:1
gbl_indf                         EQU	0x00000000 ; bytes:1
gbl_tmr0                         EQU	0x00000001 ; bytes:1
gbl_pcl                          EQU	0x00000002 ; bytes:1
gbl_fsr                          EQU	0x00000004 ; bytes:1
gbl_porta                        EQU	0x00000005 ; bytes:1
gbl_portb                        EQU	0x00000006 ; bytes:1
gbl_portc                        EQU	0x00000007 ; bytes:1
gbl_porte                        EQU	0x00000009 ; bytes:1
gbl_pclath                       EQU	0x0000000A ; bytes:1
gbl_intcon                       EQU	0x0000000B ; bytes:1
gbl_pir1                         EQU	0x0000000C ; bytes:1
gbl_pir2                         EQU	0x0000000D ; bytes:1
gbl_tmr1l                        EQU	0x0000000E ; bytes:1
gbl_tmr1h                        EQU	0x0000000F ; bytes:1
gbl_t1con                        EQU	0x00000010 ; bytes:1
gbl_tmr2                         EQU	0x00000011 ; bytes:1
gbl_t2con                        EQU	0x00000012 ; bytes:1
gbl_sspbuf                       EQU	0x00000013 ; bytes:1
gbl_sspcon                       EQU	0x00000014 ; bytes:1
gbl_ccpr1l                       EQU	0x00000015 ; bytes:1
gbl_ccpr1h                       EQU	0x00000016 ; bytes:1
gbl_ccp1con                      EQU	0x00000017 ; bytes:1
gbl_rcsta                        EQU	0x00000018 ; bytes:1
gbl_txreg                        EQU	0x00000019 ; bytes:1
gbl_rcreg                        EQU	0x0000001A ; bytes:1
gbl_ccpr2l                       EQU	0x0000001B ; bytes:1
gbl_ccpr2h                       EQU	0x0000001C ; bytes:1
gbl_ccp2con                      EQU	0x0000001D ; bytes:1
gbl_adres                        EQU	0x0000001E ; bytes:1
gbl_adcon0                       EQU	0x0000001F ; bytes:1
gbl_option_reg                   EQU	0x00000081 ; bytes:1
gbl_trisa                        EQU	0x00000085 ; bytes:1
gbl_trisb                        EQU	0x00000086 ; bytes:1
gbl_trisc                        EQU	0x00000087 ; bytes:1
gbl_trise                        EQU	0x00000089 ; bytes:1
gbl_pie1                         EQU	0x0000008C ; bytes:1
gbl_pie2                         EQU	0x0000008D ; bytes:1
gbl_pcon                         EQU	0x0000008E ; bytes:1
gbl_t1gcon                       EQU	0x0000008F ; bytes:1
gbl_osccon                       EQU	0x00000090 ; bytes:1
gbl_osctune                      EQU	0x00000091 ; bytes:1
gbl_pr2                          EQU	0x00000092 ; bytes:1
gbl_sspadd                       EQU	0x00000093 ; bytes:1
gbl_sspmsk                       EQU	0x00000093 ; bytes:1
gbl_sspstat                      EQU	0x00000094 ; bytes:1
gbl_wpub                         EQU	0x00000095 ; bytes:1
gbl_iocb                         EQU	0x00000096 ; bytes:1
gbl_ioc                          EQU	0x00000096 ; bytes:1
gbl_txsta                        EQU	0x00000098 ; bytes:1
gbl_spbrg                        EQU	0x00000099 ; bytes:1
gbl_apfcon                       EQU	0x0000009C ; bytes:1
gbl_fvrcon                       EQU	0x0000009D ; bytes:1
gbl_adcon1                       EQU	0x0000009F ; bytes:1
gbl_pmdatl                       EQU	0x0000010C ; bytes:1
gbl_pmdata                       EQU	0x0000010C ; bytes:1
gbl_pmadrl                       EQU	0x0000010D ; bytes:1
gbl_pmadr                        EQU	0x0000010D ; bytes:1
gbl_pmdath                       EQU	0x0000010E ; bytes:1
gbl_pmadrh                       EQU	0x0000010F ; bytes:1
gbl_ansela                       EQU	0x00000185 ; bytes:1
gbl_anselb                       EQU	0x00000186 ; bytes:1
gbl_ansele                       EQU	0x00000189 ; bytes:1
gbl_pmcon1                       EQU	0x0000018C ; bytes:1
gbl_battery_volt                 EQU	0x00000045 ; bytes:1
gbl_portc_latch                  EQU	0x00000046 ; bytes:1
gbl_portb_latch                  EQU	0x00000047 ; bytes:1
gbl_character                    EQU	0x00000048 ; bytes:1
gbl_voutmax                      EQU	0x00000041 ; bytes:2
gbl_bat_volt_setp                EQU	0x00000043 ; bytes:2
gbl_full_SOC                     EQU	0x00000049 ; bytes:1
gbl_hv_detect_count              EQU	0x0000004A ; bytes:1
set_portb_00000_arg_n            EQU	0x00000050 ; bytes:1
set_portb_00000_1_x              EQU	0x00000051 ; bytes:1
clear_port_00017_arg_n           EQU	0x00000050 ; bytes:1
clear_port_00017_1_x             EQU	0x00000051 ; bytes:1
clear_port_00018_arg_n           EQU	0x00000052 ; bytes:1
clear_port_00018_1_x             EQU	0x00000053 ; bytes:1
set_portc_00000_arg_n            EQU	0x00000052 ; bytes:1
set_portc_00000_1_x              EQU	0x00000053 ; bytes:1
CompTempVarRet617                EQU	0x00000050 ; bytes:1
CompTempVarRet619                EQU	0x00000052 ; bytes:1
check_Lead_0001A_1_i             EQU	0x00000050 ; bytes:1
check_Lead_0001A_1_a             EQU	0x00000051 ; bytes:1
main_1_b                         EQU	0x0000004B ; bytes:1
main_1_i                         EQU	0x0000004C ; bytes:2
main_1_j                         EQU	0x0000004E ; bytes:2
gbl_outval                       EQU	0x00000020 ; bytes:12
gbl_readval                      EQU	0x0000002C ; bytes:9
gbl_14_i2c_buffer                EQU	0x00000035 ; bytes:9
wait_scl_00000_1_data            EQU	0x00000055 ; bytes:1
wait_sda_00000_1_data            EQU	0x00000052 ; bytes:1
CompTempVarRet621                EQU	0x00000056 ; bytes:1
read_sda_00000_1_data            EQU	0x00000055 ; bytes:1
i2c_send_00000_arg_data          EQU	0x00000052 ; bytes:1
CompTempVarRet622                EQU	0x00000055 ; bytes:2
i2c_send_00000_1_i               EQU	0x00000053 ; bytes:2
CompTempVarRet623                EQU	0x00000055 ; bytes:1
i2c_rx_00000_1_i                 EQU	0x00000052 ; bytes:2
i2c_rx_00000_1_data              EQU	0x00000054 ; bytes:1
newouts_00000_arg_num            EQU	0x00000052 ; bytes:1
newouts_00000_arg_wide           EQU	0x00000053 ; bytes:1
newouts_00000_1_k                EQU	0x00000054 ; bytes:1
newouts_00000_1_r                EQU	0x00000055 ; bytes:1
newouts_00000_1_temp1            EQU	0x00000056 ; bytes:1
newouts_00000_1_temp2            EQU	0x00000057 ; bytes:1
newouts_00000_1_tencount         EQU	0x00000058 ; bytes:1
CompTempVar626                   EQU	0x00000059 ; bytes:1
CompTempVar627                   EQU	0x0000005A ; bytes:1
CompTempVar630                   EQU	0x00000059 ; bytes:1
CompTempVar632                   EQU	0x0000005A ; bytes:1
CompTempVar634                   EQU	0x00000059 ; bytes:1
CompTempVar635                   EQU	0x0000005A ; bytes:1
CompTempVar638                   EQU	0x00000059 ; bytes:1
CompTempVar643                   EQU	0x00000059 ; bytes:1
CompTempVar644                   EQU	0x0000005A ; bytes:1
CompTempVar647                   EQU	0x00000059 ; bytes:1
CompTempVar650                   EQU	0x0000005A ; bytes:1
CompTempVar651                   EQU	0x0000005B ; bytes:1
CompTempVar652                   EQU	0x0000005C ; bytes:2
CompTempVar654                   EQU	0x0000005E ; bytes:1
CompTempVar660                   EQU	0x00000059 ; bytes:1
CompTempVar661                   EQU	0x0000005A ; bytes:1
CompTempVar664                   EQU	0x00000059 ; bytes:1
CompTempVar667                   EQU	0x0000005A ; bytes:1
CompTempVar672                   EQU	0x0000005B ; bytes:2
CompTempVar674                   EQU	0x0000005D ; bytes:1
bp_00000_1_bp                    EQU	0x00000052 ; bytes:1
get_i2c_da_00011_1_result        EQU	0x00000050 ; bytes:1
get_i2c_da_00011_1_i             EQU	0x00000051 ; bytes:1
CompTempVarRet678                EQU	0x0000005A ; bytes:1
start_i2c__0001E_1_a             EQU	0x00000059 ; bytes:1
CompTempVarRet679                EQU	0x0000005B ; bytes:1
stop_i2c_c_0001F_1_a             EQU	0x0000005A ; bytes:1
send_i2c_n_00020_arg_byte        EQU	0x00000059 ; bytes:1
CompTempVarRet680                EQU	0x0000005C ; bytes:1
send_i2c_n_00020_1_i             EQU	0x0000005A ; bytes:1
send_i2c_n_00020_1_a             EQU	0x0000005B ; bytes:1
send_i2c_c_00021_arg_number      EQU	0x00000055 ; bytes:1
CompTempVarRet682                EQU	0x00000059 ; bytes:1
send_i2c_c_00021_1_a             EQU	0x00000056 ; bytes:1
send_i2c_c_00021_1_i             EQU	0x00000057 ; bytes:1
send_i2c_c_00021_1_no_ack_flag   EQU	0x00000058 ; bytes:1
set_Voutma_00012_arg_voutmax     EQU	0x00000050 ; bytes:2
CompTempVarRet686                EQU	0x00000052 ; bytes:1
set_Voutma_00012_1_a             EQU	0x00000052 ; bytes:1
set_Voutma_00012_1_b             EQU	0x00000053 ; bytes:2
Int1Context                      EQU	0x0000007F ; bytes:1
Int1BContext                     EQU	0x0000003E ; bytes:3
	ORG 0x00000000
	GOTO	_startup
	ORG 0x00000004
	MOVWF Int1Context
	SWAPF STATUS, W
	BCF STATUS, RP0
	BCF STATUS, RP1
	MOVWF Int1BContext
	SWAPF PCLATH, W
	MOVWF Int1BContext+D'1'
	SWAPF FSR, W
	MOVWF Int1BContext+D'2'
	BCF PCLATH,3
	BCF PCLATH,4
	GOTO	interrupt
	ORG 0x00000010
wait_sda_00000
; { wait_sda ; function begin
	MOVLW 0x10
	BCF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_portc, W
	MOVWF wait_sda_00000_1_data
label1
	MOVF wait_sda_00000_1_data, F
	BTFSS STATUS,Z
	RETURN
	MOVLW 0x10
	ANDWF gbl_portc, W
	MOVWF wait_sda_00000_1_data
	GOTO	label1
; } wait_sda function end

	ORG 0x0000001C
wait_scl_00000
; { wait_scl ; function begin
	MOVLW 0x08
	BCF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_portc, W
	MOVWF wait_scl_00000_1_data
label2
	MOVF wait_scl_00000_1_data, F
	BTFSS STATUS,Z
	RETURN
	MOVLW 0x08
	ANDWF gbl_portc, W
	MOVWF wait_scl_00000_1_data
	GOTO	label2
; } wait_scl function end

	ORG 0x00000028
release_sd_0001B
; { release_sda ; function begin
	MOVLW 0x10
	BSF STATUS, RP0
	BCF STATUS, RP1
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	RETURN
; } release_sda function end

	ORG 0x00000032
release_sc_0001C
; { release_scl ; function begin
	MOVLW 0x08
	BSF STATUS, RP0
	BCF STATUS, RP1
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	RETURN
; } release_scl function end

	ORG 0x0000003C
stop_i2c_c_0001F
; { stop_i2c_com_newfunc ; function begin
	MOVLW 0xF7
	BSF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	MOVLW 0xEF
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	MOVLW 0x08
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	MOVLW 0x08
	BCF STATUS, RP0
	ANDWF gbl_portc, W
	MOVWF stop_i2c_c_0001F_1_a
label3
	MOVF stop_i2c_c_0001F_1_a, F
	BTFSS STATUS,Z
	GOTO	label4
	MOVLW 0x08
	ANDWF gbl_portc, W
	MOVWF stop_i2c_c_0001F_1_a
	GOTO	label3
label4
	CLRF gbl_tmr2
	MOVLW 0xFD
	ANDWF gbl_pir1, W
	MOVWF gbl_pir1
	MOVLW 0x02
	ANDWF gbl_pir1, W
	MOVWF stop_i2c_c_0001F_1_a
label5
	MOVF stop_i2c_c_0001F_1_a, F
	BTFSS STATUS,Z
	GOTO	label6
	MOVLW 0x02
	ANDWF gbl_pir1, W
	MOVWF stop_i2c_c_0001F_1_a
	GOTO	label5
label6
	MOVLW 0x10
	BSF STATUS, RP0
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	BCF STATUS, RP0
	CLRF CompTempVarRet679
	RETURN
; } stop_i2c_com_newfunc function end

	ORG 0x00000073
start_i2c__0001E
; { start_i2c_com ; function begin
	MOVLW 0x08
	BCF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_portc, W
	MOVWF start_i2c__0001E_1_a
	MOVF start_i2c__0001E_1_a, F
	BTFSS STATUS,Z
	GOTO	label7
	MOVLW 0x01
	MOVWF CompTempVarRet678
	RETURN
label7
	MOVLW 0xEF
	BSF STATUS, RP0
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	BCF STATUS, RP0
	CLRF CompTempVarRet678
	RETURN
; } start_i2c_com function end

	ORG 0x00000085
send_i2c_n_00020
; { send_i2c_newfunc ; function begin
	CLRF send_i2c_n_00020_1_i
	CLRF send_i2c_n_00020_1_i
label8
	MOVLW 0x08
	SUBWF send_i2c_n_00020_1_i, W
	BTFSC STATUS,C
	GOTO	label13
	MOVLW 0x08
	ANDWF gbl_portc, W
	MOVWF send_i2c_n_00020_1_a
	MOVF send_i2c_n_00020_1_a, F
	BTFSS STATUS,Z
	GOTO	label10
label9
	MOVF send_i2c_n_00020_1_a, F
	BTFSS STATUS,Z
	GOTO	label10
	MOVLW 0x08
	ANDWF gbl_portc, W
	MOVWF send_i2c_n_00020_1_a
	GOTO	label9
label10
	MOVLW 0xF7
	BSF STATUS, RP0
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	MOVLW 0x80
	BCF STATUS, RP0
	ANDWF send_i2c_n_00020_arg_byte, W
	MOVWF send_i2c_n_00020_1_a
	MOVF send_i2c_n_00020_1_a, F
	BTFSS STATUS,Z
	GOTO	label11
	MOVLW 0xEF
	BSF STATUS, RP0
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	GOTO	label12
label11
	MOVLW 0x10
	BSF STATUS, RP0
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
label12
	NOP
	NOP
	MOVLW 0x08
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	MOVLW 0x08
	BCF STATUS, RP0
	ANDWF gbl_portc, W
	MOVWF send_i2c_n_00020_1_a
	MOVF send_i2c_n_00020_1_a, F
	NOP
	NOP
	MOVF send_i2c_n_00020_arg_byte, F
	BCF STATUS,C
	RLF send_i2c_n_00020_arg_byte, F
	INCF send_i2c_n_00020_1_i, F
	GOTO	label8
label13
	MOVLW 0xF7
	BSF STATUS, RP0
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	MOVLW 0x10
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	MOVLW 0x10
	BCF STATUS, RP0
	ANDWF gbl_portc, W
	MOVWF send_i2c_n_00020_1_a
	MOVF send_i2c_n_00020_1_a, F
	BTFSS STATUS,Z
	GOTO	label14
	MOVLW 0x08
	BSF STATUS, RP0
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	MOVLW 0x01
	BCF STATUS, RP0
	MOVWF CompTempVarRet680
	RETURN
label14
	MOVLW 0x08
	BSF STATUS, RP0
	IORWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	BCF STATUS, RP0
	CLRF CompTempVarRet680
	RETURN
	NOP
	NOP
; } send_i2c_newfunc function end

	ORG 0x000000E6
read_sda_00000
; { read_sda ; function begin
	MOVLW 0x10
	BCF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_portc, W
	MOVWF read_sda_00000_1_data
	MOVF read_sda_00000_1_data, F
	BTFSC STATUS,Z
	GOTO	label15
	MOVLW 0x01
	MOVWF CompTempVarRet621
	RETURN
label15
	CLRF CompTempVarRet621
	RETURN
; } read_sda function end

	ORG 0x000000F3
i2c_stop_00000
; { i2c_stop ; function begin
	CALL release_sc_0001C
	CALL wait_scl_00000
	CALL release_sd_0001B
	CALL wait_sda_00000
	RETURN
; } i2c_stop function end

	ORG 0x000000F8
drop_sda_00000
; { drop_sda ; function begin
	MOVLW 0xEF
	BSF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	RETURN
; } drop_sda function end

	ORG 0x00000102
drop_scl_00000
; { drop_scl ; function begin
	MOVLW 0xF7
	BSF STATUS, RP0
	BCF STATUS, RP1
	ANDWF gbl_trisc, W
	MOVWF gbl_trisc
	NOP
	NOP
	NOP
	NOP
	RETURN
; } drop_scl function end

	ORG 0x0000010C
set_portc_00000
; { set_portc ; function begin
	MOVLW 0x01
	MOVWF set_portc_00000_1_x
	MOVF set_portc_00000_1_x, F
	MOVF set_portc_00000_arg_n, W
label16
	ANDLW 0xFF
	BTFSC STATUS,Z
	GOTO	label17
	BCF STATUS,C
	RLF set_portc_00000_1_x, F
	ADDLW 0xFF
	GOTO	label16
label17
	MOVF set_portc_00000_1_x, W
	IORWF gbl_portc_latch, W
	MOVWF gbl_portc_latch
	MOVF gbl_portc_latch, W
	MOVWF gbl_portc
	RETURN
; } set_portc function end

	ORG 0x0000011D
set_portb_00000
; { set_portb ; function begin
	MOVLW 0x01
	MOVWF set_portb_00000_1_x
	MOVF set_portb_00000_1_x, F
	MOVF set_portb_00000_arg_n, W
label18
	ANDLW 0xFF
	BTFSC STATUS,Z
	GOTO	label19
	BCF STATUS,C
	RLF set_portb_00000_1_x, F
	ADDLW 0xFF
	GOTO	label18
label19
	MOVF set_portb_00000_1_x, W
	IORWF gbl_portb_latch, W
	MOVWF gbl_portb_latch
	MOVF gbl_portb_latch, W
	MOVWF gbl_portb
	RETURN
; } set_portb function end

	ORG 0x0000012E
send_nak_00000
; { send_nak ; function begin
	CALL release_sd_0001B
	CALL wait_sda_00000
	CALL release_sc_0001C
	CALL drop_scl_00000
	CALL drop_sda_00000
	RETURN
; } send_nak function end

	ORG 0x00000134
send_i2c_c_00021
; { send_i2c_command ; function begin
	CLRF send_i2c_c_00021_1_no_ack_flag
	MOVLW 0x01
	MOVWF send_i2c_c_00021_1_a
	BCF gbl_portc,4
	NOP
	NOP
	NOP
	BCF gbl_portc,3
label20
	MOVF send_i2c_c_00021_1_a, F
	BTFSC STATUS,Z
	GOTO	label21
	CALL start_i2c__0001E
	MOVF CompTempVarRet678, W
	MOVWF send_i2c_c_00021_1_a
	GOTO	label20
label21
	CLRF send_i2c_c_00021_1_i
label22
	MOVF send_i2c_c_00021_arg_number, W
	SUBWF send_i2c_c_00021_1_i, W
	BTFSC STATUS,C
	GOTO	label26
	BCF	STATUS,IRP
	MOVLW LOW(gbl_14_i2c_buffer+D'0')
	MOVWF FSR
	MOVF send_i2c_c_00021_1_i, W
	ADDWF FSR, F
	MOVF INDF, W
	MOVWF send_i2c_n_00020_arg_byte
	CALL send_i2c_n_00020
	MOVF CompTempVarRet680, W
	MOVWF send_i2c_c_00021_1_a
	MOVF send_i2c_c_00021_1_a, F
	BTFSS STATUS,Z
	GOTO	label23
	INCF send_i2c_c_00021_1_no_ack_flag, F
	DECF send_i2c_c_00021_1_i, W
	MOVWF send_i2c_c_00021_1_i
	GOTO	label24
label23
	CLRF send_i2c_c_00021_1_no_ack_flag
label24
	MOVF send_i2c_c_00021_1_no_ack_flag, W
	XORLW 0x03
	BTFSS STATUS,Z
	GOTO	label25
	MOVLW 0x01
	MOVWF CompTempVarRet682
	RETURN
label25
	INCF send_i2c_c_00021_1_i, F
	GOTO	label22
label26
	CALL stop_i2c_c_0001F
	CLRF CompTempVarRet682
	RETURN
; } send_i2c_command function end

	ORG 0x00000166
send_ack_00000
; { send_ack ; function begin
	CALL drop_sda_00000
	CALL release_sc_0001C
	CALL drop_scl_00000
	RETURN
; } send_ack function end

	ORG 0x0000016A
newouts_00000
; { newouts ; function begin
	CLRF newouts_00000_1_r
	CLRF newouts_00000_1_temp1
	CLRF newouts_00000_1_temp2
	CLRF newouts_00000_1_tencount
	MOVLW 0x01
	MOVWF newouts_00000_1_k
label27
	MOVLW 0x08
	SUBWF newouts_00000_1_k, W
	BTFSC STATUS,C
	RETURN
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar626
	BCF STATUS,C
	RLF CompTempVar626, W
	ADDWF FSR, F
	INCF FSR, F
	MOVLW 0x00
	MOVWF CompTempVar627
	CLRF INDF
	DECF FSR, F
	MOVF CompTempVar627, W
	MOVWF INDF
	MOVF newouts_00000_1_tencount, F
	BTFSS STATUS,Z
	GOTO	label28
	BCF	STATUS,IRP
	MOVLW LOW(gbl_readval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_k, W
	ADDWF FSR, F
	MOVF INDF, W
	MOVWF newouts_00000_1_temp1
	GOTO	label31
label28
	BCF	STATUS,IRP
	MOVLW LOW(gbl_readval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_k, W
	ADDWF FSR, F
	MOVF INDF, W
	MOVWF CompTempVar630
	MOVF newouts_00000_1_tencount, W
	MOVWF CompTempVar632
label29
	BTFSC STATUS,Z
	GOTO	label30
	BCF STATUS,C
	RRF CompTempVar630, F
	DECF CompTempVar632, F
	GOTO	label29
label30
	MOVF CompTempVar630, W
	MOVWF newouts_00000_1_temp1
label31
	MOVLW 0x02
	ADDWF newouts_00000_1_tencount, F
	BCF	STATUS,IRP
	MOVLW LOW(gbl_readval+D'0')
	MOVWF FSR
	INCF newouts_00000_1_k, W
	ADDWF FSR, F
	MOVF newouts_00000_1_tencount, W
	SUBLW 0x08
	MOVWF CompTempVar634
	MOVF INDF, W
	MOVWF CompTempVar635
	MOVF CompTempVar634, W
label32
	ANDLW 0xFF
	BTFSC STATUS,Z
	GOTO	label33
	BCF STATUS,C
	RLF CompTempVar635, F
	ADDLW 0xFF
	GOTO	label32
label33
	MOVF CompTempVar635, W
	MOVWF newouts_00000_1_temp2
	MOVF newouts_00000_1_tencount, W
	SUBLW 0x08
	MOVWF CompTempVar638
	MOVF newouts_00000_1_temp2, F
	MOVF CompTempVar638, F
label34
	BTFSC STATUS,Z
	GOTO	label35
	BCF STATUS,C
	RRF newouts_00000_1_temp2, F
	DECF CompTempVar638, F
	GOTO	label34
label35
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar643
	BCF STATUS,C
	RLF CompTempVar643, W
	ADDWF FSR, F
	INCF FSR, F
	MOVF newouts_00000_1_temp2, W
	MOVWF CompTempVar644
	CLRF INDF
	DECF FSR, F
	MOVF CompTempVar644, W
	MOVWF INDF
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar650
	BCF STATUS,C
	RLF CompTempVar650, W
	ADDWF FSR, F
	MOVF newouts_00000_1_tencount, W
	SUBLW 0x0A
	MOVWF CompTempVar651
	MOVF INDF, W
	MOVWF CompTempVar654
	INCF FSR, F
	MOVF INDF, W
	MOVWF CompTempVar652+D'1'
	MOVF CompTempVar651, W
label36
	ANDLW 0xFF
	BTFSC STATUS,Z
	GOTO	label37
	BCF STATUS,C
	RLF CompTempVar654, F
	RLF CompTempVar652+D'1', F
	ADDLW 0xFF
	GOTO	label36
label37
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar647
	BCF STATUS,C
	RLF CompTempVar647, W
	ADDWF FSR, F
	INCF FSR, F
	MOVF CompTempVar652+D'1', W
	MOVWF INDF
	DECF FSR, F
	MOVF CompTempVar654, W
	MOVWF INDF
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar660
	BCF STATUS,C
	RLF CompTempVar660, W
	ADDWF FSR, F
	MOVF INDF, W
	MOVWF CompTempVar661
	INCF FSR, F
	MOVF newouts_00000_1_temp1, W
	IORWF CompTempVar661, F
	DECF FSR, F
	MOVF CompTempVar661, W
	MOVWF INDF
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar667
	BCF STATUS,C
	RLF CompTempVar667, W
	ADDWF FSR, F
	MOVF INDF, W
	MOVWF CompTempVar674
	INCF FSR, F
	MOVF INDF, W
	ANDLW 0x03
	MOVWF CompTempVar672+D'1'
	BCF	STATUS,IRP
	MOVLW LOW(gbl_outval+D'0')
	MOVWF FSR
	MOVF newouts_00000_1_r, W
	MOVWF CompTempVar664
	BCF STATUS,C
	RLF CompTempVar664, W
	ADDWF FSR, F
	INCF FSR, F
	MOVF CompTempVar672+D'1', W
	MOVWF INDF
	DECF FSR, F
	MOVF CompTempVar674, W
	MOVWF INDF
	INCF newouts_00000_1_r, F
	MOVF newouts_00000_1_tencount, W
	XORLW 0x08
	BTFSS STATUS,Z
	GOTO	label38
	CLRF newouts_00000_1_tencount
	INCF newouts_00000_1_k, F
label38
	INCF newouts_00000_1_k, F
	GOTO	label27
; } newouts function end

	ORG 0x0000022B
i2c_start_00000
; { i2c_start ; function begin
	CALL i2c_stop_00000
	CALL drop_sda_00000
	CALL drop_scl_00000
	RETURN
; } i2c_start function end

	ORG 0x0000022F
i2c_send_00000
; { i2c_send ; function begin
	CALL drop_scl_00000
	BCF STATUS, RP0
	CLRF i2c_send_00000_1_i
	CLRF i2c_send_00000_1_i+D'1'
label39
	MOVLW 0x08
	SUBWF i2c_send_00000_1_i, W
	MOVF i2c_send_00000_1_i+D'1', W
	BTFSC STATUS,C
	GOTO	label40
	BTFSC STATUS,Z
	GOTO	label41
label40
	BTFSS i2c_send_00000_1_i+D'1',7
	GOTO	label44
label41
	BTFSS i2c_send_00000_arg_data,7
	GOTO	label42
	CALL release_sd_0001B
	GOTO	label43
label42
	CALL drop_sda_00000
label43
	CALL release_sc_0001C
	CALL wait_scl_00000
	CALL drop_scl_00000
	BCF STATUS,C
	BCF STATUS, RP0
	RLF i2c_send_00000_arg_data, F
	INCF i2c_send_00000_1_i, F
	BTFSC STATUS,Z
	INCF i2c_send_00000_1_i+D'1', F
	GOTO	label39
label44
	CALL release_sd_0001B
	CALL release_sc_0001C
	CALL wait_scl_00000
	CALL read_sda_00000
	MOVF CompTempVarRet621, W
	MOVWF i2c_send_00000_1_i
	CLRF i2c_send_00000_1_i+D'1'
	CALL drop_scl_00000
	CALL drop_sda_00000
	BCF STATUS, RP0
	MOVF i2c_send_00000_1_i, W
	MOVWF CompTempVarRet622
	MOVF i2c_send_00000_1_i+D'1', W
	MOVWF CompTempVarRet622+D'1'
	RETURN
; } i2c_send function end

	ORG 0x0000025A
i2c_rx_00000
; { i2c_rx ; function begin
	BCF STATUS, RP0
	BCF STATUS, RP1
	CLRF i2c_rx_00000_1_data
	CALL release_sd_0001B
	BCF STATUS, RP0
	CLRF i2c_rx_00000_1_i
	CLRF i2c_rx_00000_1_i+D'1'
label45
	MOVLW 0x08
	SUBWF i2c_rx_00000_1_i, W
	MOVF i2c_rx_00000_1_i+D'1', W
	BTFSC STATUS,C
	GOTO	label46
	BTFSC STATUS,Z
	GOTO	label47
label46
	BTFSS i2c_rx_00000_1_i+D'1',7
	GOTO	label48
label47
	CALL release_sc_0001C
	CALL wait_scl_00000
	BCF STATUS,C
	RLF i2c_rx_00000_1_data, F
	CALL read_sda_00000
	MOVF CompTempVarRet621, W
	IORWF i2c_rx_00000_1_data, F
	CALL drop_scl_00000
	BCF STATUS, RP0
	INCF i2c_rx_00000_1_i, F
	BTFSC STATUS,Z
	INCF i2c_rx_00000_1_i+D'1', F
	GOTO	label45
label48
	CALL drop_sda_00000
	BCF STATUS, RP0
	MOVF i2c_rx_00000_1_data, W
	MOVWF CompTempVarRet623
	RETURN
; } i2c_rx function end

	ORG 0x0000027C
i2c_readst_0001D
; { i2c_readstart ; function begin
	CALL release_sd_0001B
	CALL wait_sda_00000
	CALL release_sc_0001C
	CALL wait_scl_00000
	CALL drop_sda_00000
	CALL drop_scl_00000
	RETURN
; } i2c_readstart function end

	ORG 0x00000283
clear_port_00018
; { clear_portc ; function begin
	MOVLW 0x01
	MOVWF clear_port_00018_1_x
	MOVF clear_port_00018_1_x, F
	MOVF clear_port_00018_arg_n, W
label49
	ANDLW 0xFF
	BTFSC STATUS,Z
	GOTO	label50
	BCF STATUS,C
	RLF clear_port_00018_1_x, F
	ADDLW 0xFF
	GOTO	label49
label50
	COMF clear_port_00018_1_x, W
	ANDWF gbl_portc_latch, W
	MOVWF gbl_portc_latch
	MOVF gbl_portc_latch, W
	MOVWF gbl_portc
	RETURN
; } clear_portc function end

	ORG 0x00000294
clear_port_00017
; { clear_portb ; function begin
	MOVLW 0x01
	MOVWF clear_port_00017_1_x
	MOVF clear_port_00017_1_x, F
	MOVF clear_port_00017_arg_n, W
label51
	ANDLW 0xFF
	BTFSC STATUS,Z
	GOTO	label52
	BCF STATUS,C
	RLF clear_port_00017_1_x, F
	ADDLW 0xFF
	GOTO	label51
label52
	COMF clear_port_00017_1_x, W
	ANDWF gbl_portb_latch, W
	MOVWF gbl_portb_latch
	MOVF gbl_portb_latch, W
	MOVWF gbl_portb
	RETURN
; } clear_portb function end

	ORG 0x000002A5
bp_00000
; { bp ; function begin
	BCF STATUS, RP0
	BCF STATUS, RP1
	CLRF bp_00000_1_bp
	RETURN
; } bp function end

	ORG 0x000002A9
set_Voutma_00012
; { set_Voutmax ; function begin
	MOVLW 0x3B
	MOVWF gbl_sspcon
	MOVLW 0x02
	MOVWF gbl_14_i2c_buffer
	MOVLW 0xE3
	MOVWF gbl_14_i2c_buffer+D'1'
	MOVLW 0x06
	MOVWF gbl_14_i2c_buffer+D'2'
	CLRF gbl_14_i2c_buffer+D'3'
	MOVLW 0x80
	MOVWF gbl_14_i2c_buffer+D'4'
	MOVLW 0xF4
	MOVWF gbl_14_i2c_buffer+D'5'
	MOVLW 0xFF
	MOVWF gbl_14_i2c_buffer+D'6'
	MOVWF gbl_14_i2c_buffer+D'7'
	CLRF gbl_14_i2c_buffer+D'8'
	MOVLW 0xFF
	MOVWF gbl_14_i2c_buffer+D'6'
	MOVWF gbl_14_i2c_buffer+D'7'
	MOVLW 0x0F
	ANDWF set_Voutma_00012_arg_voutmax, W
	MOVWF set_Voutma_00012_1_a
	SWAPF set_Voutma_00012_1_a, W
	ANDLW 0xF0
	MOVWF set_Voutma_00012_1_a
	MOVF set_Voutma_00012_1_a, W
	IORWF gbl_14_i2c_buffer+D'5', W
	MOVWF gbl_14_i2c_buffer+D'5'
	MOVLW 0x0F
	IORWF set_Voutma_00012_1_a, W
	MOVWF set_Voutma_00012_1_a
	MOVF set_Voutma_00012_1_a, W
	ANDWF gbl_14_i2c_buffer+D'5', W
	MOVWF gbl_14_i2c_buffer+D'5'
	MOVF set_Voutma_00012_arg_voutmax, W
	MOVWF set_Voutma_00012_1_b
	MOVF set_Voutma_00012_arg_voutmax+D'1', W
	MOVWF set_Voutma_00012_1_b+D'1'
	RLF set_Voutma_00012_arg_voutmax+D'1', W
	RRF set_Voutma_00012_1_b+D'1', F
	RRF set_Voutma_00012_1_b, F
	RLF set_Voutma_00012_arg_voutmax+D'1', W
	RRF set_Voutma_00012_1_b+D'1', F
	RRF set_Voutma_00012_1_b, F
	RLF set_Voutma_00012_arg_voutmax+D'1', W
	RRF set_Voutma_00012_1_b+D'1', F
	RRF set_Voutma_00012_1_b, F
	RLF set_Voutma_00012_arg_voutmax+D'1', W
	RRF set_Voutma_00012_1_b+D'1', F
	RRF set_Voutma_00012_1_b, F
	MOVF set_Voutma_00012_1_b, W
	MOVWF set_Voutma_00012_1_a
	MOVF set_Voutma_00012_1_a, W
	IORWF gbl_14_i2c_buffer+D'6', W
	MOVWF gbl_14_i2c_buffer+D'6'
	MOVLW 0xC0
	IORWF set_Voutma_00012_1_a, W
	MOVWF set_Voutma_00012_1_a
	MOVF set_Voutma_00012_1_a, W
	ANDWF gbl_14_i2c_buffer+D'6', W
	MOVWF gbl_14_i2c_buffer+D'6'
	MOVLW 0x43
	MOVWF gbl_14_i2c_buffer+D'8'
	MOVLW 0x09
	MOVWF send_i2c_c_00021_arg_number
	CALL send_i2c_c_00021
	MOVF CompTempVarRet682, W
	MOVWF set_Voutma_00012_1_a
	RETURN
; } set_Voutmax function end

	ORG 0x000002EF
get_i2c_da_00011
; { get_i2c_data ; function begin
	BCF STATUS, RP0
	BCF STATUS, RP1
	CLRF get_i2c_da_00011_1_result
	CLRF get_i2c_da_00011_1_i
	CALL i2c_stop_00000
	CALL i2c_start_00000
	MOVLW 0x02
	BCF STATUS, RP0
	MOVWF i2c_send_00000_arg_data
	CALL i2c_send_00000
	MOVF CompTempVarRet622, W
	MOVWF get_i2c_da_00011_1_result
	MOVLW 0xE1
	MOVWF i2c_send_00000_arg_data
	CALL i2c_send_00000
	MOVF CompTempVarRet622, W
	MOVWF get_i2c_da_00011_1_result
	CALL i2c_readst_0001D
	MOVLW 0x03
	BCF STATUS, RP0
	MOVWF i2c_send_00000_arg_data
	CALL i2c_send_00000
	MOVF CompTempVarRet622, W
	MOVWF get_i2c_da_00011_1_result
	CLRF get_i2c_da_00011_1_i
label53
	MOVLW 0x08
	SUBWF get_i2c_da_00011_1_i, W
	BTFSC STATUS,C
	RETURN
	CALL i2c_rx_00000
	BCF	STATUS,IRP
	MOVLW LOW(gbl_readval+D'0')
	MOVWF FSR
	MOVF get_i2c_da_00011_1_i, W
	ADDWF FSR, F
	MOVF CompTempVarRet623, W
	MOVWF INDF
	MOVLW 0x07
	SUBWF get_i2c_da_00011_1_i, W
	BTFSC STATUS,C
	GOTO	label54
	CALL send_ack_00000
	GOTO	label55
label54
	CALL send_nak_00000
	CALL i2c_stop_00000
	MOVLW 0x04
	MOVWF newouts_00000_arg_num
	MOVLW 0x0A
	MOVWF newouts_00000_arg_wide
	CALL newouts_00000
	CALL bp_00000
label55
	BCF STATUS, RP0
	INCF get_i2c_da_00011_1_i, F
	GOTO	label53
; } get_i2c_data function end

	ORG 0x00000325
check_low__00019
; { check_low_current ; function begin
	MOVLW 0x33
	BCF STATUS, RP0
	BCF STATUS, RP1
	SUBWF gbl_outval+D'4', W
	MOVF gbl_outval+D'5', W
	BTFSC STATUS,C
	GOTO	label56
	BTFSS STATUS,Z
	GOTO	label56
	MOVLW 0x01
	MOVWF CompTempVarRet617
	RETURN
label56
	CLRF CompTempVarRet617
	RETURN
; } check_low_current function end

	ORG 0x00000333
check_Lead_0001A
; { check_Lead_Acid_internalADC ; function begin
	MOVLW 0x31
	BCF STATUS, RP0
	BCF STATUS, RP1
	MOVWF gbl_adcon0
	CLRF check_Lead_0001A_1_i
label57
	MOVLW 0x64
	SUBWF check_Lead_0001A_1_i, W
	BTFSC STATUS,C
	GOTO	label58
	INCF check_Lead_0001A_1_i, F
	GOTO	label57
label58
	MOVLW 0x33
	MOVWF gbl_adcon0
	MOVLW 0x02
	ANDWF gbl_adcon0, W
	MOVWF check_Lead_0001A_1_a
label59
	MOVF check_Lead_0001A_1_a, F
	BTFSC STATUS,Z
	GOTO	label60
	MOVLW 0x02
	ANDWF gbl_adcon0, W
	MOVWF check_Lead_0001A_1_a
	GOTO	label59
label60
	MOVF gbl_adres, W
	MOVWF gbl_battery_volt
	MOVF gbl_battery_volt, W
	SUBLW 0x40
	BTFSC STATUS,C
	GOTO	label61
	CLRF clear_port_00018_arg_n
	CALL clear_port_00018
	GOTO	label62
label61
	CLRF set_portc_00000_arg_n
	CALL set_portc_00000
label62
	MOVF gbl_battery_volt, W
	SUBLW 0x67
	BTFSC STATUS,C
	GOTO	label63
	MOVLW 0x04
	MOVWF CompTempVarRet619
	RETURN
label63
	MOVF gbl_battery_volt, W
	SUBLW 0x64
	BTFSC STATUS,C
	GOTO	label64
	MOVLW 0x01
	MOVWF CompTempVarRet619
	RETURN
label64
	MOVF gbl_battery_volt, W
	SUBLW 0x61
	BTFSC STATUS,C
	GOTO	label66
	DECF gbl_full_SOC, W
	BTFSS STATUS,Z
	GOTO	label66
	INCF gbl_hv_detect_count, F
	MOVF gbl_hv_detect_count, W
	SUBLW 0x64
	BTFSC STATUS,C
	GOTO	label65
	CLRF gbl_hv_detect_count
	MOVLW 0x05
	MOVWF CompTempVarRet619
	RETURN
label65
	CLRF CompTempVarRet619
	RETURN
label66
	MOVF gbl_hv_detect_count, W
	SUBLW 0x00
	BTFSS STATUS,C
	DECF gbl_hv_detect_count, F
	MOVLW 0x60
	SUBWF gbl_battery_volt, W
	BTFSC STATUS,C
	GOTO	label67
	MOVF gbl_full_SOC, W
	XORLW 0x02
	BTFSS STATUS,Z
	GOTO	label67
	MOVLW 0x06
	MOVWF CompTempVarRet619
	RETURN
label67
	MOVLW 0x3A
	SUBWF gbl_battery_volt, W
	BTFSC STATUS,C
	GOTO	label68
	MOVLW 0x03
	MOVWF CompTempVarRet619
	RETURN
label68
	MOVLW 0x49
	SUBWF gbl_battery_volt, W
	BTFSC STATUS,C
	GOTO	label69
	MOVLW 0x02
	MOVWF CompTempVarRet619
	RETURN
label69
	CLRF CompTempVarRet619
	RETURN
; } check_Lead_Acid_internalADC function end

	ORG 0x00000394
Init_00000
; { Init ; function begin
	BCF STATUS, RP0
	BCF STATUS, RP1
	CLRF gbl_full_SOC
	MOVLW 0x8F
	BSF STATUS, RP0
	MOVWF gbl_option_reg
	MOVLW 0xFB
	MOVWF gbl_trisb
	MOVLW 0x02
	BCF STATUS, RP0
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
	NOP
	NOP
	NOP
	NOP
	MOVLW 0x02
	MOVWF set_portb_00000_arg_n
	CALL set_portb_00000
	CLRF gbl_portb
	CLRF gbl_portc
	CLRF gbl_portc_latch
	BSF STATUS, RP0
	CLRF gbl_apfcon
	BCF STATUS, RP0
	CLRF gbl_portb_latch
	MOVLW 0x20
	BSF STATUS, RP0
	MOVWF gbl_osccon
	MOVLW 0x01
	BCF STATUS, RP0
	MOVWF gbl_adcon0
	BSF STATUS, RP0
	BSF STATUS, RP1
	CLRF gbl_ansela
	MOVLW 0x09
	MOVWF gbl_anselb
	MOVLW 0x02
	BCF STATUS, RP0
	BCF STATUS, RP1
	MOVWF set_portb_00000_arg_n
	CALL set_portb_00000
	MOVLW 0x01
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
	MOVLW 0x05
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	MOVLW 0xFF
	BSF STATUS, RP0
	MOVWF gbl_trisa
	MOVLW 0xC9
	MOVWF gbl_trisb
	MOVLW 0xFE
	MOVWF gbl_trisc
	MOVLW 0x03
	BCF STATUS, RP0
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	MOVLW 0x04
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	MOVLW 0x20
	MOVWF gbl_intcon
	BSF STATUS, RP0
	CLRF gbl_pie1
	MOVLW 0x01
	BCF STATUS, RP0
	MOVWF gbl_adcon0
	BSF STATUS, RP0
	CLRF gbl_adcon1
	MOVLW 0x04
	BCF STATUS, RP0
	MOVWF gbl_t2con
	MOVLW 0x02
	BSF STATUS, RP0
	MOVWF gbl_pr2
	MOVLW 0x3B
	BCF STATUS, RP0
	MOVWF gbl_sspcon
	CLRF gbl_battery_volt
	RETURN
; } Init function end

	ORG 0x000003E6
main
; { main ; function begin
	CALL Init_00000
	CLRF main_1_i
	CLRF main_1_i+D'1'
label70
	MOVLW 0x0A
	SUBWF main_1_i, W
	MOVF main_1_i+D'1', W
	BTFSC STATUS,C
	GOTO	label71
	BTFSS STATUS,Z
	GOTO	label71
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	INCF main_1_i, F
	BTFSC STATUS,Z
	INCF main_1_i+D'1', F
	GOTO	label70
label71
	MOVLW 0xB8
	MOVWF gbl_bat_volt_setp
	MOVLW 0x01
	MOVWF gbl_bat_volt_setp+D'1'
	MOVF gbl_bat_volt_setp, W
	MOVWF gbl_voutmax
	MOVF gbl_bat_volt_setp+D'1', W
	MOVWF gbl_voutmax+D'1'
	CLRF main_1_i
	CLRF main_1_i+D'1'
label72
	INCF main_1_i, F
	BTFSC STATUS,Z
	INCF main_1_i+D'1', F
	CLRWDT
	MOVF main_1_i, W
	XORLW 0xF4
	MOVLW 0x01
	BTFSC STATUS,Z
	XORWF main_1_i+D'1', W
	BTFSC STATUS,Z
	CALL get_i2c_da_00011
	CLRF main_1_b
	MOVF main_1_i, W
	XORLW 0x58
	MOVLW 0x02
	BTFSC STATUS,Z
	XORWF main_1_i+D'1', W
	BTFSS STATUS,Z
	GOTO	label73
	MOVF gbl_bat_volt_setp, W
	MOVWF gbl_voutmax
	MOVF gbl_bat_volt_setp+D'1', W
	MOVWF gbl_voutmax+D'1'
	MOVLW 0x03
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	MOVLW 0x04
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	MOVF gbl_voutmax, W
	MOVWF set_Voutma_00012_arg_voutmax
	MOVF gbl_voutmax+D'1', W
	MOVWF set_Voutma_00012_arg_voutmax+D'1'
	CALL set_Voutma_00012
	CLRF main_1_i
	CLRF main_1_i+D'1'
label73
	CALL check_low__00019
	MOVF CompTempVarRet617, W
	MOVWF main_1_b
	MOVLW 0x33
	SUBWF gbl_outval+D'4', W
	MOVF gbl_outval+D'5', W
	BTFSC STATUS,C
	GOTO	label74
	BTFSS STATUS,Z
	GOTO	label74
	MOVLW 0x05
	MOVWF set_portb_00000_arg_n
	CALL set_portb_00000
	GOTO	label75
label74
	MOVLW 0x05
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
label75
	CALL check_Lead_0001A
	MOVF CompTempVarRet619, W
	MOVWF main_1_b
	MOVF main_1_b, F
	BTFSS STATUS,Z
	GOTO	label77
	MOVF gbl_full_SOC, W
	XORLW 0x02
	BTFSC STATUS,Z
	GOTO	label76
	MOVLW 0x02
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
label76
	BSF STATUS, RP0
	BSF gbl_trisc,5
label77
	BCF STATUS, RP0
	DECF main_1_b, W
	BTFSS STATUS,Z
	GOTO	label78
	MOVLW 0x02
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
	MOVLW 0x01
	MOVWF gbl_full_SOC
	MOVLW 0x95
	MOVWF gbl_bat_volt_setp
	MOVLW 0x01
	MOVWF gbl_bat_volt_setp+D'1'
	MOVF gbl_bat_volt_setp, W
	MOVWF gbl_voutmax
	MOVF gbl_bat_volt_setp+D'1', W
	MOVWF gbl_voutmax+D'1'
label78
	MOVF main_1_b, W
	XORLW 0x02
	BTFSS STATUS,Z
	GOTO	label79
	CLRF gbl_full_SOC
	MOVLW 0xB8
	MOVWF gbl_bat_volt_setp
	MOVLW 0x01
	MOVWF gbl_bat_volt_setp+D'1'
	MOVLW 0x02
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
	BSF STATUS, RP0
	BCF gbl_trisc,5
	MOVLW 0x05
	BCF STATUS, RP0
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
label79
	MOVF main_1_b, W
	XORLW 0x03
	BTFSS STATUS,Z
	GOTO	label80
	MOVLW 0x02
	MOVWF set_portb_00000_arg_n
	CALL set_portb_00000
	MOVLW 0xB8
	MOVWF gbl_bat_volt_setp
	MOVLW 0x01
	MOVWF gbl_bat_volt_setp+D'1'
label80
	MOVF main_1_b, W
	XORLW 0x04
	BTFSS STATUS,Z
	GOTO	label84
	CLRF gbl_full_SOC
	MOVLW 0xB8
	MOVWF gbl_bat_volt_setp
	MOVLW 0x01
	MOVWF gbl_bat_volt_setp+D'1'
	MOVLW 0x02
	MOVWF set_portb_00000_arg_n
	CALL set_portb_00000
	MOVLW 0x03
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	MOVLW 0x04
	MOVWF clear_port_00018_arg_n
	CALL clear_port_00018
	CLRF main_1_j
	CLRF main_1_j+D'1'
label81
	MOVLW 0xC3
	SUBWF main_1_j+D'1', W
	BTFSS STATUS,Z
	GOTO	label82
	MOVLW 0x50
	SUBWF main_1_j, W
label82
	BTFSC STATUS,C
	GOTO	label83
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	INCF main_1_j, F
	BTFSC STATUS,Z
	INCF main_1_j+D'1', F
	GOTO	label81
label83
	CLRF main_1_j
	CLRF main_1_j+D'1'
label84
	MOVF main_1_b, W
	XORLW 0x05
	BTFSS STATUS,Z
	GOTO	label85
	MOVLW 0x02
	MOVWF set_portb_00000_arg_n
	CALL set_portb_00000
	MOVLW 0x02
	MOVWF gbl_full_SOC
label85
	MOVF main_1_b, W
	XORLW 0x06
	BTFSS STATUS,Z
	GOTO	label72
	MOVLW 0x02
	MOVWF clear_port_00017_arg_n
	CALL clear_port_00017
	MOVLW 0x01
	MOVWF gbl_full_SOC
	GOTO	label72
; } main function end

	ORG 0x000004C0
_startup
	MOVLW 0x5F
	BCF STATUS, RP0
	BCF STATUS, RP1
	MOVWF gbl_character
	CLRF gbl_hv_detect_count
	CLRF gbl_14_i2c_buffer
	CLRF gbl_14_i2c_buffer+D'1'
	CLRF gbl_14_i2c_buffer+D'2'
	CLRF gbl_14_i2c_buffer+D'3'
	CLRF gbl_14_i2c_buffer+D'4'
	CLRF gbl_14_i2c_buffer+D'5'
	CLRF gbl_14_i2c_buffer+D'6'
	CLRF gbl_14_i2c_buffer+D'7'
	CLRF gbl_14_i2c_buffer+D'8'
	BCF PCLATH,3
	BCF PCLATH,4
	GOTO	main
	ORG 0x000004D1
interrupt
; { interrupt ; function begin
	MOVLW 0xF5
	BCF STATUS, RP0
	BCF STATUS, RP1
	MOVWF gbl_tmr0
	MOVLW 0xFB
	ANDWF gbl_intcon, W
	MOVWF gbl_intcon
	SWAPF Int1BContext+D'2', W
	MOVWF FSR
	SWAPF Int1BContext+D'1', W
	MOVWF PCLATH
	SWAPF Int1BContext, W
	MOVWF STATUS
	SWAPF Int1Context, F
	SWAPF Int1Context, W
	RETFIE
; } interrupt function end

	ORG 0x00002007
	DW 0x136D
	END
