	.file	"extr_ioat.c_ioat_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Too many I/OAT devices in system\n"
	.text
	.p2align 4
	.type	ioat_attach, @function
ioat_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	DEVICE2SOFTC@PLT
	mov	edi, ebp
	mov	DWORD PTR 28[rax], ebp
	mov	rsi, rax
	mov	rbx, rax
	call	bus_get_domain@PLT
	test	rax, rax
	jne	.L2
	mov	rax, QWORD PTR [rbx]
	lea	rdi, 0[0+rax*4]
.L3:
	add	rdi, QWORD PTR cpuset_domain[rip]
	call	CPU_FFS@PLT
	sub	rax, 1
	mov	QWORD PTR 8[rbx], rax
	js	.L21
.L4:
	mov	rdi, rbx
	call	ioat_map_pci_bar@PLT
	mov	r12d, eax
	test	eax, eax
	je	.L22
.L5:
	mov	edi, ebp
	call	ioat_detach@PLT
.L1:
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	QWORD PTR [rbx], 0
	xor	edi, edi
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rdi, rbx
	call	ioat_read_cbver@PLT
	cmp	rax, QWORD PTR IOAT_VER_3_0[rip]
	mov	r12d, DWORD PTR ENODEV[rip]
	mov	QWORD PTR 16[rbx], rax
	jl	.L7
	mov	edi, ebp
	call	ioat3_attach@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L5
	mov	edi, ebp
	call	pci_enable_busmaster@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L5
	mov	rdi, rbx
	call	ioat_setup_intr@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L5
	mov	rdi, rbx
	call	ioat_reset_hw@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L5
	mov	esi, DWORD PTR FALSE[rip]
	mov	rdi, rbx
	call	ioat_process_events@PLT
	mov	edi, ebp
	call	ioat_setup_sysctl@PLT
	lea	rdi, ioat_list_mtx[rip]
	call	mtx_lock@PLT
	mov	ecx, DWORD PTR IOAT_MAX_CHANNELS[rip]
	test	ecx, ecx
	jle	.L8
	mov	rdx, QWORD PTR ioat_channel[rip]
	xor	eax, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L23:
	add	eax, 1
	add	rdx, 8
	cmp	eax, ecx
	je	.L8
.L10:
	cmp	QWORD PTR [rdx], 0
	jne	.L23
	cmp	DWORD PTR ioat_channel_index[rip], eax
	mov	DWORD PTR 24[rbx], eax
	mov	QWORD PTR [rdx], rbx
	jg	.L13
	add	eax, 1
	mov	DWORD PTR ioat_channel_index[rip], eax
.L13:
	lea	rdi, ioat_list_mtx[rip]
	call	mtx_unlock@PLT
	xor	eax, eax
	call	ioat_test_attach@PLT
	jmp	.L1
.L8:
	lea	rdi, ioat_list_mtx[rip]
	call	mtx_unlock@PLT
	lea	rsi, .LC0[rip]
	mov	edi, ebp
	call	device_printf@PLT
	mov	r12d, DWORD PTR ENXIO[rip]
	.p2align 4,,10
	.p2align 3
.L7:
	test	r12d, r12d
	jne	.L5
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	xor	eax, eax
	call	CPU_FIRST@PLT
	mov	QWORD PTR 8[rbx], rax
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	ioat_attach, .-ioat_attach
	.comm	ioat_list_mtx,4,4
	.comm	ioat_channel_index,4,4
	.comm	ioat_channel,8,8
	.comm	cpuset_domain,8,8
	.comm	IOAT_VER_3_0,8,8
	.comm	IOAT_MAX_CHANNELS,4,4
	.comm	FALSE,4,4
	.comm	ENXIO,4,4
	.comm	ENODEV,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_ioat.c_ioat_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Too many I/OAT devices in system\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ioat_attach, %function
ioat_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r6, r0
	bl	DEVICE2SOFTC
	mov	r4, r0
	mov	r0, r6
	mov	r1, r4
	str	r6, [r4, #16]
	bl	bus_get_domain
	cmp	r0, #0
	movne	r2, #0
	movne	r3, r2
	strne	r2, [r4]
	ldr	r2, .L24
	ldreq	r3, [r4]
	ldr	r0, [r2]
	lsleq	r3, r3, #2
	add	r0, r0, r3
	bl	CPU_FFS
	sub	r3, r0, #1
	cmp	r3, #0
	str	r3, [r4, #4]
	blt	.L21
.L4:
	mov	r0, r4
	bl	ioat_map_pci_bar
	subs	r5, r0, #0
	beq	.L22
.L5:
	mov	r0, r6
	bl	ioat_detach
.L1:
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L22:
	mov	r0, r4
	bl	ioat_read_cbver
	ldr	r3, .L24+4
	str	r0, [r4, #8]
	ldr	r3, [r3]
	cmp	r0, r3
	bge	.L6
	ldr	r3, .L24+8
	ldr	r5, [r3]
.L7:
	cmp	r5, #0
	bne	.L5
	mov	r0, r5
	pop	{r4, r5, r6, pc}
.L21:
	bl	CPU_FIRST
	str	r0, [r4, #4]
	b	.L4
.L6:
	mov	r0, r6
	bl	ioat3_attach
	subs	r5, r0, #0
	bne	.L5
	mov	r0, r6
	bl	pci_enable_busmaster
	subs	r5, r0, #0
	bne	.L5
	mov	r0, r4
	bl	ioat_setup_intr
	subs	r5, r0, #0
	bne	.L5
	mov	r0, r4
	bl	ioat_reset_hw
	subs	r5, r0, #0
	bne	.L5
	ldr	r3, .L24+12
	mov	r0, r4
	ldr	r1, [r3]
	bl	ioat_process_events
	mov	r0, r6
	bl	ioat_setup_sysctl
	ldr	r0, .L24+16
	bl	mtx_lock
	ldr	r3, .L24+20
	ldr	ip, [r3]
	cmp	ip, #0
	ble	.L8
	ldr	r2, .L24+24
	mov	r3, r5
	ldr	r2, [r2]
	b	.L10
.L23:
	add	r3, r3, #1
	cmp	r3, ip
	beq	.L8
.L10:
	ldr	r0, [r2]
	mov	r1, r2
	cmp	r0, #0
	add	r2, r2, #4
	bne	.L23
	ldr	r2, .L24+28
	str	r3, [r4, #12]
	ldr	r0, [r2]
	str	r4, [r1]
	cmp	r0, r3
	addle	r3, r3, #1
	ldr	r0, .L24+16
	strle	r3, [r2]
	bl	mtx_unlock
	bl	ioat_test_attach
	b	.L1
.L8:
	ldr	r0, .L24+16
	bl	mtx_unlock
	mov	r0, r6
	ldr	r1, .L24+32
	bl	device_printf
	ldr	r3, .L24+36
	ldr	r5, [r3]
	b	.L7
.L25:
	.align	2
.L24:
	.word	cpuset_domain
	.word	IOAT_VER_3_0
	.word	ENODEV
	.word	FALSE
	.word	ioat_list_mtx
	.word	IOAT_MAX_CHANNELS
	.word	ioat_channel
	.word	ioat_channel_index
	.word	.LC0
	.word	ENXIO
	.size	ioat_attach, .-ioat_attach
	.comm	ioat_list_mtx,4,4
	.comm	ioat_channel_index,4,4
	.comm	ioat_channel,4,4
	.comm	cpuset_domain,4,4
	.comm	IOAT_VER_3_0,4,4
	.comm	IOAT_MAX_CHANNELS,4,4
	.comm	FALSE,4,4
	.comm	ENXIO,4,4
	.comm	ENODEV,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
