LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/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
testq %rax, %rax
je 0xba19
movq %rax, %rbx
leaq 0xc053(%rip), %rsi      # 0x17a38
movq %rax, %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 0x22(%rip), %rax        # 0xba2d
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
callq 0x97f0
jmp 0xba1b
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/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 0xc003(%rip), %rax      # 0x17a38
cmpq %rax, (%rsi)
jne 0xba6e
cmpl $0x2000001, %edx        # imm = 0x2000001
je 0xba57
cmpl $0x2000000, %edx        # imm = 0x2000000
jne 0xba6a
movq 0x60(%rsi), %rax
movl 0x28(%rax), %eax
movl %eax, (%rcx)
movb $0x1, %al
jmp 0xba6c
movq 0x60(%rsi), %rdi
movq %rcx, %rsi
callq 0x9800
testl %eax, %eax
sete %al
jmp 0xba6c
xorl %eax, %eax
popq %rcx
retq
leaq 0x52af(%rip), %rdi      # 0x10d24
leaq 0x5304(%rip), %rsi      # 0x10d80
leaq 0x533f(%rip), %rcx      # 0x10dc2
movl $0x3a, %edx
callq 0x9380
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/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 0xc259
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), %eax
testb $0x1, %al
je 0xc207
leal 0x1(%rax), %edx
movl %edx, 0x8010(%rbx)
movl $0x0, 0x10(%rbx,%rax,4)
movq 0x8(%rbx), %rdi
movl 0x8010(%rbx), %edx
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
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xb5a8(%rip), %rax      # 0x17a68
cmpq %rax, (%rdi)
jne 0xc587
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 0xd160
testq %rax, %rax
je 0xc574
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 0xc547
movabsq $0x40000000fe, %rax     # imm = 0x40000000FE
movq %rax, (%rsp)
addl $0x7f, %ebx
andl $-0x80, %ebx
jmp 0xc54d
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 0xc577
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 0x4735(%rip), %rdi      # 0x10cc3
leaq 0x4e6b(%rip), %rsi      # 0x11400
leaq 0x4e6e(%rip), %rcx      # 0x1140a
movl $0x4a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xc5de
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 0xc5ee
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 0xd160
testq %rax, %rax
je 0xc614
movq %rax, %rbx
movq (%rsp), %rax
movq %rax, 0x68(%rbx)
jmp 0xc5e0
xorl %ebx, %ebx
movl $0x68, %esi
xorl %edi, %edi
callq 0x9850
jmp 0xc5e0
// File: /workspace/github_c_makefile_star2_O1/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 0xb43c(%rip), %rax      # 0x17a68
cmpq %rax, (%rdi)
jne 0xc64f
movq %rdi, %rbx
addq $0x10, %rdi
callq 0x9790
leaq 0x8(%rbx), %rdi
callq 0x9840
movq %rbx, %rdi
popq %rbx
jmp 0x9060
leaq 0x466d(%rip), %rdi      # 0x10cc3
leaq 0x4da3(%rip), %rsi      # 0x11400
leaq 0x4da6(%rip), %rcx      # 0x1140a
movl $0x4a, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xc6aa
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 0xc72a
movq 0x30(%rdi), %rax
movl -0x80(%rsp), %esi
cmpq $0x28, %rsi
ja 0xc709
movq %rsi, %rdx
addq -0x70(%rsp), %rdx
addl $0x8, %esi
movl %esi, -0x80(%rsp)
jmp 0xc717
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 0xc6ee
movq %rax, 0x30(%rdi)
addq $0x58, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xb347(%rip), %rax      # 0x17a90
cmpq %rax, (%rdi)
jne 0xc76b
testq %rsi, %rsi
je 0xc762
leaq 0xb37e(%rip), %rax      # 0x17ad8
cmpq %rax, (%rsi)
je 0xc764
xorl %eax, %eax
retq
xorl %esi, %esi
movq %rsi, 0x30(%rdi)
movb $0x1, %al
retq
pushq %rax
leaq 0x4686(%rip), %rdi      # 0x10df9
leaq 0x4c86(%rip), %rsi      # 0x11400
leaq 0x4d02(%rip), %rcx      # 0x11483
movl $0x4b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xaa85(%rip), %rax      # 0x17a90
cmpq %rax, (%rdi)
jne 0xd040
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 0x3db2(%rip), %rdi      # 0x10df9
leaq 0x43b2(%rip), %rsi      # 0x11400
leaq 0x442e(%rip), %rcx      # 0x11483
movl $0x4b, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xaa71(%rip), %rax      # 0x17ad8
cmpq %rax, (%rdi)
jne 0xd0a3
movq %rdi, %rbx
movq 0x68(%rdi), %rdi
cmpl $0x0, 0x34(%rdi)
jne 0xd08f
movq 0x60(%rbx), %rax
movq 0x10(%rax), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x96c0
testl %eax, %eax
je 0xd093
xorl %eax, %eax
popq %rbx
retq
movq 0x68(%rbx), %rax
movq 0x28(%rax), %rax
movq %rax, 0x30(%rbx)
movb $0x1, %al
jmp 0xd091
leaq 0x3c7a(%rip), %rdi      # 0x10d24
leaq 0x434f(%rip), %rsi      # 0x11400
leaq 0x4390(%rip), %rcx      # 0x11448
movl $0x4c, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xaa0e(%rip), %rax      # 0x17ad8
cmpq %rax, (%rdi)
jne 0xd0fe
movq %rdi, %rbx
movq 0x68(%rdi), %rax
movq 0x10(%rax), %rsi
movq 0x28(%rax), %rdi
callq 0x9630
cmpl $-0x1, %eax
je 0xd0f6
movq 0x68(%rbx), %rcx
xorl %edx, %edx
movq %rdx, 0x28(%rcx)
movq %rdx, 0x30(%rbx)
cmpl $-0x1, %eax
setne %al
popq %rbx
retq
leaq 0x3c1f(%rip), %rdi      # 0x10d24
leaq 0x42f4(%rip), %rsi      # 0x11400
leaq 0x4335(%rip), %rcx      # 0x11448
movl $0x4c, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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
testq %rax, %rax
je 0xd1c7
movq %rax, %rbx
leaq 0xa945(%rip), %rsi      # 0x17ad8
movq %rax, %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 0x22(%rip), %rax        # 0xd1db
movq %rax, 0x50(%rbx)
movq %rbx, %rdi
callq 0x97f0
jmp 0xd1c9
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/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 0xa8f5(%rip), %rax      # 0x17ad8
cmpq %rax, (%rsi)
jne 0xd21c
cmpl $0x2000001, %edx        # imm = 0x2000001
je 0xd205
cmpl $0x2000000, %edx        # imm = 0x2000000
jne 0xd218
movq 0x68(%rsi), %rax
movl 0x8(%rax), %eax
movl %eax, (%rcx)
movb $0x1, %al
jmp 0xd21a
movq 0x68(%rsi), %rdi
movq %rcx, %rsi
callq 0x96e0
testl %eax, %eax
sete %al
jmp 0xd21a
xorl %eax, %eax
popq %rcx
retq
leaq 0x3b01(%rip), %rdi      # 0x10d24
leaq 0x41d6(%rip), %rsi      # 0x11400
leaq 0x4217(%rip), %rcx      # 0x11448
movl $0x4c, %edx
callq 0x9380
nop
// File: /workspace/github_c_makefile_star2_O1/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 0xd2c6
movq %rax, %rbx
callq 0x9720
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0xd2be
leaq 0xa86c(%rip), %rsi      # 0x17b18
movq %rbx, %rdi
callq 0xa606
movq $0x0, 0x10(%rbx)
jmp 0xd2c8
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/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 0xd31b
movq %rax, %r14
movq %rax, %rdi
callq 0xdbe7
movq %rax, %rbx
testq %rax, %rax
jne 0xd31b
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_O1/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 0xa782(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd3da
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0xd3af
callq 0x93e0
testq %r14, %r14
je 0xd3c8
movq %r14, %rdi
callq 0xda83
movq %rax, 0x10(%rbx)
testq %rax, %rax
setne %al
jmp 0xd3d2
movq $0x0, 0x10(%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x3a18(%rip), %rdi      # 0x10df9
leaq 0x40dc(%rip), %rsi      # 0x114c4
leaq 0x40de(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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
leaq 0xa713(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd4a6
movl %esi, %r10d
shrl $0x10, %r10d
movl $0xff, %r11d
movl %r10d, %eax
andl %r11d, %eax
shll $0x8, %r10d
orl %eax, %r10d
leaq 0x8(%rsp), %rax
movw %r10w, (%rax)
movl %esi, %r10d
shrl $0x8, %r10d
andl %r11d, %r10d
movl %esi, %ebx
andl $0xff00, %ebx           # imm = 0xFF00
orl %r10d, %ebx
movw %bx, 0x2(%rax)
andl %esi, %r11d
movl %esi, %r10d
shll $0x8, %r10d
orl %r11d, %r10d
movw %r10w, 0x4(%rax)
movl %esi, %r10d
shrl $0x18, %r10d
shldl $0x8, %esi, %r10d
movw %r10w, 0x6(%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 0x394c(%rip), %rdi      # 0x10df9
leaq 0x4010(%rip), %rsi      # 0x114c4
leaq 0x4012(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xa643(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd560
movq %rdi, %rbx
movl %esi, %eax
shrl $0x10, %eax
movl $0xff, %ecx
movl %eax, %edi
andl %ecx, %edi
shll $0x8, %eax
orl %edi, %eax
leaq 0x8(%rsp), %r14
movw %ax, (%r14)
movl %esi, %eax
shrl $0x8, %eax
andl %ecx, %eax
movl %esi, %edi
andl $0xff00, %edi           # imm = 0xFF00
orl %eax, %edi
movw %di, 0x2(%r14)
andl %esi, %ecx
movl %esi, %eax
shll $0x8, %eax
orl %ecx, %eax
movw %ax, 0x4(%r14)
movl %esi, %eax
shrl $0x18, %eax
shldl $0x8, %esi, %eax
movw %ax, 0x6(%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 0x3892(%rip), %rdi      # 0x10df9
leaq 0x3f56(%rip), %rsi      # 0x114c4
leaq 0x3f58(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xa58a(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd5ed
movl %r9d, %ebp
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %ebx
movq %rdi, %r12
movq %rsi, %rdi
callq 0xda83
testq %rax, %rax
je 0xd5e4
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 0x3805(%rip), %rdi      # 0x10df9
leaq 0x3ec9(%rip), %rsi      # 0x114c4
leaq 0x3ecb(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xa4f7(%rip), %rax      # 0x17b18
cmpq %rax, (%rdi)
jne 0xd6db
movq %r8, %r13
movl %ecx, %r14d
movl %edx, %ebx
movq %rdi, %r15
movq %rsi, %rdi
callq 0xda83
testq %rax, %rax
je 0xd6cc
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 0x3717(%rip), %rdi      # 0x10df9
leaq 0x3ddb(%rip), %rsi      # 0x114c4
leaq 0x3ddd(%rip), %rcx      # 0x114cd
movl $0x38, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/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 0xa0ca(%rip), %rax      # 0x17b60
cmpq %rax, (%rdi)
je 0xdabb
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
movl $0x1000000, %esi        # imm = 0x1000000
callq 0x9890
testb %al, %al
je 0xdacd
movq 0x8(%rsp), %rax
jmp 0xdb8e
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 0xdb8e
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 0xdb84
movq %rax, %r14
movl $0x28, %edi
callq 0x9570
testq %rax, %rax
je 0xdb7c
movq %rax, %r15
movq %r14, 0x20(%rax)
leaq -0x8fc(%rip), %rax      # 0xd23c
movq %rax, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x97f0
movq %r15, %rsi
addq $0x10, %rsi
leaq -0x8ea(%rip), %rax      # 0xd26a
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x96f0
leaq 0x31(%rip), %rsi        # 0xdb98
movq %r14, %rdi
movq %rbx, %rdx
callq 0x9870
movq %r14, %rdi
callq 0x94f0
jmp 0xdb8e
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_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x58, %edi
callq 0x9570
xorl %r15d, %r15d
testq %rax, %rax
je 0xdc79
movq %rax, %r14
movq %rbx, %rdi
callq 0x9430
movl %eax, %ebp
movq %rbx, %rdi
callq 0x9470
movl %eax, %r12d
movq %rbx, %rdi
callq 0x9180
cmpl $0x20020888, %eax       # imm = 0x20020888
movl $0x34325258, %ecx       # imm = 0x34325258
cmovel %ecx, %r15d
cmpl $0x20028888, %eax       # imm = 0x20028888
movl $0x34325241, %r13d      # imm = 0x34325241
cmovnel %r15d, %r13d
movq %rbx, %rdi
callq 0x9510
leaq 0x9f0d(%rip), %rsi      # 0x17b60
movq %r14, %rdi
movl %ebp, %edx
movl %r12d, %ecx
movl %r13d, %r8d
movl %eax, %r9d
callq 0x9bbc
movq %rbx, %rdi
callq 0x97a0
movq %rax, 0x30(%r14)
movq %rbx, 0x50(%r14)
movq %r14, %r15
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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, %rbp
movl %r8d, 0x4(%rsp)
movl %ecx, %r14d
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r13
movl $0x30, %edi
callq 0x9570
testq %rax, %rax
je 0xdf5a
movq %rax, %rbx
leaq 0x9c82(%rip), %rax      # 0x17b90
movq %rax, (%rbx)
leaq 0x53(%rip), %rax        # 0xdf6b
movq %rax, 0x8(%rbx)
movq %rbp, 0x18(%rbx)
movq 0x18(%r13), %rax
movq %rax, 0x28(%rbx)
movq 0x10(%r13), %rax
movq %rax, 0x20(%rbx)
movq %r13, %rdi
movl %r12d, %esi
movl %r15d, %edx
movl %r14d, %ecx
movl 0x4(%rsp), %r8d
movq %rbx, %r9
callq 0x9d08
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0xdf5c
movq %rbx, %rdi
callq 0x9060
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland.c
// Function: wayland_buffer_add_exporter
bool
wayland_buffer_add_exporter(struct buffer *buffer, struct wl_buffer *wl)
{
	struct wayland_buffer *wayland_buffer;

	if (!(wayland_buffer = malloc(sizeof *wayland_buffer)))
		return false;

	wayland_buffer->wl = wl;
	wayland_buffer->exporter.export = &buffer_export;
	wld_buffer_add_exporter(&buffer->base, &wayland_buffer->exporter);
	wayland_buffer->destructor.destroy = &buffer_destroy;
	wld_buffer_add_destructor(&buffer->base, &wayland_buffer->destructor);

	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x28, %edi
callq 0x9570
movq %rax, %rbx
testq %rax, %rax
je 0xdfdb
movq %r15, 0x20(%rbx)
leaq 0x31(%rip), %rax        # 0xdfe7
movq %rax, (%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x97f0
leaq 0x10(%rbx), %rsi
leaq 0x31(%rip), %rax        # 0xe000
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x96f0
testq %rbx, %rbx
setne %al
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland.c
// Function: buffer_socket_attach
bool
buffer_socket_attach(struct buffer_socket *base, struct buffer *buffer)
{
	struct wayland_buffer_socket *socket = wayland_buffer_socket(base);
	struct wl_buffer *wl;
	union wld_object object;

	if (!wld_export(&buffer->base, WLD_WAYLAND_OBJECT_BUFFER, &object))
		return false;

	wl = object.ptr;

	if (!wl_proxy_get_listener((struct wl_proxy *)wl))
		wl_buffer_add_listener(wl, &socket->listener, buffer);

	wl_surface_attach(socket->wl, wl, 0, 0);

	if (pixman_region32_not_empty(&buffer->base.damage)) {
		pixman_box32_t *box;
		int num_boxes;

		box = pixman_region32_rectangles(&buffer->base.damage, &num_boxes);

		while (num_boxes--) {
			wl_surface_damage(socket->wl, box->x1, box->y1,
			                  box->x2 - box->x1, box->y2 - box->y1);
		}
	}

	wl_surface_commit(socket->wl);

	return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x9b3f(%rip), %rax      # 0x17b90
cmpq %rax, (%rdi)
jne 0xe189
movq %rsi, %r15
movq %rdi, %r14
leaq 0x10(%rsp), %rdx
movq %rsi, %rdi
movl $0x3000000, %esi        # imm = 0x3000000
callq 0x9890
movl %eax, %ebx
testb %al, %al
je 0xe178
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x91e0
testq %rax, %rax
jne 0xe09d
leaq 0x8(%r14), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x92b0
movq 0x18(%r14), %r13
movq %r13, %rdi
callq 0x9170
xorl %r10d, %r10d
movq %r13, %rdi
movl $0x1, %esi
xorl %edx, %edx
movl %eax, %ecx
xorl %r8d, %r8d
movq %r12, %r9
xorl %eax, %eax
pushq %r10
pushq %r10
callq 0x9400
addq $0x10, %rsp
addq $0x18, %r15
movq %r15, %rdi
callq 0x91f0
testl %eax, %eax
je 0xe156
movb %bl, 0x3(%rsp)
leaq 0x4(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x93b0
subl $0x1, (%r12)
jb 0xe152
movq %rax, %r15
movq %r14, 0x8(%rsp)
movq 0x18(%r14), %r12
movl (%r15), %ebp
movl 0x4(%r15), %r13d
movl 0x8(%r15), %ebx
subl %ebp, %ebx
movl 0xc(%r15), %r14d
subl %r13d, %r14d
movq %r12, %rdi
callq 0x9170
subq $0x8, %rsp
movq %r12, %rdi
movl $0x2, %esi
xorl %edx, %edx
movl %eax, %ecx
xorl %r8d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r14
movq 0x18(%rsp), %r14
pushq %rbx
pushq %r13
callq 0x9400
addq $0x20, %rsp
subl $0x1, 0x4(%rsp)
jae 0xe100
movb 0x3(%rsp), %bl
movq 0x18(%r14), %r14
movq %r14, %rdi
callq 0x9170
movq %r14, %rdi
movl $0x6, %esi
xorl %edx, %edx
movl %eax, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x9400
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3487(%rip), %rdi      # 0x11617
leaq 0x34a4(%rip), %rsi      # 0x1163b
leaq 0x34a7(%rip), %rcx      # 0x11645
movl $0x39, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-shm.c
// Function: wayland_create_context
struct wayland_context *
wayland_create_context(struct wl_display *display,
                       struct wl_event_queue *queue)
{
	struct shm_context *context;

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

	context_initialize(&context->base.base, &wld_context_impl);
	context->wl = NULL;
	wl_array_init(&context->formats);

	if (!(context->registry = wl_display_get_registry(display))) {
		DEBUG("Couldn't get registry\n");
		goto error1;
	}

	wl_registry_add_listener(context->registry, &registry_listener, context);
	wl_proxy_set_queue((struct wl_proxy *)context->registry, queue);

	/* Wait for wl_shm global. */
	wl_display_roundtrip_queue(display, queue);

	if (!context->wl) {
		DEBUG("No wl_shm global\n");
		goto error2;
	}

	wl_shm_add_listener(context->wl, &shm_listener, context);

	/* Wait for SHM formats. */
	wl_display_roundtrip_queue(display, queue);

	return &context->base;

error2:
	wl_registry_destroy(context->registry);
error1:
	wl_array_release(&context->formats);
	free(context);
error0:
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movl $0x48, %edi
callq 0x9570
testq %rax, %rax
je 0xe2d3
movq %rax, %rbx
leaq 0x99a1(%rip), %rsi      # 0x17bb8
movq %rax, %rdi
callq 0xa1cc
movq $0x0, 0x28(%rbx)
leaq 0x30(%rbx), %r12
movq %r12, %rdi
callq 0x91c0
movq %r15, %rdi
callq 0x9170
movq 0x9d86(%rip), %rdx      # 0x17fc8
movq %r15, %rdi
movl $0x1, %esi
movl %eax, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x9400
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0xe2b0
leaq 0x9977(%rip), %rsi      # 0x17be0
movq %rax, %rdi
movq %rbx, %rdx
callq 0x92b0
movq 0x20(%rbx), %rdi
movq %r14, %rsi
callq 0x97c0
movq %r15, %rdi
movq %r14, %rsi
callq 0x97b0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xe2b7
leaq 0x9955(%rip), %rsi      # 0x17bf0
movq %rbx, %rdx
callq 0x92b0
movq %r15, %rdi
movq %r14, %rsi
callq 0x97b0
jmp 0xe2d5
callq 0x9a4f
jmp 0xe2c3
movq %rbx, %rdi
addq $0x20, %rdi
callq 0x9a23
movq %r12, %rdi
callq 0x95a0
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-shm.c
// Function: wayland_has_format
bool
wayland_has_format(struct wld_context *base, uint32_t format)
{
	struct shm_context *context = shm_context(base);
	uint32_t *supported_format;
	uint32_t shm_format = format_wld_to_shm(format);

	wl_array_for_each (supported_format, &context->formats) {
		if (*supported_format == shm_format)
			return true;
	}

	return false;
}

// Assembly:
pushq %rax
leaq 0x98cc(%rip), %rax      # 0x17bb8
cmpq %rax, (%rdi)
jne 0xe330
xorl %ecx, %ecx
cmpl $0x34325258, %esi       # imm = 0x34325258
sete %sil
movq 0x30(%rdi), %rdx
testq %rdx, %rdx
setg %al
jle 0xe32e
movb %sil, %cl
movq 0x40(%rdi), %rsi
cmpl %ecx, (%rsi)
je 0xe32e
addq %rsi, %rdx
addq $0x4, %rsi
cmpq %rdx, %rsi
setb %al
jae 0xe32e
leaq 0x4(%rsi), %rdi
cmpl %ecx, (%rsi)
movq %rdi, %rsi
jne 0xe31b
popq %rcx
retq
leaq 0x298c(%rip), %rdi      # 0x10cc3
leaq 0x3388(%rip), %rsi      # 0x116c6
leaq 0x338f(%rip), %rcx      # 0x116d4
movl $0x36, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-shm.c
// Function: context_destroy
void
context_destroy(struct wld_context *base)
{
	struct shm_context *context = shm_context(base);

	wl_shm_destroy(context->wl);
	wl_registry_destroy(context->registry);
	wl_array_release(&context->formats);
	wl_event_queue_destroy(context->base.queue);
	free(context);
}

// Assembly:
pushq %rbx
leaq 0x962b(%rip), %rax      # 0x17bb8
cmpq %rax, (%rdi)
jne 0xe5c2
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x9830
movq 0x20(%rbx), %rdi
callq 0x9830
leaq 0x30(%rbx), %rdi
callq 0x95a0
movq 0x18(%rbx), %rdi
callq 0x9190
movq %rbx, %rdi
popq %rbx
jmp 0x9060
leaq 0x26fa(%rip), %rdi      # 0x10cc3
leaq 0x30f6(%rip), %rsi      # 0x116c6
leaq 0x30fd(%rip), %rcx      # 0x116d4
movl $0x36, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-shm.c
// Function: buffer_map
bool
buffer_map(struct buffer *base)
{
	struct shm_buffer *buffer = shm_buffer(&base->base);
	void *data;

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

	if (data == MAP_FAILED)
		return false;

	buffer->base.base.map = data;

	return true;
}

// Assembly:
pushq %rbx
leaq 0x960f(%rip), %rax      # 0x17bf8
cmpq %rax, (%rdi)
jne 0xe623
movq %rdi, %rbx
movl 0xc(%rdi), %esi
movl 0x50(%rdi), %r8d
imull 0x10(%rdi), %esi
xorl %edi, %edi
movl $0x3, %edx
movl $0x1, %ecx
xorl %r9d, %r9d
callq 0x9290
cmpq $-0x1, %rax
je 0xe61a
movq %rax, 0x30(%rbx)
cmpq $-0x1, %rax
setne %al
popq %rbx
retq
leaq 0x26fa(%rip), %rdi      # 0x10d24
leaq 0x3095(%rip), %rsi      # 0x116c6
leaq 0x30d2(%rip), %rcx      # 0x1170a
movl $0x37, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-drm.c
// Function: wayland_create_context
struct wayland_context *
wayland_create_context(struct wl_display *display,
                       struct wl_event_queue *queue)
{
	struct drm_context *context;

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

	context_initialize(&context->base.base, &wld_context_impl);
	context->wl = NULL;
	context->fd = -1;
	context->capabilities = 0;
	wl_array_init(&context->formats);

	if (!(context->registry = wl_display_get_registry(display)))
		goto error1;

	wl_registry_add_listener(context->registry, &registry_listener, context);
	wl_proxy_set_queue((struct wl_proxy *)context->registry, queue);

	/* Wait for wl_drm global. */
	wl_display_roundtrip_queue(display, queue);

	if (!context->wl) {
		DEBUG("No wl_drm global\n");
		goto error2;
	}

	wl_drm_add_listener(context->wl, &drm_listener, context);

	/* Wait for DRM capabilities and device. */
	wl_display_roundtrip_queue(display, queue);

	if (!(context->capabilities & WL_DRM_CAPABILITY_PRIME)) {
		DEBUG("No PRIME support\n");
		goto error3;
	}

	if (context->fd == -1) {
		DEBUG("No DRM device\n");
		goto error3;
	}

	if (!(context->driver_context = wld_drm_create_context(context->fd))) {
		DEBUG("Couldn't initialize context for DRM device\n");
		goto error4;
	}

	return &context->base;

error4:
	close(context->fd);
error3:
	wl_drm_destroy(context->wl);
error2:
	wl_registry_destroy(context->registry);
error1:
	wl_array_release(&context->formats);
	free(context);
error0:
	return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r12
movl $0x58, %edi
callq 0x9570
testq %rax, %rax
je 0xe852
movq %rax, %rbx
leaq 0x94d9(%rip), %rsi      # 0x17c20
movq %rax, %rdi
callq 0xa1cc
movq $0x0, 0x28(%rbx)
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
movq %rax, 0x50(%rbx)
leaq 0x38(%rbx), %r14
movq %r14, %rdi
callq 0x91c0
movq %r12, %rdi
callq 0x9170
movq 0x9848(%rip), %rdx      # 0x17fc8
movq %r12, %rdi
movl $0x1, %esi
movl %eax, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x9400
movq %rax, 0x30(%rbx)
testq %rax, %rax
je 0xe842
leaq 0x949d(%rip), %rsi      # 0x17c48
movq %rax, %rdi
movq %rbx, %rdx
callq 0x92b0
movq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0x97c0
movq %r12, %rdi
movq %r15, %rsi
callq 0x97b0
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0xe81d
leaq 0x947b(%rip), %rsi      # 0x17c58
movq %rbx, %rdx
callq 0x92b0
movq %r12, %rdi
movq %r15, %rsi
callq 0x97b0
testb $0x1, 0x50(%rbx)
je 0xe824
movq %rbx, %r15
addq $0x54, %r15
movl (%r15), %edi
cmpl $-0x1, %edi
je 0xe82b
callq 0x9160
movq %rax, 0x20(%rbx)
testq %rax, %rax
jne 0xe854
movq %r15, %rdi
callq 0x9a6e
jmp 0xe830
callq 0x9ad7
jmp 0xe839
callq 0x9ab8
jmp 0xe830
callq 0x9a99
movq 0x28(%rbx), %rdi
callq 0x9830
movq 0x30(%rbx), %rdi
callq 0x9830
movq %r14, %rdi
callq 0x95a0
movq %rbx, %rdi
callq 0x9060
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-drm.c
// Function: wayland_has_format
bool
wayland_has_format(struct wld_context *base, uint32_t format)
{
	struct drm_context *context = drm_context(base);
	uint32_t *supported_format;

	wl_array_for_each (supported_format, &context->formats) {
		if (*supported_format == format)
			return true;
	}

	return false;
}

// Assembly:
pushq %rax
leaq 0x93b5(%rip), %rax      # 0x17c20
cmpq %rax, (%rdi)
jne 0xe8a0
movq 0x38(%rdi), %rcx
testq %rcx, %rcx
setg %al
jle 0xe89e
movq 0x48(%rdi), %rdx
cmpl %esi, (%rdx)
je 0xe89e
addq %rdx, %rcx
addq $0x4, %rdx
cmpq %rcx, %rdx
setb %al
jae 0xe89e
leaq 0x4(%rdx), %rdi
cmpl %esi, (%rdx)
movq %rdi, %rdx
jne 0xe88b
popq %rcx
retq
leaq 0x241c(%rip), %rdi      # 0x10cc3
leaq 0x2f60(%rip), %rsi      # 0x1180e
leaq 0x2f67(%rip), %rcx      # 0x1181c
movl $0x32, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-drm.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 drm_context *context = drm_context(base);
	struct buffer *buffer;
	union wld_object object;
	struct wl_buffer *wl;

	if (!wayland_has_format(base, format))
		goto error0;

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

	if (!buffer)
		goto error0;

	if (!wld_export(&buffer->base, WLD_DRM_OBJECT_PRIME_FD, &object))
		goto error1;

	wl = wl_drm_create_prime_buffer(context->wl, object.i, width, height,
	                                format, 0, buffer->base.pitch, 0, 0, 0, 0);
	close(object.i);

	if (!wl)
		goto error1;

	if (!wayland_buffer_add_exporter(buffer, wl))
		goto error2;

	return buffer;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x92e7(%rip), %rax      # 0x17c20
cmpq %rax, (%rdi)
jne 0xea48
movl %r8d, %ebx
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %r14d
movq %rdi, %r13
movl %ecx, %esi
callq 0xe863
testb %al, %al
je 0xea34
movq 0x20(%r13), %rdi
movq (%rdi), %rax
movl %r14d, %esi
movl %r15d, %edx
movl %r12d, %ecx
movl %ebx, %r8d
callq *0x8(%rax)
testq %rax, %rax
je 0xea34
movq %rax, %rbx
leaq 0x8(%rsp), %rdx
movq %rax, %rdi
movl $0x2000001, %esi        # imm = 0x2000001
callq 0x9890
testb %al, %al
je 0xea2c
movq 0x28(%r13), %r13
movl 0x8(%rsp), %eax
movq %rax, 0x10(%rsp)
movl 0x10(%rbx), %ebp
movq %r13, %rdi
callq 0x9170
xorl %r10d, %r10d
movq 0x9612(%rip), %rdx      # 0x17fd0
movq %r13, %rdi
movl $0x3, %esi
movl %eax, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %eax, %eax
pushq %r10
pushq %r10
pushq %r10
pushq %r10
pushq %rbp
pushq %r10
pushq %r12
pushq %r15
pushq %r14
pushq 0x58(%rsp)
callq 0x9400
addq $0x50, %rsp
movq %rax, %r14
movl 0x8(%rsp), %edi
callq 0x93c0
testq %r14, %r14
je 0xea2c
movq %rbx, %rdi
movq %r14, %rsi
callq 0xdf8e
testb %al, %al
jne 0xea36
movq %r14, %rdi
callq 0x9170
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
movl %eax, %ecx
movl $0x1, %r8d
xorl %eax, %eax
callq 0x9400
movq %rbx, %rdi
callq 0x9260
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2274(%rip), %rdi      # 0x10cc3
leaq 0x2db8(%rip), %rsi      # 0x1180e
leaq 0x2dbf(%rip), %rcx      # 0x1181c
movl $0x32, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/michaelforney[P]wld/wayland-drm.c
// Function: context_destroy
void
context_destroy(struct wld_context *base)
{
	struct drm_context *context = drm_context(base);

	wld_destroy_context(context->driver_context);
	close(context->fd);
	wl_drm_destroy(context->wl);
	wl_registry_destroy(context->registry);
	wl_array_release(&context->formats);
	wl_event_queue_destroy(context->base.queue);
	free(context);
}

// Assembly:
pushq %rbx
leaq 0x91ae(%rip), %rax      # 0x17c20
cmpq %rax, (%rdi)
jne 0xeab8
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
callq 0x9490
movl 0x54(%rbx), %edi
callq 0x93c0
movq 0x28(%rbx), %rdi
callq 0x9830
movq 0x30(%rbx), %rdi
callq 0x9830
leaq 0x38(%rbx), %rdi
callq 0x95a0
movq 0x18(%rbx), %rdi
callq 0x9190
movq %rbx, %rdi
popq %rbx
jmp 0x9060
leaq 0x2204(%rip), %rdi      # 0x10cc3
leaq 0x2d48(%rip), %rsi      # 0x1180e
leaq 0x2d4f(%rip), %rcx      # 0x1181c
movl $0x32, %edx
callq 0x9380
// File: /workspace/github_c_makefile_star2_O1/google[P]multichase/fairness.c
// Function: wait_for_startup
static void wait_for_startup(void) {
  // wait for everyone to spawn
  pthread_mutex_lock(&wait_mutex);
  --nr_to_startup;
  if (nr_to_startup) {
    pthread_cond_wait(&wait_cond, &wait_mutex);
  } else {
    pthread_cond_broadcast(&wait_cond);
  }
  pthread_mutex_unlock(&wait_mutex);
}

// Assembly:
pushq %rax
leaq 0xef187(%rip), %rdi     # 0x4f1328
callq 0x4242d0
decq 0xeb16b(%rip)           # 0x4ed318
je 0x4021c4
leaq 0xef19a(%rip), %rdi     # 0x4f1350
leaq 0xef16b(%rip), %rsi     # 0x4f1328
callq 0x420930
jmp 0x4021d0
leaq 0xef185(%rip), %rdi     # 0x4f1350
callq 0x4202e0
leaq 0xef151(%rip), %rdi     # 0x4f1328
popq %rax
jmp 0x4251b0
nopl (%rax)