LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: type_string_to_number
int type_string_to_number(char *type)
{
    if (0 == strcmp("int", type)) {
        return LEDA_TYPE_INT;
    } else if (0 == strcmp("bool", type)) {
        return LEDA_TYPE_BOOL;
    } else if (0 == strcmp("float", type)) {
        return LEDA_TYPE_FLOAT;
    } else if (0 == strcmp("text", type)) {
        return LEDA_TYPE_TEXT;
    } else if (0 == strcmp("date", type)) {
        return LEDA_TYPE_DATE;
    } else if (0 == strcmp("enum", type)) {
        return LEDA_TYPE_ENUM;
    } else if (0 == strcmp("struct", type)) {
        return LEDA_TYPE_STRUCT;
    } else if (0 == strcmp("array", type)) {
        return LEDA_TYPE_ARRAY;
    } else if (0 == strcmp("double", type)) {
        return LEDA_TYPE_DOUBLE;
    } else {
        return -1;
    }
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
leaq 0x9781(%rip), %rdi      # 0xe048
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x48e0
movl $0x0, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x9761(%rip), %rdi      # 0xe04c
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x4904
movl $0x1, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x9742(%rip), %rdi      # 0xe051
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x4928
movl $0x2, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x9724(%rip), %rdi      # 0xe057
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x494c
movl $0x3, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x9705(%rip), %rdi      # 0xe05c
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x4970
movl $0x4, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x96e6(%rip), %rdi      # 0xe061
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x4991
movl $0x5, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x96ca(%rip), %rdi      # 0xe066
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x49b2
movl $0x6, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x96b0(%rip), %rdi      # 0xe06d
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x49d3
movl $0x7, -0x4(%rbp)
jmp 0x49fb
movq -0x10(%rbp), %rsi
leaq 0x9695(%rip), %rdi      # 0xe073
callq 0x43c0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x49f4
movl $0x8, -0x4(%rbp)
jmp 0x49fb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: get_msg_id
unsigned int get_msg_id()
{
    int ret = 0;

    pthread_mutex_lock(&g_msg_locker);
    ret = ++g_msg_id;
    pthread_mutex_unlock(&g_msg_locker);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
leaq 0xd482(%rip), %rdi      # 0x12538
callq 0x4770
movl 0xd49f(%rip), %eax      # 0x12560
addl $0x1, %eax
movl %eax, 0xd496(%rip)      # 0x12560
movl %eax, -0x4(%rbp)
leaq 0xd464(%rip), %rdi      # 0x12538
callq 0x4480
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: wsa_insert_reply
int wsa_insert_reply(int msg_id)
{
    wsa_reply_t *reply;

    pthread_mutex_lock(&wsa_replay_lock);
    reply = (wsa_reply_t *)malloc(sizeof(wsa_reply_t));
    if (NULL == reply) {
        log_e(LOG_TAG, "no memory\r\n");
        pthread_mutex_unlock(&wsa_replay_lock);
        return LE_ERROR_ALLOCATING_MEM;
    }
    reply->msg_id = msg_id;
    reply->code = LE_ERROR_UNKNOWN;
    if (0 != sem_init(&reply->sem, 0, 0)) {
        free(reply);
        pthread_mutex_unlock(&wsa_replay_lock);
        log_e(LOG_TAG, "semphore init error!");
        return LE_ERROR_UNKNOWN;
    }
    list_add(&reply->list_node, &wsa_replay_head);
    pthread_mutex_unlock(&wsa_replay_lock);
    return LE_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq 0xce7e(%rip), %rdi      # 0x11f80
callq 0x4770
movl $0x40, %edi
callq 0x4798
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x516e
movl $0x3, %edi
leaq 0x8f67(%rip), %rsi      # 0xe090
leaq 0x8f66(%rip), %rdx      # 0xe096
leaq 0x8f64(%rip), %rcx      # 0xe09b
leaq 0x8fe0(%rip), %r8       # 0xe11e
movl $0x118, %r9d            # imm = 0x118
leaq 0x8fe4(%rip), %rax      # 0xe12f
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
movq 0xce23(%rip), %rdi      # 0x11f80
callq 0x4480
movl $0x186a2, -0x4(%rbp)    # imm = 0x186A2
jmp 0x5216
movl -0x8(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x186a0, 0x14(%rax)    # imm = 0x186A0
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x4580
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x51f3
movq -0x10(%rbp), %rdi
callq 0x4790
movq 0xcdd4(%rip), %rdi      # 0x11f80
callq 0x4480
movl $0x3, %edi
leaq 0x8ed3(%rip), %rsi      # 0xe090
leaq 0x8ed2(%rip), %rdx      # 0xe096
leaq 0x8ed0(%rip), %rcx      # 0xe09b
leaq 0x8f4c(%rip), %r8       # 0xe11e
movl $0x121, %r9d            # imm = 0x121
leaq 0x8f5c(%rip), %rax      # 0xe13b
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
movl $0x186a0, -0x4(%rbp)    # imm = 0x186A0
jmp 0x5216
movq -0x10(%rbp), %rdi
movq 0xcdaa(%rip), %rsi      # 0x11fa8
callq 0x5220
movq 0xcd76(%rip), %rdi      # 0x11f80
callq 0x4480
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: wsa_remove_reply
void wsa_remove_reply(int msg_id)
{
    wsa_reply_t *reply;

    reply = _wsa_get_reply_by_msg_id(msg_id);
    if (NULL == reply) {
        return;
    }

    pthread_mutex_lock(&wsa_replay_lock);
    if (reply->payload) {
        free(reply->payload);
        reply->payload = NULL;
    }
    sem_destroy(&reply->sem);
    list_del(&reply->list_node);
    free(reply);
    pthread_mutex_unlock(&wsa_replay_lock);
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %edi
callq 0x52e0
movq %rax, -0x10(%rbp)
xorl %eax, %eax
cmpq -0x10(%rbp), %rax
jne 0x5271
jmp 0x52cc
movq 0xcd08(%rip), %rdi      # 0x11f80
callq 0x4770
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x52a1
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x4790
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x4760
movq -0x10(%rbp), %rdi
callq 0x5370
movq -0x10(%rbp), %rdi
callq 0x4790
movq 0xccb9(%rip), %rdi      # 0x11f80
callq 0x4480
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: wsa_get_reply_by_msg_id
static wsa_reply_t *_wsa_get_reply_by_msg_id(int msg_id)
{
    wsa_reply_t *pos, *next, *reply = NULL;

    pthread_mutex_lock(&wsa_replay_lock);
    list_for_each_entry_safe(pos, next, &wsa_replay_head, list_node) {
        if (pos->msg_id == msg_id) {
            reply = pos;
            break;
        }
    }
    pthread_mutex_unlock(&wsa_replay_lock);
    return reply;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq $0x0, -0x20(%rbp)
movq 0xcc86(%rip), %rdi      # 0x11f80
callq 0x4770
movq 0xcca2(%rip), %rax      # 0x11fa8
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0xcc85(%rip), %rcx      # 0x11fa8
cmpq %rcx, %rax
je 0x5355
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x4(%rbp), %eax
jne 0x533e
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x5355
jmp 0x5340
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x5318
movq 0xcc24(%rip), %rdi      # 0x11f80
callq 0x4480
movq -0x20(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: wsa_set_reply_result
int wsa_set_reply_result(int msg_id, int code, char *payload)
{
    wsa_reply_t *reply;

    reply = _wsa_get_reply_by_msg_id(msg_id);
    if (NULL == reply) {
        return -1;
    }

    pthread_mutex_lock(&wsa_replay_lock);
    reply->code = code;
    if (payload) {
        reply->payload = strdup(payload);
    }
    pthread_mutex_unlock(&wsa_replay_lock);
    sem_post(&reply->sem);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl -0x8(%rbp), %edi
callq 0x52e0
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq -0x20(%rbp), %rax
jne 0x53cf
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5420
movq 0xcbaa(%rip), %rdi      # 0x11f80
callq 0x4770
movl -0xc(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x14(%rax)
cmpq $0x0, -0x18(%rbp)
je 0x5400
movq -0x18(%rbp), %rdi
callq 0x4700
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x38(%rax)
movq 0xcb79(%rip), %rdi      # 0x11f80
callq 0x4480
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
callq 0x4360
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: leda_parse_received_msg
int leda_parse_received_msg(cJSON *root, int *msg_id, int *code, char **method, cJSON **payload)
{
    cJSON *item = NULL;

    item = cJSON_GetObjectItem(root, "messageId");
    if ((NULL == item) || (cJSON_Number != item->type)) {
        log_e(LOG_TAG, "msg id type is not integer\n");
        return MSG_INVALID;
    }
    *msg_id = item->valueint;
    *payload = cJSON_GetObjectItem(root, "payload");
    item = cJSON_GetObjectItem(root, "code");    
    if (item) {
        if (cJSON_Number != item->type) {
            log_e(LOG_TAG, "code type is not integer\n");
            return MSG_INVALID;
        }
        *code = item->valueint;
        return MSG_RSP;
    }
    item = cJSON_GetObjectItem(root, "method");
    if ((NULL == item) || (cJSON_String != item->type)) {
        return MSG_INVALID;
    }
    *method = item->valuestring;

    return MSG_METHOD;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x8b45(%rip), %rsi      # 0xe194
callq 0x40d0
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpq -0x38(%rbp), %rax
je 0x566e
movq -0x38(%rbp), %rcx
movl $0x8, %eax
cmpl 0x18(%rcx), %eax
je 0x56b3
movl $0x3, %edi
leaq 0x8a16(%rip), %rsi      # 0xe090
leaq 0x8a15(%rip), %rdx      # 0xe096
leaq 0x8a13(%rip), %rcx      # 0xe09b
leaq 0x8b0f(%rip), %r8       # 0xe19e
movl $0x17e, %r9d            # imm = 0x17E
leaq 0x8b1a(%rip), %rax      # 0xe1b6
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x57a4
movq -0x38(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
leaq 0x8b07(%rip), %rsi      # 0xe1d2
callq 0x40d0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
leaq 0x8af5(%rip), %rsi      # 0xe1da
callq 0x40d0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x575b
movq -0x38(%rbp), %rcx
movl $0x8, %eax
cmpl 0x18(%rcx), %eax
je 0x5745
movl $0x3, %edi
leaq 0x8981(%rip), %rsi      # 0xe090
leaq 0x8980(%rip), %rdx      # 0xe096
leaq 0x897e(%rip), %rcx      # 0xe09b
leaq 0x8a7a(%rip), %r8       # 0xe19e
movl $0x186, %r9d            # imm = 0x186
leaq 0x8aae(%rip), %rax      # 0xe1df
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x57a4
movq -0x38(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x57a4
movq -0x10(%rbp), %rdi
leaq 0x8b2c(%rip), %rsi      # 0xe292
callq 0x40d0
movq %rax, -0x38(%rbp)
xorl %eax, %eax
cmpq -0x38(%rbp), %rax
je 0x5785
movq -0x38(%rbp), %rcx
movl $0x10, %eax
cmpl 0x18(%rcx), %eax
je 0x578e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x57a4
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: leda_send_rsp
int leda_send_rsp(int code, int msg_id, cJSON *payload)
{
    cJSON *root;
    char *msg;
    int ret;

    root = cJSON_CreateObject();
    if (!root) {
        return LE_ERROR_ALLOCATING_MEM;
    }
    cJSON_AddNumberToObject(root, "code", code);
    cJSON_AddNumberToObject(root, "messageId", msg_id);
    if (!payload) {
        payload  = cJSON_CreateObject();
        if (!payload) {
            cJSON_Delete(root);
            return LE_ERROR_ALLOCATING_MEM;
        }
    }
    cJSON_AddItemToObject(root, "payload", payload);

    msg = cJSON_Print(root);
    cJSON_Delete(root);
    if (!msg) {
        return LE_ERROR_ALLOCATING_MEM;
    }
    log_i(LOG_TAG, "send messege to server: %s", msg);
    ret = wsc_add_msg(msg, strlen(msg) + 1, 0);
    free(msg);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
callq 0x4680
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x5d6e
movl $0x186a2, -0x4(%rbp)    # imm = 0x186A2
jmp 0x5e77
movq -0x20(%rbp), %rdi
cvtsi2sdl -0x8(%rbp), %xmm0
leaq 0x845c(%rip), %rsi      # 0xe1da
callq 0x4260
movq -0x20(%rbp), %rdi
cvtsi2sdl -0xc(%rbp), %xmm0
leaq 0x8401(%rip), %rsi      # 0xe194
callq 0x4260
cmpq $0x0, -0x18(%rbp)
jne 0x5dc6
callq 0x4680
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5dc4
movq -0x20(%rbp), %rdi
callq 0x41e0
movl $0x186a2, -0x4(%rbp)    # imm = 0x186A2
jmp 0x5e77
jmp 0x5dc6
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x83fd(%rip), %rsi      # 0xe1d2
callq 0x46e0
movq -0x20(%rbp), %rdi
callq 0x40f0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
callq 0x41e0
cmpq $0x0, -0x28(%rbp)
jne 0x5e00
movl $0x186a2, -0x4(%rbp)    # imm = 0x186A2
jmp 0x5e77
movq -0x28(%rbp), %rax
movl $0x1, %edi
leaq 0x8432(%rip), %rsi      # 0xe242
leaq 0x827f(%rip), %rdx      # 0xe096
leaq 0x827d(%rip), %rcx      # 0xe09b
leaq 0x8483(%rip), %r8       # 0xe2a8
movl $0x23d, %r9d            # imm = 0x23D
leaq 0x842c(%rip), %r10      # 0xe25e
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x42b0
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4250
movq -0x38(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
xorl %edx, %edx
callq 0x4530
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rdi
callq 0x4790
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: leda_rsp_get_properties
int leda_rsp_get_properties(char *pk, char *dn, int msg_id, leda_device_data_t *data, int data_cnt)
{
    int ret = LE_ERROR_UNKNOWN;
    cJSON *root, *payload, *properties;
    char *msg;

    payload = cJSON_CreateObject();
    if (!payload) {
        return LE_ERROR_ALLOCATING_MEM;
    }

    if (g_devs_cb.get_properties_cb) {
        ret = g_devs_cb.get_properties_cb(pk, dn, data, data_cnt, g_devs_cb.usr_data_get_property);
    } else {
        log_e(LOG_TAG, "callback get_properties_cb unregistered!\n");
    }
    
    if (ret == LE_SUCCESS) {
        properties = struct_data_to_json_data(data, data_cnt);
        cJSON_AddItemToObject(payload, "properties", properties);
    }

    return leda_send_rsp(ret, msg_id, payload);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl $0x186a0, -0x30(%rbp)   # imm = 0x186A0
callq 0x4680
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x5ebe
movl $0x186a2, -0x4(%rbp)    # imm = 0x186A2
jmp 0x5f61
cmpq $0x0, 0xc6ca(%rip)      # 0x12590
je 0x5eec
movq 0xc6c1(%rip), %rax      # 0x12590
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq 0xc6b3(%rip), %r8       # 0x12598
callq *%rax
movl %eax, -0x30(%rbp)
jmp 0x5f25
movl $0x3, %edi
leaq 0x8198(%rip), %rsi      # 0xe090
leaq 0x8197(%rip), %rdx      # 0xe096
leaq 0x8195(%rip), %rcx      # 0xe09b
leaq 0x83a9(%rip), %r8       # 0xe2b6
movl $0x252, %r9d            # imm = 0x252
leaq 0x83b4(%rip), %rax      # 0xe2ce
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
cmpl $0x0, -0x30(%rbp)
jne 0x5f4f
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x4640
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0x8379(%rip), %rsi      # 0xe2c3
callq 0x46e0
movl -0x30(%rbp), %edi
movl -0x1c(%rbp), %esi
movq -0x40(%rbp), %rdx
callq 0x43d0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: leda_rsp_set_properties
int leda_rsp_set_properties(char *pk, char *dn, int msg_id, leda_device_data_t *data, int data_cnt)
{
    int ret = LE_ERROR_UNKNOWN;

    if (g_devs_cb.set_properties_cb) {
        ret = g_devs_cb.set_properties_cb(pk, dn, data, data_cnt, g_devs_cb.set_properties_cb);
    } else {
        log_e(LOG_TAG, "callback set_properties_cb unregistered!\n");
    }

    return leda_send_rsp(ret, msg_id, NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0x186a0, -0x28(%rbp)   # imm = 0x186A0
cmpq $0x0, 0xc606(%rip)      # 0x125a0
je 0x5fc0
movq 0xc5fd(%rip), %rax      # 0x125a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq 0xc5e7(%rip), %r8       # 0x125a0
callq *%rax
movl %eax, -0x28(%rbp)
jmp 0x5ff9
movl $0x3, %edi
leaq 0x80c4(%rip), %rsi      # 0xe090
leaq 0x80c3(%rip), %rdx      # 0xe096
leaq 0x80c1(%rip), %rcx      # 0xe09b
leaq 0x8317(%rip), %r8       # 0xe2f8
movl $0x265, %r9d            # imm = 0x265
leaq 0x8322(%rip), %rax      # 0xe310
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
movl -0x28(%rbp), %edi
movl -0x14(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x43d0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: cb_ws_estab
static void cb_ws_estab(void *user)
{
    g_conn_state = LEDA_WS_CONNECTED;
    log_i(LOG_TAG, "connection establish.\n");

    if (g_conn_cb.conn_state_change_cb) {
        g_conn_cb.conn_state_change_cb(LEDA_WS_CONNECTED, g_conn_cb.usr_data);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, 0xbbda(%rip)      # 0x12450
movl $0x1, %edi
leaq 0x79c0(%rip), %rsi      # 0xe242
leaq 0x780d(%rip), %rdx      # 0xe096
leaq 0x780b(%rip), %rcx      # 0xe09b
leaq 0x7b73(%rip), %r8       # 0xe40a
movl $0x329, %r9d            # imm = 0x329
leaq 0x7b72(%rip), %rax      # 0xe416
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
cmpq $0x0, 0xbd29(%rip)      # 0x125e0
je 0x68cb
movq 0xbd20(%rip), %rax      # 0x125e0
movq 0xbd21(%rip), %rsi      # 0x125e8
xorl %edi, %edi
callq *%rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: cb_ws_close
static void cb_ws_close(void *user)
{
    g_conn_state = LEDA_WS_DISCONNECTED;
    log_i(LOG_TAG, "connection closed.\n");

    if (g_conn_cb.conn_state_change_cb) {
        g_conn_cb.conn_state_change_cb(LEDA_WS_DISCONNECTED, g_conn_cb.usr_data);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, 0xbb5a(%rip)      # 0x12450
movl $0x1, %edi
leaq 0x7940(%rip), %rsi      # 0xe242
leaq 0x778d(%rip), %rdx      # 0xe096
leaq 0x778b(%rip), %rcx      # 0xe09b
leaq 0x7b16(%rip), %r8       # 0xe42d
movl $0x31f, %r9d            # imm = 0x31F
leaq 0x7b15(%rip), %rax      # 0xe439
movq %rax, (%rsp)
movb $0x0, %al
callq 0x42b0
cmpq $0x0, 0xbca9(%rip)      # 0x125e0
je 0x694e
movq 0xbca0(%rip), %rax      # 0x125e0
movq 0xbca1(%rip), %rsi      # 0x125e8
movl $0x1, %edi
callq *%rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/leda.c
// Function: leda_wsc_exit
int leda_wsc_exit()
{
    g_is_init = 0;
    force_exit = 1;
    
    if (g_threadpool_recv_proc) {
        threadpool_destroy(g_threadpool_recv_proc, threadpool_graceful);
    }
    if (context) {
        lws_cancel_service(context);
        context = NULL;
    }

    return ws_client_destroy();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x0, 0xba6a(%rip)      # 0x125d8
movq 0xb47b(%rip), %rax      # 0x11ff0
movl $0x1, (%rax)
movq 0xb406(%rip), %rax      # 0x11f88
cmpq $0x0, (%rax)
je 0x6b9c
movq 0xb3f9(%rip), %rax      # 0x11f88
movq (%rax), %rdi
movl $0x1, %esi
callq 0x4650
movq 0xb425(%rip), %rax      # 0x11fc8
cmpq $0x0, (%rax)
je 0x6bc6
movq 0xb418(%rip), %rax      # 0x11fc8
movq (%rax), %rdi
callq 0x4390
movq 0xb409(%rip), %rax      # 0x11fc8
movq $0x0, (%rax)
movb $0x0, %al
callq 0x4130
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/ws_client.c
// Function: ws_client_destroy
int ws_client_destroy()
{
    force_exit = 1;
#ifndef _WIN32
    usleep(1000*1000);
#else
    Sleep(1000);
#endif
    if (g_cbs) {
        free(g_cbs);
        g_cbs = NULL;
    }

    return client_buf_mgmt_destroy();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0xb175(%rip), %rax      # 0x11ff0
movl $0x1, (%rax)
movl $0xf4240, %edi          # imm = 0xF4240
callq 0x4780
movq 0xb10e(%rip), %rax      # 0x11fa0
cmpq $0x0, (%rax)
je 0x6eb5
movq 0xb101(%rip), %rax      # 0x11fa0
movq (%rax), %rdi
callq 0x4790
movq 0xb0f2(%rip), %rax      # 0x11fa0
movq $0x0, (%rax)
callq 0x4270
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/ws_client_callback.c
// Function: cb_pop_msg
int cb_pop_msg(char *buf, size_t buf_len, int type, void *usr)
{
    struct lws *wsi = usr;

    if (!usr) {
        return -1;
    }
    return lws_write(wsi, buf, buf_len, type);;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x6eef
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x6f06
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movl -0x1c(%rbp), %ecx
callq 0x4690
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/ws_client_callback.c
// Function: recvframeAppend
static int recvframeAppend(struct lws *wsi, void **appendBuffer, void *in, size_t preLen, size_t len)
{
    char *tmp = NULL;
    
    if (*appendBuffer == NULL){
        tmp = malloc(preLen + len + 1);
    } else {
        tmp = realloc((void *)*appendBuffer,preLen + len + 1);
    } 

    if(!tmp)
    {
        lwsl_notice("recv malloc error:  %p\n", wsi);
        return 0;
    }

    memcpy(tmp + preLen, (void *)in, len);
    *(tmp + preLen +len) = 0;
    *appendBuffer = tmp;
    return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x7195
movq -0x28(%rbp), %rdi
addq -0x30(%rbp), %rdi
addq $0x1, %rdi
callq 0x4798
movq %rax, -0x38(%rbp)
jmp 0x71b1
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
addq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x47a0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x71d8
movq -0x10(%rbp), %rdx
movl $0x4, %edi
leaq 0x7360(%rip), %rsi      # 0xe528
movb $0x0, %al
callq 0x4280
movl $0x0, -0x4(%rbp)
jmp 0x720f
movq -0x38(%rbp), %rdi
addq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x4400
movq -0x38(%rbp), %rax
addq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/wsc_buffer_mgmt.c
// Function: client_buf_mgmt_pop
int client_buf_mgmt_pop(cb_del cb, void *usr)
{
	int ret = 0;
    int rindex = 0;

	pthread_mutex_lock(&g_ws_buf_state.locker);
    
    rindex = g_ws_buf_state.rd_index;
	if (rindex >= g_ws_buf_state.max_buf_cnt){
		g_ws_buf_state.rd_index = 0;
        rindex = 0; 
    }

	if (g_ws_buf[rindex].buf_len == 0) {
		pthread_mutex_unlock(&g_ws_buf_state.locker);
		return LE_SUCCESS;
	}
    
    ret = cb(g_ws_buf[rindex].buf + LWS_PRE, 
                        g_ws_buf[rindex].buf_len, g_ws_buf[rindex].type, usr);
    
    if(ret < g_ws_buf[rindex].buf_len){
        pthread_mutex_unlock(&g_ws_buf_state.locker);
        printf("failed to post msg to server.\n"); 
        return LE_ERROR_UNKNOWN;
    }
    g_ws_buf[rindex].buf_len = 0;
	g_ws_buf_state.rd_index++;
	pthread_mutex_unlock(&g_ws_buf_state.locker);
	
	notify_network();
	return LE_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
leaq 0xaab3(%rip), %rdi      # 0x12648
callq 0x4770
movl 0xaad0(%rip), %eax      # 0x12670
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0xaad0(%rip), %eax      # 0x1267c
jl 0x7bbf
movl $0x0, 0xaab8(%rip)      # 0x12670
movl $0x0, -0x20(%rbp)
movq 0xaaba(%rip), %rax      # 0x12680
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
jne 0x7bf0
leaq 0xaa69(%rip), %rdi      # 0x12648
callq 0x4480
movl $0x0, -0x4(%rbp)
jmp 0x7cc3
movq -0x10(%rbp), %rax
movq 0xaa85(%rip), %rcx      # 0x12680
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rdi
addq $0x10, %rdi
movq 0xaa6c(%rip), %rcx      # 0x12680
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rsi
movq 0xaa56(%rip), %rcx      # 0x12680
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movl 0x10(%rcx), %edx
movq -0x18(%rbp), %rcx
callq *%rax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq 0xaa34(%rip), %rcx      # 0x12680
movslq -0x20(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
cmpq 0x8(%rcx), %rax
jae 0x7c80
leaq 0xa9e4(%rip), %rdi      # 0x12648
callq 0x4480
leaq 0x6a50(%rip), %rdi      # 0xe6c0
movb $0x0, %al
callq 0x4290
movl $0x186a0, -0x4(%rbp)    # imm = 0x186A0
jmp 0x7cc3
movq 0xa9f9(%rip), %rax      # 0x12680
movslq -0x20(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl 0xa9d0(%rip), %eax      # 0x12670
addl $0x1, %eax
movl %eax, 0xa9c7(%rip)      # 0x12670
leaq 0xa998(%rip), %rdi      # 0x12648
callq 0x4480
movb $0x0, %al
callq 0x4050
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/wsc_buffer_mgmt.c
// Function: buf_mgmt_client_clear_msg
void buf_mgmt_client_clear_msg()
{
	int i = 0;
	pthread_mutex_lock(&g_ws_buf_state.locker);

	g_ws_buf_state.wr_index = 0;
	g_ws_buf_state.rd_index = 0;

	for (i = 0; i < MAX_MSG_BUF_COUNT; i++) {
		g_ws_buf[i].buf_len = 0;
	}
	pthread_mutex_unlock(&g_ws_buf_state.locker);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
leaq 0xa962(%rip), %rdi      # 0x12648
callq 0x4770
movl $0x0, 0xa97f(%rip)      # 0x12674
movl $0x0, 0xa971(%rip)      # 0x12670
movl $0x0, -0x4(%rbp)
cmpl $0x8, -0x4(%rbp)
jge 0x7d31
movq 0xa96d(%rip), %rax      # 0x12680
movslq -0x4(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x7d06
leaq 0xa910(%rip), %rdi      # 0x12648
callq 0x4480
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/wsc_buffer_mgmt.c
// Function: client_buf_mgmt_destroy
int client_buf_mgmt_destroy(void)
{
	int i = 0;
    
    if(!g_ws_buf)
        return 0;

	pthread_mutex_lock(&g_ws_buf_state.locker);
	for (i = 0; i < g_ws_buf_state.max_buf_cnt; i++) {
		if (NULL != g_ws_buf[i].buf)
			free(g_ws_buf[i].buf);
	}
    free(g_ws_buf);
    g_ws_buf = NULL;
	pthread_mutex_unlock(&g_ws_buf_state.locker);

	pthread_mutex_destroy(&g_ws_buf_state.locker);
    memset(&g_ws_buf_state, 0, sizeof(msg_buf_status));

    return LE_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x8(%rbp)
cmpq $0x0, 0xa919(%rip)      # 0x12680
jne 0x7d75
movl $0x0, -0x4(%rbp)
jmp 0x7e1c
leaq 0xa8cc(%rip), %rdi      # 0x12648
callq 0x4770
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0xa8eb(%rip), %eax      # 0x1267c
jge 0x7dd3
movq 0xa8e6(%rip), %rcx      # 0x12680
movslq -0x8(%rbp), %rax
imulq $0x18, %rax, %rax
addq %rax, %rcx
xorl %eax, %eax
cmpq (%rcx), %rax
je 0x7dc6
movq 0xa8cd(%rip), %rax      # 0x12680
movslq -0x8(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x4790
jmp 0x7dc8
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7d88
movq 0xa8a6(%rip), %rdi      # 0x12680
callq 0x4790
movq $0x0, 0xa896(%rip) # 0x12680
leaq 0xa857(%rip), %rdi      # 0x12648
callq 0x4480
leaq 0xa84b(%rip), %rdi      # 0x12648
callq 0x42c0
leaq 0xa83f(%rip), %rdi      # 0x12648
xorl %esi, %esi
movl $0x38, %edx
callq 0x4300
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/json/cJSON.c
// Function: cJSON_SetNumberHelper
CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number)
{
    if (number >= INT_MAX)
    {
        object->valueint = INT_MAX;
    }
    else if (number <= INT_MIN)
    {
        object->valueint = INT_MIN;
    }
    else
    {
        object->valueint = (int)number;
    }

    return object->valuedouble = number;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd -0x10(%rbp), %xmm0
movsd 0x6626(%rip), %xmm1     # 0xe6e0
ucomisd %xmm1, %xmm0
jb 0x80cd
movq -0x8(%rbp), %rax
movl $0x7fffffff, 0x28(%rax) # imm = 0x7FFFFFFF
jmp 0x80f7
movsd 0x6613(%rip), %xmm0     # 0xe6e8
ucomisd -0x10(%rbp), %xmm0
jb 0x80e9
movq -0x8(%rbp), %rax
movl $0x80000000, 0x28(%rax) # imm = 0x80000000
jmp 0x80f5
cvttsd2si -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x80f7
movsd -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
movsd %xmm0, 0x30(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/log/log.c
// Function: set_log_level
void set_log_level(int lvl)
{
    if (lvl < LOG_LEVEL_DEBUG || lvl >= LOG_LEVEL_NONE) {
        g_log_lvl = LOG_LEVEL_ERR;
    } else {
        g_log_lvl = lvl;
    }
    printf("set log level :  %d\n", lvl);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jl 0xcbc7
cmpl $0x4, -0x4(%rbp)
jl 0xcbd3
movl $0x3, 0x591f(%rip)      # 0x124f0
jmp 0xcbdc
movl -0x4(%rbp), %eax
movl %eax, 0x5914(%rip)      # 0x124f0
movl -0x4(%rbp), %esi
leaq 0x1c9a(%rip), %rdi      # 0xe880
movb $0x0, %al
callq 0x4290
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/log/log.c
// Function: log_print
void log_print(LOG_LEVEL lvl, cchar *color, cchar *t, cchar *f, cchar *func, int l, cchar *fmt, ...)
{
    if (lvl < g_log_lvl) {
        return;
    }

    va_list ap;
    va_start(ap, fmt);

    char *tmp = NULL;
    char buf_date[20] = {0};
    time_t cur_time = time(NULL);

    t = !t ? "\b" : t;
    f = !f ? "\b" : f;
    func = !func ? "\b" : func;

    tmp = strrchr(f, '/');
    if (tmp) {
        f = tmp + 1;
    }

    //add color support
    if (color) {
        puts(color);
    }

    printf(LOG_FMT, get_timestamp(buf_date, 20, cur_time), g_log_desc[lvl], t, f, func, l);

    vprintf(fmt, ap);

    if (color) {
        puts(COL_DEF);
    }

    va_end(ap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
testb %al, %al
je 0xcc47
movaps %xmm0, -0x100(%rbp)
movaps %xmm1, -0xf0(%rbp)
movaps %xmm2, -0xe0(%rbp)
movaps %xmm3, -0xd0(%rbp)
movaps %xmm4, -0xc0(%rbp)
movaps %xmm5, -0xb0(%rbp)
movaps %xmm6, -0xa0(%rbp)
movaps %xmm7, -0x90(%rbp)
movq 0x10(%rbp), %rax
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x5885(%rip), %eax      # 0x124f0
jae 0xcc72
jmp 0xcde0
leaq -0x50(%rbp), %rax
leaq -0x130(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x30, (%rax)
movq $0x0, -0x58(%rbp)
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x4300
xorl %eax, %eax
movl %eax, %edi
callq 0x4430
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xccd2
leaq 0x1bcc(%rip), %rax      # 0xe895
movq %rax, -0x138(%rbp)
jmp 0xccdd
movq -0x18(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xccff
leaq 0x1b9f(%rip), %rax      # 0xe895
movq %rax, -0x140(%rbp)
jmp 0xcd0a
movq -0x20(%rbp), %rax
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xcd2c
leaq 0x1b72(%rip), %rax      # 0xe895
movq %rax, -0x148(%rbp)
jmp 0xcd37
movq -0x28(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
movl $0x2f, %esi
callq 0x42e0
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0xcd67
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xcd77
movq -0x10(%rbp), %rdi
callq 0x4110
leaq -0x70(%rbp), %rdi
movq -0x78(%rbp), %rdx
movl $0x14, %esi
callq 0xcdf0
movq %rax, %rsi
movl -0x4(%rbp), %eax
movl %eax, %ecx
leaq 0x5768(%rip), %rax      # 0x12500
movq (%rax,%rcx,8), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
movq -0x28(%rbp), %r9
movl -0x2c(%rbp), %eax
leaq 0x1ae5(%rip), %rdi      # 0xe897
movl %eax, (%rsp)
movb $0x0, %al
callq 0x4290
movq 0x10(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x4510
cmpq $0x0, -0x10(%rbp)
je 0xcddc
leaq 0x1ad7(%rip), %rdi      # 0xe8ae
callq 0x4110
leaq -0x50(%rbp), %rax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/log/log.c
// Function: get_timestamp
static char *get_timestamp(char *buf, int len, time_t cur_time)
{
    struct tm tm_time;

#ifndef _WIN32
    localtime_r(&cur_time, &tm_time);
#else
    localtime_s(&tm_time, &cur_time);
#endif

    snprintf(buf, len, "%d-%d-%d %d:%d:%d",
             1900 + tm_time.tm_year, 1 + tm_time.tm_mon,
             tm_time.tm_mday, tm_time.tm_hour,
             tm_time.tm_min, tm_time.tm_sec);
    return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x40c0
movq -0x8(%rbp), %rdi
movslq -0xc(%rbp), %rsi
movl -0x3c(%rbp), %ecx
addl $0x76c, %ecx            # imm = 0x76C
movl -0x40(%rbp), %r8d
addl $0x1, %r8d
movl -0x44(%rbp), %r9d
movl -0x48(%rbp), %r11d
movl -0x4c(%rbp), %r10d
movl -0x50(%rbp), %eax
leaq 0x1a74(%rip), %rdx      # 0xe8b3
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x42d0
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/threadpool/threadpool.c
// Function: threadpool_thread
static void *threadpool_thread(void *threadpool)
{
    threadpool_t *pool = (threadpool_t *)threadpool;
    threadpool_task_t task;

    for(;;) {
        /* Lock must be taken to wait on conditional variable */
        pthread_mutex_lock(&(pool->lock));

        /* Wait on condition variable, check for spurious wakeups.
           When returning from pthread_cond_wait(), we own the lock. */
        while((pool->count == 0) && (!pool->shutdown)) {
            pthread_cond_wait(&(pool->notify), &(pool->lock));
        }

        if((pool->shutdown == immediate_shutdown) ||
           ((pool->shutdown == graceful_shutdown) &&
            (pool->count == 0))) {
            break;
        }

        /* Grab our task */
        task.function = pool->queue[pool->head].function;
        task.argument = pool->queue[pool->head].argument;
        pool->head = (pool->head + 1) % pool->queue_size;
        pool->count -= 1;

        /* Unlock */
        pthread_mutex_unlock(&(pool->lock));

        /* Get to work */
        (*(task.function))(task.argument);
    }

    pool->started--;

    pthread_mutex_unlock(&(pool->lock));
    pthread_exit(NULL);
    return(NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4770
movq -0x10(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x78(%rcx)
movb %al, -0x21(%rbp)
jne 0xd05c
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
setne %al
xorb $-0x1, %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xd065
jmp 0xd078
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x10(%rbp), %rsi
callq 0x41d0
jmp 0xd03d
movq -0x10(%rbp), %rax
cmpl $0x1, 0x7c(%rax)
je 0xd096
movq -0x10(%rbp), %rax
cmpl $0x2, 0x7c(%rax)
jne 0xd098
movq -0x10(%rbp), %rax
cmpl $0x0, 0x78(%rax)
jne 0xd098
jmp 0xd113
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x70(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x70(%rcx), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x70(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cltd
idivl 0x6c(%rcx)
movq -0x10(%rbp), %rax
movl %edx, 0x70(%rax)
movq -0x10(%rbp), %rax
movl 0x78(%rax), %ecx
subl $0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x10(%rbp), %rdi
callq 0x4480
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdi
callq *%rax
jmp 0xd034
movq -0x10(%rbp), %rax
movl 0x80(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x80(%rax)
movq -0x10(%rbp), %rdi
callq 0x4480
xorl %eax, %eax
movl %eax, %edi
callq 0x44c0
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/threadpool/threadpool.c
// Function: threadpool_destroy
int threadpool_destroy(threadpool_t *pool, int flags)
{
    int i, err = 0;

    if(pool == NULL) {
        return threadpool_invalid;
    }

    if(pthread_mutex_lock(&(pool->lock)) != 0) {
        return threadpool_lock_failure;
    }

    do {
        /* Already shutting down */
        if(pool->shutdown) {
            err = threadpool_shutdown;
            pthread_mutex_unlock(&(pool->lock));
            break;
        }

        pool->shutdown = (flags & threadpool_graceful) ?
            graceful_shutdown : immediate_shutdown;

        /* Wake up all worker threads */
        if(pthread_cond_broadcast(&(pool->notify)) != 0) {
            err = threadpool_lock_failure;
            pthread_mutex_unlock(&(pool->lock));
            break;
        }

        pthread_mutex_unlock(&(pool->lock));
        
        /* Join all worker thread */
        for(i = 0; i < pool->thread_count; i++) {
            if(pthread_join(pool->threads[i], NULL) != 0) {
                err = threadpool_thread_failure;
            }
        }
    } while(0);

    /* Only if everything went well do we deallocate the pool */
    if(!err) {
        threadpool_free(pool);
    }
    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xd169
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd24a
movq -0x10(%rbp), %rdi
callq 0x4770
cmpl $0x0, %eax
je 0xd183
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd24a
jmp 0xd185
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
je 0xd1a4
movl $0xfffffffc, -0x1c(%rbp) # imm = 0xFFFFFFFC
movq -0x10(%rbp), %rdi
callq 0x4480
jmp 0xd235
movl -0x14(%rbp), %edx
andl $0x1, %edx
movl $0x1, %ecx
movl $0x2, %eax
cmpl $0x0, %edx
cmovnel %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x7c(%rax)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x4100
cmpl $0x0, %eax
je 0xd1e5
movl $0xfffffffe, -0x1c(%rbp) # imm = 0xFFFFFFFE
movq -0x10(%rbp), %rdi
callq 0x4480
jmp 0xd235
movq -0x10(%rbp), %rdi
callq 0x4480
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x68(%rcx), %eax
jge 0xd233
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x46f0
cmpl $0x0, %eax
je 0xd226
movl $0xfffffffb, -0x1c(%rbp) # imm = 0xFFFFFFFB
jmp 0xd228
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xd1f5
jmp 0xd235
cmpl $0x0, -0x1c(%rbp)
jne 0xd244
movq -0x10(%rbp), %rdi
callq 0x4420
movl -0x1c(%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/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/threadpool/threadpool.c
// Function: threadpool_free
int threadpool_free(threadpool_t *pool)
{
    if(pool == NULL || pool->started > 0) {
        return -1;
    }

    /* Did we manage to allocate ? */
    if(pool->threads) {
        free(pool->threads);
        free(pool->queue);

#if 0   /* reth code  */ 
        /* Because we allocate pool->threads after initializing the
           mutex and condition variable, we're sure they're
           initialized. Let's lock the mutex just in case. */
        pthread_mutex_lock(&(pool->lock));
#endif
        pthread_mutex_destroy(&(pool->lock));
        pthread_cond_destroy(&(pool->notify));
    }
    free(pool);    
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd280
movq -0x10(%rbp), %rax
cmpl $0x0, 0x80(%rax)
jle 0xd289
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd2d4
movq -0x10(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0xd2c4
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
callq 0x4790
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x4790
movq -0x10(%rbp), %rdi
callq 0x42c0
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x45f0
movq -0x10(%rbp), %rdi
callq 0x4790
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/threadpool/threadpool.c
// Function: threadpool_add
int threadpool_add(threadpool_t *pool, void (*function)(void *),
                   void *argument, int flags)
{
    int err = 0;
    int next;
    (void) flags;

    if(pool == NULL || function == NULL) {
        return threadpool_invalid;
    }

    if(pthread_mutex_lock(&(pool->lock)) != 0) {
        return threadpool_lock_failure;
    }

    next = (pool->tail + 1) % pool->queue_size;

    do {
        /* Are we full ? */
        if(pool->count == pool->queue_size) {
            err = threadpool_queue_full;
            break;
        }

        /* Are we shutting down ? */
        if(pool->shutdown) {
            err = threadpool_shutdown;
            break;
        }

        /* Add task to queue */
        pool->queue[pool->tail].function = function;
        pool->queue[pool->tail].argument = argument;
        pool->tail = next;
        pool->count += 1;

        /* pthread_cond_broadcast */
        if(pthread_cond_signal(&(pool->notify)) != 0) {
            err = threadpool_lock_failure;
            break;
        }
    } while(0);

    if(pthread_mutex_unlock(&pool->lock) != 0) {
        err = threadpool_lock_failure;
    }

    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xd30c
cmpq $0x0, -0x18(%rbp)
jne 0xd318
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd402
movq -0x10(%rbp), %rdi
callq 0x4770
cmpl $0x0, %eax
je 0xd332
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xd402
movq -0x10(%rbp), %rax
movl 0x74(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cltd
idivl 0x6c(%rcx)
movl %edx, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl 0x78(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x6c(%rcx), %eax
jne 0xd363
movl $0xfffffffd, -0x28(%rbp) # imm = 0xFFFFFFFD
jmp 0xd3e7
movq -0x10(%rbp), %rax
cmpl $0x0, 0x7c(%rax)
je 0xd376
movl $0xfffffffc, -0x28(%rbp) # imm = 0xFFFFFFFC
jmp 0xd3e7
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rdx
movslq 0x74(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rdx
movslq 0x74(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x2c(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x74(%rax)
movq -0x10(%rbp), %rax
movl 0x78(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x78(%rax)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x43a0
cmpl $0x0, %eax
je 0xd3e5
movl $0xfffffffe, -0x28(%rbp) # imm = 0xFFFFFFFE
jmp 0xd3e7
jmp 0xd3e7
movq -0x10(%rbp), %rdi
callq 0x4480
cmpl $0x0, %eax
je 0xd3fc
movl $0xfffffffe, -0x28(%rbp) # imm = 0xFFFFFFFE
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: get_label
int get_label (labelType lt)
{
	switch (lt)
	{
		case LABEL_SWITCH :
			switchLabelCount++ ;
			return switchLabelCount ;

		case LABEL_FOR :
			forLabelCount++ ;
			return forLabelCount ;

		case LABEL_WHILE :
			whileLabelCount++ ;
			return whileLabelCount ;

		case LABEL_DIV_ZERO :
			divZeroLabelCount++ ;
			return divZeroLabelCount ;

		case LABEL_OTHER :
			otherLabelCount++ ;
			return otherLabelCount ;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq %rax, -0x10(%rbp)
subq $0x4, %rax
ja 0x16ac
movq -0x10(%rbp), %rax
leaq 0x13b5d(%rip), %rcx     # 0x15180
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x1bcfe(%rip), %eax     # 0x1d330
addl $0x1, %eax
movl %eax, 0x1bcf5(%rip)     # 0x1d330
movl 0x1bcef(%rip), %eax     # 0x1d330
movl %eax, -0x4(%rbp)
jmp 0x16ac
movl 0x1bce8(%rip), %eax     # 0x1d334
addl $0x1, %eax
movl %eax, 0x1bcdf(%rip)     # 0x1d334
movl 0x1bcd9(%rip), %eax     # 0x1d334
movl %eax, -0x4(%rbp)
jmp 0x16ac
movl 0x1bcd2(%rip), %eax     # 0x1d338
addl $0x1, %eax
movl %eax, 0x1bcc9(%rip)     # 0x1d338
movl 0x1bcc3(%rip), %eax     # 0x1d338
movl %eax, -0x4(%rbp)
jmp 0x16ac
movl 0x1bcc0(%rip), %eax     # 0x1d340
addl $0x1, %eax
movl %eax, 0x1bcb7(%rip)     # 0x1d340
movl 0x1bcb1(%rip), %eax     # 0x1d340
movl %eax, -0x4(%rbp)
jmp 0x16ac
movl 0x1bca2(%rip), %eax     # 0x1d33c
addl $0x1, %eax
movl %eax, 0x1bc99(%rip)     # 0x1d33c
movl 0x1bc93(%rip), %eax     # 0x1d33c
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)