// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_query_connect
static int mbim_query_connect(int sessionID) {
    MBIM_MESSAGE_HEADER *pRequest = NULL;
    MBIM_COMMAND_DONE_T *pCmdDone = NULL;
    MBIM_SET_CONNECT_T set_connect;
    int err;

    if (ActivationState != MBIMActivationStateActivated  || mbim_verbose)
        mbim_debug("%s(sessionID=%d)", __func__, sessionID); //avoid two many log
    set_connect.SessionId = htole32(sessionID);
    pRequest = compose_basic_connect_command(MBIM_CID_CONNECT, MBIM_CID_CMD_TYPE_QUERY, &set_connect, sizeof(set_connect));
    err = mbim_send_command(pRequest, &pCmdDone, mbim_default_timeout);
    mbim_check_err(err, pRequest, pCmdDone);

    if (le32toh(pCmdDone->InformationBufferLength))
    {
        MBIM_CONNECT_T *pInfo = (MBIM_CONNECT_T *)pCmdDone->InformationBuffer;
        ActivationState = le32toh(pInfo->ActivationState);
        mbim_update_state();
    }
    mbim_free(pRequest); mbim_free(pCmdDone);
    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movl %edi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpl $0x1, 0x1ab0b(%rip)     # 0x390e0
jne 0x1e5e0
cmpl $0x0, 0x1a912(%rip)     # 0x38ef0
je 0x1e659
jmp 0x1e5e2
movq 0x189f7(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x70(%rbp)
callq 0x13930
movq -0x70(%rbp), %rdi
movq %rax, %rdx
movl -0x8(%rbp), %r8d
leaq 0x11171(%rip), %rsi     # 0x2f778
leaq 0x11181(%rip), %rcx     # 0x2f78f
movb $0x0, %al
callq 0x52c0
leaq 0x1984c(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1e655
leaq 0x1983f(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x78(%rbp)
callq 0x13930
movq -0x78(%rbp), %rdi
movq %rax, %rdx
movl -0x8(%rbp), %r8d
leaq 0x11131(%rip), %rsi     # 0x2f778
leaq 0x11141(%rip), %rcx     # 0x2f78f
movb $0x0, %al
callq 0x52c0
jmp 0x1e657
jmp 0x1e659
movl -0x8(%rbp), %edi
callq 0x191c0
movl %eax, -0x54(%rbp)
movl $0xc, %edi
xorl %esi, %esi
leaq -0x54(%rbp), %rdx
movl $0x3c, %ecx
callq 0x16eb0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl 0x18d99(%rip), %edx     # 0x37420
leaq -0x18(%rbp), %rsi
callq 0x17270
movl %eax, -0x58(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1e6a4
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x1e6ac
xorl %eax, %eax
movq %rax, -0x80(%rbp)
jmp 0x1e6ac
movq -0x80(%rbp), %rdi
callq 0x17480
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x58(%rbp)
jne 0x1e6cf
cmpl $0x0, -0x5c(%rbp)
jne 0x1e6cf
cmpq $0x0, -0x18(%rbp)
jne 0x1e7e9
cmpq $0x0, -0x18(%rbp)
je 0x1e6ee
movq -0x18(%rbp), %rdi
cmpl $0x0, 0x1a80f(%rip)     # 0x38ef0
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x17560
jmp 0x1e6f0
cmpq $0x0, -0x10(%rbp)
je 0x1e708
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1e70a
jmp 0x1e70c
cmpq $0x0, -0x18(%rbp)
je 0x1e724
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1e726
jmp 0x1e728
movq 0x188b1(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x13930
movq -0x88(%rbp), %rdi
movq %rax, %rdx
movl -0x58(%rbp), %r9d
movl -0x5c(%rbp), %eax
leaq 0xfe97(%rip), %rsi      # 0x2e5ed
leaq 0x11032(%rip), %rcx     # 0x2f78f
movl $0x6c2, %r8d            # imm = 0x6C2
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x196f4(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1e7bf
leaq 0x196e7(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x90(%rbp)
callq 0x13930
movq -0x90(%rbp), %rdi
movq %rax, %rdx
movl -0x58(%rbp), %r9d
movl -0x5c(%rbp), %eax
leaq 0xfe45(%rip), %rsi      # 0x2e5ed
leaq 0x10fe0(%rip), %rcx     # 0x2f78f
movl $0x6c2, %r8d            # imm = 0x6C2
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x1e7c1
cmpl $0x0, -0x58(%rbp)
je 0x1e7d2
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1e85d
cmpl $0x0, -0x5c(%rbp)
je 0x1e7e0
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1e85d
movl $0x22b8, -0x4(%rbp)     # imm = 0x22B8
jmp 0x1e85d
jmp 0x1e7eb
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x191c0
cmpl $0x0, %eax
je 0x1e81f
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movl %eax, 0x1a8c6(%rip)     # 0x390e0
callq 0x1bd30
jmp 0x1e821
cmpq $0x0, -0x10(%rbp)
je 0x1e839
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1e83b
jmp 0x1e83d
cmpq $0x0, -0x18(%rbp)
je 0x1e855
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1e857
movl -0x58(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)