// File: /workspace/github_c_makefile_star2_O2/Carton32[P]quectel-CM/mbim-cm.c
// Function: requestGetSIMStatus
static int requestGetSIMStatus(SIM_Status *pSIMStatus)
{
    int retval;

    *pSIMStatus = SIM_ABSENT;
    retval = mbim_subscriber_status_query();
    if (retval)
        goto exit;
    mbim_update_state();

     switch(ReadyState) {
        case MBIMSubscriberReadyStateNotInitialized: *pSIMStatus = SIM_NOT_READY; break;
        case MBIMSubscriberReadyStateInitialized: *pSIMStatus = SIM_READY; break;
        case MBIMSubscriberReadyStateSimNotInserted: *pSIMStatus = SIM_ABSENT; break;
        case MBIMSubscriberReadyStateBadSim: *pSIMStatus = SIM_BAD; break;
        case MBIMSubscriberReadyStateFailure: *pSIMStatus = SIM_ABSENT; break;
        case MBIMSubscriberReadyStateNotActivated: *pSIMStatus = SIM_ABSENT; break;
        case MBIMSubscriberReadyStateDeviceLocked: *pSIMStatus = SIM_PIN; break;
        default: *pSIMStatus = SIM_ABSENT; break;
    }

exit:
    return retval;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
andl $0x0, (%rdi)
andq $0x0, 0x10(%rsp)
movq 0x16e73(%rip), %rax     # 0x28fb8
movq (%rax), %r14
callq 0xe343
leaq 0xe0ee(%rip), %rsi      # 0x20242
leaq 0xe2ae(%rip), %rcx      # 0x20409
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x17b39(%rip), %r13     # 0x29ca8
movq (%r13), %r14
testq %r14, %r14
je 0x12198
callq 0xe343
leaq 0xe0be(%rip), %rsi      # 0x20242
leaq 0xe27e(%rip), %rcx      # 0x20409
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
pushq $0x2
popq %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1022b
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0x103ea
movl %eax, %ebp
movq (%r15), %r12
movq %r12, %rdi
callq 0x1055f
movl %eax, %r15d
testq %r12, %r12
je 0x12328
testl %ebp, %ebp
jne 0x12328
testl %r15d, %r15d
jne 0x12328
cmpl $0x0, 0x2c(%r12)
je 0x122ef
leaq 0x30(%r12), %rax
movq %rax, 0x18(%rsp)
movl 0x34(%r12), %eax
movl 0x38(%r12), %esi
leaq (%r12,%rax), %rdi
addq $0x30, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rdx
callq 0x14f9d
movq %r13, %rbp
movq 0x16d91(%rip), %rax     # 0x28fb8
movq (%rax), %r13
callq 0xe343
leaq 0xe1f0(%rip), %rsi      # 0x20426
movq %r13, %rdi
movq %rbp, %r13
movq %rax, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x52c0
movq (%rbp), %r15
testq %r15, %r15
je 0x12270
callq 0xe343
leaq 0xe1c8(%rip), %rsi      # 0x20426
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movl 0x3c(%r12), %edi
movl 0x40(%r12), %esi
movq 0x18(%rsp), %rbp
addq %rbp, %rdi
leaq 0x20(%rsp), %r15
movq %r15, %rdx
callq 0x14f9d
movq 0x16d22(%rip), %rax     # 0x28fb8
movq (%rax), %r12
callq 0xe343
leaq 0xe198(%rip), %rsi      # 0x2043d
movq %r12, %rdi
movq %rax, %rdx
movq %r15, %rcx
xorl %eax, %eax
callq 0x52c0
movq (%r13), %r15
testq %r15, %r15
je 0x122dc
callq 0xe343
leaq 0xe173(%rip), %rsi      # 0x2043d
leaq 0x20(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movl (%rbp), %eax
movl %eax, 0x18c13(%rip)     # 0x2aef8
callq 0x14cde
movq 0x10(%rsp), %r12
movq %r14, %rdi
callq 0x5040
movq %r12, %rdi
callq 0x5040
callq 0x14cde
movl 0x18bee(%rip), %eax     # 0x2aef8
cmpq $0x6, %rax
ja 0x12320
leaq 0xd019(%rip), %rcx      # 0x1f330
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
andl $0x0, (%rbx)
jmp 0x12404
testq %r12, %r12
je 0x12349
xorl %esi, %esi
cmpl $0x0, 0x189fa(%rip)     # 0x2ad30
sete %sil
movq %r12, %rdi
callq 0x10583
movq 0x10(%rsp), %rbx
jmp 0x1234b
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x5040
testq %rbx, %rbx
je 0x12366
movq %rbx, %rdi
callq 0x5040
andq $0x0, 0x10(%rsp)
movq 0x16c4b(%rip), %rax     # 0x28fb8
movq (%rax), %rbx
callq 0xe343
movl %r15d, (%rsp)
leaq 0xd021(%rip), %rsi      # 0x1f3a1
leaq 0xe082(%rip), %rcx      # 0x20409
movq %rbx, %rdi
movq %rax, %rdx
movl $0x768, %r8d            # imm = 0x768
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
movq (%r13), %rbx
testq %rbx, %rbx
je 0x123d3
callq 0xe343
movl %r15d, (%rsp)
leaq 0xcfeb(%rip), %rsi      # 0x1f3a1
leaq 0xe04c(%rip), %rcx      # 0x20409
movq %rbx, %rdi
movq %rax, %rdx
movl $0x768, %r8d            # imm = 0x768
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
testl %r15d, %r15d
movl $0x22b8, %eax           # imm = 0x22B8
cmovnel %r15d, %eax
testl %ebp, %ebp
cmovnel %ebp, %eax
jmp 0x12406
movl $0x2, (%rbx)
jmp 0x12404
movl $0x1, (%rbx)
jmp 0x12404
movl $0x6, (%rbx)
jmp 0x12404
movl $0x3, (%rbx)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq