	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdkfd_fence_wait_timeout      ## -- Begin function amdkfd_fence_wait_timeout
	.p2align	4, 0x90
_amdkfd_fence_wait_timeout:             ## @amdkfd_fence_wait_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	%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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movl	%edx, %edi
	callq	_msecs_to_jiffies
	xorl	%ebx, %ebx
	cmpl	%r14d, (%r15)
	je	LBB0_9
## %bb.1:
	movq	%rax, %r12
	movq	_jiffies@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	%rdi, %r12
	movq	%r12, %rsi
	callq	_time_after
	testq	%rax, %rax
	jne	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_schedule
	cmpl	%r14d, (%r15)
	je	LBB0_9
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rdi
	movq	%r12, %rsi
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_3
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_pr_err
	movq	_halt_if_hws_hang@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_schedule
	cmpq	$0, (%rbx)
	jne	LBB0_6
LBB0_8:
	movq	_ETIME@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_jiffies,8,3                    ## @jiffies
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"qcm fence wait loop timeout expired\n"

	.comm	_halt_if_hws_hang,8,3           ## @halt_if_hws_hang
	.comm	_ETIME,4,2                      ## @ETIME
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdkfd_fence_wait_timeout      ; -- Begin function amdkfd_fence_wait_timeout
	.p2align	2
_amdkfd_fence_wait_timeout:             ; @amdkfd_fence_wait_timeout
	.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, x1
	mov	x20, x0
	mov	x0, x2
	bl	_msecs_to_jiffies
	ldr	w8, [x20]
	cmp	w8, w19
	b.ne	LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_9
LBB0_2:
Lloh0:
	adrp	x22, _jiffies@GOTPAGE
Lloh1:
	ldr	x22, [x22, _jiffies@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x21, x8, x0
	mov	x0, x8
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x1, x21
	bl	_time_after
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_schedule
	ldr	w8, [x20]
	cmp	w8, w19
	b.eq	LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x0, [x22]
	b	LBB0_3
LBB0_6:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
Lloh4:
	adrp	x19, _halt_if_hws_hang@GOTPAGE
Lloh5:
	ldr	x19, [x19, _halt_if_hws_hang@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	bl	_schedule
	ldr	x8, [x19]
	cbnz	x8, LBB0_7
LBB0_8:
Lloh6:
	adrp	x8, _ETIME@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ETIME@GOTPAGEOFF]
Lloh8:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"qcm fence wait loop timeout expired\n"

	.comm	_halt_if_hws_hang,8,3           ; @halt_if_hws_hang
	.comm	_ETIME,4,2                      ; @ETIME
.subsections_via_symbols
