// File: /workspace/github_c_makefile_star2_O0/michaelforney[P]wld/./intel/blt.h
// Function: xy_color_blt
static inline void
xy_color_blt(struct intel_batch *batch,
             drm_intel_bo *dst, uint16_t dst_pitch,
             uint16_t dst_x1, uint16_t dst_y1,
             uint16_t dst_x2, uint16_t dst_y2,
             uint32_t color)
{
	uint32_t tiling_mode, swizzle_mode;

	intel_batch_ensure_space(batch, GEN(batch, 8) ? 7 : 6);

	drm_intel_bo_get_tiling(dst, &tiling_mode, &swizzle_mode);

	drm_intel_bo_emit_reloc_fence(batch->bo, intel_batch_offset(batch, 4), dst, 0,
	                              I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER);

	intel_batch_add_dwords(batch, 4,
	                       BLT_BR00_CLIENT(INTEL_CLIENT_BLT)
	                           | BLT_BR00_OP(BLT_OP_XY_COLOR_BLT)
	                           | BLT_BR00_32BPP_MASK(BLT_32BPP_MASK_ALPHA | BLT_32BPP_MASK_RGB)
	                           | BLT_BR00_DST_TILING_ENABLE(tiling_mode != I915_TILING_NONE)
	                           | BLT_BR00_DWORD_LENGTH(GEN(batch, 8) ? 5 : 4),

	                       BLT_BR13_CLIPPING_ENABLE(false)
	                           | BLT_BR13_COLOR_DEPTH(BLT_COLOR_DEPTH_32BIT)
	                           | BLT_BR13_RASTER_OPERATION(BLT_RASTER_OPERATION_PAT)
	                           | BLT_BR13_DST_PITCH(tiling_mode == I915_TILING_NONE
	                                                    ? dst_pitch
	                                                    : dst_pitch >> 2),

	                       BLT_BR22_DST_Y1(dst_y1) | BLT_BR22_DST_X1(dst_x1),
	                       BLT_BR23_DST_Y2(dst_y2) | BLT_BR23_DST_X2(dst_x2));
	intel_batch_add_dwords(batch, GEN(batch, 8) ? 2 : 1,
	                       BLT_BR09_DST_ADDRESS(dst->offset64),
	                       BLT_BR27_DST_ADDRESS_HI(dst->offset64 >> 32));
	intel_batch_add_dword(batch,
	                      BLT_BR16_COLOR(color));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movl %r8d, -0x4c(%rbp)
movl %ecx, %eax
movl -0x4c(%rbp), %ecx
movl %eax, -0x48(%rbp)
movl %edx, %eax
movl -0x48(%rbp), %edx
movl %eax, -0x44(%rbp)
movq %rsi, %rax
movl -0x44(%rbp), %esi
movq %rax, -0x40(%rbp)
movq %rdi, %r8
movq -0x40(%rbp), %rdi
movw %r9w, %ax
movl 0x18(%rbp), %r9d
movw 0x10(%rbp), %r9w
movq %r8, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movw %si, -0x12(%rbp)
movw %dx, -0x14(%rbp)
movw %cx, -0x16(%rbp)
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movl $0x6, %esi
movl $0x7, %eax
cmpl $0x8, %ecx
cmovgel %eax, %esi
callq 0xc6f0
movq -0x10(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x9360
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0xc720
movq -0x38(%rbp), %rdi
movl %eax, %esi
movq -0x10(%rbp), %rdx
xorl %ecx, %ecx
movl $0x2, %r9d
movl %r9d, %r8d
callq 0x9760
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x1c(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %eax
shll $0xb, %eax
orl $0x54300000, %eax       # imm = 0x54300000
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
movl (%rcx), %esi
movl $0x4, %ecx
movl $0x5, %edx
cmpl $0x8, %esi
cmovgel %edx, %ecx
shll $0x0, %ecx
orl %ecx, %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0xc645
movzwl -0x12(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0xc64f
movzwl -0x12(%rbp), %eax
sarl $0x2, %eax
movl %eax, -0x50(%rbp)
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rdi
movl -0x50(%rbp), %ecx
shll $0x0, %ecx
orl $0x3f00000, %ecx        # imm = 0x3F00000
movzwl -0x16(%rbp), %r8d
shll $0x10, %r8d
movzwl -0x14(%rbp), %eax
shll $0x0, %eax
orl %eax, %r8d
movzwl 0x10(%rbp), %r9d
shll $0x10, %r9d
movzwl -0x18(%rbp), %eax
shll $0x0, %eax
orl %eax, %r9d
movl $0x4, %esi
movb $0x0, %al
callq 0xc740
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl (%rax), %ecx
movl $0x1, %esi
movl $0x2, %eax
cmpl $0x8, %ecx
cmovgel %eax, %esi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
shlq $0x0, %rdx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
shrq $0x20, %rcx
shlq $0x0, %rcx
movb $0x0, %al
callq 0xc740
movq -0x8(%rbp), %rdi
movl 0x18(%rbp), %esi
shll $0x0, %esi
callq 0xc7e0
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)