	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function igt_wait_request
_igt_wait_request:                      ## @igt_wait_request
	.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
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leal	3(%r15), %eax
	testl	%r15d, %r15d
	cmovnsl	%r15d, %eax
	movq	%rdi, %rbx
	sarl	$2, %eax
	movslq	%eax, %r12
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	callq	_mutex_lock
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rbx), %rax
	movq	_RCS0@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rax,%rcx,8), %rax
	movl	(%rax), %edi
	movq	%r12, %r14
	movq	%r12, %rsi
	callq	_mock_request
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_i915_request_get
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_request_wait
	movq	_ETIME@GOTPCREL(%rip), %rbx
	addl	(%rbx), %eax
	jne	LBB0_6
## %bb.2:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_i915_request_wait
	addl	(%rbx), %eax
	jne	LBB0_7
## %bb.3:
	movq	%r12, %rdi
	callq	_i915_request_completed
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_11
LBB0_6:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
LBB0_8:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_9:
	callq	_pr_err
	movl	-52(%rbp), %r13d                ## 4-byte Reload
LBB0_10:
	movq	%r12, %rdi
	callq	_i915_request_put
LBB0_11:
	movq	%rbx, %rdi
	callq	_mock_device_flush
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r12, %rdi
	callq	_i915_request_add
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_i915_request_wait
	addl	(%rbx), %eax
	jne	LBB0_15
## %bb.13:
	movq	%r12, %rdi
	callq	_i915_request_completed
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_8
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_8
LBB0_16:
	leal	7(%r15), %eax
	testl	%r15d, %r15d
	cmovnsl	%r15d, %eax
	sarl	$3, %eax
	movslq	%eax, %rdx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_i915_request_wait
	addl	(%rbx), %eax
	jne	LBB0_19
## %bb.17:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_i915_request_wait
	addl	(%rbx), %eax
	jne	LBB0_20
## %bb.18:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_8
LBB0_19:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_8
LBB0_20:
	movq	%r12, %rdi
	callq	_i915_request_completed
	testq	%rax, %rax
	je	LBB0_23
## %bb.21:
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%r14, %rdx
	callq	_i915_request_wait
	addl	(%rbx), %eax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_10
## %bb.22:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_9
LBB0_23:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_RCS0,8,3                       ## @RCS0
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ETIME,4,2                      ## @ETIME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"request wait (busy query) succeeded (expected timeout before submit!)\n"

L_.str.1:                               ## @.str.1
	.asciz	"request wait succeeded (expected timeout before submit!)\n"

L_.str.2:                               ## @.str.2
	.asciz	"request completed before submit!!\n"

L_.str.3:                               ## @.str.3
	.asciz	"request wait (busy query) succeeded (expected timeout after submit!)\n"

L_.str.4:                               ## @.str.4
	.asciz	"request completed immediately!\n"

L_.str.5:                               ## @.str.5
	.asciz	"request wait succeeded (expected timeout!)\n"

L_.str.6:                               ## @.str.6
	.asciz	"request wait timed out!\n"

L_.str.7:                               ## @.str.7
	.asciz	"request not complete after waiting!\n"

L_.str.8:                               ## @.str.8
	.asciz	"request wait timed out when already complete!\n"

	.no_dead_strip	_igt_wait_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function igt_wait_request
_igt_wait_request:                      ; @igt_wait_request
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
Lloh0:
	adrp	x8, _HZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	add	w8, w24, #3
	cmp	w24, #0
	csel	w8, w8, w24, lt
	sbfx	x21, x8, #2, #30
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	bl	_mutex_lock
	ldr	x8, [x19, #8]
Lloh6:
	adrp	x9, _RCS0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RCS0@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	ldr	x8, [x8, x9, lsl #3]
	ldr	w0, [x8]
	mov	x1, x21
	bl	_mock_request
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	bl	_i915_request_get
	mov	x0, x20
	mov	w1, #0
	mov	x2, #0
	bl	_i915_request_wait
Lloh9:
	adrp	x23, _ETIME@GOTPAGE
Lloh10:
	ldr	x23, [x23, _ETIME@GOTPAGEOFF]
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.2:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_i915_request_wait
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_7
; %bb.3:
	mov	x0, x20
	bl	_i915_request_completed
	cbz	x0, LBB0_11
; %bb.4:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_5:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_10
LBB0_6:
Lloh16:
	adrp	x0, l_.str@PAGE
Lloh17:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_8:
	neg	w21, w22
	bl	_pr_err
LBB0_9:
	mov	x0, x20
	bl	_i915_request_put
LBB0_10:
	mov	x0, x19
	bl	_mock_device_flush
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x0, x20
	bl	_i915_request_add
	mov	x0, x20
	mov	w1, #0
	mov	x2, #0
	bl	_i915_request_wait
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_14
; %bb.12:
	mov	x0, x20
	bl	_i915_request_completed
	cbz	x0, LBB0_15
; %bb.13:
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_8
LBB0_14:
Lloh22:
	adrp	x0, l_.str.3@PAGE
Lloh23:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_15:
	add	w8, w24, #7
	cmp	w24, #0
	csel	w8, w8, w24, lt
	sbfx	x2, x8, #3, #29
	mov	x0, x20
	mov	w1, #0
	bl	_i915_request_wait
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_18
; %bb.16:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_i915_request_wait
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_19
; %bb.17:
Lloh24:
	adrp	x0, l_.str.6@PAGE
Lloh25:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_8
LBB0_18:
Lloh26:
	adrp	x0, l_.str.5@PAGE
Lloh27:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_8
LBB0_19:
	mov	x0, x20
	bl	_i915_request_completed
	cbz	x0, LBB0_22
; %bb.20:
	mov	x0, x20
	mov	w1, #0
	mov	x2, x21
	bl	_i915_request_wait
	mov	w21, #0
	ldr	w8, [x23]
	cmn	w0, w8
	b.ne	LBB0_9
; %bb.21:
Lloh28:
	adrp	x0, l_.str.8@PAGE
Lloh29:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_8
LBB0_22:
Lloh30:
	adrp	x0, l_.str.7@PAGE
Lloh31:
	add	x0, x0, l_.str.7@PAGEOFF
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_RCS0,8,3                       ; @RCS0
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ETIME,4,2                      ; @ETIME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"request wait (busy query) succeeded (expected timeout before submit!)\n"

l_.str.1:                               ; @.str.1
	.asciz	"request wait succeeded (expected timeout before submit!)\n"

l_.str.2:                               ; @.str.2
	.asciz	"request completed before submit!!\n"

l_.str.3:                               ; @.str.3
	.asciz	"request wait (busy query) succeeded (expected timeout after submit!)\n"

l_.str.4:                               ; @.str.4
	.asciz	"request completed immediately!\n"

l_.str.5:                               ; @.str.5
	.asciz	"request wait succeeded (expected timeout!)\n"

l_.str.6:                               ; @.str.6
	.asciz	"request wait timed out!\n"

l_.str.7:                               ; @.str.7
	.asciz	"request not complete after waiting!\n"

l_.str.8:                               ; @.str.8
	.asciz	"request wait timed out when already complete!\n"

	.no_dead_strip	_igt_wait_request
.subsections_via_symbols
