// File: /workspace/github_c_makefile_star2_O3/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 $0x38, %rsp
movq %rdi, %rbx
movl $0x0, (%rdi)
movq $0x0, 0x8(%rsp)
movq 0x17538(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xea3b
leaq 0xf796(%rip), %rsi      # 0x2222d
leaq 0xf956(%rip), %rcx      # 0x223f4
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x181f6(%rip), %rax     # 0x2aca8
movq (%rax), %r14
testq %r14, %r14
je 0x12ada
callq 0xea3b
leaq 0xf767(%rip), %rsi      # 0x2222d
leaq 0xf927(%rip), %rcx      # 0x223f4
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
xorl %r12d, %r12d
movl $0x2, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10a7b
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0x10c38
movl %eax, %ebp
movq (%r15), %r15
testq %r15, %r15
je 0x12b76
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addl (%r15), %eax
cmpl $0x3, %eax
ja 0x12b2d
movl %eax, %eax
leaq 0xfd0b(%rip), %rcx      # 0x22830
movq (%rcx,%rax,8), %rax
movl (%r15,%rax), %r12d
testl %ebp, %ebp
sete %r13b
movl %ebp, %eax
orl %r12d, %eax
jne 0x12b87
cmpl $0x0, 0x2c(%r15)
je 0x12d66
movl 0x38(%r15), %ecx
movl %ecx, %edx
shrl %edx
cmpl $0x1f, %edx
movl $0x1f, %eax
cmovbl %edx, %eax
cmpl $0x2, %ecx
jae 0x12c55
xorl %eax, %eax
leaq 0x1813e(%rip), %r13     # 0x2aca8
movq 0x1744f(%rip), %rbp     # 0x29fc0
jmp 0x12c81
testl %ebp, %ebp
sete %r13b
movl $0x22b8, %r15d          # imm = 0x22B8
xorl %r12d, %r12d
jmp 0x12ba9
xorl %esi, %esi
cmpl $0x0, 0x191a0(%rip)     # 0x2bd30
sete %sil
movq %r15, %rdi
callq 0x10dbe
testl %r12d, %r12d
movl $0x22b8, %r15d          # imm = 0x22B8
cmovnel %r12d, %r15d
testq %r14, %r14
je 0x12bb6
movq %r14, %rdi
callq 0x5040
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12bce
callq 0x5040
movq $0x0, 0x8(%rsp)
movq 0x173eb(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xea3b
movl %r12d, (%rsp)
leaq 0xe79d(%rip), %rsi      # 0x21385
leaq 0xf805(%rip), %rcx      # 0x223f4
movq %r14, %rdi
movq %rax, %rdx
movl $0x768, %r8d            # imm = 0x768
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x1809c(%rip), %rax     # 0x2aca8
movq (%rax), %r14
testq %r14, %r14
je 0x12c41
callq 0xea3b
movl %r12d, (%rsp)
leaq 0xe761(%rip), %rsi      # 0x21385
leaq 0xf7c9(%rip), %rcx      # 0x223f4
movq %r14, %rdi
movq %rax, %rdx
movl $0x768, %r8d            # imm = 0x768
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
testb %r13b, %r13b
cmovnel %r15d, %ebp
testl %ebp, %ebp
jne 0x12da6
jmp 0x12d82
movl 0x34(%r15), %ecx
addq %r15, %rcx
addq $0x30, %rcx
xorl %edx, %edx
leaq 0x1803f(%rip), %r13     # 0x2aca8
movq 0x17350(%rip), %rbp     # 0x29fc0
movb (%rcx,%rdx,2), %sil
movb %sil, 0x10(%rsp,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x12c70
movb $0x0, 0x10(%rsp,%rax)
movq (%rbp), %r12
callq 0xea3b
leaq 0xf77b(%rip), %rsi      # 0x22411
leaq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movq (%r13), %r12
testq %r12, %r12
je 0x12ccf
callq 0xea3b
leaq 0xf754(%rip), %rsi      # 0x22411
leaq 0x10(%rsp), %rcx
movq %r12, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x30(%r15), %r12
movl 0x40(%r15), %ecx
movl %ecx, %edx
shrl %edx
cmpl $0x1f, %edx
movl $0x1f, %eax
cmovbl %edx, %eax
cmpl $0x2, %ecx
jae 0x12cef
xorl %eax, %eax
jmp 0x12d09
movl 0x3c(%r15), %ecx
addq %r12, %rcx
xorl %edx, %edx
movb (%rcx,%rdx,2), %sil
movb %sil, 0x10(%rsp,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0x12cf8
movb $0x0, 0x10(%rsp,%rax)
movq (%rbp), %r15
callq 0xea3b
leaq 0xf70a(%rip), %rsi      # 0x22428
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movq (%r13), %r15
testq %r15, %r15
je 0x12d57
callq 0xea3b
leaq 0xf6e3(%rip), %rsi      # 0x22428
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movl (%r12), %eax
movl %eax, 0x19197(%rip)     # 0x2bef8
callq 0x15a9f
testq %r14, %r14
je 0x12d73
movq %r14, %rdi
callq 0x5040
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12d82
callq 0x5040
callq 0x15a9f
movl 0x1916b(%rip), %eax     # 0x2bef8
xorl %ebp, %ebp
movl $0x0, %ecx
cmpq $0x6, %rax
ja 0x12da4
leaq 0xe5a3(%rip), %rcx      # 0x21344
movl (%rcx,%rax,4), %ecx
movl %ecx, (%rbx)
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq