	.file	"extr_if_gx.c_gx_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"unable to allocate IRQ.\n"
.LC1:
	.string	"unable to setup interrupt.\n"
.LC2:
	.string	"rx"
.LC3:
	.string	"cannot allocate ifnet.\n"
.LC4:
	.string	"GXemul Ethernet"
	.text
	.p2align 4
	.type	gx_attach, @function
gx_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 48
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	lea	r13, 16[rsp]
	call	device_get_softc@PLT
	mov	edi, ebp
	mov	DWORD PTR 36[rax], ebp
	mov	rbx, rax
	call	device_get_unit@PLT
	mov	edi, DWORD PTR GXEMUL_ETHER_DEV_MAC[rip]
	mov	rsi, r13
	mov	DWORD PTR 40[rbx], eax
	call	GXEMUL_ETHER_DEV_WRITE@PLT
	mov	rax, QWORD PTR GXEMUL_ETHER_DEV_IRQ[rip]
	lea	rdx, 12[rsp]
	mov	edi, DWORD PTR 36[rbx]
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	DWORD PTR 20[rsp], 0
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	mov	r9d, 1
	lea	rcx, -2[rax]
	mov	eax, DWORD PTR RF_ACTIVE[rip]
	mov	r8, rcx
	push	rax
	.cfi_def_cfa_offset 112
	call	bus_alloc_resource@PLT
	mov	QWORD PTR 24[rbx], rax
	pop	rsi
	.cfi_def_cfa_offset 104
	pop	rdi
	.cfi_def_cfa_offset 96
	test	rax, rax
	je	.L9
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	rsi, rax
	lea	rax, 32[rbx]
	mov	edi, DWORD PTR 36[rbx]
	push	rax
	.cfi_def_cfa_offset 112
	mov	edx, DWORD PTR INTR_TYPE_NET[rip]
	xor	ecx, ecx
	mov	r9, rbx
	mov	r8d, DWORD PTR gx_rx_intr[rip]
	call	bus_setup_intr@PLT
	pop	rdx
	.cfi_def_cfa_offset 104
	pop	rcx
	.cfi_def_cfa_offset 96
	test	eax, eax
	jne	.L10
	mov	edx, DWORD PTR 32[rbx]
	mov	rsi, QWORD PTR 24[rbx]
	lea	rcx, .LC2[rip]
	mov	edi, DWORD PTR 36[rbx]
	call	bus_describe_intr@PLT
	mov	edi, DWORD PTR IFT_ETHER[rip]
	call	if_alloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L11
	mov	edi, ebp
	call	device_get_unit@PLT
	mov	edi, ebp
	mov	r14d, eax
	call	device_get_name@PLT
	mov	edx, r14d
	mov	rdi, r12
	lea	r14, 8[rbx]
	mov	esi, eax
	call	if_initname@PLT
	mov	eax, DWORD PTR ETHERMTU[rip]
	xor	esi, esi
	mov	rdi, r14
	mov	edx, DWORD PTR gx_ioctl[rip]
	mov	QWORD PTR 16[r12], rbx
	mov	DWORD PTR 28[r12], eax
	mov	eax, DWORD PTR gx_init[rip]
	mov	DWORD PTR 8[r12], edx
	mov	ecx, DWORD PTR gx_medstat[rip]
	mov	DWORD PTR 24[r12], eax
	mov	eax, DWORD PTR IFF_BROADCAST[rip]
	or	eax, DWORD PTR IFF_SIMPLEX[rip]
	or	eax, DWORD PTR IFF_MULTICAST[rip]
	or	eax, DWORD PTR IFF_ALLMULTI[rip]
	mov	edx, DWORD PTR gx_medchange[rip]
	mov	DWORD PTR [r12], eax
	mov	QWORD PTR 16[rbx], r12
	mov	DWORD PTR [rbx], eax
	call	ifmedia_init@PLT
	xor	ecx, ecx
	xor	edx, edx
	mov	esi, DWORD PTR IFM_ETHER[rip]
	mov	rdi, r14
	or	esi, DWORD PTR IFM_AUTO[rip]
	call	ifmedia_add@PLT
	mov	esi, DWORD PTR IFM_ETHER[rip]
	mov	rdi, r14
	or	esi, DWORD PTR IFM_AUTO[rip]
	call	ifmedia_set@PLT
	mov	ecx, DWORD PTR MTX_DEF[rip]
	lea	rdi, 4[rbx]
	xor	edx, edx
	lea	rsi, .LC4[rip]
	call	mtx_init@PLT
	mov	rdi, r12
	mov	rsi, r13
	call	ether_ifattach@PLT
	mov	eax, DWORD PTR gx_transmit[rip]
	mov	edi, ebp
	mov	DWORD PTR 4[r12], eax
	call	bus_generic_attach@PLT
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L12
	add	rsp, 48
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	rcx, QWORD PTR 24[rbx]
	xor	edx, edx
	mov	edi, ebp
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	call	bus_release_resource@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	lea	rsi, .LC3[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	rcx, QWORD PTR 24[rbx]
	xor	edx, edx
	mov	edi, ebp
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	call	bus_release_resource@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	gx_attach, .-gx_attach
	.comm	gx_transmit,4,4
	.comm	gx_rx_intr,4,4
	.comm	gx_medstat,4,4
	.comm	gx_medchange,4,4
	.comm	gx_ioctl,4,4
	.comm	gx_init,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RF_ACTIVE,4,4
	.comm	MTX_DEF,4,4
	.comm	INTR_TYPE_NET,4,4
	.comm	IFT_ETHER,4,4
	.comm	IFM_ETHER,4,4
	.comm	IFM_AUTO,4,4
	.comm	IFF_SIMPLEX,4,4
	.comm	IFF_MULTICAST,4,4
	.comm	IFF_BROADCAST,4,4
	.comm	IFF_ALLMULTI,4,4
	.comm	GXEMUL_ETHER_DEV_MAC,4,4
	.comm	GXEMUL_ETHER_DEV_IRQ,8,8
	.comm	ETHERMTU,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_if_gx.c_gx_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"unable to allocate IRQ.\012\000"
	.align	2
.LC1:
	.ascii	"unable to setup interrupt.\012\000"
	.align	2
.LC2:
	.ascii	"rx\000"
	.align	2
.LC3:
	.ascii	"cannot allocate ifnet.\012\000"
	.align	2
.LC4:
	.ascii	"GXemul Ethernet\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gx_attach, %function
gx_attach:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L13
	sub	sp, sp, #48
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	mov	r5, r0
	bl	device_get_softc
	mov	r4, r0
	mov	r0, r5
	str	r5, [r4, #24]
	bl	device_get_unit
	ldr	r3, .L13+4
	str	r0, [r4, #28]
	add	r1, sp, #20
	ldr	r0, [r3]
	bl	GXEMUL_ETHER_DEV_WRITE
	mov	r2, #1
	mov	r6, #0
	ldr	r3, .L13+8
	ldr	r1, .L13+12
	ldr	r3, [r3]
	ldr	r1, [r1]
	sub	r3, r3, #2
	ldr	r8, .L13+16
	ldr	r0, [r4, #24]
	str	r2, [sp, #4]
	str	r3, [sp]
	str	r1, [sp, #8]
	ldr	r1, [r8]
	add	r2, sp, #16
	str	r6, [sp, #16]
	bl	bus_alloc_resource
	cmp	r0, r6
	str	r0, [r4, #16]
	beq	.L9
	ldr	r3, .L13+20
	ldr	r2, .L13+24
	ldr	ip, [r3]
	mov	r1, r0
	add	r3, r4, #20
	ldr	r0, [r4, #24]
	str	ip, [sp]
	str	r4, [sp, #4]
	ldr	r2, [r2]
	str	r3, [sp, #8]
	mov	r3, r6
	bl	bus_setup_intr
	subs	r7, r0, #0
	bne	.L10
	ldr	r3, .L13+28
	ldr	r2, [r4, #20]
	ldr	r1, [r4, #16]
	ldr	r0, [r4, #24]
	bl	bus_describe_intr
	ldr	r3, .L13+32
	ldr	r0, [r3]
	bl	if_alloc
	subs	r6, r0, #0
	beq	.L11
	mov	r0, r5
	bl	device_get_name
	mov	r9, r0
	mov	r0, r5
	bl	device_get_unit
	mov	r8, r4
	mov	r2, r0
	mov	r1, r9
	mov	r0, r6
	bl	if_initname
	ldr	r2, .L13+36
	ldr	r3, .L13+40
	ldr	r1, .L13+44
	ldr	r9, [r2]
	ldr	r3, [r3]
	ldr	r2, .L13+48
	ldr	lr, [r1]
	ldr	ip, .L13+52
	ldr	r0, .L13+56
	ldr	r1, .L13+60
	ldr	r2, [r2]
	orr	r3, r3, r9
	orr	r3, r3, lr
	ldr	lr, [ip]
	ldr	ip, [r0]
	ldr	r0, [r1]
	orr	r3, r3, r2
	ldr	r1, .L13+64
	ldr	r2, .L13+68
	str	lr, [r6, #20]
	str	ip, [r6, #16]
	str	r3, [r6]
	str	r0, [r6, #8]
	str	r4, [r6, #12]
	ldr	r10, .L13+72
	ldr	r9, .L13+76
	str	r6, [r4, #12]
	str	r3, [r8], #8
	ldr	r2, [r2]
	ldr	r3, [r1]
	mov	r0, r8
	mov	r1, r7
	bl	ifmedia_init
	ldr	r3, [r9]
	ldr	r1, [r10]
	mov	r2, r7
	orr	r1, r1, r3
	mov	r0, r8
	mov	r3, r7
	bl	ifmedia_add
	ldr	r3, [r9]
	ldr	r1, [r10]
	mov	r0, r8
	orr	r1, r1, r3
	bl	ifmedia_set
	ldr	r3, .L13+80
	mov	r2, r7
	ldr	r3, [r3]
	ldr	r1, .L13+84
	add	r0, r4, #4
	bl	mtx_init
	mov	r0, r6
	add	r1, sp, #20
	bl	ether_ifattach
	ldr	r3, .L13+88
	mov	r0, r5
	ldr	r3, [r3]
	str	r3, [r6, #4]
	bl	bus_generic_attach
.L1:
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	add	sp, sp, #48
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L10:
	ldr	r1, .L13+92
	mov	r0, r5
	bl	device_printf
	ldr	r3, [r4, #16]
	mov	r2, r6
	mov	r0, r5
	ldr	r1, [r8]
	bl	bus_release_resource
	ldr	r3, .L13+96
	ldr	r0, [r3]
	b	.L1
.L11:
	ldr	r1, .L13+100
	mov	r0, r5
	bl	device_printf
	ldr	r3, [r4, #16]
	mov	r2, r6
	mov	r0, r5
	ldr	r1, [r8]
	bl	bus_release_resource
	ldr	r3, .L13+104
	ldr	r0, [r3]
	b	.L1
.L9:
	mov	r0, r5
	ldr	r1, .L13+108
	bl	device_printf
	ldr	r3, .L13+96
	ldr	r0, [r3]
	b	.L1
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC5
	.word	GXEMUL_ETHER_DEV_MAC
	.word	GXEMUL_ETHER_DEV_IRQ
	.word	RF_ACTIVE
	.word	SYS_RES_IRQ
	.word	gx_rx_intr
	.word	INTR_TYPE_NET
	.word	.LC2
	.word	IFT_ETHER
	.word	IFF_SIMPLEX
	.word	IFF_BROADCAST
	.word	IFF_MULTICAST
	.word	IFF_ALLMULTI
	.word	ETHERMTU
	.word	gx_init
	.word	gx_ioctl
	.word	gx_medstat
	.word	gx_medchange
	.word	IFM_ETHER
	.word	IFM_AUTO
	.word	MTX_DEF
	.word	.LC4
	.word	gx_transmit
	.word	.LC1
	.word	ENXIO
	.word	.LC3
	.word	ENOMEM
	.word	.LC0
	.size	gx_attach, .-gx_attach
	.comm	gx_transmit,4,4
	.comm	gx_rx_intr,4,4
	.comm	gx_medstat,4,4
	.comm	gx_medchange,4,4
	.comm	gx_ioctl,4,4
	.comm	gx_init,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RF_ACTIVE,4,4
	.comm	MTX_DEF,4,4
	.comm	INTR_TYPE_NET,4,4
	.comm	IFT_ETHER,4,4
	.comm	IFM_ETHER,4,4
	.comm	IFM_AUTO,4,4
	.comm	IFF_SIMPLEX,4,4
	.comm	IFF_MULTICAST,4,4
	.comm	IFF_BROADCAST,4,4
	.comm	IFF_ALLMULTI,4,4
	.comm	GXEMUL_ETHER_DEV_MAC,4,4
	.comm	GXEMUL_ETHER_DEV_IRQ,4,4
	.comm	ETHERMTU,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
