// File: /workspace/github_c_makefile_star2_O0/connycommy[P]atCmdDevice/src/atcmdDev/atCmdDevice.c
// Function: cmIsrRx
void cmIsrRx(cmData_t *obj, const char rxChar){

	/* misra c 15.5*/
	if( (rxChar < (char)CHAR_PRINT_BELOW)  || (rxChar > (char)CHAR_PRINT_ABOVE) ) {
		return ;  /*Char no print*/
	}

	if(1 == obj->rxData.readyAsyncEvent){
		obj->rxData.bufferAsyncEvent[obj->rxData.indexAsyncEvent++] = rxChar;
		if(obj->rxData.indexAsyncEvent > CM_BUFFER_LEN_DEF ){
			obj->rxData.indexAsyncEvent = 0;
		}
		obj->rxData.bufferAsyncEvent[obj->rxData.indexAsyncEvent] = 0;

		if(rxChar == '\n'){
			 obj->rxData.readyAsyncEvent = 0;
			 obj->rxData.asyncEvent=1;
			 obj->rxData.countAsyncEvent++;
		}
	}else{
		obj->rxData.readyAsyncEvent = findStrCharByChar("URC",rxChar);
	}

	/*misra c 15.6,14.4 , 15.6*/
	if( 1 == obj->rxData.ready) {
		return; /* B_uffer reveived*/
	}
	 obj->rxData.buffer[obj->rxData.index] = rxChar; /*misra c 13.3*/
	obj->rxData.index++;

	if (obj->rxData.index >= (obj->rxData.len - (uint8_t)1) ) { /* misra c 10.4*/
		obj->rxData.index = 0; 
	}
	 obj->rxData.buffer[obj->rxData.index] = (char)0;

	#ifdef _USE_STRSTR_FROM_ISR
     //TODO: remove strstr and compare character singly
     if( (strstr((const char*)obj->rxData.buffer, obj->matchResponseFromIsr) != NULL) ||
	 	(strstr((const char*)obj->rxData.buffer, CM_CMD_ERROR_RESPONSE_FROM_ISR ) != NULL) /*exit when error or ok*/
		 ){
        obj->rxData.index = 0;
		obj->rxData.ready = 1; // completed frame
     }
	 if(strstr((const char*)obj->rxData.buffer, CM_CMD_URC_RESPONSE_FROM_ISR ) != NULL){
		 if(rxChar == '\n'){
			obj->rxData.index = 0;
			obj->rxData.ready = 1; // completed frame
			obj->rxData.asyncEvent = 1; // async event frame
		 }
	 }
	 #else
	 IsrStrResponseCmpManually(obj, rxChar);
	 #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movsbl -0x9(%rbp), %eax
cmpl $0xa, %eax
jl 0x15a4
movsbl -0x9(%rbp), %eax
cmpl $0x7a, %eax
jle 0x15a9
jmp 0x16dc
movq -0x8(%rbp), %rax
movb 0x20(%rax), %al
movzbl %al, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x163b
movb -0x9(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rsi
movw 0x32(%rsi), %cx
movw %cx, %di
addw $0x1, %di
movw %di, 0x32(%rsi)
movzwl %cx, %ecx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movw 0x32(%rax), %ax
movzwl %ax, %eax
cmpl $0x400, %eax            # imm = 0x400
jle 0x15fc
movq -0x8(%rbp), %rax
movw $0x0, 0x32(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rcx
movw 0x32(%rcx), %cx
movzwl %cx, %ecx
movb $0x0, (%rax,%rcx)
movsbl -0x9(%rbp), %eax
cmpl $0xa, %eax
jne 0x1639
movq -0x8(%rbp), %rax
movb $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x22(%rax)
movq -0x8(%rbp), %rax
movb 0x23(%rax), %cl
addb $0x1, %cl
movb %cl, 0x23(%rax)
jmp 0x1654
leaq 0x89c2(%rip), %rdi      # 0xa004
movsbl -0x9(%rbp), %esi
callq 0x16f0
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x20(%rax)
movq -0x8(%rbp), %rax
movb 0x21(%rax), %al
movzbl %al, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x1669
jmp 0x16dc
movb -0x9(%rbp), %dl
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movw 0x30(%rcx), %cx
movzwl %cx, %ecx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movw 0x30(%rax), %cx
addw $0x1, %cx
movw %cx, 0x30(%rax)
movq -0x8(%rbp), %rax
movw 0x30(%rax), %ax
movzwl %ax, %eax
movq -0x8(%rbp), %rcx
movq 0x28(%rcx), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jb 0x16b8
movq -0x8(%rbp), %rax
movw $0x0, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x8(%rbp), %rcx
movw 0x30(%rcx), %cx
movzwl %cx, %ecx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movsbl -0x9(%rbp), %esi
callq 0x1780
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)