LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: lookup
struct atom *
lookup(char *s)
{
	int i, k;
	struct atom *p;

	if (isupper(*s))
		k = BUCKETSIZE * (*s - 'A');
	else if (islower(*s))
		k = BUCKETSIZE * (*s - 'a');
	else
		k = BUCKETSIZE * 26;

	for (i = 0; i < BUCKETSIZE; i++) {
		p = symtab[k + i];
		if (p == NULL)
			break;
		if (strcmp(s, printname(p)) == 0)
			return p;
	}

	if (i == BUCKETSIZE)
		stopf("symbol table full");

	p = alloc_atom();
	s = strdup(s);
	if (s == NULL)
		exit(1);
	p->atomtype = USYM;
	p->u.usym.name = s;
	p->u.usym.index = k + i;
	symtab[k + i] = p;
	usym_count++;

	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x73a0
movq (%rax), %rcx
movsbq (%rbx), %rax
movzwl (%rcx,%rax,2), %ecx
btl $0x8, %ecx
jb 0x25b2f
movl $0xa28, %edx            # imm = 0xA28
btl $0x9, %ecx
jae 0x25b38
imull $0x64, %eax, %edx
addl $0xffffda1c, %edx       # imm = 0xFFFFDA1C
jmp 0x25b38
imull $0x64, %eax, %edx
addl $0xffffe69c, %edx       # imm = 0xFFFFE69C
movl %edx, -0x2c(%rbp)
movslq %edx, %r15
shlq $0x3, %r15
xorl %r13d, %r13d
leaq 0x542c(%rip), %r12      # 0x2af78
leaq (%r15,%r13,8), %rax
leaq 0x18609(%rip), %rcx     # 0x3e160
movq (%rcx,%rax), %r14
testq %r14, %r14
je 0x25b8b
movb 0x10(%r14), %al
andb $-0x2, %al
movq %r12, %rsi
cmpb $0x2, %al
jne 0x25b70
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x71e0
testl %eax, %eax
je 0x25bca
incq %r13
cmpq $0x64, %r13
jne 0x25b4c
movl $0x64, %r13d
cmpl $0x64, %r13d
je 0x25bdc
callq 0x74ec
movq %rax, %r14
movq %rbx, %rdi
callq 0x7360
testq %rax, %rax
je 0x25be8
movb $0x3, 0x10(%r14)
movq %rax, (%r14)
addl -0x2c(%rbp), %r13d
movl %r13d, 0x8(%r14)
movslq %r13d, %rax
leaq 0x185a0(%rip), %rcx     # 0x3e160
movq %r14, (%rcx,%rax,8)
incl 0xeb81e(%rip)           # 0x1113e8
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5383(%rip), %rdi      # 0x2af66
callq 0x77c8
movl $0x1, %edi
callq 0x7330
// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]eigenmath/eigenmath.c
// Function: update_token_buf
void
update_token_buf(char *a, char *b)
{
	int m, n;

	n = (int) (b - a);

	// Let n == 1000

	// Then m == 2000 hence there is always room for the terminator '\0'

	m = 1000 * (n / 1000 + 1); // m is a multiple of 1000

	if (m > token_buf_len) {
		if (token_buf)
			free(token_buf);
		token_buf = alloc_mem(m);
		token_buf_len = m;
	}

	strncpy(token_buf, a, n);
	token_buf[n] = '\0';
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
subq %rdi, %r14
movslq %r14d, %rax
imulq $0x10624dd3, %rax, %rax # imm = 0x10624DD3
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x26, %rax
addl %ecx, %eax
imull $0x3e8, %eax, %r15d     # imm = 0x3E8
addl $0x3e8, %r15d           # imm = 0x3E8
cmpl 0xeb9db(%rip), %r15d    # 0x111908
jle 0x25f56
movq 0xeb9c2(%rip), %rdi     # 0x1118f8
testq %rdi, %rdi
je 0x25f40
callq 0x7040
movl %r15d, %edi
callq 0x7810
movq %rax, 0xeb9a9(%rip)     # 0x1118f8
movl %r15d, 0xeb9b2(%rip)    # 0x111908
movq 0xeb99b(%rip), %rdi     # 0x1118f8
movslq %r14d, %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x7070
movq 0xeb986(%rip), %rax     # 0x1118f8
movb $0x0, (%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/font.c
// Function: wld_font_open_name
wld_font *
wld_font_open_name(struct wld_font_context *context, const char *name)
{
	FcPattern *pattern, *match;
	FcResult result;

	DEBUG("Opening font with name: %s\n", name);

	pattern = FcNameParse((const FcChar8 *)name);
	FcConfigSubstitute(NULL, pattern, FcMatchPattern);
	FcDefaultSubstitute(pattern);

	match = FcFontMatch(NULL, pattern, &result);

	if (!match)
		return NULL;

	return wld_font_open_pattern(context, match);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %rbx
movq 0xe70a(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0x7278(%rip), %rsi      # 0x10b68
leaq 0x7293(%rip), %rdx      # 0x10b8a
xorl %r14d, %r14d
movq %r15, %rcx
xorl %eax, %eax
callq 0x9480
movq %r15, %rdi
callq 0x90e0
movq %rax, %r15
xorl %edi, %edi
movq %rax, %rsi
xorl %edx, %edx
callq 0x93a0
movq %r15, %rdi
callq 0x9610
leaq 0xc(%rsp), %rdx
xorl %edi, %edi
movq %r15, %rsi
callq 0x9520
testq %rax, %rax
je 0x9945
movq %rbx, %rdi
movq %rax, %rsi
callq 0x94e0
movq %rax, %r14
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffer.c
// Function: buffer_initialize
void
buffer_initialize(struct buffer *buffer,
                  const struct wld_buffer_impl *impl,
                  uint32_t width, uint32_t height,
                  uint32_t format, uint32_t pitch)
{
	*((const struct wld_buffer_impl **)&buffer->base.impl) = impl;
	buffer->base.width = width;
	buffer->base.height = height;
	buffer->base.format = format;
	buffer->base.pitch = pitch;
	buffer->base.map = NULL;
	buffer->ref = 1;
	buffer->map_ref = 0;
	buffer->exporters = NULL;
	buffer->destructors = NULL;
	pixman_region32_init_rect(&buffer->base.damage, 0, 0, width, height);
}

// Assembly:
movl %ecx, %eax
movl %edx, %ecx
movq %rsi, (%rdi)
movl %edx, 0x8(%rdi)
movl %eax, 0xc(%rdi)
movl %r8d, 0x14(%rdi)
movl %r9d, 0x10(%rdi)
movq $0x0, 0x30(%rdi)
movl $0x1, 0x38(%rdi)
leaq 0x18(%rdi), %rdx
xorps %xmm0, %xmm0
movups %xmm0, 0x3c(%rdi)
movl $0x0, 0x4c(%rdi)
movq %rdx, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %eax, %r8d
jmp 0x9680
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffer.c
// Function: wld_buffer_unreference
EXPORT
void
wld_buffer_unreference(struct wld_buffer *base)
{
	struct buffer *buffer = (void *)base;
	struct wld_destructor *destructor, *next;

	if (--buffer->ref > 0)
		return;

	pixman_region32_fini(&buffer->base.damage);

	for (destructor = buffer->destructors; destructor; destructor = next) {
		next = destructor->next;
		destructor->destroy(destructor);
	}

	if (buffer->map_ref > 0)
		buffer->base.impl->unmap(buffer);

	buffer->base.impl->destroy(buffer);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
decl 0x38(%rdi)
je 0x9cc4
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
addq $0x18, %rdi
callq 0x9130
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x9ce7
movq 0x8(%rdi), %r14
callq *(%rdi)
movq %r14, %rdi
testq %r14, %r14
jne 0x9cd9
cmpl $0x0, 0x3c(%rbx)
je 0x9cf6
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
movq (%rbx), %rax
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x10(%rax)
nop
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: buffered_surface_create
struct wld_surface *
buffered_surface_create(struct wld_context *context, uint32_t width, uint32_t height,
                        uint32_t format, uint32_t flags, struct buffer_socket *buffer_socket)
{
	struct buffered_surface *surface;

	if (!(surface = malloc(sizeof *surface)))
		return NULL;

	surface_initialize(&surface->base, &wld_surface_impl);
	surface->context = context;
	surface->entries = NULL;
	surface->back = NULL;
	surface->entries_size = 0;
	surface->entries_capacity = 0;
	surface->buffer_socket = buffer_socket;
	surface->width = width;
	surface->height = height;
	surface->format = format;
	surface->flags = flags;

	return &surface->base;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movl %r8d, 0x4(%rsp)
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
movl $0x40, %edi
callq 0x9570
testq %rax, %rax
je 0x9d75
movq %rax, %r14
leaq 0xacd1(%rip), %rsi      # 0x14a10
movq %rax, %rdi
callq 0xa6b4
movq %rbx, 0x8(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%r14)
movq $0x0, 0x20(%r14)
movq %r15, 0x28(%r14)
movl %r13d, 0x30(%r14)
movl %r12d, 0x34(%r14)
movl %ebp, 0x38(%r14)
movl 0x4(%rsp), %eax
movl %eax, 0x3c(%r14)
jmp 0x9d78
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: surface_damage
pixman_region32_t *
surface_damage(struct wld_surface *base, pixman_region32_t *new_damage)
{
	struct buffered_surface *surface = buffered_surface(base);
	struct buffer *back_buffer;
	unsigned index;

	if (pixman_region32_not_empty(new_damage)) {
		for (index = 0; index < surface->entries_size; ++index) {
			pixman_region32_union(&surface->entries[index].buffer->base.damage,
			                      &surface->entries[index].buffer->base.damage,
			                      new_damage);
		}
	}

	if (!(back_buffer = surface_back(base)))
		return NULL;

	return &back_buffer->base.damage;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0xac77(%rip), %rax      # 0x14a10
cmpq %rax, (%rdi)
jne 0x9e01
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x91f0
testl %eax, %eax
je 0x9de2
cmpl $0x0, 0x20(%rbx)
je 0x9de2
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rdi
addq $0x18, %rdi
movq %rdi, %rsi
movq %r14, %rdx
callq 0x9760
incq %r12
movl 0x20(%rbx), %eax
addq $0x10, %r15
cmpq %rax, %r12
jb 0x9dbc
movq %rbx, %rdi
callq 0x9e20
leaq 0x18(%rax), %rcx
testq %rax, %rax
cmovneq %rcx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x51f8(%rip), %rdi      # 0xf000
leaq 0x5213(%rip), %rsi      # 0xf022
leaq 0x521f(%rip), %rcx      # 0xf035
movl $0x1b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: surface_back
struct buffer *
surface_back(struct wld_surface *base)
{
	struct buffered_surface *surface = buffered_surface(base);
	unsigned index;

	if (surface->back)
		return surface->back->buffer;

	/* The buffer socket may need to process any incoming buffer releases. */
	if (surface->buffer_socket)
		surface->buffer_socket->impl->process(surface->buffer_socket);

	for (index = 0; index < surface->entries_size; ++index) {
		if (!surface->entries[index].busy) {
			surface->back = &surface->entries[index];
			return surface->back->buffer;
		}
	}

	/* If there are no free buffers, we need to allocate another one. */
	struct buffer *buffer;

	buffer = surface->context->impl->create_buffer(surface->context, surface->width, surface->height,
	                                               surface->format, surface->flags);

	if (!buffer)
		goto error0;

	if (surface->entries_size == surface->entries_capacity) {
		struct buffer_entry *new_entries;
		size_t new_capacity = surface->entries_capacity * 2 + 1;

		new_entries = realloc(surface->entries,
		                      new_capacity * sizeof surface->entries[0]);

		if (!new_entries)
			goto error1;

		surface->entries = new_entries;
		surface->entries_capacity = new_capacity;
	}

	surface->back = &surface->entries[surface->entries_size++];
	*surface->back = (struct buffer_entry){
		.buffer = buffer,
		.busy = false
	};

	return buffer;

error1:
	wld_buffer_unreference(&buffer->base);
error0:
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xabe4(%rip), %rax      # 0x14a10
cmpq %rax, (%rdi)
jne 0x9f20
movq %rdi, %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x9e4d
movq (%rax), %r14
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x9e5c
movq (%rdi), %rax
callq *0x8(%rax)
movl 0x20(%rbx), %eax
testq %rax, %rax
je 0x9e77
movq 0x10(%rbx), %rcx
cmpb $0x0, 0x8(%rcx)
je 0x9ecb
addq $0x10, %rcx
decq %rax
jne 0x9e68
movq 0x8(%rbx), %rdi
movq (%rdi), %rax
movl 0x30(%rbx), %esi
movl 0x34(%rbx), %edx
movl 0x38(%rbx), %ecx
movl 0x3c(%rbx), %r8d
callq *0x8(%rax)
testq %rax, %rax
je 0x9f18
movq %rax, %r14
movl 0x24(%rbx), %eax
cmpl %eax, 0x20(%rbx)
jne 0x9ee9
leal 0x1(,%rax,2), %r15d
movq 0x10(%rbx), %rdi
movq %r15, %rsi
shlq $0x4, %rsi
callq 0x9600
testq %rax, %rax
je 0x9ed7
movq %rax, 0x10(%rbx)
movl %r15d, 0x24(%rbx)
xorl %eax, %eax
jmp 0x9edc
movq %rcx, 0x18(%rbx)
movq (%rcx), %r14
jmp 0x9e44
movl $0x6, %eax
cmpl $0x6, %eax
je 0x9f10
testl %eax, %eax
jne 0x9e44
movq 0x10(%rbx), %rax
movl 0x20(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0x20(%rbx)
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, 0x18(%rbx)
movq %r14, (%rax,%rcx)
movb $0x0, 0x8(%rax,%rcx)
jmp 0x9e44
movq %r14, %rdi
callq 0x9260
xorl %r14d, %r14d
jmp 0x9e44
leaq 0x50d9(%rip), %rdi      # 0xf000
leaq 0x50f4(%rip), %rsi      # 0xf022
leaq 0x5100(%rip), %rcx      # 0xf035
movl $0x1b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: surface_take
struct buffer *
surface_take(struct wld_surface *base)
{
	struct buffered_surface *surface = buffered_surface(base);
	struct buffer *buffer;

	if (!(buffer = surface_back(base)))
		return NULL;

	surface->back->busy = true;
	surface->back = NULL;
	pixman_region32_clear(&buffer->base.damage);

	return buffer;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xaac6(%rip), %rax      # 0x14a10
cmpq %rax, (%rdi)
jne 0x9f8a
movq %rdi, %r14
callq 0x9e20
testq %rax, %rax
je 0x9f7d
movq %rax, %rbx
movq 0x18(%r14), %rax
movb $0x1, 0x8(%rax)
movq $0x0, 0x18(%r14)
movq %rbx, %rdi
addq $0x18, %rdi
callq 0x94b0
jmp 0x9f7f
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x506f(%rip), %rdi      # 0xf000
leaq 0x508a(%rip), %rsi      # 0xf022
leaq 0x5096(%rip), %rcx      # 0xf035
movl $0x1b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: surface_release
bool
surface_release(struct wld_surface *base, struct buffer *buffer)
{
	struct buffered_surface *surface = buffered_surface(base);
	unsigned index;

	for (index = 0; index < surface->entries_size; ++index) {
		if (surface->entries[index].buffer == buffer) {
			surface->entries[index].busy = false;
			return true;
		}
	}

	return false;
}

// Assembly:
pushq %rax
leaq 0xaa5f(%rip), %rax      # 0x14a10
cmpq %rax, (%rdi)
jne 0x9ff6
movl 0x20(%rdi), %ecx
testl %ecx, %ecx
setne %al
je 0x9ff4
movq 0x10(%rdi), %rdx
cmpq %rsi, (%rdx)
je 0x9fe8
leal -0x1(%rcx), %edi
xorl %eax, %eax
cmpl %eax, %edi
je 0x9ff2
leaq 0x10(%rdx), %r8
incl %eax
cmpq %rsi, 0x10(%rdx)
movq %r8, %rdx
jne 0x9fce
cmpl %ecx, %eax
setb %al
jmp 0x9feb
movq %rdx, %r8
movb $0x0, 0x8(%r8)
jmp 0x9ff4
xorl %eax, %eax
popq %rcx
retq
leaq 0x5003(%rip), %rdi      # 0xf000
leaq 0x501e(%rip), %rsi      # 0xf022
leaq 0x502a(%rip), %rcx      # 0xf035
movl $0x1b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: surface_swap
bool
surface_swap(struct wld_surface *base)
{
	struct buffered_surface *surface = buffered_surface(base);
	struct buffer *buffer;

	if (!surface->buffer_socket)
		return false;

	if (!(buffer = surface_back(base)))
		return false;

	if (!surface->buffer_socket->impl->attach(surface->buffer_socket, buffer))
		return false;

	surface->back->busy = true;
	surface->back = NULL;
	pixman_region32_clear(&buffer->base.damage);

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xa9f0(%rip), %rax      # 0x14a10
cmpq %rax, (%rdi)
jne 0xa079
movq %rdi, %rbx
cmpq $0x0, 0x28(%rdi)
je 0xa06f
movq %rbx, %rdi
callq 0x9e20
testq %rax, %rax
je 0xa06f
movq %rax, %r14
movq 0x28(%rbx), %rdi
movq (%rdi), %rax
movq %r14, %rsi
callq *(%rax)
testb %al, %al
je 0xa06f
movq 0x18(%rbx), %rax
movb $0x1, 0x8(%rax)
movq $0x0, 0x18(%rbx)
addq $0x18, %r14
movq %r14, %rdi
callq 0x94b0
movb $0x1, %al
jmp 0xa071
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4f80(%rip), %rdi      # 0xf000
leaq 0x4f9b(%rip), %rsi      # 0xf022
leaq 0x4fa7(%rip), %rcx      # 0xf035
movl $0x1b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/buffered_surface.c
// Function: surface_destroy
void
surface_destroy(struct wld_surface *base)
{
	struct buffered_surface *surface = buffered_surface(base);
	unsigned index;

	if (surface->buffer_socket)
		surface->buffer_socket->impl->destroy(surface->buffer_socket);

	for (index = 0; index < surface->entries_size; ++index)
		wld_buffer_unreference(&surface->entries[index].buffer->base);

	free(surface->entries);
	free(surface);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0xa96c(%rip), %rax      # 0x14a10
cmpq %rax, (%rdi)
jne 0xa0f9
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0xa0bb
movq (%rdi), %rax
callq *0x10(%rax)
cmpl $0x0, 0x20(%rbx)
je 0xa0e3
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x9260
incq %r15
movl 0x20(%rbx), %eax
addq $0x10, %r14
cmpq %rax, %r15
jb 0xa0c7
movq 0x10(%rbx), %rdi
callq 0x9060
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x9060
leaq 0x4f00(%rip), %rdi      # 0xf000
leaq 0x4f1b(%rip), %rsi      # 0xf022
leaq 0x4f27(%rip), %rcx      # 0xf035
movl $0x1b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/color.c
// Function: wld_lookup_named_color
EXPORT
bool
wld_lookup_named_color(const char *name, uint32_t *color)
{
	char *end;
	int low = 0, mid, high = ARRAY_LENGTH(named_colors);
	int r;

	if (name[0] == '#' && name[1] != '\0') {
		*color = strtoul(name + 1, &end, 16);

		/* Set alpha channel to opaque. */
		*color |= 0xff << 24;

		if (*end == '\0')
			return true;
	}

	while (low <= high) {
		mid = (low + high) / 2;
		r = strcasecmp(named_colors[mid].name, name);

		if (r == 0) {
			*color = named_colors[mid].color;
			return true;
		}
		if (r < 0)
			low = mid + 1;
		else
			high = mid - 1;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x23, (%rdi)
jne 0xa15d
cmpb $0x0, 0x1(%r14)
je 0xa15d
leaq 0x1(%r14), %rdi
leaq 0x10(%rsp), %r15
movq %r15, %rsi
movl $0x10, %edx
callq 0x9780
orl $0xff000000, %eax       # imm = 0xFF000000
movl %eax, (%rbx)
movq (%r15), %rax
cmpb $0x0, (%rax)
je 0xa1bb
movq %rbx, 0x8(%rsp)
xorl %r12d, %r12d
movl $0x2f0, %r13d           # imm = 0x2F0
leaq 0xa8ce(%rip), %r15      # 0x14a40
leal (%r12,%r13), %eax
movl %eax, %ebp
shrl $0x1f, %ebp
addl %eax, %ebp
sarl %ebp
movslq %ebp, %rbx
shlq $0x4, %rbx
movq (%rbx,%r15), %rdi
movq %r14, %rsi
callq 0x9070
testl %eax, %eax
je 0xa1ad
js 0xa19f
decl %ebp
movl %ebp, %r13d
jmp 0xa1a4
incl %ebp
movl %ebp, %r12d
cmpl %r13d, %r12d
jle 0xa172
xorl %eax, %eax
jmp 0xa1bd
addq %rbx, %r15
movl 0x8(%r15), %eax
movq 0x8(%rsp), %rcx
movl %eax, (%rcx)
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/font.c
// Function: font_ensure_glyph
bool
font_ensure_glyph(struct font *font, FT_UInt glyph_index)
{
	if (glyph_index) {
		if (!font->glyphs[glyph_index]) {
			struct glyph *glyph;

			glyph = malloc(sizeof *glyph);

			if (!glyph)
				return false;

			FT_Load_Glyph(font->face, glyph_index, FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO);

			FT_Bitmap_New(&glyph->bitmap);

			FT_Bitmap_Copy(font->context->library,
			               &font->face->glyph->bitmap, &glyph->bitmap);

			glyph->advance = font->face->glyph->metrics.horiAdvance >> 6;
			glyph->x = font->face->glyph->bitmap_left;
			glyph->y = -font->face->glyph->bitmap_top;

			font->glyphs[glyph_index] = glyph;
		}

		return true;
	}

	return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %esi, %esi
je 0xa460
movl %esi, %ebp
movq %rdi, %r14
movq 0x20(%rdi), %rax
movl %esi, %r12d
movb $0x1, %bl
cmpq $0x0, (%rax,%r12,8)
jne 0xa462
movl $0x30, %edi
callq 0x9570
testq %rax, %rax
je 0xa460
movq %rax, %r15
movq 0x18(%r14), %rdi
movl %ebp, %esi
movl $0x21004, %edx          # imm = 0x21004
callq 0x90d0
movq %r15, %rdi
callq 0x9360
movq 0x10(%r14), %rax
movq 0x18(%r14), %rcx
movq (%rax), %rdi
movl $0x98, %esi
addq 0x98(%rcx), %rsi
movq %r15, %rdx
callq 0x9270
movq 0x18(%r14), %rax
movq 0x98(%rax), %rax
movl 0x50(%rax), %ecx
shrl $0x6, %ecx
movw %cx, 0x2c(%r15)
movzwl 0xc0(%rax), %ecx
movw %cx, 0x28(%r15)
xorl %ecx, %ecx
subw 0xc4(%rax), %cx
movw %cx, 0x2a(%r15)
movq 0x20(%r14), %rax
movq %r15, (%rax,%r12,8)
jmp 0xa462
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/font.c
// Function: wld_font_text_extents_n
EXPORT
void
wld_font_text_extents_n(struct wld_font *font_base,
                        const char *text, int32_t length,
                        struct wld_extents *extents)
{
	struct font *font = (void *)font_base;
	int ret;
	uint32_t c;
	FT_UInt glyph_index;

	extents->advance = 0;

	while ((ret = FcUtf8ToUcs4((FcChar8 *)text, &c, length) > 0) && c != '\0') {
		length -= ret;
		text += ret;
		glyph_index = FT_Get_Char_Index(font->face, c);

		if (!font_ensure_glyph(font, glyph_index))
			continue;

		extents->advance += font->glyphs[glyph_index]->advance;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x0, (%rcx)
leaq 0x4(%rsp), %r12
movq %rsi, %rdi
movq %r12, %rsi
callq 0x92a0
testl %eax, %eax
setg %cl
movl (%r12), %eax
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xa51d
incq %r14
decl %ebp
leaq 0x4(%rsp), %r12
movq 0x18(%r15), %rdi
movl %eax, %esi
callq 0x9640
movl %eax, %r13d
movq %r15, %rdi
movl %eax, %esi
callq 0xa3b4
testb %al, %al
je 0xa4ff
movq 0x20(%r15), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rax
movzwl 0x2c(%rax), %eax
addl %eax, (%rbx)
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
callq 0x92a0
testl %eax, %eax
jle 0xa51d
incq %r14
decl %ebp
movl 0x4(%rsp), %eax
testl %eax, %eax
jne 0xa4d2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/renderer.c
// Function: default_fill_region
void
default_fill_region(struct wld_renderer *renderer, uint32_t color, pixman_region32_t *region)
{
	pixman_box32_t *box;
	int num_boxes;

	box = pixman_region32_rectangles(region, &num_boxes);

	while (num_boxes--) {
		renderer->impl->fill_rectangle(renderer, color, box->x1, box->y1,
		                               box->x2 - box->x1, box->y2 - box->y1);
		++box;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x4(%rsp), %r12
movq %rdx, %rdi
movq %r12, %rsi
callq 0x93b0
subl $0x1, (%r12)
jb 0xa57e
movq %rax, %r15
movq (%r14), %rax
movl (%r15), %edx
movl 0x4(%r15), %ecx
movl 0x8(%r15), %r8d
subl %edx, %r8d
movl 0xc(%r15), %r9d
subl %ecx, %r9d
movq %r14, %rdi
movl %ebx, %esi
callq *0x10(%rax)
addq $0x10, %r15
subl $0x1, 0x4(%rsp)
jae 0xa553
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/renderer.c
// Function: default_copy_region
void
default_copy_region(struct wld_renderer *renderer, struct buffer *buffer,
                    int32_t dst_x, int32_t dst_y,
                    pixman_region32_t *region)
{
	pixman_box32_t *box;
	int num_boxes;

	box = pixman_region32_rectangles(region, &num_boxes);

	while (num_boxes--) {
		renderer->impl->copy_rectangle(renderer, buffer,
		                               dst_x + box->x1, dst_y + box->y1,
		                               box->x1, box->y1,
		                               box->x2 - box->x1, box->y2 - box->y1);
		++box;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %edx, %r14d
movq %rsi, %r15
movq %rdi, %r12
leaq 0x4(%rsp), %rbp
movq %r8, %rdi
movq %rbp, %rsi
callq 0x93b0
subl $0x1, (%rbp)
jb 0xa5f7
movq %rax, %r13
movq (%r12), %rax
movl (%r13), %r8d
movl 0x4(%r13), %r9d
leal (%r8,%r14), %edx
leal (%r9,%rbx), %ecx
movl 0x8(%r13), %r10d
subl %r8d, %r10d
movl 0xc(%r13), %r11d
subl %r9d, %r11d
movq %r12, %rdi
movq %r15, %rsi
pushq %r11
pushq %r10
callq *0x20(%rax)
addq $0x10, %rsp
addq $0x10, %r13
subl $0x1, 0x4(%rsp)
jae 0xa5b9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/drm.c
// Function: wld_drm_create_context
wld_context *
wld_drm_create_context(int fd)
{
	const struct drm_driver *driver;
	struct wld_context *context;

	if (!getenv("WLD_DRM_DUMB")) {
		driver = find_driver(fd);
		if (driver) {
			context = driver->create_context(fd);
			if (context)
				return context;
		}
	}

	DEBUG("Falling back to dumb DRM driver\n");
	return dumb_drm_driver.create_context(fd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl %edi, %ebx
leaq 0x6530(%rip), %rdi      # 0x10c26
callq 0x9030
testq %rax, %rax
jne 0xa891
leaq 0x68(%rsp), %rsi
movl %ebx, %edi
callq 0x9880
cmpl $-0x1, %eax
je 0xa86b
movq 0x90(%rsp), %r14
movq %r14, %rdi
callq 0x95f0
movl %eax, %ebp
movq %r14, %rdi
callq 0x9770
leaq 0x6537(%rip), %rdx      # 0x10c71
xorl %r12d, %r12d
movq %rsp, %rdi
movl $0x40, %esi
movl %ebp, %ecx
movl %eax, %r8d
xorl %eax, %eax
callq 0x9300
leal -0x3a(%rax), %ecx
cmpl $-0x40, %ecx
jb 0xa86e
movslq %eax, %r15
movl $0x726f64, 0x3(%rsp,%r15) # imm = 0x726F64
movl $0x646e6576, (%rsp,%r15) # imm = 0x646E6576
leaq 0x5735(%rip), %rsi      # 0xfead
movq %rsp, %rdi
callq 0x96d0
testq %rax, %rax
je 0xa86b
movq %rax, %r14
leaq (%rsp,%r15), %r13
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movl $0x20, %esi
movq %rax, %rdx
callq 0x9420
movq %r14, %rdi
callq 0x91d0
xorl %r12d, %r12d
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9780
movq %rax, %r14
movl $0x69766564, (%r13)     # imm = 0x69766564
movl $0x656369, 0x3(%r13)    # imm = 0x656369
leaq 0x56d7(%rip), %rsi      # 0xfead
movq %rsp, %rdi
callq 0x96d0
testq %rax, %rax
je 0xa86e
movq %rax, %r15
leaq 0x40(%rsp), %r12
movq %r12, %rdi
movl $0x20, %esi
movq %rax, %rdx
callq 0x9420
movq %r15, %rdi
callq 0x91d0
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9780
movq %rax, %r15
leaq 0x6495(%rip), %r13      # 0x10cb2
xorl %ebp, %ebp
movq 0xd7ca(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0xd110(%rip), %rax      # 0x17940
movq (%rbp,%rax), %r12
movq (%r12), %rcx
leaq 0x6454(%rip), %rsi      # 0x10c94
movq %r13, %rdx
xorl %eax, %eax
callq 0x9480
movl %r14d, %edi
movl %r15d, %esi
callq *0x8(%r12)
testb %al, %al
jne 0xa86e
addq $0x8, %rbp
movl $0x0, %r12d
cmpq $0x18, %rbp
jne 0xa81f
jmp 0xa86e
xorl %r12d, %r12d
testq %r12, %r12
je 0xa891
movl %ebx, %edi
callq *0x10(%r12)
testq %rax, %rax
je 0xa891
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd758(%rip), %rax      # 0x17ff0
movq (%rax), %rdi
leaq 0x6391(%rip), %rsi      # 0x10c33
leaq 0x63b1(%rip), %rdx      # 0x10c5a
xorl %eax, %eax
callq 0x9480
leaq 0xd0a1(%rip), %rax      # 0x17958
movl %ebx, %edi
callq *0x10(%rax)
jmp 0xa87f
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: context_create_buffer
struct buffer *
context_create_buffer(struct wld_context *base,
                      uint32_t width, uint32_t height,
                      uint32_t format, uint32_t flags)
{
	struct dumb_context *context = dumb_context(base);
	struct buffer *buffer;
	struct drm_mode_create_dumb create_dumb = {
		.height = height,
		.width = width,
		.bpp = format_bytes_per_pixel(format) * 8,
	};

	if (drmIoctl(context->fd, DRM_IOCTL_MODE_CREATE_DUMB, &create_dumb) != 0)
		goto error0;

	buffer = new_buffer(context, width, height, format,
	                    create_dumb.handle, create_dumb.pitch);

	if (!buffer)
		goto error1;

	return buffer;

error1 : {
	struct drm_mode_destroy_dumb destroy_dumb = {
		.handle = create_dumb.handle
	};

	drmIoctl(context->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
}
error0:
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
leaq 0xd046(%rip), %rax      # 0x17970
cmpq %rax, (%rdi)
jne 0xa9d7
movl %ecx, %ebp
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
movl $0xc00464b4, %eax       # imm = 0xC00464B4
leaq 0x8(%rsp), %rdx
movl %r14d, (%rdx)
movl %esi, 0x4(%rdx)
cmpl $0x34325241, %ecx       # imm = 0x34325241
sete %cl
cmpl $0x34325258, %ebp       # imm = 0x34325258
sete %sil
orb %cl, %sil
movzbl %sil, %ecx
shll $0x5, %ecx
movl %ecx, 0x8(%rdx)
xorps %xmm0, %xmm0
movups %xmm0, 0xc(%rdx)
movl $0x0, 0x1c(%rdx)
movl 0x8(%rdi), %edi
leaq 0x1bfffe(%rax), %rsi
callq 0x98a0
testl %eax, %eax
je 0xa993
xorl %eax, %eax
jmp 0xa9b2
movl 0x18(%rsp), %r8d
movl 0x1c(%rsp), %r9d
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %edx
movl %ebp, %ecx
callq 0xaaba
testq %rax, %rax
je 0xa9bd
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x18(%rsp), %eax
leaq 0x4(%rsp), %rdx
movl %eax, (%rdx)
movl 0x8(%rbx), %edi
movl $0xc00464b4, %esi       # imm = 0xC00464B4
callq 0x98a0
jmp 0xa98f
leaq 0x62e5(%rip), %rdi      # 0x10cc3
leaq 0x6300(%rip), %rsi      # 0x10ce5
leaq 0x6300(%rip), %rcx      # 0x10cec
movl $0x33, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: context_import_buffer
struct buffer *
context_import_buffer(struct wld_context *base,
                      uint32_t type, union wld_object object,
                      uint32_t width, uint32_t height,
                      uint32_t format, uint32_t pitch)
{
	struct dumb_context *context = dumb_context(base);
	uint32_t handle;

	switch (type) {
	case WLD_DRM_OBJECT_PRIME_FD:
		if (drmPrimeFDToHandle(context->fd, object.i, &handle) != 0)
			return NULL;
		break;
	default:
		return NULL;
	}

	return new_buffer(context, width, height, format, handle, pitch);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xcf6c(%rip), %rax      # 0x17970
cmpq %rax, (%rdi)
jne 0xaa5b
cmpl $0x2000001, %esi        # imm = 0x2000001
jne 0xaa33
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdi, %r15
movl 0x8(%rdi), %edi
leaq 0x4(%rsp), %rax
movl %edx, %esi
movq %rax, %rdx
callq 0x97e0
testl %eax, %eax
je 0xaa40
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rsp), %r8d
movl 0x30(%rsp), %r9d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xaaba
jmp 0xaa35
leaq 0x6261(%rip), %rdi      # 0x10cc3
leaq 0x627c(%rip), %rsi      # 0x10ce5
leaq 0x627c(%rip), %rcx      # 0x10cec
movl $0x33, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: new_buffer
static struct buffer *
new_buffer(struct dumb_context *context,
           uint32_t width, uint32_t height,
           uint32_t format, uint32_t handle,
           unsigned long pitch)
{
	struct dumb_buffer *buffer;

	if (!(buffer = malloc(sizeof *buffer)))
		return NULL;

	buffer_initialize(&buffer->base, &wld_buffer_impl,
	                  width, height, format, pitch);
	buffer->context = context;
	buffer->handle = handle;
	buffer->exporter.export = &export;
	wld_buffer_add_exporter(&buffer->base.base, &buffer->exporter);

	return &buffer->base;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movl %r8d, 0x4(%rsp)
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, %ebp
movq %rdi, %r15
movl $0x70, %edi
callq 0x9570
testq %rax, %rax
je 0xab2b
movq %rax, %rbx
leaq 0xcea7(%rip), %rsi      # 0x17998
movq %rax, %rdi
movl %ebp, %edx
movl %r13d, %ecx
movl %r12d, %r8d
movl %r14d, %r9d
callq 0x9bbc
movq %r15, 0x60(%rbx)
movl 0x4(%rsp), %eax
movl %eax, 0x68(%rbx)
movq %rbx, %rsi
addq $0x50, %rsi
leaq 0x22(%rip), %rax        # 0xab3f
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
callq 0x97f0
jmp 0xab2d
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: export
static bool export(struct wld_exporter *exporter, struct wld_buffer *base,
                   uint32_t type, union wld_object *object)
{
	struct dumb_buffer *buffer = dumb_buffer(base);

	switch (type) {
	case WLD_DRM_OBJECT_HANDLE:
		object->u32 = buffer->handle;
		return true;
	case WLD_DRM_OBJECT_PRIME_FD:
		if (drmPrimeHandleToFD(buffer->context->fd, buffer->handle,
		                       DRM_CLOEXEC, &object->i)
		    != 0) {
			return false;
		}

		return true;
	default:
		return false;
	}
}

// Assembly:
pushq %rax
leaq 0xce51(%rip), %rax      # 0x17998
cmpq %rax, (%rsi)
jne 0xab84
cmpl $0x2000001, %edx        # imm = 0x2000001
je 0xab65
cmpl $0x2000000, %edx        # imm = 0x2000000
jne 0xab80
movl 0x68(%rsi), %eax
movl %eax, (%rcx)
movb $0x1, %al
jmp 0xab82
movq 0x60(%rsi), %rax
movl 0x8(%rax), %edi
movl 0x68(%rsi), %esi
movl $0x80000, %edx          # imm = 0x80000
callq 0x90f0
testl %eax, %eax
sete %al
jmp 0xab82
xorl %eax, %eax
popq %rcx
retq
leaq 0x6199(%rip), %rdi      # 0x10d24
leaq 0x6153(%rip), %rsi      # 0x10ce5
leaq 0x61ac(%rip), %rcx      # 0x10d45
movl $0x34, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: buffer_map
bool
buffer_map(struct buffer *base)
{
	struct dumb_buffer *buffer = dumb_buffer(&base->base);
	struct drm_mode_map_dumb map_dumb = { .handle = buffer->handle };
	void *data;

	if (drmIoctl(buffer->context->fd, DRM_IOCTL_MODE_MAP_DUMB,
	             &map_dumb)
	    != 0) {
		return false;
	}

	data = mmap(NULL, buffer->base.base.pitch * buffer->base.base.height,
	            PROT_READ | PROT_WRITE, MAP_SHARED,
	            buffer->context->fd, map_dumb.offset);

	if (data == MAP_FAILED)
		return false;

	buffer->base.base.map = data;

	return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xcde7(%rip), %rax      # 0x17998
cmpq %rax, (%rdi)
jne 0xac2c
movq %rdi, %rbx
movl 0x68(%rdi), %eax
leaq 0x8(%rsp), %rdx
movl %eax, (%rdx)
movl $0x0, 0x4(%rdx)
movq $0x0, 0x8(%rdx)
movq 0x60(%rdi), %rax
movl 0x8(%rax), %edi
movl $0xc01064b3, %esi       # imm = 0xC01064B3
callq 0x98a0
testl %eax, %eax
je 0xabec
xorl %r14d, %r14d
jmp 0xac21
movl 0xc(%rbx), %esi
imull 0x10(%rbx), %esi
movq 0x60(%rbx), %rax
movl 0x8(%rax), %r8d
movq 0x10(%rsp), %r9
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x3, %edx
movl $0x1, %ecx
callq 0x9290
cmpq $-0x1, %rax
je 0xac21
movq %rax, 0x30(%rbx)
movb $0x1, %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x60f1(%rip), %rdi      # 0x10d24
leaq 0x60ab(%rip), %rsi      # 0x10ce5
leaq 0x6104(%rip), %rcx      # 0x10d45
movl $0x34, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: buffer_unmap
bool
buffer_unmap(struct buffer *buffer)
{
	if (munmap(buffer->base.map,
	           buffer->base.pitch * buffer->base.height)
	    == -1) {
		return false;
	}

	buffer->base.map = NULL;

	return true;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
movl 0xc(%rbx), %esi
imull 0x10(%rbx), %esi
callq 0x9630
cmpl $-0x1, %eax
je 0xac6c
movq $0x0, 0x30(%rbx)
cmpl $-0x1, %eax
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/dumb.c
// Function: buffer_destroy
void
buffer_destroy(struct buffer *base)
{
	struct dumb_buffer *buffer = dumb_buffer(&base->base);
	struct drm_mode_destroy_dumb destroy_dumb = {
		.handle = buffer->handle
	};

	drmIoctl(buffer->context->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &destroy_dumb);
	free(buffer);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xcd18(%rip), %rax      # 0x17998
cmpq %rax, (%rdi)
jne 0xacb1
movq %rdi, %rbx
movl 0x68(%rdi), %eax
leaq 0xc(%rsp), %rdx
movl %eax, (%rdx)
movq 0x60(%rdi), %rax
movl 0x8(%rax), %edi
movl $0xc00464b4, %esi       # imm = 0xC00464B4
callq 0x98a0
movq %rbx, %rdi
callq 0x9060
addq $0x10, %rsp
popq %rbx
retq
leaq 0x606c(%rip), %rdi      # 0x10d24
leaq 0x6026(%rip), %rsi      # 0x10ce5
leaq 0x607f(%rip), %rcx      # 0x10d45
movl $0x34, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: driver_create_context
struct wld_context *
driver_create_context(int drm_fd)
{
	struct intel_context *context;

	context = malloc(sizeof *context);

	if (!context)
		goto error0;

	context_initialize(&context->base, &wld_context_impl);
	context->bufmgr = drm_intel_bufmgr_gem_init(drm_fd, INTEL_BATCH_SIZE);

	if (!context->bufmgr)
		goto error1;

	return &context->base;

error1:
	free(context);
error0:
	return NULL;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x10, %edi
callq 0x9570
testq %rax, %rax
je 0xad1d
movq %rax, %rbx
leaq 0xccd0(%rip), %rsi      # 0x179c8
movq %rax, %rdi
callq 0xa1cc
movl %ebp, %edi
movl $0x8000, %esi           # imm = 0x8000
callq 0x98b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0xad1f
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: context_create_renderer
struct wld_renderer *
context_create_renderer(struct wld_context *base)
{
	struct intel_context *context = intel_context(base);
	struct intel_renderer *renderer;

	if (!(renderer = malloc(sizeof *renderer)))
		goto error0;

	if (!(intel_batch_initialize(&renderer->batch, context->bufmgr)))
		goto error1;

	renderer_initialize(&renderer->base, &wld_renderer_impl);

	return &renderer->base;

error1:
	free(renderer);
error0:
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xcc94(%rip), %rax      # 0x179c8
cmpq %rax, (%rdi)
jne 0xad88
movq %rdi, %r14
movl $0x8030, %edi           # imm = 0x8030
callq 0x9570
testq %rax, %rax
je 0xad7b
movq %rax, %rbx
movq %rax, %rdi
addq $0x10, %rdi
movq 0x8(%r14), %rsi
callq 0xba90
testb %al, %al
je 0xad73
leaq 0xcc87(%rip), %rsi      # 0x179f0
movq %rbx, %rdi
callq 0xa606
jmp 0xad7d
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5f34(%rip), %rdi      # 0x10cc3
leaq 0x5fea(%rip), %rsi      # 0x10d80
leaq 0x5feb(%rip), %rcx      # 0x10d88
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: context_create_buffer
struct buffer *
context_create_buffer(struct wld_context *base,
                      uint32_t width, uint32_t height,
                      uint32_t format, uint32_t flags)
{
	struct intel_context *context = intel_context(base);
	struct buffer *buffer;
	drm_intel_bo *bo;
	uint32_t tiling_mode = width >= 128 && !(flags & WLD_FLAG_CURSOR) ? I915_TILING_X : I915_TILING_NONE;
	unsigned long pitch;

	bo = drm_intel_bo_alloc_tiled(context->bufmgr, "buffer", width, height, 4,
	                              &tiling_mode, &pitch, 0);

	if (!bo)
		goto error0;

	if (!(buffer = new_buffer(width, height, format, pitch, bo)))
		goto error1;

	return buffer;

error1:
	drm_intel_bo_unreference(bo);
error0:
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
leaq 0xcc10(%rip), %rax      # 0x179c8
cmpq %rax, (%rdi)
jne 0xae3b
movl %ecx, %ebx
movl %edx, %ebp
movl %esi, %r14d
cmpl $0x7f, %esi
seta %al
btl $0x11, %r8d
setae %cl
andb %al, %cl
movzbl %cl, %eax
leaq 0x14(%rsp), %r9
movl %eax, (%r9)
movq 0x8(%rdi), %rdi
leaq 0x8(%rsp), %rax
leaq 0x6ab3(%rip), %rsi      # 0x118a2
movl %r14d, %edx
movl %ebp, %ecx
movl $0x4, %r8d
pushq $0x0
pushq %rax
callq 0x9390
addq $0x10, %rsp
testq %rax, %rax
je 0xae2e
movq %rax, %r15
movl 0x8(%rsp), %ecx
movl %r14d, %edi
movl %ebp, %esi
movl %ebx, %edx
movq %rax, %r8
callq 0xb9b3
testq %rax, %rax
jne 0xae30
movq %r15, %rdi
callq 0x94d0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e81(%rip), %rdi      # 0x10cc3
leaq 0x5f37(%rip), %rsi      # 0x10d80
leaq 0x5f38(%rip), %rcx      # 0x10d88
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: context_import_buffer
struct buffer *
context_import_buffer(struct wld_context *base,
                      uint32_t type, union wld_object object,
                      uint32_t width, uint32_t height,
                      uint32_t format, uint32_t pitch)
{
	struct intel_context *context = intel_context(base);
	struct buffer *buffer;
	drm_intel_bo *bo;

	switch (type) {
	case WLD_DRM_OBJECT_PRIME_FD: {
		uint32_t size = width * height * format_bytes_per_pixel(format);
		bo = drm_intel_bo_gem_create_from_prime(context->bufmgr,
		                                        object.i, size);
		break;
	}
	default:
		bo = NULL;
	};

	if (!bo)
		goto error0;

	if (!(buffer = new_buffer(width, height, format, pitch, bo)))
		goto error1;

	return buffer;

error1:
	drm_intel_bo_unreference(bo);
error0:
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0xcb60(%rip), %rax      # 0x179c8
cmpq %rax, (%rdi)
jne 0xaeeb
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
cmpl $0x2000001, %esi        # imm = 0x2000001
jne 0xaeb6
movl %ebp, %ecx
imull %r14d, %ecx
cmpl $0x34325241, %ebx       # imm = 0x34325241
sete %al
cmpl $0x34325258, %ebx       # imm = 0x34325258
sete %sil
orb %al, %sil
movzbl %sil, %eax
imull %ecx, %eax
shll $0x2, %eax
movq 0x8(%rdi), %rdi
movl %edx, %esi
movl %eax, %edx
callq 0x96b0
movq %rax, %r15
jmp 0xaeb9
xorl %r15d, %r15d
testq %r15, %r15
je 0xaede
movl 0x30(%rsp), %ecx
movl %r14d, %edi
movl %ebp, %esi
movl %ebx, %edx
movq %r15, %r8
callq 0xb9b3
testq %rax, %rax
jne 0xaee0
movq %r15, %rdi
callq 0x94d0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5dd1(%rip), %rdi      # 0x10cc3
leaq 0x5e87(%rip), %rsi      # 0x10d80
leaq 0x5e88(%rip), %rcx      # 0x10d88
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: renderer_set_target
bool
renderer_set_target(struct wld_renderer *base, struct buffer *buffer)
{
	struct intel_renderer *renderer = intel_renderer(base);

	if (buffer && buffer->base.impl != &wld_buffer_impl)
		return false;

	renderer->target = buffer ? intel_buffer(&buffer->base) : NULL;

	return true;
}

// Assembly:
leaq 0xca8b(%rip), %rax      # 0x179f0
cmpq %rax, (%rdi)
jne 0xaf8a
testq %rsi, %rsi
je 0xaf7e
leaq 0xcac2(%rip), %rax      # 0x17a38
cmpq %rax, (%rsi)
je 0xaf80
xorl %eax, %eax
retq
xorl %esi, %esi
movq %rsi, 0x8028(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x5e67(%rip), %rdi      # 0x10df9
leaq 0x5de7(%rip), %rsi      # 0x10d80
leaq 0x5e7c(%rip), %rcx      # 0x10e1c
movl $0x39, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: renderer_fill_rectangle
void
renderer_fill_rectangle(struct wld_renderer *base, uint32_t color,
                        int32_t x, int32_t y,
                        uint32_t width, uint32_t height)
{
	struct intel_renderer *renderer = intel_renderer(base);
	struct intel_buffer *dst = renderer->target;

	xy_color_blt(&renderer->batch, dst->bo, dst->base.base.pitch,
	             x, y, x + width, y + height, color);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0xca31(%rip), %rax      # 0x179f0
cmpq %rax, (%rdi)
jne 0xb115
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r13d
movq %rdi, %r14
movl %esi, 0x10(%rsp)
movq 0x8028(%rdi), %rax
leaq 0x10(%rdi), %rcx
movq %rcx, 0x18(%rsp)
movq 0x60(%rax), %r12
movzwl 0x10(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rdi), %rax
xorl %ecx, %ecx
cmpl $0x8, (%rax)
setge %cl
orl $0x6, %ecx
movl $0x1ffe, %eax           # imm = 0x1FFE
subl 0x8020(%rdi), %eax
cmpl %ecx, %eax
jae 0xb01f
movq 0x18(%rsp), %rdi
callq 0xc1c4
addl %r15d, %ebx
addl %r13d, %ebp
leaq 0x14(%rsp), %rsi
leaq 0x24(%rsp), %rdx
movq %r12, %rdi
callq 0x9350
movq 0x18(%r14), %rdi
movl 0x8020(%r14), %eax
leal 0x10(,%rax,4), %esi
movq %r12, %rdx
xorl %ecx, %ecx
movl $0x2, %r8d
movl $0x2, %r9d
callq 0x9740
movl 0xc(%rsp), %esi
movl %esi, %ecx
shrl $0x2, %ecx
xorl %eax, %eax
leaq 0x14(%rsp), %rdx
cmpl $0x0, (%rdx)
setne %al
movq 0x10(%r14), %rdx
cmovel %esi, %ecx
shll $0xb, %eax
xorl %esi, %esi
cmpl $0x8, (%rdx)
setge %sil
leal (%rax,%rsi), %edx
addl $0x54300004, %edx       # imm = 0x54300004
orl $0x3f00000, %ecx        # imm = 0x3F00000
shll $0x10, %r15d
movl $0xffff, %eax           # imm = 0xFFFF
andl %eax, %r13d
orl %r15d, %r13d
shll $0x10, %ebx
andl %eax, %ebp
orl %ebx, %ebp
movq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl $0x4, %esi
movl %r13d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0xb7d6
movq 0x10(%r14), %rax
xorl %esi, %esi
cmpl $0x8, (%rax)
setge %sil
incl %esi
movq 0x30(%r12), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xb7d6
movl 0x8020(%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x8020(%r14)
movl 0x10(%rsp), %ecx
movl %ecx, 0x20(%r14,%rax,4)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5cdd(%rip), %rdi      # 0x10df9
leaq 0x5c5d(%rip), %rsi      # 0x10d80
leaq 0x5cf2(%rip), %rcx      # 0x10e1c
movl $0x39, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: buffer_map
bool
buffer_map(struct buffer *base)
{
	struct intel_buffer *buffer = intel_buffer(&base->base);

	if (drm_intel_gem_bo_map_gtt(buffer->bo) != 0)
		return false;

	buffer->base.base.map = buffer->bo->virtual;

	return true;
}

// Assembly:
pushq %rbx
leaq 0xc335(%rip), %rax      # 0x17a38
cmpq %rax, (%rdi)
jne 0xb72b
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x91b0
testl %eax, %eax
jne 0xb724
movq 0x60(%rbx), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x30(%rbx)
testl %eax, %eax
sete %al
popq %rbx
retq
leaq 0x55f2(%rip), %rdi      # 0x10d24
leaq 0x5647(%rip), %rsi      # 0x10d80
leaq 0x5682(%rip), %rcx      # 0x10dc2
movl $0x3a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/intel.c
// Function: buffer_unmap
bool
buffer_unmap(struct buffer *base)
{
	struct intel_buffer *buffer = intel_buffer(&base->base);

	if (drm_intel_gem_bo_unmap_gtt(buffer->bo) != 0)
		return false;

	buffer->base.base.map = NULL;

	return true;
}

// Assembly:
pushq %rbx
leaq 0xc2e6(%rip), %rax      # 0x17a38
cmpq %rax, (%rdi)
jne 0xb776
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x97d0
testl %eax, %eax
jne 0xb76f
movq $0x0, 0x30(%rbx)
testl %eax, %eax
sete %al
popq %rbx
retq
leaq 0x55a7(%rip), %rdi      # 0x10d24
leaq 0x55fc(%rip), %rsi      # 0x10d80
leaq 0x5637(%rip), %rcx      # 0x10dc2
movl $0x3a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/./intel/batch.h
// Function: intel_batch_add_dwords
static inline void
intel_batch_add_dwords(struct intel_batch *batch,
                       uint32_t count, ...)
{
	va_list dwords;
	va_start(dwords, count);
	intel_batch_add_dwords_va(batch, count, dwords);
	va_end(dwords);
}

// Assembly:
subq $0x58, %rsp
leaq -0x60(%rsp), %r10
movq %rdx, 0x10(%r10)
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0xb81a
movaps %xmm0, -0x30(%rsp)
movaps %xmm1, -0x20(%rsp)
movaps %xmm2, -0x10(%rsp)
movaps %xmm3, (%rsp)
movaps %xmm4, 0x10(%rsp)
movaps %xmm5, 0x20(%rsp)
movaps %xmm6, 0x30(%rsp)
movaps %xmm7, 0x40(%rsp)
movq %r10, -0x70(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x78(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, -0x80(%rsp)
testl %esi, %esi
je 0xb88b
movl -0x80(%rsp), %eax
movq -0x78(%rsp), %rdx
movq -0x70(%rsp), %rcx
cmpl $0x28, %eax
ja 0xb860
movq %rdx, %r8
movl %eax, %edx
addq %rcx, %rdx
addl $0x8, %eax
movl %eax, -0x80(%rsp)
jmp 0xb869
leaq 0x8(%rdx), %r8
movq %r8, -0x78(%rsp)
decl %esi
movl (%rdx), %edx
movl 0x8010(%rdi), %r9d
leal 0x1(%r9), %r10d
movl %r10d, 0x8010(%rdi)
movl %edx, 0x10(%rdi,%r9,4)
movq %r8, %rdx
testl %esi, %esi
jne 0xb84a
addq $0x58, %rsp
retq