	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gk104_fifo_engine_status
_gk104_fifo_engine_status:              ## @gk104_fifo_engine_status
	.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	%rdx, %rbx
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	movq	8(%r15), %rax
	movslq	%esi, %rcx
	movq	(%rax,%rcx,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	9792(,%rcx,8), %esi
	callq	_nvkm_rd32
	movl	%eax, %ecx
	shrl	$31, %ecx
	movl	%ecx, (%rbx)
	movl	%eax, %ecx
	shrl	$30, %ecx
	andl	$1, %ecx
	movl	%ecx, 4(%rbx)
	movl	%eax, %ecx
	shrl	$28, %ecx
	andl	$1, %ecx
	leaq	20(%rbx), %r13
	movl	%ecx, 20(%rbx)
	movl	%eax, %ecx
	shrl	$16, %ecx
	andl	$4095, %ecx                     ## imm = 0xFFF
	movl	%ecx, 24(%rbx)
	movl	%eax, %edx
	shrl	$15, %edx
	andl	$1, %edx
	movl	%edx, 8(%rbx)
	movl	%eax, %ecx
	shrl	$14, %ecx
	andl	$1, %ecx
	movl	%ecx, 12(%rbx)
	movl	%eax, %esi
	shrl	$13, %esi
	andl	$1, %esi
	movl	%esi, 16(%rbx)
	movl	%eax, %edi
	shrl	$12, %edi
	andl	$1, %edi
	leaq	40(%rbx), %r12
	movl	%edi, 40(%rbx)
	movl	%eax, %edi
	andl	$4095, %edi                     ## imm = 0xFFF
	movl	%edi, 44(%rbx)
	movq	$0, 32(%rbx)
	testl	%eax, %eax
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	jns	LBB0_8
## %bb.1:
	testl	%edx, %edx
	je	LBB0_8
## %bb.2:
	movq	%r12, %rdx
	testl	%esi, %esi
	je	LBB0_7
## %bb.3:
	movq	%r13, %rdx
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.4:
	movq	%r12, %rdx
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_7
## %bb.5:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_nvkm_engine_chsw_load
	movq	%r13, %rdx
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	%r12, %rdx
	jmp	LBB0_7
LBB0_8:
	movq	%r12, %rdx
	testl	%esi, %esi
	jne	LBB0_7
## %bb.9:
	xorl	%edx, %edx
	jmp	LBB0_10
LBB0_7:
	movq	%rdx, 32(%rbx)
LBB0_10:
	movl	(%rbx), %ecx
	movl	4(%rbx), %r8d
	cmpl	$0, 40(%rbx)
	leaq	L_.str.2(%rip), %rsi
	leaq	L_.str.1(%rip), %r11
	movq	%r11, %r10
	cmoveq	%rsi, %r10
	cmpq	%r12, %rdx
	leaq	L_.str.3(%rip), %rdi
	leaq	L_.str.4(%rip), %rax
	movq	%rax, %r12
	cmoveq	%rdi, %r12
	cmpl	$0, 20(%rbx)
	cmoveq	%rsi, %r11
	movl	8(%rbx), %r9d
	cmpq	%r13, %rdx
	movl	12(%rbx), %r13d
	movl	16(%rbx), %r14d
	cmoveq	%rdi, %rax
	movl	44(%rbx), %r15d
	movl	24(%rbx), %ebx
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	pushq	%rax
	pushq	%rbx
	pushq	%r11
	pushq	%r12
	pushq	%r15
	pushq	%r10
	pushq	%r14
	pushq	%r13
	callq	_nvkm_debug
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"engine %02d: busy %d faulted %d chsw %d save %d load %d %sid %d%s-> %sid %d%s\n"

L_.str.1:                               ## @.str.1
	.asciz	"tsg"

L_.str.2:                               ## @.str.2
	.asciz	"ch"

L_.str.3:                               ## @.str.3
	.asciz	"*"

L_.str.4:                               ## @.str.4
	.asciz	" "

	.no_dead_strip	_gk104_fifo_engine_status
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function gk104_fifo_engine_status
lCPI0_0:
	.long	4294967281                      ; 0xfffffff1
	.long	4294967282                      ; 0xfffffff2
	.long	4294967283                      ; 0xfffffff3
	.long	4294967268                      ; 0xffffffe4
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_gk104_fifo_engine_status:              ; @gk104_fifo_engine_status
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldp	x0, x8, [x0]
	ldr	x22, [x8, w1, sxtw #3]
	mov	w8, #9792
	add	w1, w8, w1, lsl #3
	bl	_nvkm_rd32
	lsr	w8, w0, #31
	ubfx	w9, w0, #30, #1
	stp	w8, w9, [x21]
	add	x23, x21, #20
	ubfx	w8, w0, #16, #12
	str	w8, [x21, #24]
	dup.4s	v0, w0
Lloh0:
	adrp	x8, lCPI0_0@PAGE
Lloh1:
	ldr	q1, [x8, lCPI0_0@PAGEOFF]
	ushl.4s	v0, v0, v1
	movi.4s	v1, #1
	and.16b	v0, v0, v1
	ubfx	w8, w0, #12, #1
	mov	x24, x21
	str	w8, [x24, #40]!
	stur	q0, [x21, #8]
	and	w8, w0, #0xfff
	str	w8, [x21, #44]
	str	xzr, [x21, #32]
	mov.s	w9, v0[2]
	tbz	w0, #31, LBB0_7
; %bb.1:
	fmov	w8, s0
	cbz	w8, LBB0_7
; %bb.2:
	cbz	w9, LBB0_6
; %bb.3:
	mov.s	w8, v0[1]
	cbz	w8, LBB0_10
; %bb.4:
	cbz	x22, LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_nvkm_engine_chsw_load
	mov	x8, x23
	cbnz	x0, LBB0_8
LBB0_6:
	mov	x8, x24
	b	LBB0_8
LBB0_7:
	mov	x8, x24
	cbz	w9, LBB0_9
LBB0_8:
	str	x8, [x21, #32]
	b	LBB0_11
LBB0_9:
	mov	x8, #0
	b	LBB0_11
LBB0_10:
	mov	x8, x23
	str	x23, [x21, #32]
LBB0_11:
	ldp	w3, w4, [x21]
Lloh2:
	adrp	x9, l_.str.1@PAGE
Lloh3:
	add	x9, x9, l_.str.1@PAGEOFF
Lloh4:
	adrp	x10, l_.str.2@PAGE
Lloh5:
	add	x10, x10, l_.str.2@PAGEOFF
	ldp	w5, w6, [x21, #8]
	ldp	w11, w12, [x21, #40]
	cmp	w11, #0
Lloh6:
	adrp	x11, l_.str.4@PAGE
Lloh7:
	add	x11, x11, l_.str.4@PAGEOFF
	csel	x13, x10, x9, eq
Lloh8:
	adrp	x14, l_.str.3@PAGE
Lloh9:
	add	x14, x14, l_.str.3@PAGEOFF
	cmp	x8, x24
	csel	x15, x14, x11, eq
	ldp	w7, w16, [x21, #16]
	cmp	w16, #0
	csel	x9, x10, x9, eq
	ldr	w10, [x21, #24]
	cmp	x8, x23
	csel	x8, x14, x11, eq
	str	x8, [sp, #40]
	str	w10, [sp, #32]
	stp	x15, x9, [sp, #16]
	str	w12, [sp, #8]
	str	x13, [sp]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	bl	_nvkm_debug
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"engine %02d: busy %d faulted %d chsw %d save %d load %d %sid %d%s-> %sid %d%s\n"

l_.str.1:                               ; @.str.1
	.asciz	"tsg"

l_.str.2:                               ; @.str.2
	.asciz	"ch"

l_.str.3:                               ; @.str.3
	.asciz	"*"

l_.str.4:                               ; @.str.4
	.asciz	" "

	.no_dead_strip	_gk104_fifo_engine_status
.subsections_via_symbols
