	.file	"extr_gfx_v8_0.c_gfx_v8_0_sw_fini.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	gfx_v8_0_sw_fini, @function
gfx_v8_0_sw_fini:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edx, DWORD PTR 8[rdi]
	test	edx, edx
	jle	.L2
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rax, QWORD PTR 56[rbp]
	lea	rdi, [rax+rbx*4]
	add	rbx, 1
	call	amdgpu_ring_fini@PLT
	cmp	DWORD PTR 8[rbp], ebx
	jg	.L3
.L2:
	mov	eax, DWORD PTR 12[rbp]
	test	eax, eax
	jle	.L4
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rax, QWORD PTR 48[rbp]
	lea	rdi, [rax+rbx*4]
	add	rbx, 1
	call	amdgpu_ring_fini@PLT
	cmp	DWORD PTR 12[rbp], ebx
	jg	.L5
.L4:
	mov	rdi, rbp
	call	amdgpu_gfx_mqd_sw_fini@PLT
	lea	rsi, 40[rbp]
	lea	rdi, 44[rbp]
	call	amdgpu_gfx_kiq_free_ring@PLT
	mov	rdi, rbp
	call	amdgpu_gfx_kiq_fini@PLT
	mov	rdi, rbp
	call	gfx_v8_0_mec_fini@PLT
	mov	rdi, rbp
	call	amdgpu_gfx_rlc_fini@PLT
	lea	rdx, 28[rbp]
	lea	rsi, 32[rbp]
	lea	rdi, 36[rbp]
	call	amdgpu_bo_free_kernel@PLT
	mov	rax, QWORD PTR 0[rbp]
	cmp	rax, QWORD PTR CHIP_CARRIZO[rip]
	je	.L6
	cmp	rax, QWORD PTR CHIP_STONEY[rip]
	je	.L6
.L7:
	mov	rdi, rbp
	call	gfx_v8_0_free_microcode@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	lea	rdx, 16[rbp]
	lea	rsi, 20[rbp]
	lea	rdi, 24[rbp]
	call	amdgpu_bo_free_kernel@PLT
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	gfx_v8_0_sw_fini, .-gfx_v8_0_sw_fini
	.comm	CHIP_STONEY,8,8
	.comm	CHIP_CARRIZO,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_gfx_v8_0.c_gfx_v8_0_sw_fini.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	gfx_v8_0_sw_fini, %function
gfx_v8_0_sw_fini:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0, #4]
	push	{r4, r5, r6, lr}
	cmp	r3, #0
	mov	r4, r0
	ble	.L2
	mov	r5, #0
.L3:
	ldr	r0, [r4, #48]
	add	r0, r0, r5, lsl #2
	bl	amdgpu_ring_fini
	ldr	r3, [r4, #4]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L3
.L2:
	ldr	r3, [r4, #8]
	cmp	r3, #0
	ble	.L4
	mov	r5, #0
.L5:
	ldr	r0, [r4, #44]
	add	r0, r0, r5, lsl #2
	bl	amdgpu_ring_fini
	ldr	r3, [r4, #8]
	add	r5, r5, #1
	cmp	r3, r5
	bgt	.L5
.L4:
	mov	r0, r4
	bl	amdgpu_gfx_mqd_sw_fini
	add	r1, r4, #36
	add	r0, r4, #40
	bl	amdgpu_gfx_kiq_free_ring
	mov	r0, r4
	bl	amdgpu_gfx_kiq_fini
	mov	r0, r4
	bl	gfx_v8_0_mec_fini
	mov	r0, r4
	bl	amdgpu_gfx_rlc_fini
	add	r2, r4, #24
	add	r1, r4, #28
	add	r0, r4, #32
	bl	amdgpu_bo_free_kernel
	ldr	r2, .L12
	ldr	r3, [r4]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L6
	ldr	r2, .L12+4
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L6
.L7:
	mov	r0, r4
	bl	gfx_v8_0_free_microcode
	mov	r0, #0
	pop	{r4, r5, r6, pc}
.L6:
	add	r2, r4, #12
	add	r1, r4, #16
	add	r0, r4, #20
	bl	amdgpu_bo_free_kernel
	b	.L7
.L13:
	.align	2
.L12:
	.word	CHIP_CARRIZO
	.word	CHIP_STONEY
	.size	gfx_v8_0_sw_fini, .-gfx_v8_0_sw_fini
	.comm	CHIP_STONEY,4,4
	.comm	CHIP_CARRIZO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
