	.file	"extr_axp209.c_axp2xx_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"can't allocate device resources\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"regulators"
.LC2:
	.string	"cannot attach regulator %s\n"
.LC3:
	.string	"Regulator %s attached\n"
	.text
	.p2align 4
	.type	axp2xx_attach, @function
axp2xx_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, 8
	.cfi_def_cfa_offset 64
	call	device_get_softc@PLT
	mov	r12d, DWORD PTR MTX_DEF[rip]
	mov	edi, ebp
	mov	rbx, rax
	call	device_get_nameunit@PLT
	xor	edx, edx
	lea	rdi, 68[rbx]
	mov	ecx, r12d
	mov	esi, eax
	call	mtx_init@PLT
	mov	edx, DWORD PTR 64[rbx]
	mov	esi, DWORD PTR axp_res_spec[rip]
	mov	edi, ebp
	call	bus_alloc_resources@PLT
	test	rax, rax
	jne	.L18
	mov	esi, DWORD PTR compat_data[rip]
	mov	edi, ebp
	call	ofw_bus_search_compatible@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rbx], eax
	cmp	eax, 128
	je	.L4
	cmp	eax, 129
	je	.L5
	mov	edi, DWORD PTR 4[rbx]
.L6:
	mov	esi, DWORD PTR M_AXP2XX_REG[rip]
	sal	edi, 3
	mov	edx, DWORD PTR M_WAITOK[rip]
	or	edx, DWORD PTR M_ZERO[rip]
	call	malloc@PLT
	mov	DWORD PTR 16[rbx], ebp
	lea	rdi, 16[rbx]
	mov	QWORD PTR 8[rbx], rax
	mov	eax, DWORD PTR axp2xx_start[rip]
	mov	DWORD PTR 20[rbx], eax
	call	config_intrhook_establish@PLT
	test	rax, rax
	je	.L7
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	mov	rdi, QWORD PTR axp209_pins[rip]
	mov	QWORD PTR 56[rbx], rdi
	call	nitems@PLT
	mov	edi, ebp
	mov	QWORD PTR 48[rbx], rax
	call	gpiobus_attach_bus@PLT
	mov	rdi, QWORD PTR axp209_sensors[rip]
	mov	QWORD PTR 40[rbx], rax
	mov	QWORD PTR 32[rbx], rdi
	call	nitems@PLT
	mov	r14, QWORD PTR axp209_regdefs[rip]
	mov	QWORD PTR 24[rbx], rax
	mov	rdi, r14
	call	nitems@PLT
	mov	DWORD PTR 4[rbx], eax
	mov	edi, eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rdi, QWORD PTR axp221_pins[rip]
	mov	QWORD PTR 56[rbx], rdi
	call	nitems@PLT
	mov	edi, ebp
	mov	QWORD PTR 48[rbx], rax
	call	gpiobus_attach_bus@PLT
	mov	rdi, QWORD PTR axp221_sensors[rip]
	mov	QWORD PTR 40[rbx], rax
	mov	QWORD PTR 32[rbx], rdi
	call	nitems@PLT
	mov	r14, QWORD PTR axp221_regdefs[rip]
	mov	QWORD PTR 24[rbx], rax
	mov	rdi, r14
	call	nitems@PLT
	mov	DWORD PTR 4[rbx], eax
	mov	edi, eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edi, ebp
	lea	rsi, .LC0[rip]
	xor	eax, eax
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L7:
	.cfi_restore_state
	mov	edi, ebp
	call	ofw_bus_get_node@PLT
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	ofw_bus_find_child@PLT
	mov	r12, rax
	test	rax, rax
	jle	.L9
	mov	eax, DWORD PTR 4[rbx]
	test	eax, eax
	jle	.L9
	xor	r15d, r15d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	add	r15, 1
	add	r14, 8
	cmp	DWORD PTR 4[rbx], r15d
	jle	.L9
.L14:
	mov	rsi, QWORD PTR [r14]
	mov	rdi, r12
	lea	r13, 0[0+r15*8]
	call	ofw_bus_find_child@PLT
	mov	rsi, rax
	test	rax, rax
	je	.L11
	mov	rdx, r14
	mov	edi, ebp
	call	axp2xx_reg_attach@PLT
	test	rax, rax
	je	.L19
	mov	rdx, QWORD PTR 8[rbx]
	cmp	QWORD PTR bootverbose[rip], 0
	mov	QWORD PTR [rdx+r13], rax
	je	.L11
	mov	rdx, QWORD PTR [r14]
	lea	rsi, .LC3[rip]
	mov	edi, ebp
	xor	eax, eax
	add	r15, 1
	add	r14, 8
	call	device_printf@PLT
	cmp	DWORD PTR 4[rbx], r15d
	jg	.L14
.L9:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L19:
	.cfi_restore_state
	mov	rdx, QWORD PTR [r14]
	lea	rsi, .LC2[rip]
	mov	edi, ebp
	call	device_printf@PLT
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	axp2xx_attach, .-axp2xx_attach
	.comm	compat_data,4,4
	.comm	bootverbose,8,8
	.comm	axp_res_spec,4,4
	.comm	axp2xx_start,4,4
	.comm	axp221_sensors,8,8
	.comm	axp221_regdefs,8,8
	.comm	axp221_pins,8,8
	.comm	axp209_sensors,8,8
	.comm	axp209_regdefs,8,8
	.comm	axp209_pins,8,8
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_AXP2XX_REG,4,4
	.comm	MTX_DEF,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,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_axp209.c_axp2xx_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"can't allocate device resources\012\000"
	.align	2
.LC1:
	.ascii	"regulators\000"
	.align	2
.LC2:
	.ascii	"cannot attach regulator %s\012\000"
	.align	2
.LC3:
	.ascii	"Regulator %s attached\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	axp2xx_attach, %function
axp2xx_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	bl	device_get_softc
	mov	r4, r0
	mov	r0, r5
	bl	device_get_nameunit
	ldr	r3, .L24
	mov	r1, r0
	mov	r2, #0
	ldr	r3, [r3]
	add	r0, r4, #44
	bl	mtx_init
	ldr	r3, .L24+4
	mov	r0, r5
	ldr	r2, [r4, #40]
	ldr	r1, [r3]
	bl	bus_alloc_resources
	cmp	r0, #0
	bne	.L22
	ldr	r3, .L24+8
	mov	r0, r5
	ldr	r1, [r3]
	bl	ofw_bus_search_compatible
	ldr	r3, [r0]
	cmp	r3, #128
	str	r3, [r4]
	beq	.L4
	cmp	r3, #129
	beq	.L5
	ldr	r0, [r4, #4]
.L6:
	ldr	r2, .L24+12
	ldr	r3, .L24+16
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L24+20
	orr	r2, r1, r2
	lsl	r0, r0, #2
	ldr	r1, [r3]
	bl	malloc
	mov	r3, r4
	ldr	r2, .L24+24
	str	r0, [r4, #8]
	ldr	r2, [r2]
	str	r2, [r4, #16]
	str	r5, [r3, #12]!
	mov	r0, r3
	bl	config_intrhook_establish
	subs	r8, r0, #0
	beq	.L7
	ldr	r3, .L24+28
	ldr	r8, [r3]
.L1:
	mov	r0, r8
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	ldr	r3, .L24+32
	ldr	r0, [r3]
	str	r0, [r4, #36]
	bl	nitems
	mov	r3, r0
	mov	r0, r5
	str	r3, [r4, #32]
	bl	gpiobus_attach_bus
	ldr	r3, .L24+36
	str	r0, [r4, #28]
	ldr	r0, [r3]
	str	r0, [r4, #24]
	bl	nitems
	ldr	r3, .L24+40
.L20:
	str	r0, [r4, #20]
	ldr	r7, [r3]
	mov	r0, r7
	bl	nitems
	str	r0, [r4, #4]
	b	.L6
.L4:
	ldr	r3, .L24+44
	ldr	r0, [r3]
	str	r0, [r4, #36]
	bl	nitems
	mov	r3, r0
	mov	r0, r5
	str	r3, [r4, #32]
	bl	gpiobus_attach_bus
	ldr	r3, .L24+48
	str	r0, [r4, #28]
	ldr	r0, [r3]
	str	r0, [r4, #24]
	bl	nitems
	ldr	r3, .L24+52
	b	.L20
.L22:
	mov	r0, r5
	ldr	r1, .L24+56
	bl	device_printf
	ldr	r3, .L24+60
	ldr	r8, [r3]
	mov	r0, r8
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	mov	r0, r5
	bl	ofw_bus_get_node
	ldr	r1, .L24+64
	bl	ofw_bus_find_child
	subs	r9, r0, #0
	ble	.L1
	ldr	r3, [r4, #4]
	cmp	r3, #0
	ble	.L1
	mov	r6, r8
	b	.L14
.L11:
	ldr	r3, [r4, #4]
	add	r6, r6, #1
	cmp	r3, r6
	ble	.L1
.L14:
	ldr	r1, [r7]
	mov	r0, r9
	bl	ofw_bus_find_child
	subs	r1, r0, #0
	mov	r10, r7
	lsl	fp, r6, #2
	add	r7, r7, #4
	beq	.L11
	mov	r2, r10
	mov	r0, r5
	bl	axp2xx_reg_attach
	cmp	r0, #0
	beq	.L23
	ldr	r3, .L24+68
	ldr	r2, [r3]
	ldr	r3, [r4, #8]
	cmp	r2, #0
	str	r0, [r3, fp]
	beq	.L11
	mov	r0, r5
	ldr	r2, [r7, #-4]
	ldr	r1, .L24+72
	bl	device_printf
	b	.L11
.L23:
	mov	r0, r5
	ldr	r2, [r7, #-4]
	ldr	r1, .L24+76
	bl	device_printf
	b	.L11
.L25:
	.align	2
.L24:
	.word	MTX_DEF
	.word	axp_res_spec
	.word	compat_data
	.word	M_WAITOK
	.word	M_ZERO
	.word	M_AXP2XX_REG
	.word	axp2xx_start
	.word	ENOMEM
	.word	axp209_pins
	.word	axp209_sensors
	.word	axp209_regdefs
	.word	axp221_pins
	.word	axp221_sensors
	.word	axp221_regdefs
	.word	.LC0
	.word	ENXIO
	.word	.LC1
	.word	bootverbose
	.word	.LC3
	.word	.LC2
	.size	axp2xx_attach, .-axp2xx_attach
	.comm	compat_data,4,4
	.comm	bootverbose,4,4
	.comm	axp_res_spec,4,4
	.comm	axp2xx_start,4,4
	.comm	axp221_sensors,4,4
	.comm	axp221_regdefs,4,4
	.comm	axp221_pins,4,4
	.comm	axp209_sensors,4,4
	.comm	axp209_regdefs,4,4
	.comm	axp209_pins,4,4
	.comm	M_ZERO,4,4
	.comm	M_WAITOK,4,4
	.comm	M_AXP2XX_REG,4,4
	.comm	MTX_DEF,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
