	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvkm_xtensa_init
_nvkm_xtensa_init:                      ## @nvkm_xtensa_init
	.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)
	callq	_nvkm_xtensa
	movq	%rax, %r15
	movq	24(%rax), %r12
	movl	(%rax), %r14d
	movl	16(%rax), %edi
	testl	%edi, %edi
	je	LBB0_1
LBB0_11:
	callq	_nvkm_memory_addr
	movl	%eax, %r13d
	movl	16(%r15), %edi
	callq	_nvkm_memory_size
	movl	%eax, %ebx
	leal	3344(%r14), %esi
	movq	%r12, %rdi
	movl	$536870911, %edx                ## imm = 0x1FFFFFFF
	callq	_nvkm_wr32
	leal	3336(%r14), %esi
	movq	%r12, %rdi
	movl	$268435455, %edx                ## imm = 0xFFFFFFF
	callq	_nvkm_wr32
	leal	3368(%r14), %esi
	movq	8(%r15), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_nvkm_wr32
	leal	3104(%r14), %esi
	movl	%esi, -88(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	$63, %edx
	callq	_nvkm_wr32
	leal	3460(%r14), %r15d
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	$63, %edx
	callq	_nvkm_wr32
	leal	3264(%r14), %esi
	sarl	$8, %r13d
	movq	%r12, %rdi
	movl	%r13d, %edx
	callq	_nvkm_wr32
	leal	3268(%r14), %esi
	movq	%r12, %rdi
	movl	$28, %edx
	callq	_nvkm_wr32
	leal	3272(%r14), %esi
	sarl	$8, %ebx
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_nvkm_wr32
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_nvkm_rd32
	leal	3552(%r14), %esi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_nvkm_wr32
	addl	$3304, %r14d                    ## imm = 0xCE8
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	$15, %edx
	callq	_nvkm_wr32
	movq	%r12, %rdi
	movl	-88(%rbp), %esi                 ## 4-byte Reload
	movl	$63, %edx
	callq	_nvkm_wr32
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	$63, %edx
	callq	_nvkm_wr32
	jmp	LBB0_12
LBB0_1:
	leaq	24(%r15), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	%r14d, %ecx
	sarl	$12, %ecx
	leaq	L_.str(%rip), %rdx
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$32, %esi
	callq	_snprintf
	movl	(%r12), %edx
	leaq	-96(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	%eax, %r13d
	leaq	L_.str.1(%rip), %rsi
	leaq	-80(%rbp), %rdx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_warn
	jmp	LBB0_12
LBB0_3:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-96(%rbp), %rax
	cmpl	$262145, (%rax)                 ## imm = 0x40001
	jl	LBB0_5
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	leaq	-80(%rbp), %rdx
	callq	_nvkm_warn
	movq	-96(%rbp), %rdi
	callq	_release_firmware
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_12
LBB0_5:
	leaq	16(%r15), %rbx
	movq	_NVKM_MEM_TARGET_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$262144, %edx                   ## imm = 0x40000
	movl	$4096, %ecx                     ## imm = 0x1000
	xorl	%r8d, %r8d
	movq	%rbx, %r9
	callq	_nvkm_memory_new
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r13d
	movq	-96(%rbp), %rdi
	callq	_release_firmware
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	(%rbx), %edi
	callq	_nvkm_kmap
	movq	-96(%rbp), %rax
	cmpl	$4, (%rax)
	movq	%rbx, %rcx
	jl	LBB0_10
## %bb.8:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rcx), %edi
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edx
	movl	%r13d, %esi
	callq	_nvkm_wo32
	incq	%rbx
	movq	-96(%rbp), %rax
	movl	(%rax), %ecx
	leal	3(%rcx), %edx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edx
	sarl	$2, %edx
	movslq	%edx, %rcx
	addl	$4, %r13d
	cmpq	%rcx, %rbx
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	jl	LBB0_9
LBB0_10:
	movl	(%rcx), %edi
	movq	%rcx, %rbx
	callq	_nvkm_done
	movq	-96(%rbp), %rdi
	callq	_release_firmware
	movl	(%rbx), %edi
	jmp	LBB0_11
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nouveau/nv84_xuc%03x"

L_.str.1:                               ## @.str.1
	.asciz	"unable to load firmware %s\n"

L_.str.2:                               ## @.str.2
	.asciz	"firmware %s too large\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NVKM_MEM_TARGET_INST,4,2       ## @NVKM_MEM_TARGET_INST
	.no_dead_strip	_nvkm_xtensa_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvkm_xtensa_init
_nvkm_xtensa_init:                      ; @nvkm_xtensa_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_nvkm_xtensa
	mov	x20, x0
	mov	x22, x0
	ldr	x19, [x22, #24]!
	ldr	w24, [x0]
	mov	x21, x0
	ldr	w0, [x21, #16]!
	cbz	w0, LBB0_2
LBB0_1:
	bl	_nvkm_memory_addr
	mov	x22, x0
	ldr	w0, [x20, #16]
	bl	_nvkm_memory_size
	mov	x23, x0
	add	w1, w24, #3344
	mov	x0, x19
	mov	w2, #536870911
	bl	_nvkm_wr32
	add	w1, w24, #3336
	mov	x0, x19
	mov	w2, #268435455
	bl	_nvkm_wr32
	add	w1, w24, #3368
	ldr	x8, [x20, #8]
	ldr	w2, [x8]
	mov	x0, x19
	bl	_nvkm_wr32
	add	w20, w24, #3104
	mov	x0, x19
	mov	x1, x20
	mov	w2, #63
	bl	_nvkm_wr32
	add	w21, w24, #3460
	mov	x0, x19
	mov	x1, x21
	mov	w2, #63
	bl	_nvkm_wr32
	add	w1, w24, #3264
	asr	w2, w22, #8
	mov	x0, x19
	bl	_nvkm_wr32
	add	w1, w24, #3268
	mov	x0, x19
	mov	w2, #28
	bl	_nvkm_wr32
	add	w1, w24, #3272
	asr	w2, w23, #8
	mov	x0, x19
	bl	_nvkm_wr32
	mov	x0, x19
	mov	w1, #0
	bl	_nvkm_rd32
	mov	x2, x0
	add	w1, w24, #3552
	mov	x0, x19
	bl	_nvkm_wr32
	add	w1, w24, #3304
	mov	x0, x19
	mov	w2, #15
	bl	_nvkm_wr32
	mov	x0, x19
	mov	x1, x20
	mov	w2, #63
	bl	_nvkm_wr32
	mov	x0, x19
	mov	x1, x21
	mov	w2, #63
	bl	_nvkm_wr32
	mov	w23, #0
	b	LBB0_8
LBB0_2:
	asr	w3, w24, #12
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	add	x0, sp, #8
	mov	w1, #32
	bl	_snprintf
	ldr	w2, [x19]
	mov	x0, sp
	add	x1, sp, #8
	bl	_request_firmware
	cbz	w0, LBB0_4
; %bb.3:
	mov	x23, x0
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #8
	mov	x0, x22
	bl	_nvkm_warn
	b	LBB0_8
LBB0_4:
	ldr	x8, [sp]
	ldr	w8, [x8]
	cmp	w8, #64, lsl #12                ; =262144
	b.le	LBB0_6
; %bb.5:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #8
	mov	x0, x22
	bl	_nvkm_warn
	ldr	x0, [sp]
	bl	_release_firmware
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_8
LBB0_6:
Lloh12:
	adrp	x8, _NVKM_MEM_TARGET_INST@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NVKM_MEM_TARGET_INST@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #262144
	mov	w3, #4096
	mov	w4, #0
	mov	x5, x21
	bl	_nvkm_memory_new
	cbz	w0, LBB0_10
; %bb.7:
	mov	x23, x0
	ldr	x0, [sp]
	bl	_release_firmware
LBB0_8:
	ldr	x8, [sp, #40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.9:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	ldr	w0, [x21]
	bl	_nvkm_kmap
	ldr	x8, [sp]
	ldr	w9, [x8]
	cmp	w9, #4
	b.lt	LBB0_13
; %bb.11:
	mov	x22, #0
	mov	x23, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	ldr	x8, [x8, #8]
	ldr	w2, [x8, x22]
	mov	x1, x22
	bl	_nvkm_wo32
	add	x23, x23, #1
	ldr	x8, [sp]
	ldr	w9, [x8]
	add	w10, w9, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w9, w9, #2
	add	x22, x22, #4
	cmp	x23, w9, sxtw
	b.lt	LBB0_12
LBB0_13:
	ldr	w0, [x21]
	bl	_nvkm_done
	ldr	x0, [sp]
	bl	_release_firmware
	ldr	w0, [x21]
	b	LBB0_1
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nouveau/nv84_xuc%03x"

l_.str.1:                               ; @.str.1
	.asciz	"unable to load firmware %s\n"

l_.str.2:                               ; @.str.2
	.asciz	"firmware %s too large\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NVKM_MEM_TARGET_INST,4,2       ; @NVKM_MEM_TARGET_INST
	.no_dead_strip	_nvkm_xtensa_init
.subsections_via_symbols
