LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/asset/asset.h
// Function: Asset::Font::find_kerning(char, char)
f32 find_kerning(char a, char b) {
        u16 key = (a << 8) | b;
        s64 low = 0;
        s64 high = num_kernings;
        s64 last_guess = -1;
        while (low <= high) {
            s64 cur = (low + high) / 2;
            if (cur < 0 || num_kernings < cur || cur == last_guess)
                break;
            last_guess = cur;
            u16 cur_key = kernings[cur].key;
            if (cur_key > key)
                high = cur + 1;
            else if (cur_key < key)
                low = cur + 1;
            else
                return kernings[cur].ammount;
        }
        return 0;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x10(%rbp)
movb %cl, -0x11(%rbp)
movb %al, -0x12(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movsbl -0x11(%rbp), %ecx
shll $0x8, %ecx
movsbl -0x12(%rbp), %edx
orl %edx, %ecx
movw %cx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq $-0x1, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jg 0x42209
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jl 0x42197
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x38(%rbp), %rax
jl 0x42197
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jne 0x42199
jmp 0x42209
movq -0x48(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movw (%rax,%rcx,8), %ax
movw %ax, -0x3a(%rbp)
movzwl -0x3a(%rbp), %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jle 0x421cf
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x42204
movzwl -0x3a(%rbp), %eax
movzwl -0x14(%rbp), %ecx
cmpl %ecx, %eax
jge 0x421e9
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x42202
movq -0x48(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movss 0x4(%rax,%rcx,8), %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x42211
jmp 0x42204
jmp 0x42154
xorps %xmm0, %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/asset/asset.cpp
// Function: unsigned long Asset::read_from_file<Asset::FileHeader>(_IO_FILE*, void*, unsigned long)
size_t read_from_file(FILE *stream, void *ptr, size_t num = 1) {
    if (!num) {
        ERR("Has to read something from file, invalid read");
        return 0;
    }
    size_t read = 0;
    do {
        size_t last_read = fread(ptr, sizeof(T), num - read, stream);
        ASSERT(last_read, "Failed to read anything from asset file.");
        read += last_read;
        ptr = (void *) ((u8 *) ptr + last_read * sizeof(T));
    } while (read < num);
    return read;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x42407
movq 0x26c0e(%rip), %rax     # 0x68fe0
movq (%rax), %rsi
leaq 0x3893(%rip), %rdi      # 0x45c6f
leaq 0x41c3(%rip), %rdx      # 0x465a6
movl $0x47, %ecx
leaq 0x18623(%rip), %r8      # 0x5aa12
leaq 0x1862b(%rip), %r9      # 0x5aa21
movb $0x0, %al
callq 0xb100
movq $0x0, -0x8(%rbp)
jmp 0x42483
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
subq -0x28(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x20, %esi
callq 0x22c0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
setne %al
andb $0x1, %al
leaq 0x4168(%rip), %rdi      # 0x465a6
movl $0x4d, %esi
leaq 0x18605(%rip), %rdx     # 0x5aa4f
movzbl %al, %ecx
callq 0xb210
movq -0x30(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jb 0x4240f
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/logic/logic.h
// Function: Logic::Timer::call(float, float)
void call(f32 time, f32 delta) {
        if (next <= time && next != -1) {
            if (end == FOREVER) {
                callback(delta, time, 0, aux);
            } else if (end == ONCE) {
                callback(delta, time, 1, aux);
            } else {
                f32 percent = CLAMP(0, 1, (time - start) / (end - start));
                callback(delta, time, percent, aux);
            }
            next += spacing;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movss 0x8(%rax), %xmm1
movss -0xc(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jb 0x434cb
movq -0x20(%rbp), %rax
movss 0x8(%rax), %xmm0
movss 0x1c96(%rip), %xmm1     # 0x45018
ucomiss %xmm1, %xmm0
jne 0x4338e
jp 0x4338e
jmp 0x434cb
movq -0x20(%rbp), %rax
movss 0xc(%rax), %xmm0
movss 0x1c79(%rip), %xmm1     # 0x45018
ucomiss %xmm1, %xmm0
jne 0x433c6
jp 0x433c6
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rax
movss -0x10(%rbp), %xmm0
movss -0xc(%rbp), %xmm1
movq 0x20(%rcx), %rdi
xorps %xmm2, %xmm2
callq *%rax
jmp 0x434b8
movq -0x20(%rbp), %rax
movss 0xc(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x433fe
jp 0x433fe
movq -0x20(%rbp), %rcx
movq 0x18(%rcx), %rax
movss -0x10(%rbp), %xmm0
movss -0xc(%rbp), %xmm1
movq 0x20(%rcx), %rdi
movss 0x1c11(%rip), %xmm2     # 0x45008
callq *%rax
jmp 0x434b6
movq -0x20(%rbp), %rax
movss -0xc(%rbp), %xmm1
subss 0x4(%rax), %xmm1
movss 0xc(%rax), %xmm0
subss 0x4(%rax), %xmm0
divss %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x4342c
xorps %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
jmp 0x4348f
movq -0x20(%rbp), %rax
movss -0xc(%rbp), %xmm0
subss 0x4(%rax), %xmm0
movss 0xc(%rax), %xmm1
subss 0x4(%rax), %xmm1
divss %xmm1, %xmm0
movss 0x1bb8(%rip), %xmm1     # 0x45008
ucomiss %xmm1, %xmm0
jbe 0x43464
movss 0x1bab(%rip), %xmm0     # 0x45008
movss %xmm0, -0x28(%rbp)
jmp 0x43485
movq -0x20(%rbp), %rax
movss -0xc(%rbp), %xmm0
subss 0x4(%rax), %xmm0
movss 0xc(%rax), %xmm1
subss 0x4(%rax), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x28(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x20(%rbp), %rcx
movss -0x24(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
movq 0x18(%rcx), %rax
movss -0x10(%rbp), %xmm0
movss -0xc(%rbp), %xmm1
movss -0x14(%rbp), %xmm2
movq 0x20(%rcx), %rdi
callq *%rax
jmp 0x434b8
movq -0x20(%rbp), %rax
movss 0x10(%rax), %xmm0
addss 0x8(%rax), %xmm0
movss %xmm0, 0x8(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/util/block_list.h
// Function: Util::List<Physics::Shape> Util::create_list<Physics::Shape>(unsigned int)
List<T> create_list(u32 capacity)
{
    List<T> list = {};
    list.capacity = capacity;
    list.data = Util::push_memory<T>(capacity);
    list.initalized = true;
    return list;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq %rdi, %rax
movq %rax, -0x10(%rbp)
movl %esi, -0x4(%rbp)
callq 0x41470
movq -0x18(%rbp), %rdi
movl -0x4(%rbp), %eax
movl %eax, (%rdi)
movl -0x4(%rbp), %edi
callq 0x441a0
movq -0x18(%rbp), %rdi
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rdi)
movb $0x1, 0x10(%rdi)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/util/block_list.h
// Function: Util::List<Vec2>::append(Vec2)
void append(T element)
    {
        ASSERT(initalized, "Trying to use uninitalized list");
        length++;
        if (length >= capacity)
            resize(capacity * 2);

        data[length - 1] = element;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movlpd %xmm0, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movzbl 0x10(%rax), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
leaq 0x173a7(%rip), %rdi     # 0x5aa83
movl $0x38, %esi
leaq 0x173b8(%rip), %rdx     # 0x5aaa0
movzbl %al, %ecx
callq 0xb210
movq -0x18(%rbp), %rcx
movl 0x4(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x4(%rcx)
movl 0x4(%rcx), %eax
cmpl (%rcx), %eax
jb 0x43711
movq -0x18(%rbp), %rdi
movl (%rdi), %esi
shll %esi
callq 0x44280
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rax
movl 0x4(%rcx), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
movq -0x8(%rbp), %rdx
movq %rdx, (%rax,%rcx,8)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/FredTheDino[P]Fog/src/engine/util/block_list.h
// Function: Util::List<Vec2>::resize(unsigned int)
void resize(u32 new_size)
    {
        ASSERT(initalized, "Trying to use uninitalized list");
        // Only expand it. No need to free memory.
        if (capacity < new_size)
        {
            data = resize_memory<T>(data, sizeof(T) * new_size);
            capacity = new_size;
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movzbl 0x10(%rax), %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
leaq 0x167d9(%rip), %rdi     # 0x5aa83
movl $0x2d, %esi
leaq 0x167ea(%rip), %rdx     # 0x5aaa0
movzbl %al, %ecx
callq 0xb210
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0xc(%rbp), %eax
jae 0x442ef
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0xc(%rbp), %eax
shlq $0x3, %rax
movl %eax, %esi
callq 0x44300
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0xc(%rbp), %ecx
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/motet-a[P]libforks/examples/basic.c
// Function: main
int main() {
  libforks_ServerConn conn;
  assert(libforks_start(&conn) == libforks_OK);

  assert(libforks_fork(
    conn,
    NULL, // pid_ptr
    NULL, // socket_fd_ptr
    NULL, // exit_fd_ptr
    child_main
  ) == libforks_OK);

  // `libforks_stop` waits until the child process exits
  assert(libforks_stop(conn) == libforks_OK);

  puts("main process exited");

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1a70
cmpl $0x0, %eax
jne 0x132f
jmp 0x134e
leaq 0x2cce(%rip), %rdi      # 0x4004
leaq 0x2cec(%rip), %rsi      # 0x4029
movl $0x15, %edx
leaq 0x2cf1(%rip), %rcx      # 0x403a
callq 0x10c0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %ecx
leaq 0x83(%rip), %r8         # 0x13e0
movq %rcx, %rsi
movq %rcx, %rdx
callq 0x2240
cmpl $0x0, %eax
jne 0x136f
jmp 0x138e
leaq 0x2ccf(%rip), %rdi      # 0x4045
leaq 0x2cac(%rip), %rsi      # 0x4029
movl $0x1d, %edx
leaq 0x2cb1(%rip), %rcx      # 0x403a
callq 0x10c0
movq -0x10(%rbp), %rdi
callq 0x24d0
cmpl $0x0, %eax
jne 0x139e
jmp 0x13bd
leaq 0x2ce3(%rip), %rdi      # 0x4088
leaq 0x2c7d(%rip), %rsi      # 0x4029
movl $0x20, %edx
leaq 0x2c82(%rip), %rcx      # 0x403a
callq 0x10c0
leaq 0x2ce7(%rip), %rdi      # 0x40ab
callq 0x1070
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/motet-a[P]libforks/examples/basic.c
// Function: child_main
static void child_main(libforks_ServerConn conn, int socket_fd) {
  // not strictly required but recommended
  assert(libforks_free_conn(conn) == libforks_OK);

  assert(socket_fd == -1);
  puts("child process started");
  sleep(1);
  puts("child process exited");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2540
cmpl $0x0, %eax
jne 0x13ff
jmp 0x141e
leaq 0x2cb9(%rip), %rdi      # 0x40bf
leaq 0x2c1c(%rip), %rsi      # 0x4029
movl $0xb, %edx
leaq 0x2cce(%rip), %rcx      # 0x40e7
callq 0x10c0
cmpl $-0x1, -0xc(%rbp)
jne 0x1426
jmp 0x1445
leaq 0x2ce4(%rip), %rdi      # 0x4111
leaq 0x2bf5(%rip), %rsi      # 0x4029
movl $0xd, %edx
leaq 0x2ca7(%rip), %rcx      # 0x40e7
callq 0x10c0
leaq 0x2cd5(%rip), %rdi      # 0x4121
callq 0x1070
movl $0x1, %edi
callq 0x11f0
leaq 0x2cd5(%rip), %rdi      # 0x4137
callq 0x1070
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ramirezsebas[P]TP-LISTINGS/./src/capitulo_3/3.3/fork.c
// Function: main
int main ()
{
	pid_t child_pid;
  //El id de proceso main
  printf("the main program process ID is %d\n", (int) getpid ());
	child_pid = fork ();
	if (child_pid != 0) {
		printf("this is the parent process, with id %d\n", (int) getpid ());
		printf("the child’s process ID is %d\n", (int) child_pid);
	}
	else
    printf ("this is the child process, with id %d\n", (int) getpid ());
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
callq 0x1050
movl %eax, %esi
leaq 0xe87(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
callq 0x1040
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
je 0x11ba
callq 0x1050
movl %eax, %esi
leaq 0xe87(%rip), %rdi       # 0x2027
movb $0x0, %al
callq 0x1030
movl -0x8(%rbp), %esi
leaq 0xe9e(%rip), %rdi       # 0x204f
movb $0x0, %al
callq 0x1030
jmp 0x11cf
callq 0x1050
movl %eax, %esi
leaq 0xea7(%rip), %rdi       # 0x206f
movb $0x0, %al
callq 0x1030
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ikbenlike[P]nngutils/src/pwd.c
// Function: main
int main(int argc, char **argv){
    char pwd[PATH_MAX];

    if(!getcwd(pwd, sizeof(pwd))){
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        return 1;
    }
    puts(pwd);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1020, %rsp           # imm = 0x1020
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x1010(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x1050
cmpq $0x0, %rax
jne 0x1203
movq 0x2e41(%rip), %rax      # 0x3ff8
movq (%rax), %rax
movq %rax, -0x1020(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1018(%rbp)
callq 0x1030
movl (%rax), %edi
callq 0x1070
movq -0x1020(%rbp), %rdi
movq -0x1018(%rbp), %rdx
movq %rax, %rcx
leaq 0xe11(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1060
movl $0x1, -0x4(%rbp)
jmp 0x1216
leaq -0x1010(%rbp), %rdi
callq 0x1040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1020, %rsp           # imm = 0x1020
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/sushant8421[P]create_your_own_shell/break.c
// Function: main
int main(int argc , char *argv[]) {
	FILE *read;
	FILE *write;
	char line [128]; 
	int split_no=1, nof_lines=1,total_lines ;
	sscanf(argv[1], "%d", &total_lines); 
   
	read = fopen(argv[2],"r");
	if (!read)
		return 1;

	write= write_in(split_no);

	while (fgets(line, sizeof(line), read)!=NULL) {
		if (nof_lines == (total_lines+1)) 
		{
			fclose(write);
			nof_lines = 1;
			split_no++;
			write= write_in(split_no);	
			if (!write)
			return 1;
		}
		fprintf(write,"%s", line);
		nof_lines++;
	}
	fclose(read);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0xa4(%rbp)
movl $0x1, -0xa8(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xdfa(%rip), %rsi       # 0x2016
leaq -0xac(%rbp), %rdx
movb $0x0, %al
callq 0x1060
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0xde0(%rip), %rsi       # 0x2019
callq 0x1070
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1255
movl $0x1, -0x4(%rbp)
jmp 0x1316
movl -0xa4(%rbp), %edi
callq 0x1190
movq %rax, -0x20(%rbp)
leaq -0xa0(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x80, %esi
callq 0x1040
cmpq $0x0, %rax
je 0x1306
movl -0xa8(%rbp), %eax
movl -0xac(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x12d9
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x1, -0xa8(%rbp)
movl -0xa4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa4(%rbp)
movl -0xa4(%rbp), %edi
callq 0x1190
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12d7
movl $0x1, -0x4(%rbp)
jmp 0x1316
jmp 0x12d9
movq -0x20(%rbp), %rdi
leaq -0xa0(%rbp), %rdx
leaq 0xd30(%rip), %rsi       # 0x201b
movb $0x0, %al
callq 0x1050
movl -0xa8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xa8(%rbp)
jmp 0x1264
movq -0x18(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/neovim[P]libtermkey/demo-glib.c
// Function: main
int main(int argc, char *argv[])
{
  TERMKEY_CHECK_VERSION;

  tk = termkey_new(0, 0);

  if(!tk) {
    fprintf(stderr, "Cannot allocate termkey instance\n");
    exit(1);
  }

  GMainLoop *loop = g_main_loop_new(NULL, FALSE);

  g_io_add_watch(g_io_channel_unix_new(0), G_IO_IN, stdin_io, NULL);

  g_main_loop_run(loop);

  termkey_destroy(tk);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
xorl %edi, %edi
movl $0x17, %esi
callq 0x1080
xorl %esi, %esi
movl %esi, %edi
callq 0x10b0
movq %rax, 0x2e4d(%rip)      # 0x40b8
cmpq $0x0, 0x2e45(%rip)      # 0x40b8
jne 0x1297
movq 0x2d74(%rip), %rax      # 0x3ff0
movq (%rax), %rdi
leaq 0xd7e(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1120
movl $0x1, %edi
callq 0x1070
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x10a0
movq %rax, -0x18(%rbp)
xorl %edi, %edi
callq 0x1060
movq %rax, %rdi
movl $0x1, %esi
leaq 0x34(%rip), %rdx        # 0x12f0
xorl %eax, %eax
movl %eax, %ecx
callq 0x10d0
movq -0x18(%rbp), %rdi
callq 0x1130
movq 0x2de3(%rip), %rdi      # 0x40b8
callq 0x1040
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/neovim[P]libtermkey/demo-glib.c
// Function: stdin_io
static gboolean stdin_io(GIOChannel *source, GIOCondition condition, gpointer data)
{
  if(condition && G_IO_IN) {
    if(timeout_id)
      g_source_remove(timeout_id);

    termkey_advisereadable(tk);

    TermKeyResult ret;
    TermKeyKey key;
    while((ret = termkey_getkey(tk, &key)) == TERMKEY_RES_KEY) {
      on_key(tk, &key);
    }

    if(ret == TERMKEY_RES_AGAIN)
      timeout_id = g_timeout_add(termkey_get_waittime(tk), key_timer, NULL);
  }

  return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x137f
cmpl $0x0, 0x2db0(%rip)      # 0x40c0
je 0x131d
movl 0x2da8(%rip), %edi      # 0x40c0
callq 0x10f0
movq 0x2d94(%rip), %rdi      # 0x40b8
callq 0x1100
movq 0x2d88(%rip), %rdi      # 0x40b8
leaq -0x40(%rbp), %rsi
callq 0x10c0
movl %eax, -0x1c(%rbp)
cmpl $0x1, %eax
jne 0x1353
movq 0x2d70(%rip), %rdi      # 0x40b8
leaq -0x40(%rbp), %rsi
callq 0x1390
jmp 0x1329
cmpl $0x3, -0x1c(%rbp)
jne 0x137d
movq 0x2d58(%rip), %rdi      # 0x40b8
callq 0x10e0
movl %eax, %edi
leaq 0x72(%rip), %rsi        # 0x13e0
xorl %eax, %eax
movl %eax, %edx
callq 0x1110
movl %eax, 0x2d43(%rip)      # 0x40c0
jmp 0x137f
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/main.c
// Function: main
int main(int argc, char *argv[], char *envp[])
{
	uint8_t exit_code = 0;
	riyuu_run run;

	if (argc == 1) {
		show_help(argv[0]);
		goto out;
	}

	if (!argv_parser(argc, argv, envp, &run, &exit_code)) {
		goto out;
	}

	exit_code = riyuu_exec_run(&run);

out:
	exit(exit_code);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb $0x0, -0x19(%rbp)
cmpl $0x1, -0x8(%rbp)
jne 0x24a2
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xa480
jmp 0x24cc
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x19(%rbp), %r8
callq 0xa4d0
testb $0x1, %al
jne 0x24c0
jmp 0x24cc
leaq -0x30(%rbp), %rdi
callq 0xa660
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %edi
callq 0x21d0
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: cJSONUtils_strdup(unsigned char const*)
static unsigned char* cJSONUtils_strdup(const unsigned char* const string)
{
    size_t length = 0;
    unsigned char *copy = NULL;

    length = strlen((const char*)string) + sizeof("");
    copy = (unsigned char*) cJSON_malloc(length);
    if (copy == NULL)
    {
        return NULL;
    }
    memcpy(copy, string, length);

    return copy;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6200
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x806b
movq $0x0, -0x8(%rbp)
jmp 0x8084
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2040
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: pointer_encoded_length(unsigned char const*)
static size_t pointer_encoded_length(const unsigned char *string)
{
    size_t length;
    for (length = 0; *string != '\0'; (void)string++, length++)
    {
        /* character needs to be escaped? */
        if ((*string == '~') || (*string == '/'))
        {
            length++;
        }
    }

    return length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x80ec
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x7e, %eax
je 0x80c4
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x80d0
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x80d2
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x80a0
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: encode_string_as_pointer(unsigned char*, unsigned char const*)
static void encode_string_as_pointer(unsigned char *destination, const unsigned char *source)
{
    for (; source[0] != '\0'; (void)source++, destination++)
    {
        if (source[0] == '/')
        {
            destination[1] = '1';
            destination++;
        }
        else if (source[0] == '~')
        {
            destination[0] = '~';
            destination[1] = '1';
            destination++;
        }
        else
        {
            destination[0] = source[0];
        }
    }

    destination[0] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x8190
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x813a
movq -0x8(%rbp), %rax
movb $0x31, 0x1(%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x8171
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x7e, %eax
jne 0x8163
movq -0x8(%rbp), %rax
movb $0x7e, (%rax)
movq -0x8(%rbp), %rax
movb $0x31, 0x1(%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x816f
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x8(%rbp), %rax
movb %cl, (%rax)
jmp 0x8171
jmp 0x8173
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x810c
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: cJSONUtils_ApplyPatches
CJSON_PUBLIC(int) cJSONUtils_ApplyPatches(cJSON * const object, const cJSON * const patches)
{
    const cJSON *current_patch = NULL;
    int status = 0;

    if (!cJSON_IsArray(patches))
    {
        /* malformed patches. */
        return 1;
    }

    if (patches != NULL)
    {
        current_patch = patches->child;
    }

    while (current_patch != NULL)
    {
        status = apply_patch(object, current_patch, false);
        if (status != 0)
        {
            return status;
        }
        current_patch = current_patch->next;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x18(%rbp), %rdi
callq 0x5dc0
cmpl $0x0, %eax
jne 0x83a6
movl $0x1, -0x4(%rbp)
jmp 0x83f6
cmpq $0x0, -0x18(%rbp)
je 0x83b9
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x83bb
cmpq $0x0, -0x20(%rbp)
je 0x83ef
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0x8400
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x83e2
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x83f6
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x83bb
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: cJSONUtils_GeneratePatches
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatches(cJSON * const from, cJSON * const to)
{
    cJSON *patches = NULL;

    if ((from == NULL) || (to == NULL))
    {
        return NULL;
    }

    patches = cJSON_CreateArray();
    create_patches(patches, (const unsigned char*)"", from, to, false);

    return patches;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x8c06
cmpq $0x0, -0x18(%rbp)
jne 0x8c10
movq $0x0, -0x8(%rbp)
jmp 0x8c3c
callq 0x4c50
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x38a9(%rip), %rsi      # 0xc4d5
xorl %r8d, %r8d
callq 0x8c50
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: cJSONUtils_GeneratePatchesCaseSensitive
CJSON_PUBLIC(cJSON *) cJSONUtils_GeneratePatchesCaseSensitive(cJSON * const from, cJSON * const to)
{
    cJSON *patches = NULL;

    if ((from == NULL) || (to == NULL))
    {
        return NULL;
    }

    patches = cJSON_CreateArray();
    create_patches(patches, (const unsigned char*)"", from, to, true);

    return patches;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x90e6
cmpq $0x0, -0x18(%rbp)
jne 0x90f0
movq $0x0, -0x8(%rbp)
jmp 0x911f
callq 0x4c50
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x33c9(%rip), %rsi      # 0xc4d5
movl $0x1, %r8d
callq 0x8c50
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: decode_array_index_from_pointer(unsigned char const*, unsigned long*)
static cJSON_bool decode_array_index_from_pointer(const unsigned char * const pointer, size_t * const index)
{
    size_t parsed_index = 0;
    size_t position = 0;

    if ((pointer[0] == '0') && ((pointer[1] != '\0') && (pointer[1] != '/')))
    {
        /* leading zeroes are not permitted */
        return 0;
    }

    for (position = 0; (pointer[position] >= '0') && (pointer[0] <= '9'); position++)
    {
        parsed_index = (10 * parsed_index) + (size_t)(pointer[position] - '0');

    }

    if ((pointer[position] != '\0') && (pointer[position] != '/'))
    {
        return 0;
    }

    *index = parsed_index;

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x30, %eax
jne 0x963e
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x0, %eax
je 0x963e
movq -0x10(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x2f, %eax
je 0x963e
movl $0x0, -0x4(%rbp)
jmp 0x96de
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x29(%rbp)
jl 0x966c
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9675
jmp 0x96a1
imulq $0xa, -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rdx
movzbl (%rcx,%rdx), %ecx
subl $0x30, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x9646
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x96cc
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
je 0x96cc
movl $0x0, -0x4(%rbp)
jmp 0x96de
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: get_array_item(cJSON const*, unsigned long)
static cJSON *get_array_item(const cJSON *array, size_t item)
{
    cJSON *child = array ? array->child : NULL;
    while ((child != NULL) && (item > 0))
    {
        item--;
        child = child->next;
    }

    return child;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x9711
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x9719
xorl %eax, %eax
movq %rax, -0x20(%rbp)
jmp 0x9719
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x21(%rbp)
je 0x9738
cmpq $0x0, -0x10(%rbp)
seta %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x9741
jmp 0x975a
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x9721
movq -0x18(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: decode_patch_operation(cJSON const*, int)
static enum patch_operation decode_patch_operation(const cJSON * const patch, const cJSON_bool case_sensitive)
{
    cJSON *operation = get_object_item(patch, "op", case_sensitive);
    if (!cJSON_IsString(operation))
    {
        return INVALID;
    }

    if (strcmp(operation->valuestring, "add") == 0)
    {
        return ADD;
    }

    if (strcmp(operation->valuestring, "remove") == 0)
    {
        return REMOVE;
    }

    if (strcmp(operation->valuestring, "replace") == 0)
    {
        return REPLACE;
    }

    if (strcmp(operation->valuestring, "move") == 0)
    {
        return MOVE;
    }

    if (strcmp(operation->valuestring, "copy") == 0)
    {
        return COPY;
    }

    if (strcmp(operation->valuestring, "test") == 0)
    {
        return TEST;
    }

    return INVALID;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %edx
leaq 0x29f4(%rip), %rsi      # 0xc351
callq 0x98f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x30a0
cmpl $0x0, %eax
jne 0x9980
movl $0x0, -0x4(%rbp)
jmp 0x9a59
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x29c5(%rip), %rsi      # 0xc354
callq 0x2250
cmpl $0x0, %eax
jne 0x99a5
movl $0x1, -0x4(%rbp)
jmp 0x9a59
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x29a4(%rip), %rsi      # 0xc358
callq 0x2250
cmpl $0x0, %eax
jne 0x99ca
movl $0x2, -0x4(%rbp)
jmp 0x9a59
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x2986(%rip), %rsi      # 0xc35f
callq 0x2250
cmpl $0x0, %eax
jne 0x99ec
movl $0x3, -0x4(%rbp)
jmp 0x9a59
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x295f(%rip), %rsi      # 0xc35a
callq 0x2250
cmpl $0x0, %eax
jne 0x9a0e
movl $0x4, -0x4(%rbp)
jmp 0x9a59
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x294a(%rip), %rsi      # 0xc367
callq 0x2250
cmpl $0x0, %eax
jne 0x9a30
movl $0x5, -0x4(%rbp)
jmp 0x9a59
movq -0x20(%rbp), %rax
movq 0x20(%rax), %rdi
leaq 0x292d(%rip), %rsi      # 0xc36c
callq 0x2250
cmpl $0x0, %eax
jne 0x9a52
movl $0x6, -0x4(%rbp)
jmp 0x9a59
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: overwrite_item(cJSON*, cJSON)
static void overwrite_item(cJSON * const root, const cJSON replacement)
{
    if (root == NULL)
    {
        return;
    }

    if (root->string != NULL)
    {
        cJSON_free(root->string);
    }
    if (root->valuestring != NULL)
    {
        cJSON_free(root->valuestring);
    }
    if (root->child != NULL)
    {
        cJSON_Delete(root->child);
    }

    memcpy(root, &replacement, sizeof(cJSON));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x9d1d
jmp 0x9d77
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x9d35
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x6220
movq -0x8(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x9d4d
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x6220
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x9d65
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x31f0
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdi
movl $0x40, %edx
callq 0x2040
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: detach_path(cJSON*, unsigned char const*, int)
static cJSON *detach_path(cJSON *object, const unsigned char *path, const cJSON_bool case_sensitive)
{
    unsigned char *parent_pointer = NULL;
    unsigned char *child_pointer = NULL;
    cJSON *parent = NULL;
    cJSON *detached_item = NULL;

    /* copy path and split it in parent and child */
    parent_pointer = cJSONUtils_strdup(path);
    if (parent_pointer == NULL) {
        goto cleanup;
    }

    child_pointer = (unsigned char*)strrchr((char*)parent_pointer, '/'); /* last '/' */
    if (child_pointer == NULL)
    {
        goto cleanup;
    }
    /* split strings */
    child_pointer[0] = '\0';
    child_pointer++;

    parent = get_item_from_pointer(object, (char*)parent_pointer, case_sensitive);
    decode_pointer_inplace(child_pointer);

    if (cJSON_IsArray(parent))
    {
        size_t index = 0;
        if (!decode_array_index_from_pointer(child_pointer, &index))
        {
            goto cleanup;
        }
        detached_item = detach_item_from_array(parent, index);
    }
    else if (cJSON_IsObject(parent))
    {
        detached_item = cJSON_DetachItemFromObject(parent, (char*)child_pointer);
    }
    else
    {
        /* Couldn't find object to remove child from. */
        goto cleanup;
    }

cleanup:
    if (parent_pointer != NULL)
    {
        cJSON_free(parent_pointer);
    }

    return detached_item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8020
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x9dcc
jmp 0x9e7e
movq -0x20(%rbp), %rdi
movl $0x2f, %esi
callq 0x22b0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x9dea
jmp 0x9e7e
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x14(%rbp), %edx
callq 0x81d0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x9ea0
movq -0x30(%rbp), %rdi
callq 0x5dc0
cmpl $0x0, %eax
je 0x9e57
movq $0x0, -0x40(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x95f0
cmpl $0x0, %eax
jne 0x9e44
jmp 0x9e7e
movq -0x30(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xa110
movq %rax, -0x38(%rbp)
jmp 0x9e7c
movq -0x30(%rbp), %rdi
callq 0x5e00
cmpl $0x0, %eax
je 0x9e78
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x4db0
movq %rax, -0x38(%rbp)
jmp 0x9e7a
jmp 0x9e7e
jmp 0x9e7c
jmp 0x9e7e
cmpq $0x0, -0x20(%rbp)
je 0x9e8e
movq -0x20(%rbp), %rdi
callq 0x6220
movq -0x38(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: decode_pointer_inplace(unsigned char*)
static void decode_pointer_inplace(unsigned char *string)
{
    unsigned char *decoded_string = string;

    if (string == NULL) {
        return;
    }

    for (; *string; (void)decoded_string++, string++)
    {
        if (string[0] == '~')
        {
            if (string[1] == '0')
            {
                decoded_string[0] = '~';
            }
            else if (string[1] == '1')
            {
                decoded_string[1] = '/';
            }
            else
            {
                /* invalid escape sequence */
                return;
            }

            string++;
        }
    }

    decoded_string[0] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x9eb9
jmp 0x9f30
jmp 0x9ebb
movq -0x8(%rbp), %rax
cmpb $0x0, (%rax)
je 0x9f29
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x7e, %eax
jne 0x9f0d
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x30, %eax
jne 0x9ee6
movq -0x10(%rbp), %rax
movb $0x7e, (%rax)
jmp 0x9f01
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0x31, %eax
jne 0x9efd
movq -0x10(%rbp), %rax
movb $0x2f, 0x1(%rax)
jmp 0x9eff
jmp 0x9f30
jmp 0x9f01
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x9f0f
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x9ebb
movq -0x10(%rbp), %rax
movb $0x0, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: insert_item_in_array(cJSON*, unsigned long, cJSON*)
static cJSON_bool insert_item_in_array(cJSON *array, size_t which, cJSON *newitem)
{
    cJSON *child = array->child;
    while (child && (which > 0))
    {
        child = child->next;
        which--;
    }
    if (which > 0)
    {
        /* item is after the end of the array */
        return 0;
    }
    if (child == NULL)
    {
        cJSON_AddItemToArray(array, newitem);
        return 1;
    }

    /* insert into the linked list */
    newitem->next = child;
    newitem->prev = child->prev;
    child->prev = newitem;

    /* was it at the beginning */
    if (child == array->child)
    {
        array->child = newitem;
    }
    else
    {
        newitem->prev->next = newitem;
    }

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x28(%rbp)
movb %al, -0x29(%rbp)
je 0x9f77
cmpq $0x0, -0x18(%rbp)
seta %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x9f80
jmp 0x9f99
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x9f60
cmpq $0x0, -0x18(%rbp)
jbe 0x9fa9
movl $0x0, -0x4(%rbp)
jmp 0xa01f
cmpq $0x0, -0x28(%rbp)
jne 0x9fc6
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4220
movl $0x1, -0x4(%rbp)
jmp 0xa01f
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xa009
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xa018
movq -0x20(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: compare_strings(unsigned char const*, unsigned char const*, int)
static int compare_strings(const unsigned char *string1, const unsigned char *string2, const cJSON_bool case_sensitive)
{
    if ((string1 == NULL) || (string2 == NULL))
    {
        return 1;
    }

    if (string1 == string2)
    {
        return 0;
    }

    if (case_sensitive)
    {
        return strcmp((const char*)string1, (const char*)string2);
    }

    for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++)
    {
        if (*string1 == '\0')
        {
            return 0;
        }
    }

    return tolower(*string1) - tolower(*string2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xa051
cmpq $0x0, -0x18(%rbp)
jne 0xa05d
movl $0x1, -0x4(%rbp)
jmp 0xa107
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0xa073
movl $0x0, -0x4(%rbp)
jmp 0xa107
cmpl $0x0, -0x1c(%rbp)
je 0xa08b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x2250
movl %eax, -0x4(%rbp)
jmp 0xa107
jmp 0xa08d
movq -0x10(%rbp), %rax
movzbl (%rax), %edi
callq 0x2280
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %edi
callq 0x2280
movl %eax, %ecx
movl -0x20(%rbp), %eax
cmpl %ecx, %eax
jne 0xa0e2
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xa0c6
movl $0x0, -0x4(%rbp)
jmp 0xa107
jmp 0xa0c8
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xa08d
movq -0x10(%rbp), %rax
movzbl (%rax), %edi
callq 0x2280
movl %eax, -0x24(%rbp)
movq -0x18(%rbp), %rax
movzbl (%rax), %edi
callq 0x2280
movl %eax, %ecx
movl -0x24(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/third_party/cjson/cJSON_Utils.c
// Function: detach_item_from_array(cJSON*, unsigned long)
static cJSON *detach_item_from_array(cJSON *array, size_t which)
{
    cJSON *c = array->child;
    while (c && (which > 0))
    {
        c = c->next;
        which--;
    }
    if (!c)
    {
        /* item doesn't exist */
        return NULL;
    }
    if (c->prev)
    {
        /* not the first element */
        c->prev->next = c->next;
    }
    if (c->next)
    {
        c->next->prev = c->prev;
    }
    if (c==array->child)
    {
        array->child = c->next;
    }
    /* make sure the detached item doesn't point anywhere anymore */
    c->prev = c->next = NULL;

    return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x20(%rbp)
movb %al, -0x21(%rbp)
je 0xa13f
cmpq $0x0, -0x18(%rbp)
seta %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xa148
jmp 0xa161
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xa128
cmpq $0x0, -0x20(%rbp)
jne 0xa172
movq $0x0, -0x8(%rbp)
jmp 0xa1e8
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xa18f
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0xa1ac
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xa1c9
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/riyuu/argv_parser.c
// Function: argv_parser(int, char**, char**, _riyuu_run*, unsigned char*)
bool argv_parser(int argc, char *argv[], char *envp[], riyuu_run *run, uint8_t *exit_code)
{
	int i;
	size_t len;
	run->command = no_command;
	run->config_file = NULL;

	for (i = 1; i < argc; i++) {

		len = strlen(argv[i]);

		if (len < 1) {
			printf("argv has been corrupted!\n");
			*exit_code = 1;
			return false;
		}

		if (argv[i][0] == '-') {
			if (len == 1) {
				printf(invalid_parameter, argv[i], i);
				*exit_code = 1;
				return false;
			}

			if (len == 2) {
				switch (argv[i][1]) {
					case 'v':
						show_version();
						return false;
					break;
				}
			}

		} else {
			COMMAND("server", run_server) else 
			COMMAND("connect", run_client) else {
				printf(invalid_command, argv[i], i);
			}
		}
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xa647
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2160
movq %rax, -0x38(%rbp)
cmpq $0x1, -0x38(%rbp)
jae 0xa54e
leaq 0x1eb3(%rip), %rdi      # 0xc3ea
movb $0x0, %al
callq 0x2030
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0xa64b
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xa5c4
cmpq $0x1, -0x38(%rbp)
jne 0xa596
movq 0x5c68(%rip), %rdi      # 0x101d8
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x2c(%rbp), %edx
movb $0x0, %al
callq 0x2030
movq -0x28(%rbp), %rax
movb $0x1, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0xa64b
cmpq $0x2, -0x38(%rbp)
jne 0xa5c2
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movb 0x1(%rax), %al
subb $0x76, %al
jne 0xa5c0
jmp 0xa5b2
callq 0xa4b0
movb $0x0, -0x1(%rbp)
jmp 0xa64b
jmp 0xa5c2
jmp 0xa637
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1e2d(%rip), %rdi      # 0xc404
callq 0x2250
cmpl $0x0, %eax
jne 0xa5ed
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
jmp 0xa635
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1e0b(%rip), %rdi      # 0xc40b
callq 0x2250
cmpl $0x0, %eax
jne 0xa616
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
jmp 0xa633
movq 0x5bc3(%rip), %rdi      # 0x101e0
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl -0x2c(%rbp), %edx
movb $0x0, %al
callq 0x2030
jmp 0xa635
jmp 0xa637
jmp 0xa639
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa508
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/ammarfaizi2[P]riyuu/src/riyuu/riyuu.c
// Function: riyuu_exec_run(_riyuu_run*)
uint8_t riyuu_exec_run(riyuu_run *run)
{
	switch (run->command) {
		case no_command:
		break;

		case run_server: {
			riyuu_server_config config;
			if (riyuu_server_config_parse(run, &config)) {
				return riyuu_server_run(&config);
			}
		}
		break;

		case run_client:
			riyuu_client_run();
		break;
	}

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
testl %eax, %eax
je 0xa68f
jmp 0xa67b
movl -0x24(%rbp), %eax
subl $0x1, %eax
je 0xa691
jmp 0xa685
movl -0x24(%rbp), %eax
subl $0x2, %eax
je 0xa6b4
jmp 0xa6b9
jmp 0xa6b9
movq -0x10(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xa8c0
testb $0x1, %al
jne 0xa6a4
jmp 0xa6b2
leaq -0x20(%rbp), %rdi
callq 0xade0
movb %al, -0x1(%rbp)
jmp 0xa6bd
jmp 0xa6b9
callq 0xa6d0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)