
_Timer1Interrupt:
	PUSH	DSWPAG
	PUSH	50
	PUSH	RCOUNT
	PUSH	W0
	MOV	#2, W0
	REPEAT	#12
	PUSH	[W0++]

;GSM_EasyPIC_Fusion_v7.c,90 :: 		void Timer1Interrupt() iv IVT_ADDR_T1INTERRUPT {
;GSM_EasyPIC_Fusion_v7.c,95 :: 		gsm1msPing();
	CALL	_gsm1msPing
;GSM_EasyPIC_Fusion_v7.c,96 :: 		if (wrdRG7Tmr < 65535) {wrdRG7Tmr++;}
	MOV	_wrdRG7Tmr, W1
	MOV	#65535, W0
	CP	W1, W0
	BRA LTU	L__Timer1Interrupt44
	GOTO	L_Timer1Interrupt0
L__Timer1Interrupt44:
	MOV	#1, W1
	MOV	#lo_addr(_wrdRG7Tmr), W0
	ADD	W1, [W0], [W0]
L_Timer1Interrupt0:
;GSM_EasyPIC_Fusion_v7.c,97 :: 		T1IF_bit         = 0;
	BCLR	T1IF_bit, BitPos(T1IF_bit+0)
;GSM_EasyPIC_Fusion_v7.c,98 :: 		}
L_end_Timer1Interrupt:
	MOV	#26, W0
	REPEAT	#12
	POP	[W0--]
	POP	W0
	POP	RCOUNT
	POP	50
	POP	DSWPAG
	RETFIE
; end of _Timer1Interrupt

_USB1Interrupt:
	PUSH	DSWPAG
	PUSH	50
	PUSH	RCOUNT
	PUSH	W0
	MOV	#2, W0
	REPEAT	#12
	PUSH	[W0++]

;GSM_EasyPIC_Fusion_v7.c,101 :: 		void USB1Interrupt() iv IVT_ADDR_USB1INTERRUPT {
;GSM_EasyPIC_Fusion_v7.c,102 :: 		USB_Interrupt_Proc();
	CALL	_USB_Interrupt_Proc
;GSM_EasyPIC_Fusion_v7.c,103 :: 		}
L_end_USB1Interrupt:
	MOV	#26, W0
	REPEAT	#12
	POP	[W0--]
	POP	W0
	POP	RCOUNT
	POP	50
	POP	DSWPAG
	RETFIE
; end of _USB1Interrupt

_Timer1Init:

;GSM_EasyPIC_Fusion_v7.c,106 :: 		void Timer1Init(){
;GSM_EasyPIC_Fusion_v7.c,108 :: 		T1CON                 = 0x8010;
	MOV	#32784, W0
	MOV	WREG, T1CON
;GSM_EasyPIC_Fusion_v7.c,109 :: 		T1IE_bit         = 1;
	BSET	T1IE_bit, BitPos(T1IE_bit+0)
;GSM_EasyPIC_Fusion_v7.c,110 :: 		T1IF_bit         = 0;
	BCLR	T1IF_bit, BitPos(T1IF_bit+0)
;GSM_EasyPIC_Fusion_v7.c,111 :: 		IPC0                 = IPC0 | 0x1000;
	MOV	#4096, W1
	MOV	#lo_addr(IPC0), W0
	IOR	W1, [W0], [W0]
;GSM_EasyPIC_Fusion_v7.c,112 :: 		PR1                 = 8750;
	MOV	#8750, W0
	MOV	WREG, PR1
;GSM_EasyPIC_Fusion_v7.c,113 :: 		}
L_end_Timer1Init:
	RETURN
; end of _Timer1Init

_setup:

;GSM_EasyPIC_Fusion_v7.c,115 :: 		void setup() {
;GSM_EasyPIC_Fusion_v7.c,117 :: 		PLLFBD = 70;             // PLL multiplier M=70
	PUSH	W10
	PUSH	W11
	PUSH	W12
	MOV	#70, W0
	MOV	WREG, PLLFBD
;GSM_EasyPIC_Fusion_v7.c,118 :: 		CLKDIV = 0x0000;         // PLL prescaler N1=2, PLL postscaler N2=2
	CLR	CLKDIV
;GSM_EasyPIC_Fusion_v7.c,121 :: 		ACLKCON3 = 0xB4C1;       // Use primary oscillator (8MHz), APLL prescaler N1=2, APLL postscaler N2=2
	MOV	#46273, W0
	MOV	WREG, ACLKCON3
;GSM_EasyPIC_Fusion_v7.c,122 :: 		ACLKDIV3 = 0x0007;       // APLL multiplier M=24
	MOV	#7, W0
	MOV	WREG, ACLKDIV3
;GSM_EasyPIC_Fusion_v7.c,124 :: 		ANSELA = 0x00;
	CLR	ANSELA
;GSM_EasyPIC_Fusion_v7.c,125 :: 		ANSELB = 0x00;
	CLR	ANSELB
;GSM_EasyPIC_Fusion_v7.c,126 :: 		ANSELC = 0x00;
	CLR	ANSELC
;GSM_EasyPIC_Fusion_v7.c,127 :: 		ANSELD = 0x00;
	CLR	ANSELD
;GSM_EasyPIC_Fusion_v7.c,128 :: 		ANSELE = 0x00;
	CLR	ANSELE
;GSM_EasyPIC_Fusion_v7.c,129 :: 		ANSELG = 0x00;
	CLR	ANSELG
;GSM_EasyPIC_Fusion_v7.c,131 :: 		TRISD = 0x0000; //PortD all outputs
	CLR	TRISD
;GSM_EasyPIC_Fusion_v7.c,132 :: 		LATD  = 0x0000; //PortD all off by default
	CLR	LATD
;GSM_EasyPIC_Fusion_v7.c,133 :: 		GSM_Pwr_Key_Dir = 0;
	BCLR	TRISC1_bit, BitPos(TRISC1_bit+0)
;GSM_EasyPIC_Fusion_v7.c,134 :: 		GSM_Stat_Dir = 1;
	BSET	TRISB8_bit, BitPos(TRISB8_bit+0)
;GSM_EasyPIC_Fusion_v7.c,135 :: 		CNPUG7_bit = 1;     //RG7 Weak Pull-Up Enabled
	BSET	CNPUG7_bit, BitPos(CNPUG7_bit+0)
;GSM_EasyPIC_Fusion_v7.c,136 :: 		PPS_Mapping(100, _INPUT,  _U1RX); // Sets pin RP100 (RF4) to be an input,  and maps U1RX to it
	MOV.B	#34, W12
	MOV.B	#1, W11
	MOV.B	#100, W10
	CALL	_PPS_Mapping
;GSM_EasyPIC_Fusion_v7.c,137 :: 		PPS_Mapping(101, _OUTPUT, _U1TX); // Sets pin RP101 (RF5) to be an output, and maps U1TX to it
	MOV.B	#1, W12
	CLR	W11
	MOV.B	#101, W10
	CALL	_PPS_Mapping
;GSM_EasyPIC_Fusion_v7.c,138 :: 		Timer1Init();
	CALL	_Timer1Init
;GSM_EasyPIC_Fusion_v7.c,139 :: 		}
L_end_setup:
	POP	W12
	POP	W11
	POP	W10
	RETURN
; end of _setup

_startup:

;GSM_EasyPIC_Fusion_v7.c,141 :: 		void startup() {
;GSM_EasyPIC_Fusion_v7.c,142 :: 		bitRTCC_Set = 0;
	PUSH	W10
	PUSH	W11
	MOV	#lo_addr(_bitRTCC_Set), W0
	BCLR	[W0], BitPos(_bitRTCC_Set+0)
;GSM_EasyPIC_Fusion_v7.c,143 :: 		UART1_Init(9600); // For GSM Module
	MOV	#9600, W10
	MOV	#0, W11
	CALL	_UART1_Init
;GSM_EasyPIC_Fusion_v7.c,144 :: 		gsmInit();
	CALL	_gsmInit
;GSM_EasyPIC_Fusion_v7.c,145 :: 		gsm_MS_Init();
	CALL	_gsm_MS_Init
;GSM_EasyPIC_Fusion_v7.c,146 :: 		gsm_Msg_Init(); // Requires GSM_Msg module
	CALL	_gsm_Msg_Init
;GSM_EasyPIC_Fusion_v7.c,148 :: 		HID_Enable(&USBin, &USBout);
	MOV	#lo_addr(_USBout), W11
	MOV	#lo_addr(_USBin), W10
	CALL	_HID_Enable
;GSM_EasyPIC_Fusion_v7.c,150 :: 		}
L_end_startup:
	POP	W11
	POP	W10
	RETURN
; end of _startup

_UIntToBin:

;GSM_EasyPIC_Fusion_v7.c,152 :: 		void UIntToBin(char input, char *output) { // Convert an unsigned integer to a binary string
;GSM_EasyPIC_Fusion_v7.c,154 :: 		for (mask = 0b1000000000000000; mask != 0; mask = mask >> 1) {
; mask start address is: 2 (W1)
	MOV	#32768, W1
; mask end address is: 2 (W1)
L_UIntToBin1:
; mask start address is: 2 (W1)
	CP	W1, #0
	BRA NZ	L__UIntToBin50
	GOTO	L_UIntToBin2
L__UIntToBin50:
;GSM_EasyPIC_Fusion_v7.c,155 :: 		if (input & mask) *output = '1'; else *output = '0';
	ZE	W10, W0
	AND	W0, W1, W0
	BRA NZ	L__UIntToBin51
	GOTO	L_UIntToBin4
L__UIntToBin51:
	MOV.B	#49, W0
	MOV.B	W0, [W11]
	GOTO	L_UIntToBin5
L_UIntToBin4:
	MOV.B	#48, W0
	MOV.B	W0, [W11]
L_UIntToBin5:
;GSM_EasyPIC_Fusion_v7.c,156 :: 		output++;
	ADD	W11, #1, W0
	MOV	W0, W11
;GSM_EasyPIC_Fusion_v7.c,154 :: 		for (mask = 0b1000000000000000; mask != 0; mask = mask >> 1) {
	LSR	W1, #1, W0
	MOV	W0, W1
;GSM_EasyPIC_Fusion_v7.c,157 :: 		}
; mask end address is: 2 (W1)
	GOTO	L_UIntToBin1
L_UIntToBin2:
;GSM_EasyPIC_Fusion_v7.c,158 :: 		*output = 0; // Mark the end of the string
	CLR	W0
	MOV.B	W0, [W11]
;GSM_EasyPIC_Fusion_v7.c,159 :: 		}
L_end_UIntToBin:
	RETURN
; end of _UIntToBin

_generateStatusReport:

;GSM_EasyPIC_Fusion_v7.c,161 :: 		void generateStatusReport(char *dest) { // Generate a string indicating the
;GSM_EasyPIC_Fusion_v7.c,163 :: 		strcpy(dest, "PORTA:");
	PUSH	W10
	PUSH	W11
	MOV	#lo_addr(?lstr1_GSM_EasyPIC_Fusion_v7), W11
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,164 :: 		dest += 6;
	ADD	W10, #6, W0
	MOV	W0, W10
;GSM_EasyPIC_Fusion_v7.c,165 :: 		UIntToBin(PORTA, dest);
	PUSH	W10
	MOV	W0, W11
	MOV	PORTA, W10
	CALL	_UIntToBin
	POP	W10
;GSM_EasyPIC_Fusion_v7.c,166 :: 		dest += 16;
	ADD	W10, #16, W1
	MOV	W1, W10
;GSM_EasyPIC_Fusion_v7.c,167 :: 		*dest++ = ',';
	MOV.B	#44, W0
	MOV.B	W0, [W1]
	ADD	W10, #1, W0
	MOV	W0, W10
;GSM_EasyPIC_Fusion_v7.c,168 :: 		strcpy(dest, "LATD:");
	MOV	#lo_addr(?lstr2_GSM_EasyPIC_Fusion_v7), W11
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,169 :: 		dest += 5;
	ADD	W10, #5, W0
	MOV	W0, W10
;GSM_EasyPIC_Fusion_v7.c,170 :: 		UIntToBin(LATD, dest);
	MOV	W0, W11
	MOV	LATD, W10
	CALL	_UIntToBin
;GSM_EasyPIC_Fusion_v7.c,171 :: 		}
L_end_generateStatusReport:
	POP	W11
	POP	W10
	RETURN
; end of _generateStatusReport

_msgSend:

;GSM_EasyPIC_Fusion_v7.c,173 :: 		void msgSend() {
;GSM_EasyPIC_Fusion_v7.c,175 :: 		strcpy(&USBout, "Sending message to ");
	PUSH	W10
	PUSH	W11
	PUSH	W12
	MOV	#lo_addr(?lstr3_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,176 :: 		strcat(&USBout, &strDestID);
	MOV	#lo_addr(_strDestID), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcat
;GSM_EasyPIC_Fusion_v7.c,177 :: 		strcat(&USBout, ":\r\n");
	MOV	#lo_addr(?lstr4_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcat
;GSM_EasyPIC_Fusion_v7.c,178 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,179 :: 		strncpyExNewLine(&USBout, &strMsgSendTxt, 64);
	MOV.B	#64, W12
	MOV	#lo_addr(_strMsgSendTxt), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strncpyExNewLine
;GSM_EasyPIC_Fusion_v7.c,180 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,182 :: 		if (strDestID[0] != 0) {
	MOV	#lo_addr(_strDestID), W0
	MOV.B	[W0], W0
	CP.B	W0, #0
	BRA NZ	L__msgSend54
	GOTO	L_msgSend6
L__msgSend54:
;GSM_EasyPIC_Fusion_v7.c,183 :: 		if (gsmMsgSendPending()) {gsmMsgSendCancel();} // Cancel any message waiting to be sent
	CALL	_gsmMsgSendPending
	CP0.B	W0
	BRA NZ	L__msgSend55
	GOTO	L_msgSend7
L__msgSend55:
	CALL	_gsmMsgSendCancel
L_msgSend7:
;GSM_EasyPIC_Fusion_v7.c,184 :: 		gsmMsgSend(&strMsgSendTxt, &strDestID); // Send the message
	MOV	#lo_addr(_strDestID), W11
	MOV	#lo_addr(_strMsgSendTxt), W10
	CALL	_gsmMsgSend
;GSM_EasyPIC_Fusion_v7.c,185 :: 		}
L_msgSend6:
;GSM_EasyPIC_Fusion_v7.c,186 :: 		}
L_end_msgSend:
	POP	W12
	POP	W11
	POP	W10
	RETURN
; end of _msgSend

_gsmMissedCall:

;GSM_EasyPIC_Fusion_v7.c,188 :: 		void gsmMissedCall(char *OriginatorID) {
;GSM_EasyPIC_Fusion_v7.c,189 :: 		LATD0_bit = !LATD0_bit; // Toggle PortD.0
	PUSH	W10
	PUSH	W11
	BTG	LATD0_bit, BitPos(LATD0_bit+0)
;GSM_EasyPIC_Fusion_v7.c,190 :: 		if (strDestID[0] == 0) { // If destination ID has not yet been set
	MOV	#lo_addr(_strDestID), W0
	MOV.B	[W0], W0
	CP.B	W0, #0
	BRA Z	L__gsmMissedCall57
	GOTO	L_gsmMissedCall8
L__gsmMissedCall57:
;GSM_EasyPIC_Fusion_v7.c,192 :: 		strcpy(&strDestID, OriginatorID);
	MOV	W10, W11
	MOV	#lo_addr(_strDestID), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,193 :: 		}
L_gsmMissedCall8:
;GSM_EasyPIC_Fusion_v7.c,194 :: 		}
L_end_gsmMissedCall:
	POP	W11
	POP	W10
	RETURN
; end of _gsmMissedCall

_gsmMsgRcvd:

;GSM_EasyPIC_Fusion_v7.c,196 :: 		void gsmMsgRcvd(char *MessageText, char *OriginatorID) {
;GSM_EasyPIC_Fusion_v7.c,197 :: 		if (strDestID[0] == 0) { // If destination ID has not yet been set
	PUSH	W10
	PUSH	W11
	PUSH	W12
	MOV	#lo_addr(_strDestID), W0
	MOV.B	[W0], W0
	CP.B	W0, #0
	BRA Z	L__gsmMsgRcvd59
	GOTO	L_gsmMsgRcvd9
L__gsmMsgRcvd59:
;GSM_EasyPIC_Fusion_v7.c,199 :: 		strcpy(&strDestID, OriginatorID);
	PUSH	W10
	MOV	#lo_addr(_strDestID), W10
	CALL	_strcpy
	POP	W10
;GSM_EasyPIC_Fusion_v7.c,200 :: 		}
L_gsmMsgRcvd9:
;GSM_EasyPIC_Fusion_v7.c,201 :: 		if (gsmMsgJustArrived() == 1) {
	CALL	_gsmMsgJustArrived
	CP.B	W0, #1
	BRA Z	L__gsmMsgRcvd60
	GOTO	L_gsmMsgRcvd10
L__gsmMsgRcvd60:
;GSM_EasyPIC_Fusion_v7.c,204 :: 		if (!bitRTCC_Set) {
	MOV	#lo_addr(_bitRTCC_Set), W0
	BTSC	[W0], BitPos(_bitRTCC_Set+0)
	GOTO	L_gsmMsgRcvd11
;GSM_EasyPIC_Fusion_v7.c,205 :: 		memcpy(&dtmRTCC, &dtmGsmEvent, 6);
	PUSH	W10
	MOV	#6, W12
	MOV	#lo_addr(_dtmGsmEvent), W11
	MOV	#lo_addr(_dtmRTCC), W10
	CALL	_memcpy
	POP	W10
;GSM_EasyPIC_Fusion_v7.c,207 :: 		gsmDateTimeWrite();
	CALL	_gsmDateTimeWrite
;GSM_EasyPIC_Fusion_v7.c,208 :: 		}
L_gsmMsgRcvd11:
;GSM_EasyPIC_Fusion_v7.c,209 :: 		}
L_gsmMsgRcvd10:
;GSM_EasyPIC_Fusion_v7.c,210 :: 		lcase(MessageText); // Convert the entire message to lower case
	PUSH	W10
	CALL	_lcase
	POP	W10
;GSM_EasyPIC_Fusion_v7.c,212 :: 		if (*(MessageText + 1) == 'n') { // Looking for "on"
	ADD	W10, #1, W0
	MOV.B	[W0], W1
	MOV.B	#110, W0
	CP.B	W1, W0
	BRA Z	L__gsmMsgRcvd61
	GOTO	L_gsmMsgRcvd12
L__gsmMsgRcvd61:
;GSM_EasyPIC_Fusion_v7.c,213 :: 		LATD = 0xFFFF;
	MOV	#65535, W0
	MOV	WREG, LATD
;GSM_EasyPIC_Fusion_v7.c,214 :: 		} else if (*(MessageText + 1) == 'f') { // Looking for "off"
	GOTO	L_gsmMsgRcvd13
L_gsmMsgRcvd12:
	ADD	W10, #1, W0
	MOV.B	[W0], W1
	MOV.B	#102, W0
	CP.B	W1, W0
	BRA Z	L__gsmMsgRcvd62
	GOTO	L_gsmMsgRcvd14
L__gsmMsgRcvd62:
;GSM_EasyPIC_Fusion_v7.c,215 :: 		LATD = 0x0000;
	CLR	LATD
;GSM_EasyPIC_Fusion_v7.c,216 :: 		} else if (memcmp(MessageText, "stat", 4) == 0) { //Status report
	GOTO	L_gsmMsgRcvd15
L_gsmMsgRcvd14:
	PUSH	W10
	MOV	#4, W12
	MOV	#lo_addr(?lstr5_GSM_EasyPIC_Fusion_v7), W11
	CALL	_memcmp
	POP	W10
	CP	W0, #0
	BRA Z	L__gsmMsgRcvd63
	GOTO	L_gsmMsgRcvd16
L__gsmMsgRcvd63:
;GSM_EasyPIC_Fusion_v7.c,217 :: 		generateStatusReport(&strMsgSendTxt);
	MOV	#lo_addr(_strMsgSendTxt), W10
	CALL	_generateStatusReport
;GSM_EasyPIC_Fusion_v7.c,218 :: 		msgSend();
	CALL	_msgSend
;GSM_EasyPIC_Fusion_v7.c,219 :: 		} else if (memcmp(MessageText, "please call ", 12) == 0) { // "Please Call Me"
	GOTO	L_gsmMsgRcvd17
L_gsmMsgRcvd16:
	PUSH	W10
	MOV	#12, W12
	MOV	#lo_addr(?lstr6_GSM_EasyPIC_Fusion_v7), W11
	CALL	_memcmp
	POP	W10
	CP	W0, #0
	BRA Z	L__gsmMsgRcvd64
	GOTO	L_gsmMsgRcvd18
L__gsmMsgRcvd64:
;GSM_EasyPIC_Fusion_v7.c,220 :: 		LATD1_bit = !LATD1_bit;
	BTG	LATD1_bit, BitPos(LATD1_bit+0)
;GSM_EasyPIC_Fusion_v7.c,221 :: 		generateStatusReport(&strMsgSendTxt);
	MOV	#lo_addr(_strMsgSendTxt), W10
	CALL	_generateStatusReport
;GSM_EasyPIC_Fusion_v7.c,222 :: 		msgSend();
	CALL	_msgSend
;GSM_EasyPIC_Fusion_v7.c,223 :: 		} else if (memcmp(MessageText, "test", 4) == 0) { //Test
	GOTO	L_gsmMsgRcvd19
L_gsmMsgRcvd18:
	MOV	#4, W12
	MOV	#lo_addr(?lstr7_GSM_EasyPIC_Fusion_v7), W11
	CALL	_memcmp
	CP	W0, #0
	BRA Z	L__gsmMsgRcvd65
	GOTO	L_gsmMsgRcvd20
L__gsmMsgRcvd65:
;GSM_EasyPIC_Fusion_v7.c,224 :: 		strcpy(&strMsgSendTxt, "GSM Library all ok!");
	MOV	#lo_addr(?lstr8_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_strMsgSendTxt), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,225 :: 		msgSend();
	CALL	_msgSend
;GSM_EasyPIC_Fusion_v7.c,226 :: 		}
L_gsmMsgRcvd20:
L_gsmMsgRcvd19:
L_gsmMsgRcvd17:
L_gsmMsgRcvd15:
L_gsmMsgRcvd13:
;GSM_EasyPIC_Fusion_v7.c,227 :: 		}
L_end_gsmMsgRcvd:
	POP	W12
	POP	W11
	POP	W10
	RETURN
; end of _gsmMsgRcvd

_gsmEvent:

;GSM_EasyPIC_Fusion_v7.c,229 :: 		void gsmEvent(char GsmEventType) {
;GSM_EasyPIC_Fusion_v7.c,231 :: 		switch (GsmEventType) {
	PUSH	W10
	PUSH	W11
	PUSH	W12
	GOTO	L_gsmEvent21
;GSM_EasyPIC_Fusion_v7.c,232 :: 		case gsmevntPIN_Request:
L_gsmEvent23:
;GSM_EasyPIC_Fusion_v7.c,235 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,236 :: 		case gsmevntPIN_Fail:
L_gsmEvent24:
;GSM_EasyPIC_Fusion_v7.c,238 :: 		strcpy(&USBout, "PIN entry failed\r\n");
	MOV	#lo_addr(?lstr9_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,239 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,241 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,242 :: 		case gsmevntMissedCall:
L_gsmEvent25:
;GSM_EasyPIC_Fusion_v7.c,243 :: 		gsmMissedCall(pstrGsmEventOriginatorID);
	MOV	_pstrGsmEventOriginatorID, W10
	CALL	_gsmMissedCall
;GSM_EasyPIC_Fusion_v7.c,244 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,245 :: 		case gsmevntMsgRcvd:
L_gsmEvent26:
;GSM_EasyPIC_Fusion_v7.c,246 :: 		gsmMsgRcvd(pstrGsmEventData, pstrGsmEventOriginatorID);
	MOV	_pstrGsmEventOriginatorID, W11
	MOV	_pstrGsmEventData, W10
	CALL	_gsmMsgRcvd
;GSM_EasyPIC_Fusion_v7.c,247 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,248 :: 		case gsmevntMsgSent:
L_gsmEvent27:
;GSM_EasyPIC_Fusion_v7.c,250 :: 		strcpy(&USBout, "Message sent\r\n");
	MOV	#lo_addr(?lstr10_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,251 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,253 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,254 :: 		case gsmevntMsgDiscarded:
L_gsmEvent28:
;GSM_EasyPIC_Fusion_v7.c,255 :: 		case gsmevntMsgSendFailed:
L_gsmEvent29:
;GSM_EasyPIC_Fusion_v7.c,257 :: 		strcpy(&USBout, "Message send failed\r\n");
	MOV	#lo_addr(?lstr11_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,258 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,260 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,261 :: 		case gsmevntDateTimeRead:
L_gsmEvent30:
;GSM_EasyPIC_Fusion_v7.c,262 :: 		if (dtmGsmEvent.Year > 10) { // If the GSM modules date/time is valid
	MOV	#lo_addr(_dtmGsmEvent), W0
	MOV.B	[W0], W0
	CP.B	W0, #10
	BRA GTU	L__gsmEvent67
	GOTO	L_gsmEvent31
L__gsmEvent67:
;GSM_EasyPIC_Fusion_v7.c,266 :: 		strcpy(&USBout, "Date/Time: ");
	MOV	#lo_addr(?lstr12_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,267 :: 		RTCC_GenerateString(&dtmGsmEvent, &USBout + 11);
	MOV	#lo_addr(_USBout+11), W11
	MOV	#lo_addr(_dtmGsmEvent), W10
	CALL	_RTCC_GenerateString
;GSM_EasyPIC_Fusion_v7.c,268 :: 		strcat(&USBout, "\r\n");
	MOV	#lo_addr(?lstr13_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcat
;GSM_EasyPIC_Fusion_v7.c,269 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,271 :: 		memcpy(&dtmRTCC, &dtmGsmEvent, 6);
	MOV	#6, W12
	MOV	#lo_addr(_dtmGsmEvent), W11
	MOV	#lo_addr(_dtmRTCC), W10
	CALL	_memcpy
;GSM_EasyPIC_Fusion_v7.c,272 :: 		bitRTCC_Set = 1;
	MOV	#lo_addr(_bitRTCC_Set), W0
	BSET	[W0], BitPos(_bitRTCC_Set+0)
;GSM_EasyPIC_Fusion_v7.c,273 :: 		} else {
	GOTO	L_gsmEvent32
L_gsmEvent31:
;GSM_EasyPIC_Fusion_v7.c,275 :: 		strcpy(&USBout, "Date/Time not yet set.\r\n");
	MOV	#lo_addr(?lstr14_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,276 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,278 :: 		}
L_gsmEvent32:
;GSM_EasyPIC_Fusion_v7.c,279 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,280 :: 		case gsmevntDateTimeWrite:
L_gsmEvent33:
;GSM_EasyPIC_Fusion_v7.c,282 :: 		memcpy(&dtmGsmEvent, &dtmRTCC, 6);
	MOV	#6, W12
	MOV	#lo_addr(_dtmRTCC), W11
	MOV	#lo_addr(_dtmGsmEvent), W10
	CALL	_memcpy
;GSM_EasyPIC_Fusion_v7.c,283 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,284 :: 		case gsmevntIMEI_Read:
L_gsmEvent34:
;GSM_EasyPIC_Fusion_v7.c,286 :: 		strcpy(&USBout, "IMEI: ");
	MOV	#lo_addr(?lstr15_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,287 :: 		strcat(&USBout, pstrGsmEventData);
	MOV	_pstrGsmEventData, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcat
;GSM_EasyPIC_Fusion_v7.c,288 :: 		strcat(&USBout, "\r\n");
	MOV	#lo_addr(?lstr16_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_USBout), W10
	CALL	_strcat
;GSM_EasyPIC_Fusion_v7.c,289 :: 		HID_Write(&USBout, 64);
	MOV.B	#64, W11
	MOV	#lo_addr(_USBout), W10
	CALL	_HID_Write
;GSM_EasyPIC_Fusion_v7.c,291 :: 		break;
	GOTO	L_gsmEvent22
;GSM_EasyPIC_Fusion_v7.c,292 :: 		}
L_gsmEvent21:
	CP.B	W10, #30
	BRA NZ	L__gsmEvent68
	GOTO	L_gsmEvent23
L__gsmEvent68:
	CP.B	W10, #31
	BRA NZ	L__gsmEvent69
	GOTO	L_gsmEvent24
L__gsmEvent69:
	MOV.B	#70, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent70
	GOTO	L_gsmEvent25
L__gsmEvent70:
	MOV.B	#80, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent71
	GOTO	L_gsmEvent26
L__gsmEvent71:
	MOV.B	#83, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent72
	GOTO	L_gsmEvent27
L__gsmEvent72:
	MOV.B	#82, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent73
	GOTO	L_gsmEvent28
L__gsmEvent73:
	MOV.B	#84, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent74
	GOTO	L_gsmEvent29
L__gsmEvent74:
	MOV.B	#150, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent75
	GOTO	L_gsmEvent30
L__gsmEvent75:
	MOV.B	#151, W0
	CP.B	W10, W0
	BRA NZ	L__gsmEvent76
	GOTO	L_gsmEvent33
L__gsmEvent76:
	CP.B	W10, #20
	BRA NZ	L__gsmEvent77
	GOTO	L_gsmEvent34
L__gsmEvent77:
L_gsmEvent22:
;GSM_EasyPIC_Fusion_v7.c,293 :: 		}
L_end_gsmEvent:
	POP	W12
	POP	W11
	POP	W10
	RETURN
; end of _gsmEvent

_main:
	MOV	#2048, W15
	MOV	#6142, W0
	MOV	WREG, 32
	MOV	#1, W0
	MOV	WREG, 50
	MOV	#4, W0
	IOR	68

;GSM_EasyPIC_Fusion_v7.c,295 :: 		void main() {
;GSM_EasyPIC_Fusion_v7.c,296 :: 		setup();
	PUSH	W10
	PUSH	W11
	CALL	_setup
;GSM_EasyPIC_Fusion_v7.c,297 :: 		startup();
	CALL	_startup
;GSM_EasyPIC_Fusion_v7.c,298 :: 		gsmDateTimeRead();
	CALL	_gsmDateTimeRead
;GSM_EasyPIC_Fusion_v7.c,299 :: 		while (1) {
L_main35:
;GSM_EasyPIC_Fusion_v7.c,300 :: 		gsmPoll(); // Keep the GSM library running
	CALL	_gsmPoll
;GSM_EasyPIC_Fusion_v7.c,303 :: 		if ((RG7_bit == 0) && (wrdRG7Tmr > 10000)) {
	BTSC	RG7_bit, BitPos(RG7_bit+0)
	GOTO	L__main42
	MOV	_wrdRG7Tmr, W1
	MOV	#10000, W0
	CP	W1, W0
	BRA GTU	L__main79
	GOTO	L__main41
L__main79:
L__main40:
;GSM_EasyPIC_Fusion_v7.c,304 :: 		strcpy(&strMsgSendTxt, "GSM Lib: RG7 pulled low.");
	MOV	#lo_addr(?lstr17_GSM_EasyPIC_Fusion_v7), W11
	MOV	#lo_addr(_strMsgSendTxt), W10
	CALL	_strcpy
;GSM_EasyPIC_Fusion_v7.c,305 :: 		msgSend();
	CALL	_msgSend
;GSM_EasyPIC_Fusion_v7.c,306 :: 		wrdRG7Tmr = 0;
	CLR	W0
	MOV	W0, _wrdRG7Tmr
;GSM_EasyPIC_Fusion_v7.c,303 :: 		if ((RG7_bit == 0) && (wrdRG7Tmr > 10000)) {
L__main42:
L__main41:
;GSM_EasyPIC_Fusion_v7.c,308 :: 		} // (while)
	GOTO	L_main35
;GSM_EasyPIC_Fusion_v7.c,309 :: 		} // (void)
L_end_main:
	POP	W11
	POP	W10
L__main_end_loop:
	BRA	L__main_end_loop
; end of _main
