	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gf100_gr_wait_idle             ## -- Begin function gf100_gr_wait_idle
	.p2align	4, 0x90
_gf100_gr_wait_idle:                    ## @gf100_gr_wait_idle
	.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	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r12
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	$2000, %edi                     ## imm = 0x7D0
	callq	_msecs_to_jiffies
	movq	%rax, %r15
	addq	%rbx, %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$4196096, %esi                  ## imm = 0x400700
	callq	_nvkm_rd32
	movq	%r12, %rdi
	movl	$512, %esi                      ## imm = 0x200
	callq	_nvkm_rd32
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	$9792, %esi                     ## imm = 0x2640
	callq	_nvkm_rd32
	movl	%eax, %ebx
	movq	%r12, %rdi
	movl	$4195852, %esi                  ## imm = 0x40060C
	callq	_nvkm_rd32
	movl	%eax, %r14d
	xorl	%eax, %eax
	andl	$4096, %r13d                    ## imm = 0x1000
	je	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	andl	$32768, %ebx                    ## imm = 0x8000
	andl	$1, %r14d
	movl	%r14d, %ecx
	orl	%ebx, %ecx
	je	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%r15, %rsi
	callq	_time_before
	testq	%rax, %rax
	jne	LBB0_1
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	movl	%ebx, %ecx
	movl	%r14d, %r8d
	callq	_nvkm_error
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_5:
	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	"wait for idle timeout (en: %d, ctxsw: %d, busy: %d)\n"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gf100_gr_wait_idle             ; -- Begin function gf100_gr_wait_idle
	.p2align	2
_gf100_gr_wait_idle:                    ; @gf100_gr_wait_idle
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	mov	w25, #1548
	movk	w25, #64, lsl #16
	ldr	x20, [x0]
Lloh0:
	adrp	x26, _jiffies@GOTPAGE
Lloh1:
	ldr	x26, [x26, _jiffies@GOTPAGEOFF]
	ldr	x21, [x26]
	mov	w0, #2000
	bl	_msecs_to_jiffies
	add	x21, x0, x21
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	w1, w25, #244
	mov	x0, x20
	bl	_nvkm_rd32
	mov	x0, x20
	mov	w1, #512
	bl	_nvkm_rd32
	mov	x22, x0
	mov	x0, x20
	mov	w1, #9792
	bl	_nvkm_rd32
	mov	x23, x0
	mov	x0, x20
	mov	w1, #1548
	movk	w1, #64, lsl #16
	bl	_nvkm_rd32
	tbz	w22, #12, LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	and	w23, w23, #0x8000
	and	w24, w0, #0x1
	orr	w8, w24, w23
	cbz	w8, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x0, [x26]
	mov	x1, x21
	bl	_time_before
	cbnz	x0, LBB0_1
; %bb.4:
	and	w2, w22, #0x1000
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x23
	mov	x4, x24
	bl	_nvkm_error
Lloh4:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_jiffies,8,3                    ; @jiffies
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"wait for idle timeout (en: %d, ctxsw: %d, busy: %d)\n"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
