	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_memx_fini                 ## -- Begin function nvkm_memx_fini
	.p2align	4, 0x90
_nvkm_memx_fini:                        ## @nvkm_memx_fini
	.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
	movl	%esi, %r12d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r13
	movq	8(%r13), %r14
	movq	(%r14), %rbx
	movq	%r13, %rdi
	callq	_memx_out
	movq	%rbx, %rdi
	movl	$1089984, %esi                  ## imm = 0x10A1C0
	callq	_nvkm_rd32
	movl	%eax, %r15d
	movq	%rbx, %rdi
	movl	$1090944, %esi                  ## imm = 0x10A580
	xorl	%edx, %edx
	callq	_nvkm_wr32
	testl	%r12d, %r12d
	je	LBB0_2
## %bb.1:
	andl	$16777215, %r15d                ## imm = 0xFFFFFF
	movq	_PROC_MEMX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MEMX_MSG_EXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%r13), %r8d
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	movl	%r15d, %r9d
	callq	_nvkm_pmu_send
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_nvkm_debug
LBB0_2:
	movq	%r13, %rdi
	callq	_kfree
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PROC_MEMX,4,2                  ## @PROC_MEMX
	.comm	_MEMX_MSG_EXEC,4,2              ## @MEMX_MSG_EXEC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Exec took %uns, PMU_IN %08x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_memx_fini                 ; -- Begin function nvkm_memx_fini
	.p2align	2
_nvkm_memx_fini:                        ; @nvkm_memx_fini
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x22, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	x19, [x0]
	ldr	x20, [x19, #8]
	ldr	x23, [x20]
	mov	x0, x19
	bl	_memx_out
	mov	w24, #41408
	movk	w24, #16, lsl #16
	mov	x0, x23
	mov	w1, #41408
	movk	w1, #16, lsl #16
	bl	_nvkm_rd32
	mov	x21, x0
	add	w1, w24, #960
	mov	x0, x23
	mov	w2, #0
	bl	_nvkm_wr32
	cbz	w22, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _PROC_MEMX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PROC_MEMX@GOTPAGEOFF]
	and	w5, w21, #0xffffff
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _MEMX_MSG_EXEC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEMX_MSG_EXEC@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	ldr	w4, [x19]
	mov	x1, sp
	mov	x0, x20
	bl	_nvkm_pmu_send
	ldp	w2, w3, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_nvkm_debug
LBB0_2:
	mov	x0, x19
	bl	_kfree
	ldr	x8, [sp, #8]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_4:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PROC_MEMX,4,2                  ; @PROC_MEMX
	.comm	_MEMX_MSG_EXEC,4,2              ; @MEMX_MSG_EXEC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Exec took %uns, PMU_IN %08x\n"

.subsections_via_symbols
