	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _wa_add
__wa_add:                               ## @_wa_add
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	8(%rsi), %edi
	callq	_i915_mmio_reg_offset
	movq	%rax, %r15
	movl	(%r13), %ebx
	movq	_WA_LIST_CHUNK@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%r12d, %edi
	callq	_is_power_of_2
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_GEM_BUG_ON
	movl	(%r13), %edi
	movl	%r12d, %esi
	callq	_IS_ALIGNED
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movl	(%r13), %edi
	incl	%edi
	movl	%r12d, %esi
	callq	_ALIGN
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	movl	$16, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_20
## %bb.2:
	movq	%rax, %r12
	movq	8(%r13), %rsi
	testq	%rsi, %rsi
	je	LBB0_4
## %bb.3:
	movl	(%r13), %edx
	shll	$4, %edx
	movq	%r12, %rdi
	callq	_memcpy
LBB0_4:
	movq	%r12, 8(%r13)
LBB0_5:
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.6:
	movl	%r15d, %ecx
	xorl	%eax, %eax
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rcx
	incl	%ebx
	movl	%ebx, %eax
	movq	%r14, %r13
	movl	%r12d, %ebx
	cmpl	%eax, %ebx
	jbe	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %r12d
	subl	%eax, %ebx
	shrl	%ebx
	addl	%eax, %ebx
	movq	8(%r13), %rax
	movq	%r13, %r14
	movq	%rbx, %r13
	shlq	$4, %r13
	movl	8(%rax,%r13), %edi
	movq	%rcx, %r15
	callq	_i915_mmio_reg_offset
	cmpq	%r15, %rax
	jl	LBB0_8
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movq	8(%r14), %rax
	movl	8(%rax,%r13), %edi
	callq	_i915_mmio_reg_offset
	cmpq	%r15, %rax
	jle	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r15, %rcx
	movl	%ebx, %eax
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	%r12d, %eax
	cmpl	%eax, %ebx
	ja	LBB0_7
LBB0_10:
	incl	16(%r13)
	movq	8(%r13), %rax
	movl	(%r13), %ecx
	leal	1(%rcx), %edx
	movl	%edx, (%r13)
	shlq	$4, %rcx
	leaq	(%rax,%rcx), %rbx
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movups	(%rdx), %xmm0
	movups	%xmm0, (%rax,%rcx)
	cmpq	8(%r13), %rbx
	jbe	LBB0_19
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	-8(%rbx), %edi
	callq	_i915_mmio_reg_offset
	movq	%rax, %r14
	movl	8(%rbx), %edi
	callq	_i915_mmio_reg_offset
	xorl	%edi, %edi
	cmpq	%rax, %r14
	sete	%dil
	callq	_GEM_BUG_ON
	movl	8(%rbx), %edi
	callq	_i915_mmio_reg_offset
	movq	%rax, %r14
	movl	-8(%rbx), %edi
	callq	_i915_mmio_reg_offset
	cmpq	%rax, %r14
	jg	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	-16(%rbx), %r14
	movq	(%rbx), %rdi
	movq	8(%rbx), %rsi
	movq	-16(%rbx), %rdx
	movq	-8(%rbx), %rcx
	callq	_swap
	movq	%r14, %rbx
	cmpq	8(%r13), %r14
	ja	LBB0_11
	jmp	LBB0_19
LBB0_20:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_15:
	movl	%ebx, %ebx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	8(%r12), %r15
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movl	(%r13), %eax
	shlq	$4, %rbx
	leaq	(%r15,%rbx), %r14
	movl	(%r15,%rbx), %ecx
	movl	%ecx, %edx
	notl	%edx
	testl	%edx, %eax
	je	LBB0_17
## %bb.16:
	movl	4(%r15,%rbx), %edx
	jmp	LBB0_18
LBB0_17:
	movl	8(%r15,%rbx), %edi
	callq	_i915_mmio_reg_offset
	movl	(%r14), %edx
	movl	4(%r15,%rbx), %ecx
	leaq	L_.str.1(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movl	(%r13), %eax
	movl	%eax, %edx
	notl	%edx
	andl	4(%r15,%rbx), %edx
	movl	%edx, 4(%r15,%rbx)
	movl	(%r14), %ecx
LBB0_18:
	orl	%eax, %ecx
	incl	16(%r12)
	orl	4(%r13), %edx
	movl	%edx, 4(%r15,%rbx)
	movl	%ecx, (%r14)
	movl	12(%r13), %eax
	orl	%eax, 12(%r15,%rbx)
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WA_LIST_CHUNK,4,2              ## @WA_LIST_CHUNK
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No space for workaround init!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Discarding overwritten w/a for reg %04x (mask: %08x, value: %08x)\n"

	.no_dead_strip	__wa_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _wa_add
__wa_add:                               ; @_wa_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x1, #8]
	bl	_i915_mmio_reg_offset
	mov	x21, x0
	ldr	w23, [x19]
Lloh0:
	adrp	x8, _WA_LIST_CHUNK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WA_LIST_CHUNK@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	mov	x0, x22
	bl	_is_power_of_2
	cmp	w0, #0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w0, [x19]
	mov	x1, x22
	bl	_IS_ALIGNED
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x19]
	add	w0, w8, #1
	mov	x1, x22
	bl	_ALIGN
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_kmalloc_array
	cbz	x0, LBB0_16
; %bb.2:
	mov	x22, x0
	ldr	x1, [x19, #8]
	cbz	x1, LBB0_4
; %bb.3:
	ldr	w8, [x19]
	lsl	w2, w8, #4
	mov	x0, x22
	bl	_memcpy
LBB0_4:
	str	x22, [x19, #8]
LBB0_5:
	cbz	w23, LBB0_13
; %bb.6:
	mov	w24, #0
	and	x22, x21, #0xffffffff
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w24, w21, #1
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	cmp	w23, w24
	b.ls	LBB0_13
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w23, w24
	add	w21, w24, w8, lsr #1
	ldr	x8, [x19, #8]
	add	x8, x8, w21, uxtw #4
	ldr	w0, [x8, #8]
	bl	_i915_mmio_reg_offset
	cmp	x0, x22
	b.lt	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x21, lsl #4
	ldr	w0, [x8, #8]
	bl	_i915_mmio_reg_offset
	mov	x23, x21
	cmp	x0, x22
	b.gt	LBB0_8
; %bb.11:
	ldr	x23, [x19, #8]
	ldr	w8, [x20]
	add	x22, x23, w21, uxtw #4
	ldr	w9, [x22]
	bics	wzr, w8, w9
	b.eq	LBB0_17
; %bb.12:
	add	x10, x23, x21, lsl #4
	ldr	w10, [x10, #4]
	b	LBB0_18
LBB0_13:
	ldr	w8, [x19, #16]
	add	w8, w8, #1
	str	w8, [x19, #16]
	ldr	x8, [x19, #8]
	ldr	w9, [x19]
	add	w10, w9, #1
	str	w10, [x19]
	add	x21, x8, x9, lsl #4
	ldr	q0, [x20]
	str	q0, [x21]
	ldr	x8, [x19, #8]
	cmp	x21, x8
	b.ls	LBB0_19
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldur	w0, [x21, #-8]
	bl	_i915_mmio_reg_offset
	mov	x20, x0
	ldr	w0, [x21, #8]
	bl	_i915_mmio_reg_offset
	cmp	x20, x0
	cset	w0, eq
	bl	_GEM_BUG_ON
	ldr	w0, [x21, #8]
	bl	_i915_mmio_reg_offset
	mov	x20, x0
	ldur	w0, [x21, #-8]
	bl	_i915_mmio_reg_offset
	cmp	x20, x0
	b.gt	LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	mov	x20, x21
	ldr	x2, [x20, #-16]!
	ldp	x0, x1, [x21]
	ldur	x3, [x21, #-8]
	bl	_swap
	ldr	x8, [x19, #8]
	mov	x21, x20
	cmp	x20, x8
	b.hi	LBB0_14
	b	LBB0_19
LBB0_16:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_DRM_ERROR
LBB0_17:
	add	x24, x23, x21, lsl #4
	ldr	w0, [x24, #8]
	bl	_i915_mmio_reg_offset
	ldr	w8, [x24, #4]
	ldr	w9, [x22]
	stp	x9, x8, [sp, #8]
	str	x0, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	ldr	w8, [x20]
	ldr	w9, [x24, #4]
	bic	w10, w9, w8
	str	w10, [x24, #4]
	ldr	w9, [x22]
LBB0_18:
	ldr	w11, [x19, #16]
	add	w11, w11, #1
	str	w11, [x19, #16]
	ldr	w11, [x20, #4]
	add	x12, x23, x21, lsl #4
	orr	w10, w10, w11
	str	w10, [x12, #4]
	orr	w8, w9, w8
	str	w8, [x22]
	ldr	w8, [x20, #12]
	ldr	w9, [x12, #12]
	orr	w8, w9, w8
	str	w8, [x12, #12]
LBB0_19:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_WA_LIST_CHUNK,4,2              ; @WA_LIST_CHUNK
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No space for workaround init!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Discarding overwritten w/a for reg %04x (mask: %08x, value: %08x)\n"

	.no_dead_strip	__wa_add
.subsections_via_symbols
