// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/main.c
// Function: main
int main(int argc, char *argv[])
{
    int ret;
    PROFILE_T *ctx = &s_profile;

    dbg_time("QConnectManager_Linux_V1.6.1");

    ret = parse_user_input(argc, argv, ctx);
    if (!ret)
        return ret;

    if (ctx->kill_pdp) {
        return kill_data_call_pdp(ctx->kill_pdp, argv[0]);
    }

    if (ctx->logfile) {
        logfilefp = fopen(ctx->logfile, "a+");
        if (!logfilefp) {
            dbg_time("Fail to open %s, errno: %d(%s)", ctx->logfile, errno, strerror(errno));
        }
    }

    signal(SIGINT, ql_sigaction);
    signal(SIGTERM, ql_sigaction);
    signal(SIGALRM, ql_sigaction);

    do {
        ret = quectel_CM(ctx);
        if (g_donot_exit_when_modem_hangup > 0)
            sleep(3);
    } while (g_donot_exit_when_modem_hangup > 0);

    if (logfilefp) {
        fclose(logfilefp);
    }

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq 0x2f2bf(%rip), %rax     # 0x3759c
movq %rax, -0x20(%rbp)
movq 0x2ecf8(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x13930
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x232d2(%rip), %rsi     # 0x2b5d4
movb $0x0, %al
callq 0x52c0
leaq 0x2fb58(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x833e
leaq 0x2fb4b(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x13930
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x2329d(%rip), %rsi     # 0x2b5d4
movb $0x0, %al
callq 0x52c0
jmp 0x8340
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x8530
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x8364
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x8518
movq -0x20(%rbp), %rax
cmpl $0x0, 0x82(%rax)
je 0x838f
movq -0x20(%rbp), %rax
movl 0x82(%rax), %edi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x8c80
movl %eax, -0x4(%rbp)
jmp 0x8518
movq -0x20(%rbp), %rax
cmpq $0x0, 0x52(%rax)
je 0x8499
movq -0x20(%rbp), %rax
movq 0x52(%rax), %rdi
leaq 0x2324a(%rip), %rsi     # 0x2b5f7
callq 0x5480
movq %rax, %rcx
leaq 0x2faac(%rip), %rax     # 0x37e68
movq %rcx, (%rax)
leaq 0x2faa2(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
jne 0x8497
jmp 0x83d2
movq 0x2ec07(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movq 0x52(%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x34(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %r8d
movq %rax, %r9
leaq 0x231d5(%rip), %rsi     # 0x2b5fa
movb $0x0, %al
callq 0x52c0
leaq 0x2fa35(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x8493
leaq 0x2fa28(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x70(%rbp)
callq 0x13930
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x52(%rax), %rax
movq %rax, -0x60(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x54(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl -0x54(%rbp), %r8d
movq %rax, %r9
leaq 0x2316e(%rip), %rsi     # 0x2b5fa
movb $0x0, %al
callq 0x52c0
jmp 0x8495
jmp 0x8497
jmp 0x8499
movl $0x2, %edi
leaq 0x8cb(%rip), %rsi       # 0x8d70
callq 0x52b0
movl $0xf, %edi
leaq 0x8ba(%rip), %rsi       # 0x8d70
callq 0x52b0
movl $0xe, %edi
leaq 0x8a9(%rip), %rsi       # 0x8d70
callq 0x52b0
movq -0x20(%rbp), %rdi
callq 0x8dc0
movl %eax, -0x14(%rbp)
cmpl $0x0, 0x2f0b1(%rip)     # 0x37590
jle 0x84eb
movl $0x3, %edi
callq 0x5550
jmp 0x84ed
cmpl $0x0, 0x2f09c(%rip)     # 0x37590
jg 0x84cc
leaq 0x2f96b(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x8512
leaq 0x2f95e(%rip), %rax     # 0x37e68
movq (%rax), %rdi
callq 0x5130
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)