// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_register_state_query
static int mbim_register_state_query(void) {
    MBIM_MESSAGE_HEADER *pRequest = NULL;
    MBIM_COMMAND_DONE_T *pCmdDone = NULL;
    int err;

    mbim_debug("%s()", __func__);
    pRequest = compose_basic_connect_command(MBIM_CID_REGISTER_STATE, MBIM_CID_CMD_TYPE_QUERY, NULL, 0);
    err = mbim_send_command(pRequest, &pCmdDone, mbim_default_timeout);
    mbim_check_err(err, pRequest, pCmdDone);

    if (le32toh(pCmdDone->InformationBufferLength)) {
        MBIM_REGISTRATION_STATE_INFO_T *pInfo = (MBIM_REGISTRATION_STATE_INFO_T *)pCmdDone->InformationBuffer;;
        RegisterState = le32toh(pInfo->RegisterState);
        mbim_update_state();
    }
    mbim_free(pRequest); mbim_free(pCmdDone);
    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x19a61(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x13930
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x11ef5(%rip), %rsi     # 0x2f48e
leaq 0x12100(%rip), %rcx     # 0x2f6a0
movb $0x0, %al
callq 0x52c0
leaq 0x1a8ba(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1d5e3
leaq 0x1a8ad(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x38(%rbp)
callq 0x13930
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x11eb9(%rip), %rsi     # 0x2f48e
leaq 0x120c4(%rip), %rcx     # 0x2f6a0
movb $0x0, %al
callq 0x52c0
jmp 0x1d5e5
movl $0x9, %edi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %edx
movl %ecx, %esi
callq 0x16eb0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl 0x19e1b(%rip), %edx     # 0x37420
leaq -0x18(%rbp), %rsi
callq 0x17270
movl %eax, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1d622
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x1d62a
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x1d62a
movq -0x40(%rbp), %rdi
callq 0x17480
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x1d64d
cmpl $0x0, -0x20(%rbp)
jne 0x1d64d
cmpq $0x0, -0x18(%rbp)
jne 0x1d75b
cmpq $0x0, -0x18(%rbp)
je 0x1d66c
movq -0x18(%rbp), %rdi
cmpl $0x0, 0x1b891(%rip)     # 0x38ef0
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x17560
jmp 0x1d66e
cmpq $0x0, -0x10(%rbp)
je 0x1d686
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1d688
jmp 0x1d68a
cmpq $0x0, -0x18(%rbp)
je 0x1d6a2
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1d6a4
jmp 0x1d6a6
movq 0x19933(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x13930
movq -0x48(%rbp), %rdi
movq %rax, %rdx
movl -0x1c(%rbp), %r9d
movl -0x20(%rbp), %eax
leaq 0x10f1f(%rip), %rsi     # 0x2e5ed
leaq 0x11fcb(%rip), %rcx     # 0x2f6a0
movl $0x781, %r8d            # imm = 0x781
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x1a77c(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1d731
leaq 0x1a76f(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq -0x50(%rbp), %rdi
movq %rax, %rdx
movl -0x1c(%rbp), %r9d
movl -0x20(%rbp), %eax
leaq 0x10ed3(%rip), %rsi     # 0x2e5ed
leaq 0x11f7f(%rip), %rcx     # 0x2f6a0
movl $0x781, %r8d            # imm = 0x781
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x1d733
cmpl $0x0, -0x1c(%rbp)
je 0x1d744
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d7cf
cmpl $0x0, -0x20(%rbp)
je 0x1d752
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1d7cf
movl $0x22b8, -0x4(%rbp)     # imm = 0x22B8
jmp 0x1d7cf
jmp 0x1d75d
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x191c0
cmpl $0x0, %eax
je 0x1d791
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movl %eax, 0x1b944(%rip)     # 0x390d0
callq 0x1bd30
jmp 0x1d793
cmpq $0x0, -0x10(%rbp)
je 0x1d7ab
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1d7ad
jmp 0x1d7af
cmpq $0x0, -0x18(%rbp)
je 0x1d7c7
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1d7c9
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)