LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_init
int rtk_init(int fd, int proto, int speed, struct termios *ti)
{
	struct sigaction sa;
	int retlen;
	RS_DBG("Realtek hciattach version %s \n", RTK_VERSION);

	memset(&rtk_hw_cfg, 0, sizeof(rtk_hw_cfg));
	rtk_hw_cfg.serial_fd = fd;
	rtk_hw_cfg.dl_fw_flag = 1;

	/* h4 will do nothing for init */
	if (proto == HCI_UART_3WIRE) {
		if (rtk_init_h5(fd, ti) < 0)
			return -1;;
	}

	return rtk_config(fd, proto, speed, ti);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %r14d
movl %esi, %r12d
movl %edi, %r15d
cmpb $0x0, 0x7f77(%rip)      # 0xf2e0
jne 0x73cb
leaq 0x836e(%rip), %rdi      # 0xf6e0
movl $0xa0, %edx
xorl %esi, %esi
callq 0x20d0
movl %r15d, 0x839b(%rip)     # 0xf720
movb $0x1, 0x8390(%rip)      # 0xf71c
cmpl $0x2, %r12d
jne 0x73a7
movl %r15d, %edi
movq %rbx, %rsi
callq 0x6755
movl $0x2, %r12d
testl %eax, %eax
js 0x73bd
movl %r15d, %edi
movl %r12d, %esi
movl %r14d, %edx
movq %rbx, %rcx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x73d2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x369d
jmp 0x736b
// File: /workspace/github_c_makefile_star2_O3/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_slip_msgdelim
static RT_U8 *skb_put(struct sk_buff *skb, RT_U32 len)
{
	RT_U32 old_len = skb->data_len;
	if ((skb->data_len + len) > (skb->max_len)) {
		RS_ERR("Buffer too small");
		return NULL;
	}
	skb->data_len += len;
	return (skb->data + old_len);
}

// Assembly:
movl 0x4(%rdi), %eax
leal 0x1(%rax), %ecx
cmpl (%rdi), %ecx
ja 0x81ad
movl %ecx, 0x4(%rdi)
movb $-0x40, 0x8(%rdi,%rax)
retq
pushq %rbp
movq %rsp, %rbp
callq 0x3b88
// File: /workspace/github_c_makefile_star2_O3/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: h5_slip_one_byte
static void h5_slip_one_byte(struct sk_buff *skb, RT_U8 c)
{
	const RT_S8 esc_c0[2] = { 0xdb, 0xdc };
	const RT_S8 esc_db[2] = { 0xdb, 0xdd };
	const RT_S8 esc_11[2] = { 0xdb, 0xde };
	const RT_S8 esc_13[2] = { 0xdb, 0xdf };

	switch (c) {
	case 0xc0:
		memcpy(skb_put(skb, 2), &esc_c0, 2);
		break;

	case 0xdb:
		memcpy(skb_put(skb, 2), &esc_db, 2);
		break;

	case 0x11:
		memcpy(skb_put(skb, 2), &esc_11, 2);
		break;

	case 0x13:
		memcpy(skb_put(skb, 2), &esc_13, 2);
		break;

	default:
		memcpy(skb_put(skb, 1), &c, 1);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %ecx
movl 0x4(%rdi), %eax
cmpl $0xbf, %esi
jg 0x81e4
cmpl $0x11, %esi
je 0x821a
cmpl $0x13, %esi
jne 0x8209
leal 0x2(%rax), %edx
cmpl %ecx, %edx
ja 0x8247
movl %edx, 0x4(%rdi)
movw $0xdfdb, 0x8(%rdi,%rax) # imm = 0xDFDB
jmp 0x8240
cmpl $0xdb, %esi
je 0x822d
cmpl $0xc0, %esi
jne 0x8209
movl %eax, %edx
addl $0x2, %edx
cmpl %ecx, %edx
ja 0x824c
movl %edx, 0x4(%rdi)
movw $0xdcdb, 0x8(%rdi,%rax) # imm = 0xDCDB
jmp 0x8240
leal 0x1(%rax), %edx
cmpl %ecx, %edx
ja 0x8242
movl %edx, 0x4(%rdi)
movb %sil, 0x8(%rdi,%rax)
jmp 0x8240
leal 0x2(%rax), %edx
cmpl %ecx, %edx
ja 0x8251
movl %edx, 0x4(%rdi)
movw $0xdedb, 0x8(%rdi,%rax) # imm = 0xDEDB
jmp 0x8240
movl %eax, %edx
addl $0x2, %edx
cmpl %ecx, %edx
ja 0x8256
movl %edx, 0x4(%rdi)
movw $0xdddb, 0x8(%rdi,%rax) # imm = 0xDDDB
popq %rbp
retq
callq 0x3c37
callq 0x3bab
callq 0x3c14
callq 0x3bce
callq 0x3bf1
// File: /workspace/github_c_makefile_star2_O3/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_local_ver_sig_alarm
static void rtk_local_ver_sig_alarm(int sig)
{
	uint8_t cmd[4] = { 0x01, 0x01, 0x10, 0x00 };
	static int retries;

	if (retries < rtk_max_retries) {
		retries++;
		if (write(rtk_hw_cfg.serial_fd, cmd, sizeof(cmd)) < 0)
			return;
		alarm(1);
		return;
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("init timed out, read local ver fails");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x7f40(%rip), %eax      # 0x107a8
cmpl $0x4, %eax
jg 0x889e
incl %eax
movl %eax, 0x7f33(%rip)      # 0x107a8
movl 0x6ea5(%rip), %edi      # 0xf720
leaq 0x255a(%rip), %rsi      # 0xaddc
movl $0x4, %edx
callq 0x2070
testq %rax, %rax
js 0x889c
movl $0x1, %edi
popq %rbp
jmp 0x20f0
popq %rbp
retq
callq 0x3f1f
// File: /workspace/github_c_makefile_star2_O3/seuscq[P]rtk_hciattach/hciattach_rtk.c
// Function: rtk_rom_ver_sig_alarm
static void rtk_rom_ver_sig_alarm(int sig)
{
	uint8_t cmd[4] = { 0x01, 0x6d, 0xfc, 0x00 };
	static int retries;

	if (retries < rtk_max_retries) {
		retries++;
		if (write(rtk_hw_cfg.serial_fd, cmd, sizeof(cmd)) < 0)
			return;
		alarm(1);
		return;
	}

	tcflush(rtk_hw_cfg.serial_fd, TCIOFLUSH);
	RS_ERR("init timed out, read rom ver fails");
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x7eff(%rip), %eax      # 0x107ac
cmpl $0x4, %eax
jg 0x88e3
incl %eax
movl %eax, 0x7ef2(%rip)      # 0x107ac
movl 0x6e60(%rip), %edi      # 0xf720
leaq 0x2559(%rip), %rsi      # 0xae20
movl $0x4, %edx
callq 0x2070
testq %rax, %rax
js 0x88e1
movl $0x1, %edi
popq %rbp
jmp 0x20f0
popq %rbp
retq
callq 0x3f58
// File: /workspace/github_c_makefile_star2_O3/xtanitfy[P]Murphy/test/test_conv.c
// Function: conv_slow
int conv_slow(void)
{
	int tmp = 0;
	for (int i = 0;i < 3;i++) {
		for (int j = 0;j < 3;j++) {
			tmp = 0;
			for (int m = i;m < (i + 2);m++) {
				for (int n = j;n < (j + 2);n++) {
					tmp +=  arr[m][n] * k [1-m+i][1-n+j];
				}
			}
			dst[i][j] = tmp;
		}
	}
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
leaq 0x2e2b(%rip), %rax      # 0x4040
xorl %ecx, %ecx
leaq 0x2e62(%rip), %rdx      # 0x4080
leaq 0x2e7b(%rip), %rsi      # 0x40a0
leaq (%rcx,%rcx,2), %rdi
incq %rcx
leaq (%rsi,%rdi,4), %rdi
movq %rax, %r8
xorl %r9d, %r9d
leaq 0x1(%r9), %r10
xorl %ebp, %ebp
movl $0x1, %r11d
movq %r8, %rbx
movd %ebp, %xmm0
movq (%rdx,%r11,8), %xmm1
pshufd $0xe1, %xmm1, %xmm2     # xmm2 = xmm1[1,0,2,3]
movq (%rbx), %xmm3
pshufd $0xf5, %xmm3, %xmm4     # xmm4 = xmm3[1,1,3,3]
pmuludq %xmm1, %xmm4
pshufd $0xe8, %xmm4, %xmm1     # xmm1 = xmm4[0,2,2,3]
pmuludq %xmm3, %xmm2
pshufd $0xe8, %xmm2, %xmm2     # xmm2 = xmm2[0,2,2,3]
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
paddd %xmm0, %xmm2
pshufd $0x55, %xmm2, %xmm0     # xmm0 = xmm2[1,1,1,1]
paddd %xmm2, %xmm0
movd %xmm0, %ebp
addq $0x10, %rbx
addq $-0x1, %r11
jb 0x1245
movl %ebp, (%rdi,%r9,4)
addq $0x4, %r8
movq %r10, %r9
cmpq $0x3, %r10
jne 0x1236
addq $0x10, %rax
cmpq $0x3, %rcx
jne 0x1225
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xtanitfy[P]Murphy/test/test_conv.c
// Function: main
int main(void)
{
	printf("Before conv:\n");
	print_src();
	conv_slow();
	printf("After conv:\n");
	print_dst();
	
	return 0;
}

// Assembly:
pushq %rax
leaq 0xd30(%rip), %rdi       # 0x2008
callq 0x1050
callq 0x115c
callq 0x120c
leaq 0xd27(%rip), %rdi       # 0x2015
callq 0x1050
callq 0x11b4
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_int_atomic_inc.c
// Function: shmem_int_atomic_inc
void shmem_int_atomic_inc( int* ptr, int pe)
{ 
	int* remote_ptr = (int*)shmem_ptr((void*)ptr, pe );
	long* x = (long*)shmem_ptr((void*)&__shmem.lock_atomic_int, pe);
	__set_spin_lock(x);
	*remote_ptr += 1;
	__clear_spin_lock(x);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
callq 0x1c3c
movq %rax, %r14
leaq 0x31b7(%rip), %rdi      # 0x61f0
addq $0x10, %rdi
movl %ebx, %esi
callq 0x1c3c
movq %rax, %rbx
movq %rax, %rdi
callq 0x3303
incl (%r14)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32f4
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/canvas.c
// Function: createCanvas
canvas *createCanvas(int width, int height, int bgcolor) {
    canvas *canvas = malloc(sizeof(*canvas));
    canvas->width = width;
    canvas->height = height;
    canvas->pixels = malloc(width*height);
    memset(canvas->pixels,bgcolor,width*height);
    return canvas;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
movl $0x10, %edi
callq 0x2480
movq %rax, %r15
movl %r14d, (%rax)
movl %ebp, 0x4(%rax)
imull %r14d, %ebp
movslq %ebp, %r14
movq %r14, %rdi
callq 0x2480
movq %rax, 0x8(%r15)
movq %rax, %rdi
movl %ebx, %esi
movq %r14, %rdx
callq 0x2140
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/canvas.c
// Function: drawLine
void drawLine(canvas *canvas, int x1, int y1, int x2, int y2, int color) {
    int dx = abs(x2-x1);
    int dy = abs(y2-y1);
    int sx = (x1 < x2) ? 1 : -1;
    int sy = (y1 < y2) ? 1 : -1;
    int err = dx-dy, e2;

    while(1) {
        drawPixel(canvas,x1,y1,color);
        if (x1 == x2 && y1 == y2) break;
        e2 = err*2;
        if (e2 > -dy) {
            err -= dy;
            x1 += sx;
        }
        if (e2 < dx) {
            err += dx;
            y1 += sy;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %ebx, %ebx
movl %r8d, %r11d
subl %edx, %r11d
setg %bl
xorl %r14d, %r14d
movl %ecx, %r10d
subl %esi, %r10d
setg %r14b
movl %r10d, %eax
negl %eax
cmovsl %r10d, %eax
movl %r11d, %r10d
negl %r10d
cmovsl %r11d, %r10d
leal -0x1(,%r14,2), %r11d
leal -0x1(,%rbx,2), %ebx
movl %eax, %r14d
subl %r10d, %r14d
movl %r10d, %ebp
negl %ebp
testl %esi, %esi
js 0x2732
testl %edx, %edx
js 0x2732
movl (%rdi), %r15d
cmpl %esi, %r15d
jle 0x2732
cmpl %edx, 0x4(%rdi)
jle 0x2732
movq 0x8(%rdi), %r12
imull %edx, %r15d
movl %esi, %r13d
addq %r15, %r13
movb %r9b, (%r12,%r13)
cmpl %r8d, %edx
jne 0x273b
cmpl %ecx, %esi
je 0x277e
leal (%r14,%r14), %r15d
cmpl %ebp, %r15d
movl $0x0, %r12d
cmovgl %r10d, %r12d
movl $0x0, %r13d
cmovgl %r11d, %r13d
subl %r12d, %r14d
addl %r13d, %esi
cmpl %eax, %r15d
movl $0x0, %r15d
cmovll %ebx, %r15d
movl $0x0, %r12d
cmovll %eax, %r12d
addl %r15d, %edx
addl %r14d, %r12d
movl %r12d, %r14d
jmp 0x270b
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: cJSON_SetValuestring
CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring)
{
    char *copy = NULL;
    /* if object's type is not cJSON_String or is cJSON_IsReference, it should not set valuestring */
    if (!(object->type & cJSON_String) || (object->type & cJSON_IsReference))
    {
        return NULL;
    }
    if (strlen(valuestring) <= strlen(object->valuestring))
    {
        strcpy(object->valuestring, valuestring);
        return object->valuestring;
    }
    copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks);
    if (copy == NULL)
    {
        return NULL;
    }
    if (object->valuestring != NULL)
    {
        cJSON_free(object->valuestring);
    }
    object->valuestring = copy;

    return copy;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0x110, %eax            # imm = 0x110
andl 0x18(%rdi), %eax
cmpl $0x10, %eax
jne 0x2bc7
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2100
movq %rax, %r12
movq 0x20(%rbx), %r15
movq %r15, %rdi
callq 0x2100
cmpq %rax, %r12
jbe 0x2bcc
testq %r14, %r14
je 0x2bc7
movq %r14, %rdi
callq 0x2100
movq %rax, %r12
incq %r12
movq %r12, %rdi
callq *0x126ac(%rip)          # 0x15248
testq %rax, %rax
je 0x2bc7
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x21e0
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2bc1
callq *0x1268f(%rip)          # 0x15250
movq %r15, 0x20(%rbx)
jmp 0x2bdb
xorl %r15d, %r15d
jmp 0x2bdb
movq %r15, %rdi
movq %r14, %rsi
callq 0x2220
movq 0x20(%rbx), %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: cJSON_PrintPreallocated
CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format)
{
    printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } };

    if ((length < 0) || (buffer == NULL))
    {
        return false;
    }

    p.buffer = (unsigned char*)buffer;
    p.length = (size_t)length;
    p.offset = 0;
    p.noalloc = true;
    p.format = format;
    p.hooks = global_hooks;

    return print_value(item, &p);
}

// Assembly:
subq $0x48, %rsp
movq $0x0, 0x20(%rsp)
testl %edx, %edx
sets %r8b
testq %rsi, %rsi
sete %r9b
xorl %eax, %eax
orb %r8b, %r9b
jne 0x3897
leaq 0x8(%rsp), %rax
movq %rsi, (%rax)
movl %edx, %edx
movq %rdx, 0x8(%rax)
movq $0x0, 0x10(%rax)
movl $0x1, 0x20(%rax)
movl %ecx, 0x24(%rax)
movups 0x119c8(%rip), %xmm0    # 0x15248
movups %xmm0, 0x28(%rax)
movq 0x119cd(%rip), %rcx     # 0x15258
movq %rcx, 0x38(%rax)
movq %rax, %rsi
callq 0x331c
addq $0x48, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: cJSON_CreateBool
CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool boolean)
{
    cJSON *item = cJSON_New_Item(&global_hooks);
    if(item)
    {
        item->type = boolean ? cJSON_True : cJSON_False;
    }

    return item;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x40, %edi
callq *0x11402(%rip)          # 0x15248
testq %rax, %rax
je 0x3e6b
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, (%rax)
cmpl $0x1, %ebx
movl $0x2, %ecx
sbbl $0x0, %ecx
movl %ecx, 0x18(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: cJSON_InsertItemInArray
CJSON_PUBLIC(cJSON_bool) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem)
{
    cJSON *after_inserted = NULL;

    if (which < 0)
    {
        return false;
    }

    after_inserted = get_array_item(array, (size_t)which);
    if (after_inserted == NULL)
    {
        return add_item_to_array(array, newitem);
    }

    newitem->next = after_inserted;
    newitem->prev = after_inserted->prev;
    after_inserted->prev = newitem;
    if (after_inserted == array->child)
    {
        array->child = newitem;
    }
    else
    {
        newitem->prev->next = newitem;
    }
    return true;
}

// Assembly:
testl %esi, %esi
js 0x4386
testq %rdi, %rdi
je 0x437e
movl %esi, %esi
leaq 0x10(%rdi), %rax
movq %rax, %rcx
movq (%rcx), %rcx
addq $-0x1, %rsi
setb %r8b
testq %rcx, %rcx
je 0x4358
testb %r8b, %r8b
jne 0x4343
testq %rcx, %rcx
je 0x437e
movq %rcx, (%rdx)
movq 0x8(%rcx), %rsi
movq %rsi, 0x8(%rdx)
movq %rdx, 0x8(%rcx)
cmpq (%rax), %rcx
je 0x4375
movq 0x8(%rdx), %rax
movq %rdx, (%rax)
movl $0x1, %eax
retq
movq %rdx, %rsi
jmp 0x39d8
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: replace_item_in_object
static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive)
{
    if ((replacement == NULL) || (string == NULL))
    {
        return false;
    }

    /* replace the name in the replacement */
    if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL))
    {
        cJSON_free(replacement->string);
    }
    replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks);
    replacement->type &= ~cJSON_StringIsConst;

    return cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
testq %rdx, %rdx
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x446c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
testb $0x2, 0x19(%rdx)
jne 0x448a
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x448a
callq *0x10dc6(%rip)          # 0x15250
movq %r15, %rdi
callq 0x2100
movq %rax, %r12
incq %r12
movq %r12, %rdi
callq *0x10da7(%rip)          # 0x15248
movq %rax, %r13
testq %rax, %rax
je 0x44b7
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21e0
movq %r13, 0x38(%rbx)
andb $-0x3, 0x19(%rbx)
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x38eb
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4389
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: cJSON_CreateIntArray
CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count)
{
    size_t i = 0;
    cJSON *n = NULL;
    cJSON *p = NULL;
    cJSON *a = NULL;

    if ((count < 0) || (numbers == NULL))
    {
        return NULL;
    }

    a = cJSON_CreateArray();

    for(i = 0; a && (i < (size_t)count); i++)
    {
        n = cJSON_CreateNumber(numbers[i]);
        if (!n)
        {
            cJSON_Delete(a);
            return NULL;
        }
        if(!i)
        {
            a->child = n;
        }
        else
        {
            suffix_object(p, n);
        }
        p = n;
    }

    if (a && a->child) {
        a->child->prev = n;
    }

    return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
sets %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x4665
movl %esi, %ebp
movq %rdi, %r14
movl $0x40, %edi
callq *0x10c8f(%rip)          # 0x15248
testq %rax, %rax
je 0x4665
movq %rax, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rax)
movupd %xmm0, 0x30(%rax)
movupd %xmm0, 0x20(%rax)
movupd %xmm0, (%rax)
movl $0x20, 0x18(%rax)
testl %ebp, %ebp
je 0x464c
movl %ebp, %r15d
xorl %r13d, %r13d
xorl %r12d, %r12d
movl (%r14,%r12,4), %ebp
movl $0x40, %edi
callq *0x10c49(%rip)          # 0x15248
testq %rax, %rax
je 0x465d
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rax)
movups %xmm1, 0x30(%rax)
movups %xmm1, 0x20(%rax)
movups %xmm1, (%rax)
movl $0x8, 0x18(%rax)
movsd %xmm0, 0x30(%rax)
movl %ebp, 0x28(%rax)
testq %r12, %r12
je 0x463b
movq %rax, (%r13)
movq %r13, 0x8(%rax)
jmp 0x463f
movq %rax, 0x10(%rbx)
incq %r12
movq %rax, %r13
cmpq %r15, %r12
jb 0x45f0
jmp 0x464e
xorl %eax, %eax
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x4667
movq %rax, 0x8(%rcx)
jmp 0x4667
movq %rbx, %rdi
callq 0x2aa8
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/cJSON.c
// Function: cJSON_CreateStringArray
CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char *const *strings, int count)
{
    size_t i = 0;
    cJSON *n = NULL;
    cJSON *p = NULL;
    cJSON *a = NULL;

    if ((count < 0) || (strings == NULL))
    {
        return NULL;
    }

    a = cJSON_CreateArray();

    for (i = 0; a && (i < (size_t)count); i++)
    {
        n = cJSON_CreateString(strings[i]);
        if(!n)
        {
            cJSON_Delete(a);
            return NULL;
        }
        if(!i)
        {
            a->child = n;
        }
        else
        {
            suffix_object(p,n);
        }
        p = n;
    }

    if (a && a->child) {
        a->child->prev = n;
    }
    
    return a;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %esi, %esi
sets %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
jne 0x496e
movl %esi, %ebp
movq %rdi, %r14
movl $0x40, %edi
callq *0x1094f(%rip)          # 0x15248
testq %rax, %rax
je 0x496e
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, (%rax)
movl $0x20, 0x18(%rax)
testl %ebp, %ebp
je 0x4955
movl %ebp, %r15d
xorl %r13d, %r13d
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdi
callq 0x3fb8
testq %rax, %rax
je 0x4966
testq %r12, %r12
je 0x4944
movq %rax, (%r13)
movq %r13, 0x8(%rax)
jmp 0x4948
movq %rax, 0x10(%rbx)
incq %r12
movq %rax, %r13
cmpq %r15, %r12
jb 0x4927
jmp 0x4957
xorl %eax, %eax
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x4970
movq %rax, 0x8(%rcx)
jmp 0x4970
movq %rbx, %rdi
callq 0x2aa8
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: xmalloc
void *xmalloc(size_t size) {
    void *p = malloc(size);
    if (p == NULL) {
        printf("Out of memory: malloc(%zu)", size);
        exit(1);
    }
    return p;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x2480
testq %rax, %rax
je 0x7730
popq %rbx
retq
leaq 0x7155(%rip), %rdi      # 0xe88c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2030
movl $0x1, %edi
callq 0x2300
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: xrealloc
void *xrealloc(void *ptr, size_t size) {
    void *p = realloc(ptr,size);
    if (p == NULL) {
        printf("Out of memory: realloc(%zu)", size);
        exit(1);
    }
    return p;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
callq 0x2488
testq %rax, %rax
je 0x775b
popq %rbx
retq
leaq 0x7145(%rip), %rdi      # 0xe8a7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2030
movl $0x1, %edi
callq 0x2300
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: priceChangeToEmoji
const char *priceChangeToEmoji(double change) {
    int emoidx = 0;
    static const char *emoset[] = {"⚰️","🔴","🟢","🚀"};
    /* Note: ordering of the followign if statements is important. */
    if (change < 0) emoidx = 1;
    if (change < -8) emoidx = 0;
    if (change >= 0) emoidx = 2;
    if (change > 8) emoidx = 3;
    return emoset[emoidx];
}

// Assembly:
xorpd %xmm1, %xmm1
movapd %xmm0, %xmm2
cmpltpd %xmm1, %xmm2
movsd 0x6c6d(%rip), %xmm3     # 0xe6a0
movapd %xmm0, %xmm4
cmpnltpd %xmm3, %xmm4
andpd %xmm2, %xmm4
movd %xmm4, %eax
andl $0x1, %eax
ucomisd %xmm1, %xmm0
movl $0x2, %ecx
cmovbl %eax, %ecx
ucomisd 0x6c4d(%rip), %xmm0     # 0xe6a8
movl $0x3, %eax
cmovbel %ecx, %eax
leaq 0xd316(%rip), %rcx      # 0x14d80
movq (%rcx,%rax,8), %rax
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: sqlEnd
void sqlEnd(sqlRow *row) {
    if (row->stmt == NULL) return;
    xfree(row->col);
    sqlite3_finalize(row->stmt);
    row->col = NULL;
    row->stmt = NULL;
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x80e2
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x2478
movq (%rbx), %rdi
callq 0x2420
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: sqlNextRow
int sqlNextRow(sqlRow *row) {
    if (row->stmt == NULL) return 0;

    if (row->col != NULL) {
        if (sqlite3_step(row->stmt) != SQLITE_ROW) {
            sqlEnd(row);
            return 0;
        }
    }

    xfree(row->col);
    row->cols = sqlite3_data_count(row->stmt);
    row->col = xmalloc(row->cols*sizeof(sqlCol));
    for (int j = 0; j < row->cols; j++) {
        row->col[j].type = sqlite3_column_type(row->stmt,j);
        if (row->col[j].type == SQLITE_INTEGER) {
            row->col[j].i = sqlite3_column_int64(row->stmt,j);
        } else if (row->col[j].type == SQLITE_FLOAT) {
            row->col[j].d = sqlite3_column_double(row->stmt,j);
        } else if (row->col[j].type == SQLITE_TEXT) {
            row->col[j].s = (char*)sqlite3_column_text(row->stmt,j);
            row->col[j].i = sqlite3_column_bytes(row->stmt,j);
        } else if (row->col[j].type == SQLITE_BLOB) {
            row->col[j].s = sqlite3_column_blob(row->stmt,j);
            row->col[j].i = sqlite3_column_bytes(row->stmt,j);
        } else {
            /* SQLITE_NULL. */
            row->col[j].s = NULL;
            row->col[j].i = 0;
            row->col[j].d = 0;
        }
    }
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
testq %rdi, %rdi
je 0x8204
cmpq $0x0, 0x10(%rbx)
je 0x8115
callq 0x2360
cmpl $0x64, %eax
jne 0x81fc
movq 0x10(%rbx), %rdi
jmp 0x8117
xorl %edi, %edi
callq 0x2478
movq (%rbx), %rdi
callq 0x21b0
movl %eax, 0x8(%rbx)
movslq %eax, %rdi
shlq $0x5, %rdi
callq 0x7720
movq %rax, 0x10(%rbx)
movl $0x1, %ebp
cmpl $0x0, 0x8(%rbx)
jle 0x8206
xorl %r15d, %r15d
leaq 0x6610(%rip), %r12      # 0xe760
xorl %r14d, %r14d
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x20e0
movq 0x10(%rbx), %rcx
movl %eax, (%rcx,%r15)
decl %eax
cmpl $0x3, %eax
ja 0x81d4
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x2090
jmp 0x81b1
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x21f0
jmp 0x819b
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x2040
movq 0x10(%rbx), %rcx
movq %rax, 0x10(%rcx,%r15)
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x22f0
cltq
movq 0x10(%rbx), %rcx
movq %rax, 0x8(%rcx,%r15)
jmp 0x81e6
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x21d0
movq 0x10(%rbx), %rax
movsd %xmm0, 0x18(%rax,%r15)
jmp 0x81e6
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rcx,%r15)
movq $0x0, 0x18(%rcx,%r15)
incq %r14
movslq 0x8(%rbx), %rax
addq $0x20, %r15
cmpq %rax, %r14
jl 0x8153
jmp 0x8206
movq %rbx, %rdi
callq 0x80bd
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: sqlSelectOneRow
int sqlSelectOneRow(sqlRow *row, const char *sql, ...) {
    va_list ap;
    va_start(ap,sql);
    int rc = sqlGenericQuery(row,sql,ap);
    if (rc == SQLITE_ROW) sqlNextRow(row);
    va_end(ap);
    return rc;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x8437
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rdx)
movq %rbx, %rdi
callq 0x7da2
movl %eax, %ebp
cmpl $0x64, %eax
jne 0x846e
movq %rbx, %rdi
callq 0x80e3
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: sqlSelectInt
int64_t sqlSelectInt(const char *sql, ...) {
    sqlRow row;
    int64_t i = 0;
    va_list ap;
    va_start(ap,sql);
    int rc = sqlGenericQuery(&row,sql,ap);
    if (rc == SQLITE_ROW) {
        sqlNextRow(&row);
        i = row.col[0].i;
        sqlEnd(&row);
    }
    va_end(ap);
    return i;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %r10
leaq 0x40(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x84e1
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
leaq 0x20(%rsp), %rdx
movq %rdi, 0x10(%rdx)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
leaq 0x8(%rsp), %rdi
movq %r10, %rsi
callq 0x7da2
cmpl $0x64, %eax
jne 0x854d
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x80e3
movq 0x10(%r14), %rdi
movq 0x8(%rdi), %rbx
cmpq $0x0, (%r14)
je 0x854f
callq 0x2478
movq 0x8(%rsp), %rdi
callq 0x2420
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movq %rax, 0x8(%rsp)
jmp 0x854f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0xf8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: makeHttpCall
sds makeHttpCall(const char *url, int *resptr) {
    if (DebugMode) printf("HTTP GET %s\n", url);
    CURL* curl;
    CURLcode res;
    sds body = sdsempty();

    curl = curl_easy_init();
    if (curl) {
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, makeHttpCallWriter);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 1L);
        curl_easy_setopt(curl, CURLOPT_TIMEOUT, 15);
        curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 15);

        /* Perform the request, res will get the return code */
        res = curl_easy_perform(curl);
        if (resptr) *resptr = res == CURLE_OK ? C_OK : C_ERR;

        /* Check for errors */
        if (res != CURLE_OK) {
            const char *errstr = curl_easy_strerror(res);
            body = sdscat(body,errstr);
        } else {
            /* Return C_ERR if the request worked but returned a 500 code. */
            long code;
            curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code);
            if (code == 500 && resptr) *resptr = C_ERR;
        }

        /* always cleanup */
        curl_easy_cleanup(curl);
    }
    return body;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r15
cmpl $0x0, 0xcd18(%rip)      # 0x152b0
je 0x85ab
leaq 0x6356(%rip), %rdi      # 0xe8f7
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
callq 0x56c6
movq %rax, %r12
movq %rax, 0x8(%rsp)
callq 0x2330
testq %rax, %rax
je 0x86c1
movq %rax, %r14
movq %rax, %rdi
movl $0x2712, %esi           # imm = 0x2712
movq %r15, %rdx
xorl %eax, %eax
callq 0x22d0
leaq -0x85(%rip), %rdx       # 0x855d
movq %r14, %rdi
movl $0x4e2b, %esi           # imm = 0x4E2B
xorl %eax, %eax
callq 0x22d0
leaq 0x8(%rsp), %rdx
movq %r14, %rdi
movl $0x2711, %esi           # imm = 0x2711
xorl %eax, %eax
callq 0x22d0
movl $0x1, %edx
movq %r14, %rdi
movl $0x40, %esi
xorl %eax, %eax
callq 0x22d0
movl $0x1, %edx
movq %r14, %rdi
movl $0x51, %esi
xorl %eax, %eax
callq 0x22d0
movq %r14, %rdi
movl $0xd, %esi
movl $0xf, %edx
xorl %eax, %eax
callq 0x22d0
movq %r14, %rdi
movl $0x4e, %esi
movl $0xf, %edx
xorl %eax, %eax
callq 0x22d0
movq %r14, %rdi
callq 0x2340
testq %rbx, %rbx
je 0x866b
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
movl %ecx, (%rbx)
testl %eax, %eax
je 0x868a
movl %eax, %edi
callq 0x23a0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x5ff1
movq %rax, 0x8(%rsp)
jmp 0x86b4
leaq 0x10(%rsp), %rdx
movq %r14, %rdi
movl $0x200002, %esi         # imm = 0x200002
xorl %eax, %eax
callq 0x2160
testq %rbx, %rbx
je 0x86b4
cmpq $0x1f4, 0x10(%rsp)      # imm = 0x1F4
jne 0x86b4
movl $0x0, (%rbx)
movq %r14, %rdi
callq 0x2320
movq 0x8(%rsp), %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: makeHttpCallOpt
sds makeHttpCallOpt(const char *url, int *resptr, char **optlist, int optnum) {
    sds fullurl = sdsnew(url);
    if (optnum) fullurl = sdscatlen(fullurl,"?",1);
    CURL *curl = curl_easy_init();
    for (int j = 0; j < optnum; j++) {
        if (j > 0) fullurl = sdscatlen(fullurl,"&",1);
        fullurl = sdscat(fullurl,optlist[j*2]);
        fullurl = sdscatlen(fullurl,"=",1);
        char *escaped = curl_easy_escape(curl,
            optlist[j*2+1],strlen(optlist[j*2+1]));
        fullurl = sdscat(fullurl,escaped);
        curl_free(escaped);
    }
    curl_easy_cleanup(curl);
    sds body = makeHttpCall(fullurl,resptr);
    sdsfree(fullurl);
    return body;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
callq 0x56e9
movq %rax, %r12
testl %ebp, %ebp
je 0x87a8
leaq 0x6933(%rip), %rsi      # 0xf02d
movl $0x1, %edx
movq %r12, %rdi
callq 0x5f26
movq %rax, %r12
callq 0x2330
movq %rax, %r15
testl %ebp, %ebp
jle 0x87b0
movq %rbx, (%rsp)
movl %ebp, %ebp
shlq $0x4, %rbp
xorl %r13d, %r13d
testq %r13, %r13
je 0x8743
movl $0x1, %edx
movq %r12, %rdi
leaq 0x61c9(%rip), %rsi      # 0xe904
callq 0x5f26
movq %rax, %r12
movq (%r14,%r13), %rsi
movq %r12, %rdi
callq 0x5ff1
movl $0x1, %edx
movq %rax, %rdi
leaq 0x61a8(%rip), %rsi      # 0xe906
callq 0x5f26
movq %rax, %r12
movq 0x8(%r14,%r13), %rbx
movq %rbx, %rdi
callq 0x2100
movq %r15, %rdi
movq %rbx, %rsi
movl %eax, %edx
callq 0x2430
movq %rax, %rbx
movq %r12, %rdi
movq %rax, %rsi
callq 0x5ff1
movq %rax, %r12
movq %rbx, %rdi
callq 0x20a0
addq $0x10, %r13
cmpq %r13, %rbp
jne 0x8727
movq (%rsp), %rbx
jmp 0x87b0
callq 0x2330
movq %rax, %r15
movq %r15, %rdi
callq 0x2320
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8580
movq %rax, %rbx
movq %r12, %rdi
callq 0x5775
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: makeBotRequest
sds makeBotRequest(const char *action, int *resptr, char **optlist, int numopt)
{
    sds url = sdsnew("https://api.telegram.org/bot");
    url = sdscat(url,BotApiKey);
    url = sdscatlen(url,"/",1);
    url = sdscat(url,action);
    sds body = makeHttpCallOpt(url,resptr,optlist,numopt);
    sdsfree(url);
    return body;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
leaq 0x610e(%rip), %rdi      # 0xe908
callq 0x56e9
movq 0xcaba(%rip), %rsi      # 0x152c0
movq %rax, %rdi
callq 0x5ff1
leaq 0x6142(%rip), %rsi      # 0xe957
movl $0x1, %edx
movq %rax, %rdi
callq 0x5f26
movq %rax, %rdi
movq %r12, %rsi
callq 0x5ff1
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x86d0
movq %rax, %rbx
movq %r12, %rdi
callq 0x5775
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: freeYahooData
void freeYahooData(ydata *y) {
    if (y == NULL) return;
    sdsfree(y->symbol);
    sdsfree(y->name);
    sdsfree(y->prechange);
    sdsfree(y->postchange);
    sdsfree(y->regchange);
    sdsfree(y->csym);
    sdsfree(y->exchange);
    sdsfree(y->summary);
    sdsfree(y->country);
    sdsfree(y->industry);
    sdsfree(y->exdivdate);
    free(y->ts_data);
    free(y);
}

// Assembly:
testq %rdi, %rdi
je 0x88eb
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x5775
movq 0x10(%rbx), %rdi
callq 0x5775
movq 0x48(%rbx), %rdi
callq 0x5775
movq 0x50(%rbx), %rdi
callq 0x5775
movq 0x58(%rbx), %rdi
callq 0x5775
movq 0x70(%rbx), %rdi
callq 0x5775
movq 0x60(%rbx), %rdi
callq 0x5775
movq 0xc8(%rbx), %rdi
callq 0x5775
movq 0xd0(%rbx), %rdi
callq 0x5775
movq 0xd8(%rbx), %rdi
callq 0x5775
movq 0xf0(%rbx), %rdi
callq 0x5775
movq 0x80(%rbx), %rdi
callq 0x2478
movq %rbx, %rdi
popq %rbx
jmp 0x2478
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: kvGet
sds kvGet(const char *key) {
    sds value = NULL;
    sqlRow row;
    sqlSelect(&row,"SELECT expire,value FROM KeyValue WHERE key=?s",key);
    if (sqlNextRow(&row)) {
        int64_t expire = row.col[0].i;
        if (!NoEvictMode && expire && expire < time(NULL)) {
            sqlQuery("DELETE FROM KeyValue WHERE key=?s",key);
        } else {
            value = sdsnewlen(row.col[1].s,row.col[1].i);
        }
    }
    sqlEnd(&row);
    return value;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
leaq 0x5e00(%rip), %rsi      # 0xeafe
xorl %ebx, %ebx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8357
movq %r15, %rdi
callq 0x80e3
testl %eax, %eax
je 0x8d6b
movq 0x18(%rsp), %rax
cmpl $0x0, 0xc5aa(%rip)      # 0x152d4
jne 0x8d5b
movq 0x8(%rax), %rbx
testq %rbx, %rbx
je 0x8d5b
xorl %edi, %edi
callq 0x2210
cmpq %rax, %rbx
jge 0x8d56
leaq 0x5de5(%rip), %rdi      # 0xeb2d
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0x82bd
jmp 0x8d6b
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rdi
callq 0x55a0
movq %rax, %rbx
cmpq $0x0, 0x8(%rsp)
je 0x8d87
movq 0x18(%rsp), %rdi
callq 0x2478
movq 0x8(%rsp), %rdi
callq 0x2420
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: botSendMessage
int botSendMessage(int64_t target, sds text, int64_t reply_to) {
    char *options[10];
    int optlen = 4;
    options[0] = "chat_id";
    options[1] = sdsfromlonglong(target);
    options[2] = "text";
    options[3] = text;
    options[4] = "parse_mode";
    options[5] = "Markdown";
    options[6] = "disable_web_page_preview";
    options[7] = "true";
    if (reply_to) {
        optlen++;
        options[8] = "reply_to_message_id";
        options[9] = sdsfromlonglong(reply_to);
    } else {
        options[9] = NULL; /* So we can sdsfree it later without problems. */
    }

    int res;
    sds body = makeBotRequest("sendMessage",&res,options,optlen);
    sdsfree(body);
    sdsfree(options[1]);
    sdsfree(options[9]);
    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdx, %r14
movq %rsi, %r15
leaq 0x5ae6(%rip), %rax      # 0xea4a
movq %rax, 0x10(%rsp)
callq 0x626f
movq %rax, %rbx
movq %rax, 0x18(%rsp)
leaq 0x5ad5(%rip), %rax      # 0xea52
movq %rax, 0x20(%rsp)
movq %r15, 0x28(%rsp)
leaq 0x5ac9(%rip), %rax      # 0xea57
movq %rax, 0x30(%rsp)
leaq 0x5ac8(%rip), %rax      # 0xea62
movq %rax, 0x38(%rsp)
leaq 0x5ac5(%rip), %rax      # 0xea6b
movq %rax, 0x40(%rsp)
leaq 0x50f8(%rip), %rax      # 0xe0aa
movq %rax, 0x48(%rsp)
testq %r14, %r14
je 0x8fda
leaq 0x5ac1(%rip), %rax      # 0xea84
movq %rax, 0x50(%rsp)
movq %r14, %rdi
callq 0x626f
movq %rax, %r14
movl $0x5, %ecx
jmp 0x8fe2
movl $0x4, %ecx
xorl %r14d, %r14d
leaq 0x10(%rsp), %rdx
movq %r14, 0x48(%rdx)
leaq 0x5aa6(%rip), %rdi      # 0xea98
leaq 0xc(%rsp), %r15
movq %r15, %rsi
callq 0x87e0
movq %rax, %rdi
callq 0x5775
movq %rbx, %rdi
callq 0x5775
movq %r14, %rdi
callq 0x5775
movl (%r15), %eax
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: kvSetLen
int kvSetLen(const char *key, const char *value, size_t vlen, int64_t expire) {
    expire += time(NULL);
    if (!sqlInsert("INSERT INTO KeyValue VALUES(?i,?s,?b)",
                   expire,key,value,vlen))
    {
        if (!sqlQuery("UPDATE KeyValue SET expire=?i,value=?b WHERE key=?s",
                      expire,value,vlen,key))
        {
            return C_ERR;
        }
    }
    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbp
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x2210
movq %rax, %r13
addq %rbp, %r13
leaq 0x5a2f(%rip), %rdi      # 0xeaa4
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x8211
testl %eax, %eax
jne 0x90aa
leaq 0x5a37(%rip), %rdi      # 0xeaca
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x82bd
testl %eax, %eax
je 0x90af
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: dbGetListID
int64_t dbGetListID(const char *listname, int create) {
    int64_t listid = 0;

    listid = sqlSelectInt(
        "SELECT rowid FROM Lists WHERE name=?s COLLATE NOCASE",
        listname);
    if (listid == 0 && create)
        listid = sqlInsert("INSERT INTO Lists VALUES(?s)",listname);
    return listid;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x5d94(%rip), %rdi      # 0xeefc
movq %rbx, %rsi
xorl %eax, %eax
callq 0x847a
testq %rax, %rax
setne %cl
testl %ebp, %ebp
sete %dl
orb %cl, %dl
jne 0x9194
leaq 0x5da9(%rip), %rdi      # 0xef31
movq %rbx, %rsi
xorl %eax, %eax
callq 0x8211
cltq
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: dbGetStockID
int64_t dbGetStockID(const char *listname, const char *stock) {
    int64_t listid = dbGetListID(listname,0);
    if (listid == 0) return 0;

    /* Check if a list with such name already exists. */
    return sqlSelectInt(
        "SELECT rowid FROM ListStock WHERE "
        "listid=?i AND symbol=?s COLLATE NOCASE",listid,stock);
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x5d53(%rip), %rdi      # 0xeefc
xorl %eax, %eax
callq 0x847a
testq %rax, %rax
je 0x91ca
leaq 0x5d92(%rip), %rdi      # 0xef4e
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
popq %rbx
jmp 0x847a
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: dbGetListCount
int dbGetListCount(const char *listname) {
    int64_t listid = dbGetListID(listname,0);
    if (listid == 0) return 0;

    return sqlSelectInt(
        "SELECT COUNT(*) FROM ListStock WHERE listid=?i",listid);
}

// Assembly:
pushq %rbx
movq %rdi, %rsi
leaq 0x5d23(%rip), %rdi      # 0xeefc
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x847a
testq %rax, %rax
je 0x91fb
leaq 0x5da9(%rip), %rdi      # 0xef97
movq %rax, %rsi
xorl %eax, %eax
callq 0x847a
movq %rax, %rbx
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: dbDelStockFromList
int dbDelStockFromList(const char *listname, const char *symbol, int dellist) {
    int64_t stockid = dbGetStockID(listname,symbol);

    if (!sqlQuery("DELETE FROM ListStock WHERE rowid=?i",stockid))
        return C_ERR;

    /* Delete the list if is now orphaned. */
    if (dellist && dbGetListCount(listname) == 0) {
        if (!sqlQuery("DELETE FROM Lists WHERE name=?s",listname))
            return C_ERR;
    }

    /* Finally remove the packs associated with this item in the list. */
    if (!sqlQuery("DELETE FROM StockPack WHERE rowid=?",stockid))
        return C_ERR;

    return C_OK;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rdi, %r14
callq 0x919b
movq %rax, %rbx
leaq 0x5daf(%rip), %rdi      # 0xefc6
movq %rax, %rsi
xorl %eax, %eax
callq 0x82bd
testl %eax, %eax
je 0x925f
testl %ebp, %ebp
je 0x924a
movq %r14, %rdi
callq 0x91ce
testl %eax, %eax
jne 0x924a
leaq 0x5daf(%rip), %rdi      # 0xefeb
movq %r14, %rsi
xorl %eax, %eax
callq 0x82bd
testl %eax, %eax
je 0x925f
leaq 0x5dba(%rip), %rdi      # 0xf00b
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x82bd
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: populateStockPackInfo
int populateStockPackInfo(stockpack *pack, const char *symbol) {
    ydata *yd = getYahooData(YDATA_QUOTE,symbol,NULL,NULL,10);

    size_t len = strlen(symbol);
    if (len >= sizeof(pack->symbol)) len = sizeof(pack->symbol)-1;
    memcpy(pack->symbol,symbol,len);
    pack->symbol[len] = 0;

    if (yd) {
        double daychange = strtod(yd->regchange,NULL);
        double payed = pack->quantity * pack->avgprice;
        double value = pack->quantity * yd->reg;
        pack->value = value;
        pack->gain = value-payed;
        pack->gainperc = (value/payed-1)*100;
        pack->daygainperc = daychange;
        pack->daygain = value / 100 * daychange;
        if (yd->csym[0] == '$')
            pack->currency = CURRENCY_USD;
        else if (strlen(yd->csym) == 3 && !memcmp(yd->csym,"\xe2\x82\xac",3))
            pack->currency = CURRENCY_EUR;
        freeYahooData(yd);
        return C_OK;
    } else {
        return C_ERR;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r12
movq %rdi, %rbx
xorl %r15d, %r15d
xorl %edi, %edi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0xa, %r8d
callq 0x88ec
movq %rax, %r14
movq %r12, %rdi
callq 0x2100
cmpq $0x3f, %rax
movl $0x3f, %r13d
cmovbq %rax, %r13
leaq 0x24(%rbx), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21e0
movb $0x0, 0x24(%rbx,%r13)
testq %r14, %r14
je 0x937d
movq 0x58(%r14), %rdi
xorl %esi, %esi
callq 0x21c0
movq 0x10(%rbx), %rax
cvtsi2sd %rax, %xmm1
mulsd 0x18(%rbx), %xmm1
cvtsi2ss %rax, %xmm2
mulss 0x20(%r14), %xmm2
cvtss2sd %xmm2, %xmm2
movsd %xmm2, 0x88(%rbx)
movaps %xmm2, %xmm3
subsd %xmm1, %xmm3
movsd %xmm3, 0x68(%rbx)
movaps %xmm2, %xmm3
divsd %xmm1, %xmm3
addsd 0x53ad(%rip), %xmm3     # 0xe6b8
movsd %xmm0, 0x80(%rbx)
divsd 0x5395(%rip), %xmm2     # 0xe6b0
unpcklpd %xmm2, %xmm3            # xmm3 = xmm3[0],xmm2[0]
movapd 0x5529(%rip), %xmm1     # 0xe850
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
mulpd %xmm3, %xmm1
movupd %xmm1, 0x70(%rbx)
movq 0x70(%r14), %r15
movl $0x1, %eax
cmpb $0x24, (%r15)
jne 0x9348
movl %eax, 0x20(%rbx)
jmp 0x936f
movq %r15, %rdi
callq 0x2100
cmpq $0x3, %rax
jne 0x936f
movzwl (%r15), %eax
xorl $0x82e2, %eax           # imm = 0x82E2
movzbl 0x2(%r15), %ecx
xorl $0xac, %ecx
orw %ax, %cx
je 0x938a
movq %r14, %rdi
callq 0x885a
movl $0x1, %r15d
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0x2, %eax
jmp 0x9343
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: dbGetPortfolio
stockpack *dbGetPortfolio(const char *listname, int *count) {
    int64_t listid = dbGetListID(listname,0);
    if (listid == 0) return NULL;

    stockpack *packs = NULL;
    int rows = 0;
    char *sql = "SELECT symbol,quantity,avgprice FROM ListStock "
                "CROSS JOIN StockPack On "
                "ListStock.rowid = StockPack.liststockid "
                "WHERE ListStock.listid=?i ORDER BY symbol";

    sqlRow row;
    sqlSelect(&row,sql,listid);
    while (sqlNextRow(&row)) {
        packs = realloc(packs,sizeof(stockpack)*(rows+1));
        stockpack *pack = packs+rows;
        memset(pack,0,sizeof(stockpack));
        const char *symbol = row.col[0].s;
        pack->quantity = row.col[1].i;
        pack->avgprice = row.col[2].d;
        /* Compute the gain. */
        populateStockPackInfo(pack,symbol);
        rows++;
    }
    *count = rows;

    /* Return NULL if the list exists but there are no associated packs. */
    if (rows == 0) {
        xfree(packs);
        packs = NULL;
    }
    return packs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x5b50(%rip), %rdi      # 0xeefc
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x847a
testq %rax, %rax
je 0x9457
movq %rbx, 0x8(%rsp)
leaq 0x5c69(%rip), %rsi      # 0xf033
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8357
movq %r14, %rdi
callq 0x80e3
testl %eax, %eax
je 0x945c
xorl %ebp, %ebp
leaq 0x10(%rsp), %r15
xorl %r12d, %r12d
xorl %r14d, %r14d
leaq 0x90(%r12), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2488
movq %rax, %r14
leaq (%rax,%r12), %r13
movl $0x90, %edx
movq %r13, %rdi
xorl %esi, %esi
callq 0x2140
movq 0x20(%rsp), %rax
movq 0x10(%rax), %rsi
movq 0x28(%rax), %rcx
movq %rcx, 0x10(%r14,%r12)
movsd 0x58(%rax), %xmm0
movsd %xmm0, 0x18(%r14,%r12)
movq %r13, %rdi
callq 0x9266
movq %r15, %rdi
callq 0x80e3
incl %ebp
movq %rbx, %r12
testl %eax, %eax
jne 0x93f5
jmp 0x945f
xorl %r14d, %r14d
jmp 0x9466
xorl %r14d, %r14d
movq 0x8(%rsp), %rax
movl %ebp, (%rax)
movq %r14, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/antirez[P]stonky/stonky.c
// Function: dbAddStockToList
int64_t dbAddStockToList(const char *listname, const char *symbol) {
    int64_t listid = dbGetListID(listname,1);
    if (listid == 0) return 0;

    /* Check if the stock is already part of the list. */
    int64_t stockid = dbGetStockID(listname,symbol);
    if (stockid) return stockid;

    stockid = sqlInsert("INSERT INTO ListStock VALUES(?i,?s)",listid,symbol);
    return stockid;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
movl $0x1, %esi
callq 0x9159
testq %rax, %rax
je 0x94bd
movq %rax, %r14
movq %r15, %rdi
movq %rbx, %rsi
callq 0x919b
testq %rax, %rax
jne 0x94bf
leaq 0x5c20(%rip), %rdi      # 0xf0cc
movq %r14, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x8211
cltq
jmp 0x94bf
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq