// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_open_device
static int mbim_open_device(uint32_t MaxControlTransfer) {
    MBIM_MESSAGE_HEADER *pRequest = NULL;
    MBIM_OPEN_DONE_T *pOpenDone = NULL;
    int err = 0;

    mbim_debug("%s()", __func__);
    pRequest = compose_open_command(MaxControlTransfer);
    err = mbim_send_command(pRequest, (MBIM_COMMAND_DONE_T **)&pOpenDone, 3*1000); //EM06ELAR03A09M4G take about 2.5 seconds
    mbim_check_err(err, pRequest, pOpenDone);

    err = le32toh(pOpenDone->Status);
    mbim_free(pRequest); mbim_free(pOpenDone);

    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movq 0x1ba37(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x13930
movq -0x28(%rbp), %rdi
movq %rax, %rdx
leaq 0x13ecb(%rip), %rsi     # 0x2f48e
leaq 0x13ecf(%rip), %rcx     # 0x2f499
movb $0x0, %al
callq 0x52c0
leaq 0x1c890(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1b60d
leaq 0x1c883(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x30(%rbp)
callq 0x13930
movq -0x30(%rbp), %rdi
movq %rax, %rdx
leaq 0x13e8f(%rip), %rsi     # 0x2f48e
leaq 0x13e93(%rip), %rcx     # 0x2f499
movb $0x0, %al
callq 0x52c0
jmp 0x1b60f
movl -0x8(%rbp), %edi
callq 0x1c7a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0xbb8, %edx            # imm = 0xBB8
callq 0x17270
movl %eax, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1b641
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0x1b649
xorl %eax, %eax
movq %rax, -0x38(%rbp)
jmp 0x1b649
movq -0x38(%rbp), %rdi
callq 0x17480
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x1b66c
cmpl $0x0, -0x20(%rbp)
jne 0x1b66c
cmpq $0x0, -0x18(%rbp)
jne 0x1b777
cmpq $0x0, -0x18(%rbp)
je 0x1b68b
movq -0x18(%rbp), %rdi
cmpl $0x0, 0x1d872(%rip)     # 0x38ef0
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x17560
jmp 0x1b68d
cmpq $0x0, -0x10(%rbp)
je 0x1b6a5
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1b6a7
jmp 0x1b6a9
cmpq $0x0, -0x18(%rbp)
je 0x1b6c1
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1b6c3
jmp 0x1b6c5
movq 0x1b914(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
movl -0x1c(%rbp), %r9d
movl -0x20(%rbp), %eax
leaq 0x12f00(%rip), %rsi     # 0x2e5ed
leaq 0x13da5(%rip), %rcx     # 0x2f499
movl $0x69f, %r8d            # imm = 0x69F
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x1c75d(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1b750
leaq 0x1c750(%rip), %rax     # 0x37e68
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 0x12eb4(%rip), %rsi     # 0x2e5ed
leaq 0x13d59(%rip), %rcx     # 0x2f499
movl $0x69f, %r8d            # imm = 0x69F
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x1b752
cmpl $0x0, -0x1c(%rbp)
je 0x1b760
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1b7c4
cmpl $0x0, -0x20(%rbp)
je 0x1b76e
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1b7c4
movl $0x22b8, -0x4(%rbp)     # imm = 0x22B8
jmp 0x1b7c4
jmp 0x1b779
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x191c0
movl %eax, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1b7a0
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1b7a2
jmp 0x1b7a4
cmpq $0x0, -0x18(%rbp)
je 0x1b7bc
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1b7be
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)