	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kgd2kfd_schedule_evict_and_restore_process ## -- Begin function kgd2kfd_schedule_evict_and_restore_process
	.p2align	4, 0x90
_kgd2kfd_schedule_evict_and_restore_process: ## @kgd2kfd_schedule_evict_and_restore_process
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_PROCESS_ACTIVE_TIME_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	testq	%rbx, %rbx
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_dma_fence_is_signaled
	xorl	%r12d, %r12d
	testq	%rax, %rax
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	callq	_kfd_lookup_process_by_mm
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movq	(%rbx), %rax
	cmpq	(%r15), %rax
	je	LBB0_8
## %bb.7:
	movq	%rax, (%r15)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_get_jiffies_64
	subq	8(%r15), %rax
	subq	%rax, %r14
	cmovaeq	%r14, %rbx
	movq	%r15, %rdi
	addq	$16, %rdi
	movq	%rbx, %rsi
	callq	_schedule_delayed_work
LBB0_8:
	movq	%r15, %rdi
	callq	_kfd_unref_process
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_9:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_PROCESS_ACTIVE_TIME_MS,4,2     ## @PROCESS_ACTIVE_TIME_MS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_kgd2kfd_schedule_evict_and_restore_process ; -- Begin function kgd2kfd_schedule_evict_and_restore_process
	.p2align	2
_kgd2kfd_schedule_evict_and_restore_process: ; @kgd2kfd_schedule_evict_and_restore_process
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PROCESS_ACTIVE_TIME_MS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PROCESS_ACTIVE_TIME_MS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	cbz	x21, LBB0_7
; %bb.1:
	mov	x19, x0
	mov	x0, x21
	bl	_dma_fence_is_signaled
	cbnz	x0, LBB0_6
; %bb.2:
	mov	x0, x20
	bl	_kfd_lookup_process_by_mm
	cbz	x0, LBB0_10
; %bb.3:
	mov	x20, x0
	ldr	x8, [x21]
	ldr	x9, [x0]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
	str	x8, [x20]
	bl	_get_jiffies_64
	ldr	x8, [x20, #8]
	sub	x8, x0, x8
	subs	x8, x19, x8
	csel	x1, xzr, x8, lo
	add	x0, x20, #16
	bl	_schedule_delayed_work
LBB0_5:
	mov	x0, x20
	bl	_kfd_unref_process
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
LBB0_10:
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_PROCESS_ACTIVE_TIME_MS,4,2     ; @PROCESS_ACTIVE_TIME_MS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
