	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gfx_v6_0_setup_spi
_gfx_v6_0_setup_spi:                    ## @gfx_v6_0_setup_spi
	.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, %r15
	callq	_mutex_lock
	movl	4(%r15), %ecx
	testl	%ecx, %ecx
	jle	LBB0_16
## %bb.1:
	movl	8(%r15), %eax
	xorl	%r14d, %r14d
	movq	_mmSPI_STATIC_THREAD_MGMT_3@GOTPCREL(%rip), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	incl	%r14d
	cmpl	%ecx, %r14d
	jge	LBB0_16
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%eax, %eax
	jle	LBB0_15
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	movl	$-1, %ecx
	callq	_gfx_v6_0_select_se_sh
	movl	(%r13), %edi
	callq	_RREG32
	movl	%eax, %r12d
	movq	%r15, %rdi
	callq	_gfx_v6_0_get_cu_enabled
	movl	$-2, %ecx
	testb	$1, %al
	jne	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$-3, %ecx
	testb	$2, %al
	jne	LBB0_12
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$-9, %ecx
	testb	$8, %al
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$-65, %ecx
	testb	$64, %al
	jne	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$-1025, %ecx                    ## imm = 0xFBFF
	testl	$1024, %eax                     ## imm = 0x400
	jne	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	$-32769, %ecx                   ## imm = 0xFFFF7FFF
	testl	$32768, %eax                    ## imm = 0x8000
	jne	LBB0_12
## %bb.10:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$-2097153, %ecx                 ## imm = 0xFFDFFFFF
	testl	$2097152, %eax                  ## imm = 0x200000
	jne	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=2
	movl	$-268435457, %ecx               ## imm = 0xEFFFFFFF
	testl	$268435456, %eax                ## imm = 0x10000000
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=2
	andl	%ecx, %r12d
	movl	(%r13), %edi
	movl	%r12d, %esi
	callq	_WREG32
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=2
	incl	%ebx
	movl	8(%r15), %eax
	cmpl	%eax, %ebx
	jl	LBB0_4
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %ecx
	jmp	LBB0_15
LBB0_16:
	movq	%r15, %rdi
	movl	$-1, %esi
	movl	$-1, %edx
	movl	$-1, %ecx
	callq	_gfx_v6_0_select_se_sh
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mmSPI_STATIC_THREAD_MGMT_3,4,2 ## @mmSPI_STATIC_THREAD_MGMT_3
	.no_dead_strip	_gfx_v6_0_setup_spi
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gfx_v6_0_setup_spi
_gfx_v6_0_setup_spi:                    ; @gfx_v6_0_setup_spi
	.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
	bl	_mutex_lock
	ldr	w9, [x19, #4]
	cmp	w9, #1
	b.lt	LBB0_24
; %bb.1:
	mov	w20, #0
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x23, _mmSPI_STATIC_THREAD_MGMT_3@GOTPAGE
Lloh1:
	ldr	x23, [x23, _mmSPI_STATIC_THREAD_MGMT_3@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, #1
	cmp	w20, w9
	b.ge	LBB0_24
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w21, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x19
	mov	x1, x20
	mov	x2, x21
	mov	w3, #-1
	bl	_gfx_v6_0_select_se_sh
	ldr	w0, [x23]
	bl	_RREG32
	mov	x22, x0
	mov	x0, x19
	bl	_gfx_v6_0_get_cu_enabled
	tbnz	w0, #0, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #1, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #3, LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #6, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #10, LBB0_18
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #15, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=2
	tbnz	w0, #21, LBB0_20
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=2
	tbz	w0, #28, LBB0_22
; %bb.13:                               ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-268435457
	b	LBB0_21
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-2
	b	LBB0_21
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-3
	b	LBB0_21
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-9
	b	LBB0_21
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-65
	b	LBB0_21
LBB0_18:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-1025
	b	LBB0_21
LBB0_19:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-32769
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	w8, #-2097153
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=2
	and	w1, w22, w8
	ldr	w0, [x23]
	bl	_WREG32
LBB0_22:                                ;   in Loop: Header=BB0_5 Depth=2
	add	w21, w21, #1
	ldr	w8, [x19, #8]
	cmp	w21, w8
	b.lt	LBB0_5
; %bb.23:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x19, #4]
	b	LBB0_2
LBB0_24:
	mov	x0, x19
	mov	w1, #-1
	mov	w2, #-1
	mov	w3, #-1
	bl	_gfx_v6_0_select_se_sh
	mov	x0, x19
	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
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_mmSPI_STATIC_THREAD_MGMT_3,4,2 ; @mmSPI_STATIC_THREAD_MGMT_3
	.no_dead_strip	_gfx_v6_0_setup_spi
.subsections_via_symbols
