LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_status_code
static int mbim_status_code(MBIM_MESSAGE_HEADER *pMsgHdr) {
    int status = 0;

    if (!pMsgHdr)
        return 0;

    switch (le32toh(pMsgHdr->MessageType)) {
        case MBIM_OPEN_DONE: {
            MBIM_OPEN_DONE_T *pOpenDone = (MBIM_OPEN_DONE_T *)pMsgHdr;
            status = le32toh(pOpenDone->Status);
        }
        break;
        case MBIM_CLOSE_DONE: {
            MBIM_CLOSE_DONE_T *pCloseDone = (MBIM_CLOSE_DONE_T *)pMsgHdr;
            status = le32toh(pCloseDone->Status);
        }
        break;
        case MBIM_COMMAND_DONE: {
            MBIM_COMMAND_DONE_T *pCmdDone = (MBIM_COMMAND_DONE_T *)pMsgHdr;
            status = le32toh(pCmdDone->Status);
        }
        break;
        case MBIM_FUNCTION_ERROR_MSG: {
            MBIM_FUNCTION_ERROR_MSG_T *pErrMsg = (MBIM_FUNCTION_ERROR_MSG_T *)pMsgHdr;
            status = le32toh(pErrMsg->ErrorStatusCode);
            if (status == MBIM_ERROR_NOT_OPENED)
                mbim_open_state = 0; //EM06ELAR03A05M4G when suspend/resume, may get this error
        }
        break;
        default:
        break;
    }

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x174a6
movl $0x0, -0x4(%rbp)
jmp 0x17555
movq -0x10(%rbp), %rax
movl (%rax), %edi
callq 0x191c0
addl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x3, %eax
ja 0x1754d
movq -0x40(%rbp), %rax
leaq 0x16ff8(%rip), %rcx     # 0x2e4c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x191c0
movl %eax, -0x14(%rbp)
jmp 0x1754f
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x191c0
movl %eax, -0x14(%rbp)
jmp 0x1754f
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x191c0
movl %eax, -0x14(%rbp)
jmp 0x1754f
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x191c0
movl %eax, -0x14(%rbp)
cmpl $0x5, -0x14(%rbp)
jne 0x1754b
movl $0x0, 0x21a2d(%rip)     # 0x38f78
jmp 0x1754f
jmp 0x1754f
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_init
static int mbim_init(PROFILE_T *profile) {
    int retval;
    int t = 0;

    if (profile->proxy[0] && !strcmp(profile->proxy, LIBMBIM_PROXY)) {
        retval = mbim_proxy_configure(profile->qmichannel);
        if (retval) goto exit;
    }

    while (t++ < 10) {
        retval = mbim_open_device(4096);
        if (retval != ETIMEDOUT)
            break;
    }
    if (retval) goto exit;
    retval = mbim_device_caps_query(profile);
    if (retval) goto exit;
    mbim_update_state();
    retval = mbim_device_services_query();
    if (retval) goto exit;
    mbim_update_state();
    retval = mbim_set_radio_state(MBIMRadioOn);
    if (retval) goto exit;
    mbim_update_state();

    if (qmi_over_mbim_support) {
        if (!socketpair( AF_LOCAL, SOCK_STREAM, 0, qmi_over_mbim_sk)) {
            qmidev_send = qmi_over_mbim_qmidev_send;
#ifdef CONFIG_CELLINFO //by now, only this function need QMI OVER MBIM
            qmi_over_mbim_nas = qmi_over_mbim_get_client_id(QMUX_TYPE_NAS);
#endif
        }
    }

    return 0;

exit:
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x28(%rax), %eax
cmpl $0x0, %eax
je 0x180d9
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
leaq 0x135a8(%rip), %rsi     # 0x2b657
callq 0x52a0
cmpl $0x0, %eax
jne 0x180d9
movq -0x10(%rbp), %rdi
addq $0x8a, %rdi
callq 0x16c20
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x180d7
jmp 0x18194
jmp 0x180d9
jmp 0x180db
movl -0x18(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x18(%rbp)
cmpl $0xa, %eax
jge 0x18102
movl $0x1000, %edi           # imm = 0x1000
callq 0x1b580
movl %eax, -0x14(%rbp)
cmpl $0x6e, -0x14(%rbp)
je 0x18100
jmp 0x18102
jmp 0x180db
cmpl $0x0, -0x14(%rbp)
je 0x1810d
jmp 0x18194
movq -0x10(%rbp), %rdi
callq 0x1b7d0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x18121
jmp 0x18194
callq 0x1bd30
callq 0x1c0e0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x18136
jmp 0x18194
callq 0x1bd30
movl $0x1, %edi
callq 0x1c460
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x18150
jmp 0x18194
callq 0x1bd30
cmpl $0x0, 0x20f64(%rip)     # 0x390c0
je 0x1818b
movl $0x1, %esi
xorl %edx, %edx
leaq 0x1f2b8(%rip), %rcx     # 0x37424
movl %esi, %edi
callq 0x5300
cmpl $0x0, %eax
jne 0x18189
leaq 0x1fc69(%rip), %rax     # 0x37de8
leaq 0xc9a(%rip), %rcx       # 0x18e20
movq %rcx, (%rax)
jmp 0x1818b
movl $0x0, -0x4(%rbp)
jmp 0x1819a
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_deinit
static int mbim_deinit(void) {
    if (qmi_over_mbim_nas) {
        qmi_over_mbim_release_client_id(QMUX_TYPE_NAS, qmi_over_mbim_nas);
        qmi_over_mbim_nas = 0;
    }
    
    mbim_close_device();

    if (qmi_over_mbim_sk[0] != -1) {
        close(qmi_over_mbim_sk[0]);
        close(qmi_over_mbim_sk[1]);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpb $0x0, 0x20d39(%rip)     # 0x38ef4
je 0x181d5
movl $0x3, %edi
movzbl 0x20d2b(%rip), %esi     # 0x38ef4
callq 0x6b40
movb $0x0, 0x20d1f(%rip)     # 0x38ef4
callq 0x1cb70
cmpl $-0x1, 0x1f243(%rip)    # 0x37424
je 0x181f9
movl 0x1f23b(%rip), %edi     # 0x37424
callq 0x5230
movl 0x1f234(%rip), %edi     # 0x37428
callq 0x5230
xorl %eax, %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
callq 0x1d150
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x18a59
jmp 0x18ae2
callq 0x1bd30
movl 0x20664(%rip), %eax     # 0x390c8
movq %rax, -0x18(%rbp)
subq $0x6, %rax
ja 0x18ad6
movq -0x18(%rbp), %rax
leaq 0x15ac3(%rip), %rcx     # 0x2e53c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movl $0x1, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x2, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x6, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x3, (%rax)
jmp 0x18ae0
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
jmp 0x18ae2
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: requestSetupDataCall
static int requestSetupDataCall(PROFILE_T *profile, int curIpFamily) {
    int retval;

    (void)curIpFamily;

    if (profile->apn)
        mbim_apn = profile->apn;
    if (profile->user)
        mbim_user = profile->user;
    if (profile->password)
        mbim_passwd = profile->password;
    if (profile->auth)
        mbim_auth = profile->auth;
    if (profile->enable_ipv4)
        mbim_iptype = MBIMContextIPTypeIPv4;
    if (profile->enable_ipv6)
        mbim_iptype = MBIMContextIPTypeIPv6;
    if (profile->enable_ipv4 && profile->enable_ipv6)
        mbim_iptype = MBIMContextIPTypeIPv4AndIPv6;

    retval = mbim_set_connect(1, mbim_sessionID);
    if (retval)
        goto exit;

exit:
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x18c47
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, 0x204a1(%rip)     # 0x390e8
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x18c61
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x2048f(%rip)     # 0x390f0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x18c7b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x2047d(%rip)     # 0x390f8
movq -0x8(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x18c92
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x2046e(%rip)     # 0x39100
movq -0x8(%rbp), %rax
cmpb $0x0, 0x50(%rax)
je 0x18ca6
movl $0x1, 0x2045e(%rip)     # 0x39104
movq -0x8(%rbp), %rax
cmpb $0x0, 0x51(%rax)
je 0x18cba
movl $0x2, 0x2044a(%rip)     # 0x39104
movq -0x8(%rbp), %rax
movzbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0x18cde
movq -0x8(%rbp), %rax
movzbl 0x51(%rax), %eax
cmpl $0x0, %eax
je 0x18cde
movl $0x4, 0x20426(%rip)     # 0x39104
movl 0x20400(%rip), %esi     # 0x390e4
movl $0x1, %edi
callq 0x1ddc0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x18cf9
jmp 0x18cfb
jmp 0x18cfb
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: requestQueryDataCall
static int requestQueryDataCall(UCHAR  *pConnectionStatus, int curIpFamily) {
    int retval;

    (void)curIpFamily;

    *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED;

    retval = mbim_query_connect(mbim_sessionID);
    if (retval)
        goto exit;

    switch(ActivationState) {
        case MBIMActivationStateUnknown: *pConnectionStatus = QWDS_PKT_DATA_UNKNOW; break;
        case MBIMActivationStateActivated: *pConnectionStatus = QWDS_PKT_DATA_CONNECTED; break;
        case MBIMActivationStateActivating: *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED; break;
        case MBIMActivationStateDeactivated: *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED; break;
        case MBIMActivationStateDeactivating: *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED; break;
        default: *pConnectionStatus = QWDS_PKT_DATA_DISCONNECTED; break;
    }

exit:
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
movl 0x203b8(%rip), %edi     # 0x390e4
callq 0x1e5b0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x18d3c
jmp 0x18d96
movl 0x2039e(%rip), %eax     # 0x390e0
movq %rax, -0x18(%rbp)
subq $0x4, %rax
ja 0x18d8d
movq -0x18(%rbp), %rax
leaq 0x15831(%rip), %rcx     # 0x2e588
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
jmp 0x18d94
movq -0x8(%rbp), %rax
movb $0x2, (%rax)
jmp 0x18d94
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
jmp 0x18d94
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
jmp 0x18d94
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
jmp 0x18d94
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
jmp 0x18d96
movl -0x10(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: requestDeactivateDefaultPDP
static int requestDeactivateDefaultPDP(PROFILE_T *profile, int curIpFamily) {
    int retval;
    
    (void)profile;
    (void)curIpFamily;

    retval = mbim_set_connect(0, mbim_sessionID);
    if (retval)
        goto exit;

exit:
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl 0x2032f(%rip), %esi     # 0x390e4
xorl %edi, %edi
callq 0x1ddc0
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x18dc7
jmp 0x18dc9
jmp 0x18dc9
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: requestGetIPAddress
static int requestGetIPAddress(PROFILE_T *profile, int curIpFamily) {
    int retval;
    
    (void)curIpFamily;
    retval = mbim_ip_config(profile, mbim_sessionID);
    if (retval)
        goto exit;

exit:
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl 0x202eb(%rip), %esi     # 0x390e4
callq 0x1e870
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x18e09
jmp 0x18e0b
jmp 0x18e0b
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: compose_qmi_over_mbim_command
static MBIM_MESSAGE_HEADER *compose_qmi_over_mbim_command(UINT32 CID, UINT32 CommandType, void *pInformationBuffer, UINT32 InformationBufferLength)
{
    MBIM_COMMAND_MSG_T *pRequest = (MBIM_COMMAND_MSG_T *)compose_basic_connect_command(CID, CommandType, pInformationBuffer, InformationBufferLength);

    if (!pRequest)
        return NULL;

    memcpy(pRequest->DeviceServiceId.uuid, str2uuid(uuid_ext_qmux), 16);

    return &pRequest->MessageHeader;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x16eb0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1917c
movq $0x0, -0x8(%rbp)
jmp 0x191ae
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x15d85(%rip), %rdi     # 0x2ef10
callq 0x17000
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x14(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x1c(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMMSGTypeStr
static const char *MBIMMSGTypeStr(int _val) {
    struct { int val;char *name;} _enumstr[] = { 
        {MBIM_OPEN_MSG, "MBIM_OPEN_MSG"}, 
        {MBIM_CLOSE_MSG, "MBIM_CLOSE_MSG"}, 
        {MBIM_COMMAND_MSG, "MBIM_COMMAND_MSG"}, 
        {MBIM_HOST_ERROR_MSG, "MBIM_HOST_ERROR_MSG"}, 
        {MBIM_OPEN_DONE, "MBIM_OPEN_DONE"}, 
        {MBIM_CLOSE_DONE, "MBIM_CLOSE_DONE"}, 
        {MBIM_COMMAND_DONE, "MBIM_COMMAND_DONE"}, 
        {MBIM_FUNCTION_ERROR_MSG, "MBIM_FUNCTION_ERROR_MSG"}, 
        {MBIM_INDICATE_STATUS_MSG, "MBIM_INDICATE_STATUS_MSG"}, 
    }; 
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) { 
        if (_val == _enumstr[idx].val) 
            return _enumstr[idx].name;
    } 

    return "MBIMMSGTypeUnknow"; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl %edi, -0xc(%rbp)
leaq -0x80(%rbp), %rdi
leaq 0x1b907(%rip), %rsi     # 0x36550
movl $0x6c, %edx
callq 0x52f0
movl $0x0, -0x84(%rbp)
cmpl $0x9, -0x84(%rbp)
jge 0x1acae
movl -0xc(%rbp), %eax
movslq -0x84(%rbp), %rdx
leaq -0x80(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1ac9b
movslq -0x84(%rbp), %rcx
leaq -0x80(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1acb9
jmp 0x1ac9d
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x1ac5d
leaq 0x13be4(%rip), %rax     # 0x2e899
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: uuid2str
static const char * uuid2str(const UUID_T *pUUID) {
    static char str[16*2+4+1];
    const UINT8 *d = pUUID->uuid;

    snprintf(str, sizeof(str), "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x",
        d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
        d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);

    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movzbl (%rax), %ecx
movq -0x38(%rbp), %rax
movzbl 0x1(%rax), %r8d
movq -0x38(%rbp), %rax
movzbl 0x2(%rax), %r9d
movq -0x38(%rbp), %rax
movzbl 0x3(%rax), %eax
movq -0x38(%rbp), %rdx
movzbl 0x4(%rdx), %edx
movl %edx, -0x4c(%rbp)
movq -0x38(%rbp), %rdx
movzbl 0x5(%rdx), %edx
movl %edx, -0x48(%rbp)
movq -0x38(%rbp), %rdx
movzbl 0x6(%rdx), %edx
movl %edx, -0x44(%rbp)
movq -0x38(%rbp), %rdx
movzbl 0x7(%rdx), %edx
movl %edx, -0x40(%rbp)
movq -0x38(%rbp), %rdx
movzbl 0x8(%rdx), %r13d
movq -0x38(%rbp), %rdx
movzbl 0x9(%rdx), %r12d
movq -0x38(%rbp), %rdx
movzbl 0xa(%rdx), %r15d
movq -0x38(%rbp), %rdx
movzbl 0xb(%rdx), %r14d
movq -0x38(%rbp), %rdx
movzbl 0xc(%rdx), %ebx
movq -0x38(%rbp), %rdx
movzbl 0xd(%rdx), %r11d
movq -0x38(%rbp), %rdx
movzbl 0xe(%rdx), %r10d
movq -0x38(%rbp), %rdx
movzbl 0xf(%rdx), %edx
movl %edx, -0x3c(%rbp)
leaq 0x1dff3(%rip), %rdi     # 0x38f90
movl $0x25, %esi
leaq 0x136b6(%rip), %rdx     # 0x2e65f
movl %eax, (%rsp)
movl -0x4c(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x48(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x44(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x40(%rbp), %eax
movl %eax, 0x20(%rsp)
movl -0x3c(%rbp), %eax
movl %r13d, 0x28(%rsp)
movl %r12d, 0x30(%rsp)
movl %r15d, 0x38(%rsp)
movl %r14d, 0x40(%rsp)
movl %ebx, 0x48(%rsp)
movl %r11d, 0x50(%rsp)
movl %r10d, 0x58(%rsp)
movl %eax, 0x60(%rsp)
movb $0x0, %al
callq 0x51c0
leaq 0x1df91(%rip), %rax     # 0x38f90
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: DeviceServiceId2str
static const char *DeviceServiceId2str(const UUID_T *pUUID) {
    const char *str = uuid2str(pUUID);

    struct { char *val;char *name;} _enumstr[] = {
        {UUID_BASIC_CONNECT, "UUID_BASIC_CONNECT"},
        {UUID_BASIC_CONNECT_EXT, "UUID_BASIC_CONNECT_EXT"},
        {UUID_SMS, "UUID_SMS"},
        {UUID_USSD, "UUID_USSD"},
        {UUID_PHONEBOOK, "UUID_PHONEBOOK"},
        {UUID_STK, "UUID_STK"},
        {UUID_AUTH, "UUID_AUTH"},
        {UUID_DSS, "UUID_DSS"},
        {uuid_ext_qmux, "uuid_ext_qmux"},
        {uuid_mshsd, "uuid_mshsd"},
        {uuid_qmbe, "uuid_qmbe"},
        {UUID_MSFWID, "UUID_MSFWID"},
        {uuid_atds, "uuid_atds"},
        {uuid_qdu, "uuid_qdu"},
        {UUID_MS_UICC_LOW_LEVEL, "UUID_MS_UICC_LOW_LEVEL"},
        {UUID_MS_SARControl, "UUID_MS_SARControl"},
        {UUID_VOICEEXTENSIONS, "UUID_VOICEEXTENSIONS"},
        {UUID_LIBMBIM_PROXY, "UUID_LIBMBIM_PROXY"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (!strcasecmp(str, _enumstr[idx].val))
            return _enumstr[idx].name;
    }

    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1aee0
movq %rax, -0x18(%rbp)
leaq -0x140(%rbp), %rdi
leaq 0x1b8e6(%rip), %rsi     # 0x36930
movl $0x120, %edx            # imm = 0x120
callq 0x52f0
movl $0x0, -0x144(%rbp)
cmpl $0x12, -0x144(%rbp)
jge 0x1b0bf
movq -0x18(%rbp), %rdi
movslq -0x144(%rbp), %rcx
leaq -0x140(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x5050
cmpl $0x0, %eax
jne 0x1b0ac
movslq -0x144(%rbp), %rcx
leaq -0x140(%rbp), %rax
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b0c7
jmp 0x1b0ae
movl -0x144(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x144(%rbp)
jmp 0x1b05e
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMActivationStateStr
static const char *MBIMActivationStateStr(int _val) {
    struct { int val;char *name;} _enumstr[] = {
        {MBIMActivationStateUnknown, "Unknown"},
        {MBIMActivationStateActivated, "Activated"},
        {MBIMActivationStateActivating, "Activating"},
        {MBIMActivationStateDeactivated, "Deactivated"},
        {MBIMActivationStateDeactivating, "Deactivating"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    }

    return "Undefined";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0xc(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1b95a(%rip), %rsi     # 0x36a50
movl $0x3c, %edx
callq 0x52f0
movl $0x0, -0x54(%rbp)
cmpl $0x5, -0x54(%rbp)
jge 0x1b149
movl -0xc(%rbp), %eax
movslq -0x54(%rbp), %rdx
leaq -0x50(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b13c
movslq -0x54(%rbp), %rcx
leaq -0x50(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b154
jmp 0x1b13e
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1b107
leaq 0x1402d(%rip), %rax     # 0x2f17d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMContextIPTypeStr
static const char *MBIMContextIPTypeStr(int _val) { 
    struct { int val;char *name;} _enumstr[] = { 
        {MBIMContextIPTypeDefault, "MBIMContextIPTypeDefault"}, 
        {MBIMContextIPTypeIPv4, "MBIMContextIPTypeIPv4"}, 
        {MBIMContextIPTypeIPv6, "MBIMContextIPTypeIPv6"}, 
        {MBIMContextIPTypeIPv4v6, "MBIMContextIPTypeIPv4v6"}, 
        {MBIMContextIPTypeIPv4AndIPv6, "MBIMContextIPTypeIPv4AndIPv6"}, 
    }; 
    int idx; 

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    } 

    return "MBIMContextIPTypeUnknow"; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0xc(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1b91a(%rip), %rsi     # 0x36a90
movl $0x3c, %edx
callq 0x52f0
movl $0x0, -0x54(%rbp)
cmpl $0x5, -0x54(%rbp)
jge 0x1b1c9
movl -0xc(%rbp), %eax
movslq -0x54(%rbp), %rdx
leaq -0x50(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b1bc
movslq -0x54(%rbp), %rcx
leaq -0x50(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b1d4
jmp 0x1b1be
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1b187
leaq 0x14031(%rip), %rax     # 0x2f201
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMVoiceCallStateStr
static const char *MBIMVoiceCallStateStr(int _val) {
    struct { int val;char *name;} _enumstr[] = {
        {MBIMVoiceCallStateNone, "None"},
        {MBIMVoiceCallStateInProgress, "InProgress"},
        {MBIMVoiceCallStateHangUp, "HangUp"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
        return _enumstr[idx].name;
    }

    return "Undefined";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
leaq -0x30(%rbp), %rdi
leaq 0x1b8da(%rip), %rsi     # 0x36ad0
movl $0x24, %edx
callq 0x52f0
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x1b249
movl -0xc(%rbp), %eax
movslq -0x34(%rbp), %rdx
leaq -0x30(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b23c
movslq -0x34(%rbp), %rcx
leaq -0x30(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b254
jmp 0x1b23e
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1b207
leaq 0x13f2d(%rip), %rax     # 0x2f17d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMPacketServiceStateStr
static const char *MBIMPacketServiceStateStr(int _val) {
    struct { int val;char *name;} _enumstr[] = {
        {MBIMPacketServiceStateUnknown, "Unknown"},
        {MBIMPacketServiceStateAttaching, "Attaching"},
        {MBIMPacketServiceStateAttached, "Attached"},
        {MBIMPacketServiceStateDetaching, "Detaching"},
        {MBIMPacketServiceStateDetached, "Detached"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    }

    return "Undefined";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl %edi, -0xc(%rbp)
leaq -0x50(%rbp), %rdi
leaq 0x1b88a(%rip), %rsi     # 0x36b00
movl $0x3c, %edx
callq 0x52f0
movl $0x0, -0x54(%rbp)
cmpl $0x5, -0x54(%rbp)
jge 0x1b2c9
movl -0xc(%rbp), %eax
movslq -0x54(%rbp), %rdx
leaq -0x50(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b2bc
movslq -0x54(%rbp), %rcx
leaq -0x50(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b2d4
jmp 0x1b2be
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x1b287
leaq 0x13ead(%rip), %rax     # 0x2f17d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMDataClassStr
static const char *MBIMDataClassStr(int _val) {
    struct { int val;char *name;} _enumstr[] = {
        {MBIMDataClassNone, "None"},
        {MBIMDataClassGPRS, "GPRS"},
        {MBIMDataClassEDGE, "EDGE"},
        {MBIMDataClassUMTS, "UMTS"},
        {MBIMDataClassHSDPA, "HSDPA"},
        {MBIMDataClassHSUPA, "HSUPA"},
        {MBIMDataClassLTE, "LTE"},
        {MBIMDataClass5G_NSA, "5G_NSA"},
        {MBIMDataClass5G_SA, "5G_SA"},
        {MBIMDataClass1XRTT, "1XRTT"},
        {MBIMDataClass1XEVDO, "1XEVDO"},
        {MBIMDataClass1XEVDORevA, "1XEVDORevA"},
        {MBIMDataClass1XEVDV, "1XEVDV"},
        {MBIMDataClass3XRTT, "3XRTT"},
        {MBIMDataClass1XEVDORevB, "1XEVDORevB"},
        {MBIMDataClassUMB, "UMB"},
        {MBIMDataClassCustom, "Custom"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    }

    return "Unknow";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movl %edi, -0xc(%rbp)
leaq -0xe0(%rbp), %rdi
leaq 0x1b844(%rip), %rsi     # 0x36b40
movl $0xcc, %edx
callq 0x52f0
movl $0x0, -0xe4(%rbp)
cmpl $0x11, -0xe4(%rbp)
jge 0x1b367
movl -0xc(%rbp), %eax
movslq -0xe4(%rbp), %rdx
leaq -0xe0(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b354
movslq -0xe4(%rbp), %rcx
leaq -0xe0(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b372
jmp 0x1b356
movl -0xe4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xe4(%rbp)
jmp 0x1b310
leaq 0x13536(%rip), %rax     # 0x2e8a4
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMSubscriberReadyStateStr
static const char *MBIMSubscriberReadyStateStr(int _val) {
    struct { int val;char *name;} _enumstr[] = {
        {MBIMSubscriberReadyStateNotInitialized, "NotInitialized"},
        {MBIMSubscriberReadyStateInitialized, "Initialized"},
        {MBIMSubscriberReadyStateSimNotInserted, "NotInserted"},
        {MBIMSubscriberReadyStateBadSim, "BadSim"},
        {MBIMSubscriberReadyStateFailure, "Failure"},
        {MBIMSubscriberReadyStateNotActivated, "NotActivated"},
        {MBIMSubscriberReadyStateDeviceLocked, "DeviceLocked"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    }

    return "Undefined";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0xc(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x1b86a(%rip), %rsi     # 0x36c10
movl $0x54, %edx
callq 0x52f0
movl $0x0, -0x64(%rbp)
cmpl $0x7, -0x64(%rbp)
jge 0x1b3f9
movl -0xc(%rbp), %eax
movslq -0x64(%rbp), %rdx
leaq -0x60(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b3ec
movslq -0x64(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b404
jmp 0x1b3ee
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1b3b7
leaq 0x13d7d(%rip), %rax     # 0x2f17d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_get_segment
static const char *mbim_get_segment(void *_pMsg, UINT32 offset, UINT32 len)
{
    int idx;
    static char buff[256] = {'\0'};
    UINT8 *pMsg = (UINT8*)_pMsg;

    for (idx = 0; idx < (int)(len/2); idx++)
        buff[idx] = pMsg[offset+idx*2];
    buff[idx] = '\0';
    return buff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x10(%rbp), %ecx
shrl %ecx
cmpl %ecx, %eax
jge 0x1b465
movq -0x20(%rbp), %rax
movl -0xc(%rbp), %ecx
movl -0x14(%rbp), %edx
shll %edx
addl %edx, %ecx
movl %ecx, %ecx
movb (%rax,%rcx), %dl
movslq -0x14(%rbp), %rcx
leaq 0x1db69(%rip), %rax     # 0x38fc0
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1b42d
movslq -0x14(%rbp), %rcx
leaq 0x1db50(%rip), %rax     # 0x38fc0
movb $0x0, (%rax,%rcx)
leaq 0x1db45(%rip), %rax     # 0x38fc0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMRegisterStateStr
static const char *MBIMRegisterStateStr(int _val) {
    struct { int val;char *name;} _enumstr[] ={
        {MBIMRegisterStateUnknown, "Unknown"},
        {MBIMRegisterStateDeregistered, "Deregistered"},
        {MBIMRegisterStateSearching, "Searching"},
        {MBIMRegisterStateHome, "Home"},
        {MBIMRegisterStateRoaming, "Roaming"},
        {MBIMRegisterStatePartner, "Partner"},
        {MBIMRegisterStateDenied, "Denied"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    }

    return "Undefined";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0xc(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x1b7da(%rip), %rsi     # 0x36c70
movl $0x54, %edx
callq 0x52f0
movl $0x0, -0x64(%rbp)
cmpl $0x7, -0x64(%rbp)
jge 0x1b4e9
movl -0xc(%rbp), %eax
movslq -0x64(%rbp), %rdx
leaq -0x60(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b4dc
movslq -0x64(%rbp), %rcx
leaq -0x60(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b4f4
jmp 0x1b4de
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1b4a7
leaq 0x13c8d(%rip), %rax     # 0x2f17d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: MBIMRegisterModeStr
static const char *MBIMRegisterModeStr(int _val) {
    struct { int val;char *name;} _enumstr[] = {
        {MBIMRegisterModeUnknown, "Unknown"},
        {MBIMRegisterModeAutomatic, "Automatic"},
        {MBIMRegisterModeManual, "Manual"},
    };
    int idx;

    for (idx = 0; idx < (int)(sizeof(_enumstr)/sizeof(_enumstr[0])); idx++) {
        if (_val == _enumstr[idx].val)
            return _enumstr[idx].name;
    }

    return "Undefined";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0xc(%rbp)
leaq -0x30(%rbp), %rdi
leaq 0x1b7ba(%rip), %rsi     # 0x36cd0
movl $0x24, %edx
callq 0x52f0
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x1b569
movl -0xc(%rbp), %eax
movslq -0x34(%rbp), %rdx
leaq -0x30(%rbp), %rcx
imulq $0xc, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x1b55c
movslq -0x34(%rbp), %rcx
leaq -0x30(%rbp), %rax
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movq 0x4(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1b574
jmp 0x1b55e
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1b527
leaq 0x13c0d(%rip), %rax     # 0x2f17d
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: compose_open_command
static MBIM_MESSAGE_HEADER *compose_open_command(UINT32 MaxControlTransfer)
{
    MBIM_OPEN_MSG_T *pRequest = (MBIM_OPEN_MSG_T *)mbim_alloc(sizeof(MBIM_OPEN_MSG_T));

    if(!pRequest)
        return NULL;

    pRequest->MessageHeader.MessageType = htole32(MBIM_OPEN_MSG);
    pRequest->MessageHeader.MessageLength = htole32(sizeof(MBIM_OPEN_MSG_T));
    pRequest->MessageHeader.TransactionId = htole32(TransactionId++);
    pRequest->MaxControlTransfer = htole32(MaxControlTransfer);

    return &pRequest->MessageHeader;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl $0x10, %edi
callq 0x5370
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1c7ca
movq $0x0, -0x8(%rbp)
jmp 0x1c827
movl $0x1, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movl $0x10, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x1ac37(%rip), %edi     # 0x3742c
movl %edi, %eax
addl $0x1, %eax
movl %eax, 0x1ac2c(%rip)     # 0x3742c
callq 0x191c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movl -0xc(%rbp), %edi
callq 0x191c0
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: wchar2char
static void wchar2char(const char *src, size_t src_size, char *dst, size_t dst_len) {
    size_t i;
    
    for (i = 0; i < (dst_len-1) && i < (src_size/2); i++)
        dst[i] = src[i*2];
    dst[i] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rdx
subq $0x1, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x29(%rbp)
jae 0x1c886
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
setb %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x1c88f
jmp 0x1c8b6
movq -0x8(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq %rcx
movb (%rax,%rcx), %dl
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1c85c
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: compose_basic_connect_ext_command
static MBIM_MESSAGE_HEADER *compose_basic_connect_ext_command(UINT32 CID, UINT32 CommandType, void *pInformationBuffer, UINT32 InformationBufferLength)
{
    MBIM_COMMAND_MSG_T *pRequest = (MBIM_COMMAND_MSG_T *)compose_basic_connect_command(CID, CommandType, pInformationBuffer, InformationBufferLength);

    if (!pRequest)
        return NULL;

    memcpy(pRequest->DeviceServiceId.uuid, str2uuid(UUID_BASIC_CONNECT_EXT), 16);

    return &pRequest->MessageHeader;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x16eb0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1cb2c
movq $0x0, -0x8(%rbp)
jmp 0x1cb5e
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x11bf7(%rip), %rdi     # 0x2e732
callq 0x17000
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x14(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x1c(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: compose_close_command
static MBIM_MESSAGE_HEADER *compose_close_command(void)
{
    MBIM_CLOSE_MSG_T *pRequest = (MBIM_CLOSE_MSG_T *)mbim_alloc(sizeof(MBIM_CLOSE_MSG_T));

    if(!pRequest)
        return NULL;

    pRequest->MessageHeader.MessageType = htole32(MBIM_CLOSE_MSG);
    pRequest->MessageHeader.MessageLength = htole32(sizeof(MBIM_CLOSE_MSG_T));
    pRequest->MessageHeader.TransactionId = htole32(TransactionId++);

    return &pRequest->MessageHeader;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0xc, %edi
callq 0x5370
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1cde7
movq $0x0, -0x8(%rbp)
jmp 0x1ce33
movl $0x2, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0xc, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x1a61a(%rip), %edi     # 0x3742c
movl %edi, %eax
addl $0x1, %eax
movl %eax, 0x1a60f(%rip)     # 0x3742c
callq 0x191c0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: mbim_proxy_read
static ssize_t mbim_proxy_read (int fd, MBIM_MESSAGE_HEADER *pResponse, size_t size) {
    ssize_t nreads;

    nreads = read(fd, pResponse, sizeof(MBIM_MESSAGE_HEADER));
    if (nreads == sizeof(MBIM_MESSAGE_HEADER) && le32toh(pResponse->MessageLength) <= size) {
        nreads += read(fd, pResponse+1, le32toh(pResponse->MessageLength) - sizeof(MBIM_MESSAGE_HEADER));
    }

    return nreads;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
movl $0xc, %edx
callq 0x5250
movq %rax, -0x20(%rbp)
cmpq $0xc, -0x20(%rbp)
jne 0x1cebd
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movl %eax, %eax
cmpq -0x18(%rbp), %rax
ja 0x1cebd
movl -0x4(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x191c0
movl -0x2c(%rbp), %edi
movq -0x28(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
subq $0xc, %rdx
callq 0x5250
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/device.c
// Function: query_usb_device_info
static void query_usb_device_info(char *path, struct usb_device_info *p) {
    size_t offset = strlen(path);

    memset(p, 0, sizeof(*p));

    path[offset] = '\0';
    strcat(path, "/idVendor");
    p->idVendor = file_get_value(path, 16);

    if (p->idVendor == CM_INVALID_VAL)
        return;

    path[offset] = '\0';
    strcat(path, "/idProduct");
    p->idProduct = file_get_value(path, 16);

    path[offset] = '\0';
    strcat(path, "/busnum");
    p->busnum = file_get_value(path, 10);

    path[offset] = '\0';
    strcat(path, "/devnum");
    p->devnum = file_get_value(path, 10);

    path[offset] = '\0';
    strcat(path, "/bNumInterfaces");
    p->bNumInterfaces = file_get_value(path, 10);

    path[offset] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x5160
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x5200
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xeeec(%rip), %rsi      # 0x30060
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
cmpl $-0x1, (%rax)
jne 0x2119d
jmp 0x21275
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xeeb6(%rip), %rsi      # 0x3006a
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0x10, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xee8e(%rip), %rsi      # 0x30075
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xee63(%rip), %rsi      # 0x3007d
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
leaq 0xee38(%rip), %rsi      # 0x30085
callq 0x54d0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0x22ee0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb $0x0, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/device.c
// Function: dir_get_child
static int dir_get_child(const char *dirname, char *buff, unsigned bufsize, const char *prefix)
{
    struct dirent *entptr = NULL;
    DIR *dirptr;

    buff[0] = 0;

    dirptr = opendir(dirname);
    if (!dirptr)
        return -1;

    while ((entptr = readdir(dirptr))) {
        if (entptr->d_name[0] == '.')
            continue;
        if (prefix && strlen(prefix) && strncmp(entptr->d_name, prefix, strlen(prefix)))
            continue;
        snprintf(buff, bufsize, "%s", entptr->d_name);
        break;
    }
    closedir(dirptr);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x5140
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x212c6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x21363
jmp 0x212c8
movq -0x38(%rbp), %rdi
callq 0x5320
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x21353
movq -0x30(%rbp), %rax
movsbl 0x13(%rax), %eax
cmpl $0x2e, %eax
jne 0x212ea
jmp 0x212c8
cmpq $0x0, -0x28(%rbp)
je 0x21334
movq -0x28(%rbp), %rdi
callq 0x5160
cmpq $0x0, %rax
je 0x21334
movq -0x30(%rbp), %rax
addq $0x13, %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5160
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq %rax, %rdx
callq 0x5090
cmpl $0x0, %eax
je 0x21334
jmp 0x212c8
movq -0x18(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %esi
movq -0x30(%rbp), %rcx
addq $0x13, %rcx
leaq 0xed0e(%rip), %rdx      # 0x3005a
movb $0x0, %al
callq 0x51c0
movq -0x38(%rbp), %rdi
callq 0x5240
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/device.c
// Function: get_driver_type
int get_driver_type(PROFILE_T *profile)
{
    /* QMI_WWAN */
    if (profile->usb_intf.bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
        return SOFTWARE_QMI;
    }
    else if (profile->usb_intf.bInterfaceClass == USB_CLASS_COMM) {
        switch (profile->usb_intf.bInterfaceSubClass) {
            case USB_CDC_SUBCLASS_MBIM:
                return SOFTWARE_MBIM;
            break;
            case USB_CDC_SUBCLASS_ETHERNET:
            case USB_CDC_SUBCLASS_NCM:
                return SOFTWARE_ECM_RNDIS_NCM;
            break;
            default:
            break;
        }
    }
    else if (profile->usb_intf.bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER) {
        if (profile->usb_intf.bInterfaceSubClass == 1 && profile->usb_intf.bInterfaceProtocol == 3)
            return SOFTWARE_ECM_RNDIS_NCM;
    }

    dbg_time("%s unknow bInterfaceClass=%d, bInterfaceSubClass=%d", __func__,
        profile->usb_intf.bInterfaceClass, profile->usb_intf.bInterfaceSubClass);
    return DRV_INVALID;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0xff, 0x1dd(%rax)
jne 0x21608
movl $0x1, -0x4(%rbp)
jmp 0x21737
movq -0x10(%rbp), %rax
cmpl $0x2, 0x1dd(%rax)
jne 0x21659
movq -0x10(%rbp), %rax
movl 0x1e1(%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x6, %eax
je 0x21649
jmp 0x21629
movl -0x14(%rbp), %eax
subl $0xd, %eax
je 0x21649
jmp 0x21633
movl -0x14(%rbp), %eax
subl $0xe, %eax
jne 0x21655
jmp 0x2163d
movl $0x2, -0x4(%rbp)
jmp 0x21737
movl $0x3, -0x4(%rbp)
jmp 0x21737
jmp 0x21657
jmp 0x21693
movq -0x10(%rbp), %rax
cmpl $0xe0, 0x1dd(%rax)
jne 0x21691
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1e1(%rax)
jne 0x2168f
movq -0x10(%rbp), %rax
cmpl $0x3, 0x1e5(%rax)
jne 0x2168f
movl $0x3, -0x4(%rbp)
jmp 0x21737
jmp 0x21691
jmp 0x21693
jmp 0x21695
jmp 0x21697
movq 0x15942(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x13930
movq -0x20(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl 0x1dd(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x1e1(%rax), %r9d
leaq 0xe5ed(%rip), %rsi      # 0x2fcbb
leaq 0xe620(%rip), %rcx      # 0x2fcf5
movb $0x0, %al
callq 0x52c0
leaq 0x16785(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x2172e
leaq 0x16778(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x13930
movq -0x28(%rbp), %rdi
movq %rax, %rdx
movq -0x10(%rbp), %rax
movl 0x1dd(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x1e1(%rax), %r9d
leaq 0xe59b(%rip), %rsi      # 0x2fcbb
leaq 0xe5ce(%rip), %rcx      # 0x2fcf5
movb $0x0, %al
callq 0x52c0
jmp 0x21730
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq