// File: /workspace/github_c_makefile_star2_O1/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 0x17396(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xeb2f
leaq 0xf5cc(%rip), %rsi      # 0x22205
leaq 0xf78c(%rip), %rcx      # 0x223cc
xorl %r12d, %r12d
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x18051(%rip), %rax     # 0x2aca8
movq (%rax), %r14
testq %r14, %r14
je 0x12c7f
callq 0xeb2f
leaq 0xf59a(%rip), %rsi      # 0x22205
leaq 0xf75a(%rip), %rcx      # 0x223cc
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movl $0x2, %edi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x10b66
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
movl $0x7530, %edx           # imm = 0x7530
callq 0x10d09
movl %eax, %ebp
movq (%r15), %rdi
testq %rdi, %rdi
je 0x12cce
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addl (%rdi), %eax
cmpl $0x3, %eax
ja 0x12cce
movl %eax, %eax
leaq 0xfb42(%rip), %rcx      # 0x22808
movq (%rcx,%rax,8), %rax
movl (%rdi,%rax), %r12d
movl %ebp, %eax
orl %r12d, %eax
sete %al
testq %rdi, %rdi
setne %r13b
andb %al, %r13b
je 0x12ce7
jmp 0x12dac
testq %rdi, %rdi
je 0x12cfe
xorl %esi, %esi
cmpl $0x0, 0x1903b(%rip)     # 0x2bd30
sete %sil
callq 0x10e8f
testq %r14, %r14
je 0x12d0b
movq %r14, %rdi
callq 0x5040
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12d23
callq 0x5040
movq $0x0, 0x8(%rsp)
movq 0x17296(%rip), %rax     # 0x29fc0
movq (%rax), %r14
callq 0xeb2f
movl %r12d, (%rsp)
leaq 0xe620(%rip), %rsi      # 0x2135d
leaq 0xf688(%rip), %rcx      # 0x223cc
movq %r14, %rdi
movq %rax, %rdx
movl $0x768, %r8d            # imm = 0x768
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
leaq 0x17f47(%rip), %rax     # 0x2aca8
movq (%rax), %r14
testq %r14, %r14
je 0x12d96
callq 0xeb2f
movl %r12d, (%rsp)
leaq 0xe5e4(%rip), %rsi      # 0x2135d
leaq 0xf64c(%rip), %rcx      # 0x223cc
movq %r14, %rdi
movq %rax, %rdx
movl $0x768, %r8d            # imm = 0x768
movl %ebp, %r9d
xorl %eax, %eax
callq 0x52c0
testl %r12d, %r12d
movl $0x22b8, %r15d          # imm = 0x22B8
cmovnel %r12d, %r15d
testl %ebp, %ebp
cmovnel %ebp, %r15d
xorl %r14d, %r14d
testb %r13b, %r13b
je 0x12f2b
movq 0x8(%rsp), %r12
cmpl $0x0, 0x2c(%r12)
je 0x12f03
movl 0x38(%r12), %ecx
movl %ecx, %edx
shrl %edx
cmpl $0x1f, %edx
movl $0x1f, %eax
cmovbl %edx, %eax
cmpl $0x2, %ecx
jae 0x12de3
xorl %ecx, %ecx
jmp 0x12e03
movl 0x34(%r12), %ecx
leaq (%r12,%rcx), %rdx
addq $0x30, %rdx
xorl %ecx, %ecx
movb (%rdx,%rcx,2), %sil
movb %sil, 0x10(%rsp,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x12df2
movb $0x0, 0x10(%rsp,%rcx)
movq 0x171b1(%rip), %rax     # 0x29fc0
movq (%rax), %r15
callq 0xeb2f
leaq 0xf5cb(%rip), %rsi      # 0x223e9
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x17e71(%rip), %rax     # 0x2aca8
movq (%rax), %r15
testq %r15, %r15
je 0x12e5d
callq 0xeb2f
leaq 0xf59e(%rip), %rsi      # 0x223e9
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x30(%r12), %r13
movl 0x40(%r12), %ecx
movl %ecx, %edx
shrl %edx
cmpl $0x1f, %edx
movl $0x1f, %eax
cmovbl %edx, %eax
cmpl $0x2, %ecx
jae 0x12e7f
xorl %ecx, %ecx
jmp 0x12e9a
movl 0x3c(%r12), %edx
addq %r13, %rdx
xorl %ecx, %ecx
movb (%rdx,%rcx,2), %sil
movb %sil, 0x10(%rsp,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x12e89
movb $0x0, 0x10(%rsp,%rcx)
movq 0x1711a(%rip), %rax     # 0x29fc0
movq (%rax), %r15
callq 0xeb2f
leaq 0xf54b(%rip), %rsi      # 0x22400
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
leaq 0x17dda(%rip), %rax     # 0x2aca8
movq (%rax), %r15
testq %r15, %r15
je 0x12ef4
callq 0xeb2f
leaq 0xf51e(%rip), %rsi      # 0x22400
leaq 0x10(%rsp), %rcx
movq %r15, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x52c0
movl (%r13), %eax
movl %eax, 0x18ffa(%rip)     # 0x2bef8
callq 0x15c62
testq %r14, %r14
je 0x12f10
movq %r14, %rdi
callq 0x5040
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x12f28
callq 0x5040
movq $0x0, 0x8(%rsp)
movl %ebp, %r15d
testl %r15d, %r15d
jne 0x12f4f
callq 0x15c62
movl 0x18fbd(%rip), %eax     # 0x2bef8
xorl %ecx, %ecx
cmpq $0x6, %rax
ja 0x12f4d
leaq 0xe3d2(%rip), %rcx      # 0x2131c
movl (%rcx,%rax,4), %ecx
movl %ecx, (%rbx)
movl %r15d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq