	.file	"extr_zy7_gpio.c_zy7_gpio_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Can't allocate memory for device"
	.text
	.p2align 4
	.type	zy7_gpio_attach, @function
zy7_gpio_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 24
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	device_get_softc@PLT
	mov	DWORD PTR 16[rax], ebp
	mov	rdi, rax
	mov	rbx, rax
	call	ZGPIO_LOCK_INIT@PLT
	mov	ecx, DWORD PTR RF_ACTIVE[rip]
	mov	esi, DWORD PTR SYS_RES_MEMORY[rip]
	mov	edi, ebp
	lea	rdx, 4[rsp]
	mov	DWORD PTR 4[rsp], 0
	call	bus_alloc_resource_any@PLT
	mov	QWORD PTR 8[rbx], rax
	test	rax, rax
	je	.L8
	mov	edi, ebp
	call	gpiobus_attach_bus@PLT
	xor	r8d, r8d
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L9
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, r8d
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	edi, ebp
	call	zy7_gpio_detach@PLT
	mov	r8d, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	mov	edi, ebp
	call	zy7_gpio_detach@PLT
	mov	r8d, DWORD PTR ENOMEM[rip]
	jmp	.L1
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	zy7_gpio_attach, .-zy7_gpio_attach
	.comm	SYS_RES_MEMORY,4,4
	.comm	RF_ACTIVE,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_zy7_gpio.c_zy7_gpio_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Can't allocate memory for device\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	zy7_gpio_attach, %function
zy7_gpio_attach:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L11
	sub	sp, sp, #8
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	mov	r4, r0
	bl	device_get_softc
	mov	r6, #0
	str	r4, [r0, #8]
	mov	r5, r0
	bl	ZGPIO_LOCK_INIT
	ldr	r2, .L11+4
	ldr	r3, .L11+8
	ldr	r1, [r2]
	mov	r0, r4
	mov	r2, sp
	ldr	r3, [r3]
	str	r6, [sp]
	bl	bus_alloc_resource_any
	cmp	r0, r6
	str	r0, [r5, #4]
	beq	.L8
	mov	r0, r4
	bl	gpiobus_attach_bus
	cmp	r0, #0
	str	r0, [r5]
	movne	r0, r6
	beq	.L9
.L1:
	ldr	r3, .L11
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, pc}
.L8:
	ldr	r1, .L11+12
	mov	r0, r4
	bl	device_printf
	mov	r0, r4
	bl	zy7_gpio_detach
	ldr	r3, .L11+16
	ldr	r0, [r3]
	b	.L1
.L9:
	mov	r0, r4
	bl	zy7_gpio_detach
	ldr	r3, .L11+16
	ldr	r0, [r3]
	b	.L1
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	.LC1
	.word	SYS_RES_MEMORY
	.word	RF_ACTIVE
	.word	.LC0
	.word	ENOMEM
	.size	zy7_gpio_attach, .-zy7_gpio_attach
	.comm	SYS_RES_MEMORY,4,4
	.comm	RF_ACTIVE,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
