// File: /workspace/github_c_makefile_star2_O2/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 0x1040e(%rip), %rbp     # 0x29c50
leaq 0x7c33(%rip), %r12      # 0x2147c
leaq 0x7c20(%rip), %r13      # 0x21470
leaq 0x7c09(%rip), %rbx      # 0x21460
callq 0x1a2cc
testq %rax, %rax
je 0x19be4
movq %rax, %r15
xorl %r14d, %r14d
cmpq $0x10, %r14
je 0x198bf
movslq (%r14,%rbx), %rsi
addq %rbx, %rsi
movq %r15, %rdi
callq 0x1973c
addq $0x4, %r14
testl %eax, %eax
je 0x1986b
movq %r15, %rdi
callq 0x5530
movq %rax, %r15
callq 0x1a2cc
testq %rax, %rax
je 0x19be4
movq 0x116a8(%rip), %rcx     # 0x2af50
testq %rcx, %rcx
je 0x198b5
movq %r15, %rdi
movq %rax, %rsi
callq *%rcx
movq %r15, %rdi
callq 0x5040
jmp 0x19857
movq %rbp, %rdi
callq 0x5570
movq 0x116a2(%rip), %r14     # 0x2af70
testq %r14, %r14
je 0x19acc
cmpq $0x0, 0x116a1(%rip)     # 0x2af80
je 0x198f4
movq %r15, %rdi
leaq 0x629e(%rip), %rsi      # 0x1fb89
callq 0x52a0
testl %eax, %eax
je 0x19959
xorl %ebp, %ebp
cmpq $0xc, %rbp
je 0x1991d
movslq (%rbp,%r13), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x1973c
addq $0x4, %rbp
testl %eax, %eax
je 0x198f6
movl $0x1, (%r14)
jmp 0x19945
xorl %ebp, %ebp
cmpq $0x1c, %rbp
je 0x199fe
movslq (%rbp,%r12), %rsi
addq %r12, %rsi
movq %r15, %rdi
callq 0x1973c
addq $0x4, %rbp
testl %eax, %eax
je 0x1991f
andl $0x0, (%r14)
movq %r15, %rdi
callq 0x1a620
leaq 0x102fc(%rip), %rbp     # 0x29c50
jmp 0x19adf
movl $0x7a120, %edi          # imm = 0x7A120
callq 0x55a0
cmpl $0x0, 0xf9a6(%rip)      # 0x29310
js 0x19a5b
testb $0x1, 0x115e1(%rip)     # 0x2af58
jne 0x19a5b
movq 0x115fc(%rip), %rax     # 0x2af80
movq %rax, (%rsp)
movq 0x115f9(%rip), %r14     # 0x2af88
xorl %r12d, %r12d
movq %r14, %r15
subq %r12, %r15
jbe 0x19a5b
movl 0xf96c(%rip), %eax      # 0x29310
movl %eax, 0x8(%rsp)
movl $0x4, 0xc(%rsp)
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $-0x1
popq %rdx
callq 0x53d0
testl %eax, %eax
jle 0x19a5b
movq (%rsp), %rax
leaq (%rax,%r12), %rbp
movl 0xf93a(%rip), %edi      # 0x29310
movq %rbp, %rsi
movq %r15, %rdx
callq 0x5100
testq %rax, %rax
jns 0x199f2
callq 0x5070
cmpl $0x4, (%rax)
je 0x199d0
jmp 0x19a54
addq %rax, %r12
leaq 0x10254(%rip), %rbp     # 0x29c50
jmp 0x19992
movq 0x11563(%rip), %rbp     # 0x2af68
testq %rbp, %rbp
je 0x19a22
cmpb $0x3e, (%r15)
jne 0x19a22
cmpb $0x20, 0x1(%r15)
jne 0x19a22
cmpb $0x0, 0x2(%r15)
je 0x19af6
movl 0x1157c(%rip), %eax     # 0x2afa4
leaq 0x7a21(%rip), %rcx      # 0x21450
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x11511(%rip), %rax     # 0x2af50
testq %rax, %rax
leaq 0x10207(%rip), %rbp     # 0x29c50
jne 0x19ad8
jmp 0x19adf
leaq 0x101f5(%rip), %rbp     # 0x29c50
andq $0x0, 0x1151d(%rip)     # 0x2af80
leaq 0x7a12(%rip), %r12      # 0x2147c
jmp 0x19adf
cmpq $0x0, 0x10(%r14)
leaq 0x101d8(%rip), %rbp     # 0x29c50
jne 0x19acc
movq 0x114df(%rip), %rsi     # 0x2af60
movq %r15, %rdi
callq 0x1973c
testl %eax, %eax
jne 0x19aec
jmp 0x19acc
movq 0x114ca(%rip), %rsi     # 0x2af60
movq %r15, %rdi
callq 0x1973c
testl %eax, %eax
leaq 0x101a9(%rip), %rbp     # 0x29c50
jne 0x19aec
jmp 0x19acc
cmpq $0x0, 0x10(%r14)
leaq 0x10199(%rip), %rbp     # 0x29c50
jne 0x19acc
callq 0x5590
movq (%rax), %rax
movsbq (%r15), %rcx
testb $0x8, 0x1(%rax,%rcx,2)
jne 0x19aec
movq 0x1147d(%rip), %rax     # 0x2af50
testq %rax, %rax
je 0x19adf
movq %r15, %rdi
xorl %esi, %esi
callq *%rax
movq %rbp, %rdi
callq 0x5340
jmp 0x19857
movq %r15, %rdi
callq 0x1a63e
jmp 0x19adf
movq %rbp, %rdi
callq 0x5160
movq %rax, 0x10(%rsp)
cmpl $0x0, 0xf806(%rip)      # 0x29310
js 0x19bd7
testb $0x1, 0x11441(%rip)     # 0x2af58
jne 0x19bd7
movq 0xf494(%rip), %rax      # 0x28fb8
movq (%rax), %r14
callq 0xe343
movq %r14, %rdi
leaq 0x7a9c(%rip), %r15      # 0x215d2
movq %r15, %rsi
movq %rax, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x52c0
leaq 0x1015b(%rip), %rax     # 0x29ca8
movq (%rax), %r14
testq %r14, %r14
je 0x19b6d
callq 0xe343
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x52c0
xorl %eax, %eax
movq 0x10(%rsp), %r15
movq %rax, (%rsp)
subq %rax, %r15
jbe 0x19bb3
movq (%rsp), %rax
leaq (%rax,%rbp), %r14
movl 0xf785(%rip), %edi      # 0x29310
movq %r14, %rsi
movq %r15, %rdx
callq 0x5100
testq %rax, %rax
jns 0x19ba7
callq 0x5070
cmpl $0x4, (%rax)
je 0x19b85
jmp 0x19bd7
movq (%rsp), %rcx
addq %rax, %rcx
movq %rcx, %rax
jmp 0x19b6f
movl 0xf757(%rip), %edi      # 0x29310
leaq 0x7a21(%rip), %rsi      # 0x215e1
pushq $0x1
popq %rdx
callq 0x5100
testq %rax, %rax
jns 0x19bd5
callq 0x5070
cmpl $0x4, (%rax)
je 0x19bb3
andq $0x0, 0x11389(%rip)     # 0x2af68
jmp 0x1994d
movq 0xf3cd(%rip), %rax      # 0x28fb8
movq (%rax), %rbx
callq 0xe343
leaq 0x334c(%rip), %rsi      # 0x1cf46
leaq 0x79e2(%rip), %rcx      # 0x215e3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x10093(%rip), %rax     # 0x29ca8
movq (%rax), %rbx
testq %rbx, %rbx
je 0x19c3d
callq 0xe343
leaq 0x331d(%rip), %rsi      # 0x1cf46
leaq 0x79b3(%rip), %rcx      # 0x215e3
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
cmpq $0x0, 0x11353(%rip)     # 0x2af98
je 0x19c80
testb $0x1, 0x1130a(%rip)     # 0x2af58
jne 0x19c80
leaq 0xfff9(%rip), %rbx      # 0x29c50
movq %rbx, %rdi
callq 0x5570
movb $0x1, 0x112f2(%rip)     # 0x2af58
leaq 0x1000b(%rip), %rdi     # 0x29c78
callq 0x5280
movq %rbx, %rdi
callq 0x5340
callq *0x11318(%rip)          # 0x2af98
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq