// File: /workspace/github_c_makefile_star2_O1/Carton32[P]quectel-CM/atchannel.c
// Function: readerLoop
static void *readerLoop(void *arg)
{
    (void)arg;

    for (;;) {
        const char * line;

        line = readline();

        if (line == NULL) {
            break;
        }

        if(isSMSUnsolicited(line)) {
            char *line1;
            const char *line2;

            // The scope of string returned by 'readline()' is valid only
            // till next call to 'readline()' hence making a copy of line
            // before calling readline again.
            line1 = strdup(line);
            line2 = readline();

            if (line2 == NULL) {
                break;
            }

            if (s_unsolHandler != NULL) {
                s_unsolHandler (line1, line2);
            }
            free(line1);
        } else {
            processLine(line);
        }
    }

    onReaderClosed();

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xf098(%rip), %rbp      # 0x29d50
leaq 0xff91(%rip), %rbx      # 0x2ac50
leaq 0xffe2(%rip), %r12      # 0x2aca8
callq 0x1b8f8
testq %rax, %rax
je 0x1ae45
movq %rax, %r15
movb (%rax), %al
movq %r15, %r14
incq %r14
xorl %ecx, %ecx
movq (%rbp,%rcx,8), %rdx
testb %al, %al
je 0x1ad0a
movq %r14, %rsi
movl %eax, %edi
movb (%rdx), %r8b
testb %r8b, %r8b
je 0x1ad0a
cmpb %r8b, %dil
jne 0x1ad13
incq %rdx
movb (%rsi), %dil
incq %rsi
testb %dil, %dil
jne 0x1acef
cmpb $0x0, (%rdx)
je 0x1ae4f
incq %rcx
cmpq $0x4, %rcx
jne 0x1ace1
movq %rbx, %rdi
callq 0x5560
movq 0x11245(%rip), %r13     # 0x2bf70
testq %r13, %r13
je 0x1ae87
cmpq $0x0, 0x11244(%rip)     # 0x2bf80
je 0x1ad55
movq %r15, %rdi
leaq 0x6dfd(%rip), %rsi      # 0x21b45
callq 0x52a0
testl %eax, %eax
je 0x1aec3
movb (%r15), %bl
movsbq %bl, %r9
xorl %eax, %eax
leaq 0xf00b(%rip), %r8       # 0x29d70
movq (%r8,%rax,8), %rcx
testb %bl, %bl
je 0x1ad8d
movq %r14, %rdx
movl %ebx, %esi
movb (%rcx), %dil
testb %dil, %dil
je 0x1ad8d
cmpb %dil, %sil
jne 0x1ad96
incq %rcx
movb (%rdx), %sil
incq %rdx
testb %sil, %sil
jne 0x1ad72
cmpb $0x0, (%rcx)
je 0x1aeb6
incq %rax
cmpq $0x3, %rax
jne 0x1ad65
xorl %eax, %eax
leaq 0xefe8(%rip), %rcx      # 0x29d90
movq (%rcx,%rax,8), %rcx
testb %bl, %bl
je 0x1add0
movq %r14, %rdx
movl %ebx, %esi
movb (%rcx), %dil
testb %dil, %dil
je 0x1add0
cmpb %dil, %sil
jne 0x1add9
incq %rcx
movb (%rdx), %sil
incq %rdx
testb %sil, %sil
jne 0x1adb5
cmpb $0x0, (%rcx)
je 0x1af67
incq %rax
cmpq $0x7, %rax
jne 0x1ada1
movq 0x1117f(%rip), %rax     # 0x2bf68
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x1ae10
movq %r15, %rdi
leaq 0x8700(%rip), %rsi      # 0x234fd
movq %r9, %r12
callq 0x52a0
movq %r12, %r9
testl %eax, %eax
je 0x1afa5
movl 0x1118e(%rip), %eax     # 0x2bfa4
leaq 0x85f3(%rip), %rcx      # 0x23410
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x11123(%rip), %rax     # 0x2bf50
testq %rax, %rax
leaq 0xfe19(%rip), %rbx      # 0x2ac50
leaq 0xfe6a(%rip), %r12      # 0x2aca8
jne 0x1ae97
jmp 0x1af8e
movl $0x2, %eax
jmp 0x1af98
movq %r15, %rdi
callq 0x5520
movq %rax, %r14
callq 0x1b8f8
movq %rax, %r15
testq %rax, %rax
je 0x1aea3
movq 0x110e2(%rip), %rax     # 0x2bf50
testq %rax, %rax
je 0x1ae7b
movq %r14, %rdi
movq %r15, %rsi
callq *%rax
movq %r14, %rdi
callq 0x5040
xorl %eax, %eax
jmp 0x1aea8
movq 0x110c2(%rip), %rax     # 0x2bf50
testq %rax, %rax
je 0x1af8e
movq %r15, %rdi
xorl %esi, %esi
callq *%rax
jmp 0x1af8e
movl $0x2, %eax
testq %r15, %r15
jne 0x1af96
jmp 0x1af98
movl $0x1, (%r13)
jmp 0x1af6f
movl $0x7a120, %edi          # imm = 0x7A120
callq 0x5590
cmpl $0x0, 0xf43c(%rip)      # 0x2a310
js 0x1af53
testb $0x1, 0x1107b(%rip)     # 0x2bf58
jne 0x1af53
movq 0x1109a(%rip), %rbx     # 0x2bf80
movq 0x1109b(%rip), %r13     # 0x2bf88
xorl %r12d, %r12d
movq %r13, %r15
subq %r12, %r15
jbe 0x1af53
movl 0xf412(%rip), %eax      # 0x2a310
movl %eax, 0x8(%rsp)
movl $0x4, 0xc(%rsp)
movl $0x1, %esi
leaq 0x8(%rsp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x53c0
testl %eax, %eax
jle 0x1af46
leaq (%rbx,%r12), %r14
movl 0xf3e4(%rip), %edi      # 0x2a310
movq %r14, %rsi
movq %r15, %rdx
callq 0x5100
testq %rax, %rax
jns 0x1af4a
callq 0x5070
cmpl $0x4, (%rax)
je 0x1af26
xorl %eax, %eax
jmp 0x1af4f
addq %rax, %r12
movb $0x1, %al
testb %al, %al
jne 0x1aef0
movq $0x0, 0x11022(%rip) # 0x2bf80
leaq 0xfd43(%rip), %r12      # 0x2aca8
jmp 0x1af87
movl $0x0, (%r13)
movq %r15, %rdi
callq 0x5520
movq %rax, 0x8(%r13)
leaq 0xfcf6(%rip), %rdi      # 0x2ac78
callq 0x5280
leaq 0xfcc2(%rip), %rbx      # 0x2ac50
movq %rbx, %rdi
callq 0x5340
xorl %eax, %eax
testl %eax, %eax
je 0x1acc6
jmp 0x1b1a3
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x5160
movq %rax, (%rsp)
cmpl $0x0, 0xf353(%rip)      # 0x2a310
leaq 0xfce4(%rip), %r12      # 0x2aca8
js 0x1b08b
testb $0x1, 0x10f87(%rip)     # 0x2bf58
jne 0x1b08b
movq 0xefe2(%rip), %rax      # 0x29fc0
movq (%rax), %r14
callq 0xeb2f
movq %r14, %rdi
leaq 0x856d(%rip), %rbx      # 0x2355d
movq %rbx, %rsi
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
movq (%r12), %r14
testq %r14, %r14
je 0x1b021
callq 0xeb2f
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x52c0
movq (%rsp), %r15
testq %r15, %r15
je 0x1b06d
xorl %ebx, %ebx
leaq (%rbx,%r13), %r14
subq %rbx, %r15
movl 0xf2d7(%rip), %edi      # 0x2a310
movq %r14, %rsi
movq %r15, %rdx
callq 0x5100
testq %rax, %rax
jns 0x1b055
callq 0x5070
cmpl $0x4, (%rax)
je 0x1b033
jmp 0x1b08b
addq %rax, %rbx
movq (%rsp), %r15
cmpq %r15, %rbx
jb 0x1b02c
jmp 0x1b06d
callq 0x5070
cmpl $0x4, (%rax)
jne 0x1b08b
movl 0xf29d(%rip), %edi      # 0x2a310
movl $0x1, %edx
leaq 0x84ed(%rip), %rsi      # 0x2356c
callq 0x5100
testq %rax, %rax
js 0x1b063
je 0x1b06d
movq $0x0, 0x10ed2(%rip) # 0x2bf68
jmp 0x1af87
cmpq $0x0, 0x10(%r13)
leaq 0xfc01(%rip), %r12      # 0x2aca8
jne 0x1b17a
movq 0x10eac(%rip), %rax     # 0x2bf60
testb %bl, %bl
je 0x1b175
movb (%rax), %cl
testb %cl, %cl
je 0x1b175
cmpb %cl, %bl
jne 0x1b17a
incq %rax
movb (%r14), %bl
incq %r14
jmp 0x1b0b4
movq 0x10e80(%rip), %rax     # 0x2bf60
testb %bl, %bl
leaq 0xfbbf(%rip), %r12      # 0x2aca8
je 0x1b106
movb (%rax), %cl
testb %cl, %cl
je 0x1b106
cmpb %cl, %bl
jne 0x1b17a
incq %rax
movb (%r14), %bl
incq %r14
testb %bl, %bl
jne 0x1b0eb
cmpb $0x0, (%rax)
jne 0x1b17a
movl $0x10, %edi
callq 0x5360
movq %rax, %r14
movq %r15, %rdi
callq 0x5520
movq %rax, 0x8(%r14)
movq 0x10(%r13), %rax
movq %rax, (%r14)
jmp 0x1b16c
movq 0x10(%r13), %rbx
testq %rbx, %rbx
leaq 0xfb6d(%rip), %r12      # 0x2aca8
jne 0x1b17a
movq %r9, %r14
callq 0x5580
movq (%rax), %rax
testb $0x8, 0x1(%rax,%r14,2)
je 0x1b17a
movl $0x10, %edi
callq 0x5360
movq %rax, %r14
movq %r15, %rdi
callq 0x5520
movq %rax, 0x8(%r14)
movq %rbx, (%r14)
movq %r14, 0x10(%r13)
jmp 0x1af87
cmpb $0x0, (%rax)
je 0x1b196
movq 0x10dcf(%rip), %rax     # 0x2bf50
testq %rax, %rax
leaq 0xfac5(%rip), %rbx      # 0x2ac50
jne 0x1ae97
jmp 0x1af8e
movq %r15, %rdi
callq 0x1bc80
jmp 0x1af87
movq 0xee16(%rip), %rax      # 0x29fc0
movq (%rax), %rbx
callq 0xeb2f
leaq 0x3d91(%rip), %rsi      # 0x1ef4a
leaq 0x83ae(%rip), %rcx      # 0x2356e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movq (%r12), %rbx
testq %rbx, %rbx
je 0x1b1f6
callq 0xeb2f
leaq 0x3d68(%rip), %rsi      # 0x1ef4a
leaq 0x8385(%rip), %rcx      # 0x2356e
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
cmpq $0x0, 0x10d9a(%rip)     # 0x2bf98
je 0x1b239
testb $0x1, 0x10d51(%rip)     # 0x2bf58
jne 0x1b239
leaq 0xfa40(%rip), %rbx      # 0x2ac50
movq %rbx, %rdi
callq 0x5560
movb $0x1, 0x10d39(%rip)     # 0x2bf58
leaq 0xfa52(%rip), %rdi      # 0x2ac78
callq 0x5280
movq %rbx, %rdi
callq 0x5340
callq *0x10d5f(%rip)          # 0x2bf98
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq