	.file	"extr_pata_icside.c_pata_icside_add_ports.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pata_icside_add_ports, @function
pata_icside_add_ports:
.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
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR 40[rdi]
	mov	rbx, rdi
	mov	r13, QWORD PTR 48[rdi]
	test	rax, rax
	je	.L2
	mov	QWORD PTR 24[r13], rax
	mov	eax, DWORD PTR 32[rdi]
	mov	DWORD PTR 16[r13], eax
.L2:
	mov	esi, DWORD PTR 28[rbx]
	test	esi, esi
	jne	.L18
.L3:
	mov	rax, QWORD PTR 8[r13]
	mov	esi, DWORD PTR 0[r13]
	mov	rdi, r13
	call	[QWORD PTR [rax]]
	mov	esi, DWORD PTR [rbx]
	lea	rdi, 4[r13]
	call	ata_host_alloc@PLT
	mov	r14, rax
	test	rax, rax
	je	.L19
	mov	eax, DWORD PTR 24[rbx]
	mov	DWORD PTR 12[r14], eax
	mov	eax, DWORD PTR ATA_HOST_SIMPLEX[rip]
	mov	DWORD PTR 8[r14], eax
	mov	eax, DWORD PTR [rbx]
	test	eax, eax
	jle	.L6
	xor	ebp, ebp
	lea	r12, pata_icside_port_ops[rip]
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR [r14]
	mov	esi, DWORD PTR 16[rbx]
	mov	rdx, rbx
	mov	rdi, QWORD PTR [rax+rbp*8]
	mov	eax, DWORD PTR ATA_PIO4[rip]
	mov	DWORD PTR 16[rdi], eax
	mov	eax, DWORD PTR 20[rbx]
	mov	DWORD PTR 12[rdi], eax
	mov	eax, DWORD PTR ATA_FLAG_SLAVE_POSS[rip]
	or	DWORD PTR 8[rdi], eax
	mov	rax, QWORD PTR 8[rbx]
	mov	QWORD PTR [rdi], r12
	mov	ecx, DWORD PTR [rax+rbp*4]
	add	rbp, 1
	call	pata_icside_setup_ioaddr@PLT
	cmp	DWORD PTR [rbx], ebp
	jg	.L7
.L6:
	mov	esi, DWORD PTR 0[r13]
	mov	edx, DWORD PTR ata_bmdma_interrupt[rip]
	mov	rdi, r14
	xor	ecx, ecx
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	lea	r8, pata_icside_sht[rip]
	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
	jmp	ata_host_activate@PLT
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	edx, DWORD PTR 24[rbx]
	mov	rdi, r13
	call	ecard_setirq@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L19:
	mov	eax, DWORD PTR ENOMEM[rip]
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	pata_icside_add_ports, .-pata_icside_add_ports
	.comm	pata_icside_sht,4,4
	.comm	pata_icside_port_ops,4,4
	.comm	ata_bmdma_interrupt,4,4
	.comm	ENOMEM,4,4
	.comm	ATA_PIO4,4,4
	.comm	ATA_HOST_SIMPLEX,4,4
	.comm	ATA_FLAG_SLAVE_POSS,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_pata_icside.c_pata_icside_add_ports.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pata_icside_add_ports, %function
pata_icside_add_ports:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0, #28]
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	cmp	r3, #0
	ldrne	r2, [r0, #24]
	ldr	r10, [r0, #32]
	ldr	r1, [r0, #20]
	strne	r3, [r10, #16]
	strne	r2, [r10, #12]
	cmp	r1, #0
	mov	r4, r0
	sub	sp, sp, #8
	bne	.L17
.L3:
	ldr	r3, [r10, #8]
	ldr	r1, [r10]
	ldr	r3, [r3]
	mov	r0, r10
	blx	r3
	ldr	r1, [r4]
	add	r0, r10, #4
	bl	ata_host_alloc
	subs	r6, r0, #0
	beq	.L18
	ldr	r3, .L19
	ldr	r1, [r4]
	ldr	r2, [r3]
	ldr	r3, [r4, #16]
	cmp	r1, #0
	stmib	r6, {r2, r3}
	ble	.L6
	mov	r5, #0
	ldr	r9, .L19+4
	ldr	r8, .L19+8
	ldr	r7, .L19+12
.L7:
	ldr	r3, [r6]
	ldr	r2, [r8]
	ldr	r0, [r3, r5, lsl #2]
	ldr	r1, [r4, #12]
	ldr	r3, [r0, #4]
	ldr	ip, [r9]
	orr	r3, r3, r2
	ldr	r2, [r4, #4]
	str	r1, [r0, #8]
	str	ip, [r0, #12]
	str	r3, [r0, #4]
	ldr	r3, [r2, r5, lsl #2]
	ldr	r1, [r4, #8]
	mov	r2, r4
	str	r7, [r0]
	bl	pata_icside_setup_ioaddr
	ldr	r3, [r4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L7
.L6:
	ldr	r3, .L19+16
	ldr	r2, .L19+20
	ldr	r1, [r10]
	ldr	r2, [r2]
	mov	r0, r6
	str	r3, [sp]
	mov	r3, #0
	bl	ata_host_activate
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	ldr	r2, [r0, #16]
	mov	r0, r10
	bl	ecard_setirq
	b	.L3
.L18:
	ldr	r3, .L19+24
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L20:
	.align	2
.L19:
	.word	ATA_HOST_SIMPLEX
	.word	ATA_PIO4
	.word	ATA_FLAG_SLAVE_POSS
	.word	pata_icside_port_ops
	.word	pata_icside_sht
	.word	ata_bmdma_interrupt
	.word	ENOMEM
	.size	pata_icside_add_ports, .-pata_icside_add_ports
	.comm	pata_icside_sht,4,4
	.comm	pata_icside_port_ops,4,4
	.comm	ata_bmdma_interrupt,4,4
	.comm	ENOMEM,4,4
	.comm	ATA_PIO4,4,4
	.comm	ATA_HOST_SIMPLEX,4,4
	.comm	ATA_FLAG_SLAVE_POSS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
