	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_write_fence_reg
_i915_write_fence_reg:                  ## @i915_write_fence_reg
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r13
	movq	%rdi, %r12
	movq	24(%rdx), %rax
	movl	(%rax), %r14d
	movq	_I915_FENCE_START_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movl	(%rdx), %edx
	movl	20(%r13), %ecx
	andl	%edx, %eax
	leal	-1(%r14), %esi
	movl	%r14d, %ebx
	andl	%esi, %ebx
	orl	%eax, %ebx
	andl	%edx, %esi
	xorl	%edi, %edi
	orl	%ebx, %esi
	setne	%dil
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %r8d
	callq	_WARN
	movq	8(%r13), %rax
	movq	_I915_TILING_Y@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rax
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	movq	%rsi, %rbx
	callq	_HAS_128_BYTE_Y_TILING
	movq	%rbx, %rsi
	movl	$128, %ecx
	testq	%rax, %rax
	jne	LBB0_5
LBB0_4:
	movl	$512, %ecx                      ## imm = 0x200
LBB0_5:
	movl	16(%r13), %eax
	cltd
	idivl	%ecx
	bsfl	%eax, %eax
	movl	$-1, %r12d
	cmovnel	%eax, %r12d
	movl	(%r13), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	8(%r13), %rax
	movq	_I830_FENCE_TILING_Y_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	xorl	%ebx, %ebx
	cmpq	(%rsi), %rax
	cmovel	%edx, %ebx
	movl	%r14d, %edi
	callq	_I915_FENCE_SIZE_BITS
	movq	_I830_FENCE_PITCH_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %r12d
	movl	%eax, %esi
	movq	_I830_FENCE_REG_VALID@GOTPCREL(%rip), %rax
	orl	-44(%rbp), %esi                 ## 4-byte Folded Reload
	orl	%ebx, %esi
	orl	%r12d, %esi
	orl	(%rax), %esi
	cmpl	$7, %r15d
	jg	LBB0_8
LBB0_7:
	movq	_FENCE_REG_830_0@GOTPCREL(%rip), %rax
	shll	$2, %r15d
	addl	(%rax), %r15d
	jmp	LBB0_9
LBB0_1:
	xorl	%esi, %esi
	cmpl	$7, %r15d
	jle	LBB0_7
LBB0_8:
	movq	_FENCE_REG_945_8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	(%rax,%r15,4), %r15d
	addl	$-32, %r15d
LBB0_9:
	movl	%r15d, %edi
	callq	_I915_WRITE
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_POSTING_READ                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_FENCE_START_MASK,4,2      ## @I915_FENCE_START_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"object 0x%08x [fenceable? %d] not 1M or pot-size (0x%08x) aligned\n"

	.comm	_I915_TILING_Y,8,3              ## @I915_TILING_Y
	.comm	_I830_FENCE_TILING_Y_SHIFT,4,2  ## @I830_FENCE_TILING_Y_SHIFT
	.comm	_I830_FENCE_PITCH_SHIFT,4,2     ## @I830_FENCE_PITCH_SHIFT
	.comm	_I830_FENCE_REG_VALID,4,2       ## @I830_FENCE_REG_VALID
	.comm	_FENCE_REG_830_0,4,2            ## @FENCE_REG_830_0
	.comm	_FENCE_REG_945_8,4,2            ## @FENCE_REG_945_8
	.no_dead_strip	_i915_write_fence_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_write_fence_reg
_i915_write_fence_reg:                  ; @i915_write_fence_reg
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	cbz	x2, LBB0_7
; %bb.1:
	mov	x21, x2
	mov	x22, x0
	ldr	x8, [x2, #24]
	ldr	w20, [x8]
	ldr	w2, [x2]
Lloh0:
	adrp	x8, _I915_FENCE_START_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_FENCE_START_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bic	w8, w2, w8
	sub	w9, w20, #1
	and	w10, w20, w9
	orr	w8, w10, w8
	and	w9, w2, w9
	orr	w8, w8, w9
	cmp	w8, #0
	cset	w0, ne
	ldr	w3, [x21, #20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x4, x20
	bl	_WARN
	ldr	x8, [x21, #8]
Lloh5:
	adrp	x23, _I915_TILING_Y@GOTPAGE
Lloh6:
	ldr	x23, [x23, _I915_TILING_Y@GOTPAGEOFF]
	ldr	x9, [x23]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_HAS_128_BYTE_Y_TILING
	cbz	x0, LBB0_4
; %bb.3:
	mov	w8, #128
	b	LBB0_5
LBB0_4:
	mov	w8, #512
LBB0_5:
	ldr	w9, [x21, #16]
	sdiv	w8, w9, w8
	rbit	w9, w8
	clz	w9, w9
	cmp	w8, #0
	csinv	w22, w9, wzr, ne
	ldr	w24, [x21]
	ldr	x8, [x21, #8]
Lloh7:
	adrp	x9, _I830_FENCE_TILING_Y_SHIFT@GOTPAGE
Lloh8:
	ldr	x9, [x9, _I830_FENCE_TILING_Y_SHIFT@GOTPAGEOFF]
	ldr	x10, [x23]
Lloh9:
	ldr	w9, [x9]
	mov	w11, #1
	lsl	w9, w11, w9
	cmp	x8, x10
	csel	w21, w9, wzr, eq
	mov	x0, x20
	bl	_I915_FENCE_SIZE_BITS
Lloh10:
	adrp	x8, _I830_FENCE_PITCH_SHIFT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _I830_FENCE_PITCH_SHIFT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _I830_FENCE_REG_VALID@GOTPAGE
Lloh14:
	ldr	x9, [x9, _I830_FENCE_REG_VALID@GOTPAGEOFF]
	lsl	w8, w22, w8
Lloh15:
	ldr	w9, [x9]
	orr	w10, w0, w24
	orr	w10, w10, w21
	orr	w8, w10, w8
	orr	w1, w8, w9
	cmp	w19, #7
	b.gt	LBB0_8
LBB0_6:
Lloh16:
	adrp	x8, _FENCE_REG_830_0@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FENCE_REG_830_0@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	add	w19, w8, w19, lsl #2
	b	LBB0_9
LBB0_7:
	mov	w1, #0
	cmp	w19, #7
	b.le	LBB0_6
LBB0_8:
Lloh19:
	adrp	x8, _FENCE_REG_945_8@GOTPAGE
Lloh20:
	ldr	x8, [x8, _FENCE_REG_945_8@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	add	w8, w8, w19, lsl #2
	sub	w19, w8, #32
LBB0_9:
	mov	x0, x19
	bl	_I915_WRITE
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_POSTING_READ
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_FENCE_START_MASK,4,2      ; @I915_FENCE_START_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"object 0x%08x [fenceable? %d] not 1M or pot-size (0x%08x) aligned\n"

	.comm	_I915_TILING_Y,8,3              ; @I915_TILING_Y
	.comm	_I830_FENCE_TILING_Y_SHIFT,4,2  ; @I830_FENCE_TILING_Y_SHIFT
	.comm	_I830_FENCE_PITCH_SHIFT,4,2     ; @I830_FENCE_PITCH_SHIFT
	.comm	_I830_FENCE_REG_VALID,4,2       ; @I830_FENCE_REG_VALID
	.comm	_FENCE_REG_830_0,4,2            ; @FENCE_REG_830_0
	.comm	_FENCE_REG_945_8,4,2            ; @FENCE_REG_945_8
	.no_dead_strip	_i915_write_fence_reg
.subsections_via_symbols
