LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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
movq %rax, %rbx
testq %rax, %rax
je 0xab28
leaq 0xcea8(%rip), %rsi      # 0x17998
movq %rbx, %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 0x1e(%rip), %rax        # 0xab3a
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
callq 0x97f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xce56(%rip), %rax      # 0x17998
cmpq %rax, (%rsi)
jne 0xab7f
cmpl $0x2000001, %edx        # imm = 0x2000001
je 0xab60
cmpl $0x2000000, %edx        # imm = 0x2000000
jne 0xab7b
movl 0x68(%rsi), %eax
movl %eax, (%rcx)
movb $0x1, %al
jmp 0xab7d
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 0xab7d
xorl %eax, %eax
popq %rcx
retq
leaq 0x619e(%rip), %rdi      # 0x10d24
leaq 0x6158(%rip), %rsi      # 0x10ce5
leaq 0x61b1(%rip), %rcx      # 0x10d45
movl $0x34, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xcdec(%rip), %rax      # 0x17998
cmpq %rax, (%rdi)
jne 0xac27
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 0xabe7
xorl %r14d, %r14d
jmp 0xac1c
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 0xac1c
movq %rax, 0x30(%rbx)
movb $0x1, %r14b
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
leaq 0x60f6(%rip), %rdi      # 0x10d24
leaq 0x60b0(%rip), %rsi      # 0x10ce5
leaq 0x6109(%rip), %rcx      # 0x10d45
movl $0x34, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xac67
movq $0x0, 0x30(%rbx)
cmpl $-0x1, %eax
setne %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xcd1d(%rip), %rax      # 0x17998
cmpq %rax, (%rdi)
jne 0xacac
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 0x6071(%rip), %rdi      # 0x10d24
leaq 0x602b(%rip), %rsi      # 0x10ce5
leaq 0x6084(%rip), %rcx      # 0x10d45
movl $0x34, %edx
callq 0x9380
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xad19
movq %rax, %rbx
leaq 0xccd4(%rip), %rsi      # 0x179c8
movq %rax, %rdi
callq 0xa1b4
movl %ebp, %edi
movl $0x8000, %esi           # imm = 0x8000
callq 0x98b0
movq %rax, 0x8(%rbx)
testq %rax, %rax
jne 0xad1b
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_O3/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 0xcc98(%rip), %rax      # 0x179c8
cmpq %rax, (%rdi)
jne 0xad84
movq %rdi, %r14
movl $0x8030, %edi           # imm = 0x8030
callq 0x9570
testq %rax, %rax
je 0xad77
movq %rax, %rbx
movq %rax, %rdi
addq $0x10, %rdi
movq 0x8(%r14), %rsi
callq 0xba88
testb %al, %al
je 0xad6f
leaq 0xcc8b(%rip), %rsi      # 0x179f0
movq %rbx, %rdi
callq 0xa5ee
jmp 0xad79
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x5f38(%rip), %rdi      # 0x10cc3
leaq 0x5fee(%rip), %rsi      # 0x10d80
leaq 0x5fef(%rip), %rcx      # 0x10d88
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xcc14(%rip), %rax      # 0x179c8
cmpq %rax, (%rdi)
jne 0xae37
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 0x6ab7(%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 0xae2a
movq %rax, %r15
movl 0x8(%rsp), %ecx
movl %r14d, %edi
movl %ebp, %esi
movl %ebx, %edx
movq %rax, %r8
callq 0xb9b2
testq %rax, %rax
jne 0xae2c
movq %r15, %rdi
callq 0x94d0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e85(%rip), %rdi      # 0x10cc3
leaq 0x5f3b(%rip), %rsi      # 0x10d80
leaq 0x5f3c(%rip), %rcx      # 0x10d88
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xcb64(%rip), %rax      # 0x179c8
cmpq %rax, (%rdi)
jne 0xaee5
cmpl $0x2000001, %esi        # imm = 0x2000001
jne 0xaed8
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movl %r8d, %ecx
imull %r14d, %ecx
cmpl $0x34325241, %r9d       # imm = 0x34325241
sete %al
cmpl $0x34325258, %r9d       # 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
testq %rax, %rax
je 0xaed8
movq %rax, %r15
movl 0x30(%rsp), %ecx
movl %r14d, %edi
movl %ebp, %esi
movl %ebx, %edx
movq %rax, %r8
callq 0xb9b2
testq %rax, %rax
jne 0xaeda
movq %r15, %rdi
callq 0x94d0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5dd7(%rip), %rdi      # 0x10cc3
leaq 0x5e8d(%rip), %rsi      # 0x10d80
leaq 0x5e8e(%rip), %rcx      # 0x10d88
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xca91(%rip), %rax      # 0x179f0
cmpq %rax, (%rdi)
jne 0xaf82
testq %rsi, %rsi
je 0xaf78
leaq 0xcac8(%rip), %rax      # 0x17a38
cmpq %rax, (%rsi)
je 0xaf78
xorl %eax, %eax
retq
movq %rsi, 0x8028(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x5e6f(%rip), %rdi      # 0x10df9
leaq 0x5def(%rip), %rsi      # 0x10d80
leaq 0x5e84(%rip), %rcx      # 0x10e1c
movl $0x39, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xca39(%rip), %rax      # 0x179f0
cmpq %rax, (%rdi)
jne 0xb10d
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 0xb017
movq 0x18(%rsp), %rdi
callq 0xc1bc
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 0xb7d5
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 0xb7d5
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 0x5ce5(%rip), %rdi      # 0x10df9
leaq 0x5c65(%rip), %rsi      # 0x10d80
leaq 0x5cfa(%rip), %rcx      # 0x10e1c
movl $0x39, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xc336(%rip), %rax      # 0x17a38
cmpq %rax, (%rdi)
jne 0xb72a
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x91b0
testl %eax, %eax
jne 0xb723
movq 0x60(%rbx), %rcx
movq 0x18(%rcx), %rcx
movq %rcx, 0x30(%rbx)
testl %eax, %eax
sete %al
popq %rbx
retq
leaq 0x55f3(%rip), %rdi      # 0x10d24
leaq 0x5648(%rip), %rsi      # 0x10d80
leaq 0x5683(%rip), %rcx      # 0x10dc2
movl $0x3a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/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 0xc2e7(%rip), %rax      # 0x17a38
cmpq %rax, (%rdi)
jne 0xb775
movq %rdi, %rbx
movq 0x60(%rdi), %rdi
callq 0x97d0
testl %eax, %eax
jne 0xb76e
movq $0x0, 0x30(%rbx)
testl %eax, %eax
sete %al
popq %rbx
retq
leaq 0x55a8(%rip), %rdi      # 0x10d24
leaq 0x55fd(%rip), %rsi      # 0x10d80
leaq 0x5638(%rip), %rcx      # 0x10dc2
movl $0x3a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/intel.c
// Function: new_buffer
static struct buffer *
new_buffer(uint32_t width, uint32_t height,
           uint32_t format, uint32_t pitch,
           drm_intel_bo *bo)
{
	struct intel_buffer *buffer;

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

	buffer_initialize(&buffer->base, &wld_buffer_impl,
	                  width, height, format, pitch);
	buffer->bo = bo;
	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 %r8, %r14
movl %ecx, %ebp
movl %edx, %r15d
movl %esi, %r12d
movl %edi, %r13d
movl $0x68, %edi
callq 0x9570
movq %rax, %rbx
testq %rax, %rax
je 0xba16
leaq 0xc054(%rip), %rsi      # 0x17a38
movq %rbx, %rdi
movl %r13d, %edx
movl %r12d, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x9bbc
movq %r14, 0x60(%rbx)
movq %rbx, %rsi
addq $0x50, %rsi
leaq 0x1e(%rip), %rax        # 0xba28
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
callq 0x97f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/intel.c
// Function: export
static bool export(struct wld_exporter *exporter, struct wld_buffer *base,
                   uint32_t type, union wld_object *object)
{
	struct intel_buffer *buffer = intel_buffer(base);

	switch (type) {
	case WLD_DRM_OBJECT_HANDLE:
		object->u32 = buffer->bo->handle;
		return true;
	case WLD_DRM_OBJECT_PRIME_FD:
		if (drm_intel_bo_gem_export_to_prime(buffer->bo, &object->i) != 0)
			return false;
		return true;
	default:
		return false;
	}
}

// Assembly:
pushq %rax
leaq 0xc008(%rip), %rax      # 0x17a38
cmpq %rax, (%rsi)
jne 0xba69
cmpl $0x2000001, %edx        # imm = 0x2000001
je 0xba52
cmpl $0x2000000, %edx        # imm = 0x2000000
jne 0xba65
movq 0x60(%rsi), %rax
movl 0x28(%rax), %eax
movl %eax, (%rcx)
movb $0x1, %al
jmp 0xba67
movq 0x60(%rsi), %rdi
movq %rcx, %rsi
callq 0x9800
testl %eax, %eax
sete %al
jmp 0xba67
xorl %eax, %eax
popq %rcx
retq
leaq 0x52b4(%rip), %rdi      # 0x10d24
leaq 0x5309(%rip), %rsi      # 0x10d80
leaq 0x5344(%rip), %rcx      # 0x10dc2
movl $0x3a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/intel/batch.c
// Function: intel_batch_flush
void
intel_batch_flush(struct intel_batch *batch)
{
	if (batch->command_count == 0)
		return;

	intel_batch_add_dword(batch, MI_BATCH_BUFFER_END);

	/* Pad the batch buffer to the next quad-word. */
	if (batch->command_count & 1)
		intel_batch_add_dword(batch, MI_NOOP);

	drm_intel_bo_subdata(batch->bo, 0, batch->command_count << 2,
	                     batch->commands);
	drm_intel_bo_mrb_exec(batch->bo, batch->command_count << 2, NULL, 0, 0,
	                      GEN(batch, 6) ? I915_EXEC_BLT
	                                    : I915_EXEC_DEFAULT);
	drm_intel_gem_bo_clear_relocs(batch->bo, 0);
	batch->command_count = 0;
}

// Assembly:
movl 0x8010(%rdi), %eax
testq %rax, %rax
je 0xc253
pushq %rbx
movq %rdi, %rbx
leaq 0x10(%rdi), %rcx
leal 0x1(%rax), %edx
movl %edx, 0x8010(%rdi)
movl $0x5000000, 0x10(%rdi,%rax,4) # imm = 0x5000000
movl 0x8010(%rdi), %edx
testb $0x1, %dl
je 0xc207
movl %edx, %eax
incl %eax
movl %eax, 0x8010(%rbx)
movl $0x0, 0x10(%rbx,%rdx,4)
movl 0x8010(%rbx), %edx
movq 0x8(%rbx), %rdi
shll $0x2, %edx
xorl %esi, %esi
callq 0x9210
movq (%rbx), %rax
movq 0x8(%rbx), %rdi
movl 0x8010(%rbx), %esi
shll $0x2, %esi
xorl %ecx, %ecx
cmpl $0x6, (%rax)
setge %cl
leal (%rcx,%rcx,2), %r9d
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x92f0
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x9540
movl $0x0, 0x8010(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.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 nouveau_context *context = nouveau_context(base);
	struct nouveau_buffer *buffer;
	uint32_t bpp = format_bytes_per_pixel(format),
	         pitch = roundup(width * bpp, 64), bo_flags;
	union nouveau_bo_config config = {};

	if (!(buffer = new_buffer(context, width, height, format, pitch)))
		goto error0;

	bo_flags = NOUVEAU_BO_VRAM;

	if (flags & WLD_DRM_FLAG_SCANOUT)
		bo_flags |= NOUVEAU_BO_CONTIG;

	if (height > 0x40 && !(flags & WLD_FLAG_MAP)) {
		config.nvc0.tile_mode = 0x40;
		config.nvc0.memtype = 0xfe;
		height = roundup(height, 0x80);
	} else
		bo_flags |= NOUVEAU_BO_MAP;

	if (nouveau_bo_new(context->device, bo_flags, 0, pitch * height,
	                   &config, &buffer->bo)
	    != 0) {
		goto error1;
	}

	return &buffer->base;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
leaq 0xb5c1(%rip), %rax      # 0x17a68
cmpq %rax, (%rdi)
jne 0xc56e
movl %r8d, %r12d
movl %edx, %ebx
movq %rdi, %r15
cmpl $0x34325241, %ecx       # imm = 0x34325241
sete %al
cmpl $0x34325258, %ecx       # imm = 0x34325258
sete %dl
orb %al, %dl
movzbl %dl, %eax
imull %esi, %eax
leal 0x3f(,%rax,4), %ebp
andl $-0x40, %ebp
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movl %ebx, %edx
movl %ebp, %r8d
callq 0xd153
testq %rax, %rax
je 0xc55b
movq %rax, %r14
movl %r12d, %esi
andl $0x1, %esi
shll $0x1e, %esi
incl %esi
cmpl $0x41, %ebx
setb %al
shrl $0x10, %r12d
andl $0x1, %r12d
orb %al, %r12b
jne 0xc52e
movabsq $0x40000000fe, %rax     # imm = 0x40000000FE
movq %rax, (%rsp)
addl $0x7f, %ebx
andl $-0x80, %ebx
jmp 0xc534
orl $0x80000000, %esi       # imm = 0x80000000
movq 0x8(%r15), %rdi
imull %ebp, %ebx
movq %r14, %r9
addq $0x68, %r9
movq %rsp, %r8
xorl %edx, %edx
movq %rbx, %rcx
callq 0x9370
testl %eax, %eax
je 0xc55e
movq %r14, %rdi
callq 0x9060
xorl %r14d, %r14d
movq %r14, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x474e(%rip), %rdi      # 0x10cc3
leaq 0x4e84(%rip), %rsi      # 0x11400
leaq 0x4e87(%rip), %rcx      # 0x1140a
movl $0x4a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.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 nouveau_context *context = (void *)base;
	struct nouveau_buffer *buffer;
	struct nouveau_bo *bo = NULL;

	switch (type) {
	case WLD_DRM_OBJECT_PRIME_FD:
		if (nouveau_bo_prime_handle_ref(context->device,
		                                object.i, &bo)
		    != 0) {
			goto error0;
		}
		break;
	default:
		goto error0;
	}

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

	buffer->bo = bo;

	return &buffer->base;

error1:
	nouveau_bo_ref(NULL, &buffer->bo);
error0:
	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq $0x0, (%rsp)
cmpl $0x2000001, %esi        # imm = 0x2000001
jne 0xc5c5
movl %r9d, %ebx
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdi, %r15
movq 0x8(%rdi), %rdi
movq %rsp, %rax
movl %edx, %esi
movq %rax, %rdx
callq 0x9050
testl %eax, %eax
je 0xc5d5
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x30(%rsp), %r8d
movq %r15, %rdi
movl %r14d, %esi
movl %ebp, %edx
movl %ebx, %ecx
callq 0xd153
testq %rax, %rax
je 0xc5fb
movq %rax, %rbx
movq (%rsp), %rax
movq %rax, 0x68(%rbx)
jmp 0xc5c7
xorl %ebx, %ebx
movl $0x68, %esi
xorl %edi, %edi
callq 0x9850
jmp 0xc5c7
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: context_destroy
void
context_destroy(struct wld_context *base)
{
	struct nouveau_context *context = nouveau_context(base);

	nouveau_client_del(&context->client);
	nouveau_device_del(&context->device);
	free(context);
}

// Assembly:
pushq %rbx
leaq 0xb455(%rip), %rax      # 0x17a68
cmpq %rax, (%rdi)
jne 0xc636
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x9790
leaq 0x8(%rbx), %rdi
callq 0x9840
movq %rbx, %rdi
popq %rbx
jmp 0x9060
leaq 0x4686(%rip), %rdi      # 0x10cc3
leaq 0x4dbc(%rip), %rsi      # 0x11400
leaq 0x4dbf(%rip), %rcx      # 0x1140a
movl $0x4a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: nvc0_methods
static inline void
nvc0_methods(struct nouveau_pushbuf *push,
             uint8_t subchannel, uint16_t start_method,
             uint16_t count, ...)
{
	va_list dwords;
	nv_add_dword(push, nvc0_command(GF100_COMMAND_TYPE_INCREASING,
	                                subchannel, start_method, count));
	va_start(dwords, count);
	nv_add_dwords_va(push, count, dwords);
	va_end(dwords);
}

// Assembly:
subq $0x58, %rsp
leaq -0x60(%rsp), %rsi
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xc691
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)
movl %ecx, %eax
shll $0x10, %eax
shrl $0x2, %edx
orl %eax, %edx
orl $0x20006000, %edx       # imm = 0x20006000
movq 0x30(%rdi), %rax
leaq 0x4(%rax), %r8
movq %r8, 0x30(%rdi)
movl %edx, (%rax)
movq %rsi, -0x70(%rsp)
leaq 0x60(%rsp), %rax
movq %rax, -0x78(%rsp)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, -0x80(%rsp)
testl %ecx, %ecx
je 0xc711
movq 0x30(%rdi), %rax
movl -0x80(%rsp), %esi
cmpq $0x28, %rsi
ja 0xc6f0
movq %rsi, %rdx
addq -0x70(%rsp), %rdx
addl $0x8, %esi
movl %esi, -0x80(%rsp)
jmp 0xc6fe
movq -0x78(%rsp), %rdx
leaq 0x8(%rdx), %rsi
movq %rsi, -0x78(%rsp)
decl %ecx
movl (%rdx), %edx
movl %edx, (%rax)
addq $0x4, %rax
testw %cx, %cx
jne 0xc6d5
movq %rax, 0x30(%rdi)
addq $0x58, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: renderer_set_target
bool
renderer_set_target(struct wld_renderer *base, struct buffer *buffer)
{
	struct nouveau_renderer *renderer = nouveau_renderer(base);

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

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

	return true;
}

// Assembly:
leaq 0xb360(%rip), %rax      # 0x17a90
cmpq %rax, (%rdi)
jne 0xc750
testq %rsi, %rsi
je 0xc749
leaq 0xb397(%rip), %rax      # 0x17ad8
cmpq %rax, (%rsi)
je 0xc749
xorl %eax, %eax
retq
movq %rsi, 0x30(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x46a1(%rip), %rdi      # 0x10df9
leaq 0x4ca1(%rip), %rsi      # 0x11400
leaq 0x4d1d(%rip), %rcx      # 0x11483
movl $0x4b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: renderer_destroy
void
renderer_destroy(struct wld_renderer *base)
{
	struct nouveau_renderer *renderer = nouveau_renderer(base);

	nvc0_2d_finalize(renderer);
	nouveau_bufctx_del(&renderer->bufctx);
	nouveau_pushbuf_del(&renderer->pushbuf);
	nouveau_object_del(&renderer->channel);
	free(renderer);
}

// Assembly:
pushq %rbx
leaq 0xaa92(%rip), %rax      # 0x17a90
cmpq %rax, (%rdi)
jne 0xd033
movq %rdi, %rbx
addq $0x28, %rdi
callq 0x93d0
leaq 0x20(%rbx), %rdi
callq 0x9700
leaq 0x18(%rbx), %rdi
callq 0x9550
leaq 0x10(%rbx), %rdi
callq 0x93d0
movq %rbx, %rdi
popq %rbx
jmp 0x9060
leaq 0x3dbf(%rip), %rdi      # 0x10df9
leaq 0x43bf(%rip), %rsi      # 0x11400
leaq 0x443b(%rip), %rcx      # 0x11483
movl $0x4b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: buffer_map
bool
buffer_map(struct buffer *base)
{
	struct nouveau_buffer *buffer = nouveau_buffer(&base->base);

	/* If the buffer is tiled, it cannot be mapped into virtual memory in order
	 * to appear linear like intel can do with map_gtt. */
	if (buffer->bo->config.nvc0.tile_mode)
		return false;

	if (nouveau_bo_map(buffer->bo, NOUVEAU_BO_WR,
	                   buffer->context->client)
	    != 0) {
		return false;
	}

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

	return true;
}

// Assembly:
pushq %rbx
leaq 0xaa7e(%rip), %rax      # 0x17ad8
cmpq %rax, (%rdi)
jne 0xd096
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
cmpl $0x0, 0x34(%rdi)
jne 0xd082
movq 0x60(%rbx), %rax
movq 0x10(%rax), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x96c0
testl %eax, %eax
je 0xd086
xorl %eax, %eax
popq %rbx
retq
movq 0x68(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x30(%rbx)
movb $0x1, %al
jmp 0xd084
leaq 0x3c87(%rip), %rdi      # 0x10d24
leaq 0x435c(%rip), %rsi      # 0x11400
leaq 0x439d(%rip), %rcx      # 0x11448
movl $0x4c, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: buffer_unmap
bool
buffer_unmap(struct buffer *base)
{
	struct nouveau_buffer *buffer = nouveau_buffer(&base->base);

	if (munmap(buffer->bo->map, buffer->bo->size) == -1)
		return false;

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

	return true;
}

// Assembly:
pushq %rbx
leaq 0xaa1b(%rip), %rax      # 0x17ad8
cmpq %rax, (%rdi)
jne 0xd0f1
movq %rdi, %rbx
movq 0x68(%rdi), %rax
movq 0x10(%rax), %rsi
movq 0x28(%rax), %rdi
callq 0x9630
cmpl $-0x1, %eax
je 0xd0e9
movq 0x68(%rbx), %rcx
xorl %edx, %edx
movq %rdx, 0x28(%rcx)
movq %rdx, 0x30(%rbx)
cmpl $-0x1, %eax
setne %al
popq %rbx
retq
leaq 0x3c2c(%rip), %rdi      # 0x10d24
leaq 0x4301(%rip), %rsi      # 0x11400
leaq 0x4342(%rip), %rcx      # 0x11448
movl $0x4c, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: new_buffer
static struct nouveau_buffer *
new_buffer(struct nouveau_context *context,
           uint32_t width, uint32_t height,
           uint32_t format, uint32_t pitch)
{
	struct nouveau_buffer *buffer;

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

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

	return buffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %r14
movl $0x70, %edi
callq 0x9570
movq %rax, %rbx
testq %rax, %rax
je 0xd1b8
leaq 0xa952(%rip), %rsi      # 0x17ad8
movq %rbx, %rdi
movl %r13d, %edx
movl %r12d, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x9bbc
movq %r14, 0x60(%rbx)
movq %rbx, %rsi
addq $0x50, %rsi
leaq 0x1e(%rip), %rax        # 0xd1ca
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
callq 0x97f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/nouveau.c
// Function: export
static bool export(struct wld_exporter *exporter, struct wld_buffer *base,
                   uint32_t type, union wld_object *object)
{
	struct nouveau_buffer *buffer = nouveau_buffer(base);

	switch (type) {
	case WLD_DRM_OBJECT_HANDLE:
		object->u32 = buffer->bo->handle;
		return true;
	case WLD_DRM_OBJECT_PRIME_FD:
		if (nouveau_bo_set_prime(buffer->bo, &object->i) != 0)
			return false;
		return true;
	default:
		return false;
	}
}

// Assembly:
pushq %rax
leaq 0xa906(%rip), %rax      # 0x17ad8
cmpq %rax, (%rsi)
jne 0xd20b
cmpl $0x2000001, %edx        # imm = 0x2000001
je 0xd1f4
cmpl $0x2000000, %edx        # imm = 0x2000000
jne 0xd207
movq 0x68(%rsi), %rax
movl 0x8(%rax), %eax
movl %eax, (%rcx)
movb $0x1, %al
jmp 0xd209
movq 0x68(%rsi), %rdi
movq %rcx, %rsi
callq 0x96e0
testl %eax, %eax
sete %al
jmp 0xd209
xorl %eax, %eax
popq %rcx
retq
leaq 0x3b12(%rip), %rdi      # 0x10d24
leaq 0x41e7(%rip), %rsi      # 0x11400
leaq 0x4228(%rip), %rcx      # 0x11448
movl $0x4c, %edx
callq 0x9380
nop
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: context_create_renderer
struct wld_renderer *
context_create_renderer(struct wld_context *context)
{
	struct pixman_renderer *renderer;

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

	if (!(renderer->glyph_cache = pixman_glyph_cache_create()))
		goto error1;

	renderer_initialize(&renderer->base, &wld_renderer_impl);
	renderer->target = NULL;

	return &renderer->base;

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

// Assembly:
pushq %rbx
movl $0x20, %edi
callq 0x9570
testq %rax, %rax
je 0xd2b6
movq %rax, %rbx
callq 0x9720
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xd2ae
leaq 0xa87c(%rip), %rsi      # 0x17b18
movq %rbx, %rdi
callq 0xa5ee
movq $0x0, 0x10(%rbx)
jmp 0xd2b8
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: context_create_buffer
struct buffer *
context_create_buffer(struct wld_context *context,
                      uint32_t width, uint32_t height,
                      uint32_t format, uint32_t flags)
{
	struct buffer *buffer;
	pixman_image_t *image;

	image = pixman_image_create_bits(format_wld_to_pixman(format),
	                                 width, height, NULL, 0);

	if (!image)
		goto error0;

	if (!(buffer = new_buffer(image)))
		goto error1;

	return buffer;

error1:
	pixman_image_unref(image);
error0:
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
cmpl $0x34325258, %ecx       # imm = 0x34325258
movl $0x20020888, %eax       # imm = 0x20020888
cmovnel %ebx, %eax
cmpl $0x34325241, %ecx       # imm = 0x34325241
movl $0x20028888, %edi       # imm = 0x20028888
cmovnel %eax, %edi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x9670
testq %rax, %rax
je 0xd30b
movq %rax, %r14
movq %rax, %rdi
callq 0xdb98
movq %rax, %rbx
testq %rax, %rax
jne 0xd30b
movq %r14, %rdi
callq 0x93e0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: context_import_buffer
struct buffer *
context_import_buffer(struct wld_context *context,
                      uint32_t type, union wld_object object,
                      uint32_t width, uint32_t height,
                      uint32_t format, uint32_t pitch)
{
	struct buffer *buffer;
	pixman_image_t *image;

	switch (type) {
	case WLD_OBJECT_DATA:
		image = pixman_image_create_bits(format_wld_to_pixman(format),
		                                 width, height, object.ptr, pitch);
		break;
	default:
		image = NULL;
	}

	if (!image)
		goto error0;

	if (!(buffer = new_buffer(image)))
		goto error1;

	return buffer;

error1:
	pixman_image_unref(image);
error0:
	return NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
testl %esi, %esi
je 0xd32b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdx, %rax
movl 0x20(%rsp), %r10d
cmpl $0x34325258, %r9d       # imm = 0x34325258
movl $0x20020888, %edx       # imm = 0x20020888
cmovnel %ebx, %edx
cmpl $0x34325241, %r9d       # imm = 0x34325241
movl $0x20028888, %edi       # imm = 0x20028888
cmovnel %edx, %edi
movl %ecx, %esi
movl %r8d, %edx
movq %rax, %rcx
movl %r10d, %r8d
callq 0x9670
testq %rax, %rax
je 0xd320
movq %rax, %r14
movq %rax, %rdi
callq 0xdb98
movq %rax, %rbx
testq %rax, %rax
jne 0xd320
movq %r14, %rdi
callq 0x93e0
xorl %ebx, %ebx
jmp 0xd320
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: renderer_set_target
bool
renderer_set_target(struct wld_renderer *base, struct buffer *buffer)
{
	struct pixman_renderer *renderer = pixman_renderer(base);

	if (renderer->target)
		pixman_image_unref(renderer->target);

	if (buffer)
		return (renderer->target = pixman_image(buffer));

	renderer->target = NULL;
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0xa781(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd3d7
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0xd3b0
callq 0x93e0
testq %r14, %r14
je 0xd3c5
movq %r14, %rdi
callq 0xda34
testq %rax, %rax
setne %cl
jmp 0xd3c9
movb $0x1, %cl
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3a1b(%rip), %rdi      # 0x10df9
leaq 0x40df(%rip), %rsi      # 0x114c4
leaq 0x40e1(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.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 pixman_renderer *renderer = pixman_renderer(base);
	pixman_color_t pixman_color = PIXMAN_COLOR(color);
	pixman_box32_t box = { x, y, x + width, y + height };

	pixman_image_fill_boxes(PIXMAN_OP_SRC, renderer->target,
	                        &pixman_color, 1, &box);
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movl %esi, %eax
leaq 0xa714(%rip), %rsi      # 0x17b18
cmpq %rsi, (%rdi)
jne 0xd483
movl %eax, %esi
shrl $0x10, %esi
movl $0xff, %r10d
andl %r10d, %esi
movzbl %ah, %ebx
andl %eax, %r10d
movd %esi, %xmm0
pinsrw $0x1, %ebx, %xmm0
pinsrw $0x2, %r10d, %xmm0
shrl $0x18, %eax
pinsrw $0x3, %eax, %xmm0
movdqa %xmm0, %xmm1
psllw $0x8, %xmm1
paddw %xmm0, %xmm1
leaq 0x8(%rsp), %rax
movq %xmm1, (%rax)
leaq 0x10(%rsp), %r10
movl %edx, (%r10)
movl %ecx, 0x4(%r10)
addl %edx, %r8d
movl %r8d, 0x8(%r10)
addl %ecx, %r9d
movl %r9d, 0xc(%r10)
movq 0x10(%rdi), %rsi
movl $0x1, %edi
movq %rax, %rdx
movl $0x1, %ecx
movq %r10, %r8
callq 0x9580
addq $0x20, %rsp
popq %rbx
retq
leaq 0x396f(%rip), %rdi      # 0x10df9
leaq 0x4033(%rip), %rsi      # 0x114c4
leaq 0x4035(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: renderer_fill_region
void
renderer_fill_region(struct wld_renderer *base, uint32_t color,
                     pixman_region32_t *region)
{
	struct pixman_renderer *renderer = pixman_renderer(base);
	pixman_color_t pixman_color = PIXMAN_COLOR(color);
	pixman_box32_t *boxes;
	int num_boxes;

	boxes = pixman_region32_rectangles(region, &num_boxes);
	pixman_image_fill_boxes(PIXMAN_OP_SRC, renderer->target,
	                        &pixman_color, num_boxes, boxes);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xa666(%rip), %rcx      # 0x17b18
cmpq %rcx, (%rdi)
jne 0xd52b
movl %esi, %eax
movq %rdi, %rbx
movl %esi, %ecx
shrl $0x10, %ecx
movl $0xff, %esi
andl %esi, %ecx
movzbl %ah, %edi
andl %eax, %esi
movd %ecx, %xmm0
pinsrw $0x1, %edi, %xmm0
pinsrw $0x2, %esi, %xmm0
shrl $0x18, %eax
pinsrw $0x3, %eax, %xmm0
movdqa %xmm0, %xmm1
psllw $0x8, %xmm1
paddw %xmm0, %xmm1
leaq 0x8(%rsp), %r14
movq %xmm1, (%r14)
leaq 0x4(%rsp), %r15
movq %rdx, %rdi
movq %r15, %rsi
callq 0x93b0
movq 0x10(%rbx), %rsi
movl (%r15), %ecx
movl $0x1, %edi
movq %r14, %rdx
movq %rax, %r8
callq 0x9580
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38c7(%rip), %rdi      # 0x10df9
leaq 0x3f8b(%rip), %rsi      # 0x114c4
leaq 0x3f8d(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: renderer_copy_rectangle
void
renderer_copy_rectangle(struct wld_renderer *base, struct buffer *buffer,
                        int32_t dst_x, int32_t dst_y,
                        int32_t src_x, int32_t src_y,
                        uint32_t width, uint32_t height)
{
	struct pixman_renderer *renderer = pixman_renderer(base);
	pixman_image_t *src = pixman_image(buffer), *dst = renderer->target;

	if (!src)
		return;

	pixman_image_composite32(PIXMAN_OP_SRC, src, NULL, dst,
	                         src_x, src_y, 0, 0, dst_x, dst_y, width, height);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xa5bf(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd5b8
movl %r9d, %ebp
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %ebx
movq %rdi, %r12
movq %rsi, %rdi
callq 0xda34
testq %rax, %rax
je 0xd5af
movl 0x38(%rsp), %r10d
movl 0x30(%rsp), %r11d
movq 0x10(%r12), %rcx
xorl %r12d, %r12d
movl $0x1, %edi
movq %rax, %rsi
xorl %edx, %edx
movl %r15d, %r8d
movl %ebp, %r9d
pushq %r10
pushq %r11
pushq %r14
pushq %rbx
pushq %r12
pushq %r12
callq 0x9120
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x383a(%rip), %rdi      # 0x10df9
leaq 0x3efe(%rip), %rsi      # 0x114c4
leaq 0x3f00(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: renderer_copy_region
void
renderer_copy_region(struct wld_renderer *base, struct buffer *buffer,
                     int32_t dst_x, int32_t dst_y,
                     pixman_region32_t *region)
{
	struct pixman_renderer *renderer = pixman_renderer(base);
	pixman_image_t *src = pixman_image(buffer), *dst = renderer->target;
	pixman_region32_t clip;

	if (!src)
		return;

	pixman_region32_init(&clip);
	pixman_region32_copy(&clip, region);
	pixman_region32_translate(&clip, dst_x, dst_y);

	pixman_image_set_clip_region32(dst, &clip);
	pixman_image_composite32(PIXMAN_OP_SRC, src, NULL, dst,
	                         region->extents.x1, region->extents.y1, 0, 0,
	                         region->extents.x1 + dst_x,
	                         region->extents.y1 + dst_y,
	                         region->extents.x2 - region->extents.x1,
	                         region->extents.y2 - region->extents.y1);
	pixman_image_set_clip_region32(dst, NULL);

	pixman_region32_fini(&clip);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xa52c(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd6a6
movq %r8, %r13
movl %ecx, %r14d
movl %edx, %ebx
movq %rdi, %r15
movq %rsi, %rdi
callq 0xda34
testq %rax, %rax
je 0xd697
movq %rax, %rbp
movq 0x10(%r15), %r12
movq %rsp, %r15
movq %r15, %rdi
callq 0x9230
movq %r15, %rdi
movq %r13, %rsi
callq 0x92c0
movq %r15, %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x95e0
movq %r12, %rdi
movq %r15, %rsi
callq 0x9410
movl (%r13), %r8d
movl 0x4(%r13), %r9d
addl %r8d, %ebx
addl %r9d, %r14d
movl 0x8(%r13), %eax
subl %r8d, %eax
movl 0xc(%r13), %r10d
subl %r9d, %r10d
xorl %r11d, %r11d
movl $0x1, %edi
movq %rbp, %rsi
xorl %edx, %edx
movq %r12, %rcx
pushq %r10
pushq %rax
pushq %r14
pushq %rbx
pushq %r11
pushq %r11
callq 0x9120
addq $0x30, %rsp
movq %r12, %rdi
xorl %esi, %esi
callq 0x9410
movq %r15, %rdi
callq 0x9130
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x374c(%rip), %rdi      # 0x10df9
leaq 0x3e10(%rip), %rsi      # 0x114c4
leaq 0x3e12(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: pixman_image
static pixman_image_t *
pixman_image(struct buffer *buffer)
{
	if (buffer->base.impl == &wld_buffer_impl)
		return pixman_image_ref(pixman_buffer(&buffer->base)->image);

	union wld_object object;

	if (wld_export(&buffer->base, WLD_PIXMAN_OBJECT_IMAGE, &object))
		return object.ptr;

	struct pixman_map *map;
	pixman_image_t *image;

	if (!wld_map(&buffer->base))
		goto error0;

	image = pixman_image_create_bits(format_wld_to_pixman(buffer->base.format),
	                                 buffer->base.width, buffer->base.height,
	                                 buffer->base.map, buffer->base.pitch);

	if (!image)
		goto error1;

	if (!(map = malloc(sizeof *map)))
		goto error2;

	map->image = image;
	map->exporter.export = &map_export;
	wld_buffer_add_exporter(&buffer->base, &map->exporter);
	map->destructor.destroy = &map_destroy;
	wld_buffer_add_destructor(&buffer->base, &map->destructor);
	pixman_image_set_destroy_function(image, &destroy_image, buffer);

	return pixman_image_ref(image);

error2:
	pixman_image_unref(image);
error1:
	wld_unmap(&buffer->base);
error0:
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0xa119(%rip), %rax      # 0x17b60
cmpq %rax, (%rdi)
je 0xda6c
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl $0x1000000, %esi        # imm = 0x1000000
callq 0x9890
testb %al, %al
je 0xda7e
movq 0x8(%rsp), %rax
jmp 0xdb3f
movq 0x50(%rbx), %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x94f0
movq %rbx, %rdi
callq 0x91a0
movl %eax, %ecx
xorl %eax, %eax
testb %cl, %cl
je 0xdb3f
movl 0x14(%rbx), %ecx
cmpl $0x34325258, %ecx       # imm = 0x34325258
movl $0x20020888, %edx       # imm = 0x20020888
cmovel %edx, %eax
cmpl $0x34325241, %ecx       # imm = 0x34325241
movl $0x20028888, %edi       # imm = 0x20028888
cmovnel %eax, %edi
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq 0x30(%rbx), %rcx
movl 0x10(%rbx), %r8d
callq 0x9670
testq %rax, %rax
je 0xdb35
movq %rax, %r14
movl $0x28, %edi
callq 0x9570
testq %rax, %rax
je 0xdb2d
movq %rax, %r15
movq %r14, 0x20(%rax)
leaq -0x8bd(%rip), %rax      # 0xd22c
movq %rax, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x97f0
movq %r15, %rsi
addq $0x10, %rsi
leaq -0x8ab(%rip), %rax      # 0xd25a
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x96f0
leaq 0x31(%rip), %rsi        # 0xdb49
movq %r14, %rdi
movq %rbx, %rdx
callq 0x9870
movq %r14, %rdi
callq 0x94f0
jmp 0xdb3f
movq %r14, %rdi
callq 0x93e0
movq %rbx, %rdi
callq 0x9140
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/pixman.c
// Function: new_buffer
static struct buffer *
new_buffer(pixman_image_t *image)
{
	struct pixman_buffer *buffer;

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

	buffer_initialize(&buffer->base, &wld_buffer_impl,
	                  pixman_image_get_width(image),
	                  pixman_image_get_height(image),
	                  format_pixman_to_wld(pixman_image_get_format(image)),
	                  pixman_image_get_stride(image));
	buffer->base.base.map = pixman_image_get_data(image);
	buffer->image = image;

	return &buffer->base;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl $0x58, %edi
callq 0x9570
movq %rax, %r14
testq %rax, %rax
je 0xdc22
movq %rbx, %rdi
callq 0x9430
movl %eax, %ebp
movq %rbx, %rdi
callq 0x9470
movl %eax, %r15d
movq %rbx, %rdi
callq 0x9180
xorl %ecx, %ecx
cmpl $0x20020888, %eax       # imm = 0x20020888
movl $0x34325258, %edx       # imm = 0x34325258
cmovnel %ecx, %edx
cmpl $0x20028888, %eax       # imm = 0x20028888
movl $0x34325241, %r12d      # imm = 0x34325241
cmovnel %edx, %r12d
movq %rbx, %rdi
callq 0x9510
leaq 0x9f61(%rip), %rsi      # 0x17b60
movq %r14, %rdi
movl %ebp, %edx
movl %r15d, %ecx
movl %r12d, %r8d
movl %eax, %r9d
callq 0x9bbc
movq %rbx, %rdi
callq 0x97a0
movq %rax, 0x30(%r14)
movq %rbx, 0x50(%r14)
movq %r14, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/michaelforney[P]wld/wayland.c
// Function: wld_wayland_create_surface
wld_surface *
wld_wayland_create_surface(struct wld_context *context,
                           uint32_t width, uint32_t height,
                           uint32_t format, uint32_t flags,
                           struct wl_surface *wl)
{
	struct wayland_buffer_socket *socket;

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

	socket->base.impl = &buffer_socket_impl;
	socket->listener.release = &buffer_release;
	socket->wl = wl;
	socket->queue = ((struct wayland_context *)context)->queue;
	socket->display = ((struct wayland_context *)context)->display;
	socket->surface = buffered_surface_create(context, width, height, format,
	                                          flags, &socket->base);

	if (!socket->surface)
		goto error1;

	return socket->surface;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movl %r8d, 0x4(%rsp)
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbp
movl $0x30, %edi
callq 0x9570
testq %rax, %rax
je 0xdee0
movq %rax, %rbx
leaq 0x9cf4(%rip), %rax      # 0x17b90
movq %rax, (%rbx)
leaq 0x4b(%rip), %rax        # 0xdef1
movq %rax, 0x8(%rbx)
movq %r13, 0x18(%rbx)
movups 0x10(%rbp), %xmm0
movups %xmm0, 0x20(%rbx)
movq %rbp, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl 0x4(%rsp), %r8d
movq %rbx, %r9
callq 0x9d0c
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0xdee2
movq %rbx, %rdi
callq 0x9060
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq