	.file	"extr_pci_common.c_sun4u_read_pci_cfg_host.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sun4u_read_pci_cfg_host, @function
sun4u_read_pci_cfg_host:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movzx	r15d, sil
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	esi, r15d
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r9
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, ecx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r8d
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	DWORD PTR 12[rsp], edx
	call	sun4u_config_mkaddr@PLT
	mov	edx, DWORD PTR 12[rsp]
	test	rax, rax
	je	.L6
	mov	r12, rax
	cmp	ebx, 2
	je	.L4
	cmp	ebx, 4
	je	.L5
	cmp	ebx, 1
	je	.L13
.L6:
	mov	rbx, QWORD PTR 40[rsp]
	xor	rbx, QWORD PTR fs:40
	mov	eax, DWORD PTR PCIBIOS_SUCCESSFUL[rip]
	jne	.L14
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.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
.L4:
	.cfi_restore_state
	cmp	ebp, 7
	jg	.L9
	lea	rsi, 32[rsp]
	mov	rdi, rax
	call	pci_config_read16@PLT
	mov	eax, DWORD PTR 32[rsp]
	mov	DWORD PTR 0[r13], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	cmp	ebp, 7
	jg	.L7
	mov	rdi, rax
	lea	rsi, 32[rsp]
	and	rdi, -2
	call	pci_config_read16@PLT
	and	ebp, 1
	je	.L8
	mov	eax, DWORD PTR 32[rsp]
	sar	eax, 8
	mov	DWORD PTR 0[r13], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	lea	rbx, 28[rsp]
	mov	r8d, 2
	mov	ecx, ebp
	mov	esi, r15d
	mov	r9, rbx
	mov	rdi, r14
	mov	DWORD PTR 12[rsp], edx
	mov	DWORD PTR 28[rsp], -1
	call	sun4u_read_pci_cfg_host
	mov	eax, DWORD PTR 28[rsp]
	mov	edx, DWORD PTR 12[rsp]
	lea	ecx, 2[rbp]
	mov	r9, rbx
	mov	r8d, 2
	mov	esi, r15d
	mov	rdi, r14
	mov	DWORD PTR 0[r13], eax
	mov	DWORD PTR 28[rsp], -1
	call	sun4u_read_pci_cfg_host
	mov	eax, DWORD PTR 28[rsp]
	sal	eax, 16
	or	DWORD PTR 0[r13], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	lea	rsi, 36[rsp]
	mov	rdi, rax
	call	pci_config_read8@PLT
	mov	eax, DWORD PTR 36[rsp]
	mov	DWORD PTR 0[r13], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	lea	rbp, 36[rsp]
	mov	rdi, rax
	mov	rsi, rbp
	call	pci_config_read8@PLT
	mov	eax, DWORD PTR 36[rsp]
	lea	rdi, 4[r12]
	mov	rsi, rbp
	mov	DWORD PTR 0[r13], eax
	call	pci_config_read8@PLT
	mov	eax, DWORD PTR 36[rsp]
	sal	eax, 8
	or	DWORD PTR 0[r13], eax
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L8:
	movzx	eax, BYTE PTR 32[rsp]
	mov	DWORD PTR 0[r13], eax
	jmp	.L6
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	sun4u_read_pci_cfg_host, .-sun4u_read_pci_cfg_host
	.comm	PCIBIOS_SUCCESSFUL,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_pci_common.c_sun4u_read_pci_cfg_host.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sun4u_read_pci_cfg_host, %function
sun4u_read_pci_cfg_host:
	@ args = 8, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L15
	sub	sp, sp, #28
	ldr	ip, [ip]
	str	ip, [sp, #20]
	mov	ip,#0
	mov	r7, r0
	mov	r8, r1
	mov	r9, r2
	mov	r6, r3
	ldr	r5, [sp, #64]
	ldr	r10, [sp, #68]
	bl	sun4u_config_mkaddr
	subs	r4, r0, #0
	beq	.L6
	cmp	r5, #2
	beq	.L4
	cmp	r5, #4
	beq	.L5
	cmp	r5, #1
	beq	.L13
.L6:
	ldr	r3, .L15+4
	ldr	r0, [r3]
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	cmp	r6, #7
	bgt	.L9
	add	r1, sp, #12
	bl	pci_config_read16
	ldr	r3, [sp, #12]
	str	r3, [r10]
	b	.L6
.L13:
	cmp	r6, #7
	bgt	.L7
	bic	r0, r4, #1
	add	r1, sp, #12
	bl	pci_config_read16
	tst	r6, #1
	ldrne	r3, [sp, #12]
	ldrbeq	r3, [sp, #12]	@ zero_extendqisi2
	asrne	r3, r3, #8
	str	r3, [r10]
	b	.L6
.L5:
	mov	r5, #2
	mvn	r4, #0
	add	fp, sp, #8
	mov	r3, r6
	mov	r2, r9
	mov	r1, r8
	mov	r0, r7
	stm	sp, {r5, fp}
	str	r4, [sp, #8]
	bl	sun4u_read_pci_cfg_host
	ldr	ip, [sp, #8]
	mov	r2, r9
	stm	sp, {r5, fp}
	add	r3, r6, r5
	mov	r1, r8
	mov	r0, r7
	str	ip, [r10]
	str	r4, [sp, #8]
	bl	sun4u_read_pci_cfg_host
	ldr	r3, [r10]
	ldr	r2, [sp, #8]
	orr	r3, r3, r2, lsl #16
	str	r3, [r10]
	b	.L6
.L7:
	add	r1, sp, #16
	bl	pci_config_read8
	ldr	r3, [sp, #16]
	str	r3, [r10]
	b	.L6
.L9:
	add	r1, sp, #16
	bl	pci_config_read8
	ldr	r3, [sp, #16]
	add	r1, sp, #16
	str	r3, [r10]
	add	r0, r4, #4
	bl	pci_config_read8
	ldr	r3, [r10]
	ldr	r2, [sp, #16]
	orr	r3, r3, r2, lsl #8
	str	r3, [r10]
	b	.L6
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	PCIBIOS_SUCCESSFUL
	.size	sun4u_read_pci_cfg_host, .-sun4u_read_pci_cfg_host
	.comm	PCIBIOS_SUCCESSFUL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
