// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, %r15d
movl %r8d, %ebp
movl %ecx, %r13d
movl %edx, %r12d
movq %rsi, %r14
movq %rdi, %rbx
callq 0xb31c
leaq 0xdc7e(%rip), %rax      # 0x18a38
cmpq %rax, (%r14)
jne 0xafa1
movl %ebp, 0x18(%rsp)
movl %r15d, 0x14(%rsp)
movl 0x70(%rsp), %r15d
movq %r14, %rdi
callq 0xb2ee
movq 0x8028(%rbx), %rax
leaq 0x10(%rbx), %rdi
movq %rdi, 0x28(%rsp)
movq 0x60(%r14), %rbp
movzwl 0x10(%r14), %ecx
movl %ecx, 0x10(%rsp)
movl %r12d, 0xc(%rsp)
movq 0x60(%rax), %r12
movzwl 0x10(%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
cmpl $0x8, (%rax)
setge %cl
leal 0x8(,%rcx,2), %esi
callq 0xb34a
leaq 0x1c(%rsp), %rsi
leaq 0x34(%rsp), %r14
movq %r12, %rdi
movq %r12, 0x20(%rsp)
movq %r14, %rdx
callq 0x9350
leaq 0x4(%rsp), %rsi
movq %rbp, %rdi
movq %r14, %rdx
callq 0x9350
movq 0x18(%rbx), %rdi
movl 0x8020(%rbx), %eax
leal 0x10(,%rax,4), %esi
pushq $0x2
popq %r14
movq %r12, %rdx
xorl %ecx, %ecx
movl %r14d, %r8d
movl %r14d, %r9d
callq 0x9740
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rdi
xorl %ecx, %ecx
cmpl $0x8, (%rax)
setge %cl
addl 0x8020(%rbx), %ecx
leal 0x1c(,%rcx,4), %esi
movq %rbp, %rdx
xorl %ecx, %ecx
movl %r14d, %r8d
xorl %r9d, %r9d
callq 0x9740
xorl %eax, %eax
leaq 0x4(%rsp), %rcx
cmpl $0x0, (%rcx)
setne %al
shll $0xf, %eax
movl 0x8(%rsp), %edi
movl %edi, %ecx
shrl $0x2, %ecx
xorl %edx, %edx
leaq 0x1c(%rsp), %rsi
cmpl $0x0, (%rsi)
setne %dl
movq 0x10(%rbx), %rsi
cmovel %edi, %ecx
shll $0xb, %edx
orl %eax, %edx
xorl %eax, %eax
cmpl $0x8, (%rsi)
setge %al
leal (%rdx,%rax,2), %edx
addl $0x54f00006, %edx       # imm = 0x54F00006
orl $0x3cc0000, %ecx        # imm = 0x3CC0000
movl 0x78(%rsp), %eax
addl %r13d, %eax
shll $0x10, %r13d
movl $0xffff, %r14d          # imm = 0xFFFF
movl 0xc(%rsp), %esi
andl %r14d, %esi
orl %esi, %r13d
shll $0x10, %eax
andl %r14d, %r15d
addl %esi, %r15d
orl %eax, %r15d
pushq $0x4
popq %rsi
movq 0x28(%rsp), %r12
movq %r12, %rdi
movl %r13d, %r8d
movl %r15d, %r9d
xorl %eax, %eax
callq 0xb35e
movq 0x10(%rbx), %rax
xorl %esi, %esi
cmpl $0x8, (%rax)
setge %sil
incl %esi
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
movq %r12, %rdi
xorl %eax, %eax
callq 0xb35e
movl 0x14(%rsp), %eax
shll $0x10, %eax
movl 0x18(%rsp), %edx
andl %r14d, %edx
orl %eax, %edx
movl 0x10(%rsp), %eax
movl %eax, %ecx
shrl $0x2, %ecx
leaq 0x4(%rsp), %rsi
cmpl $0x0, (%rsi)
cmovel %eax, %ecx
movq %r12, %rdi
pushq $0x2
popq %rsi
xorl %eax, %eax
callq 0xb35e
movq 0x10(%rbx), %rax
xorl %esi, %esi
cmpl $0x8, (%rax)
setge %sil
incl %esi
movq 0x30(%rbp), %rdx
movq %rdx, %rcx
shrq $0x20, %rcx
movq %r12, %rdi
xorl %eax, %eax
callq 0xb35e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq