	.file	"extr_ops-emma2rh.c_pci_config_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pci_config_write, @function
pci_config_write:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, r8d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, edx
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	edi, DWORD PTR EMMA2RH_PCI_CONFIG_BASE[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	KSEG1ADDR@PLT
	lea	rdx, 20[rsp]
	mov	esi, ebp
	mov	rdi, r15
	mov	r14d, eax
	call	check_args@PLT
	cmp	rax, QWORD PTR PCIBIOS_DEVICE_NOT_FOUND[rip]
	je	.L1
	mov	edi, DWORD PTR EMMA2RH_PCI_IWIN0_CTR[rip]
	call	emma2rh_in32@PLT
	mov	edi, DWORD PTR 20[rsp]
	mov	edx, ebx
	mov	esi, ebp
	mov	r15d, eax
	call	set_pci_configuration_address@PLT
	test	rax, rax
	js	.L15
	mov	edi, ebp
	call	PCI_FUNC@PLT
	mov	esi, ebx
	sal	eax, 8
	and	esi, -4
	add	eax, r14d
	add	eax, esi
	mov	r8d, DWORD PTR [eax]
	cmp	r13d, 2
	je	.L5
	cmp	r13d, 4
	je	.L6
	cmp	r13d, 1
	je	.L17
	mov	edi, DWORD PTR EMMA2RH_PCI_IWIN0_CTR[rip]
	mov	esi, r15d
	call	emma2rh_out32@PLT
	mov	eax, DWORD PTR PCIBIOS_FUNC_NOT_SUPPORTED[rip]
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rbx, QWORD PTR 24[rsp]
	xor	rbx, QWORD PTR fs:40
	jne	.L18
	add	rsp, 40
	.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
.L17:
	.cfi_restore_state
	lea	ecx, 0[0+rbx*8]
	mov	edi, 255
	movzx	r12d, r12b
	and	ecx, 24
	mov	eax, edi
	sal	eax, cl
	sal	r12d, cl
	not	eax
	and	eax, r8d
	or	r12d, eax
.L6:
	mov	edi, ebp
	mov	DWORD PTR 12[rsp], esi
	call	PCI_FUNC@PLT
	mov	esi, DWORD PTR 12[rsp]
	sal	eax, 8
	add	r14d, eax
	add	esi, r14d
	mov	DWORD PTR [esi], r12d
	mov	edi, DWORD PTR EMMA2RH_PCI_IWIN0_CTR[rip]
	mov	esi, r15d
	call	emma2rh_out32@PLT
	mov	edi, DWORD PTR EMMA2RH_PCI_INT[rip]
	call	emma2rh_in32@PLT
	mov	r8d, eax
	mov	eax, DWORD PTR PCIBIOS_SUCCESSFUL[rip]
	test	DWORD PTR RMABORT[rip], r8d
	je	.L1
.L15:
	mov	eax, DWORD PTR PCIBIOS_DEVICE_NOT_FOUND[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	lea	ecx, 0[0+rbx*8]
	mov	edx, 65535
	movzx	r12d, r12w
	and	ecx, 16
	mov	eax, edx
	sal	eax, cl
	sal	r12d, cl
	not	eax
	and	eax, r8d
	or	r12d, eax
	jmp	.L6
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pci_config_write, .-pci_config_write
	.comm	RMABORT,4,4
	.comm	PCIBIOS_SUCCESSFUL,4,4
	.comm	PCIBIOS_FUNC_NOT_SUPPORTED,4,4
	.comm	PCIBIOS_DEVICE_NOT_FOUND,8,8
	.comm	EMMA2RH_PCI_IWIN0_CTR,4,4
	.comm	EMMA2RH_PCI_INT,4,4
	.comm	EMMA2RH_PCI_CONFIG_BASE,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_ops-emma2rh.c_pci_config_write.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	pci_config_write, %function
pci_config_write:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	ip, .L17
	mov	r8, r3
	ldr	r3, .L17+4
	sub	sp, sp, #12
	mov	r7, r0
	ldr	r0, [ip]
	mov	r4, r1
	mov	r5, r2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	KSEG1ADDR
	mov	r2, sp
	mov	r6, r0
	mov	r1, r4
	mov	r0, r7
	bl	check_args
	ldr	r7, .L17+8
	ldr	r2, [r7]
	cmp	r0, r2
	beq	.L1
	ldr	r10, .L17+12
	ldr	r0, [r10]
	bl	emma2rh_in32
	mov	r2, r5
	mov	r9, r0
	mov	r1, r4
	ldr	r0, [sp]
	bl	set_pci_configuration_address
	cmp	r0, #0
	blt	.L13
	mov	r0, r4
	bl	PCI_FUNC
	bic	fp, r5, #3
	add	r0, r6, r0, lsl #8
	cmp	r8, #2
	ldr	r3, [r0, fp]
	beq	.L4
	cmp	r8, #4
	beq	.L5
	cmp	r8, #1
	beq	.L15
	mov	r1, r9
	ldr	r0, [r10]
	bl	emma2rh_out32
	ldr	r3, .L17+16
	ldr	r2, [r3]
.L1:
	ldr	r3, .L17+4
	ldr	r1, [r3]
	ldr	r3, [sp, #4]
	eors	r1, r3, r1
	mov	r3, #0
	bne	.L16
	mov	r0, r2
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	mov	r2, #255
	lsl	r5, r5, #3
	and	r5, r5, #24
	bic	r3, r3, r2, lsl r5
	ldr	r2, [sp, #48]
	and	r2, r2, #255
	orr	r3, r3, r2, lsl r5
	str	r3, [sp, #48]
.L5:
	mov	r0, r4
	bl	PCI_FUNC
	ldr	r3, [sp, #48]
	add	r6, r6, r0, lsl #8
	str	r3, [r6, fp]
	mov	r1, r9
	ldr	r0, [r10]
	bl	emma2rh_out32
	ldr	r3, .L17+20
	ldr	r0, [r3]
	bl	emma2rh_in32
	ldr	r3, .L17+24
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L7
.L13:
	ldr	r2, [r7]
	b	.L1
.L7:
	ldr	r3, .L17+28
	ldr	r2, [r3]
	b	.L1
.L4:
	ldr	r2, .L17+32
	ldr	r1, [sp, #48]
	lsl	r5, r5, #3
	and	r5, r5, #16
	bic	r3, r3, r2, lsl r5
	and	r2, r2, r1
	orr	r3, r3, r2, lsl r5
	str	r3, [sp, #48]
	b	.L5
.L16:
	bl	__stack_chk_fail
.L18:
	.align	2
.L17:
	.word	EMMA2RH_PCI_CONFIG_BASE
	.word	.LC0
	.word	PCIBIOS_DEVICE_NOT_FOUND
	.word	EMMA2RH_PCI_IWIN0_CTR
	.word	PCIBIOS_FUNC_NOT_SUPPORTED
	.word	EMMA2RH_PCI_INT
	.word	RMABORT
	.word	PCIBIOS_SUCCESSFUL
	.word	65535
	.size	pci_config_write, .-pci_config_write
	.comm	RMABORT,4,4
	.comm	PCIBIOS_SUCCESSFUL,4,4
	.comm	PCIBIOS_FUNC_NOT_SUPPORTED,4,4
	.comm	PCIBIOS_DEVICE_NOT_FOUND,4,4
	.comm	EMMA2RH_PCI_IWIN0_CTR,4,4
	.comm	EMMA2RH_PCI_INT,4,4
	.comm	EMMA2RH_PCI_CONFIG_BASE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
