	.file	"extr_pcihp_slot.c_program_hpp_type2.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"PCIe settings rev %d not supported\n"
	.text
	.p2align 4
	.type	program_hpp_type2, @function
program_hpp_type2:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	test	rsi, rsi
	je	.L1
	mov	edx, DWORD PTR [rsi]
	mov	rbp, rdi
	mov	rbx, rsi
	cmp	edx, 1
	jg	.L16
	mov	edx, DWORD PTR 48[rsi]
	mov	ecx, DWORD PTR 44[rsi]
	mov	esi, DWORD PTR PCI_EXP_DEVCTL[rip]
	not	edx
	call	pcie_capability_clear_and_set_word@PLT
	cmp	QWORD PTR 0[rbp], 0
	jne	.L17
.L5:
	mov	esi, DWORD PTR PCI_EXT_CAP_ID_ERR[rip]
	mov	rdi, rbp
	call	pci_find_ext_capability@PLT
	test	eax, eax
	je	.L1
	mov	rsi, QWORD PTR PCI_ERR_UNCOR_MASK[rip]
	movsx	r12, eax
	lea	r13, 4[rsp]
	mov	rdi, rbp
	mov	rdx, r13
	add	rsi, r12
	call	pci_read_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_UNCOR_MASK[rip]
	mov	edx, DWORD PTR 4[rbx]
	mov	rdi, rbp
	and	edx, DWORD PTR 4[rsp]
	or	edx, DWORD PTR 8[rbx]
	add	rsi, r12
	mov	DWORD PTR 4[rsp], edx
	call	pci_write_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_UNCOR_SEVER[rip]
	mov	rdx, r13
	mov	rdi, rbp
	add	rsi, r12
	call	pci_read_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_UNCOR_SEVER[rip]
	mov	edx, DWORD PTR 12[rbx]
	mov	rdi, rbp
	and	edx, DWORD PTR 4[rsp]
	or	edx, DWORD PTR 16[rbx]
	add	rsi, r12
	mov	DWORD PTR 4[rsp], edx
	call	pci_write_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_COR_MASK[rip]
	mov	rdx, r13
	mov	rdi, rbp
	add	rsi, r12
	call	pci_read_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_COR_MASK[rip]
	mov	edx, DWORD PTR 20[rbx]
	mov	rdi, rbp
	and	edx, DWORD PTR 4[rsp]
	or	edx, DWORD PTR 24[rbx]
	add	rsi, r12
	mov	DWORD PTR 4[rsp], edx
	call	pci_write_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_CAP[rip]
	mov	rdx, r13
	mov	rdi, rbp
	add	rsi, r12
	call	pci_read_config_dword@PLT
	mov	rsi, QWORD PTR PCI_ERR_CAP[rip]
	mov	edx, DWORD PTR 28[rbx]
	mov	rdi, rbp
	and	edx, DWORD PTR 4[rsp]
	or	edx, DWORD PTR 32[rbx]
	add	rsi, r12
	mov	DWORD PTR 4[rsp], edx
	call	pci_write_config_dword@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L18
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L16:
	.cfi_restore_state
	lea	rdi, 8[rdi]
	lea	rsi, .LC0[rip]
	call	dev_warn@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L17:
	mov	edx, DWORD PTR 40[rbx]
	mov	ecx, DWORD PTR 36[rbx]
	mov	rdi, rbp
	mov	esi, DWORD PTR PCI_EXP_LNKCTL[rip]
	not	edx
	call	pcie_capability_clear_and_set_word@PLT
	jmp	.L5
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	program_hpp_type2, .-program_hpp_type2
	.comm	PCI_EXT_CAP_ID_ERR,4,4
	.comm	PCI_EXP_LNKCTL,4,4
	.comm	PCI_EXP_DEVCTL,4,4
	.comm	PCI_ERR_UNCOR_SEVER,8,8
	.comm	PCI_ERR_UNCOR_MASK,8,8
	.comm	PCI_ERR_COR_MASK,8,8
	.comm	PCI_ERR_CAP,8,8
	.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_pcihp_slot.c_program_hpp_type2.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"PCIe settings rev %d not supported\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	program_hpp_type2, %function
program_hpp_type2:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L22
	sub	sp, sp, #12
	subs	r4, r1, #0
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	beq	.L1
	ldr	r2, [r4]
	mov	r6, r0
	cmp	r2, #1
	bgt	.L19
	ldr	r2, [r4, #48]
	ldr	r3, .L22+4
	mvn	r2, r2
	ldr	r1, [r3]
	ldr	r3, [r4, #44]
	bl	pcie_capability_clear_and_set_word
	ldr	r3, [r6]
	cmp	r3, #0
	bne	.L20
.L5:
	ldr	r3, .L22+8
	mov	r0, r6
	ldr	r1, [r3]
	bl	pci_find_ext_capability
	subs	r5, r0, #0
	beq	.L1
	ldr	r7, .L22+12
	mov	r2, sp
	ldr	r1, [r7]
	mov	r0, r6
	add	r1, r5, r1
	bl	pci_read_config_dword
	ldr	r0, [sp]
	ldr	r2, [r4, #4]
	ldr	r3, [r4, #8]
	ldr	r1, [r7]
	and	r2, r2, r0
	ldr	r7, .L22+16
	orr	r2, r2, r3
	add	r1, r5, r1
	mov	r0, r6
	str	r2, [sp]
	bl	pci_write_config_dword
	ldr	r1, [r7]
	mov	r2, sp
	add	r1, r5, r1
	mov	r0, r6
	bl	pci_read_config_dword
	ldr	r0, [sp]
	ldr	r2, [r4, #12]
	ldr	r3, [r4, #16]
	ldr	r1, [r7]
	and	r2, r2, r0
	ldr	r7, .L22+20
	orr	r2, r2, r3
	add	r1, r5, r1
	mov	r0, r6
	str	r2, [sp]
	bl	pci_write_config_dword
	ldr	r1, [r7]
	mov	r2, sp
	add	r1, r5, r1
	mov	r0, r6
	bl	pci_read_config_dword
	ldr	r0, [sp]
	ldr	r2, [r4, #20]
	ldr	r3, [r4, #24]
	ldr	r1, [r7]
	and	r2, r2, r0
	ldr	r7, .L22+24
	orr	r2, r2, r3
	add	r1, r5, r1
	mov	r0, r6
	str	r2, [sp]
	bl	pci_write_config_dword
	ldr	r1, [r7]
	mov	r2, sp
	add	r1, r5, r1
	mov	r0, r6
	bl	pci_read_config_dword
	ldr	r0, [sp]
	ldr	r2, [r4, #28]
	ldr	r3, [r4, #32]
	ldr	r1, [r7]
	and	r2, r2, r0
	orr	r2, r2, r3
	mov	r0, r6
	add	r1, r5, r1
	str	r2, [sp]
	bl	pci_write_config_dword
.L1:
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L19:
	ldr	r1, .L22+28
	add	r0, r0, #4
	bl	dev_warn
	b	.L1
.L20:
	ldr	r2, [r4, #40]
	ldr	r3, .L22+32
	mvn	r2, r2
	ldr	r1, [r3]
	mov	r0, r6
	ldr	r3, [r4, #36]
	bl	pcie_capability_clear_and_set_word
	b	.L5
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC1
	.word	PCI_EXP_DEVCTL
	.word	PCI_EXT_CAP_ID_ERR
	.word	PCI_ERR_UNCOR_MASK
	.word	PCI_ERR_UNCOR_SEVER
	.word	PCI_ERR_COR_MASK
	.word	PCI_ERR_CAP
	.word	.LC0
	.word	PCI_EXP_LNKCTL
	.size	program_hpp_type2, .-program_hpp_type2
	.comm	PCI_EXT_CAP_ID_ERR,4,4
	.comm	PCI_EXP_LNKCTL,4,4
	.comm	PCI_EXP_DEVCTL,4,4
	.comm	PCI_ERR_UNCOR_SEVER,4,4
	.comm	PCI_ERR_UNCOR_MASK,4,4
	.comm	PCI_ERR_COR_MASK,4,4
	.comm	PCI_ERR_CAP,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
