// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_set_radio_state
static int mbim_set_radio_state(MBIM_RADIO_SWITCH_STATE_E RadioState) {
    MBIM_MESSAGE_HEADER *pRequest = NULL;
    MBIM_COMMAND_DONE_T *pCmdDone = NULL;
    UINT32 value = htole32(RadioState);
    int err;

    mbim_debug("%s( %d )", __func__, RadioState);
    pRequest = compose_basic_connect_command(MBIM_CID_RADIO_STATE, MBIM_CID_CMD_TYPE_SET, &value, sizeof(value));
    err = mbim_send_command(pRequest, &pCmdDone, mbim_default_timeout);
    mbim_check_err(err, pRequest, pCmdDone);

    if (le32toh(pCmdDone->InformationBufferLength)) {
         MBIM_RADIO_STATE_INFO_T *pInfo = (MBIM_RADIO_STATE_INFO_T *)pCmdDone->InformationBuffer;
        mbim_debug("HwRadioState: %d, SwRadioState: %d", le32toh(pInfo->HwRadioState), le32toh(pInfo->SwRadioState));
    }
    mbim_free(pRequest); mbim_free(pCmdDone);
    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl -0x8(%rbp), %edi
callq 0x191c0
movl %eax, -0x1c(%rbp)
movq 0x1ab50(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
callq 0x13930
movq -0x38(%rbp), %rdi
movq %rax, %rdx
movl -0x8(%rbp), %r8d
leaq 0x1310f(%rip), %rsi     # 0x2f5bd
leaq 0x13117(%rip), %rcx     # 0x2f5cc
movb $0x0, %al
callq 0x52c0
leaq 0x1b9a5(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1c4fc
leaq 0x1b998(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
movl -0x8(%rbp), %r8d
leaq 0x130cf(%rip), %rsi     # 0x2f5bd
leaq 0x130d7(%rip), %rcx     # 0x2f5cc
movb $0x0, %al
callq 0x52c0
jmp 0x1c4fe
movl $0x3, %edi
movl $0x1, %esi
leaq -0x1c(%rbp), %rdx
movl $0x4, %ecx
callq 0x16eb0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl 0x1aefc(%rip), %edx     # 0x37420
leaq -0x18(%rbp), %rsi
callq 0x17270
movl %eax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1c541
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x1c549
xorl %eax, %eax
movq %rax, -0x48(%rbp)
jmp 0x1c549
movq -0x48(%rbp), %rdi
callq 0x17480
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x20(%rbp)
jne 0x1c56c
cmpl $0x0, -0x24(%rbp)
jne 0x1c56c
cmpq $0x0, -0x18(%rbp)
jne 0x1c680
cmpq $0x0, -0x18(%rbp)
je 0x1c58b
movq -0x18(%rbp), %rdi
cmpl $0x0, 0x1c972(%rip)     # 0x38ef0
sete %al
andb $0x1, %al
movzbl %al, %esi
callq 0x17560
jmp 0x1c58d
cmpq $0x0, -0x10(%rbp)
je 0x1c5a5
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1c5a7
jmp 0x1c5a9
cmpq $0x0, -0x18(%rbp)
je 0x1c5c1
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1c5c3
jmp 0x1c5c5
movq 0x1aa14(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq -0x50(%rbp), %rdi
movq %rax, %rdx
movl -0x20(%rbp), %r9d
movl -0x24(%rbp), %eax
leaq 0x12000(%rip), %rsi     # 0x2e5ed
leaq 0x12fd8(%rip), %rcx     # 0x2f5cc
movl $0x756, %r8d            # imm = 0x756
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x1b85d(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1c650
leaq 0x1b850(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x13930
movq -0x58(%rbp), %rdi
movq %rax, %rdx
movl -0x20(%rbp), %r9d
movl -0x24(%rbp), %eax
leaq 0x11fb4(%rip), %rsi     # 0x2e5ed
leaq 0x12f8c(%rip), %rcx     # 0x2f5cc
movl $0x756, %r8d            # imm = 0x756
movl %eax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x1c652
cmpl $0x0, -0x20(%rbp)
je 0x1c663
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1c792
cmpl $0x0, -0x24(%rbp)
je 0x1c674
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1c792
movl $0x22b8, -0x4(%rbp)     # imm = 0x22B8
jmp 0x1c792
jmp 0x1c682
movq -0x18(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x191c0
cmpl $0x0, %eax
je 0x1c754
movq -0x18(%rbp), %rax
addq $0x30, %rax
movq %rax, -0x30(%rbp)
movq 0x1a936(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x70(%rbp)
callq 0x13930
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %edi
callq 0x191c0
movl %eax, -0x5c(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movl -0x5c(%rbp), %ecx
movl %eax, %r8d
leaq 0x12ef8(%rip), %rsi     # 0x2f5e1
movb $0x0, %al
callq 0x52c0
leaq 0x1b771(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x1c750
leaq 0x1b764(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x13930
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movl (%rax), %edi
callq 0x191c0
movl %eax, -0x74(%rbp)
movq -0x30(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rdx
movl -0x74(%rbp), %ecx
movl %eax, %r8d
leaq 0x12e98(%rip), %rsi     # 0x2f5e1
movb $0x0, %al
callq 0x52c0
jmp 0x1c752
jmp 0x1c754
jmp 0x1c756
cmpq $0x0, -0x10(%rbp)
je 0x1c76e
movq -0x10(%rbp), %rdi
callq 0x5040
movq $0x0, -0x10(%rbp)
jmp 0x1c770
jmp 0x1c772
cmpq $0x0, -0x18(%rbp)
je 0x1c78a
movq -0x18(%rbp), %rdi
callq 0x5040
movq $0x0, -0x18(%rbp)
jmp 0x1c78c
movl -0x20(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nop