	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vi_gpu_pci_config_reset
_vi_gpu_pci_config_reset:               ## @vi_gpu_pci_config_reset
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_info
	movl	12(%r14), %edi
	callq	_pci_clear_master
	movq	%r14, %rdi
	callq	_amdgpu_device_pci_config_reset
	movl	$100, %edi
	callq	_udelay
	cmpq	$0, (%r14)
	jle	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	movq	_mmCONFIG_MEMSIZE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_RREG32
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	callq	_udelay
	incq	%rbx
	cmpq	(%r14), %rbx
	jl	LBB0_2
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_3:
	movl	12(%r14), %edi
	callq	_pci_set_master
	movl	$1, 8(%r14)
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPU pci config reset\n"

	.comm	_mmCONFIG_MEMSIZE,4,2           ## @mmCONFIG_MEMSIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_vi_gpu_pci_config_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vi_gpu_pci_config_reset
_vi_gpu_pci_config_reset:               ; @vi_gpu_pci_config_reset
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w0, [x19, #12]
	bl	_pci_clear_master
	mov	x0, x19
	bl	_amdgpu_device_pci_config_reset
	mov	w0, #100
	bl	_udelay
	ldr	x8, [x19]
	cmp	x8, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x20, #0
Lloh2:
	adrp	x21, _mmCONFIG_MEMSIZE@GOTPAGE
Lloh3:
	ldr	x21, [x21, _mmCONFIG_MEMSIZE@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_RREG32
	cmn	w0, #1
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #1
	bl	_udelay
	add	x20, x20, #1
	ldr	x8, [x19]
	cmp	x20, x8
	b.lt	LBB0_2
LBB0_4:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #12]
	bl	_pci_set_master
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19, #8]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPU pci config reset\n"

	.comm	_mmCONFIG_MEMSIZE,4,2           ; @mmCONFIG_MEMSIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_vi_gpu_pci_config_reset
.subsections_via_symbols
