	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_init_workaround_bb
_intel_init_workaround_bb:              ## @intel_init_workaround_bb
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	32(%rdi), %r13
	movq	%r13, -64(%rbp)
	leaq	24(%rdi), %rax
	movq	%rax, -56(%rbp)
	movq	(%rdi), %rax
	movq	_RENDER_CLASS@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_22
## %bb.1:
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_INTEL_GEN
                                        ## kill: def $eax killed $eax def $rax
	addl	$-8, %eax
	cmpl	$4, %eax
	ja	LBB0_5
## %bb.2:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_4:
	movq	_gen8_init_indirectctx_bb@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movl	8(%rbx), %edi
	callq	_INTEL_GEN
	movl	%eax, %edi
	callq	_MISSING_CASE
	jmp	LBB0_22
LBB0_3:
	movq	_gen9_init_indirectctx_bb@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_gen10_init_indirectctx_bb@GOTPCREL(%rip), %rax
LBB0_7:
	movq	%rax, -80(%rbp)
	movq	$0, -72(%rbp)
	movq	%rbx, %rdi
	callq	_lrc_setup_wa_ctx
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_DRM_DEBUG_DRIVER
	jmp	LBB0_22
LBB0_9:
	movq	16(%rbx), %rax
	movl	(%rax), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_i915_gem_object_get_dirty_page
	movq	%rax, %rdi
	callq	_kmap_atomic
	movq	%rax, %r15
	leaq	-80(%rbp), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	je	LBB0_10
## %bb.11:
	movl	$0, (%r13)
	movq	_CACHELINE_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_DEBUG_WARN_ON
	movq	%r15, %r12
	testq	%rax, %rax
	jne	LBB0_19
## %bb.12:
	movl	$1, %r14d
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %r12
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	-88(%rbp,%r14,8), %rcx
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	*%rcx
	movq	%rax, %r12
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movl	(%r13), %eax
	addl	%r15d, %eax
	movl	%r12d, %ecx
	subl	%eax, %ecx
	movl	%ecx, 4(%r13)
	leaq	-80(%rbp), %rdi
	callq	_ARRAY_SIZE
	movl	%eax, %eax
	cmpq	%rax, %r14
	jae	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_13 Depth=1
	movq	-64(%rbp,%r14,8), %r13
	movl	%r12d, %edi
	subl	%r15d, %edi
	movl	%edi, (%r13)
	movq	_CACHELINE_BYTES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_IS_ALIGNED
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_DEBUG_WARN_ON
	incq	%r14
	testq	%rax, %rax
	je	LBB0_13
## %bb.18:
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	xorl	%r14d, %r14d
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_20
LBB0_10:
	movq	%r15, %r12
	xorl	%r13d, %r13d
	jmp	LBB0_20
LBB0_16:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
LBB0_20:
	subq	%r15, %r12
	movq	_CTX_WA_BB_OBJ_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	%rax, %r12
	setg	%dil
	callq	_BUG_ON
	movq	%r15, %rdi
	callq	_kunmap_atomic
	testl	%r13d, %r13d
	je	LBB0_22
## %bb.21:
	movq	%rbx, %rdi
	callq	_lrc_destroy_wa_ctx
	movl	%r13d, %r14d
LBB0_22:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_24
## %bb.23:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	callq	___stack_chk_fail
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_22, LBB0_22-LJTI0_0
LJTI0_0:
	.long	L0_0_set_4
	.long	L0_0_set_3
	.long	L0_0_set_6
	.long	L0_0_set_22
	.long	L0_0_set_22
	.end_data_region
                                        ## -- End function
	.comm	_RENDER_CLASS,8,3               ## @RENDER_CLASS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to setup context WA page: %d\n"

	.comm	_CACHELINE_BYTES,4,2            ## @CACHELINE_BYTES
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CTX_WA_BB_OBJ_SIZE,4,2         ## @CTX_WA_BB_OBJ_SIZE
	.no_dead_strip	_intel_init_workaround_bb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_init_workaround_bb
_intel_init_workaround_bb:              ; @intel_init_workaround_bb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	add	x23, x0, #32
	add	x8, x0, #24
	stp	x23, x8, [sp, #24]
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _RENDER_CLASS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RENDER_CLASS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_INTEL_GEN
	sub	w8, w0, #8
	cmp	w8, #4
	b.hi	LBB0_5
; %bb.2:
	mov	w22, #0
Lloh6:
	adrp	x9, lJTI0_0@PAGE
Lloh7:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
Lloh8:
	adrp	x8, _gen8_init_indirectctx_bb@GOTPAGE
Lloh9:
	ldr	x8, [x8, _gen8_init_indirectctx_bb@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	mov	w22, #0
	b	LBB0_22
LBB0_5:
	ldr	w0, [x19, #8]
	bl	_INTEL_GEN
	bl	_MISSING_CASE
	mov	w22, #0
	b	LBB0_22
LBB0_6:
Lloh10:
	adrp	x8, _gen9_init_indirectctx_bb@GOTPAGE
Lloh11:
	ldr	x8, [x8, _gen9_init_indirectctx_bb@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _gen10_init_indirectctx_bb@GOTPAGE
Lloh13:
	ldr	x8, [x8, _gen10_init_indirectctx_bb@GOTPAGEOFF]
LBB0_8:
	stp	x8, xzr, [sp, #8]
	mov	x0, x19
	bl	_lrc_setup_wa_ctx
	cbz	w0, LBB0_10
; %bb.9:
	mov	x22, x0
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_DRM_DEBUG_DRIVER
	b	LBB0_22
LBB0_10:
	ldr	x8, [x19, #16]
	ldr	w0, [x8]
	mov	w1, #0
	bl	_i915_gem_object_get_dirty_page
	bl	_kmap_atomic
	mov	x20, x0
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	cbz	w0, LBB0_18
; %bb.11:
	str	wzr, [x23]
Lloh16:
	adrp	x22, _CACHELINE_BYTES@GOTPAGE
Lloh17:
	ldr	x22, [x22, _CACHELINE_BYTES@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w0, #0
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_DEBUG_WARN_ON
	mov	x21, x20
	cbnz	x0, LBB0_17
; %bb.12:
	mov	x26, #0
	add	x8, sp, #24
	add	x24, x8, #8
	add	x25, sp, #8
	mov	x21, x20
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25, x26, lsl #3]
	cbz	x8, LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	x0, x19
	mov	x1, x21
	blr	x8
	mov	x21, x0
LBB0_15:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x23]
	add	w8, w20, w8
	sub	w8, w21, w8
	str	w8, [x23, #4]
	add	x27, x26, #1
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	cmp	x27, w0, uxtw
	b.hs	LBB0_19
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x23, [x24, x26, lsl #3]
	sub	w0, w21, w20
	str	w0, [x23]
	ldr	w1, [x22]
	bl	_IS_ALIGNED
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_DEBUG_WARN_ON
	mov	x26, x27
	cbz	x0, LBB0_13
LBB0_17:
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_20
LBB0_18:
	mov	w22, #0
	mov	x21, x20
	b	LBB0_20
LBB0_19:
	mov	w22, #0
LBB0_20:
Lloh21:
	adrp	x8, _CTX_WA_BB_OBJ_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CTX_WA_BB_OBJ_SIZE@GOTPAGEOFF]
Lloh23:
	ldrsw	x8, [x8]
	sub	x9, x21, x20
	cmp	x9, x8
	cset	w0, gt
	bl	_BUG_ON
	mov	x0, x20
	bl	_kunmap_atomic
	cbz	w22, LBB0_22
; %bb.21:
	mov	x0, x19
	bl	_lrc_destroy_wa_ctx
LBB0_22:
	ldr	x8, [sp, #40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_24
; %bb.23:
	mov	x0, x22
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_24:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_7-LBB0_3)>>2
	.byte	(LBB0_22-LBB0_3)>>2
	.byte	(LBB0_22-LBB0_3)>>2
                                        ; -- End function
	.comm	_RENDER_CLASS,8,3               ; @RENDER_CLASS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to setup context WA page: %d\n"

	.comm	_CACHELINE_BYTES,4,2            ; @CACHELINE_BYTES
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CTX_WA_BB_OBJ_SIZE,4,2         ; @CTX_WA_BB_OBJ_SIZE
	.no_dead_strip	_intel_init_workaround_bb
.subsections_via_symbols
