	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a6xx_gmu_set_oob               ## -- Begin function a6xx_gmu_set_oob
	.p2align	4, 0x90
_a6xx_gmu_set_oob:                      ## @a6xx_gmu_set_oob
	.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
	addl	$-128, %esi
	cmpl	$3, %esi
	jae	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movslq	%esi, %r12
	leaq	l_switch.table.a6xx_gmu_set_oob(%rip), %rax
	movq	(%rax,%r12,8), %rax
	leaq	l_switch.table.a6xx_gmu_set_oob.4(%rip), %rcx
	movq	(%rcx,%r12,8), %rcx
	movb	(%rcx), %bl
	movb	(%rax), %cl
	movq	_REG_A6XX_GMU_HOST2GMU_INTR_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %r14d
	movl	$1, %edx
	shll	%cl, %edx
	callq	_gmu_write
	movq	_REG_A6XX_GMU_GMU2HOST_INTR_INFO@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movl	%ebx, %ecx
	shll	%cl, %r14d
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	movl	$100, %r8d
	movl	$10000, %r9d                    ## imm = 0x2710
	callq	_gmu_poll_timeout
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	l_reltable.a6xx_gmu_set_oob(%rip), %rax
	movslq	(%rax,%r12,4), %r12
	addq	%rax, %r12
	movq	%r13, %rax
	movl	(%r15), %r13d
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_gmu_read
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edi
	movq	%r12, %rdx
	movl	%eax, %ecx
	callq	_DRM_DEV_ERROR
LBB0_4:
	movq	_REG_A6XX_GMU_GMU2HOST_INTR_CLR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_gmu_write
	jmp	LBB0_5
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GMU_OOB_GPU_SET_REQUEST,4,2    ## @GMU_OOB_GPU_SET_REQUEST
	.comm	_GMU_OOB_GPU_SET_ACK,4,2        ## @GMU_OOB_GPU_SET_ACK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPU_SET"

	.comm	_GMU_OOB_BOOT_SLUMBER_REQUEST,4,2 ## @GMU_OOB_BOOT_SLUMBER_REQUEST
	.comm	_GMU_OOB_BOOT_SLUMBER_ACK,4,2   ## @GMU_OOB_BOOT_SLUMBER_ACK
L_.str.1:                               ## @.str.1
	.asciz	"BOOT_SLUMBER"

	.comm	_GMU_OOB_DCVS_REQUEST,4,2       ## @GMU_OOB_DCVS_REQUEST
	.comm	_GMU_OOB_DCVS_ACK,4,2           ## @GMU_OOB_DCVS_ACK
L_.str.2:                               ## @.str.2
	.asciz	"GPU_DCVS"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_REG_A6XX_GMU_HOST2GMU_INTR_SET,4,2 ## @REG_A6XX_GMU_HOST2GMU_INTR_SET
	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_INFO,4,2 ## @REG_A6XX_GMU_GMU2HOST_INTR_INFO
L_.str.3:                               ## @.str.3
	.asciz	"Timeout waiting for GMU OOB set %s: 0x%x\n"

	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_CLR,4,2 ## @REG_A6XX_GMU_GMU2HOST_INTR_CLR
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.a6xx_gmu_set_oob
l_switch.table.a6xx_gmu_set_oob:
	.quad	_GMU_OOB_GPU_SET_REQUEST
	.quad	_GMU_OOB_DCVS_REQUEST
	.quad	_GMU_OOB_BOOT_SLUMBER_REQUEST

	.p2align	3                               ## @switch.table.a6xx_gmu_set_oob.4
l_switch.table.a6xx_gmu_set_oob.4:
	.quad	_GMU_OOB_GPU_SET_ACK
	.quad	_GMU_OOB_DCVS_ACK
	.quad	_GMU_OOB_BOOT_SLUMBER_ACK

	.section	__TEXT,__const
	.p2align	2                               ## @reltable.a6xx_gmu_set_oob
l_reltable.a6xx_gmu_set_oob:
	.long	L_.str-l_reltable.a6xx_gmu_set_oob
	.long	L_.str.2-l_reltable.a6xx_gmu_set_oob
	.long	L_.str.1-l_reltable.a6xx_gmu_set_oob

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_a6xx_gmu_set_oob               ; -- Begin function a6xx_gmu_set_oob
	.p2align	2
_a6xx_gmu_set_oob:                      ; @a6xx_gmu_set_oob
	.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
	sub	w8, w1, #128
	cmp	w8, #3
	b.hs	LBB0_4
; %bb.1:
	mov	x19, x0
	sbfiz	x22, x8, #3, #32
Lloh0:
	adrp	x8, l_switch.table.a6xx_gmu_set_oob@PAGE
Lloh1:
	add	x8, x8, l_switch.table.a6xx_gmu_set_oob@PAGEOFF
	ldr	x8, [x8, x22]
Lloh2:
	adrp	x9, l_switch.table.a6xx_gmu_set_oob.4@PAGE
Lloh3:
	add	x9, x9, l_switch.table.a6xx_gmu_set_oob.4@PAGEOFF
	ldr	x9, [x9, x22]
	ldr	w20, [x9]
	ldr	w8, [x8]
Lloh4:
	adrp	x9, _REG_A6XX_GMU_HOST2GMU_INTR_SET@GOTPAGE
Lloh5:
	ldr	x9, [x9, _REG_A6XX_GMU_HOST2GMU_INTR_SET@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x9]
	mov	w21, #1
	lsl	w2, w21, w8
	bl	_gmu_write
Lloh7:
	adrp	x24, _REG_A6XX_GMU_GMU2HOST_INTR_INFO@GOTPAGE
Lloh8:
	ldr	x24, [x24, _REG_A6XX_GMU_GMU2HOST_INTR_INFO@GOTPAGEOFF]
	ldr	w1, [x24]
	lsl	w20, w21, w20
	mov	x0, x19
	mov	w3, #0
	mov	w4, #100
	mov	w5, #10000
	bl	_gmu_poll_timeout
	mov	x21, x0
	cbz	w0, LBB0_3
; %bb.2:
Lloh9:
	adrp	x8, l_switch.table.a6xx_gmu_set_oob.5@PAGE
Lloh10:
	add	x8, x8, l_switch.table.a6xx_gmu_set_oob.5@PAGEOFF
	ldr	x22, [x8, x22]
	ldr	w23, [x19]
	ldr	w1, [x24]
	mov	x0, x19
	bl	_gmu_read
	mov	x3, x0
Lloh11:
	adrp	x1, l_.str.3@PAGE
Lloh12:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x23
	mov	x2, x22
	bl	_DRM_DEV_ERROR
LBB0_3:
Lloh13:
	adrp	x8, _REG_A6XX_GMU_GMU2HOST_INTR_CLR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _REG_A6XX_GMU_GMU2HOST_INTR_CLR@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_gmu_write
	b	LBB0_5
LBB0_4:
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_5:
	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
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GMU_OOB_GPU_SET_REQUEST,4,2    ; @GMU_OOB_GPU_SET_REQUEST
	.comm	_GMU_OOB_GPU_SET_ACK,4,2        ; @GMU_OOB_GPU_SET_ACK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPU_SET"

	.comm	_GMU_OOB_BOOT_SLUMBER_REQUEST,4,2 ; @GMU_OOB_BOOT_SLUMBER_REQUEST
	.comm	_GMU_OOB_BOOT_SLUMBER_ACK,4,2   ; @GMU_OOB_BOOT_SLUMBER_ACK
l_.str.1:                               ; @.str.1
	.asciz	"BOOT_SLUMBER"

	.comm	_GMU_OOB_DCVS_REQUEST,4,2       ; @GMU_OOB_DCVS_REQUEST
	.comm	_GMU_OOB_DCVS_ACK,4,2           ; @GMU_OOB_DCVS_ACK
l_.str.2:                               ; @.str.2
	.asciz	"GPU_DCVS"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_REG_A6XX_GMU_HOST2GMU_INTR_SET,4,2 ; @REG_A6XX_GMU_HOST2GMU_INTR_SET
	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_INFO,4,2 ; @REG_A6XX_GMU_GMU2HOST_INTR_INFO
l_.str.3:                               ; @.str.3
	.asciz	"Timeout waiting for GMU OOB set %s: 0x%x\n"

	.comm	_REG_A6XX_GMU_GMU2HOST_INTR_CLR,4,2 ; @REG_A6XX_GMU_GMU2HOST_INTR_CLR
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.a6xx_gmu_set_oob
l_switch.table.a6xx_gmu_set_oob:
	.quad	_GMU_OOB_GPU_SET_REQUEST
	.quad	_GMU_OOB_DCVS_REQUEST
	.quad	_GMU_OOB_BOOT_SLUMBER_REQUEST

	.p2align	3                               ; @switch.table.a6xx_gmu_set_oob.4
l_switch.table.a6xx_gmu_set_oob.4:
	.quad	_GMU_OOB_GPU_SET_ACK
	.quad	_GMU_OOB_DCVS_ACK
	.quad	_GMU_OOB_BOOT_SLUMBER_ACK

	.p2align	3                               ; @switch.table.a6xx_gmu_set_oob.5
l_switch.table.a6xx_gmu_set_oob.5:
	.quad	l_.str
	.quad	l_.str.2
	.quad	l_.str.1

.subsections_via_symbols
