	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sdhci_attach
_bcm_sdhci_attach:                      ## @bcm_sdhci_attach
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r14d, 104(%rax)
	movq	$0, 112(%rax)
	movq	_compat_data@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_ofw_bus_search_compatible
	movq	(%rax), %rax
	movq	%rax, 80(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_BCM2835_MBOX_POWER_ID_EMMC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bcm2835_mbox_set_power_state
	testl	%eax, %eax
	je	LBB0_5
## %bb.3:
	movl	%eax, %r15d
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_42
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_42
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_42
LBB0_5:
	movl	$0, -44(%rbp)
	movq	80(%rbx), %rax
	movl	28(%rax), %edi
	leaq	-44(%rbp), %rsi
	callq	_bcm2835_mbox_get_clock_rate
	movl	%eax, %r15d
	movl	-44(%rbp), %edx
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	testl	%edx, %edx
	jne	LBB0_13
	jmp	LBB0_8
LBB0_6:
	movslq	%edx, %rax
	imulq	$1125899907, %rax, %rdx         ## imm = 0x431BDE83
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$50, %rdx
	addl	%eax, %edx
	movl	%edx, -44(%rbp)
	testl	%edx, %edx
	jne	LBB0_13
LBB0_8:
	movl	104(%rbx), %edi
	callq	_ofw_bus_get_node
	leaq	L_.str.1(%rip), %rsi
	leaq	-52(%rbp), %rdx
	movl	%eax, %edi
	movl	$4, %ecx
	callq	_OF_getencprop
	testq	%rax, %rax
	jle	LBB0_9
## %bb.10:
	movslq	-52(%rbp), %rax
	imulq	$1125899907, %rax, %rdx         ## imm = 0x431BDE83
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$50, %rdx
	addl	%eax, %edx
	movl	%edx, -44(%rbp)
	testl	%edx, %edx
	jne	LBB0_13
LBB0_12:
	movq	80(%rbx), %rax
	movl	(%rax), %edx
	movl	%edx, -44(%rbp)
LBB0_13:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_15:
	movl	$0, -48(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_16
## %bb.18:
	movq	%rax, %rdi
	callq	_rman_get_bustag
	movl	%eax, 92(%rbx)
	movq	8(%rbx), %rdi
	callq	_rman_get_bushandle
	movl	%eax, 88(%rbx)
	movl	$0, -48(%rbp)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_SHAREABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	orl	(%r12), %ecx
	leaq	-48(%rbp), %rdx
	movl	%r14d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_19
## %bb.20:
	movq	_INTR_TYPE_BIO@GOTPCREL(%rip), %rcx
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_bcm_sdhci_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r8d
	leaq	24(%rbx), %rcx
	movq	%rcx, (%rsp)
	movl	%r14d, %edi
	movq	%rax, %rsi
	xorl	%ecx, %ecx
	movq	%rbx, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_17
LBB0_16:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_17
LBB0_19:
	leaq	L_.str.4(%rip), %rsi
LBB0_17:
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_33:
	movq	24(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_35
## %bb.34:
	movq	16(%rbx), %rsi
	movl	%r14d, %edi
	callq	_bus_teardown_intr
LBB0_35:
	movq	16(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_37
## %bb.36:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_37:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_42
## %bb.38:
	movl	(%r13), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_42:
	movl	%r15d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	_bcm2835_sdhci_pio_mode@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_24
## %bb.23:
	movq	_SDHCI_PLATFORM_TRANSFER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
LBB0_24:
	movq	_SDHCI_CAN_VDD_330@GOTPCREL(%rip), %rcx
	movq	_SDHCI_CAN_VDD_180@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	leaq	32(%rbx), %r12
	movq	_bcm2835_sdhci_hs@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	movl	$0, %edx
	je	LBB0_26
## %bb.25:
	movq	_SDHCI_CAN_DO_HISPD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_26:
	movl	-44(%rbp), %esi
	movq	_SDHCI_CLOCK_BASE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%esi, %eax
	orl	%edx, %eax
	movl	%eax, 32(%rbx)
	movq	80(%rbx), %rax
	movl	24(%rax), %eax
	movl	%eax, 36(%rbx)
	movl	%r14d, %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	callq	_sdhci_init_slot
	movq	80(%rbx), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_41
## %bb.27:
	movq	_BCM_DMA_CH_ANY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_bcm_dma_allocate
	movq	%rax, (%rbx)
	movq	_BCM_DMA_CH_INVALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_33
## %bb.28:
	movq	_bcm_sdhci_dma_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	movq	%rbx, %rdx
	callq	_bcm_dma_setup_intr
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:
	leaq	L_.str.6(%rip), %rsi
	jmp	LBB0_17
LBB0_9:
	movl	-44(%rbp), %edx
	testl	%edx, %edx
	jne	LBB0_13
	jmp	LBB0_12
LBB0_30:
	movl	%r14d, %edi
	callq	_bus_get_dma_tag
	movq	_BUS_SPACE_MAXADDR_32BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	_BCM_SDHCI_BUFFER_SIZE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movq	_NUM_DMA_SEGS@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	movq	_BUS_DMA_ALLOCNOW@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	leaq	76(%rbx), %rsi
	movq	%rsi, 56(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movl	%edi, 32(%rsp)
	movl	%edx, 24(%rsp)
	movl	%r9d, 16(%rsp)
	movl	%edx, 8(%rsp)
	movq	$0, (%rsp)
	movl	%eax, %edi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	callq	_bus_dma_tag_create
	testl	%eax, %eax
	je	LBB0_39
## %bb.31:
	movl	%eax, %r15d
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_32
LBB0_39:
	movl	76(%rbx), %edi
	movq	%rbx, %rdx
	addq	$72, %rdx
	xorl	%esi, %esi
	callq	_bus_dmamap_create
	testl	%eax, %eax
	je	LBB0_41
## %bb.40:
	movl	%eax, %r15d
	leaq	L_.str.8(%rip), %rsi
LBB0_32:
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_33
LBB0_41:
	movq	8(%rbx), %rdi
	callq	_rman_get_start
	movq	_SDHCI_BUFFER@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%rax, 64(%rbx)
	movl	%r14d, %edi
	callq	_bus_generic_probe
	movl	%r14d, %edi
	callq	_bus_generic_attach
	movq	%r12, %rdi
	callq	_sdhci_start_slot
	movq	_SDHCI_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movq	%r12, %rsi
	callq	_SDHCI_READ_4
	movq	%rax, 56(%rbx)
	movq	_SDHCI_TRANSFER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	movq	%r12, %rsi
	callq	_SDHCI_READ_4
	movq	%rax, 48(%rbx)
	xorl	%r15d, %r15d
	jmp	LBB0_42
	.cfi_endproc
                                        ## -- End function
	.comm	_compat_data,4,2                ## @compat_data
	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_BCM2835_MBOX_POWER_ID_EMMC,4,2 ## @BCM2835_MBOX_POWER_ID_EMMC
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_bootverbose,8,3                ## @bootverbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to enable the power\n"

L_.str.1:                               ## @.str.1
	.asciz	"clock-frequency"

L_.str.2:                               ## @.str.2
	.asciz	"SDHCI frequency: %dMHz\n"

	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
L_.str.3:                               ## @.str.3
	.asciz	"cannot allocate memory window\n"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_RF_SHAREABLE,4,2               ## @RF_SHAREABLE
L_.str.4:                               ## @.str.4
	.asciz	"cannot allocate interrupt\n"

	.comm	_INTR_TYPE_BIO,4,2              ## @INTR_TYPE_BIO
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_bcm_sdhci_intr,4,2             ## @bcm_sdhci_intr
L_.str.5:                               ## @.str.5
	.asciz	"cannot setup interrupt handler\n"

	.comm	_bcm2835_sdhci_pio_mode,4,2     ## @bcm2835_sdhci_pio_mode
	.comm	_SDHCI_PLATFORM_TRANSFER,4,2    ## @SDHCI_PLATFORM_TRANSFER
	.comm	_SDHCI_CAN_VDD_330,4,2          ## @SDHCI_CAN_VDD_330
	.comm	_SDHCI_CAN_VDD_180,4,2          ## @SDHCI_CAN_VDD_180
	.comm	_bcm2835_sdhci_hs,8,3           ## @bcm2835_sdhci_hs
	.comm	_SDHCI_CAN_DO_HISPD,4,2         ## @SDHCI_CAN_DO_HISPD
	.comm	_SDHCI_CLOCK_BASE_SHIFT,4,2     ## @SDHCI_CLOCK_BASE_SHIFT
	.comm	_BCM_DMA_CH_ANY,4,2             ## @BCM_DMA_CH_ANY
	.comm	_BCM_DMA_CH_INVALID,8,3         ## @BCM_DMA_CH_INVALID
	.comm	_bcm_sdhci_dma_intr,4,2         ## @bcm_sdhci_dma_intr
L_.str.6:                               ## @.str.6
	.asciz	"cannot setup dma interrupt handler\n"

	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ## @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
	.comm	_BCM_SDHCI_BUFFER_SIZE,4,2      ## @BCM_SDHCI_BUFFER_SIZE
	.comm	_NUM_DMA_SEGS,4,2               ## @NUM_DMA_SEGS
	.comm	_BUS_DMA_ALLOCNOW,4,2           ## @BUS_DMA_ALLOCNOW
L_.str.7:                               ## @.str.7
	.asciz	"failed allocate DMA tag"

L_.str.8:                               ## @.str.8
	.asciz	"bus_dmamap_create failed\n"

	.comm	_SDHCI_BUFFER,8,3               ## @SDHCI_BUFFER
	.comm	_SDHCI_BLOCK_SIZE,4,2           ## @SDHCI_BLOCK_SIZE
	.comm	_SDHCI_TRANSFER_MODE,4,2        ## @SDHCI_TRANSFER_MODE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_bcm_sdhci_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_sdhci_attach
_bcm_sdhci_attach:                      ; @bcm_sdhci_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #104]
	str	xzr, [x0, #112]
Lloh0:
	adrp	x8, _compat_data@GOTPAGE
Lloh1:
	ldr	x8, [x8, _compat_data@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ofw_bus_search_compatible
	ldr	x8, [x0]
	str	x8, [x20, #80]
	cbz	x8, LBB0_4
; %bb.1:
Lloh3:
	adrp	x8, _BCM2835_MBOX_POWER_ID_EMMC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BCM2835_MBOX_POWER_ID_EMMC@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _TRUE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_bcm2835_mbox_set_power_state
	cbz	w0, LBB0_5
; %bb.2:
	mov	x21, x0
Lloh9:
	adrp	x8, _bootverbose@GOTPAGE
Lloh10:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cbz	x8, LBB0_26
; %bb.3:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_26
LBB0_4:
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh16:
	ldr	w21, [x8]
	b	LBB0_26
LBB0_5:
	str	wzr, [sp, #52]
	ldr	x8, [x20, #80]
	ldr	w0, [x8, #28]
	add	x1, sp, #52
	bl	_bcm2835_mbox_get_clock_rate
	mov	x21, x0
	ldr	w8, [sp, #52]
	cbz	w0, LBB0_7
; %bb.6:
	cbnz	w8, LBB0_11
	b	LBB0_8
LBB0_7:
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	str	w8, [sp, #52]
	cbnz	w8, LBB0_11
LBB0_8:
	ldr	w0, [x20, #104]
	bl	_ofw_bus_get_node
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #56
	mov	w3, #4
	bl	_OF_getencprop
	cmp	x0, #0
	b.le	LBB0_33
; %bb.9:
	ldrsw	x8, [sp, #56]
	mov	w9, #56963
	movk	w9, #17179, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #50
	add	w8, w8, w9
	str	w8, [sp, #52]
	cbnz	w8, LBB0_11
LBB0_10:
	ldr	x8, [x20, #80]
	ldr	w8, [x8]
	str	w8, [sp, #52]
LBB0_11:
Lloh19:
	adrp	x9, _bootverbose@GOTPAGE
Lloh20:
	ldr	x9, [x9, _bootverbose@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cbz	x9, LBB0_13
; %bb.12:
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_13:
	stur	wzr, [x29, #-52]
Lloh24:
	adrp	x23, _SYS_RES_MEMORY@GOTPAGE
Lloh25:
	ldr	x23, [x23, _SYS_RES_MEMORY@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh26:
	adrp	x22, _RF_ACTIVE@GOTPAGE
Lloh27:
	ldr	x22, [x22, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w3, [x22]
	sub	x2, x29, #52
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #8]
Lloh28:
	adrp	x24, _SYS_RES_IRQ@GOTPAGE
Lloh29:
	ldr	x24, [x24, _SYS_RES_IRQ@GOTPAGEOFF]
	cbz	x0, LBB0_17
; %bb.14:
	bl	_rman_get_bustag
	str	w0, [x20, #92]
	ldr	x0, [x20, #8]
	bl	_rman_get_bushandle
	str	w0, [x20, #88]
	stur	wzr, [x29, #-52]
	ldr	w1, [x24]
	ldr	w8, [x22]
Lloh30:
	adrp	x9, _RF_SHAREABLE@GOTPAGE
Lloh31:
	ldr	x9, [x9, _RF_SHAREABLE@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w3, w9, w8
	sub	x2, x29, #52
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20, #16]
	cbz	x0, LBB0_18
; %bb.15:
	mov	x1, x0
Lloh33:
	adrp	x8, _INTR_TYPE_BIO@GOTPAGE
Lloh34:
	ldr	x8, [x8, _INTR_TYPE_BIO@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh37:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh39:
	adrp	x8, _bcm_sdhci_intr@GOTPAGE
Lloh40:
	ldr	x8, [x8, _bcm_sdhci_intr@GOTPAGEOFF]
Lloh41:
	ldr	w4, [x8]
	add	x6, x20, #24
	mov	x0, x19
	mov	x3, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	x0, LBB0_27
; %bb.16:
Lloh42:
	adrp	x1, l_.str.5@PAGE
Lloh43:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_19
LBB0_17:
Lloh44:
	adrp	x1, l_.str.3@PAGE
Lloh45:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_19
LBB0_18:
Lloh46:
	adrp	x1, l_.str.4@PAGE
Lloh47:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_19:
	mov	x0, x19
	bl	_device_printf
Lloh48:
	adrp	x8, _ENXIO@GOTPAGE
Lloh49:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh50:
	ldr	w21, [x8]
LBB0_20:
	ldr	x2, [x20, #24]
	cbz	x2, LBB0_22
; %bb.21:
	ldr	x1, [x20, #16]
	mov	x0, x19
	bl	_bus_teardown_intr
LBB0_22:
	ldr	x3, [x20, #16]
	cbz	x3, LBB0_24
; %bb.23:
	ldr	w1, [x24]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_24:
	ldr	x3, [x20, #8]
	cbz	x3, LBB0_26
; %bb.25:
	ldr	w1, [x23]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_release_resource
LBB0_26:
	mov	x0, x21
	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
	add	sp, sp, #128
	ret
LBB0_27:
Lloh51:
	adrp	x8, _bcm2835_sdhci_pio_mode@GOTPAGE
Lloh52:
	ldr	x8, [x8, _bcm2835_sdhci_pio_mode@GOTPAGEOFF]
Lloh53:
	ldr	w8, [x8]
	cbnz	w8, LBB0_29
; %bb.28:
Lloh54:
	adrp	x8, _SDHCI_PLATFORM_TRANSFER@GOTPAGE
Lloh55:
	ldr	x8, [x8, _SDHCI_PLATFORM_TRANSFER@GOTPAGEOFF]
Lloh56:
	ldr	w8, [x8]
	str	w8, [x20, #40]
LBB0_29:
Lloh57:
	adrp	x8, _SDHCI_CAN_VDD_330@GOTPAGE
Lloh58:
	ldr	x8, [x8, _SDHCI_CAN_VDD_330@GOTPAGEOFF]
Lloh59:
	adrp	x9, _SDHCI_CAN_VDD_180@GOTPAGE
Lloh60:
	ldr	x9, [x9, _SDHCI_CAN_VDD_180@GOTPAGEOFF]
Lloh61:
	ldr	w8, [x8]
Lloh62:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh63:
	adrp	x9, _bcm2835_sdhci_hs@GOTPAGE
Lloh64:
	ldr	x9, [x9, _bcm2835_sdhci_hs@GOTPAGEOFF]
Lloh65:
	ldr	x9, [x9]
Lloh66:
	adrp	x10, _SDHCI_CAN_DO_HISPD@GOTPAGE
Lloh67:
	ldr	x10, [x10, _SDHCI_CAN_DO_HISPD@GOTPAGEOFF]
Lloh68:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
	ldr	w9, [sp, #52]
Lloh69:
	adrp	x10, _SDHCI_CLOCK_BASE_SHIFT@GOTPAGE
Lloh70:
	ldr	x10, [x10, _SDHCI_CLOCK_BASE_SHIFT@GOTPAGEOFF]
Lloh71:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w8, w9
	mov	x22, x20
	str	w8, [x22, #32]!
	ldr	x8, [x22, #48]
	ldr	w8, [x8, #24]
	str	w8, [x22, #4]
	mov	x0, x19
	mov	x1, x22
	mov	w2, #0
	bl	_sdhci_init_slot
	ldr	x8, [x22, #48]
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_39
; %bb.30:
Lloh72:
	adrp	x8, _BCM_DMA_CH_ANY@GOTPAGE
Lloh73:
	ldr	x8, [x8, _BCM_DMA_CH_ANY@GOTPAGEOFF]
Lloh74:
	ldr	w0, [x8]
	bl	_bcm_dma_allocate
	str	x0, [x20]
Lloh75:
	adrp	x8, _BCM_DMA_CH_INVALID@GOTPAGE
Lloh76:
	ldr	x8, [x8, _BCM_DMA_CH_INVALID@GOTPAGEOFF]
Lloh77:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_20
; %bb.31:
Lloh78:
	adrp	x8, _bcm_sdhci_dma_intr@GOTPAGE
Lloh79:
	ldr	x8, [x8, _bcm_sdhci_dma_intr@GOTPAGEOFF]
Lloh80:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_bcm_dma_setup_intr
	cbz	x0, LBB0_34
; %bb.32:
Lloh81:
	adrp	x1, l_.str.6@PAGE
Lloh82:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_19
LBB0_33:
	ldr	w8, [sp, #52]
	cbnz	w8, LBB0_11
	b	LBB0_10
LBB0_34:
	mov	x0, x19
	bl	_bus_get_dma_tag
Lloh83:
	adrp	x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGE
Lloh84:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGEOFF]
Lloh85:
	adrp	x9, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh86:
	ldr	x9, [x9, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
Lloh87:
	ldr	w3, [x8]
Lloh88:
	ldr	w4, [x9]
Lloh89:
	adrp	x8, _BCM_SDHCI_BUFFER_SIZE@GOTPAGE
Lloh90:
	ldr	x8, [x8, _BCM_SDHCI_BUFFER_SIZE@GOTPAGEOFF]
Lloh91:
	adrp	x9, _NUM_DMA_SEGS@GOTPAGE
Lloh92:
	ldr	x9, [x9, _NUM_DMA_SEGS@GOTPAGEOFF]
Lloh93:
	ldr	w7, [x8]
Lloh94:
	ldr	w8, [x9]
Lloh95:
	adrp	x9, _BUS_DMA_ALLOCNOW@GOTPAGE
Lloh96:
	ldr	x9, [x9, _BUS_DMA_ALLOCNOW@GOTPAGEOFF]
Lloh97:
	ldr	w9, [x9]
	add	x10, x20, #76
	stp	xzr, xzr, [sp, #16]
	str	x10, [sp, #32]
	stp	w7, w9, [sp, #4]
	str	w8, [sp]
	mov	w1, #1
	mov	w2, #0
	mov	x5, #0
	mov	x6, #0
	bl	_bus_dma_tag_create
	cbz	w0, LBB0_36
; %bb.35:
	mov	x21, x0
Lloh98:
	adrp	x1, l_.str.7@PAGE
Lloh99:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_38
LBB0_36:
	ldr	w0, [x20, #76]
	add	x2, x20, #72
	mov	w1, #0
	bl	_bus_dmamap_create
	cbz	w0, LBB0_39
; %bb.37:
	mov	x21, x0
Lloh100:
	adrp	x1, l_.str.8@PAGE
Lloh101:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_38:
	mov	x0, x19
	bl	_device_printf
	b	LBB0_20
LBB0_39:
	ldr	x0, [x20, #8]
	bl	_rman_get_start
Lloh102:
	adrp	x8, _SDHCI_BUFFER@GOTPAGE
Lloh103:
	ldr	x8, [x8, _SDHCI_BUFFER@GOTPAGEOFF]
Lloh104:
	ldr	x8, [x8]
	add	x8, x8, x0
	str	x8, [x20, #64]
	mov	x0, x19
	bl	_bus_generic_probe
	mov	x0, x19
	bl	_bus_generic_attach
	mov	x0, x22
	bl	_sdhci_start_slot
Lloh105:
	adrp	x8, _SDHCI_BLOCK_SIZE@GOTPAGE
Lloh106:
	ldr	x8, [x8, _SDHCI_BLOCK_SIZE@GOTPAGEOFF]
Lloh107:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_SDHCI_READ_4
	str	x0, [x20, #56]
Lloh108:
	adrp	x8, _SDHCI_TRANSFER_MODE@GOTPAGE
Lloh109:
	ldr	x8, [x8, _SDHCI_TRANSFER_MODE@GOTPAGEOFF]
Lloh110:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_SDHCI_READ_4
	mov	w21, #0
	str	x0, [x20, #48]
	b	LBB0_26
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh61
	.loh AdrpLdrGotLdr	Lloh75, Lloh76, Lloh77
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh95, Lloh96, Lloh97
	.loh AdrpLdrGotLdr	Lloh91, Lloh92, Lloh94
	.loh AdrpLdrGotLdr	Lloh89, Lloh90, Lloh93
	.loh AdrpLdrGotLdr	Lloh85, Lloh86, Lloh88
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh87
	.loh AdrpAdd	Lloh98, Lloh99
	.loh AdrpAdd	Lloh100, Lloh101
	.loh AdrpLdrGotLdr	Lloh108, Lloh109, Lloh110
	.loh AdrpLdrGotLdr	Lloh105, Lloh106, Lloh107
	.loh AdrpLdrGotLdr	Lloh102, Lloh103, Lloh104
	.cfi_endproc
                                        ; -- End function
	.comm	_compat_data,4,2                ; @compat_data
	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_BCM2835_MBOX_POWER_ID_EMMC,4,2 ; @BCM2835_MBOX_POWER_ID_EMMC
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_bootverbose,8,3                ; @bootverbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to enable the power\n"

l_.str.1:                               ; @.str.1
	.asciz	"clock-frequency"

l_.str.2:                               ; @.str.2
	.asciz	"SDHCI frequency: %dMHz\n"

	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
l_.str.3:                               ; @.str.3
	.asciz	"cannot allocate memory window\n"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_RF_SHAREABLE,4,2               ; @RF_SHAREABLE
l_.str.4:                               ; @.str.4
	.asciz	"cannot allocate interrupt\n"

	.comm	_INTR_TYPE_BIO,4,2              ; @INTR_TYPE_BIO
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_bcm_sdhci_intr,4,2             ; @bcm_sdhci_intr
l_.str.5:                               ; @.str.5
	.asciz	"cannot setup interrupt handler\n"

	.comm	_bcm2835_sdhci_pio_mode,4,2     ; @bcm2835_sdhci_pio_mode
	.comm	_SDHCI_PLATFORM_TRANSFER,4,2    ; @SDHCI_PLATFORM_TRANSFER
	.comm	_SDHCI_CAN_VDD_330,4,2          ; @SDHCI_CAN_VDD_330
	.comm	_SDHCI_CAN_VDD_180,4,2          ; @SDHCI_CAN_VDD_180
	.comm	_bcm2835_sdhci_hs,8,3           ; @bcm2835_sdhci_hs
	.comm	_SDHCI_CAN_DO_HISPD,4,2         ; @SDHCI_CAN_DO_HISPD
	.comm	_SDHCI_CLOCK_BASE_SHIFT,4,2     ; @SDHCI_CLOCK_BASE_SHIFT
	.comm	_BCM_DMA_CH_ANY,4,2             ; @BCM_DMA_CH_ANY
	.comm	_BCM_DMA_CH_INVALID,8,3         ; @BCM_DMA_CH_INVALID
	.comm	_bcm_sdhci_dma_intr,4,2         ; @bcm_sdhci_dma_intr
l_.str.6:                               ; @.str.6
	.asciz	"cannot setup dma interrupt handler\n"

	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ; @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
	.comm	_BCM_SDHCI_BUFFER_SIZE,4,2      ; @BCM_SDHCI_BUFFER_SIZE
	.comm	_NUM_DMA_SEGS,4,2               ; @NUM_DMA_SEGS
	.comm	_BUS_DMA_ALLOCNOW,4,2           ; @BUS_DMA_ALLOCNOW
l_.str.7:                               ; @.str.7
	.asciz	"failed allocate DMA tag"

l_.str.8:                               ; @.str.8
	.asciz	"bus_dmamap_create failed\n"

	.comm	_SDHCI_BUFFER,8,3               ; @SDHCI_BUFFER
	.comm	_SDHCI_BLOCK_SIZE,4,2           ; @SDHCI_BLOCK_SIZE
	.comm	_SDHCI_TRANSFER_MODE,4,2        ; @SDHCI_TRANSFER_MODE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_bcm_sdhci_attach
.subsections_via_symbols
