// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_packet_service_query
static int mbim_packet_service_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_PACKET_SERVICE, 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_PACKET_SERVICE_INFO_T *pInfo = (MBIM_PACKET_SERVICE_INFO_T *)pCmdDone->InformationBuffer;
        PacketServiceState = le32toh(pInfo->PacketServiceState);
        mbim_update_state();

        if (le32toh(pCmdDone->InformationBufferLength) == sizeof(MBIM_PACKET_SERVICE_INFO_V2_T)) {
            MBIM_PACKET_SERVICE_INFO_V2_T *pInfo = (MBIM_PACKET_SERVICE_INFO_V2_T *)pCmdDone->InformationBuffer;
            mbim_debug("CurrentDataClass = %s", MBIMDataClassStr(le32toh(pInfo->CurrentDataClass)));
        }
    }
    mbim_free(pRequest); mbim_free(pCmdDone);
    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq 0x197de(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
callq 0x13930
movq -0x38(%rbp), %rdi
movq %rax, %rdx
leaq 0x11c72(%rip), %rsi     # 0x2f48e
leaq 0x11e97(%rip), %rcx     # 0x2f6ba
movb $0x0, %al
callq 0x52c0
leaq 0x1a637(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1d866
leaq 0x1a62a(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
leaq 0x11c36(%rip), %rsi     # 0x2f48e
leaq 0x11e5b(%rip), %rcx     # 0x2f6ba
movb $0x0, %al
callq 0x52c0
jmp 0x1d868
movl $0xa, %edi
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %edx
movl %ecx, %esi
callq 0x16eb0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl 0x19b98(%rip), %edx     # 0x37420
leaq -0x18(%rbp), %rsi
callq 0x17270
movl %eax, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1d8a5
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1d8ad
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x1d8ad
movq -0x48(%rbp), %rdi
callq 0x17480
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x1d8d0
cmpl $0x0, -0x20(%rbp)
jne 0x1d8d0
cmpq $0x0, -0x18(%rbp)
jne 0x1d9e4
cmpq $0x0, -0x18(%rbp)
je 0x1d8ef
movq -0x18(%rbp), %rdi
cmpl $0x0, 0x1b60e(%rip)     # 0x38ef0
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x17560
jmp 0x1d8f1
cmpq $0x0, -0x10(%rbp)
je 0x1d909
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1d90b
jmp 0x1d90d
cmpq $0x0, -0x18(%rbp)
je 0x1d925
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1d927
jmp 0x1d929
movq 0x196b0(%rip), %rax     # 0x36fe0
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 0x10c9c(%rip), %rsi     # 0x2e5ed
leaq 0x11d62(%rip), %rcx     # 0x2f6ba
movl $0x794, %r8d            # imm = 0x794
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x1a4f9(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1d9b4
leaq 0x1a4ec(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x13930
movq -0x58(%rbp), %rdi
movq %rax, %rdx
movl -0x1c(%rbp), %r9d
movl -0x20(%rbp), %eax
leaq 0x10c50(%rip), %rsi     # 0x2e5ed
leaq 0x11d16(%rip), %rcx     # 0x2f6ba
movl $0x794, %r8d            # imm = 0x794
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x1d9b6
cmpl $0x0, -0x1c(%rbp)
je 0x1d9c7
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1db19
cmpl $0x0, -0x20(%rbp)
je 0x1d9d8
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1db19
movl $0x22b8, -0x4(%rbp)     # imm = 0x22B8
jmp 0x1db19
jmp 0x1d9e6
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x191c0
cmpl $0x0, %eax
je 0x1dadb
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movl %eax, 0x1b6bf(%rip)     # 0x390d8
callq 0x1bd30
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x191c0
movl %eax, %eax
cmpq $0x20, %rax
jne 0x1dad9
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x30(%rbp)
movq 0x19597(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x13930
movq %rax, -0x60(%rbp)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x191c0
movl %eax, %edi
callq 0x1b2e0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq %rax, %rcx
leaq 0x11c56(%rip), %rsi     # 0x2f6d4
movb $0x0, %al
callq 0x52c0
leaq 0x1a3dc(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1dad5
leaq 0x1a3cf(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x78(%rbp)
callq 0x13930
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x191c0
movl %eax, %edi
callq 0x1b2e0
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq %rax, %rcx
leaq 0x11c06(%rip), %rsi     # 0x2f6d4
movb $0x0, %al
callq 0x52c0
jmp 0x1dad7
jmp 0x1dad9
jmp 0x1dadb
jmp 0x1dadd
cmpq $0x0, -0x10(%rbp)
je 0x1daf5
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1daf7
jmp 0x1daf9
cmpq $0x0, -0x18(%rbp)
je 0x1db11
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1db13
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)