LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/theandrew168[P]skylark/src/op.c
// Function: operation_DRW_Dxyn
static int
operation_DRW_Dxyn(struct chip8* chip8, const struct instruction* inst)
{
    chip8->reg[CHIP8_REG_VF] = 0;
    for (long dy = 0; dy < inst->n; dy++) {
        uint8_t sprite = chip8->mem[chip8->index + dy];
        for (long dx = 0; dx < CHIP8_SPRITE_WIDTH; dx++) {
            // account for pixels wrapping around edges of the display
            long x = (chip8->reg[inst->x] + dx) % CHIP8_DISPLAY_WIDTH;
            long y = (chip8->reg[inst->y] + dy) % CHIP8_DISPLAY_HEIGHT;

            // chip8->display is stored as a row-major matrix
            long pixel_index = (y * CHIP8_DISPLAY_WIDTH) + x;

            // determine what the resulting pixel value will be
            bool new_pixel = sprite & (0x80 >> dx);
            bool old_pixel = chip8->display[pixel_index];
            bool resulting_pixel = new_pixel ^ old_pixel;

            // set VF register to 1 if a pixel gets turned off
            if (old_pixel && !resulting_pixel) chip8->reg[CHIP8_REG_VF] = 1;

            chip8->display[pixel_index] = resulting_pixel;
        }
    }
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x100f(%rax)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
cmpq %rcx, %rax
jge 0x376c
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x1010(%rcx), %ecx
addq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movq $0x0, -0x28(%rbp)
cmpq $0x8, -0x28(%rbp)
jge 0x3759
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movzbl 0x1000(%rax,%rcx), %eax
addq -0x28(%rbp), %rax
movl $0x40, %ecx
cqto
idivq %rcx
movq %rdx, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x8(%rcx), %ecx
movzbl 0x1000(%rax,%rcx), %eax
addq -0x18(%rbp), %rax
movl $0x20, %ecx
cqto
idivq %rcx
movq %rdx, -0x38(%rbp)
movq -0x38(%rbp), %rax
shlq $0x6, %rax
addq -0x30(%rbp), %rax
movq %rax, -0x40(%rbp)
movzbl -0x19(%rbp), %eax
movq -0x28(%rbp), %rcx
movl $0x80, %edx
sarl %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x41(%rbp)
movq -0x8(%rbp), %rax
movq -0x40(%rbp), %rcx
movb 0x1046(%rax,%rcx), %al
andb $0x1, %al
movb %al, -0x42(%rbp)
movb -0x41(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb -0x42(%rbp), %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x43(%rbp)
testb $0x1, -0x42(%rbp)
je 0x3733
testb $0x1, -0x43(%rbp)
jne 0x3733
movq -0x8(%rbp), %rax
movb $0x1, 0x100f(%rax)
movb -0x43(%rbp), %dl
movq -0x8(%rbp), %rax
movq -0x40(%rbp), %rcx
andb $0x1, %dl
movb %dl, 0x1046(%rax,%rcx)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x3665
jmp 0x375b
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x362f
movq -0x8(%rbp), %rax
movzwl 0x1012(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x1012(%rax)
xorl %eax, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx0A
static int
operation_LD_Fx0A(struct chip8* chip8, const struct instruction* inst)
{
    for (long i = 0; i < CHIP8_INPUT_SIZE; i++) {
        if (chip8->input[i]) {
            chip8->reg[inst->x] = i;
            chip8->pc += 2;
            break;
        }
    }
    // no "pc += 2" here means that this instruction
    // will loop until an input key is pressed
    return OPERATION_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x10, -0x18(%rbp)
jge 0x390d
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
testb $0x1, 0x1036(%rax,%rcx)
je 0x38fd
movq -0x18(%rbp), %rax
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movb %dl, 0x1000(%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1012(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x1012(%rax)
jmp 0x390d
jmp 0x38ff
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x38b4
xorl %eax, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx33
static int
operation_LD_Fx33(struct chip8* chip8, const struct instruction* inst)
{
    chip8->mem[chip8->index + 0] = (chip8->reg[inst->x] / 100);
    chip8->mem[chip8->index + 1] = (chip8->reg[inst->x] / 10)  % 10;
    chip8->mem[chip8->index + 2] = (chip8->reg[inst->x] / 100) % 10;
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movzbl 0x1000(%rax,%rcx), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb %al, %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x1010(%rcx), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movzbl 0x1000(%rax,%rcx), %eax
movl $0xa, %ecx
cltd
idivl %ecx
movl $0xa, %ecx
cltd
idivl %ecx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x1010(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
movzbl 0x1000(%rax,%rcx), %eax
movl $0x64, %ecx
cltd
idivl %ecx
movl $0xa, %ecx
cltd
idivl %ecx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x1010(%rcx), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movq -0x8(%rbp), %rax
movzwl 0x1012(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x1012(%rax)
xorl %eax, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx55
static int
operation_LD_Fx55(struct chip8* chip8, const struct instruction* inst)
{
    for (long i = 0; i < inst->x; i++) {
        chip8->mem[chip8->index + i] = chip8->reg[i];
    }
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
cmpq %rcx, %rax
jge 0x3b98
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb 0x1000(%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x1010(%rcx), %ecx
addq -0x18(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3b54
movq -0x8(%rbp), %rax
movzwl 0x1012(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x1012(%rax)
xorl %eax, %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/theandrew168[P]skylark/src/op.c
// Function: operation_LD_Fx65
static int
operation_LD_Fx65(struct chip8* chip8, const struct instruction* inst)
{
    for (long i = 0; i < inst->x; i++) {
        chip8->reg[i] = chip8->mem[chip8->index + i];
    }
    chip8->pc += 2;
    return OPERATION_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
cmpq %rcx, %rax
jge 0x3c18
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x1010(%rcx), %ecx
addq -0x18(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movb %dl, 0x1000(%rax,%rcx)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3bd4
movq -0x8(%rbp), %rax
movzwl 0x1012(%rax), %ecx
addl $0x2, %ecx
movw %cx, 0x1012(%rax)
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/albinoloverats[P]hide/src/tiff.c
// Function: init
extern image_type_t *init(void)
{
	static image_type_t tiff;
	tiff.type = "TIFF";
	tiff.is_type = is_tiff;
	tiff.read = read_tiff;
	tiff.write = write_tiff;
	tiff.info = info_tiff;
	tiff.free = free_tiff;
	return &tiff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0xe35(%rip), %rax       # 0x2000
movq %rax, 0x2eb6(%rip)      # 0x4088
leaq 0x57(%rip), %rax        # 0x1230
movq %rax, 0x2eb0(%rip)      # 0x4090
leaq 0xa9(%rip), %rax        # 0x1290
movq %rax, 0x2eaa(%rip)      # 0x4098
leaq 0x1fb(%rip), %rax       # 0x13f0
movq %rax, 0x2ea4(%rip)      # 0x40a0
leaq 0x3dd(%rip), %rax       # 0x15e0
movq %rax, 0x2e9e(%rip)      # 0x40a8
leaq 0x40f(%rip), %rax       # 0x1620
movq %rax, 0x2e98(%rip)      # 0x40b0
leaq 0x2e69(%rip), %rax      # 0x4088
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/albinoloverats[P]hide/src/tiff.c
// Function: is_tiff
static bool is_tiff(char *file_name)
{
	TIFFSetErrorHandler(NULL);
	TIFFSetWarningHandler(NULL);

	TIFF *tif = TIFFOpen(file_name, "r");
	if (!tif)
		return false;
	TIFFClose(tif);
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
xorl %eax, %eax
movl %eax, %edi
callq 0x10e0
xorl %eax, %eax
movl %eax, %edi
callq 0x1090
movq -0x10(%rbp), %rdi
leaq 0xdac(%rip), %rsi       # 0x2005
callq 0x1050
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x126f
movb $0x0, -0x1(%rbp)
jmp 0x127c
movq -0x18(%rbp), %rdi
callq 0x10d0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/albinoloverats[P]hide/src/tiff.c
// Function: read_tiff
static int read_tiff(image_info_t *image_info, void (*progress_update)(uint64_t, uint64_t))
{
	errno = EXIT_SUCCESS;

	TIFF *tif = TIFFOpen(image_info->file, "r");
	if (!tif)
		return errno;

	TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &image_info->width);
	TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &image_info->height);
	TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &image_info->bpp);

	image_info->buffer = malloc(sizeof (uint8_t *) * image_info->height);
	for (uint64_t y = 0; y < image_info->height; y++)
	{
		image_info->buffer[y] = malloc(image_info->width * image_info->bpp);
		TIFFReadScanline(tif, image_info->buffer[y], y, 0);
		if (progress_update)
			progress_update(y, image_info->height);
	}

	TIFFClose(tif);

	return errno;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
callq 0x1040
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xd4c(%rip), %rsi       # 0x2005
callq 0x1050
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x12d8
callq 0x1040
movl (%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x13de
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x30, %rdx
movl $0x100, %esi            # imm = 0x100
movb $0x0, %al
callq 0x1070
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x28, %rdx
movl $0x101, %esi            # imm = 0x101
movb $0x0, %al
callq 0x1070
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x38, %rdx
movl $0x115, %esi            # imm = 0x115
movb $0x0, %al
callq 0x1070
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
shlq $0x3, %rdi
callq 0x10a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x40(%rax)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0x13cb
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movzwl 0x38(%rax), %eax
imulq %rax, %rdi
callq 0x10a0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movq -0x28(%rbp), %rax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x10b0
cmpq $0x0, -0x18(%rbp)
je 0x13b8
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rcx
movq 0x28(%rcx), %rsi
callq *%rax
jmp 0x13ba
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1344
movq -0x20(%rbp), %rdi
callq 0x10d0
callq 0x1040
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_log_init
bool ce_log_init(const char* filename){
     g_ce_log = fopen(filename, "wa");
     if(!g_ce_log){
          fprintf(stderr, "error: unable to create ce log: fopen(\"%s\", \"wa\") failed: '%s'\n", filename, strerror(errno));
          return false;
     }

     static const char* greetings [] = {
          "Thank you for flying ce",
          "There's nothing like a fresh cup of ce in the morning",
          "Why do kids love the taste of C Editor?\n\nIt's the taste you can ce",
          "ce is for C Editor, that's good enough for me",
          "I missed you.",
          "Hope you're having a great day! -ce",
          "You're a special person -- or robot. I don't judge.",
          "I missed you... in a creepy way.",
          "I'm a potato",
          "At least this isn't emacs? Am I right!",
          "TACOCAT is the best palindrome",
          "Found a bug? It's a feature.",
          "Yo.",
          "Slurp'n up whitespace since 2016",
          "Welcome to GNU Emacs, one component of the GNU/Linux operating system.",
          "ce, the world's only editor with a Michelin star.",
          "Oy! ce's a beaut!",
          "The default config has a great vimplementation!",
          "They see me slurpin' They hatin'",
          "'Days of pain are worth the years of upcoming prosperity' -confucius, probably",
          "ce, aka, 'the cache miss king'",
          "All the terminal you want with none of the illness",
          "I used ce before it was cool",
          "'Where has this been all my life' -emacs enthusiast",
     };

     srand(time(NULL));
     ce_log("%s\n", greetings[rand() % (sizeof(greetings) / sizeof(greetings[0]))]);
     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x34859(%rip), %rsi     # 0x420a0
callq 0xd590
movq %rax, 0x4134d(%rip)     # 0x4eba0
cmpq $0x0, 0x41345(%rip)     # 0x4eba0
jne 0xd89e
movq 0x40794(%rip), %rax     # 0x4dff8
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0xd0a0
movl (%rax), %edi
callq 0xd630
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq %rax, %rcx
leaq 0x34812(%rip), %rsi     # 0x420a3
movb $0x0, %al
callq 0xd3a0
movb $0x0, -0x1(%rbp)
jmp 0xd8dc
xorl %eax, %eax
movl %eax, %edi
callq 0xd430
movl %eax, %edi
callq 0xd350
callq 0xd6f0
cltq
movl $0x18, %ecx
xorl %edx, %edx
divq %rcx
leaq 0x40aea(%rip), %rax     # 0x4e3b0
movq (%rax,%rdx,8), %rsi
leaq 0x382f4(%rip), %rdi     # 0x45bc5
movb $0x0, %al
callq 0xd8f0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_log
void ce_log(const char* fmt, ...){
     va_list args;
     va_start(args, fmt);
     size_t string_len = vsnprintf(g_log_string, BUFSIZ, fmt, args);
     va_end(args);

#if defined(PLATFORM_WINDOWS)
     printf("%s", g_log_string);
#else
     fwrite(g_log_string, string_len, 1, g_ce_log);
#endif
     CePoint_t end = ce_buffer_end_point(g_ce_log_buffer);
     g_ce_log_buffer->status = CE_BUFFER_STATUS_NONE;
     ce_buffer_insert_string(g_ce_log_buffer, g_log_string, end);
     g_ce_log_buffer->status = CE_BUFFER_STATUS_READONLY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
testb %al, %al
je 0xd92b
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rsi, -0xe8(%rbp)
movq %rdi, -0x8(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movl $0x30, -0x1c(%rbp)
movl $0x8, -0x20(%rbp)
movq -0x8(%rbp), %rdx
leaq 0x41232(%rip), %rdi     # 0x4ebb0
movq %rdi, -0xf8(%rbp)
movl $0x2000, %esi           # imm = 0x2000
leaq -0x20(%rbp), %rcx
callq 0xd170
movq -0xf8(%rbp), %rdi
cltq
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rsi
movq 0x411f5(%rip), %rcx     # 0x4eba0
movl $0x1, %edx
callq 0xd5f0
movq 0x411ec(%rip), %rdi     # 0x4eba8
callq 0xda10
movq -0xf8(%rbp), %rsi
movq %rax, -0x38(%rbp)
movq %rdx, -0x30(%rbp)
movq 0x411d1(%rip), %rax     # 0x4eba8
movl $0x0, 0x18(%rax)
movq 0x411c3(%rip), %rdi     # 0x4eba8
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0xda70
movq 0x411af(%rip), %rax     # 0x4eba8
movl $0x2, 0x18(%rax)
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_end_point
CePoint_t ce_buffer_end_point(CeBuffer_t* buffer){
     CePoint_t point = {0, buffer->line_count};
     if(point.y > 0){
          point.y--;
          point.x = ce_utf8_last_index(buffer->lines[point.y]);
     }
     return point;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jle 0xda5b
movq -0x8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xf1f0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_alloc
bool ce_buffer_alloc(CeBuffer_t* buffer, int64_t line_count, const char* name){
     if(buffer->lines) ce_buffer_free(buffer);

     if(line_count <= 0){
          ce_log("%s() error: 0 line_count specified.\n", __FUNCTION__);
          return false;
     }

     buffer->lines = (char**)malloc(line_count * sizeof(*buffer->lines));
     if(!buffer->lines){
          ce_log("%s() failed to malloc() %ld lines.\n", __FUNCTION__, line_count);
          return false;
     }

     buffer->line_count = line_count;
     buffer->name = strdup(name);

     for(int64_t i = 0; i < line_count; i++){
          buffer->lines[i] = (char*)calloc(1, sizeof(buffer->lines[i]));
     }

     buffer->status = CE_BUFFER_STATUS_MODIFIED;
     return true;
}

// 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
cmpq $0x0, (%rax)
je 0xe077
movq -0x10(%rbp), %rdi
callq 0xe160
cmpq $0x0, -0x18(%rbp)
jg 0xe09c
leaq 0x34407(%rip), %rdi     # 0x4248c
leaq 0x34425(%rip), %rsi     # 0x424b1
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0xe14c
movq -0x18(%rbp), %rdi
shlq $0x3, %rdi
callq 0xd4a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xe0dc
movq -0x18(%rbp), %rdx
leaq 0x343f9(%rip), %rdi     # 0x424c1
leaq 0x343e2(%rip), %rsi     # 0x424b1
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0xe14c
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rbp), %rdi
callq 0xd620
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0xe13d
movl $0x1, %edi
movl $0x8, %esi
callq 0xd360
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xe104
movq -0x10(%rbp), %rax
movl $0x1, 0x18(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_free
void ce_buffer_free(CeBuffer_t* buffer){
     for(int64_t i = 0; i < buffer->line_count; i++){
          free(buffer->lines[i]);
     }

     free(buffer->lines);
     free(buffer->name);

     if(buffer->change_node){
          CeBufferChangeNode_t* head = buffer->change_node;
          while(head->prev) head = head->prev;
          ce_buffer_change_node_free(&head);
     }

     memset(buffer, 0, sizeof(*buffer));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xe1a4
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd090
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xe174
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0xd090
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xd090
movq -0x8(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0xe1f6
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xe1ed
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xe1d4
leaq -0x18(%rbp), %rdi
callq 0xe210
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x70, %edx
callq 0xd290
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_change_node_free
static void ce_buffer_change_node_free(CeBufferChangeNode_t** head){
     CeBufferChangeNode_t* itr = *head;
     while(itr){
          CeBufferChangeNode_t* tmp = itr;
          itr = itr->next;
          free(tmp->change.string);
          free(tmp);
     }

     *head = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0xe25a
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xd090
movq -0x18(%rbp), %rdi
callq 0xd090
jmp 0xe227
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_util_count_string_lines
int64_t ce_util_count_string_lines(const char* string){
     int64_t string_length = strlen(string);
     int64_t line_count = 0;
     for(int64_t i = 0; i <= string_length; ++i){
          if(string[i] == CE_NEWLINE || string[i] == 0) line_count++;
     }

     return line_count;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd200
movq %rax, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jg 0xe731
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0xa, %eax
je 0xe715
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xe721
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xe723
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xe6e9
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: find_next_newline
static FindNewlineResult_t find_next_newline(const char* str){
     int64_t rune_len = 0;
     FindNewlineResult_t status = {};
     while(*str){
          CeRune_t rune = ce_utf8_decode(str, &rune_len);
          if(rune == CE_NEWLINE){
               status.str = str;
               status.status = FNS_OK;
               return status;
          }else if(rune == CE_UTF8_INVALID){
               status.status = FNS_INVALID;
               return status;
          }
          str += rune_len;
     }

     status.status = FNS_EOF;
     return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0xe7b3
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xedc0
movl %eax, -0x24(%rbp)
cmpl $0xa, -0x24(%rbp)
jne 0xe794
movq -0x18(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
jmp 0xe7ba
cmpl $-0x1, -0x24(%rbp)
jne 0xe7a3
movl $0x2, -0x8(%rbp)
jmp 0xe7ba
jmp 0xe7a5
movq -0x20(%rbp), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xe764
movl $0x1, -0x8(%rbp)
movq -0x10(%rbp), %rax
movl -0x8(%rbp), %edx
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_save
bool ce_buffer_save(CeBuffer_t* buffer){
     FILE* file = fopen(buffer->name, "wb");
     if(!file){
          ce_log("%s() fopen('%s', 'wb') failed: '%s'\n", __FUNCTION__, buffer->name, strerror(errno));
          return false;
     }

     char newline = CE_NEWLINE;
     for(int64_t i = 0; i < buffer->line_count; ++i){
          int64_t line_len = strlen(buffer->lines[i]);
          fwrite(buffer->lines[i], 1, line_len, file);
          fwrite(&newline, 1, 1, file);
     }

     fclose(file);
     if(buffer->status == CE_BUFFER_STATUS_MODIFIED) buffer->status = CE_BUFFER_STATUS_NONE;
     buffer->save_at_change_node = buffer->change_node;

     struct stat statbuf;
     if(stat(buffer->name, &statbuf) == 0){
          buffer->file_modified_time = statbuf.st_mtime;
     }

     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x33dc6(%rip), %rsi     # 0x425b4
callq 0xd590
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xe841
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0xc8(%rbp)
callq 0xd0a0
movl (%rax), %edi
callq 0xd630
movq -0xc8(%rbp), %rdx
movq %rax, %rcx
leaq 0x33d8d(%rip), %rdi     # 0x425b7
leaq 0x33dab(%rip), %rsi     # 0x425dc
movb $0x0, %al
callq 0xd8f0
movb $0x0, -0x1(%rbp)
jmp 0xe90e
movb $0xa, -0x19(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xe8b7
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd200
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x30(%rbp), %rdx
movq -0x18(%rbp), %rcx
movl $0x1, %esi
callq 0xd5f0
movq -0x18(%rbp), %rcx
leaq -0x19(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0xd5f0
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xe84d
movq -0x18(%rbp), %rdi
callq 0xd1e0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jne 0xe8d5
movq -0x10(%rbp), %rax
movl $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xd3d0
cmpl $0x0, %eax
jne 0xe90a
movq -0x68(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_empty
bool ce_buffer_empty(CeBuffer_t* buffer){
     if(buffer->lines == NULL) return false;

     // free all lines after the first
     for(int64_t i = 0; i < buffer->line_count; ++i){
          free(buffer->lines[i]);
     }

     // re allocate it down to a single blank line
     buffer->lines = realloc(buffer->lines, sizeof(*buffer->lines));
     buffer->lines[0] = malloc(sizeof(buffer->lines[0]));
     buffer->lines[0][0] = 0;
     buffer->line_count = 1;
     buffer->status = CE_BUFFER_STATUS_NONE;

     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xe93f
movb $0x0, -0x1(%rbp)
jmp 0xe9d1
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xe977
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xd090
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xe947
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl $0x8, %esi
callq 0xd500
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x8, %edi
callq 0xd4a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x1, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x18(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_contains_point
bool ce_buffer_contains_point(CeBuffer_t* buffer, CePoint_t point){
     if(point.y < 0 || point.y >= buffer->line_count || point.x < 0) return false;
     int64_t line_len = ce_utf8_strlen(buffer->lines[point.y]);
     if(point.x >= line_len){
          if(line_len == 0 && point.x == 0){
               return true;
          }
          return false;
     }

     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jl 0xea10
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xea10
cmpq $0x0, -0x18(%rbp)
jge 0xea16
movb $0x0, -0x1(%rbp)
jmp 0xea56
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jl 0xea52
cmpq $0x0, -0x28(%rbp)
jne 0xea4c
cmpq $0x0, -0x18(%rbp)
jne 0xea4c
movb $0x1, -0x1(%rbp)
jmp 0xea56
movb $0x0, -0x1(%rbp)
jmp 0xea56
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_utf8_strlen
int64_t ce_utf8_strlen(const char* string){
     int64_t len = 0;
     int64_t byte_count = 0;

     while(*string){
          if((*string & 0x80) == 0){
               byte_count = 1;
          }else if((*string & 0xE0) == 0xC0){
               byte_count = 2;
          }else if((*string & 0xF0) == 0xE0){
               byte_count = 3;
          }else if((*string & 0xF8) == 0xF0){
               byte_count = 4;
          }else{
               assert(!"unicode character claiming it has more than 4 bytes?!");
               return -1;
          }

          // validate string doesn't early terminate
          for(int64_t i = 0; i < byte_count; i++){
               if(*string == 0) return -1;
               string++;
          }

          len++;
     }

     return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0xeb83
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0xeab4
movq $0x1, -0x20(%rbp)
jmp 0xeb30
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xe0, %eax
cmpl $0xc0, %eax
jne 0xead1
movq $0x2, -0x20(%rbp)
jmp 0xeb2e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
jne 0xeaee
movq $0x3, -0x20(%rbp)
jmp 0xeb2c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xf8, %eax
cmpl $0xf0, %eax
jne 0xeb0b
movq $0x4, -0x20(%rbp)
jmp 0xeb2a
leaq 0x33baf(%rip), %rdi     # 0x426c1
leaq 0x33afb(%rip), %rsi     # 0x42614
movl $0x531, %edx            # imm = 0x531
leaq 0x33bd5(%rip), %rcx     # 0x426fa
callq 0xd270
jmp 0xeb2c
jmp 0xeb2e
jmp 0xeb30
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xeb72
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xeb58
movq $-0x1, -0x8(%rbp)
jmp 0xeb8b
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xeb38
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xea8c
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_point_is_valid
int64_t ce_buffer_point_is_valid(CeBuffer_t* buffer, CePoint_t point){
     if(point.y < 0 || point.y >= buffer->line_count || point.x < 0) return false;
     int64_t line_len = ce_utf8_strlen(buffer->lines[point.y]);
     if(point.x > line_len) return false;

     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jl 0xebd0
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xebd0
cmpq $0x0, -0x18(%rbp)
jge 0xebda
movq $0x0, -0x8(%rbp)
jmp 0xec0e
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x28(%rbp), %rax
jle 0xec06
movq $0x0, -0x8(%rbp)
jmp 0xec0e
movq $0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_get_rune
CeRune_t ce_buffer_get_rune(CeBuffer_t* buffer, CePoint_t point){
     if(!ce_buffer_point_is_valid(buffer, point)) return CE_UTF8_INVALID;

     char* str = ce_utf8_iterate_to(buffer->lines[point.y], point.x);
     int64_t rune_len = 0;
     return ce_utf8_decode(str, &rune_len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rdi, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xeba0
cmpq $0x0, %rax
jne 0xec54
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xec88
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0xeca0
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0xedc0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_utf8_iterate_to
char* ce_utf8_iterate_to(char* string, int64_t index){
     int64_t bytes = 0;
     while(index){
          if((*string & 0x80) == 0){
               bytes = 1;
          }else if((*string & 0xE0) == 0xC0){
               bytes = 2;
          }else if((*string & 0xF0) == 0xE0){
               bytes = 3;
          }else if((*string & 0xF8) == 0xF0){
               bytes = 4;
          }else{
               assert(!"unicode character claiming it has more than 4 bytes?!");
               return NULL;
          }

          for(int64_t i = 0; i < bytes; ++i){
               if(*string == 0){
                    return NULL;
               }
               string++;
          }

          index--;
     }

     return string;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xedad
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0xecde
movq $0x1, -0x20(%rbp)
jmp 0xed5a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xe0, %eax
cmpl $0xc0, %eax
jne 0xecfb
movq $0x2, -0x20(%rbp)
jmp 0xed58
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xf0, %eax
cmpl $0xe0, %eax
jne 0xed18
movq $0x3, -0x20(%rbp)
jmp 0xed56
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
andl $0xf8, %eax
cmpl $0xf0, %eax
jne 0xed35
movq $0x4, -0x20(%rbp)
jmp 0xed54
leaq 0x33985(%rip), %rdi     # 0x426c1
leaq 0x338d1(%rip), %rsi     # 0x42614
movl $0x572, %edx            # imm = 0x572
leaq 0x33a0b(%rip), %rcx     # 0x4275a
callq 0xd270
jmp 0xed56
jmp 0xed58
jmp 0xed5a
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xed9c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xed82
movq $0x0, -0x8(%rbp)
jmp 0xedb5
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0xed62
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0xecb8
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_search_forward
CePoint_t ce_buffer_search_forward(CeBuffer_t* buffer, CePoint_t start, const char* pattern){
     CePoint_t result = (CePoint_t){-1, -1};

     if(!ce_buffer_point_is_valid(buffer, start)) return result;

     int64_t save_y = start.y;
     char* itr = ce_utf8_iterate_to(buffer->lines[start.y], start.x);
     char* match = NULL;

     // try to match the pattern on each line to the end
     while(true){
          match = strstr(itr, pattern);
          if(match) break;
          start.y++;
          if(start.y >= buffer->line_count) break;
          itr = buffer->lines[start.y];
     }

     if(match){
          // figure out index in the line
          int64_t index = 0;
          int64_t rune_len = 0;
          while(match > itr){
               ce_utf8_decode(itr, &rune_len);
               itr += rune_len;
               index++;
          }

          if(start.y == save_y){
               // if we are on the same line, use the starting x plus the index
               result.x = start.x + index;
          }else{
               result.x = index;
          }
          result.y = start.y;
     }

     return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rsi, -0x20(%rbp)
movq %rdx, -0x18(%rbp)
movq %rdi, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq 0x338b9(%rip), %rax     # 0x42808
movq %rax, -0x10(%rbp)
movq 0x338b6(%rip), %rax     # 0x42810
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xeba0
cmpq $0x0, %rax
jne 0xef7a
jmp 0xf063
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x20(%rbp), %rsi
callq 0xeca0
movq %rax, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xd6d0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0xefc0
jmp 0xeff1
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0xefdc
jmp 0xeff1
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
jmp 0xefa6
cmpq $0x0, -0x48(%rbp)
je 0xf061
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jbe 0xf039
movq -0x40(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xedc0
movq -0x58(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xf008
movq -0x18(%rbp), %rax
cmpq -0x38(%rbp), %rax
jne 0xf051
movq -0x20(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0xf059
movq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xf063
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_regex_search_forward
CeRegexSearchResult_t ce_buffer_regex_search_forward(CeBuffer_t* buffer, CePoint_t start, CeRegex_t regex){
     CeRegexSearchResult_t result = {(CePoint_t){-1, -1}, -1};

     if(!ce_buffer_point_is_valid(buffer, start)) return result;

     while(start.y < buffer->line_count){
          CeRegexResult_t regex_result = ce_regex_match(regex,
                                                        buffer->lines[start.y] + start.x);
          if(regex_result.error_message != NULL){
               ce_log("ce_regex_match() failed: %s", regex_result.error_message);
               free(regex_result.error_message);
               break;
          }
          if(regex_result.match_start != CE_REGEX_NO_MATCH){
               result.point = start;
               result.point.x += regex_result.match_start;
               result.length = regex_result.match_length;
               break;
          }
          start.y++;
          start.x = 0;
     }

     return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x48(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x8(%rbp)
movq %rsi, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq 0x32e16(%rip), %rax     # 0x42070
movq %rax, (%rdi)
movq 0x32e14(%rip), %rax     # 0x42078
movq %rax, 0x8(%rdi)
movq 0x32e11(%rip), %rax     # 0x42080
movq %rax, 0x10(%rdi)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
callq 0xeba0
cmpq $0x0, %rax
jne 0xf28f
jmp 0xf330
jmp 0xf291
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0xf32e
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
addq -0x10(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x2aa10
cmpq $0x0, -0x38(%rbp)
je 0xf2e7
movq -0x38(%rbp), %rsi
leaq 0x33316(%rip), %rdi     # 0x425eb
movb $0x0, %al
callq 0xd8f0
movq -0x38(%rbp), %rdi
callq 0xd090
jmp 0xf32e
cmpq $-0x1, -0x30(%rbp)
je 0xf315
movq -0x48(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rcx
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq %rcx, 0x10(%rax)
jmp 0xf32e
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
jmp 0xf291
jmp 0xf330
movq -0x40(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_buffer_range_len
int64_t ce_buffer_range_len(CeBuffer_t* buffer, CePoint_t start, CePoint_t end){
     if(!ce_buffer_point_is_valid(buffer, start)) return -1;
     if(!ce_buffer_point_is_valid(buffer, end)) return -1;
     if(ce_point_after(start, end)) return -1; // TODO: calculate negative value?

     // easy case where they are on the same line
     if(start.y == end.y) return (end.x - start.x) + 1;

     int64_t length = 0;
     for(int64_t y = start.y; y <= end.y; ++y){
          if(y == start.y){
               // count from the star to the end of the line
               length = ce_utf8_strlen(ce_utf8_iterate_to(buffer->lines[y], start.x)) + 1;
          }else if(y == end.y){
               length += end.x + 1;
          }else{
               // count entire line
               int64_t line_length = ce_utf8_strlen(buffer->lines[y]) + 1;
               if(line_length == 0) length++;
               length += line_length;
          }
     }

     return length;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x18(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x20(%rbp)
movq %rdi, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0xeba0
cmpq $0x0, %rax
jne 0xf550
movq $-0x1, -0x8(%rbp)
jmp 0xf681
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xeba0
cmpq $0x0, %rax
jne 0xf574
movq $-0x1, -0x8(%rbp)
jmp 0xf681
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0xf690
testb $0x1, %al
jne 0xf58f
jmp 0xf59c
movq $-0x1, -0x8(%rbp)
jmp 0xf681
movq -0x10(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xf5bb
movq -0x28(%rbp), %rax
subq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0xf681
movq $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jg 0xf679
movq -0x40(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0xf60d
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x18(%rbp), %rsi
callq 0xeca0
movq %rax, %rdi
callq 0xea70
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xf666
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xf629
movq -0x28(%rbp), %rax
addq $0x1, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xf664
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xea70
addq $0x1, %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xf658
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xf666
jmp 0xf668
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xf5cb
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_util_string_index_to_visible_index
int64_t ce_util_string_index_to_visible_index(const char* string, int64_t index, int64_t tab_width){
     int64_t x = 0;
     int64_t rune_len = 0;
     CeRune_t rune = 1;

     while(rune > 0 && index > 0){
          rune = ce_utf8_decode(string, &rune_len);

          if(rune > 0){
               if(rune == CE_TAB){
                    x += tab_width;
               }else{
                    x++;
               }
          }else{
               x++;
          }

          string += rune_len;
          index--;
     }

     return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x1, -0x2c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x2d(%rbp)
jle 0xf9b1
cmpq $0x0, -0x10(%rbp)
setg %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0xf9ba
jmp 0xfa18
movq -0x8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xedc0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0xf9f2
cmpl $0x9, -0x2c(%rbp)
jne 0xf9e4
movq -0x18(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xf9f0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xf9fe
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xf99b
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: ce_util_visible_index_to_string_index
int64_t ce_util_visible_index_to_string_index(const char* string, int64_t index, int64_t tab_width){
     int64_t x = 0;
     int64_t rune_len = 0;
     CeRune_t rune = 1;

     while(rune > 0 && index > 0){
          rune = ce_utf8_decode(string, &rune_len);

          if(rune > 0){
               if(rune == CE_TAB){
                    index -= tab_width;
               }else{
                    index--;
               }
          }else{
               index--;
          }

          string += rune_len;
          x++;
     }

     return x;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movl $0x1, -0x2c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x2c(%rbp)
movb %al, -0x2d(%rbp)
jle 0xfa71
cmpq $0x0, -0x10(%rbp)
setg %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0xfa7a
jmp 0xfadb
movq -0x8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0xedc0
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0xfab5
cmpl $0x9, -0x2c(%rbp)
jne 0xfaa7
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0xfab3
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xfac1
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rax
addq -0x8(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0xfa5b
movq -0x20(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce.c
// Function: buffer_realloc_lines
static bool buffer_realloc_lines(CeBuffer_t* buffer, int64_t new_line_count){
     // if we want to realloc 0 lines, clear everything
     if(new_line_count == 0){
          free(buffer->lines);
          buffer->lines = NULL;
          buffer->line_count = 0;
          return true;
     }else if(new_line_count == buffer->line_count){
          return true;
     }

     buffer->lines = realloc(buffer->lines, new_line_count * sizeof(buffer->lines[0]));
     if(buffer->lines == NULL) return false;
     buffer->line_count = new_line_count;
     return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xff40
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xd090
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movb $0x1, -0x1(%rbp)
jmp 0xff94
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jne 0xff54
movb $0x1, -0x1(%rbp)
jmp 0xff94
jmp 0xff56
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
shlq $0x3, %rsi
callq 0xd500
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xff84
movb $0x0, -0x1(%rbp)
jmp 0xff94
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop