LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: DmsUIMVerifyPinReqSend
static USHORT DmsUIMVerifyPinReqSend(PQMUX_MSG pMUXMsg, void *arg) {
    pMUXMsg->UIMVerifyPinReq.TLVType = 0x01;
    pMUXMsg->UIMVerifyPinReq.PINID = 0x01; //Pin1, not Puk
    pMUXMsg->UIMVerifyPinReq.PINLen = strlen((const char *)arg);
    qstrcpy((char *)&pMUXMsg->UIMVerifyPinReq.PINValue, ((const char *)arg));
    pMUXMsg->UIMVerifyPinReq.TLVLength = cpu_to_le16(2 + strlen((const char *)arg));
    return sizeof(QMIDMS_UIM_VERIFY_PIN_REQ_MSG) + (strlen((const char *)arg) - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x7(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0xa(%rax)
movq -0x10(%rbp), %rdi
callq 0x5160
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x8(%rbp), %rdi
addq $0x3, %rdi
addq $0x9, %rdi
movq -0x10(%rbp), %rsi
callq 0x11cb0
movq -0x10(%rbp), %rdi
callq 0x5160
addq $0x2, %rax
movzwl %ax, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x10(%rbp), %rdi
callq 0x5160
subq $0x1, %rax
addq $0xa, %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: qstrcpy
static char *qstrcpy(char *to, const char *from) { //no __strcpy_chk
	char *save = to;
	for (; (*to = *from) != '\0'; ++from, ++to);
	return(save);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb (%rax), %al
movq -0x8(%rbp), %rcx
movb %al, (%rcx)
movsbl %al, %eax
cmpl $0x0, %eax
je 0x11cf4
jmp 0x11cda
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x11cc4
movq -0x18(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: WdsGetProfileSettingsReqSend
static USHORT WdsGetProfileSettingsReqSend(PQMUX_MSG pMUXMsg, void *arg) {
    PROFILE_T *profile = (PROFILE_T *)arg;
    pMUXMsg->GetProfileSettingsReq.Length = cpu_to_le16(sizeof(QMIWDS_GET_PROFILE_SETTINGS_REQ_MSG) - 4);
    pMUXMsg->GetProfileSettingsReq.TLVType = 0x01;
    pMUXMsg->GetProfileSettingsReq.TLVLength = cpu_to_le16(0x02);
    pMUXMsg->GetProfileSettingsReq.ProfileType = 0x00; // 0 ~ 3GPP, 1 ~ 3GPP2
    pMUXMsg->GetProfileSettingsReq.ProfileIndex = profile->pdp;
    return sizeof(QMIWDS_GET_PROFILE_SETTINGS_REQ_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x5, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x7(%rax)
movl $0x2, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xa(%rax)
movq -0x18(%rbp), %rax
movl 0x48(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movw $0x9, %ax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: WdsCreateProfileSettingsReqSend
static USHORT WdsCreateProfileSettingsReqSend(PQMUX_MSG pMUXMsg, void *arg) {
    PROFILE_T *profile = (PROFILE_T *)arg;
    pMUXMsg->CreatetProfileSettingsReq.Length = cpu_to_le16(sizeof(QMIWDS_CREATE_PROFILE_SETTINGS_REQ_MSG) - 4);
    pMUXMsg->CreatetProfileSettingsReq.TLVType = 0x01;
    pMUXMsg->CreatetProfileSettingsReq.TLVLength = cpu_to_le16(0x01);
    pMUXMsg->CreatetProfileSettingsReq.ProfileType = 0x00; // 0 ~ 3GPP, 1 ~ 3GPP2
    pMUXMsg->CreatetProfileSettingsReq.TLV2Type = 0x25;
    pMUXMsg->CreatetProfileSettingsReq.TLV2Length = cpu_to_le16(0x01);
    pMUXMsg->CreatetProfileSettingsReq.pdp_context = profile->pdp; // 0 ~ 3GPP, 1 ~ 3GPP2
    return sizeof(QMIWDS_CREATE_PROFILE_SETTINGS_REQ_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x8, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x5(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x7(%rax)
movl $0x1, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0xa(%rax)
movq -0x8(%rbp), %rax
movb $0x25, 0xb(%rax)
movl $0x1, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0xc(%rax)
movq -0x18(%rbp), %rax
movl 0x48(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xe(%rax)
movw $0xc, %ax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: quectel_convert_cdma_mcc_2_ascii_mcc
static void quectel_convert_cdma_mcc_2_ascii_mcc( USHORT *p_mcc, USHORT mcc )
{
  unsigned int d1, d2, d3, buf = mcc + 111;

  if ( mcc == 0x3FF ) // wildcard
  {
    *p_mcc = 3;
  }
  else
  {
    d3 = buf % 10;
    buf = ( d3 == 0 ) ? (buf-10)/10 : buf/10;

    d2 = buf % 10;
    buf = ( d2 == 0 ) ? (buf-10)/10 : buf/10;

    d1 = ( buf == 10 ) ? 0 : buf;

//dbg_time("d1:%d, d2:%d,d3:%d",d1,d2,d3);
    if ( d1<10 && d2<10 && d3<10 )
    {
    *p_mcc = d1*100+d2*10+d3;
#if 0
      *(p_mcc+0) = '0' + d1;
      *(p_mcc+1) = '0' + d2;
      *(p_mcc+2) = '0' + d3;
#endif
    }
    else
    {
      //dbg_time( "invalid digits %d %d %d", d1, d2, d3 );
      *p_mcc = 0;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %eax
addl $0x6f, %eax
movl %eax, -0x1c(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x3ff, %eax            # imm = 0x3FF
jne 0x12f82
movq -0x8(%rbp), %rax
movw $0x3, (%rax)
jmp 0x1304d
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
jne 0x12fab
movl -0x1c(%rbp), %eax
subl $0xa, %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x20(%rbp)
jmp 0x12fba
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x12fe9
movl -0x1c(%rbp), %eax
subl $0xa, %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x24(%rbp)
jmp 0x12ff8
movl -0x1c(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x1c(%rbp)
cmpl $0xa, -0x1c(%rbp)
jne 0x1300b
xorl %eax, %eax
movl %eax, -0x28(%rbp)
jmp 0x13011
movl -0x1c(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0xa, -0x10(%rbp)
jae 0x13042
cmpl $0xa, -0x14(%rbp)
jae 0x13042
cmpl $0xa, -0x18(%rbp)
jae 0x13042
imull $0x64, -0x10(%rbp), %eax
imull $0xa, -0x14(%rbp), %ecx
addl %ecx, %eax
addl -0x18(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x1304b
movq -0x8(%rbp), %rax
movw $0x0, (%rax)
jmp 0x1304d
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: quectel_convert_cdma_mnc_2_ascii_mnc
static void quectel_convert_cdma_mnc_2_ascii_mnc( USHORT *p_mnc, USHORT imsi_11_12)
{
  unsigned int d1, d2, buf = imsi_11_12 + 11;

  if ( imsi_11_12 == 0x7F ) // wildcard
  {
    *p_mnc = 7;
  }
  else
  {
    d2 = buf % 10;
    buf = ( d2 == 0 ) ? (buf-10)/10 : buf/10;

    d1 = ( buf == 10 ) ? 0 : buf;

    if ( d1<10 && d2<10 )
    {
     *p_mnc = d1*10 + d2;
    }
    else
    {
      //dbg_time( "invalid digits %d %d", d1, d2, 0 );
      *p_mnc = 0;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movzwl -0xa(%rbp), %eax
addl $0xb, %eax
movl %eax, -0x18(%rbp)
movzwl -0xa(%rbp), %eax
cmpl $0x7f, %eax
jne 0x13080
movq -0x8(%rbp), %rax
movw $0x7, (%rax)
jmp 0x13101
movl -0x18(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x130a9
movl -0x18(%rbp), %eax
subl $0xa, %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x1c(%rbp)
jmp 0x130b8
movl -0x18(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x18(%rbp)
cmpl $0xa, -0x18(%rbp)
jne 0x130cb
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0x130d1
movl -0x18(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0xa, -0x10(%rbp)
jae 0x130f6
cmpl $0xa, -0x14(%rbp)
jae 0x130f6
imull $0xa, -0x10(%rbp), %eax
addl -0x14(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
jmp 0x130ff
movq -0x8(%rbp), %rax
movw $0x0, (%rax)
jmp 0x13101
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: char2ushort
static USHORT char2ushort(UCHAR str[3]) {
    int i;
    char temp[4];
    USHORT ret= 0;

    memcpy(temp, str, 3);
    temp[3] = '\0';

    for (i = 0; i < 4; i++) {
        if ((UCHAR)temp[i] == 0xFF) {
            temp[i] = '\0';
        }
    }
    ret = (USHORT)atoi(temp);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movw $0x0, -0x12(%rbp)
movq -0x8(%rbp), %rax
movw (%rax), %cx
movw %cx, -0x10(%rbp)
movb 0x2(%rax), %al
movb %al, -0xe(%rbp)
movb $0x0, -0xd(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x4, -0xc(%rbp)
jge 0x1316a
movslq -0xc(%rbp), %rax
movzbl -0x10(%rbp,%rax), %eax
cmpl $0xff, %eax
jne 0x1315d
movslq -0xc(%rbp), %rax
movb $0x0, -0x10(%rbp,%rax)
jmp 0x1315f
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1313e
leaq -0x10(%rbp), %rdi
callq 0x54c0
movw %ax, -0x12(%rbp)
movw -0x12(%rbp), %ax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: wwan_data_class2str
static const char *wwan_data_class2str(ULONG class)
{
    unsigned int i = 0;
    for (i = 0; i < sizeof(class2str)/sizeof(class2str[0]); i++) {
        if (class2str[i].class == class) {
            return class2str[i].str;
        }
    }
    return "UNKNOWN";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpq $0x11, %rax
jae 0x131f2
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x24156(%rip), %rax     # 0x37310
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x131e5
movl -0x10(%rbp), %eax
movl %eax, %ecx
leaq 0x2413c(%rip), %rax     # 0x37310
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x131fd
jmp 0x131e7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x131a5
leaq 0x1aae6(%rip), %rax     # 0x2dcdf
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: WdsStopNwInterfaceReq
static USHORT WdsStopNwInterfaceReq(PQMUX_MSG pMUXMsg, void *arg) {
    pMUXMsg->StopNwInterfaceReq.TLVType = 0x01;
    pMUXMsg->StopNwInterfaceReq.TLVLength = cpu_to_le16(0x04);
    if (*((int *)arg) == IpFamilyV4)
        pMUXMsg->StopNwInterfaceReq.Handle =  cpu_to_le32(WdsConnectionIPv4Handle);
    else
        pMUXMsg->StopNwInterfaceReq.Handle =  cpu_to_le32(WdsConnectionIPv6Handle);
    return sizeof(QMIWDS_STOP_NETWORK_INTERFACE_REQ_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x1, 0x7(%rax)
movl $0x4, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x1364c
movl 0x247c4(%rip), %edi     # 0x37e00
callq 0x14040
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xa(%rax)
jmp 0x13660
movl 0x247b2(%rip), %edi     # 0x37e04
callq 0x14040
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xa(%rax)
movw $0xb, %ax
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/QMIThread.c
// Function: WdsGetRuntimeSettingReq
static USHORT WdsGetRuntimeSettingReq(PQMUX_MSG pMUXMsg, void *arg)
{
    (void)arg;
    pMUXMsg->GetRuntimeSettingsReq.TLVType = 0x10;
    pMUXMsg->GetRuntimeSettingsReq.TLVLength = cpu_to_le16(0x04);
    // the following mask also applies to IPV6
    pMUXMsg->GetRuntimeSettingsReq.Mask = cpu_to_le32(QMIWDS_GET_RUNTIME_SETTINGS_MASK_IPV4DNS_ADDR |
                                                      QMIWDS_GET_RUNTIME_SETTINGS_MASK_IPV4_ADDR |
                                                      QMIWDS_GET_RUNTIME_SETTINGS_MASK_MTU |
                                                      QMIWDS_GET_RUNTIME_SETTINGS_MASK_IPV4GATEWAY_ADDR) |
                                          QMIWDS_GET_RUNTIME_SETTINGS_MASK_PCSCF_SV_ADDR |
                                          QMIWDS_GET_RUNTIME_SETTINGS_MASK_PCSCF_DOM_NAME;

    return sizeof(QMIWDS_GET_RUNTIME_SETTINGS_REQ_MSG);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x10, 0x7(%rax)
movl $0x4, %edi
callq 0x13ff0
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x8(%rax)
movl $0x2310, %edi           # imm = 0x2310
callq 0x14040
movl %eax, %ecx
orl $0x800, %ecx            # imm = 0x800
orl $0x4000, %ecx           # imm = 0x4000
movq -0x8(%rbp), %rax
movl %ecx, 0xa(%rax)
movw $0xb, %ax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: cm_open_dev
int cm_open_dev(const char *dev) {
    int fd;

    fd = open(dev, O_RDWR | O_NONBLOCK | O_NOCTTY);
    if (fd != -1) {
        fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK);
        fcntl(fd, F_SETFD, FD_CLOEXEC);

        if (!strncmp(dev, "/dev/tty", strlen("/dev/tty")))
        {
            //disable echo on serial ports 
            struct termios  ios;

            memset(&ios, 0, sizeof(ios));
            tcgetattr( fd, &ios );
            cfmakeraw(&ios);
            cfsetispeed(&ios, B115200);
            cfsetospeed(&ios, B115200);
            tcsetattr( fd, TCSANOW, &ios );
            tcflush(fd, TCIOFLUSH);
        }
    } else {
        dbg_time("Failed to open %s, errno: %d (%s)", dev, errno, strerror(errno));
    }

    return fd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x902, %esi            # imm = 0x902
movb $0x0, %al
callq 0x5450
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
je 0x13857
movl -0xc(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0xc(%rbp), %edi
movl $0x3, %esi
movb $0x0, %al
callq 0x50e0
movl -0x4c(%rbp), %edi
movl %eax, %edx
orl $0x800, %edx            # imm = 0x800
movl $0x4, %esi
movb $0x0, %al
callq 0x50e0
movl -0xc(%rbp), %edi
movl $0x2, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x50e0
movq -0x8(%rbp), %rdi
leaq 0x1a6d0(%rip), %rsi     # 0x2deb7
movl $0x8, %edx
callq 0x5090
cmpl $0x0, %eax
jne 0x13852
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x3c, %edx
callq 0x5200
movl -0xc(%rbp), %edi
leaq -0x48(%rbp), %rsi
callq 0x5430
leaq -0x48(%rbp), %rdi
callq 0x53b0
leaq -0x48(%rbp), %rdi
movl $0x1002, %esi           # imm = 0x1002
callq 0x5490
leaq -0x48(%rbp), %rdi
movl $0x1002, %esi           # imm = 0x1002
callq 0x5150
movl -0xc(%rbp), %edi
xorl %esi, %esi
leaq -0x48(%rbp), %rdx
callq 0x5440
movl -0xc(%rbp), %edi
movl $0x2, %esi
callq 0x5180
jmp 0x13916
jmp 0x13859
movq 0x23780(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x68(%rbp)
callq 0x13930
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x50(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq -0x58(%rbp), %rcx
movl -0x50(%rbp), %r8d
movq %rax, %r9
leaq 0x1a618(%rip), %rsi     # 0x2dec0
movb $0x0, %al
callq 0x52c0
cmpq $0x0, 0x245b1(%rip)     # 0x37e68
je 0x13912
movq 0x245a8(%rip), %rax     # 0x37e68
movq %rax, -0x88(%rbp)
callq 0x13930
movq %rax, -0x80(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x5070
movl (%rax), %eax
movl %eax, -0x6c(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rdx
movq -0x78(%rbp), %rcx
movl -0x6c(%rbp), %r8d
movq %rax, %r9
leaq 0x1a5b5(%rip), %rsi     # 0x2dec0
movb $0x0, %al
callq 0x52c0
jmp 0x13914
jmp 0x13916
movl -0xc(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: pthread_cond_timeout_np
int pthread_cond_timeout_np(pthread_cond_t *cond, pthread_mutex_t * mutex, unsigned msecs) {
    if (msecs != 0) {
        unsigned i;
        unsigned t = msecs/4;
        int ret = 0;

        if (t == 0)
            t = 1;

        for (i = 0; i < msecs; i += t) {
            struct timespec ts;
            setTimespecRelative(&ts, t);
//very old uclibc do not support pthread_condattr_setclock(CLOCK_MONOTONIC)
            ret = pthread_cond_timedwait(cond, mutex, &ts); //to advoid system time change
            if (ret != ETIMEDOUT) {
                if(ret) dbg_time("ret=%d, msecs=%u, t=%u", ret, msecs, t);
                break;
            }
        }

        return ret;
    } else {
        return pthread_cond_wait(cond, mutex);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x13db8
movl -0x1c(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x13cea
movl $0x1, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jae 0x13db0
movl -0x24(%rbp), %eax
movl %eax, %esi
leaq -0x38(%rbp), %rdi
callq 0x13de0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x5420
movl %eax, -0x28(%rbp)
cmpl $0x6e, -0x28(%rbp)
je 0x13da0
cmpl $0x0, -0x28(%rbp)
je 0x13d9e
jmp 0x13d2d
movq 0x232ac(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x13930
movq -0x40(%rbp), %rdi
movq %rax, %rdx
movl -0x28(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl -0x24(%rbp), %r9d
leaq 0x1a1cf(%rip), %rsi     # 0x2df28
movb $0x0, %al
callq 0x52c0
cmpq $0x0, 0x24100(%rip)     # 0x37e68
je 0x13d9a
movq 0x240f7(%rip), %rax     # 0x37e68
movq %rax, -0x48(%rbp)
callq 0x13930
movq -0x48(%rbp), %rdi
movq %rax, %rdx
movl -0x28(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl -0x24(%rbp), %r9d
leaq 0x1a195(%rip), %rsi     # 0x2df28
movb $0x0, %al
callq 0x52c0
jmp 0x13d9c
jmp 0x13d9e
jmp 0x13db0
jmp 0x13da2
movl -0x24(%rbp), %eax
addl -0x20(%rbp), %eax
movl %eax, -0x20(%rbp)
jmp 0x13cf1
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x13dc8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5120
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: setTimespecRelative
static void setTimespecRelative(struct timespec *p_ts, long long msec)
{
    struct timeval tv;

    gettimeofday(&tv, (struct timezone *) NULL);

    /* what's really funny about this is that I know
       pthread_cond_timedwait just turns around and makes this
       a relative time again */
    p_ts->tv_sec = tv.tv_sec + (msec / 1000);
    p_ts->tv_nsec = (tv.tv_usec + (msec % 1000) * 1000L ) * 1000L;
    if ((unsigned long)p_ts->tv_nsec >= 1000000000UL) {
        p_ts->tv_sec += 1;
        p_ts->tv_nsec -= 1000000000UL;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x51f0
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movl $0x3e8, %esi            # imm = 0x3E8
cqto
idivq %rsi
addq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl $0x3e8, %ecx            # imm = 0x3E8
cqto
idivq %rcx
movq -0x28(%rbp), %rax
imulq $0x3e8, %rdx, %rcx      # imm = 0x3E8
addq %rcx, %rax
imulq $0x3e8, %rax, %rcx      # imm = 0x3E8
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x3b9aca00, 0x8(%rax)  # imm = 0x3B9ACA00
jb 0x13e7b
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
subq $0x3b9aca00, %rcx       # imm = 0x3B9ACA00
movq %rcx, 0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: le16_to_cpu
USHORT le16_to_cpu(USHORT v16) {
    USHORT tmp = v16;
    if (is_bigendian()) {
        unsigned char *s = (unsigned char *)(&v16);
        unsigned char *d = (unsigned char *)(&tmp);
        d[0] = s[1];
        d[1] = s[0];
    }
    return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movw %di, %ax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
movw %ax, -0x4(%rbp)
movsbl 0x1a1ba(%rip), %eax     # 0x2e0a4
cmpl $0x0, %eax
jne 0x13f19
leaq -0x2(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x4(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb 0x1(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movw -0x4(%rbp), %ax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: le32_to_cpu
UINT  le32_to_cpu (UINT v32) {
    UINT tmp = v32;
    if (is_bigendian()) {
        unsigned char *s = (unsigned char *)(&v32);
        unsigned char *d = (unsigned char *)(&tmp);
        d[0] = s[3];
        d[1] = s[2];
        d[2] = s[1];
        d[3] = s[0];
    }
    return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
movsbl 0x1a170(%rip), %eax     # 0x2e0a4
cmpl $0x0, %eax
jne 0x13f7f
leaq -0x4(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb 0x3(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movb 0x2(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x10(%rbp), %rax
movb 0x1(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x3(%rax)
movl -0x8(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: ql_swap32
UINT ql_swap32(UINT v32) {
    UINT tmp = v32;
    {
        unsigned char *s = (unsigned char *)(&v32);
        unsigned char *d = (unsigned char *)(&tmp);
        d[0] = s[3];
        d[1] = s[2];
        d[2] = s[1];
        d[3] = s[0];
    }
    return tmp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x8(%rbp)
leaq -0x4(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movb 0x3(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movb 0x2(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x10(%rbp), %rax
movb 0x1(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, 0x3(%rax)
movl -0x8(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/util.c
// Function: ql_set_driver_qmap_setting
void ql_set_driver_qmap_setting(PROFILE_T *profile, QMAP_SETTING *qmap_settings) {
    int ifc_ctl_sock;
    struct ifreq ifr;
    int rc;
    int request = 0x89F2;

    ifc_ctl_sock = socket(AF_INET, SOCK_DGRAM, 0);
    if (ifc_ctl_sock <= 0) {
        dbg_time("socket() failed: %s\n", strerror(errno));
        return;
    }
    
    memset(&ifr, 0, sizeof(struct ifreq));
    strncpy(ifr.ifr_name, profile->usbnet_adapter, IFNAMSIZ);
    ifr.ifr_name[IFNAMSIZ - 1] = 0;    
    ifr.ifr_ifru.ifru_data = (void *)qmap_settings;
        
    rc = ioctl(ifc_ctl_sock, request, &ifr);
    if (rc < 0) {
        dbg_time("ioctl(0x%x, qmap_settings) failed: %s, rc=%d", request, strerror(errno), rc);
    }

    close(ifc_ctl_sock);	
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x89f2, -0x48(%rbp)    # imm = 0x89F2
movl $0x2, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x55a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0x14d6d
jmp 0x14ce7
movq 0x222f2(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x13930
movq %rax, -0x50(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq %rax, %rcx
leaq 0x19301(%rip), %rsi     # 0x2e01d
movb $0x0, %al
callq 0x52c0
cmpq $0x0, 0x2313d(%rip)     # 0x37e68
je 0x14d66
movq 0x23134(%rip), %rax     # 0x37e68
movq %rax, -0x68(%rbp)
callq 0x13930
movq %rax, -0x60(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq %rax, %rcx
leaq 0x192be(%rip), %rsi     # 0x2e01d
movb $0x0, %al
callq 0x52c0
jmp 0x14d68
jmp 0x14e7a
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0x5200
leaq -0x40(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0xaa, %rsi
movl $0x10, %edx
callq 0x5080
movb $0x0, -0x31(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %edi
movslq -0x48(%rbp), %rsi
leaq -0x40(%rbp), %rdx
movb $0x0, %al
callq 0x5210
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jge 0x14e72
jmp 0x14dc3
movq 0x22216(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x80(%rbp)
callq 0x13930
movq %rax, -0x78(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x6c(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rdx
movl -0x6c(%rbp), %ecx
movq %rax, %r8
movl -0x44(%rbp), %r9d
leaq 0x19269(%rip), %rsi     # 0x2e06e
movb $0x0, %al
callq 0x52c0
cmpq $0x0, 0x23054(%rip)     # 0x37e68
je 0x14e6e
movq 0x2304b(%rip), %rax     # 0x37e68
movq %rax, -0x98(%rbp)
callq 0x13930
movq %rax, -0x90(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x84(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rdx
movl -0x84(%rbp), %ecx
movq %rax, %r8
movl -0x44(%rbp), %r9d
leaq 0x19207(%rip), %rsi     # 0x2e06e
movb $0x0, %al
callq 0x52c0
jmp 0x14e70
jmp 0x14e72
movl -0x14(%rbp), %edi
callq 0x5230
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_fread
static size_t ql_fread(const char *filename, void *buf, size_t size) {
    FILE *fp = fopen(filename , "r");
    size_t n = 0;

    memset(buf, 0x00, size);

    if (fp) {
        n = fread(buf, 1, size, fp);
        if (n <= 0 || n == size) {
            dbg_time("warnning: fail to fread(%s), fread=%zu, buf_size=%zu: (%s)", filename, n, size, strerror(errno));
        }
        fclose(fp);
    }

    return n > 0 ? n : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x19f65(%rip), %rsi     # 0x2f3e7
callq 0x5480
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
xorl %esi, %esi
callq 0x5200
cmpq $0x0, -0x20(%rbp)
je 0x155ba
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %esi
callq 0x50b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jbe 0x154dc
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x155b1
jmp 0x154de
movq 0x21afb(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r9
leaq 0x18cdb(%rip), %rsi     # 0x2e20f
movq %rax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x22922(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x155ad
leaq 0x22915(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x78(%rbp)
callq 0x13930
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x18c6d(%rip), %rsi     # 0x2e20f
movq %rax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x155af
jmp 0x155b1
movq -0x20(%rbp), %rdi
callq 0x5130
cmpq $0x0, -0x28(%rbp)
jbe 0x155cb
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x155d3
xorl %eax, %eax
movq %rax, -0x80(%rbp)
jmp 0x155d3
movq -0x80(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_fwrite
static size_t ql_fwrite(const char *filename, const void *buf, size_t size) {
    FILE *fp = fopen(filename , "w");
    size_t n = 0;

    if (fp) {
        n = fwrite(buf, 1, size, fp);
        if (n != size) {
            dbg_time("warnning: fail to fwrite(%s), fwrite=%zu, buf_size=%zu: (%s)", filename, n, size, strerror(errno));
        }
        fclose(fp);
    }

    return n > 0 ? n : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x192a7(%rip), %rsi     # 0x2e8a9
callq 0x5480
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x15724
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movl $0x1, %esi
callq 0x5510
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x1571b
jmp 0x15648
movq 0x21991(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
callq 0x13930
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %r8
movq -0x30(%rbp), %r9
leaq 0x18bb2(%rip), %rsi     # 0x2e250
movq %rax, (%rsp)
movb $0x0, %al
callq 0x52c0
leaq 0x227b8(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x15717
leaq 0x227ab(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x78(%rbp)
callq 0x13930
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x5070
movl (%rax), %edi
callq 0x5540
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x58(%rbp), %r9
leaq 0x18b44(%rip), %rsi     # 0x2e250
movq %rax, (%rsp)
movb $0x0, %al
callq 0x52c0
jmp 0x15719
jmp 0x1571b
movq -0x20(%rbp), %rdi
callq 0x5130
cmpq $0x0, -0x28(%rbp)
jbe 0x15735
movq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0x1573d
xorl %eax, %eax
movq %rax, -0x80(%rbp)
jmp 0x1573d
movq -0x80(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_driver_type_detect
int ql_driver_type_detect(PROFILE_T *profile) {
    if (qmidev_is_gobinet(profile->qmichannel)) {
        profile->qmi_ops = &gobi_qmidev_ops;
    }
    else {
        profile->qmi_ops = &qmiwwan_qmidev_ops;
    }
    qmidev_send = profile->qmi_ops->send;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8a, %rdi
leaq 0x161de(%rip), %rsi     # 0x2bc8c
movl $0xa, %edx
callq 0x5090
cmpl $0x0, %eax
jne 0x15ad1
movq -0x8(%rbp), %rax
leaq 0x1fbb8(%rip), %rcx     # 0x35680
movq %rcx, 0x31e(%rax)
jmp 0x15ae3
movq -0x8(%rbp), %rax
leaq 0x1fb84(%rip), %rcx     # 0x35660
movq %rcx, 0x31e(%rax)
movq -0x8(%rbp), %rax
movq 0x31e(%rax), %rax
movq 0x10(%rax), %rcx
leaq 0x222ef(%rip), %rax     # 0x37de8
movq %rcx, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_set_driver_bridge_mode
void ql_set_driver_bridge_mode(PROFILE_T *profile) {
    char enable[16];
    char filename[256];

    if(profile->qmap_mode)
        snprintf(filename, sizeof(filename), "/sys/class/net/%s/bridge_mode", profile->qmapnet_adapter);
    else
        snprintf(filename, sizeof(filename), "/sys/class/net/%s/bridge_mode", profile->usbnet_adapter);
    snprintf(enable, sizeof(enable), "%02d\n", profile->enable_bridge);
    ql_fwrite(filename, enable, sizeof(enable));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10a(%rax)
je 0x15b53
leaq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rcx
addq $0xca, %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x1855e(%rip), %rdx     # 0x2e0a8
movb $0x0, %al
callq 0x51c0
jmp 0x15b78
leaq -0x120(%rbp), %rdi
movq -0x8(%rbp), %rcx
addq $0xaa, %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x18537(%rip), %rdx     # 0x2e0a8
movb $0x0, %al
callq 0x51c0
leaq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x4c(%rax), %ecx
movl $0x10, %esi
leaq 0x1867a(%rip), %rdx     # 0x2e209
movb $0x0, %al
callq 0x51c0
leaq -0x120(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x10, %edx
callq 0x155e0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_qmap_mode_detect
int ql_qmap_mode_detect(PROFILE_T *profile) {
    if (profile->software_interface == SOFTWARE_MBIM) {
        if (profile->hardware_interface == HARDWARE_USB)
            return ql_mbim_usb_vlan_mode_detect(profile);
        else if (profile->hardware_interface == HARDWARE_PCIE)
            return ql_mbim_mhi_qmap_mode_detect(profile);
    } else if (profile->software_interface == SOFTWARE_QMI) {
        return ql_qmi_qmap_mode_detect(profile);
    }
#ifdef CONFIG_QRTR
    else if(profile->software_interface == SOFTWARE_QRTR) {
        char tmp[128];

        profile->qmap_mode = 4;
        profile->qmap_version = WDA_DL_DATA_AGG_QMAP_V5_ENABLED;
        profile->qmap_size = 31*1024;
        profile->muxid = 0x80 | profile->pdp;
        snprintf(profile->qmapnet_adapter, sizeof(profile->qmapnet_adapter), "rmnet_data%d", profile->muxid&0xF);

        snprintf(tmp, sizeof(tmp), "/sys/class/net/%s", profile->qmapnet_adapter);
        if (access(tmp, F_OK)) {
            rtrmnet_ctl_create_vnd(profile->usbnet_adapter, profile->qmapnet_adapter,
                profile->muxid, profile->qmap_version, 11, 4096);
        }
    }
#endif
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x2, 0x1c1(%rax)
jne 0x15c13
movq -0x10(%rbp), %rax
cmpl $0x6, 0x1bd(%rax)
jne 0x15bf4
movq -0x10(%rbp), %rdi
callq 0x15c40
movl %eax, -0x4(%rbp)
jmp 0x15c37
movq -0x10(%rbp), %rax
cmpl $0x5, 0x1bd(%rax)
jne 0x15c0f
movq -0x10(%rbp), %rdi
callq 0x15d90
movl %eax, -0x4(%rbp)
jmp 0x15c37
jmp 0x15c11
jmp 0x15c30
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1c1(%rax)
jne 0x15c2e
movq -0x10(%rbp), %rdi
callq 0x15f20
movl %eax, -0x4(%rbp)
jmp 0x15c37
jmp 0x15c30
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_mbim_usb_vlan_mode_detect
static int ql_mbim_usb_vlan_mode_detect(PROFILE_T *profile) {
    char tmp[128];

    snprintf(tmp, sizeof(tmp), "/sys/class/net/%s.%d", profile->usbnet_adapter, profile->pdp);
    if (!access(tmp, F_OK)) {
        profile->qmap_mode = 4;
        profile->muxid = profile->pdp;
        strncpy(profile->qmapnet_adapter, &tmp[strlen("/sys/class/net/")], sizeof(profile->qmapnet_adapter));

        dbg_time("mbim_qmap_mode = %d, vlan_id = 0x%02x, qmap_netcard = %s",
            profile->qmap_mode, profile->muxid, profile->qmapnet_adapter);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x90(%rbp), %rdi
movq -0x8(%rbp), %rcx
addq $0xaa, %rcx
movq -0x8(%rbp), %rax
movl 0x48(%rax), %r8d
movl $0x80, %esi
leaq 0x1861e(%rip), %rdx     # 0x2e293
movb $0x0, %al
callq 0x51c0
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
callq 0x5460
cmpl $0x0, %eax
jne 0x15d7f
movq -0x8(%rbp), %rax
movl $0x4, 0x10a(%rax)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x11e(%rax)
movq -0x8(%rbp), %rdi
addq $0xca, %rdi
leaq -0x90(%rbp), %rsi
addq $0xf, %rsi
movl $0x20, %edx
callq 0x5080
movq 0x21307(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x98(%rbp)
callq 0x13930
movq -0x98(%rbp), %rdi
movq %rax, %rdx
movq -0x8(%rbp), %rax
movl 0x10a(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x11e(%rax), %r8d
movq -0x8(%rbp), %r9
addq $0xca, %r9
leaq 0x1858f(%rip), %rsi     # 0x2e2a8
movb $0x0, %al
callq 0x52c0
leaq 0x22141(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x15d7b
leaq 0x22134(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
callq 0x13930
movq -0xa0(%rbp), %rdi
movq %rax, %rdx
movq -0x8(%rbp), %rax
movl 0x10a(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x11e(%rax), %r8d
movq -0x8(%rbp), %r9
addq $0xca, %r9
leaq 0x18534(%rip), %rsi     # 0x2e2a8
movb $0x0, %al
callq 0x52c0
jmp 0x15d7d
jmp 0x15d7f
xorl %eax, %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/qmap_bridge_mode.c
// Function: ql_mbim_mhi_qmap_mode_detect
static int ql_mbim_mhi_qmap_mode_detect(PROFILE_T *profile) {
    ql_get_driver_rmnet_info(profile, &profile->rmnet_info);
    if (profile->rmnet_info.size) {
        profile->qmap_mode = profile->rmnet_info.qmap_mode;
        if (profile->qmap_mode) {
            int offset_id = profile->pdp - 1;

            if (profile->qmap_mode == 1)
                offset_id = 0;
            profile->muxid = profile->pdp;
            strcpy(profile->qmapnet_adapter, profile->rmnet_info.ifname[offset_id]);
            profile->qmap_size = profile->rmnet_info.rx_urb_size;
            profile->qmap_version = profile->rmnet_info.qmap_version;
        
            dbg_time("mbim_qmap_mode = %d, vlan_id = 0x%02x, qmap_netcard = %s",
                profile->qmap_mode, profile->muxid, profile->qmapnet_adapter);
        }

        goto _out;
    }
    
_out:
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rsi
addq $0x32e, %rsi            # imm = 0x32E
callq 0x14a40
movq -0x8(%rbp), %rax
cmpl $0x0, 0x32e(%rax)
je 0x15f0d
movq -0x8(%rbp), %rax
movl 0x33e(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10a(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10a(%rax)
je 0x15f0b
movq -0x8(%rbp), %rax
movl 0x48(%rax), %eax
subl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x10a(%rax)
jne 0x15e07
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x48(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x11e(%rax)
movq -0x8(%rbp), %rdi
addq $0xca, %rdi
movq -0x8(%rbp), %rsi
addq $0x32e, %rsi            # imm = 0x32E
addq $0x1c, %rsi
movslq -0xc(%rbp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0x50a0
movq -0x8(%rbp), %rax
movl 0x332(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x10e(%rax)
movq -0x8(%rbp), %rax
movl 0x342(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x112(%rax)
movq 0x2116f(%rip), %rax     # 0x36fe0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
callq 0x13930
movq -0x18(%rbp), %rdi
movq %rax, %rdx
movq -0x8(%rbp), %rax
movl 0x10a(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x11e(%rax), %r8d
movq -0x8(%rbp), %r9
addq $0xca, %r9
leaq 0x183fd(%rip), %rsi     # 0x2e2a8
movb $0x0, %al
callq 0x52c0
leaq 0x21faf(%rip), %rax     # 0x37e68
cmpq $0x0, (%rax)
je 0x15f07
leaq 0x21fa2(%rip), %rax     # 0x37e68
movq (%rax), %rax
movq %rax, -0x20(%rbp)
callq 0x13930
movq -0x20(%rbp), %rdi
movq %rax, %rdx
movq -0x8(%rbp), %rax
movl 0x10a(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x11e(%rax), %r8d
movq -0x8(%rbp), %r9
addq $0xca, %r9
leaq 0x183a8(%rip), %rsi     # 0x2e2a8
movb $0x0, %al
callq 0x52c0
jmp 0x15f09
jmp 0x15f0b
jmp 0x15f0f
jmp 0x15f0f
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: compose_basic_connect_command
static MBIM_MESSAGE_HEADER *compose_basic_connect_command(UINT32 CID, UINT32 CommandType, void *pInformationBuffer, UINT32 InformationBufferLength)
{
    MBIM_COMMAND_MSG_T *pRequest = (MBIM_COMMAND_MSG_T *)mbim_alloc(sizeof(MBIM_COMMAND_MSG_T) + InformationBufferLength);

    if (!pRequest)
        return NULL;

    pRequest->MessageHeader.MessageType = htole32(MBIM_COMMAND_MSG);
    pRequest->MessageHeader.MessageLength = htole32((sizeof(MBIM_COMMAND_MSG_T) + InformationBufferLength));
    pRequest->MessageHeader.TransactionId = htole32(TransactionId++);

    pRequest->FragmentHeader.TotalFragments = htole32(1);
    pRequest->FragmentHeader.CurrentFragment= htole32(0);

    memcpy(pRequest->DeviceServiceId.uuid, str2uuid(UUID_BASIC_CONNECT), 16);

    pRequest->CID = htole32(CID);
    pRequest->CommandType = htole32(CommandType);
    if (InformationBufferLength && pInformationBuffer) {
        pRequest->InformationBufferLength = htole32(InformationBufferLength);
        memcpy(pRequest->InformationBuffer, pInformationBuffer, InformationBufferLength);
    } else {
        pRequest->InformationBufferLength = htole32(0);
    }

    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 -0x1c(%rbp), %eax
movl %eax, %edi
addq $0x30, %rdi
callq 0x5370
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x16eeb
movq $0x0, -0x8(%rbp)
jmp 0x16ff0
movl $0x3, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x1c(%rbp), %eax
addq $0x30, %rax
movl %eax, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movl 0x20512(%rip), %edi     # 0x3742c
movl %edi, %eax
addl $0x1, %eax
movl %eax, 0x20507(%rip)     # 0x3742c
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x1, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xc(%rax)
xorl %edi, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0x176d5(%rip), %rdi     # 0x2e63a
callq 0x17000
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq (%rcx), %rdx
movq %rdx, 0x14(%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x1c(%rax)
movl -0xc(%rbp), %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x24(%rax)
movl -0x10(%rbp), %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x28(%rax)
cmpl $0x0, -0x1c(%rbp)
je 0x16fd8
cmpq $0x0, -0x18(%rbp)
je 0x16fd8
movl -0x1c(%rbp), %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %eax
movl %eax, %edx
callq 0x52f0
jmp 0x16fe8
xorl %edi, %edi
callq 0x191c0
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: str2uuid
static const UUID_T * str2uuid(const char *str) {
    static UUID_T uuid;
    UINT32 d[16];
    char tmp[16*2+4+1];
    unsigned i = 0;

    while (str[i]) {
        tmp[i] = tolower(str[i]);
        i++;
    }
    tmp[i] = '\0';

    sscanf(tmp, "%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]);

    for (i = 0; i < 16; i++) {
        uuid.uuid[i] = d[i]&0xFF;
    }

    return &uuid;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, -0x30(%rbp)
movl $0x0, -0xa4(%rbp)
movq -0x30(%rbp), %rax
movl -0xa4(%rbp), %ecx
cmpb $0x0, (%rax,%rcx)
je 0x17065
movq -0x30(%rbp), %rax
movl -0xa4(%rbp), %ecx
movsbl (%rax,%rcx), %edi
callq 0x5340
movb %al, %cl
movl -0xa4(%rbp), %eax
movb %cl, -0xa0(%rbp,%rax)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x17022
movl -0xa4(%rbp), %eax
movb $0x0, -0xa0(%rbp,%rax)
leaq -0xa0(%rbp), %rdi
leaq -0x70(%rbp), %rdx
leaq -0x70(%rbp), %rcx
addq $0x4, %rcx
leaq -0x70(%rbp), %r8
addq $0x8, %r8
leaq -0x70(%rbp), %r9
addq $0xc, %r9
leaq -0x70(%rbp), %rax
addq $0x10, %rax
leaq -0x70(%rbp), %rsi
addq $0x14, %rsi
movq %rsi, -0xc8(%rbp)
leaq -0x70(%rbp), %rsi
addq $0x18, %rsi
movq %rsi, -0xc0(%rbp)
leaq -0x70(%rbp), %rsi
addq $0x1c, %rsi
movq %rsi, -0xb8(%rbp)
leaq -0x70(%rbp), %r13
addq $0x20, %r13
leaq -0x70(%rbp), %r12
addq $0x24, %r12
leaq -0x70(%rbp), %r15
addq $0x28, %r15
leaq -0x70(%rbp), %r14
addq $0x2c, %r14
leaq -0x70(%rbp), %rbx
addq $0x30, %rbx
leaq -0x70(%rbp), %r11
addq $0x34, %r11
leaq -0x70(%rbp), %r10
addq $0x38, %r10
leaq -0x70(%rbp), %rsi
addq $0x3c, %rsi
movq %rsi, -0xb0(%rbp)
leaq 0x17546(%rip), %rsi     # 0x2e65f
movq %rax, (%rsp)
movq -0xc8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0xc0(%rbp), %rax
movq %rax, 0x10(%rsp)
movq -0xb8(%rbp), %rax
movq %rax, 0x18(%rsp)
movq -0xb0(%rbp), %rax
movq %r13, 0x20(%rsp)
movq %r12, 0x28(%rsp)
movq %r15, 0x30(%rsp)
movq %r14, 0x38(%rsp)
movq %rbx, 0x40(%rsp)
movq %r11, 0x48(%rsp)
movq %r10, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movb $0x0, %al
callq 0x53a0
movl $0x0, -0xa4(%rbp)
cmpl $0x10, -0xa4(%rbp)
jae 0x171be
movl -0xa4(%rbp), %eax
movl -0x70(%rbp,%rax,4), %eax
andl $0xff, %eax
movb %al, %dl
movl -0xa4(%rbp), %eax
movl %eax, %ecx
leaq 0x21d4b(%rip), %rax     # 0x38ef5
movb %dl, (%rax,%rcx)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
jmp 0x17181
leaq 0x21d30(%rip), %rax     # 0x38ef5
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/Carton32[P]quectel-CM/mbim-cm.c
// Function: char2wchar
static size_t char2wchar(const char *src, size_t src_len, uint8_t *dst, size_t dst_len) {
    size_t i;

    if (src_len > (dst_len/2))
        src_len = (dst_len/2);

    for (i = 0; i < src_len; i++) {
        *dst++ = *src++;
        *dst++ = 0;
    }

    return i*2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
shrq %rcx
cmpq %rcx, %rax
jbe 0x1720f
movq -0x20(%rbp), %rax
shrq %rax
movq %rax, -0x10(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x17263
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movb (%rax), %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x17217
movq -0x28(%rbp), %rax
shlq %rax
popq %rbp
retq
nopl (%rax)