LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/wsc_buffer_mgmt.c
// Function: client_buf_mgmt_init
int client_buf_mgmt_init(int single_buf_size, int max_buf_cnt)
{
	int i = 0;
    int ret = 0;

    memset(&g_ws_buf_state, 0, sizeof(msg_buf_status));
    ret = pthread_mutex_init(&g_ws_buf_state.locker, NULL);
    if(ret != 0){
        printf("failed to init buffer locker.\n");
        return LE_ERROR_CREATING_MUTEX; 
    }
    g_ws_buf_state.rd_index = 0;
	g_ws_buf_state.wr_index = 0;
    g_ws_buf_state.single_buf_size = single_buf_size;
    g_ws_buf_state.max_buf_cnt = max_buf_cnt;

    g_ws_buf = malloc(max_buf_cnt * sizeof(msg_buf_item));
    if(!g_ws_buf){
        printf("failed to malloc memory for client buffer mgmt\n");
        pthread_mutex_destroy(&g_ws_buf_state.locker);
        return LE_ERROR_ALLOCATING_MEM;
    }
    memset(g_ws_buf, 0, sizeof(msg_buf_item) * max_buf_cnt);
	for (i = 0; i < max_buf_cnt; i++) {
        g_ws_buf[i].buf = malloc(single_buf_size);
        if(!g_ws_buf[i].buf)
            goto _failed;
		memset(g_ws_buf[i].buf, 0, single_buf_size);
	}

    return 0;
_failed:
    for(i = 0; i < max_buf_cnt; i++){
        if(g_ws_buf[i].buf){
            free(g_ws_buf[i].buf);
            g_ws_buf[i].buf = NULL;
        }else
            break;
    }
    
    free(g_ws_buf);
    g_ws_buf = NULL;
    pthread_mutex_destroy(&g_ws_buf_state.locker);

	return LE_ERROR_ALLOCATING_MEM;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %r15d
xorps %xmm0, %xmm0
movups %xmm0, 0x7cee(%rip)     # 0xe598
movups %xmm0, 0x7cd7(%rip)     # 0xe588
movups %xmm0, 0x7cc0(%rip)     # 0xe578
andq $0x0, 0x7ce8(%rip)      # 0xe5a8
leaq 0x7cb1(%rip), %rdi      # 0xe578
xorl %esi, %esi
callq 0x4700
testl %eax, %eax
je 0x68e8
leaq 0x3d99(%rip), %rdi      # 0xa672
callq 0x4100
movl $0x186a3, %eax          # imm = 0x186A3
jmp 0x69af
andq $0x0, 0x7cb0(%rip)      # 0xe5a0
movl %r15d, 0x7cb1(%rip)     # 0xe5a8
movl %r14d, 0x7cae(%rip)     # 0xe5ac
movslq %r14d, %rax
imulq $0x18, %rax, %rsi
pushq $0x1
popq %rdi
callq 0x43a0
movq %rax, 0x7c9c(%rip)      # 0xe5b0
testq %rax, %rax
je 0x697c
movq %rax, %rbx
movslq %r15d, %r12
xorl %eax, %eax
testl %r14d, %r14d
cmovlel %eax, %r14d
imulq $0x18, %r14, %rax
movq %rax, -0x30(%rbp)
leaq 0x18(%rax), %r13
xorl %r14d, %r14d
leaq 0x18(%r14), %r15
cmpq %r15, %r13
je 0x698a
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0x43a0
movq %rax, (%rbx,%r14)
movq %r15, %r14
testq %rax, %rax
jne 0x6937
xorl %r14d, %r14d
movq -0x30(%rbp), %r15
cmpq %r14, %r15
je 0x698e
movq (%rbx,%r14), %rdi
testq %rdi, %rdi
je 0x698e
callq 0x4750
andq $0x0, (%rbx,%r14)
addq $0x18, %r14
jmp 0x695e
leaq 0x3cc0(%rip), %rdi      # 0xa643
callq 0x4100
jmp 0x699e
xorl %eax, %eax
jmp 0x69af
movq %rbx, %rdi
callq 0x4750
andq $0x0, 0x7c12(%rip)      # 0xe5b0
leaq 0x7bd3(%rip), %rdi      # 0xe578
callq 0x42a0
movl $0x186a2, %eax          # imm = 0x186A2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/ali_ws/wsc_buffer_mgmt.c
// Function: client_buf_mgmt_push
int client_buf_mgmt_push(const char *buf, size_t len, int msg_type)
{
	msg_buf_item *p_new_msg = NULL;
    char         *tmp = NULL;
    int           windex = 0;

    if(!buf || !g_ws_buf)
        return LE_ERROR_INVAILD_PARAM;

	pthread_mutex_lock(&g_ws_buf_state.locker);
    
    windex = g_ws_buf_state.wr_index;
	if (windex >= g_ws_buf_state.max_buf_cnt){
		g_ws_buf_state.wr_index = 0;
        windex = 0;
    }
    ++len;
    if(len > g_ws_buf_state.single_buf_size - LWS_PRE){
        tmp = realloc(g_ws_buf[windex].buf, len + LWS_PRE);    
        if(!tmp){
            printf("failed to alloc more memory to store msg\n");
            pthread_mutex_unlock(&g_ws_buf_state.locker);
            return LE_ERROR_ALLOCATING_MEM;
        }
        memset(tmp, 0, len + LWS_PRE);
        g_ws_buf[windex].buf = tmp;
    }

	memset(g_ws_buf[windex].buf, 0, g_ws_buf[windex].buf_len);
	memcpy(g_ws_buf[windex].buf + LWS_PRE, buf, len - 1);
	g_ws_buf[windex].buf[LWS_PRE + len - 1] = '\0';
	g_ws_buf[windex].buf_len = len;
	g_ws_buf[windex].type = msg_type;

	g_ws_buf_state.wr_index++;

	pthread_mutex_unlock(&g_ws_buf_state.locker);

    notify_network();
	return LE_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl $0x186a1, %r12d         # imm = 0x186A1
testq %rdi, %rdi
je 0x6ad3
cmpq $0x0, 0x7bca(%rip)      # 0xe5b0
je 0x6ad3
movq %rsi, %r14
movq %rdi, -0x48(%rbp)
movl %edx, -0x2c(%rbp)
leaq 0x7b7b(%rip), %rdi      # 0xe578
callq 0x4720
movl 0x7b9c(%rip), %eax      # 0xe5a4
cmpl 0x7b9e(%rip), %eax      # 0xe5ac
jl 0x6a19
andl $0x0, 0x7b8d(%rip)      # 0xe5a4
xorl %eax, %eax
leaq 0x1(%r14), %rdx
movslq 0x7b84(%rip), %rcx      # 0xe5a8
addq $-0x10, %rcx
movq 0x7b81(%rip), %rbx      # 0xe5b0
cltq
imulq $0x18, %rax, %r15
movq (%rbx,%r15), %r13
movq %rdx, -0x40(%rbp)
cmpq %rcx, %rdx
jbe 0x6a79
leaq 0x11(%r14), %r12
movq %r13, %rdi
movq %r12, %rsi
callq 0x4760
testq %rax, %rax
je 0x6ae5
movq %rax, %r13
leaq (%rbx,%r15), %rax
movq %rax, -0x38(%rbp)
movq %r13, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x42e0
movq -0x38(%rbp), %rax
movq %r13, (%rax)
movq 0x8(%rbx,%r15), %rdx
xorl %r12d, %r12d
movq %r13, %rdi
xorl %esi, %esi
callq 0x42e0
movq (%rbx,%r15), %rdi
addq $0x10, %rdi
movq -0x48(%rbp), %rsi
movq %r14, %rdx
callq 0x43f0
movq (%rbx,%r15), %rax
movb $0x0, 0x10(%rax,%r14)
movq -0x40(%rbp), %rax
movq %rax, 0x8(%rbx,%r15)
movl -0x2c(%rbp), %eax
movl %eax, 0x10(%rbx,%r15)
leaq 0x7ab7(%rip), %rdi      # 0xe578
incl 0x7add(%rip)            # 0xe5a4
callq 0x4460
xorl %eax, %eax
callq 0x4050
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3ba4(%rip), %rdi      # 0xa690
callq 0x4100
leaq 0x7a80(%rip), %rdi      # 0xe578
callq 0x4460
movl $0x186a2, %r12d         # imm = 0x186A2
jmp 0x6ad3
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x7a5c(%rip), %rdi      # 0xe578
callq 0x4720
movl 0x7a79(%rip), %ecx      # 0xe5a0
cmpl 0x7a7f(%rip), %ecx      # 0xe5ac
jl 0x6b38
andl $0x0, 0x7a6a(%rip)      # 0xe5a0
xorl %ecx, %ecx
movq 0x7a71(%rip), %rax      # 0xe5b0
movslq %ecx, %rcx
imulq $0x18, %rcx, %r15
movq 0x8(%rax,%r15), %rsi
testq %rsi, %rsi
je 0x6b92
addq %r15, %rax
movq (%rax), %rdi
addq $0x10, %rdi
movl 0x10(%rax), %edx
movq %r14, %rcx
callq *%rbx
movslq %eax, %rcx
movq 0x7a44(%rip), %rax      # 0xe5b0
cmpq %rcx, 0x8(%rax,%r15)
jbe 0x6ba2
leaq 0x79fe(%rip), %rdi      # 0xe578
callq 0x4460
leaq 0x3b33(%rip), %rdi      # 0xa6b9
callq 0x4100
movl $0x186a0, %ebx          # imm = 0x186A0
jmp 0x6bc8
leaq 0x79df(%rip), %rdi      # 0xe578
callq 0x4460
xorl %ebx, %ebx
jmp 0x6bc8
addq %r15, %rax
addq $0x8, %rax
andq $0x0, (%rax)
leaq 0x79c4(%rip), %rdi      # 0xe578
incl 0x79e6(%rip)            # 0xe5a0
callq 0x4460
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x4050
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
leaq 0x7998(%rip), %rdi      # 0xe578
callq 0x4720
andq $0x0, 0x79b3(%rip)      # 0xe5a0
pushq $0x8
popq %rax
movq 0x79b9(%rip), %rcx      # 0xe5b0
cmpq $0xc8, %rax
je 0x6c0a
andq $0x0, (%rcx,%rax)
addq $0x18, %rax
jmp 0x6bf7
leaq 0x7967(%rip), %rdi      # 0xe578
popq %rbp
jmp 0x4460
// File: /workspace/github_c_makefile_star2_O2/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:
cmpq $0x0, 0x7991(%rip)      # 0xe5b0
je 0x6cb6
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7942(%rip), %rdi      # 0xe578
callq 0x4720
xorl %r14d, %r14d
movq 0x796b(%rip), %rbx      # 0xe5b0
movq %rbx, %r15
movslq 0x795d(%rip), %rax      # 0xe5ac
cmpq %rax, %r14
jge 0x6c65
movq (%r15), %rdi
callq 0x4750
incq %r14
addq $0x18, %r15
jmp 0x6c48
movq %rbx, %rdi
callq 0x4750
andq $0x0, 0x793b(%rip)      # 0xe5b0
leaq 0x78fc(%rip), %rbx      # 0xe578
movq %rbx, %rdi
callq 0x4460
movq %rbx, %rdi
callq 0x42a0
xorps %xmm0, %xmm0
movups %xmm0, 0x78e2(%rip)     # 0xe578
movups %xmm0, 0x78eb(%rip)     # 0xe588
movups %xmm0, 0x78f4(%rip)     # 0xe598
andq $0x0, 0x78fc(%rip)      # 0xe5a8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
xorl %eax, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/json/cJSON.c
// Function: cJSON_InitHooks
CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks)
{
    if (hooks == NULL)
    {
        /* Reset hooks */
        global_hooks.allocate = malloc;
        global_hooks.deallocate = free;
        global_hooks.reallocate = realloc;
        return;
    }

    global_hooks.allocate = malloc;
    if (hooks->malloc_fn != NULL)
    {
        global_hooks.allocate = hooks->malloc_fn;
    }

    global_hooks.deallocate = free;
    if (hooks->free_fn != NULL)
    {
        global_hooks.deallocate = hooks->free_fn;
    }

    /* use realloc only if both free and malloc are used */
    global_hooks.reallocate = NULL;
    if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free))
    {
        global_hooks.reallocate = realloc;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdi, %rdi
je 0x6d7c
movq 0x727a(%rip), %rdx      # 0xdfb8
movq %rdx, 0x770b(%rip)      # 0xe450
movq (%rdi), %rax
testq %rax, %rax
cmoveq %rdx, %rax
movq 0x721a(%rip), %rsi      # 0xdf70
movq %rsi, 0x76fb(%rip)      # 0xe458
movq 0x8(%rdi), %rcx
testq %rcx, %rcx
cmoveq %rsi, %rcx
xorq %rax, %rdx
xorq %rcx, %rsi
orq %rdx, %rsi
jne 0x6d93
movq 0x7246(%rip), %rdx      # 0xdfc0
jmp 0x6d95
movq 0x723d(%rip), %rdx      # 0xdfc0
movq 0x71e6(%rip), %rcx      # 0xdf70
movq 0x7227(%rip), %rax      # 0xdfb8
jmp 0x6d95
xorl %edx, %edx
movq %rax, 0x76b4(%rip)      # 0xe450
movq %rcx, 0x76b5(%rip)      # 0xe458
movq %rdx, 0x76b6(%rip)      # 0xe460
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/json/cJSON.c
// Function: cJSON_Minify
CJSON_PUBLIC(void) cJSON_Minify(char *json)
{
    unsigned char *into = (unsigned char*)json;

    if (json == NULL)
    {
        return;
    }

    while (*json)
    {
        if (*json == ' ')
        {
            json++;
        }
        else if (*json == '\t')
        {
            /* Whitespace characters. */
            json++;
        }
        else if (*json == '\r')
        {
            json++;
        }
        else if (*json=='\n')
        {
            json++;
        }
        else if ((*json == '/') && (json[1] == '/'))
        {
            /* double-slash comments, to end of line. */
            while (*json && (*json != '\n'))
            {
                json++;
            }
        }
        else if ((*json == '/') && (json[1] == '*'))
        {
            /* multiline comments. */
            while (*json && !((*json == '*') && (json[1] == '/')))
            {
                json++;
            }
            json += 2;
        }
        else if (*json == '\"')
        {
            /* string literals, which are \" sensitive. */
            *into++ = (unsigned char)*json++;
            while (*json && (*json != '\"'))
            {
                if (*json == '\\')
                {
                    *into++ = (unsigned char)*json++;
                }
                *into++ = (unsigned char)*json++;
            }
            *into++ = (unsigned char)*json++;
        }
        else
        {
            /* All other characters. */
            *into++ = (unsigned char)*json++;
        }
    }

    /* and null-terminate. */
    *into = '\0';
}

// Assembly:
testq %rdi, %rdi
je 0x8981
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movzbl (%rdi), %ecx
cmpl $0x9, %ecx
je 0x88d9
cmpl $0xa, %ecx
je 0x88d9
cmpl $0xd, %ecx
je 0x88d9
cmpl $0x20, %ecx
je 0x88d9
cmpl $0x22, %ecx
je 0x88de
cmpl $0x2f, %ecx
je 0x891b
testl %ecx, %ecx
jne 0x8970
jmp 0x897d
incq %rdi
jmp 0x88ab
movb $0x22, (%rax)
movzbl 0x1(%rdi), %ecx
cmpl $0x5c, %ecx
je 0x88fb
testl %ecx, %ecx
je 0x890e
cmpl $0x22, %ecx
je 0x890e
incq %rax
incq %rdi
jmp 0x890a
movb $0x5c, 0x1(%rax)
addq $0x2, %rax
movb 0x2(%rdi), %cl
addq $0x2, %rdi
movb %cl, (%rax)
jmp 0x88e1
addq $0x2, %rdi
movb %cl, 0x1(%rax)
addq $0x2, %rax
jmp 0x88ab
movzbl 0x1(%rdi), %edx
cmpl $0x2f, %edx
je 0x895b
cmpl $0x2a, %edx
jne 0x8970
addq $0x2, %rdi
movb $0x2f, %cl
cmpb $0x2a, %cl
je 0x8944
movzbl %cl, %ecx
testl %ecx, %ecx
je 0x88ab
movb -0x1(%rdi), %cl
jmp 0x8950
movb -0x1(%rdi), %cl
cmpb $0x2f, %cl
je 0x88ab
incq %rdi
jmp 0x892f
movb 0x1(%rdi), %dl
incq %rdi
testb %dl, %dl
je 0x88ab
movzbl %dl, %ecx
cmpl $0xa, %ecx
jne 0x8955
jmp 0x88ab
incq %rdi
movb %cl, (%rax)
incq %rax
jmp 0x88ab
movb $0x0, (%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
testb %al, %al
je 0x923b
movaps %xmm0, -0xf0(%rbp)
movaps %xmm1, -0xe0(%rbp)
movaps %xmm2, -0xd0(%rbp)
movaps %xmm3, -0xc0(%rbp)
movaps %xmm4, -0xb0(%rbp)
movaps %xmm5, -0xa0(%rbp)
movaps %xmm6, -0x90(%rbp)
movaps %xmm7, -0x80(%rbp)
cmpl %edi, 0x5227(%rip)      # 0xe468
ja 0x9374
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r15
movl %edi, %r13d
movl %r9d, -0x2c(%rbp)
leaq -0x120(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movabsq $0x3000000030, %rax     # imm = 0x3000000030
movq %rax, -0x50(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x70(%rbp)
andl $0x0, -0x60(%rbp)
xorl %edi, %edi
movq %rsi, %rbx
callq 0x4420
testq %r15, %r15
leaq 0x14f2(%rip), %rcx      # 0xa789
cmoveq %rcx, %r15
testq %r12, %r12
cmoveq %rcx, %r12
movq %rax, -0x38(%rbp)
testq %r14, %r14
cmoveq %rcx, %r14
pushq $0x2f
popq %rsi
movq %r12, %rdi
callq 0x42c0
movq %rbx, %rdi
leaq 0x1(%rax), %rbx
testq %rax, %rax
cmoveq %r12, %rbx
testq %rdi, %rdi
je 0x9329
callq 0x4100
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
callq 0x9386
movl %r13d, %eax
leaq 0x4a96(%rip), %rcx      # 0xdd80
movq (%rcx,%rax,8), %rdx
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x1490(%rip), %rdi      # 0xa78b
movq %r12, %rsi
movq %r15, %rcx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x4270
leaq -0x50(%rbp), %rsi
movq 0x10(%rbp), %rdi
callq 0x44e0
leaq 0x1480(%rip), %rdi      # 0xa7a2
callq 0x4100
jmp 0x9374
leaq -0x70(%rbp), %r12
movq %r12, %rdi
movq -0x38(%rbp), %rsi
callq 0x9386
movl %r13d, %eax
leaq 0x4a3d(%rip), %rcx      # 0xdd80
movq (%rcx,%rax,8), %rdx
movl -0x2c(%rbp), %eax
movl %eax, (%rsp)
leaq 0x1437(%rip), %rdi      # 0xa78b
movq %r12, %rsi
movq %r15, %rcx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x4270
leaq -0x50(%rbp), %rsi
movq 0x10(%rbp), %rdi
callq 0x44e0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq -0x18(%rbp), %rdi
movq %rsi, (%rdi)
leaq -0x50(%rbp), %r14
movq %r14, %rsi
callq 0x40c0
movl $0x76c, %ecx            # imm = 0x76C
addl 0x14(%r14), %ecx
movl 0x10(%r14), %r8d
incl %r8d
movl 0xc(%r14), %r9d
movl 0x8(%r14), %r10d
movl (%r14), %r11d
movl 0x4(%r14), %r14d
subq $0x8, %rsp
leaq 0x13d6(%rip), %rdx      # 0xa7a7
pushq $0x14
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
pushq %r11
pushq %r14
pushq %r10
callq 0x42b0
addq $0x20, %rsp
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/back1127[P]linkedge-thing-access-websocket_client_sdk/sdk/utility/threadpool/threadpool.c
// Function: threadpool_create
threadpool_t *threadpool_create(int thread_count, int queue_size, int flags)
{
    threadpool_t *pool;
    int i;
    (void) flags;

    if(thread_count <= 0 || thread_count > MAX_THREADS || queue_size <= 0 || queue_size > MAX_QUEUE) {
        return NULL;
    }

    if((pool = (threadpool_t *)malloc(sizeof(threadpool_t))) == NULL) {
        goto err;
    }

    /* Initialize */
    pool->thread_count = 0;
    pool->queue_size = queue_size;
    pool->head = pool->tail = pool->count = 0;
    pool->shutdown = pool->started = 0;

    /* Allocate thread and task queue */
    pool->threads = (pthread_t *)malloc(sizeof(pthread_t) * thread_count);
    pool->queue = (threadpool_task_t *)malloc
        (sizeof(threadpool_task_t) * queue_size);

    /* Initialize mutex and conditional variable first */
    if((pthread_mutex_init(&(pool->lock), NULL) != 0) ||
       (pthread_cond_init(&(pool->notify), NULL) != 0) ||
       (pool->threads == NULL) ||
       (pool->queue == NULL)) {
        goto err;
    }

    /* Start worker threads */
    for(i = 0; i < thread_count; i++) {
        if(pthread_create(&(pool->threads[i]), NULL,
                          threadpool_thread, (void*)pool) != 0) {
            threadpool_destroy(pool, 0);
            return NULL;
        }
        pool->thread_count++;
        pool->started++;
    }

    return pool;

 err:
    if(pool) {
        threadpool_free(pool);
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r15d
movl %edi, %r14d
leal -0x41(%r14), %eax
cmpl $-0x40, %eax
setb %al
leal -0x10001(%r15), %ecx
cmpl $0xffff0000, %ecx       # imm = 0xFFFF0000
setb %cl
orb %al, %cl
jne 0x9494
movl $0x88, %edi
callq 0x4758
testq %rax, %rax
je 0x9494
movq %rax, %rbx
andl $0x0, 0x68(%rax)
movl %r15d, 0x6c(%rax)
leal (,%r14,8), %edi
callq 0x4758
andl $0x0, 0x80(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rbx)
movq %rax, 0x58(%rbx)
shll $0x4, %r15d
movq %r15, %rdi
callq 0x4758
movq %rax, 0x60(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4700
testl %eax, %eax
jne 0x948c
movq %rbx, %rdi
addq $0x28, %rdi
xorl %esi, %esi
callq 0x4440
testl %eax, %eax
je 0x94a2
movq %rbx, %rdi
callq 0x4410
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x58(%rbx)
je 0x948c
cmpq $0x0, 0x60(%rbx)
je 0x948c
movl %r14d, %r15d
shlq $0x3, %r15
xorl %r12d, %r12d
leaq 0x38(%rip), %r14        # 0x94f9
cmpq %r12, %r15
je 0x9496
movq 0x58(%rbx), %rdi
addq %r12, %rdi
xorl %esi, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x4560
testl %eax, %eax
jne 0x94ed
incl 0x68(%rbx)
incl 0x80(%rbx)
addq $0x8, %r12
jmp 0x94c1
movq %rbx, %rdi
xorl %esi, %esi
callq 0x4610
jmp 0x9494
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x28(%rdi), %r14
movq %rbx, %rdi
callq 0x4720
movl 0x78(%rbx), %ecx
movl 0x7c(%rbx), %eax
movl %ecx, %edx
orl %eax, %edx
jne 0x952c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x41c0
jmp 0x9513
cmpl $0x2, %eax
je 0x9538
cmpl $0x1, %eax
jne 0x953c
jmp 0x9570
testl %ecx, %ecx
je 0x9570
movq 0x60(%rbx), %rdx
movslq 0x70(%rbx), %rsi
leal 0x1(%rsi), %eax
shlq $0x4, %rsi
movq (%rdx,%rsi), %r12
movq 0x8(%rdx,%rsi), %r15
cltd
idivl 0x6c(%rbx)
movl %edx, 0x70(%rbx)
decl %ecx
movl %ecx, 0x78(%rbx)
movq %rbx, %rdi
callq 0x4460
movq %r15, %rdi
callq *%r12
jmp 0x950b
decl 0x80(%rbx)
movq %rbx, %rdi
callq 0x4460
xorl %edi, %edi
callq 0x44a0
// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x95ba
movl %esi, %r15d
movq %rdi, %rbx
callq 0x4720
pushq $-0x2
popq %r14
testl %eax, %eax
jne 0x95be
cmpl $0x0, 0x7c(%rbx)
je 0x95ca
movq %rbx, %rdi
callq 0x4460
pushq $-0x4
jmp 0x95bc
pushq $-0x1
popq %r14
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andl $0x1, %r15d
incl %r15d
movl %r15d, 0x7c(%rbx)
leaq 0x28(%rbx), %rdi
callq 0x40f0
movl %eax, %r15d
movq %rbx, %rdi
callq 0x4460
testl %r15d, %r15d
jne 0x95be
xorl %r15d, %r15d
pushq $-0x5
popq %r12
xorl %r14d, %r14d
movslq 0x68(%rbx), %rax
cmpq %rax, %r15
jge 0x961b
movq 0x58(%rbx), %rax
movq (%rax,%r15,8), %rdi
xorl %esi, %esi
callq 0x46a0
testl %eax, %eax
cmovnel %r12d, %r14d
incq %r15
jmp 0x95f8
testl %r14d, %r14d
jne 0x95be
movq %rbx, %rdi
callq 0x4410
xorl %r14d, %r14d
jmp 0x95be
// File: /workspace/github_c_makefile_star2_O2/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 $-0x1
popq %rax
testq %rdi, %rdi
je 0x967f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x80(%rdi)
jg 0x9679
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x966f
callq 0x4750
movq 0x60(%rbx), %rdi
callq 0x4750
movq %rbx, %rdi
callq 0x42a0
leaq 0x28(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
callq 0x4750
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x9694
pushq $-0x1
popq %rax
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
callq 0x4720
testl %eax, %eax
je 0x96b5
pushq $-0x2
popq %rax
jmp 0x96e8
movslq 0x74(%rbx), %rcx
leal 0x1(%rcx), %eax
movl 0x6c(%rbx), %edi
movl 0x78(%rbx), %esi
cltd
idivl %edi
cmpl %edi, %esi
jne 0x96cd
pushq $-0x3
jmp 0x96d5
cmpl $0x0, 0x7c(%rbx)
je 0x96f3
pushq $-0x4
popq %r14
movq %rbx, %rdi
callq 0x4460
testl %eax, %eax
pushq $-0x2
popq %rax
cmovel %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x60(%rbx), %rax
shlq $0x4, %rcx
movq %r15, (%rax,%rcx)
movq %r14, 0x8(%rax,%rcx)
movl %edx, 0x74(%rbx)
incl %esi
movl %esi, 0x78(%rbx)
leaq 0x28(%rbx), %rdi
callq 0x4380
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal -0x2(,%rcx,2), %r14d
jmp 0x96d7
nop
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/erplag.c
// Function: main
int main(int argc, char **argv)
{
	FILE *fpIn ;
	char *outputFile ;
	checkCommand (argc, argv, &outputFile) ;
 
 	if (!(fpIn = fopen (argv[1], "r")))
 	{
 		errFatal () ;
		#if defined __linux__ || defined __MACH__
 			printf ("Source file " ANSI_BOLD "%s" ANSI_RESET " does not exist\n", argv[1]) ;
		#endif
		#ifdef _WIN64
			printf ("Source file %s does not exist\n", argv[1]) ;
		#endif
 		exit (1) ;
 	}


	treeNode *root = parse (fpIn) ;
	if (root->syntax_error)
		exit (1) ;

	astNode *astRoot ;
	astRoot = applyASTRule (root) ;
	deletePT (root) ;
	
	realBase = fillSymbolTable (astRoot,0);

	if (!realBase->semanticError)
	{
		if (realPresent)
		{
			errCodegen () ;
			#if defined __linux__ || defined __MACH__
				printf ("Variables or static values of type " ANSI_BOLD ANSI_GREEN "real" ANSI_RESET " found in source file, which is not handled by the present version of the compiler.\n") ;
			#endif
			#ifdef _WIN64
				printf ("Variables or static values of type \"real\" found in source file, which is not handled by the present version of the compiler.\n") ;
			#endif
			exit (1) ;
		}

		int len ;
		if (!(fpOut = fopen (outputFile, "w")))
		{
			errFatal () ;
			#if defined __linux__ || defined __MACH__
				printf ("Error creating asm file " ANSI_BOLD "%s" ANSI_RESET "\n", outputFile) ;
			#endif
			#ifdef _WIN64
				printf ("Error creating asm file %s\n", outputFile) ;
			#endif
			exit (1) ;
		}

		preamble () ;
		codeGeneration (astRoot) ;
		postamble () ;
	}
	else
		exit (1) ;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
leaq -0x18(%rbp), %rdx
callq 0x127c
movq 0x8(%rbx), %rdi
leaq 0xefe6(%rip), %rsi      # 0x103f5
callq 0x1120
testq %rax, %rax
je 0x14b2
movq %rax, %rdi
callq 0xa39c
cmpl $0x0, 0x24(%rax)
jne 0x14f3
movq %rax, %r14
movq %rax, %rdi
callq 0x5b4e
movq %rax, %rbx
movq %r14, %rdi
callq 0xa79a
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc82b
leaq 0x2ebc2(%rip), %rcx     # 0x30018
movq %rax, (%rcx)
cmpl $0x0, 0xd8(%rax)
jne 0x14f3
leaq 0x2eba7(%rip), %rax     # 0x30014
cmpl $0x0, (%rax)
jne 0x14c6
movq -0x18(%rbp), %r14
leaq 0xf0b7(%rip), %rsi      # 0x10534
movq %r14, %rdi
callq 0x1120
movq %rax, 0x14eac(%rip)     # 0x16338
testq %rax, %rax
je 0x14db
xorl %eax, %eax
callq 0x3cd9
movq %rbx, %rdi
callq 0x3b8b
xorl %eax, %eax
callq 0x41a6
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
callq 0xd60f
movq 0x8(%rbx), %rsi
leaq 0xcb40(%rip), %rdi      # 0xe004
jmp 0x14ec
xorl %eax, %eax
callq 0xd6ab
leaq 0xcc1e(%rip), %rdi      # 0xe0f2
callq 0x1070
jmp 0x14f3
xorl %eax, %eax
callq 0xd60f
leaq 0xcb42(%rip), %rdi      # 0xe02b
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
pushq $0x1
popq %rdi
callq 0x1150
nop
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: codeComment
void codeComment (int tabCount, char *comment)
{
	int i ;
	for (i = 0 ; i < tabCount ; i++)
		codePrint ("\t") ;

	codePrint ("; %s\n", comment) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
xorl %r15d, %r15d
testl %edi, %edi
cmovgl %edi, %r15d
leaq 0x14e00(%rip), %r12     # 0x16338
pushq $0x9
popq %r14
movq (%r12), %rsi
subl $0x1, %r15d
jb 0x1550
movl %r14d, %edi
callq 0x10d0
jmp 0x153c
leaq 0xcccd(%rip), %rax      # 0xe224
movq %rsi, %rdi
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: getOffsetStr
char* getOffsetStr (int offset)
{	
	if (offset > 0)
		sprintf (offsetStr, " - %d", offset) ;
	else if (offset < 0)
		sprintf (offsetStr, " + %d", -offset) ;
	else
		memset (offsetStr, 0, 10) ;

	return offsetStr ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %edx
testl %edi, %edi
jle 0x1590
leaq 0x14de0(%rip), %rdi     # 0x16360
leaq 0xcca3(%rip), %rsi      # 0xe22a
xorl %eax, %eax
callq 0x1140
jmp 0x15a2
js 0x15ab
andw $0x0, 0x14dce(%rip)     # 0x16368
andq $0x0, 0x14dbe(%rip)     # 0x16360
leaq 0x14db7(%rip), %rax     # 0x16360
popq %rbp
retq
negl %edx
leaq 0x14dac(%rip), %rdi     # 0x16360
leaq 0xcc75(%rip), %rsi      # 0xe230
jmp 0x1587
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: loadRegLeftLim
void loadRegLeftLim (varST *vst, char *reg)
{
	if (isLeftLimStatic (vst))
		codePrint ("\t\tMOV %s, %s\n", reg, vst->arrayIndices->tokLeft->lexeme) ;
	else
		codePrint ("\t\tMOV %s, [RBP%s]\n", reg, getOffsetStr(vst->offset-10)) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
callq 0xcd04
leaq 0x14d2e(%rip), %rcx     # 0x16338
movq (%rcx), %r14
testl %eax, %eax
je 0x1626
movq 0x10(%r15), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xcc12(%rip), %rsi      # 0xe236
jmp 0x1640
movl 0x1c(%r15), %edi
addl $-0xa, %edi
callq 0x156f
leaq 0xd403(%rip), %rsi      # 0xea3c
leaq 0x14d20(%rip), %rcx     # 0x16360
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: loadRegRightLim
void loadRegRightLim (varST *vst, char *reg)
{
	if (isRightLimStatic (vst))
		codePrint ("\t\tMOV %s, %s\n", reg, vst->arrayIndices->tokRight->lexeme) ;		
	else
		codePrint ("\t\tMOV %s, [RBP%s]\n", reg, getOffsetStr(vst->offset-8)) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
callq 0xcd35
leaq 0x14cc5(%rip), %rcx     # 0x16338
movq (%rcx), %r14
testl %eax, %eax
je 0x168f
movq 0x10(%r15), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xcba9(%rip), %rsi      # 0xe236
jmp 0x16a9
movl 0x1c(%r15), %edi
addl $-0x8, %edi
callq 0x156f
leaq 0xd39a(%rip), %rsi      # 0xea3c
leaq 0x14cb7(%rip), %rcx     # 0x16360
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: loadArrBase
void loadArrBase (varST *vst, char *reg)
{
	if (isVarStaticArr (vst))
	{
		if (vst->varType == VAR_LOCAL)
		{
			codePrint ("\t\tMOV %s, RBP\n", reg) ;
			codePrint ("\t\tSUB %s, %d\n", reg, vst->offset) ;			
		}
		else
			codePrint ("\t\tMOV %s, [RBP%s]\n", reg, getOffsetStr (vst->offset)) ;
	}
	else
		codePrint ("\t\tMOV %s, [RBP%s]\n", reg, getOffsetStr(vst->offset)) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0xcd66
testl %eax, %eax
je 0x1721
cmpl $0x3, 0x30(%r14)
leaq 0x14c52(%rip), %r12     # 0x16338
movq (%r12), %r15
jne 0x172b
leaq 0xcb51(%rip), %rsi      # 0xe244
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10f0
movq (%r12), %rdi
movl 0x1c(%r14), %ecx
leaq 0xcb44(%rip), %rsi      # 0xe253
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
leaq 0x14c10(%rip), %rax     # 0x16338
movq (%rax), %r15
movl 0x1c(%r14), %edi
callq 0x156f
leaq 0xd301(%rip), %rsi      # 0xea3c
leaq 0x14c1e(%rip), %rcx     # 0x16360
movq %r15, %rdi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: arrBoundCheck
void arrBoundCheck (astNode *node, moduleST *lst, varST *vst)
{
	varST *indexVar = NULL ;
	if (!isIndexStatic (node))	
		indexVar = searchVar (lst, node->child->tok->lexeme) ;

	tf |= 1 << boundCheck ;

	loadArrBase (vst, "RDI") ;
	loadRegLeftLim (vst, "BX") ;

	if (indexVar == NULL)
		codePrint ("\t\tMOV CX, %s\n", node->child->tok->lexeme) ;
	else
		codePrint ("\t\tMOV CX, [RBP%s]\n", getOffsetStr (indexVar->offset)) ;

	loadRegRightLim (vst, "DX") ;

	codePrint ("\t\tCALL @boundCheck") ;
	codeComment (10, "checking array index bound") ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
callq 0x15bd
testl %eax, %eax
je 0x17c7
xorl %r15d, %r15d
jmp 0x17de
movq 0x30(%r14), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0xac19
movq %rax, %r15
orb $0x20, 0x14b74(%rip)    # 0x16359
leaq 0xcb23(%rip), %rsi      # 0xe30f
movq %rbx, %rdi
callq 0x16c0
leaq 0xcf5f(%rip), %rsi      # 0xe75a
movq %rbx, %rdi
callq 0x15ee
leaq 0x14b2e(%rip), %r13     # 0x16338
movq (%r13), %r12
testq %r15, %r15
je 0x182c
movl 0x1c(%r15), %edi
callq 0x156f
leaq 0xca4c(%rip), %rsi      # 0xe26f
leaq 0x14b36(%rip), %rdx     # 0x16360
jmp 0x183f
movq 0x30(%r14), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0xca22(%rip), %rsi      # 0xe261
movq %r12, %rdi
xorl %eax, %eax
callq 0x10f0
leaq 0xca32(%rip), %rsi      # 0xe282
movq %rbx, %rdi
callq 0x1657
movq (%r13), %rcx
leaq 0xca22(%rip), %rdi      # 0xe285
pushq $0x12
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
leaq 0xca23(%rip), %rsi      # 0xe298
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x151a
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: isArrayRHS
int isArrayRHS (astNode *assignNode, moduleST *lst)
{
	varST *searchedVar ;

	if (assignNode->child->next->id == TK_ID)
	{
		searchedVar = searchVar (lst, assignNode->child->next->tok->lexeme) ;
		if (searchedVar->datatype == TK_ARRAY && assignNode->child->next->child == NULL)
			return 1 ;
	}

	return 0 ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x30(%rdi), %rax
movq 0x38(%rax), %rax
cmpl $0x40, (%rax)
jne 0x1929
movq %rdi, %rbx
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rsi, %rdi
movq %rax, %rsi
callq 0xac19
cmpl $0x3b, 0x8(%rax)
jne 0x1929
movq 0x30(%rbx), %rax
movq 0x38(%rax), %rax
cmpq $0x0, 0x30(%rax)
je 0x1932
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
pushq $0x1
popq %rax
jmp 0x192b
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: dynAsgnArr
void dynAsgnArr (varST *lhs, varST *rhs)
{
	tf |= 1 << asgnLimERROR ;
	int leftLab, rightLab ;

	leftLab = get_label (LABEL_OTHER) ;
	rightLab = get_label (LABEL_OTHER) ;

	loadRegLeftLim (lhs, "AX") ;
	loadRegLeftLim (rhs, "CX") ;

	codePrint ("\t\tCMP AX, CX\n") ;
	codePrint ("\t\tJE @LABEL%d\n", leftLab) ;
	codePrint ("\t\tCALL @asgnLimERROR\n") ;

	codePrint ("\n\t@LABEL%d:\n", leftLab) ;
	loadRegRightLim (lhs, "BX") ;
	loadRegRightLim (rhs, "DX") ;

	codePrint ("\t\tCMP BX, DX\n") ;
	codePrint ("\t\tJE @LABEL%d\n", rightLab) ;
	codePrint ("\t\tCALL @asgnLimERROR\n") ;

	codePrint ("\n\t@LABEL%d:\n", rightLab) ;
	loadArrBase (rhs, "RDI") ;
	codePrint ("\t\tMOV[RBP%s], RDI", getOffsetStr(lhs->offset)) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, -0x30(%rbp)
orb $0x10, 0x149d4(%rip)    # 0x16358
movl 0x149c1(%rip), %r15d    # 0x1634c
leal 0x1(%r15), %r13d
addl $0x2, %r15d
movl %r15d, 0x149b2(%rip)    # 0x1634c
leaq 0xc9ab(%rip), %rsi      # 0xe34c
callq 0x15ee
leaq 0xd169(%rip), %rsi      # 0xeb16
movq %r14, %rdi
callq 0x15ee
leaq 0x1497c(%rip), %r12     # 0x16338
movq (%r12), %rcx
leaq 0xc8ec(%rip), %rdi      # 0xe2b3
pushq $0xd
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1160
movq (%r12), %rdi
leaq 0xc8e1(%rip), %rsi      # 0xe2c1
movl %r13d, %edx
xorl %eax, %eax
callq 0x10f0
movq (%r12), %rcx
leaq 0xc8db(%rip), %rdi      # 0xe2d0
pushq $0x15
popq %rsi
movq %rbx, %rdx
callq 0x1160
movq (%r12), %rdi
leaq 0xc8db(%rip), %rsi      # 0xe2e6
movl %r13d, %edx
xorl %eax, %eax
callq 0x10f0
leaq 0xcd3e(%rip), %rsi      # 0xe75a
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x1657
leaq 0xc853(%rip), %rsi      # 0xe282
movq %r14, %rdi
callq 0x1657
movq (%r12), %rcx
leaq 0xc8b1(%rip), %rdi      # 0xe2f3
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
movq (%r12), %rdi
leaq 0xc869(%rip), %rsi      # 0xe2c1
movl %r15d, %edx
xorl %eax, %eax
callq 0x10f0
movq (%r12), %rcx
leaq 0xc863(%rip), %rdi      # 0xe2d0
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
movq (%r12), %rdi
leaq 0xc863(%rip), %rsi      # 0xe2e6
movl %r15d, %edx
xorl %eax, %eax
callq 0x10f0
leaq 0xc87b(%rip), %rsi      # 0xe30f
movq %r14, %rdi
callq 0x16c0
movq (%r12), %r14
movl 0x1c(%rbx), %edi
callq 0x156f
leaq 0xc852(%rip), %rsi      # 0xe301
leaq 0x148aa(%rip), %rdx     # 0x16360
movq %r14, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: exprAssign
void exprAssign (astNode *node, moduleST *lst, int singleAssign)
{
	if (!singleAssign)
		codePrint ("\t\tPOP AX\n") ;

	if(node->child == NULL)
	{
		varST *searchedVar = searchVar (lst, node->tok->lexeme) ;
		if (node->next->id == TK_MINUS && node->next->child->next == NULL)
			codePrint ("\t\tNEG AX\n") ;

		codePrint ("\t\tMOV [RBP%s], AX", getOffsetStr (searchedVar->offset)) ;
	}
	else
	{
		varST* vst ;
		vst = searchVar (lst,node->tok->lexeme);

		if (isVarStaticArr(vst) && node->child->id == TK_NUM)
		{
			if (node->next->id == TK_MINUS && node->next->child->next == NULL)
				codePrint ("\t\tNEG AX\n") ;

			codePrint ("\t\tMOV [RBP%s], AX" , getOffsetStr(getStaticOffset(vst,node,2))) ;
		}
		else
		{
			if (node->next->id == TK_MINUS && node->next->child->next == NULL)
				codePrint ("\t\tNEG AX\n") ;

			arrBoundCheck (node, lst, vst) ;
			codePrint ("\t\tMOV [RDI + RBX], AX") ;
		}
	}
	codeComment (10, "store variable") ;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
testl %edx, %edx
jne 0x1aff
leaq 0x1484e(%rip), %rax     # 0x16338
movq (%rax), %rcx
leaq 0xc81f(%rip), %rdi      # 0xe313
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
movq 0x30(%r14), %r12
movq 0x8(%r14), %rax
movq 0x8(%rax), %rsi
movq %r15, %rdi
callq 0xac19
movq %rax, %rbx
testq %r12, %r12
je 0x1bf5
movq %rbx, %rdi
callq 0xcd66
testl %eax, %eax
je 0x1b99
movq 0x30(%r14), %rax
cmpl $0x71, (%rax)
jne 0x1b99
movq 0x38(%r14), %rax
cmpl $0x58, (%rax)
jne 0x1b64
movq 0x30(%rax), %rax
cmpq $0x0, 0x38(%rax)
jne 0x1b64
leaq 0x147e9(%rip), %rax     # 0x16338
movq (%rax), %rcx
leaq 0xc7c4(%rip), %rdi      # 0xe31d
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
leaq 0x147cd(%rip), %rax     # 0x16338
movq (%rax), %r15
pushq $0x2
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1757
movl %eax, %edi
callq 0x156f
leaq 0xc79d(%rip), %rsi      # 0xe327
leaq 0x147cf(%rip), %rdx     # 0x16360
movq %r15, %rdi
jmp 0x1c48
movq 0x38(%r14), %rax
cmpl $0x58, (%rax)
jne 0x1bc9
movq 0x30(%rax), %rax
cmpq $0x0, 0x38(%rax)
jne 0x1bc9
leaq 0x14784(%rip), %rax     # 0x16338
movq (%rax), %rcx
leaq 0xc75f(%rip), %rdi      # 0xe31d
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x17a2
leaq 0x1475a(%rip), %rax     # 0x16338
movq (%rax), %rcx
leaq 0xc751(%rip), %rdi      # 0xe339
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
jmp 0x1c4f
movq 0x38(%r14), %rax
cmpl $0x58, (%rax)
jne 0x1c25
movq 0x30(%rax), %rax
cmpq $0x0, 0x38(%rax)
jne 0x1c25
leaq 0x14728(%rip), %rax     # 0x16338
movq (%rax), %rcx
leaq 0xc703(%rip), %rdi      # 0xe31d
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x1160
leaq 0x1470c(%rip), %rax     # 0x16338
movq (%rax), %r14
movl 0x1c(%rbx), %edi
callq 0x156f
leaq 0xc6e9(%rip), %rsi      # 0xe327
leaq 0x1471b(%rip), %rdx     # 0x16360
movq %r14, %rdi
xorl %eax, %eax
callq 0x10f0
leaq 0xc6f9(%rip), %rsi      # 0xe34f
pushq $0xa
popq %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x151a
// File: /workspace/github_c_makefile_star2_O2/anuwu[P]ERPLAG-Compiler/codegen.c
// Function: RSPAlign
void RSPAlign ()
{
	codePrint ("\t\tMOV RAX, RSP") ;
	codeComment (9, "Stack Alignment") ;
	codePrint ("\t\tAND RAX, 15\n") ;
	codePrint ("\t\tADD RAX, 8\n") ;
	codePrint ("\t\tSUB RSP, RAX\n") ;
	codePrint ("\t\tPUSH RAX\n") ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x13fb5(%rip), %r15     # 0x16338
movq (%r15), %rcx
leaq 0xc1c0(%rip), %rdi      # 0xe54d
pushq $0xe
popq %r14
pushq $0x1
popq %rbx
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1160
leaq 0xc214(%rip), %rsi      # 0xe5ba
pushq $0x9
popq %rdi
callq 0x151a
movq (%r15), %rcx
leaq 0xc1a4(%rip), %rdi      # 0xe55c
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1160
movq (%r15), %rcx
leaq 0xc19e(%rip), %rdi      # 0xe56b
pushq $0xd
popq %rsi
movq %rbx, %rdx
callq 0x1160
movq (%r15), %rcx
leaq 0xc197(%rip), %rdi      # 0xe579
pushq $0xf
popq %rsi
movq %rbx, %rdx
callq 0x1160
movq (%r15), %rcx
leaq 0xc192(%rip), %rdi      # 0xe589
pushq $0xb
popq %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1160