	.file	"extr_aspm.c_pcie_aspm_init_link_state.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	pcie_aspm_init_link_state
	.type	pcie_aspm_init_link_state, @function
pcie_aspm_init_link_state:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	pcie_aspm_sanity_check@PLT
	mov	edx, DWORD PTR aspm_support_enabled[rip]
	test	edx, edx
	je	.L1
	cmp	QWORD PTR 16[rbp], 0
	je	.L15
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	rdi, rbp
	mov	ebx, eax
	call	pcie_downstream_port@PLT
	test	eax, eax
	je	.L1
	mov	rdi, rbp
	call	pci_pcie_type@PLT
	cmp	rax, QWORD PTR PCI_EXP_TYPE_ROOT_PORT[rip]
	jne	.L5
	mov	rax, QWORD PTR 8[rbp]
	cmp	QWORD PTR [rax], 0
	jne	.L1
.L5:
	lea	rdi, pci_bus_sem[rip]
	call	down_read@PLT
	mov	rdi, QWORD PTR 0[rbp]
	call	list_empty@PLT
	test	rax, rax
	jne	.L6
	lea	rdi, aspm_lock[rip]
	call	mutex_lock@PLT
	mov	rdi, rbp
	call	alloc_pcie_link_state@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L8
	xor	r12d, r12d
	test	ebx, ebx
	mov	rdi, rax
	setne	r12b
	mov	esi, r12d
	call	pcie_aspm_cap_init@PLT
	mov	esi, r12d
	mov	rdi, rbp
	call	pcie_clkpm_cap_init@PLT
	mov	rax, QWORD PTR aspm_policy[rip]
	cmp	rax, QWORD PTR POLICY_POWERSAVE[rip]
	je	.L8
	cmp	rax, QWORD PTR POLICY_POWER_SUPERSAVE[rip]
	je	.L8
	mov	rdi, rbp
	call	pcie_config_aspm_path@PLT
	mov	rdi, rbp
	call	policy_to_clkpm_state@PLT
	mov	rdi, rbp
	mov	esi, eax
	call	pcie_set_clkpm@PLT
.L8:
	lea	rdi, aspm_lock[rip]
	call	mutex_unlock@PLT
.L6:
	pop	rbx
	.cfi_def_cfa_offset 24
	lea	rdi, pci_bus_sem[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	up_read@PLT
	.cfi_endproc
.LFE0:
	.size	pcie_aspm_init_link_state, .-pcie_aspm_init_link_state
	.comm	pci_bus_sem,4,4
	.comm	aspm_support_enabled,4,4
	.comm	aspm_policy,8,8
	.comm	aspm_lock,4,4
	.comm	POLICY_POWER_SUPERSAVE,8,8
	.comm	POLICY_POWERSAVE,8,8
	.comm	PCI_EXP_TYPE_ROOT_PORT,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_aspm.c_pcie_aspm_init_link_state.c"
	.text
	.align	2
	.global	pcie_aspm_init_link_state
	.syntax unified
	.arm
	.fpu softvfp
	.type	pcie_aspm_init_link_state, %function
pcie_aspm_init_link_state:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	bl	pcie_aspm_sanity_check
	ldr	r3, .L15
	ldr	r3, [r3]
	cmp	r3, #0
	popeq	{r4, r5, r6, pc}
	ldr	r3, [r4, #8]
	cmp	r3, #0
	popne	{r4, r5, r6, pc}
	mov	r5, r0
	mov	r0, r4
	bl	pcie_downstream_port
	cmp	r0, #0
	popeq	{r4, r5, r6, pc}
	mov	r0, r4
	bl	pci_pcie_type
	ldr	r3, .L15+4
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L5
	ldr	r3, [r4, #4]
	ldr	r3, [r3]
	cmp	r3, #0
	popne	{r4, r5, r6, pc}
.L5:
	ldr	r0, .L15+8
	bl	down_read
	ldr	r0, [r4]
	bl	list_empty
	cmp	r0, #0
	bne	.L6
	ldr	r0, .L15+12
	bl	mutex_lock
	mov	r0, r4
	bl	alloc_pcie_link_state
	subs	r4, r0, #0
	beq	.L8
	subs	r5, r5, #0
	movne	r5, #1
	mov	r1, r5
	bl	pcie_aspm_cap_init
	mov	r1, r5
	mov	r0, r4
	bl	pcie_clkpm_cap_init
	ldr	r3, .L15+16
	ldr	r2, .L15+20
	ldr	r3, [r3]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L8
	ldr	r2, .L15+24
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L8
	mov	r0, r4
	bl	pcie_config_aspm_path
	mov	r0, r4
	bl	policy_to_clkpm_state
	mov	r1, r0
	mov	r0, r4
	bl	pcie_set_clkpm
.L8:
	ldr	r0, .L15+12
	bl	mutex_unlock
.L6:
	pop	{r4, r5, r6, lr}
	ldr	r0, .L15+8
	b	up_read
.L16:
	.align	2
.L15:
	.word	aspm_support_enabled
	.word	PCI_EXP_TYPE_ROOT_PORT
	.word	pci_bus_sem
	.word	aspm_lock
	.word	aspm_policy
	.word	POLICY_POWERSAVE
	.word	POLICY_POWER_SUPERSAVE
	.size	pcie_aspm_init_link_state, .-pcie_aspm_init_link_state
	.comm	pci_bus_sem,4,4
	.comm	aspm_support_enabled,4,4
	.comm	aspm_policy,4,4
	.comm	aspm_lock,4,4
	.comm	POLICY_POWER_SUPERSAVE,4,4
	.comm	POLICY_POWERSAVE,4,4
	.comm	PCI_EXP_TYPE_ROOT_PORT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
