	.file	"extr_aml8726_mmc.c_aml8726_mmc_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"missing clocks attribute in FDT\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"pinctrl-0"
	.section	.rodata.str1.8
	.align 8
.LC2:
	.string	"missing pinctrl-0 attribute in FDT\n"
	.section	.rodata.str1.1
.LC3:
	.string	"amlogic,function"
	.section	.rodata.str1.8
	.align 8
.LC4:
	.string	"missing amlogic,function attribute in FDT\n"
	.section	.rodata.str1.1
.LC5:
	.string	"sdio-a"
.LC6:
	.string	"sdio-b"
.LC7:
	.string	"sdio-c"
	.section	.rodata.str1.8
	.align 8
.LC8:
	.string	"unknown function attribute %.*s in FDT\n"
	.section	.rodata.str1.1
.LC9:
	.string	"mmc-pwr-en"
	.section	.rodata.str1.8
	.align 8
.LC10:
	.string	"unable to process mmc-pwr-en attribute in FDT\n"
	.align 8
.LC11:
	.string	"could not use gpio to control power\n"
	.section	.rodata.str1.1
.LC12:
	.string	"mmc-voltages"
	.section	.rodata.str1.8
	.align 8
.LC13:
	.string	"missing mmc-voltages attribute in FDT\n"
	.section	.rodata.str1.1
.LC14:
	.string	"1.8"
.LC15:
	.string	"3.3"
	.section	.rodata.str1.8
	.align 8
.LC16:
	.string	"unknown voltage attribute %.*s in FDT\n"
	.align 8
.LC17:
	.string	"unable to process mmc-vselect attribute in FDT\n"
	.align 8
.LC18:
	.string	"could not use gpio to set voltage\n"
	.section	.rodata.str1.1
.LC19:
	.string	"no voltages in FDT\n"
.LC20:
	.string	"only one voltage in FDT\n"
.LC21:
	.string	"too many voltages in FDT\n"
	.section	.rodata.str1.8
	.align 8
.LC22:
	.string	"could not allocate resources for device\n"
	.align 8
.LC23:
	.string	"could not setup interrupt handler\n"
	.section	.rodata.str1.1
.LC24:
	.string	"mmc"
.LC25:
	.string	"could not add mmc\n"
.LC26:
	.string	"could not attach mmc\n"
.LC27:
	.string	"mmc-vselect"
	.text
	.p2align 4
	.type	aml8726_mmc_attach, @function
aml8726_mmc_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 72
	.cfi_def_cfa_offset 128
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 56[rsp], rax
	xor	eax, eax
	call	device_get_softc@PLT
	mov	edi, ebp
	mov	DWORD PTR 132[rax], ebp
	mov	rbx, rax
	call	ofw_bus_get_node@PLT
	mov	edi, eax
	mov	r13d, eax
	call	aml8726_mmc_clk@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L69
	lea	rax, 32[rsp]
	mov	ecx, 24
	lea	rsi, .LC1[rip]
	mov	edi, r13d
	mov	rdx, rax
	mov	QWORD PTR [rsp], rax
	call	OF_getencprop@PLT
	cdqe
	sub	rax, 8
	cmp	rax, 7
	ja	.L4
	mov	rdi, QWORD PTR 32[rsp]
	test	rdi, rdi
	jne	.L5
.L4:
	lea	rsi, .LC2[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
.L1:
	mov	rax, QWORD PTR 56[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L70
	add	rsp, 72
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	call	OF_node_from_xref@PLT
	lea	rdx, 16[rsp]
	lea	rsi, .LC3[rip]
	mov	edi, eax
	call	OF_getprop_alloc@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L71
	mov	rsi, QWORD PTR 16[rsp]
	mov	edx, eax
	lea	rdi, .LC5[rip]
	call	strncmp@PLT
	test	rax, rax
	jne	.L7
	mov	eax, DWORD PTR AML_MMC_MULT_CONFIG_PORT_A[rip]
	mov	DWORD PTR 128[rbx], eax
.L8:
	mov	rdi, QWORD PTR 16[rsp]
	call	OF_prop_free@PLT
	mov	QWORD PTR 112[rbx], 0
	mov	rdx, QWORD PTR [rsp]
	mov	ecx, 24
	lea	rsi, .LC9[rip]
	mov	edi, r13d
	call	OF_getencprop@PLT
	test	eax, eax
	jle	.L11
	cdqe
	sub	rax, 24
	cmp	rax, 7
	jbe	.L12
	mov	rax, QWORD PTR 112[rbx]
.L13:
	test	rax, rax
	je	.L72
	mov	rdi, rbx
	call	aml8726_mmc_power_off@PLT
	test	rax, rax
	jne	.L16
	mov	rsi, QWORD PTR 104[rbx]
	mov	rdi, QWORD PTR 112[rbx]
	mov	edx, DWORD PTR GPIO_PIN_OUTPUT[rip]
	call	GPIO_PIN_SETFLAGS@PLT
	test	rax, rax
	jne	.L16
.L11:
	lea	rdx, 24[rsp]
	lea	rsi, .LC12[rip]
	mov	edi, r13d
	call	OF_getprop_alloc@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L73
	mov	rax, QWORD PTR 8[rbx]
	mov	r15, QWORD PTR 24[rsp]
	mov	QWORD PTR [rax], 0
	je	.L18
	xor	r14d, r14d
	.p2align 4,,10
	.p2align 3
.L26:
	mov	edx, r12d
	mov	rsi, r15
	lea	rdi, .LC14[rip]
	call	strncmp@PLT
	test	rax, rax
	jne	.L19
	mov	rax, QWORD PTR 8[rbx]
	mov	edx, DWORD PTR MMC_OCR_LOW_VOLTAGE[rip]
	mov	DWORD PTR [rax+r14*4], edx
.L20:
	cmp	BYTE PTR [r15], 0
	lea	r9d, 1[r14]
	jne	.L25
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L22:
	test	r12d, r12d
	je	.L24
.L25:
	add	r15, 1
	sub	r12d, 1
	cmp	BYTE PTR [r15], 0
	jne	.L22
	test	r12d, r12d
	je	.L24
.L23:
	add	r15, 1
	add	r14, 1
	sub	r12d, 1
	je	.L24
	cmp	r9d, 1
	jle	.L26
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdi, QWORD PTR 24[rsp]
	mov	DWORD PTR 12[rsp], r9d
	call	OF_prop_free@PLT
	mov	QWORD PTR 88[rbx], 0
	mov	rdx, QWORD PTR [rsp]
	mov	ecx, 24
	lea	rsi, .LC27[rip]
	mov	edi, r13d
	call	OF_getencprop@PLT
	mov	r9d, DWORD PTR 12[rsp]
	test	eax, eax
	jle	.L33
.L42:
	cdqe
	sub	rax, 16
	cmp	rax, 7
	jbe	.L28
	mov	rdi, QWORD PTR 88[rbx]
.L29:
	test	rdi, rdi
	je	.L74
	mov	rsi, QWORD PTR 96[rbx]
	xor	edx, edx
	mov	DWORD PTR [rsp], r9d
	call	GPIO_PIN_SET@PLT
	mov	r9d, DWORD PTR [rsp]
	test	rax, rax
	jne	.L32
	mov	rsi, QWORD PTR 96[rbx]
	mov	rdi, QWORD PTR 88[rbx]
	mov	DWORD PTR [rsp], r9d
	mov	edx, DWORD PTR GPIO_PIN_OUTPUT[rip]
	call	GPIO_PIN_SETFLAGS@PLT
	test	rax, rax
	jne	.L32
	mov	r9d, DWORD PTR [rsp]
	test	r9d, r9d
	je	.L43
.L33:
	cmp	r9d, 1
	jne	.L75
	cmp	QWORD PTR 88[rbx], 0
	jne	.L76
.L34:
	mov	rdx, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR aml8726_mmc_spec[rip]
	mov	edi, ebp
	call	bus_alloc_resources@PLT
	test	rax, rax
	jne	.L77
	mov	rdi, rbx
	call	AML_MMC_LOCK_INIT@PLT
	mov	edi, ebp
	mov	r12d, DWORD PTR AML_MMC_MAX_DMA[rip]
	mov	r15d, DWORD PTR BUS_SPACE_MAXADDR[rip]
	mov	r14d, DWORD PTR BUS_SPACE_MAXADDR_32BIT[rip]
	mov	r13d, DWORD PTR AML_MMC_ALIGN_DMA[rip]
	call	bus_get_dma_tag@PLT
	xor	r9d, r9d
	mov	r8d, r15d
	xor	edx, edx
	mov	edi, eax
	lea	rax, 24[rbx]
	mov	ecx, r14d
	mov	esi, r13d
	push	rax
	.cfi_def_cfa_offset 136
	push	0
	.cfi_def_cfa_offset 144
	push	0
	.cfi_def_cfa_offset 152
	push	0
	.cfi_def_cfa_offset 160
	push	r12
	.cfi_def_cfa_offset 168
	push	1
	.cfi_def_cfa_offset 176
	push	r12
	.cfi_def_cfa_offset 184
	push	0
	.cfi_def_cfa_offset 192
	call	bus_dma_tag_create@PLT
	add	rsp, 64
	.cfi_def_cfa_offset 128
	mov	r12d, eax
	test	eax, eax
	jne	.L36
	mov	rdi, QWORD PTR 24[rbx]
	lea	rdx, 32[rbx]
	xor	esi, esi
	call	bus_dmamap_create@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L36
	mov	rax, QWORD PTR 16[rbx]
	sub	rsp, 8
	.cfi_def_cfa_offset 136
	mov	edx, DWORD PTR INTR_TYPE_MISC[rip]
	xor	ecx, ecx
	mov	r8d, DWORD PTR aml8726_mmc_intr[rip]
	or	edx, DWORD PTR INTR_MPSAFE[rip]
	mov	r9, rbx
	mov	edi, ebp
	mov	esi, DWORD PTR 4[rax]
	lea	rax, 40[rbx]
	push	rax
	.cfi_def_cfa_offset 144
	call	bus_setup_intr@PLT
	mov	r12d, eax
	pop	rax
	.cfi_def_cfa_offset 136
	pop	rdx
	.cfi_def_cfa_offset 128
	test	r12d, r12d
	jne	.L78
	mov	edx, DWORD PTR CALLOUT_RETURNUNLOCKED[rip]
	lea	rsi, 72[rbx]
	lea	rdi, 76[rbx]
	call	callout_init_mtx@PLT
	mov	esi, 200000
	mov	rdi, rbx
	call	aml8726_mmc_div@PLT
	mov	rdi, rbx
	mov	esi, eax
	call	aml8726_mmc_freq@PLT
	mov	esi, 50000000
	mov	rdi, rbx
	mov	QWORD PTR 64[rbx], rax
	call	aml8726_mmc_div@PLT
	mov	rdi, rbx
	mov	esi, eax
	call	aml8726_mmc_freq@PLT
	mov	rdx, QWORD PTR 8[rbx]
	mov	edi, ebp
	lea	rsi, .LC24[rip]
	mov	QWORD PTR 56[rbx], rax
	mov	eax, DWORD PTR [rdx]
	or	eax, DWORD PTR 4[rdx]
	mov	edx, -1
	mov	DWORD PTR 48[rbx], eax
	mov	eax, DWORD PTR MMC_CAP_4_BIT_DATA[rip]
	or	eax, DWORD PTR MMC_CAP_HSPEED[rip]
	mov	DWORD PTR 52[rbx], eax
	call	device_add_child@PLT
	mov	edi, eax
	test	eax, eax
	je	.L79
	call	device_probe_and_attach@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L1
	lea	rsi, .LC26[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
.L36:
	mov	rdx, QWORD PTR 40[rbx]
	test	rdx, rdx
	jne	.L80
.L39:
	mov	rsi, QWORD PTR 32[rbx]
	mov	rdi, QWORD PTR 24[rbx]
	test	rsi, rsi
	jne	.L81
.L40:
	test	rdi, rdi
	jne	.L82
.L41:
	mov	rdi, rbx
	call	AML_MMC_LOCK_DESTROY@PLT
	mov	rdi, rbx
	call	aml8726_mmc_power_off@PLT
	mov	rdx, QWORD PTR 16[rbx]
	mov	esi, DWORD PTR aml8726_mmc_spec[rip]
	mov	edi, ebp
	call	bus_release_resources@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L69:
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L71:
	lea	rsi, .LC4[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L16:
	lea	rsi, .LC11[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	edx, r12d
	mov	rsi, r15
	lea	rdi, .LC15[rip]
	call	strncmp@PLT
	test	rax, rax
	jne	.L21
	mov	rdx, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR MMC_OCR_320_330[rip]
	or	eax, DWORD PTR MMC_OCR_330_340[rip]
	mov	DWORD PTR [rdx+r14*4], eax
	jmp	.L20
.L7:
	mov	rsi, QWORD PTR 16[rsp]
	mov	edx, r12d
	lea	rdi, .LC6[rip]
	call	strncmp@PLT
	test	rax, rax
	jne	.L9
	mov	eax, DWORD PTR AML_MMC_MULT_CONFIG_PORT_B[rip]
	mov	DWORD PTR 128[rbx], eax
	jmp	.L8
.L9:
	mov	rsi, QWORD PTR 16[rsp]
	mov	edx, r12d
	lea	rdi, .LC7[rip]
	call	strncmp@PLT
	test	rax, rax
	jne	.L10
	mov	eax, DWORD PTR AML_MMC_MULT_CONFIG_PORT_C[rip]
	mov	DWORD PTR 128[rbx], eax
	jmp	.L8
.L12:
	mov	rdi, QWORD PTR 32[rsp]
	call	OF_device_from_xref@PLT
	mov	rdx, QWORD PTR 40[rsp]
	mov	QWORD PTR 112[rbx], rax
	mov	QWORD PTR 104[rbx], rdx
	mov	rdx, QWORD PTR 48[rsp]
	mov	QWORD PTR 120[rbx], rdx
	jmp	.L13
.L72:
	lea	rsi, .LC10[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L21:
	mov	edx, r12d
	mov	rcx, r15
	lea	rsi, .LC16[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	rdi, QWORD PTR 24[rsp]
	call	OF_prop_free@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L32:
	lea	rsi, .LC18[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L73:
	lea	rsi, .LC13[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L75:
	cmp	QWORD PTR 88[rbx], 0
	jne	.L34
	lea	rsi, .LC21[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L28:
	mov	rdi, QWORD PTR 32[rsp]
	mov	DWORD PTR [rsp], r9d
	call	OF_device_from_xref@PLT
	mov	DWORD PTR 80[rbx], 1
	mov	r9d, DWORD PTR [rsp]
	mov	QWORD PTR 88[rbx], rax
	mov	rdi, rax
	mov	rax, QWORD PTR 40[rsp]
	mov	QWORD PTR 96[rbx], rax
	jmp	.L29
.L77:
	lea	rsi, .LC22[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L18:
	mov	rdi, r15
	call	OF_prop_free@PLT
	mov	QWORD PTR 88[rbx], 0
	mov	rdx, QWORD PTR [rsp]
	mov	ecx, 24
	lea	rsi, .LC27[rip]
	mov	edi, r13d
	call	OF_getencprop@PLT
	xor	r9d, r9d
	test	eax, eax
	jg	.L42
.L43:
	lea	rsi, .LC19[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L74:
	lea	rsi, .LC17[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L82:
	call	bus_dma_tag_destroy@PLT
	jmp	.L41
.L81:
	call	bus_dmamap_destroy@PLT
	mov	rdi, QWORD PTR 24[rbx]
	jmp	.L40
.L80:
	mov	rax, QWORD PTR 16[rbx]
	mov	edi, ebp
	mov	esi, DWORD PTR 4[rax]
	call	bus_teardown_intr@PLT
	jmp	.L39
.L10:
	mov	rcx, QWORD PTR 16[rsp]
	mov	edx, r12d
	mov	edi, ebp
	xor	eax, eax
	lea	rsi, .LC8[rip]
	call	device_printf@PLT
	mov	rdi, QWORD PTR 16[rsp]
	call	OF_prop_free@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L76:
	lea	rsi, .LC20[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L1
.L79:
	lea	rsi, .LC25[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	jmp	.L36
.L78:
	lea	rsi, .LC23[rip]
	mov	edi, ebp
	xor	eax, eax
	call	device_printf@PLT
	jmp	.L36
.L70:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	aml8726_mmc_attach, .-aml8726_mmc_attach
	.comm	aml8726_mmc_spec,4,4
	.comm	aml8726_mmc_intr,4,4
	.comm	MMC_OCR_LOW_VOLTAGE,4,4
	.comm	MMC_OCR_330_340,4,4
	.comm	MMC_OCR_320_330,4,4
	.comm	MMC_CAP_HSPEED,4,4
	.comm	MMC_CAP_4_BIT_DATA,4,4
	.comm	INTR_TYPE_MISC,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	GPIO_PIN_OUTPUT,4,4
	.comm	ENXIO,4,4
	.comm	CALLOUT_RETURNUNLOCKED,4,4
	.comm	BUS_SPACE_MAXADDR_32BIT,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.comm	AML_MMC_MULT_CONFIG_PORT_C,4,4
	.comm	AML_MMC_MULT_CONFIG_PORT_B,4,4
	.comm	AML_MMC_MULT_CONFIG_PORT_A,4,4
	.comm	AML_MMC_MAX_DMA,4,4
	.comm	AML_MMC_ALIGN_DMA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_aml8726_mmc.c_aml8726_mmc_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"missing clocks attribute in FDT\012\000"
	.align	2
.LC1:
	.ascii	"pinctrl-0\000"
	.align	2
.LC2:
	.ascii	"missing pinctrl-0 attribute in FDT\012\000"
	.align	2
.LC3:
	.ascii	"amlogic,function\000"
	.align	2
.LC4:
	.ascii	"missing amlogic,function attribute in FDT\012\000"
	.align	2
.LC5:
	.ascii	"sdio-a\000"
	.align	2
.LC6:
	.ascii	"sdio-b\000"
	.align	2
.LC7:
	.ascii	"sdio-c\000"
	.align	2
.LC8:
	.ascii	"unknown function attribute %.*s in FDT\012\000"
	.align	2
.LC9:
	.ascii	"mmc-pwr-en\000"
	.align	2
.LC10:
	.ascii	"unable to process mmc-pwr-en attribute in FDT\012\000"
	.align	2
.LC11:
	.ascii	"could not use gpio to control power\012\000"
	.align	2
.LC12:
	.ascii	"mmc-voltages\000"
	.align	2
.LC13:
	.ascii	"missing mmc-voltages attribute in FDT\012\000"
	.align	2
.LC14:
	.ascii	"1.8\000"
	.align	2
.LC15:
	.ascii	"3.3\000"
	.align	2
.LC16:
	.ascii	"unknown voltage attribute %.*s in FDT\012\000"
	.align	2
.LC17:
	.ascii	"unable to process mmc-vselect attribute in FDT\012\000"
	.align	2
.LC18:
	.ascii	"could not use gpio to set voltage\012\000"
	.align	2
.LC19:
	.ascii	"no voltages in FDT\012\000"
	.align	2
.LC20:
	.ascii	"only one voltage in FDT\012\000"
	.align	2
.LC21:
	.ascii	"too many voltages in FDT\012\000"
	.align	2
.LC22:
	.ascii	"could not allocate resources for device\012\000"
	.align	2
.LC23:
	.ascii	"could not setup interrupt handler\012\000"
	.align	2
.LC24:
	.ascii	"mmc\000"
	.align	2
.LC25:
	.ascii	"could not add mmc\012\000"
	.align	2
.LC26:
	.ascii	"could not attach mmc\012\000"
	.align	2
.LC27:
	.ascii	"mmc-vselect\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC28:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	aml8726_mmc_attach, %function
aml8726_mmc_attach:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L84
	sub	sp, sp, #76
	ldr	r3, [r3]
	str	r3, [sp, #68]
	mov	r3,#0
	mov	r6, r0
	bl	device_get_softc
	mov	r5, r0
	mov	r0, r6
	str	r6, [r5, #76]
	bl	ofw_bus_get_node
	mov	r7, r0
	bl	aml8726_mmc_clk
	cmp	r0, #0
	str	r0, [r5]
	beq	.L69
	mov	r3, #12
	mov	r0, r7
	ldr	r1, .L84+4
	add	r2, sp, #56
	bl	OF_getencprop
	sub	r0, r0, #4
	cmp	r0, #3
	bhi	.L4
	ldr	r0, [sp, #56]
	cmp	r0, #0
	bne	.L5
.L4:
	mov	r0, r6
	ldr	r1, .L84+8
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
.L1:
	ldr	r3, .L84
	ldr	r2, [r3]
	ldr	r3, [sp, #68]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L70
	mov	r0, r4
	add	sp, sp, #76
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	bl	OF_node_from_xref
	ldr	r1, .L84+16
	add	r2, sp, #48
	bl	OF_getprop_alloc
	subs	r4, r0, #0
	blt	.L71
	ldr	r8, [sp, #48]
	mov	r2, r4
	mov	r1, r8
	ldr	r0, .L84+20
	bl	strncmp
	cmp	r0, #0
	beq	.L72
	mov	r2, r4
	mov	r1, r8
	ldr	r0, .L84+24
	bl	strncmp
	cmp	r0, #0
	bne	.L9
	ldr	r3, .L84+28
	ldr	r3, [r3]
	str	r3, [r5, #72]
.L8:
	mov	r0, r8
	bl	OF_prop_free
	mov	r2, #0
	mov	r3, #12
	str	r2, [r5, #64]
	mov	r0, r7
	ldr	r1, .L84+32
	add	r2, sp, #56
	bl	OF_getencprop
	cmp	r0, #0
	ble	.L11
	sub	r0, r0, #12
	cmp	r0, #3
	bls	.L12
	ldr	r0, [r5, #64]
.L13:
	cmp	r0, #0
	beq	.L73
	mov	r0, r5
	bl	aml8726_mmc_power_off
	cmp	r0, #0
	bne	.L16
	ldr	r3, .L84+36
	ldr	r1, [r5, #60]
	ldr	r2, [r3]
	ldr	r0, [r5, #64]
	bl	GPIO_PIN_SETFLAGS
	cmp	r0, #0
	bne	.L16
.L11:
	mov	r0, r7
	ldr	r1, .L84+40
	add	r2, sp, #52
	bl	OF_getprop_alloc
	subs	r4, r0, #0
	blt	.L74
	mov	r8, #0
	ldr	r3, [r5, #4]
	ldr	r10, [sp, #52]
	str	r8, [r3, #4]
	str	r10, [sp, #44]
	str	r8, [r3]
	beq	.L18
	mov	r9, r8
	mov	r8, r3
	ldr	fp, .L84+44
.L26:
	mov	r2, r4
	mov	r1, r10
	mov	r0, fp
	bl	strncmp
	cmp	r0, #0
	bne	.L19
	ldr	r3, .L84+48
	ldr	r3, [r3]
	str	r3, [r8, r9, lsl #2]
.L20:
	ldrb	r3, [r10]	@ zero_extendqisi2
	add	r1, r9, #1
	cmp	r3, #0
	addne	r3, r10, #1
	bne	.L25
	b	.L23
.L22:
	cmp	r4, #0
	beq	.L67
.L25:
	mov	r10, r3
	ldrb	r2, [r3], #1	@ zero_extendqisi2
	sub	r4, r4, #1
	cmp	r2, #0
	bne	.L22
	cmp	r4, #0
	beq	.L67
.L23:
	subs	r4, r4, #1
	movne	r3, #1
	moveq	r3, #0
	cmp	r1, #1
	movgt	r3, #0
	andle	r3, r3, #1
	cmp	r3, #0
	mov	r9, #1
	add	r10, r10, #1
	bne	.L26
.L67:
	ldr	r0, [sp, #44]
	mov	r9, r1
	bl	OF_prop_free
	mov	r3, #0
	mov	r0, r7
	str	r3, [r5, #52]
	ldr	r1, .L84+52
	mov	r3, #12
	add	r2, sp, #56
	bl	OF_getencprop
	cmp	r0, #0
	ble	.L32
.L41:
	sub	r0, r0, #8
	cmp	r0, #3
	bls	.L27
	ldr	r0, [r5, #52]
.L28:
	cmp	r0, #0
	beq	.L75
	mov	r2, #0
	ldr	r1, [r5, #56]
	bl	GPIO_PIN_SET
	cmp	r0, #0
	bne	.L31
	ldr	r3, .L84+36
	ldr	r1, [r5, #56]
	ldr	r2, [r3]
	ldr	r0, [r5, #52]
	bl	GPIO_PIN_SETFLAGS
	cmp	r0, #0
	bne	.L31
	cmp	r9, #0
	beq	.L42
.L32:
	cmp	r9, #1
	bne	.L76
	ldr	r3, [r5, #52]
	cmp	r3, #0
	bne	.L77
.L33:
	ldr	r7, .L84+56
	mov	r0, r6
	ldr	r2, [r5, #8]
	ldr	r1, [r7]
	bl	bus_alloc_resources
	subs	r4, r0, #0
	bne	.L78
	mov	r8, #1
	mov	r0, r5
	bl	AML_MMC_LOCK_INIT
	mov	r0, r6
	bl	bus_get_dma_tag
	ldr	r2, .L84+60
	ldr	r3, .L84+64
	ldr	ip, [r2]
	ldr	r3, [r3]
	ldr	lr, .L84+68
	ldr	r1, .L84+72
	str	r4, [sp, #32]
	str	r4, [sp, #28]
	str	r4, [sp, #24]
	str	r4, [sp, #8]
	str	r4, [sp, #4]
	str	ip, [sp]
	str	r3, [sp, #20]
	str	r3, [sp, #12]
	str	r8, [sp, #16]
	add	ip, r5, #12
	mov	r2, r4
	ldr	r3, [lr]
	ldr	r1, [r1]
	str	ip, [sp, #36]
	bl	bus_dma_tag_create
	subs	r4, r0, #0
	bne	.L35
	mov	r1, r4
	ldr	r0, [r5, #12]
	add	r2, r5, #16
	bl	bus_dmamap_create
	subs	r4, r0, #0
	bne	.L35
	ldr	r0, .L84+76
	ldr	r2, .L84+80
	ldr	r3, .L84+84
	ldr	r0, [r0]
	ldr	r2, [r2]
	ldr	r1, [r5, #8]
	ldr	ip, [r3]
	orr	r2, r0, r2
	add	r0, r5, #20
	ldr	r1, [r1, #4]
	mov	r3, r4
	str	r0, [sp, #8]
	str	r5, [sp, #4]
	mov	r0, r6
	str	ip, [sp]
	bl	bus_setup_intr
	subs	r4, r0, #0
	bne	.L79
	ldr	r3, .L84+88
	add	r1, r5, #40
	ldr	r2, [r3]
	add	r0, r5, #44
	bl	callout_init_mtx
	ldr	r1, .L84+92
	mov	r0, r5
	bl	aml8726_mmc_div
	mov	r1, r0
	mov	r0, r5
	bl	aml8726_mmc_freq
	ldr	r1, .L84+96
	str	r0, [r5, #36]
	mov	r0, r5
	bl	aml8726_mmc_div
	mov	r1, r0
	mov	r0, r5
	bl	aml8726_mmc_freq
	ldr	r1, [r5, #4]
	ldr	r2, .L84+100
	ldr	r3, .L84+104
	ldr	ip, [r2]
	ldr	r3, [r3]
	ldr	r2, [r1]
	ldr	r1, [r1, #4]
	orr	r3, r3, ip
	orr	r2, r2, r1
	str	r0, [r5, #32]
	str	r2, [r5, #24]
	mov	r0, r6
	mvn	r2, #0
	ldr	r1, .L84+108
	str	r3, [r5, #28]
	bl	device_add_child
	cmp	r0, #0
	beq	.L80
	bl	device_probe_and_attach
	subs	r4, r0, #0
	beq	.L1
	mov	r0, r6
	ldr	r1, .L84+112
	bl	device_printf
.L35:
	ldr	r2, [r5, #20]
	cmp	r2, #0
	bne	.L81
.L38:
	ldr	r1, [r5, #16]
	ldr	r0, [r5, #12]
	cmp	r1, #0
	bne	.L82
.L39:
	cmp	r0, #0
	bne	.L83
.L40:
	mov	r0, r5
	bl	AML_MMC_LOCK_DESTROY
	mov	r0, r5
	bl	aml8726_mmc_power_off
	mov	r0, r6
	ldr	r2, [r5, #8]
	ldr	r1, [r7]
	bl	bus_release_resources
	b	.L1
.L69:
	mov	r0, r6
	ldr	r1, .L84+116
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L72:
	ldr	r3, .L84+120
	ldr	r3, [r3]
	str	r3, [r5, #72]
	b	.L8
.L19:
	mov	r2, r4
	mov	r1, r10
	ldr	r0, .L84+124
	bl	strncmp
	cmp	r0, #0
	bne	.L21
	ldr	r3, .L84+128
	ldr	r2, .L84+132
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r8, r9, lsl #2]
	b	.L20
.L16:
	mov	r0, r6
	ldr	r1, .L84+136
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L9:
	mov	r2, r4
	mov	r1, r8
	ldr	r0, .L84+140
	bl	strncmp
	cmp	r0, #0
	bne	.L10
	ldr	r3, .L84+144
	ldr	r3, [r3]
	str	r3, [r5, #72]
	b	.L8
.L12:
	ldr	r0, [sp, #56]
	bl	OF_device_from_xref
	ldr	r2, [sp, #60]
	ldr	r3, [sp, #64]
	str	r0, [r5, #64]
	str	r2, [r5, #60]
	str	r3, [r5, #68]
	b	.L13
.L27:
	ldr	r0, [sp, #56]
	bl	OF_device_from_xref
	mov	r2, #1
	ldr	r3, [sp, #60]
	str	r0, [r5, #52]
	str	r2, [r5, #48]
	str	r3, [r5, #56]
	b	.L28
.L10:
	mov	r3, r8
	mov	r2, r4
	ldr	r1, .L84+148
	mov	r0, r6
	bl	device_printf
	ldr	r0, [sp, #48]
	bl	OF_prop_free
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L71:
	mov	r0, r6
	ldr	r1, .L84+152
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L21:
	mov	r3, r10
	mov	r2, r4
	ldr	r1, .L84+156
	mov	r0, r6
	bl	device_printf
	ldr	r0, [sp, #52]
	bl	OF_prop_free
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L73:
	mov	r0, r6
	ldr	r1, .L84+160
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L74:
	mov	r0, r6
	ldr	r1, .L84+164
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L31:
	mov	r0, r6
	ldr	r1, .L84+168
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L76:
	ldr	r3, [r5, #52]
	cmp	r3, #0
	bne	.L33
	mov	r0, r6
	ldr	r1, .L84+172
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L78:
	mov	r0, r6
	ldr	r1, .L84+176
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L18:
	ldr	r0, [sp, #44]
	bl	OF_prop_free
	mov	r0, r7
	mov	r3, #12
	ldr	r1, .L84+52
	str	r4, [r5, #52]
	add	r2, sp, #56
	bl	OF_getencprop
	cmp	r0, #0
	movgt	r9, r4
	bgt	.L41
.L42:
	mov	r0, r6
	ldr	r1, .L84+180
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L75:
	mov	r0, r6
	ldr	r1, .L84+184
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L83:
	bl	bus_dma_tag_destroy
	b	.L40
.L82:
	bl	bus_dmamap_destroy
	ldr	r0, [r5, #12]
	b	.L39
.L81:
	ldr	r3, [r5, #8]
	mov	r0, r6
	ldr	r1, [r3, #4]
	bl	bus_teardown_intr
	b	.L38
.L77:
	mov	r0, r6
	ldr	r1, .L84+188
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L1
.L80:
	mov	r0, r6
	ldr	r1, .L84+192
	bl	device_printf
	ldr	r3, .L84+12
	ldr	r4, [r3]
	b	.L35
.L79:
	mov	r0, r6
	ldr	r1, .L84+196
	bl	device_printf
	b	.L35
.L70:
	bl	__stack_chk_fail
.L85:
	.align	2
.L84:
	.word	.LC28
	.word	.LC1
	.word	.LC2
	.word	ENXIO
	.word	.LC3
	.word	.LC5
	.word	.LC6
	.word	AML_MMC_MULT_CONFIG_PORT_B
	.word	.LC9
	.word	GPIO_PIN_OUTPUT
	.word	.LC12
	.word	.LC14
	.word	MMC_OCR_LOW_VOLTAGE
	.word	.LC27
	.word	aml8726_mmc_spec
	.word	BUS_SPACE_MAXADDR
	.word	AML_MMC_MAX_DMA
	.word	BUS_SPACE_MAXADDR_32BIT
	.word	AML_MMC_ALIGN_DMA
	.word	INTR_TYPE_MISC
	.word	INTR_MPSAFE
	.word	aml8726_mmc_intr
	.word	CALLOUT_RETURNUNLOCKED
	.word	200000
	.word	50000000
	.word	MMC_CAP_HSPEED
	.word	MMC_CAP_4_BIT_DATA
	.word	.LC24
	.word	.LC26
	.word	.LC0
	.word	AML_MMC_MULT_CONFIG_PORT_A
	.word	.LC15
	.word	MMC_OCR_320_330
	.word	MMC_OCR_330_340
	.word	.LC11
	.word	.LC7
	.word	AML_MMC_MULT_CONFIG_PORT_C
	.word	.LC8
	.word	.LC4
	.word	.LC16
	.word	.LC10
	.word	.LC13
	.word	.LC18
	.word	.LC21
	.word	.LC22
	.word	.LC19
	.word	.LC17
	.word	.LC20
	.word	.LC25
	.word	.LC23
	.size	aml8726_mmc_attach, .-aml8726_mmc_attach
	.comm	aml8726_mmc_spec,4,4
	.comm	aml8726_mmc_intr,4,4
	.comm	MMC_OCR_LOW_VOLTAGE,4,4
	.comm	MMC_OCR_330_340,4,4
	.comm	MMC_OCR_320_330,4,4
	.comm	MMC_CAP_HSPEED,4,4
	.comm	MMC_CAP_4_BIT_DATA,4,4
	.comm	INTR_TYPE_MISC,4,4
	.comm	INTR_MPSAFE,4,4
	.comm	GPIO_PIN_OUTPUT,4,4
	.comm	ENXIO,4,4
	.comm	CALLOUT_RETURNUNLOCKED,4,4
	.comm	BUS_SPACE_MAXADDR_32BIT,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.comm	AML_MMC_MULT_CONFIG_PORT_C,4,4
	.comm	AML_MMC_MULT_CONFIG_PORT_B,4,4
	.comm	AML_MMC_MULT_CONFIG_PORT_A,4,4
	.comm	AML_MMC_MAX_DMA,4,4
	.comm	AML_MMC_ALIGN_DMA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
