	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function azx_setup_controller
_azx_setup_controller:                  ## @azx_setup_controller
	.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	%rsi, %r15
	movq	%rdi, %r14
	callq	_azx_stream_clear
	movq	_SD_CTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_azx_sd_readl
	movq	_SD_CTL_STREAM_TAG_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movl	(%r15), %r13d
	movq	_SD_CTL_STREAM_TAG_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r13d
	movq	%r14, %rdi
	callq	_azx_snoop
	xorl	%ecx, %ecx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_SD_CTL_TRAFFIC_PRIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_2:
	orl	%ecx, %ebx
	orl	%ebx, %r13d
	movl	(%r12), %esi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_azx_sd_writel
	movq	_SD_CBL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movq	%r15, %rdi
	callq	_azx_sd_writel
	movq	_SD_FORMAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	24(%r15), %rdx
	movq	%r15, %rdi
	callq	_azx_sd_writew
	movq	_SD_LVI@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%r15), %rdx
	decq	%rdx
	movq	%r15, %rdi
	callq	_azx_sd_writew
	movq	_SD_BDLPL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r15), %edx
	movq	%r15, %rdi
	callq	_azx_sd_writel
	movq	_SD_BDLPU@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%r15), %rdi
	callq	_upper_32_bits
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_azx_sd_writel
	movq	(%r14), %rax
	movq	(%rax), %rcx
	movq	_POS_FIX_LPIB@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.3:
	cmpq	%rcx, 8(%rax)
	je	LBB0_6
LBB0_4:
	movq	_DPLBASE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_azx_readl
	movq	_ICH6_DPLBASE_ENABLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	testl	%eax, %edx
	jne	LBB0_6
## %bb.5:
	movl	(%rbx), %esi
	orl	8(%r14), %edx
	movq	%r14, %rdi
	callq	_azx_writel
LBB0_6:
	movl	(%r12), %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_azx_sd_readl
	movq	_SD_INT_MASK@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_azx_sd_writel
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SD_CTL,4,2                     ## @SD_CTL
	.comm	_SD_CTL_STREAM_TAG_MASK,4,2     ## @SD_CTL_STREAM_TAG_MASK
	.comm	_SD_CTL_STREAM_TAG_SHIFT,4,2    ## @SD_CTL_STREAM_TAG_SHIFT
	.comm	_SD_CTL_TRAFFIC_PRIO,4,2        ## @SD_CTL_TRAFFIC_PRIO
	.comm	_SD_CBL,4,2                     ## @SD_CBL
	.comm	_SD_FORMAT,4,2                  ## @SD_FORMAT
	.comm	_SD_LVI,4,2                     ## @SD_LVI
	.comm	_SD_BDLPL,4,2                   ## @SD_BDLPL
	.comm	_SD_BDLPU,4,2                   ## @SD_BDLPU
	.comm	_POS_FIX_LPIB,8,3               ## @POS_FIX_LPIB
	.comm	_DPLBASE,4,2                    ## @DPLBASE
	.comm	_ICH6_DPLBASE_ENABLE,4,2        ## @ICH6_DPLBASE_ENABLE
	.comm	_SD_INT_MASK,4,2                ## @SD_INT_MASK
	.no_dead_strip	_azx_setup_controller
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function azx_setup_controller
_azx_setup_controller:                  ; @azx_setup_controller
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	bl	_azx_stream_clear
Lloh0:
	adrp	x22, _SD_CTL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SD_CTL@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_azx_sd_readl
Lloh2:
	adrp	x8, _SD_CTL_STREAM_TAG_MASK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SD_CTL_STREAM_TAG_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	bic	w8, w0, w8
	ldr	w9, [x19]
Lloh5:
	adrp	x10, _SD_CTL_STREAM_TAG_SHIFT@GOTPAGE
Lloh6:
	ldr	x10, [x10, _SD_CTL_STREAM_TAG_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w21, w9, w8
	mov	x0, x20
	bl	_azx_snoop
Lloh8:
	adrp	x8, _SD_CTL_TRAFFIC_PRIO@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SD_CTL_TRAFFIC_PRIO@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w8, w8, wzr, eq
	orr	w2, w21, w8
	ldr	w1, [x22]
	mov	x0, x19
	bl	_azx_sd_writel
Lloh11:
	adrp	x8, _SD_CBL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SD_CBL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w2, [x19, #4]
	mov	x0, x19
	bl	_azx_sd_writel
Lloh14:
	adrp	x8, _SD_FORMAT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SD_FORMAT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	ldr	x2, [x19, #24]
	mov	x0, x19
	bl	_azx_sd_writew
Lloh17:
	adrp	x8, _SD_LVI@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SD_LVI@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	x8, [x19, #16]
	sub	x2, x8, #1
	mov	x0, x19
	bl	_azx_sd_writew
Lloh20:
	adrp	x8, _SD_BDLPL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SD_BDLPL@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	bl	_azx_sd_writel
Lloh23:
	adrp	x8, _SD_BDLPU@GOTPAGE
Lloh24:
	ldr	x8, [x8, _SD_BDLPU@GOTPAGEOFF]
Lloh25:
	ldr	w21, [x8]
	ldr	x0, [x19, #8]
	bl	_upper_32_bits
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_azx_sd_writel
	ldr	x8, [x20]
	ldr	x9, [x8]
Lloh26:
	adrp	x10, _POS_FIX_LPIB@GOTPAGE
Lloh27:
	ldr	x10, [x10, _POS_FIX_LPIB@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [x8, #8]
	cmp	x8, x9
	b.eq	LBB0_4
LBB0_2:
Lloh29:
	adrp	x21, _DPLBASE@GOTPAGE
Lloh30:
	ldr	x21, [x21, _DPLBASE@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_azx_readl
Lloh31:
	adrp	x8, _ICH6_DPLBASE_ENABLE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ICH6_DPLBASE_ENABLE@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.3:
	ldr	w1, [x21]
	ldr	w9, [x20, #8]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_azx_writel
LBB0_4:
	ldr	w20, [x22]
	mov	x0, x19
	mov	x1, x20
	bl	_azx_sd_readl
Lloh34:
	adrp	x8, _SD_INT_MASK@GOTPAGE
Lloh35:
	ldr	x8, [x8, _SD_INT_MASK@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	orr	w2, w8, w0
	mov	x0, x19
	mov	x1, x20
	bl	_azx_sd_writel
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_SD_CTL,4,2                     ; @SD_CTL
	.comm	_SD_CTL_STREAM_TAG_MASK,4,2     ; @SD_CTL_STREAM_TAG_MASK
	.comm	_SD_CTL_STREAM_TAG_SHIFT,4,2    ; @SD_CTL_STREAM_TAG_SHIFT
	.comm	_SD_CTL_TRAFFIC_PRIO,4,2        ; @SD_CTL_TRAFFIC_PRIO
	.comm	_SD_CBL,4,2                     ; @SD_CBL
	.comm	_SD_FORMAT,4,2                  ; @SD_FORMAT
	.comm	_SD_LVI,4,2                     ; @SD_LVI
	.comm	_SD_BDLPL,4,2                   ; @SD_BDLPL
	.comm	_SD_BDLPU,4,2                   ; @SD_BDLPU
	.comm	_POS_FIX_LPIB,8,3               ; @POS_FIX_LPIB
	.comm	_DPLBASE,4,2                    ; @DPLBASE
	.comm	_ICH6_DPLBASE_ENABLE,4,2        ; @ICH6_DPLBASE_ENABLE
	.comm	_SD_INT_MASK,4,2                ; @SD_INT_MASK
	.no_dead_strip	_azx_setup_controller
.subsections_via_symbols
