// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, 0x4(%rsp)
movl %edx, (%rsp)
leaq 0xb2ec(%rip), %rax      # 0x17a90
cmpq %rax, (%rdi)
jne 0xc94f
movl %r9d, %r14d
movl %r8d, %ebx
movl %esi, %r13d
movq %rdi, %r12
movq 0x18(%rdi), %rdi
movq 0x30(%r12), %r15
movq 0x38(%rdi), %rax
subq 0x30(%rdi), %rax
cmpq $0x48, %rax
jg 0xc7e6
movl $0x12, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x9860
testl %eax, %eax
jne 0xc910
movl 0x14(%r15), %eax
xorl %ecx, %ecx
cmpl $0x34325241, %eax       # imm = 0x34325241
movl $0xcf, %edx
cmovnel %ecx, %edx
cmpl $0x34325258, %eax       # imm = 0x34325258
movl $0xe6, %ebp
cmovnel %edx, %ebp
movq 0x20(%r12), %rdi
xorl %esi, %esi
callq 0x9110
movq 0x18(%r12), %rdi
movl %ebp, %ecx
shll $0x10, %ecx
orl $0x80006080, %ecx       # imm = 0x80006080
movq 0x30(%rdi), %rax
leaq 0x4(%rax), %rdx
movq %rdx, 0x30(%rdi)
movl %ecx, (%rax)
movq 0x68(%r15), %rcx
cmpl $0x0, 0x30(%rcx)
je 0xc856
movl 0x34(%rcx), %r9d
xorl %esi, %esi
movl $0x204, %edx            # imm = 0x204
movl $0x2, %ecx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0xc66e
jmp 0xc87c
leaq 0x8(%rax), %rcx
movq %rcx, 0x30(%rdi)
movl $0x80016081, 0x4(%rax)  # imm = 0x80016081
movl 0x10(%r15), %r8d
xorl %esi, %esi
movl $0x214, %edx            # imm = 0x214
movl $0x1, %ecx
xorl %eax, %eax
callq 0xc66e
movq 0x18(%r12), %rdi
movl 0x8(%r15), %r8d
movl 0xc(%r15), %r9d
movq 0x68(%r15), %rax
movq 0x20(%rax), %r10
movq %r10, %r11
shrq $0x20, %r11
xorl %esi, %esi
movl $0x218, %edx            # imm = 0x218
movl $0x4, %ecx
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0xc66e
addq $0x10, %rsp
movq 0x20(%r12), %rdi
movq 0x68(%r15), %rdx
xorl %esi, %esi
movl $0x201, %ecx            # imm = 0x201
callq 0x95c0
movq 0x18(%r12), %rdi
subq $0x8, %rsp
xorl %esi, %esi
movl $0x580, %edx            # imm = 0x580
movl $0x3, %ecx
movl $0x4, %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r13
callq 0xc66e
addq $0x10, %rsp
movq 0x18(%r12), %rdi
movq 0x20(%r12), %rsi
callq 0x92d0
movq 0x18(%r12), %rdi
callq 0x9460
testl %eax, %eax
je 0xc916
addq $0x8, %rsp
jmp 0xc944
movq 0x18(%r12), %rdi
movl (%rsp), %r8d
addl %r8d, %ebx
movl 0x4(%rsp), %r9d
addl %r9d, %r14d
xorl %esi, %esi
movl $0x600, %edx            # imm = 0x600
movl $0x4, %ecx
xorl %eax, %eax
pushq %r14
pushq %rbx
callq 0xc66e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x44a3(%rip), %rdi      # 0x10df9
leaq 0x4aa3(%rip), %rsi      # 0x11400
leaq 0x4b1f(%rip), %rcx      # 0x11483
movl $0x4b, %edx
callq 0x9380