	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a6xx_get_cluster
_a6xx_get_cluster:                      ## @a6xx_get_cluster
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r12
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	(%r8), %r15
	movq	_A6XX_CD_DATA_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	addl	8(%r8), %r14d
	movl	24(%rdx), %esi
	testl	%esi, %esi
	je	LBB0_2
## %bb.1:
	movl	(%r12), %edx
	movq	%r15, %rdi
	callq	_CRASHDUMP_WRITE
	leaq	(%r15,%rax,4), %r15
LBB0_2:
	movq	_A6XX_NUM_CONTEXTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_3
## %bb.4:
	xorl	%ebx, %ebx
	xorl	%ecx, %ecx
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	incl	%ecx
	movq	_A6XX_NUM_CONTEXTS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jge	LBB0_9
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
	movq	_REG_A6XX_CP_APERTURE_CNTL_CD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r12), %eax
	shll	$8, %eax
	movl	%ecx, %edx
	shll	$4, %edx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	orl	%ecx, %edx
	orl	%eax, %edx
	movq	%r15, %rdi
	callq	_CRASHDUMP_WRITE
	leaq	(%r15,%rax,4), %r15
	cmpl	$0, 8(%r12)
	jle	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	16(%r12), %rdi
	movl	%r13d, %esi
	callq	_RANGE
	movl	%eax, %r12d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rax
	movl	(%rax,%r13,4), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	movl	%r14d, %ecx
	callq	_CRASHDUMP_READ
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	leaq	(%r15,%rax,4), %r15
	leal	(%r14,%r12,4), %r14d
	movl	$0, %eax
	cmovnel	%eax, %r12d
	addl	%r12d, %ebx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	addq	$2, %r13
	cmpl	%r13d, 8(%r12)
	jg	LBB0_7
	jmp	LBB0_8
LBB0_3:
	xorl	%ebx, %ebx
LBB0_9:
	movq	%r15, %rdi
	callq	_CRASHDUMP_FINI
	movq	_A6XX_NUM_CONTEXTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%ebx, %r14
	imulq	%rax, %r14
	shlq	$2, %r14
	movq	_A6XX_CD_DATA_SIZE@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	(%rax), %r14
	seta	%dil
	callq	_WARN_ON
	testq	%rax, %rax
	jne	LBB0_12
## %bb.10:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_a6xx_crashdumper_run
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%r12, 8(%rbx)
	movq	_A6XX_CD_DATA_OFFSET@GOTPCREL(%rip), %rax
	movslq	(%rax), %rsi
	shlq	$2, %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	(%rax), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_state_kmemdup
	movl	%eax, (%rbx)
LBB0_12:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_A6XX_CD_DATA_OFFSET,4,2        ## @A6XX_CD_DATA_OFFSET
	.comm	_A6XX_NUM_CONTEXTS,4,2          ## @A6XX_NUM_CONTEXTS
	.comm	_REG_A6XX_CP_APERTURE_CNTL_CD,4,2 ## @REG_A6XX_CP_APERTURE_CNTL_CD
	.comm	_A6XX_CD_DATA_SIZE,8,3          ## @A6XX_CD_DATA_SIZE
	.no_dead_strip	_a6xx_get_cluster
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a6xx_get_cluster
_a6xx_get_cluster:                      ; @a6xx_get_cluster
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x4
	stp	x1, x3, [sp, #8]                ; 16-byte Folded Spill
	mov	x22, x2
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	ldr	x24, [x4]
	ldr	w23, [x4, #8]
Lloh0:
	adrp	x8, _A6XX_CD_DATA_OFFSET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _A6XX_CD_DATA_OFFSET@GOTPAGEOFF]
Lloh2:
	ldr	w25, [x8]
	ldr	w1, [x2, #24]
	cbz	w1, LBB0_2
; %bb.1:
	ldr	w2, [x22]
	mov	x0, x24
	bl	_CRASHDUMP_WRITE
	add	x24, x24, x0, lsl #2
LBB0_2:
Lloh3:
	adrp	x28, _A6XX_NUM_CONTEXTS@GOTPAGE
Lloh4:
	ldr	x28, [x28, _A6XX_NUM_CONTEXTS@GOTPAGEOFF]
	ldr	w8, [x28]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:
	mov	w20, #0
	mov	w19, #0
	add	w25, w25, w23
Lloh5:
	adrp	x23, _REG_A6XX_CP_APERTURE_CNTL_CD@GOTPAGE
Lloh6:
	ldr	x23, [x23, _REG_A6XX_CP_APERTURE_CNTL_CD@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w19, w19, #1
	ldr	w8, [x28]
	cmp	w19, w8
	b.ge	LBB0_9
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	ldr	w1, [x23]
	ldr	w8, [x22, #4]
	orr	w9, w19, w19, lsl #4
	orr	w2, w9, w8, lsl #8
	mov	x0, x24
	bl	_CRASHDUMP_WRITE
	add	x24, x24, x0, lsl #2
	ldr	w8, [x22, #8]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, #0
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x0, [x22, #16]
	mov	x1, x26
	bl	_RANGE
	mov	x27, x0
	ldr	x8, [x22, #16]
	ldr	w1, [x8, x26, lsl #2]
	mov	x0, x24
	mov	x2, x27
	mov	x3, x25
	bl	_CRASHDUMP_READ
	add	x24, x24, x0, lsl #2
	add	w25, w25, w27, lsl #2
	cmp	w19, #0
	csel	w8, w27, wzr, eq
	add	w20, w8, w20
	add	x26, x26, #2
	ldr	w8, [x22, #8]
	cmp	w8, w26
	b.gt	LBB0_7
	b	LBB0_4
LBB0_8:
	mov	w20, #0
LBB0_9:
	mov	x0, x24
	bl	_CRASHDUMP_FINI
	ldr	w8, [x28]
	mul	w8, w8, w20
	sbfiz	x24, x8, #2, #32
Lloh7:
	adrp	x8, _A6XX_CD_DATA_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _A6XX_CD_DATA_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	cmp	x24, x8
	cset	w0, hi
	bl	_WARN_ON
	cbnz	x0, LBB0_12
; %bb.10:
	ldr	x0, [sp, #24]                   ; 8-byte Folded Reload
	mov	x1, x21
	bl	_a6xx_crashdumper_run
	cbnz	x0, LBB0_12
; %bb.11:
	ldp	x0, x19, [sp, #8]               ; 16-byte Folded Reload
	str	x22, [x19, #8]
	ldr	x8, [x21]
Lloh10:
	adrp	x9, _A6XX_CD_DATA_OFFSET@GOTPAGE
Lloh11:
	ldr	x9, [x9, _A6XX_CD_DATA_OFFSET@GOTPAGEOFF]
Lloh12:
	ldrsw	x9, [x9]
	add	x1, x8, x9, lsl #2
	mov	x2, x24
	bl	_state_kmemdup
	str	w0, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_A6XX_CD_DATA_OFFSET,4,2        ; @A6XX_CD_DATA_OFFSET
	.comm	_A6XX_NUM_CONTEXTS,4,2          ; @A6XX_NUM_CONTEXTS
	.comm	_REG_A6XX_CP_APERTURE_CNTL_CD,4,2 ; @REG_A6XX_CP_APERTURE_CNTL_CD
	.comm	_A6XX_CD_DATA_SIZE,8,3          ; @A6XX_CD_DATA_SIZE
	.no_dead_strip	_a6xx_get_cluster
.subsections_via_symbols
