	.file	"extr_if_octm.c_octm_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"unsupported management port %u.\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"unable to allocate IRQ.\n"
.LC2:
	.string	"unable to setup interrupt.\n"
.LC3:
	.string	"rx"
.LC4:
	.string	"cannot allocate ifnet.\n"
	.text
	.p2align 4
	.type	octm_attach, @function
octm_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
	mov	r12d, edi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	device_get_softc@PLT
	mov	edi, r12d
	mov	DWORD PTR 36[rax], r12d
	mov	rbp, rax
	call	device_get_unit@PLT
	mov	DWORD PTR 0[rbp], eax
	test	eax, eax
	je	.L2
	cmp	eax, 1
	je	.L3
	mov	edx, eax
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
.L1:
	mov	rcx, QWORD PTR 24[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L14
	add	rsp, 32
	.cfi_remember_state
	.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
.L2:
	.cfi_restore_state
	mov	r13d, DWORD PTR OCTEON_IRQ_MII[rip]
.L5:
	mov	QWORD PTR 16[rsp], 0
	xor	eax, eax
	lea	r14, 24[rsp]
	call	cvmx_sysinfo_get@PLT
	mov	edx, 6
	mov	rdi, r14
	mov	esi, DWORD PTR [rax]
	call	memcpy@PLT
	movsx	rsi, DWORD PTR 0[rbp]
	mov	rdi, rsi
	add	rsi, QWORD PTR 16[rsp]
	mov	QWORD PTR 16[rsp], rsi
	call	cvmx_mgmt_port_set_mac@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	CVMX_MIXX_IRHWM@PLT
	xor	esi, esi
	mov	edi, eax
	call	cvmx_write_csr@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	CVMX_MIXX_INTENA@PLT
	xor	esi, esi
	mov	edi, eax
	call	cvmx_write_csr@PLT
	lea	rdx, 12[rsp]
	mov	edi, DWORD PTR 36[rbp]
	mov	r8d, r13d
	mov	eax, DWORD PTR RF_ACTIVE[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	mov	ecx, r13d
	mov	DWORD PTR 20[rsp], 0
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	mov	r9d, 1
	push	rax
	.cfi_def_cfa_offset 96
	call	bus_alloc_resource@PLT
	mov	QWORD PTR 24[rbp], rax
	mov	rsi, rax
	pop	rdi
	.cfi_def_cfa_offset 88
	pop	r8
	.cfi_def_cfa_offset 80
	test	rax, rax
	je	.L15
	sub	rsp, 8
	.cfi_def_cfa_offset 88
	lea	rax, 32[rbp]
	mov	edi, DWORD PTR 36[rbp]
	xor	ecx, ecx
	push	rax
	.cfi_def_cfa_offset 96
	mov	edx, DWORD PTR INTR_TYPE_NET[rip]
	mov	r9, rbp
	mov	r8d, DWORD PTR octm_rx_intr[rip]
	call	bus_setup_intr@PLT
	pop	rdx
	.cfi_def_cfa_offset 88
	pop	rcx
	.cfi_def_cfa_offset 80
	test	eax, eax
	jne	.L16
	mov	edx, DWORD PTR 32[rbp]
	mov	rsi, QWORD PTR 24[rbp]
	lea	rcx, .LC3[rip]
	mov	edi, DWORD PTR 36[rbp]
	call	bus_describe_intr@PLT
	mov	edi, DWORD PTR IFT_ETHER[rip]
	call	if_alloc@PLT
	mov	r13, rax
	test	rax, rax
	je	.L17
	mov	edi, r12d
	call	device_get_unit@PLT
	mov	edi, r12d
	mov	r15d, eax
	call	device_get_name@PLT
	mov	edx, r15d
	mov	rdi, r13
	mov	esi, eax
	call	if_initname@PLT
	mov	eax, DWORD PTR ETHERMTU[rip]
	mov	QWORD PTR 32[r13], rbp
	xor	esi, esi
	mov	edx, DWORD PTR octm_ioctl[rip]
	add	rbp, 8
	mov	ecx, DWORD PTR octm_medstat[rip]
	mov	DWORD PTR 44[r13], eax
	mov	eax, DWORD PTR octm_init[rip]
	mov	DWORD PTR 24[r13], edx
	mov	edx, DWORD PTR octm_medchange[rip]
	mov	DWORD PTR 40[r13], 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	DWORD PTR 0[r13], eax
	mov	QWORD PTR 8[rbp], r13
	mov	DWORD PTR -4[rbp], eax
	mov	rdi, rbp
	call	ifmedia_init@PLT
	xor	ecx, ecx
	xor	edx, edx
	mov	rdi, rbp
	mov	esi, DWORD PTR IFM_ETHER[rip]
	or	esi, DWORD PTR IFM_AUTO[rip]
	call	ifmedia_add@PLT
	mov	rdi, rbp
	mov	esi, DWORD PTR IFM_ETHER[rip]
	lea	rbp, 8[r13]
	or	esi, DWORD PTR IFM_AUTO[rip]
	call	ifmedia_set@PLT
	mov	rsi, r14
	mov	rdi, r13
	call	ether_ifattach@PLT
	mov	eax, DWORD PTR octm_transmit[rip]
	mov	DWORD PTR 4[r13], 4
	mov	rdi, rbp
	mov	esi, DWORD PTR CVMX_MGMT_PORT_NUM_TX_BUFFERS[rip]
	mov	DWORD PTR 20[r13], eax
	mov	eax, DWORD PTR IFCAP_VLAN_MTU[rip]
	mov	DWORD PTR 12[r13], eax
	mov	DWORD PTR 16[r13], eax
	call	IFQ_SET_MAXLEN@PLT
	mov	eax, DWORD PTR CVMX_MGMT_PORT_NUM_TX_BUFFERS[rip]
	mov	rdi, rbp
	mov	DWORD PTR 8[r13], eax
	call	IFQ_SET_READY@PLT
	mov	edi, r12d
	call	bus_generic_attach@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	r13d, DWORD PTR OCTEON_IRQ_MII1[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	lea	rsi, .LC2[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
	mov	rcx, QWORD PTR 24[rbp]
	xor	edx, edx
	mov	edi, r12d
	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
.L15:
	lea	rsi, .LC1[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
	mov	eax, DWORD PTR ENXIO[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rsi, .LC4[rip]
	mov	edi, r12d
	xor	eax, eax
	call	device_printf@PLT
	mov	rcx, QWORD PTR 24[rbp]
	xor	edx, edx
	mov	edi, r12d
	mov	esi, DWORD PTR SYS_RES_IRQ[rip]
	call	bus_release_resource@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	jmp	.L1
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	octm_attach, .-octm_attach
	.comm	octm_transmit,4,4
	.comm	octm_rx_intr,4,4
	.comm	octm_medstat,4,4
	.comm	octm_medchange,4,4
	.comm	octm_ioctl,4,4
	.comm	octm_init,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RF_ACTIVE,4,4
	.comm	OCTEON_IRQ_MII1,4,4
	.comm	OCTEON_IRQ_MII,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	IFCAP_VLAN_MTU,4,4
	.comm	ETHERMTU,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,4,4
	.comm	CVMX_MGMT_PORT_NUM_TX_BUFFERS,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_octm.c_octm_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"unsupported management port %u.\012\000"
	.align	2
.LC1:
	.ascii	"unable to allocate IRQ.\012\000"
	.align	2
.LC2:
	.ascii	"unable to setup interrupt.\012\000"
	.align	2
.LC3:
	.ascii	"rx\000"
	.align	2
.LC4:
	.ascii	"cannot allocate ifnet.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	octm_attach, %function
octm_attach:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L18
	sub	sp, sp, #32
	mov	r5, r0
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	device_get_softc
	mov	r4, r0
	mov	r0, r5
	str	r5, [r4, #24]
	bl	device_get_unit
	cmp	r0, #0
	str	r0, [r4]
	beq	.L2
	cmp	r0, #1
	beq	.L3
	mov	r2, r0
	ldr	r1, .L18+4
	mov	r0, r5
	bl	device_printf
	ldr	r3, .L18+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r3, .L18+12
	ldr	r7, [r3]
.L5:
	mov	r6, #0
	str	r6, [sp, #20]
	bl	cvmx_sysinfo_get
	mov	r2, #6
	ldr	r1, [r0]
	add	r0, sp, #28
	bl	memcpy
	ldr	r0, [r4]
	ldr	r1, [sp, #20]
	ldr	r8, .L18+16
	add	r1, r0, r1
	str	r1, [sp, #20]
	bl	cvmx_mgmt_port_set_mac
	ldr	r0, [r4]
	bl	CVMX_MIXX_IRHWM
	mov	r1, r6
	bl	cvmx_write_csr
	ldr	r0, [r4]
	bl	CVMX_MIXX_INTENA
	mov	r1, r6
	bl	cvmx_write_csr
	mov	r2, #1
	ldr	r3, .L18+20
	ldr	r0, [r4, #24]
	ldr	r3, [r3]
	str	r2, [sp, #4]
	str	r3, [sp, #8]
	str	r7, [sp]
	ldr	r1, [r8]
	mov	r3, r7
	add	r2, sp, #24
	str	r6, [sp, #24]
	bl	bus_alloc_resource
	cmp	r0, r6
	mov	r1, r0
	str	r0, [r4, #16]
	beq	.L15
	ldr	r3, .L18+24
	ldr	r2, .L18+28
	ldr	ip, [r3]
	ldr	r0, [r4, #24]
	add	r3, r4, #20
	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	.L16
	ldr	r3, .L18+32
	ldr	r2, [r4, #20]
	ldr	r1, [r4, #16]
	ldr	r0, [r4, #24]
	bl	bus_describe_intr
	ldr	r3, .L18+36
	ldr	r0, [r3]
	bl	if_alloc
	subs	r6, r0, #0
	beq	.L17
	mov	r0, r5
	bl	device_get_name
	mov	r8, r0
	mov	r0, r5
	bl	device_get_unit
	mov	r1, r8
	mov	r2, r0
	mov	r0, r6
	bl	if_initname
	ldr	r2, .L18+40
	ldr	r3, .L18+44
	ldr	r0, .L18+48
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, .L18+52
	ldr	lr, [r0]
	ldr	r2, [r2]
	ldr	ip, .L18+56
	ldr	r0, .L18+60
	orr	r3, r3, r1
	ldr	r1, .L18+64
	orr	r3, r3, lr
	orr	r3, r3, r2
	ldr	lr, [ip]
	ldr	r2, .L18+68
	ldr	ip, [r0]
	ldr	r0, [r1]
	ldr	r1, .L18+72
	add	r8, r4, #8
	ldr	r10, .L18+76
	ldr	r9, .L18+80
	str	lr, [r6, #36]
	str	ip, [r6, #32]
	str	r4, [r6, #28]
	str	r3, [r6]
	str	r0, [r6, #24]
	ldr	r2, [r2]
	str	r3, [r4, #4]
	str	r6, [r4, #12]
	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
	add	r1, sp, #28
	mov	r0, r6
	bl	ether_ifattach
	mov	r2, #4
	ldr	r1, .L18+84
	ldr	r3, .L18+88
	ldr	r1, [r1]
	ldr	r3, [r3]
	ldr	r7, .L18+92
	add	r4, r6, #8
	str	r1, [r6, #20]
	str	r3, [r6, #12]
	ldr	r1, [r7]
	str	r3, [r6, #16]
	str	r2, [r6, #4]
	mov	r0, r4
	bl	IFQ_SET_MAXLEN
	ldr	r3, [r7]
	mov	r0, r4
	str	r3, [r6, #8]
	bl	IFQ_SET_READY
	mov	r0, r5
	bl	bus_generic_attach
	b	.L1
.L3:
	ldr	r3, .L18+96
	ldr	r7, [r3]
	b	.L5
.L16:
	ldr	r1, .L18+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, .L18+8
	ldr	r0, [r3]
	b	.L1
.L15:
	mov	r0, r5
	ldr	r1, .L18+104
	bl	device_printf
	ldr	r3, .L18+8
	ldr	r0, [r3]
	b	.L1
.L17:
	ldr	r1, .L18+108
	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, .L18+112
	ldr	r0, [r3]
	b	.L1
.L14:
	bl	__stack_chk_fail
.L19:
	.align	2
.L18:
	.word	.LC5
	.word	.LC0
	.word	ENXIO
	.word	OCTEON_IRQ_MII
	.word	SYS_RES_IRQ
	.word	RF_ACTIVE
	.word	octm_rx_intr
	.word	INTR_TYPE_NET
	.word	.LC3
	.word	IFT_ETHER
	.word	IFF_SIMPLEX
	.word	IFF_BROADCAST
	.word	IFF_MULTICAST
	.word	IFF_ALLMULTI
	.word	ETHERMTU
	.word	octm_init
	.word	octm_ioctl
	.word	octm_medchange
	.word	octm_medstat
	.word	IFM_ETHER
	.word	IFM_AUTO
	.word	octm_transmit
	.word	IFCAP_VLAN_MTU
	.word	CVMX_MGMT_PORT_NUM_TX_BUFFERS
	.word	OCTEON_IRQ_MII1
	.word	.LC2
	.word	.LC1
	.word	.LC4
	.word	ENOMEM
	.size	octm_attach, .-octm_attach
	.comm	octm_transmit,4,4
	.comm	octm_rx_intr,4,4
	.comm	octm_medstat,4,4
	.comm	octm_medchange,4,4
	.comm	octm_ioctl,4,4
	.comm	octm_init,4,4
	.comm	SYS_RES_IRQ,4,4
	.comm	RF_ACTIVE,4,4
	.comm	OCTEON_IRQ_MII1,4,4
	.comm	OCTEON_IRQ_MII,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	IFCAP_VLAN_MTU,4,4
	.comm	ETHERMTU,4,4
	.comm	ENXIO,4,4
	.comm	ENOMEM,4,4
	.comm	CVMX_MGMT_PORT_NUM_TX_BUFFERS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
