	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_memx_train_result         ## -- Begin function nvkm_memx_train_result
	.p2align	4, 0x90
_nvkm_memx_train_result:                ## @nvkm_memx_train_result
	.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	%edx, %r13d
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r15
	movq	_PROC_MEMX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MEMX_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_MEMX_INFO_TRAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	-56(%rbp), %rsi
	xorl	%r9d, %r9d
	callq	_nvkm_pmu_send
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movl	-52(%rbp), %eax
	movl	%eax, %ebx
	sarl	$2, %ebx
	cmpl	%r13d, %ebx
	jle	LBB0_3
## %bb.2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_6
LBB0_3:
	movl	$33554432, %edx                 ## imm = 0x2000000
	orl	-56(%rbp), %edx
	movq	%r15, %rdi
	movl	$1089984, %esi                  ## imm = 0x10A1C0
	movl	%eax, %r13d
	callq	_nvkm_wr32
	xorl	%r12d, %r12d
	cmpl	$4, %r13d
	jl	LBB0_6
## %bb.4:
	cmpl	$2, %ebx
	movl	$1, %r13d
	cmovgel	%ebx, %r13d
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	$1089988, %esi                  ## imm = 0x10A1C4
	callq	_nvkm_rd32
	movl	%eax, (%r14,%rbx,4)
	incq	%rbx
	cmpq	%rbx, %r13
	jne	LBB0_5
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PROC_MEMX,4,2                  ## @PROC_MEMX
	.comm	_MEMX_MSG_INFO,4,2              ## @MEMX_MSG_INFO
	.comm	_MEMX_INFO_TRAIN,4,2            ## @MEMX_INFO_TRAIN
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nvkm_memx_train_result         ; -- Begin function nvkm_memx_train_result
	.p2align	2
_nvkm_memx_train_result:                ; @nvkm_memx_train_result
	.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	x21, x2
	mov	x19, 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	x20, [x0]
Lloh3:
	adrp	x8, _PROC_MEMX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PROC_MEMX@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _MEMX_MSG_INFO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEMX_MSG_INFO@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
Lloh9:
	adrp	x8, _MEMX_INFO_TRAIN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MEMX_INFO_TRAIN@GOTPAGEOFF]
Lloh11:
	ldr	w4, [x8]
	mov	x1, sp
	mov	w5, #0
	bl	_nvkm_pmu_send
	cbnz	w0, LBB0_7
; %bb.1:
	ldr	w23, [sp, #4]
	asr	w22, w23, #2
	cmp	w22, w21
	b.le	LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_3:
	mov	w21, #41408
	movk	w21, #16, lsl #16
	ldr	w8, [sp]
	orr	w2, w8, #0x2000000
	mov	x0, x20
	mov	w1, #41408
	movk	w1, #16, lsl #16
	bl	_nvkm_wr32
	cmp	w23, #4
	b.lt	LBB0_6
; %bb.4:
	cmp	w22, #1
	csinc	w22, w22, wzr, gt
	add	w21, w21, #4
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_nvkm_rd32
	str	w0, [x19], #4
	subs	x22, x22, #1
	b.ne	LBB0_5
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldr	x8, [sp, #8]
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_9
; %bb.8:
	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_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_PROC_MEMX,4,2                  ; @PROC_MEMX
	.comm	_MEMX_MSG_INFO,4,2              ; @MEMX_MSG_INFO
	.comm	_MEMX_INFO_TRAIN,4,2            ; @MEMX_INFO_TRAIN
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
