	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_timeout             ## -- Begin function amdgpu_gem_timeout
	.p2align	4, 0x90
_amdgpu_gem_timeout:                    ## @amdgpu_gem_timeout
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	js	LBB0_1
## %bb.2:
	callq	_ns_to_ktime
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_ktime_get
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_ktime_sub
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_ktime_to_ns
	testq	%rax, %rax
	js	LBB0_4
## %bb.3:
	movl	%r14d, %edi
	callq	_ktime_to_ns
	movq	%rax, %rdi
	callq	_nsecs_to_jiffies
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	-1(%rcx), %rbx
	cmpq	%rcx, %rax
	cmovbeq	%rax, %rbx
	jmp	LBB0_4
LBB0_1:
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_4:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ## @MAX_SCHEDULE_TIMEOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_timeout             ; -- Begin function amdgpu_gem_timeout
	.p2align	2
_amdgpu_gem_timeout:                    ; @amdgpu_gem_timeout
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	tbnz	x0, #63, LBB0_3
; %bb.1:
	bl	_ns_to_ktime
	mov	x19, x0
	bl	_ktime_get
	mov	x1, x0
	mov	x0, x19
	bl	_ktime_sub
	mov	x19, x0
	bl	_ktime_to_ns
	tbnz	x0, #63, LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_ktime_to_ns
	bl	_nsecs_to_jiffies
Lloh0:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sub	x9, x8, #1
	cmp	x0, x8
	csel	x0, x9, x0, hi
	b	LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh5:
	ldr	x0, [x8]
	b	LBB0_5
LBB0_4:
	mov	x0, #0
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ; @MAX_SCHEDULE_TIMEOUT
.subsections_via_symbols
