	.file	"extr_pci_mpc85xx.c_fsl_pcib_cfgread.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	fsl_pcib_cfgread, @function
fsl_pcib_cfgread:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	sal	ecx, 8
	sal	edx, 11
	mov	r13d, r9d
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, r8d
	and	ecx, 1792
	sal	esi, 16
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	and	r12d, 252
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, r8d
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	or	r12d, DWORD PTR CONFIG_ACCESS_ENABLE[rip]
	or	r12d, ecx
	movzx	ecx, dx
	or	ecx, r12d
	mov	r12d, esi
	and	r12d, 16711680
	or	r12d, ecx
	cmp	QWORD PTR 16[rdi], 0
	je	.L2
	mov	eax, r8d
	sal	eax, 16
	and	eax, 251658240
	or	r12d, eax
.L2:
	mov	rdi, rbp
	call	mtx_lock_spin@PLT
	mov	esi, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	mov	ecx, r12d
	mov	edx, DWORD PTR REG_CFG_ADDR[rip]
	call	bus_space_write_4@PLT
	cmp	r13d, 2
	je	.L3
	cmp	r13d, 4
	je	.L4
	mov	r12d, -1
	cmp	r13d, 1
	je	.L9
.L5:
	mov	rdi, rbp
	call	mtx_unlock_spin@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	esi, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	and	ebx, 2
	add	ebx, DWORD PTR REG_CFG_DATA[rip]
	mov	edx, ebx
	call	bus_space_read_2@PLT
	mov	edi, eax
	call	le16toh@PLT
	mov	r12d, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	mov	esi, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	and	ebx, 3
	add	ebx, DWORD PTR REG_CFG_DATA[rip]
	mov	edx, ebx
	call	bus_space_read_1@PLT
	mov	r12d, eax
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	mov	esi, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR 8[rbp]
	mov	edx, DWORD PTR REG_CFG_DATA[rip]
	call	bus_space_read_4@PLT
	mov	edi, eax
	call	le32toh@PLT
	mov	r12d, eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	fsl_pcib_cfgread, .-fsl_pcib_cfgread
	.comm	REG_CFG_DATA,4,4
	.comm	REG_CFG_ADDR,4,4
	.comm	CONFIG_ACCESS_ENABLE,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_mpc85xx.c_fsl_pcib_cfgread.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fsl_pcib_cfgread, %function
fsl_pcib_cfgread:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r0, .L13
	ldr	r6, [sp, #24]
	ldr	ip, [r0]
	lsl	r5, r3, #8
	ldr	r0, .L13+4
	and	r3, r6, #252
	and	r5, r5, #1792
	orr	r3, r3, ip
	ldr	ip, [r4, #12]
	orr	r3, r3, r5
	lsl	r1, r1, #16
	and	r5, r0, r2, lsl #11
	orr	r3, r3, r5
	cmp	ip, #0
	and	r1, r1, #16711680
	orr	r5, r1, r3
	lslne	r3, r6, #16
	andne	r3, r3, #251658240
	mov	r0, r4
	orrne	r5, r5, r3
	ldr	r7, [sp, #28]
	bl	mtx_lock_spin
	ldr	r2, .L13+8
	mov	r3, r5
	ldr	r2, [r2]
	ldr	r1, [r4, #4]
	ldr	r0, [r4, #8]
	bl	bus_space_write_4
	cmp	r7, #2
	beq	.L3
	cmp	r7, #4
	beq	.L4
	cmp	r7, #1
	mvnne	r5, #0
	beq	.L12
.L5:
	mov	r0, r4
	bl	mtx_unlock_spin
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	ldr	r3, .L13+12
	and	r6, r6, #2
	ldr	r2, [r3]
	ldr	r1, [r4, #4]
	add	r2, r6, r2
	ldr	r0, [r4, #8]
	bl	bus_space_read_2
	bl	le16toh
	mov	r5, r0
	b	.L5
.L12:
	ldr	r3, .L13+12
	and	r2, r6, #3
	ldr	r3, [r3]
	ldr	r1, [r4, #4]
	ldr	r0, [r4, #8]
	add	r2, r2, r3
	bl	bus_space_read_1
	mov	r5, r0
	b	.L5
.L4:
	ldr	r3, .L13+12
	ldr	r1, [r4, #4]
	ldr	r2, [r3]
	ldr	r0, [r4, #8]
	bl	bus_space_read_4
	bl	le32toh
	mov	r5, r0
	b	.L5
.L14:
	.align	2
.L13:
	.word	CONFIG_ACCESS_ENABLE
	.word	65535
	.word	REG_CFG_ADDR
	.word	REG_CFG_DATA
	.size	fsl_pcib_cfgread, .-fsl_pcib_cfgread
	.comm	REG_CFG_DATA,4,4
	.comm	REG_CFG_ADDR,4,4
	.comm	CONFIG_ACCESS_ENABLE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
