LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/intel.c
// Function: renderer_copy_rectangle
void
renderer_copy_rectangle(struct wld_renderer *base,
                        struct buffer *buffer_base,
                        int32_t dst_x, int32_t dst_y,
                        int32_t src_x, int32_t src_y,
                        uint32_t width, uint32_t height)
{
	struct intel_renderer *renderer = intel_renderer(base);

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

	struct intel_buffer *src = intel_buffer(&buffer_base->base),
	                    *dst = renderer->target;

	xy_src_copy_blt(&renderer->batch,
	                src->bo, src->base.base.pitch, src_x, src_y,
	                dst->bo, dst->base.base.pitch, dst_x, dst_y, width, height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x60, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movl %ecx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0xc4f0
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
leaq 0xfae1(%rip), %rcx      # 0x1ba50
cmpq %rcx, (%rax)
je 0xbf79
jmp 0xc01d
movq -0x20(%rbp), %rdi
callq 0xc4a0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x8028(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x38(%rbp), %rdi
addq $0x10, %rdi
movq -0x40(%rbp), %rax
movq 0x60(%rax), %rsi
movq -0x40(%rbp), %rax
movl 0x10(%rax), %eax
movw %ax, %dx
movl -0x2c(%rbp), %eax
movw %ax, %cx
movl -0x30(%rbp), %eax
movw %ax, %r8w
movq -0x48(%rbp), %rax
movq 0x60(%rax), %r9
movq -0x48(%rbp), %rax
movl 0x10(%rax), %eax
movw %ax, %r14w
movl -0x24(%rbp), %eax
movw %ax, %bx
movl -0x28(%rbp), %eax
movw %ax, %r11w
movl 0x10(%rbp), %eax
movw %ax, %r10w
movl 0x18(%rbp), %eax
movzwl %dx, %edx
movzwl %cx, %ecx
movzwl %r8w, %r8d
movzwl %r14w, %r14d
movl %r14d, (%rsp)
movzwl %bx, %ebx
movl %ebx, 0x8(%rsp)
movzwl %r11w, %r11d
movl %r11d, 0x10(%rsp)
movzwl %r10w, %r10d
movl %r10d, 0x18(%rsp)
movzwl %ax, %eax
movl %eax, 0x20(%rsp)
callq 0xc8d0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xc4a0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x91c0
cmpl $0x0, %eax
je 0xc3e1
movb $0x0, -0x1(%rbp)
jmp 0xc3f9
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x18(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xc4a0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x97f0
cmpl $0x0, %eax
je 0xc441
movb $0x0, -0x1(%rbp)
jmp 0xc451
movq -0x18(%rbp), %rax
movq $0x0, 0x30(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x68, %edi
callq 0x9590
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xcea6
movq $0x0, -0x8(%rbp)
jmp 0xcef8
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %edx
movl -0x10(%rbp), %ecx
movl -0x14(%rbp), %r8d
movl -0x18(%rbp), %r9d
leaq 0xeb91(%rip), %rsi      # 0x1ba50
callq 0x99b0
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rax
leaq 0x35(%rip), %rcx        # 0xcf10
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x50, %rsi
callq 0x9810
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xc4a0
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
subl $0x2000000, %eax        # imm = 0x2000000
je 0xcf4f
jmp 0xcf43
movl -0x34(%rbp), %eax
subl $0x2000001, %eax        # imm = 0x2000001
je 0xcf66
jmp 0xcf88
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x28(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xcf8c
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x9820
cmpl $0x0, %eax
je 0xcf82
movb $0x0, -0x1(%rbp)
jmp 0xcf8c
movb $0x1, -0x1(%rbp)
jmp 0xcf8c
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/intel/batch.c
// Function: intel_batch_initialize
bool
intel_batch_initialize(struct intel_batch *batch,
                       drm_intel_bufmgr *bufmgr)
{
	int device_id = drm_intel_bufmgr_gem_get_devid(bufmgr);

	batch->command_count = 0;
	batch->device_info = device_info(device_id);

	if (!batch->device_info)
		return false;

	/* Alignment argument (4096) is not used */
	batch->bo = drm_intel_bo_alloc(bufmgr, "batchbuffer", sizeof batch->commands, 4096);

	if (!batch->bo)
		return false;

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x9640
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x8010(%rax)
movl -0x1c(%rbp), %edi
callq 0xd080
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xd02c
movb $0x0, -0x1(%rbp)
jmp 0xd066
movq -0x18(%rbp), %rdi
leaq 0x7e2f(%rip), %rsi      # 0x14e66
movl $0x8000, %edx           # imm = 0x8000
movl $0x1000, %ecx           # imm = 0x1000
callq 0x90b0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0xd062
movb $0x0, -0x1(%rbp)
jmp 0xd066
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8010(%rax)
jne 0xe87e
jmp 0xe92c
movq -0x8(%rbp), %rdi
movl $0x5000000, %esi        # imm = 0x5000000
callq 0xe940
movq -0x8(%rbp), %rax
movl 0x8010(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xe8a9
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xe940
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8010(%rax), %eax
shll $0x2, %eax
movl %eax, %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
addq $0x10, %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x9220
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8010(%rax), %esi
shll $0x2, %esi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
xorl %r9d, %r9d
movl $0x3, %eax
cmpl $0x6, %ecx
cmovgel %eax, %r9d
xorl %eax, %eax
movl %eax, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x9300
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x9560
movq -0x8(%rbp), %rax
movl $0x0, 0x8010(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/nouveau.c
// Function: driver_create_context
struct wld_context *
driver_create_context(int drm_fd)
{
	struct nouveau_context *context;

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

	if (nouveau_device_wrap(drm_fd, 0, &context->device) != 0)
		goto error1;

	switch (context->device->chipset & ~0xf) {
	/* TODO: Support NV50
	case 0x50:
	case 0x80:
	case 0x90:
	case 0xa0:
		context->architecture = NV_ARCH_50;
		break;
	*/
	case 0xc0:
	case 0xd0:
		context->architecture = NV_ARCH_C0;
		break;
	/* TODO: Support NVE0
	case 0xe0:
	case 0xf0:
	case 0x100:
		context->architecture = NV_ARCH_E0;
		break;
	*/
	default:
		return NULL;
	}

	if (nouveau_client_new(context->device, &context->client) != 0)
		goto error2;

	context_initialize(&context->base, &wld_context_impl);

	return &context->base;

error2:
	nouveau_device_del(&context->device);
error1:
	free(context);
error0:
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0xc(%rbp)
movl $0x20, %edi
callq 0x9590
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0xe9b4
jmp 0xea4a
movl -0xc(%rbp), %edi
movq -0x18(%rbp), %rdx
addq $0x8, %rdx
xorl %esi, %esi
callq 0x9080
cmpl $0x0, %eax
je 0xe9cd
jmp 0xea41
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl 0x2c(%rax), %eax
orl $0x10, %eax
andl $-0x10, %eax
subl $0xd0, %eax
je 0xe9e7
jmp 0xe9f4
movq -0x18(%rbp), %rax
movl $0xc0, 0x18(%rax)
jmp 0xe9fe
movq $0x0, -0x8(%rbp)
jmp 0xea52
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
addq $0x10, %rsi
callq 0x95f0
cmpl $0x0, %eax
je 0xea1a
jmp 0xea34
movq -0x18(%rbp), %rdi
leaq 0xd05b(%rip), %rsi      # 0x1ba80
callq 0xa3f0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xea52
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x9860
movq -0x18(%rbp), %rdi
callq 0x9060
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/nouveau.c
// Function: context_create_renderer
struct wld_renderer *
context_create_renderer(struct wld_context *base)
{
	struct nouveau_context *context = nouveau_context(base);
	struct nouveau_renderer *renderer;
	struct nvc0_fifo fifo = {};
	int ret;

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

	ret = nouveau_object_new(&context->device->object, 0,
	                         NOUVEAU_FIFO_CHANNEL_CLASS, &fifo, sizeof fifo,
	                         &renderer->channel);

	if (ret != 0)
		goto error1;

	ret = nouveau_pushbuf_new(context->client, renderer->channel, 4, 32 * 1024,
	                          true, &renderer->pushbuf);

	if (ret != 0)
		goto error2;

	if (nouveau_bufctx_new(context->client, 1, &renderer->bufctx) != 0)
		goto error3;

	if (!nvc0_2d_initialize(renderer))
		goto error4;

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

	return &renderer->base;

error4:
	nouveau_bufctx_del(&renderer->bufctx);
error3:
	nouveau_pushbuf_del(&renderer->pushbuf);
error2:
	nouveau_object_del(&renderer->channel);
error1:
	free(renderer);
error0:
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xee10
movq %rax, -0x18(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x93c0
movl $0x38, %edi
callq 0x9590
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0xeaa2
jmp 0xeb96
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %r9
addq $0x10, %r9
xorl %eax, %eax
movl %eax, %esi
movl $0x80000001, %edx       # imm = 0x80000001
leaq -0x50(%rbp), %rcx
movl $0x30, %r8d
callq 0x9160
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0xead8
jmp 0xeb8d
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movq -0x20(%rbp), %r9
addq $0x18, %r9
movl $0x4, %edx
movl $0x8000, %ecx           # imm = 0x8000
movl $0x1, %r8d
callq 0x9230
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0xeb10
jmp 0xeb80
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rdx
addq $0x20, %rdx
movl $0x1, %esi
callq 0x94c0
cmpl $0x0, %eax
je 0xeb31
jmp 0xeb73
movq -0x20(%rbp), %rdi
callq 0xee60
testb $0x1, %al
jne 0xeb40
jmp 0xeb66
movq -0x20(%rbp), %rdi
leaq 0xcf5d(%rip), %rsi      # 0x1baa8
callq 0xace0
movq -0x20(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xeb9e
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
callq 0x9720
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
callq 0x9570
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0x93f0
movq -0x20(%rbp), %rdi
callq 0x9060
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xee10
movq %rax, -0x28(%rbp)
movl -0x1c(%rbp), %edi
callq 0xfd60
movzbl %al, %eax
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %edi
imull -0x34(%rbp), %edi
movl $0x40, %esi
callq 0xfda0
movl %eax, -0x38(%rbp)
movq 0x63cd(%rip), %rax      # 0x14fcc
movq %rax, -0x5c(%rbp)
movq 0x63ca(%rip), %rax      # 0x14fd4
movq %rax, -0x54(%rbp)
movq 0x63c7(%rip), %rax      # 0x14fdc
movq %rax, -0x4c(%rbp)
movq 0x63c4(%rip), %rax      # 0x14fe4
movq %rax, -0x44(%rbp)
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x1c(%rbp), %ecx
movl -0x38(%rbp), %r8d
callq 0xfdc0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0xec49
jmp 0xece7
movl $0x1, -0x3c(%rbp)
movl -0x20(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xec66
movl -0x3c(%rbp), %eax
orl $0x40000000, %eax       # imm = 0x40000000
movl %eax, -0x3c(%rbp)
cmpl $0x40, -0x18(%rbp)
jbe 0xec99
movl -0x20(%rbp), %eax
andl $0x10000, %eax          # imm = 0x10000
cmpl $0x0, %eax
jne 0xec99
movl $0x40, -0x58(%rbp)
movl $0xfe, -0x5c(%rbp)
movl -0x18(%rbp), %edi
movl $0x80, %esi
callq 0xfda0
movl %eax, -0x18(%rbp)
jmp 0xeca4
movl -0x3c(%rbp), %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x3c(%rbp), %esi
movl -0x38(%rbp), %eax
imull -0x18(%rbp), %eax
movl %eax, %eax
movl %eax, %ecx
movq -0x30(%rbp), %r9
addq $0x68, %r9
xorl %edx, %edx
leaq -0x5c(%rbp), %r8
callq 0x9380
cmpl $0x0, %eax
je 0xecd4
jmp 0xecde
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xecef
movq -0x30(%rbp), %rdi
callq 0x9060
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdx, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x40(%rbp)
movl -0x1c(%rbp), %eax
subl $0x2000001, %eax        # imm = 0x2000001
jne 0xed5a
jmp 0xed3d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
movl -0x10(%rbp), %esi
leaq -0x40(%rbp), %rdx
callq 0x9050
cmpl $0x0, %eax
je 0xed58
jmp 0xeda5
jmp 0xed5c
jmp 0xeda5
movq -0x30(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0xfdc0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0xed7e
jmp 0xed94
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xedad
movq -0x38(%rbp), %rsi
addq $0x68, %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0x9870
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xee10
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x97b0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x9860
movq -0x10(%rbp), %rdi
callq 0x9060
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/nouveau.c
// Function: nvc0_2d_initialize
static bool
nvc0_2d_initialize(struct nouveau_renderer *renderer)
{
	int ret;

	ret = nouveau_object_new(renderer->channel, GF100_2D, GF100_2D, NULL, 0,
	                         &renderer->nvc0_2d);

	if (ret != 0)
		goto error0;

	if (!ensure_space(renderer->pushbuf, 5))
		goto error1;

	nvc0_2d(renderer->pushbuf, NV1_SUBCHAN_OBJECT, 1,
	        renderer->nvc0_2d->handle);
	nvc0_2d_inline(renderer->pushbuf, G80_2D_OPERATION,
	               G80_2D_OPERATION_SRCCOPY_AND);
	nvc0_2d_inline(renderer->pushbuf, G80_2D_UNK0884, 0x3f);
	nvc0_2d_inline(renderer->pushbuf, G80_2D_UNK0888, 1);

	return true;

error1:
	nouveau_object_del(&renderer->nvc0_2d);
error0:
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %r9
addq $0x28, %r9
movl $0x902d, %esi           # imm = 0x902D
movl $0x902d, %edx           # imm = 0x902D
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x9160
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xeea0
jmp 0xef43
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x5, %esi
callq 0xef60
testb $0x1, %al
jne 0xeeb8
jmp 0xef36
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %r8
movl $0x3, %esi
xorl %edx, %edx
movl $0x1, %ecx
movb $0x0, %al
callq 0xefc0
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x3, %esi
movl $0x2ac, %edx            # imm = 0x2AC
xorl %ecx, %ecx
callq 0xf090
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x3, %esi
movl $0x884, %edx            # imm = 0x884
movl $0x3f, %ecx
callq 0xf090
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x3, %esi
movl $0x888, %edx            # imm = 0x888
movl $0x1, %ecx
callq 0xf090
movb $0x1, -0x1(%rbp)
jmp 0xef47
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
callq 0x93f0
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
testb %al, %al
je 0xeff8
movaps %xmm0, -0xb0(%rbp)
movaps %xmm1, -0xa0(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm3, -0x80(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm7, -0x40(%rbp)
movq %r9, -0xb8(%rbp)
movq %r8, -0xc0(%rbp)
movw %cx, %ax
movw %dx, %cx
movb %sil, %dl
movq %rdi, -0x8(%rbp)
movb %dl, -0x9(%rbp)
movw %cx, -0xc(%rbp)
movw %ax, -0xe(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movzbl -0x9(%rbp), %esi
movzwl -0xc(%rbp), %edx
movzwl -0xe(%rbp), %ecx
movl $0x1, %edi
callq 0xf120
movq -0xe8(%rbp), %rdi
movl %eax, %esi
callq 0xf0f0
leaq -0xe0(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x30, -0x2c(%rbp)
movl $0x20, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movzwl -0xe(%rbp), %esi
leaq -0x30(%rbp), %rdx
callq 0xf170
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0xfaf0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xf27a
movq -0x18(%rbp), %rax
leaq 0xc881(%rip), %rcx      # 0x1baf0
cmpq %rcx, (%rax)
je 0xf27a
movb $0x0, -0x1(%rbp)
jmp 0xf2a8
cmpq $0x0, -0x18(%rbp)
je 0xf290
movq -0x18(%rbp), %rdi
callq 0xfaa0
movq %rax, -0x28(%rbp)
jmp 0xf298
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0xf298
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/nouveau.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 nouveau_renderer *renderer = nouveau_renderer(base);
	struct nouveau_buffer *dst = renderer->target;
	uint32_t format;

	if (!ensure_space(renderer->pushbuf, 18))
		return;

	format = nvc0_format(dst->base.base.format);

	nouveau_bufctx_reset(renderer->bufctx, 0);
	nvc0_2d_use_buffer(renderer, dst, G80_2D_DST_FORMAT, format);
	nvc0_2d(renderer->pushbuf, G80_2D_DRAW_SHAPE, 3,
	        G80_2D_DRAW_SHAPE_RECTANGLES, format, color);
	nouveau_pushbuf_bufctx(renderer->pushbuf, renderer->bufctx);

	if (nouveau_pushbuf_validate(renderer->pushbuf) != 0)
		return;

	nvc0_2d(renderer->pushbuf, G80_2D_DRAW_POINT32_X(0), 4,
	        x, y, x + width, y + height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0xfaf0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movl $0x12, %esi
callq 0xef60
testb $0x1, %al
jne 0xf311
jmp 0xf3d7
movq -0x30(%rbp), %rax
movl 0x14(%rax), %edi
callq 0xfb40
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x9120
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x34(%rbp), %eax
movl $0x200, %edx            # imm = 0x200
movzwl %ax, %ecx
callq 0xfb80
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x34(%rbp), %r9d
movl -0xc(%rbp), %eax
movl $0x3, %ecx
movl $0x580, %edx            # imm = 0x580
movl $0x4, %r8d
movl %ecx, %esi
movl %eax, (%rsp)
movb $0x0, %al
callq 0xefc0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x92e0
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x9480
cmpl $0x0, %eax
je 0xf39b
jmp 0xf3d7
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movl -0x10(%rbp), %r8d
movl -0x14(%rbp), %r9d
movl -0x10(%rbp), %r10d
addl -0x18(%rbp), %r10d
movl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
movl $0x3, %esi
movl $0x600, %edx            # imm = 0x600
movl $0x4, %ecx
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0xefc0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xfaf0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xfd40
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
callq 0x9720
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
callq 0x9570
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x93f0
movq -0x10(%rbp), %rdi
callq 0x9060
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xfaa0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
cmpl $0x0, 0x34(%rax)
je 0xf99d
movb $0x0, -0x1(%rbp)
jmp 0xf9de
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x96e0
cmpl $0x0, %eax
je 0xf9c6
movb $0x0, -0x1(%rbp)
jmp 0xf9de
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xfaa0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x28(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9650
cmpl $-0x1, %eax
jne 0xfa31
movb $0x0, -0x1(%rbp)
jmp 0xfa51
movq -0x18(%rbp), %rax
movq 0x68(%rax), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x30(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/nouveau.c
// Function: nvc0_format
static inline uint32_t
nvc0_format(uint32_t format)
{
	switch (format) {
	case WLD_FORMAT_XRGB8888:
		return G80_SURFACE_FORMAT_BGRX8_UNORM;
	case WLD_FORMAT_ARGB8888:
		return G80_SURFACE_FORMAT_BGRA8_UNORM;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x8(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
subl $0x34325241, %eax       # imm = 0x34325241
je 0xfb6b
jmp 0xfb56
movl -0xc(%rbp), %eax
subl $0x34325258, %eax       # imm = 0x34325258
jne 0xfb74
jmp 0xfb62
movl $0xe6, -0x4(%rbp)
jmp 0xfb7b
movl $0xcf, -0x4(%rbp)
jmp 0xfb7b
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/nouveau.c
// Function: nvc0_2d_use_buffer
static inline void
nvc0_2d_use_buffer(struct nouveau_renderer *renderer,
                   struct nouveau_buffer *buffer,
                   uint16_t format_method, uint16_t format)
{
	uint32_t access = format == G80_2D_SRC_FORMAT ? NOUVEAU_BO_RD
	                                              : NOUVEAU_BO_WR;

	nvc0_2d_inline(renderer->pushbuf, format_method, format);

	if (buffer->bo->config.nvc0.memtype) {
		nvc0_2d(renderer->pushbuf, format_method + 0x04, 2,
		        0, buffer->bo->config.nvc0.tile_mode);
	} else {
		nvc0_2d_inline(renderer->pushbuf, format_method + 0x04, 1);
		nvc0_2d(renderer->pushbuf, format_method + 0x14, 1,
		        buffer->base.base.pitch);
	}

	nvc0_2d(renderer->pushbuf, format_method + 0x18, 4,
	        buffer->base.base.width, buffer->base.base.height,
	        buffer->bo->offset >> 32, buffer->bo->offset);
	nouveau_bufctx_refn(renderer->bufctx, 0, buffer->bo,
	                    NOUVEAU_BO_VRAM | access);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %cx, %ax
movw %dx, %cx
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movw %cx, -0x12(%rbp)
movw %ax, -0x14(%rbp)
movzwl -0x14(%rbp), %edx
movl $0x200, %eax            # imm = 0x200
movl $0x100, %ecx            # imm = 0x100
cmpl $0x230, %edx            # imm = 0x230
cmovel %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movw -0x12(%rbp), %ax
movl $0x3, %esi
movzwl %ax, %edx
movzwl -0x14(%rbp), %ecx
callq 0xf090
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
cmpl $0x0, 0x30(%rax)
je 0xfc17
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movzwl -0x12(%rbp), %eax
addl $0x4, %eax
movq -0x10(%rbp), %rcx
movq 0x68(%rcx), %rcx
movl 0x34(%rcx), %r9d
movl $0x3, %esi
movl $0x2, %ecx
xorl %r8d, %r8d
movzwl %ax, %edx
movb $0x0, %al
callq 0xefc0
jmp 0xfc63
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movzwl -0x12(%rbp), %eax
addl $0x4, %eax
movl $0x3, %esi
movl $0x1, %ecx
movzwl %ax, %edx
callq 0xf090
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movzwl -0x12(%rbp), %eax
addl $0x14, %eax
movq -0x10(%rbp), %rcx
movl 0x10(%rcx), %r8d
movl $0x3, %esi
movl $0x1, %ecx
movzwl %ax, %edx
movb $0x0, %al
callq 0xefc0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movzwl -0x12(%rbp), %eax
addl $0x18, %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0xc(%rax), %r9d
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x20(%rax), %r10
shrq $0x20, %r10
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rax
movq 0x20(%rax), %rax
movl $0x3, %esi
movl $0x4, %ecx
movzwl %dx, %edx
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0xefc0
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rdx
movl -0x18(%rbp), %ecx
orl $0x1, %ecx
xorl %esi, %esi
callq 0x95e0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl $0x70, %edi
callq 0x9590
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0xfdf7
movq $0x0, -0x8(%rbp)
jmp 0xfe49
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movl -0x20(%rbp), %r9d
leaq 0xbce0(%rip), %rsi      # 0x1baf0
callq 0x99b0
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x28(%rbp), %rax
leaq 0x34(%rip), %rcx        # 0xfe60
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x50, %rsi
callq 0x9810
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0xfaa0
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
subl $0x2000000, %eax        # imm = 0x2000000
je 0xfe9f
jmp 0xfe93
movl -0x34(%rbp), %eax
subl $0x2000001, %eax        # imm = 0x2000001
je 0xfeb6
jmp 0xfed8
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rax
movl 0x8(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xfedc
movq -0x30(%rbp), %rax
movq 0x68(%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x9700
cmpl $0x0, %eax
je 0xfed2
movb $0x0, -0x1(%rbp)
jmp 0xfedc
movb $0x1, -0x1(%rbp)
jmp 0xfedc
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/pixman.c
// Function: map_export
bool
map_export(struct wld_exporter *exporter, struct wld_buffer *buffer,
           uint32_t type, union wld_object *object)
{
	struct pixman_map *map = CONTAINER_OF(exporter, struct pixman_map, exporter);

	switch (type) {
	case WLD_PIXMAN_OBJECT_IMAGE:
		object->ptr = pixman_image_ref(map->image);
		return true;
	default:
		return false;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x1c(%rbp), %eax
subl $0x1000000, %eax        # imm = 0x1000000
jne 0xff38
jmp 0xff1b
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x9510
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0xff3c
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl $0x20, %edi
callq 0x9590
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0xffb2
jmp 0xfff6
callq 0x9740
movq -0x18(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0xffc7
jmp 0xffed
movq -0x18(%rbp), %rdi
leaq 0xbb5e(%rip), %rsi      # 0x1bb30
callq 0xace0
movq -0x18(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xfffe
movq -0x18(%rbp), %rdi
callq 0x9060
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl -0x1c(%rbp), %edi
callq 0x10b90
movl %eax, %edi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
xorl %eax, %eax
movl %eax, %ecx
xorl %r8d, %r8d
callq 0x9690
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x10052
jmp 0x1007a
movq -0x30(%rbp), %rdi
callq 0x10cc0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x10067
jmp 0x10071
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x10082
movq -0x30(%rbp), %rdi
callq 0x9400
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl 0x10(%rbp), %eax
movq %rdx, -0x10(%rbp)
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movl -0x1c(%rbp), %eax
testl %eax, %eax
jne 0x100dd
jmp 0x100ba
movl -0x28(%rbp), %edi
callq 0x10b90
movl %eax, %edi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
movq -0x10(%rbp), %rcx
movl 0x10(%rbp), %r8d
callq 0x9690
movq %rax, -0x38(%rbp)
jmp 0x100e5
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x100ee
jmp 0x10116
movq -0x38(%rbp), %rdi
callq 0x10cc0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x10103
jmp 0x1010d
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1011e
movq -0x38(%rbp), %rdi
callq 0x9400
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10990
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x10195
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x9400
cmpq $0x0, -0x18(%rbp)
je 0x101bb
movq -0x18(%rbp), %rdi
callq 0x109e0
movq -0x20(%rbp), %rcx
movq %rax, 0x10(%rcx)
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x101cb
movq -0x20(%rbp), %rax
movq $0x0, 0x10(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
movl %r9d, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10990
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x30(%rbp)
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x2e(%rbp)
movl -0xc(%rbp), %eax
shrl $0x0, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x2c(%rbp)
movl -0xc(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x2a(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x10(%rbp), %eax
addl -0x18(%rbp), %eax
movl %eax, -0x38(%rbp)
movl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
movl $0x1, %ecx
leaq -0x30(%rbp), %rdx
leaq -0x40(%rbp), %r8
movl %ecx, %edi
callq 0x95a0
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10990
movq %rax, -0x20(%rbp)
movl -0xc(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x28(%rbp)
movl -0xc(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x26(%rbp)
movl -0xc(%rbp), %eax
shrl $0x0, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x24(%rbp)
movl -0xc(%rbp), %eax
shrl $0x18, %eax
andl $0xff, %eax
imull $0x101, %eax, %eax      # imm = 0x101
movw %ax, -0x22(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x93d0
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x34(%rbp), %ecx
movq -0x30(%rbp), %r8
movl $0x1, %edi
leaq -0x28(%rbp), %rdx
callq 0x95a0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl %edx, -0x24(%rbp)
movl %ecx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x10990
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rdi
callq 0x109e0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x103a6
jmp 0x103f4
movq -0x40(%rbp), %rsi
movq -0x48(%rbp), %rcx
movl -0x2c(%rbp), %r8d
movl -0x30(%rbp), %r9d
movl -0x24(%rbp), %ebx
movl -0x28(%rbp), %r11d
movl 0x10(%rbp), %r10d
movl 0x18(%rbp), %eax
movl $0x1, %edi
xorl %edx, %edx
xorl %r14d, %r14d
movl $0x0, (%rsp)
movl $0x0, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movl %eax, 0x28(%rsp)
callq 0x9130
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)