	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kfd_ioctl_set_scratch_backing_va
_kfd_ioctl_set_scratch_backing_va:      ## @kfd_ioctl_set_scratch_backing_va
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movl	4(%rdx), %edi
	callq	_kfd_device_by_id
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_kfd_bind_process_to_device
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r13, %rdi
	callq	_PTR_ERR
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_7
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_7
LBB0_4:
	movl	(%r14), %eax
	movl	%eax, 8(%r13)
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	16(%rbx), %rax
	movq	(%rax), %rax
	movq	_KFD_SCHED_POLICY_NO_HWS@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.5:
	movq	(%r13), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.6:
	movq	8(%rbx), %rax
	movl	(%rbx), %edi
	movl	(%r14), %esi
	callq	*(%rax)
LBB0_7:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_KFD_SCHED_POLICY_NO_HWS,8,3    ## @KFD_SCHED_POLICY_NO_HWS
	.no_dead_strip	_kfd_ioctl_set_scratch_backing_va
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kfd_ioctl_set_scratch_backing_va
_kfd_ioctl_set_scratch_backing_va:      ; @kfd_ioctl_set_scratch_backing_va
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x21, x1
	ldr	w0, [x2, #4]
	bl	_kfd_device_by_id
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_lock
	mov	x0, x20
	mov	x1, x21
	bl	_kfd_bind_process_to_device
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	mov	x0, x22
	bl	_PTR_ERR
	mov	x19, x0
	mov	x0, x21
	bl	_mutex_unlock
	b	LBB0_8
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_8
LBB0_4:
	ldr	w8, [x19]
	str	w8, [x22, #8]
	mov	x0, x21
	bl	_mutex_unlock
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _KFD_SCHED_POLICY_NO_HWS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KFD_SCHED_POLICY_NO_HWS@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	ldr	x2, [x22]
	cbz	x2, LBB0_7
; %bb.6:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	ldr	w0, [x20]
	ldr	w1, [x19]
	blr	x8
LBB0_7:
	mov	w19, #0
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_KFD_SCHED_POLICY_NO_HWS,8,3    ; @KFD_SCHED_POLICY_NO_HWS
	.no_dead_strip	_kfd_ioctl_set_scratch_backing_va
.subsections_via_symbols
