	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_atpx_detect
_amdgpu_atpx_detect:                    ## @amdgpu_atpx_detect
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$296, %rsp                      ## imm = 0x128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, -65(%rbp)
	movaps	%xmm0, -80(%rbp)
	movaps	%xmm0, -96(%rbp)
	movaps	%xmm0, -112(%rbp)
	movaps	%xmm0, -128(%rbp)
	movaps	%xmm0, -144(%rbp)
	movaps	%xmm0, -160(%rbp)
	movaps	%xmm0, -176(%rbp)
	movaps	%xmm0, -192(%rbp)
	movaps	%xmm0, -208(%rbp)
	movaps	%xmm0, -224(%rbp)
	movaps	%xmm0, -240(%rbp)
	movaps	%xmm0, -256(%rbp)
	movaps	%xmm0, -272(%rbp)
	movaps	%xmm0, -288(%rbp)
	movaps	%xmm0, -304(%rbp)
	movl	$255, -328(%rbp)
	leaq	-304(%rbp), %rax
	movq	%rax, -320(%rbp)
	movq	_PCI_CLASS_DISPLAY_VGA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$8, %edi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_pci_get_class
	movl	$0, %r13d
	movl	$0, %r15d
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	cmpq	$0, (%rax)
	setne	%al
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movzbl	-305(%rbp), %ecx                ## 1-byte Folded Reload
	movb	%cl, %r14b
	orl	%r14d, %r12d
	movzbl	%al, %eax
	orl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_amdgpu_atpx_get_quirks
	movq	_PCI_CLASS_DISPLAY_VGA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$8, %edi
	movq	%rbx, %rsi
	callq	_pci_get_class
	movq	%rax, %rbx
	incl	%r13d
	testq	%rax, %rax
	je	LBB0_4
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_amdgpu_atpx_pci_probe_handle
	xorl	%r14d, %r14d
	cmpl	$1, %eax
	sete	-305(%rbp)                      ## 1-byte Folded Spill
	movq	%rbx, %rdi
	callq	_pci_upstream_bridge
	testq	%rax, %rax
	jne	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_4:
	movq	_PCI_CLASS_DISPLAY_OTHER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$8, %edi
	xorl	%esi, %esi
	callq	_pci_get_class
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movq	%rax, %rbx
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$0, (%rax)
	setne	%al
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	movzbl	-305(%rbp), %ecx                ## 1-byte Folded Reload
	movb	%cl, %r14b
	orl	%r14d, %r12d
	movzbl	%al, %eax
	orl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_amdgpu_atpx_get_quirks
	movq	_PCI_CLASS_DISPLAY_OTHER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	shll	$8, %edi
	movq	%rbx, %rsi
	callq	_pci_get_class
	movq	%rax, %rbx
	incl	%r13d
	testq	%rax, %rax
	je	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_amdgpu_atpx_pci_probe_handle
	xorl	%r14d, %r14d
	cmpl	$1, %eax
	sete	-305(%rbp)                      ## 1-byte Folded Spill
	movq	%rbx, %rdi
	callq	_pci_upstream_bridge
	testq	%rax, %rax
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_12:
	testl	%r12d, %r12d
	je	LBB0_13
## %bb.14:
	cmpl	$2, %r13d
	movl	$0, %eax
	jne	LBB0_16
## %bb.15:
	movq	_amdgpu_atpx_priv@GOTPCREL(%rip), %rbx
	movl	8(%rbx), %edi
	movq	_ACPI_FULL_PATHNAME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-328(%rbp), %rdx
	callq	_acpi_get_name
	leaq	L_.str(%rip), %rdi
	leaq	-304(%rbp), %rsi
	callq	_pr_info
	movl	$1, (%rbx)
	movl	%r15d, 4(%rbx)
	xorl	%eax, %eax
	callq	_amdgpu_atpx_init
	movl	$1, %eax
	jmp	LBB0_16
LBB0_13:
	xorl	%eax, %eax
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_18
## %bb.17:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$296, %rsp                      ## imm = 0x128
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_CLASS_DISPLAY_VGA,4,2      ## @PCI_CLASS_DISPLAY_VGA
	.comm	_PCI_CLASS_DISPLAY_OTHER,4,2    ## @PCI_CLASS_DISPLAY_OTHER
	.comm	_amdgpu_atpx_priv,12,2          ## @amdgpu_atpx_priv
	.comm	_ACPI_FULL_PATHNAME,4,2         ## @ACPI_FULL_PATHNAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vga_switcheroo: detected switching method %s handle\n"

	.no_dead_strip	_amdgpu_atpx_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_atpx_detect
_amdgpu_atpx_detect:                    ; @amdgpu_atpx_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #368
	.cfi_def_cfa_offset 368
	stp	x28, x27, [sp, #288]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #304]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #320]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #336]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #352]            ; 16-byte Folded Spill
	add	x29, sp, #352
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w27, -72
	.cfi_offset w28, -80
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #255]
	stp	q0, q0, [sp, #224]
	stp	q0, q0, [sp, #192]
	stp	q0, q0, [sp, #160]
	stp	q0, q0, [sp, #128]
	stp	q0, q0, [sp, #96]
	stp	q0, q0, [sp, #64]
	str	q0, [sp, #48]
	mov	w8, #255
	str	w8, [sp]
	add	x8, sp, #16
	str	x8, [sp, #8]
Lloh3:
	adrp	x23, _PCI_CLASS_DISPLAY_VGA@GOTPAGE
Lloh4:
	ldr	x23, [x23, _PCI_CLASS_DISPLAY_VGA@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w0, w8, #8
	stp	q0, q0, [sp, #16]
	mov	x1, #0
	bl	_pci_get_class
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	mov	w20, #0
	mov	w21, #0
	mov	w22, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w8, ne
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	orr	w22, w22, w24
	orr	w20, w20, w8
	mov	x0, x19
	bl	_amdgpu_atpx_get_quirks
	ldr	w8, [x23]
	lsl	w0, w8, #8
	mov	x1, x19
	bl	_pci_get_class
	mov	x19, x0
	add	w21, w21, #1
	cbz	x0, LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_amdgpu_atpx_pci_probe_handle
	cmp	w0, #1
	cset	w24, eq
	mov	x0, x19
	bl	_pci_upstream_bridge
	cbnz	x0, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w8, #0
	b	LBB0_3
LBB0_6:
	mov	w22, #0
	mov	w21, #0
	mov	w20, #0
LBB0_7:
Lloh5:
	adrp	x23, _PCI_CLASS_DISPLAY_OTHER@GOTPAGE
Lloh6:
	ldr	x23, [x23, _PCI_CLASS_DISPLAY_OTHER@GOTPAGEOFF]
	ldr	w8, [x23]
	lsl	w0, w8, #8
	mov	x1, #0
	bl	_pci_get_class
	cbz	x0, LBB0_13
; %bb.8:
	mov	x19, x0
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w8, ne
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	orr	w22, w22, w24
	orr	w20, w20, w8
	mov	x0, x19
	bl	_amdgpu_atpx_get_quirks
	ldr	w8, [x23]
	lsl	w0, w8, #8
	mov	x1, x19
	bl	_pci_get_class
	mov	x19, x0
	add	w21, w21, #1
	cbz	x0, LBB0_13
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_amdgpu_atpx_pci_probe_handle
	cmp	w0, #1
	cset	w24, eq
	mov	x0, x19
	bl	_pci_upstream_bridge
	cbnz	x0, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	w8, #0
	b	LBB0_10
LBB0_13:
	mov	w19, #0
	cbz	w22, LBB0_16
; %bb.14:
	cmp	w21, #2
	b.ne	LBB0_16
; %bb.15:
Lloh7:
	adrp	x21, _amdgpu_atpx_priv@GOTPAGE
Lloh8:
	ldr	x21, [x21, _amdgpu_atpx_priv@GOTPAGEOFF]
	ldr	w0, [x21, #8]
Lloh9:
	adrp	x8, _ACPI_FULL_PATHNAME@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ACPI_FULL_PATHNAME@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x2, sp
	bl	_acpi_get_name
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	add	x1, sp, #16
	bl	_pr_info
	mov	w19, #1
	stp	w19, w20, [x21]
	bl	_amdgpu_atpx_init
LBB0_16:
	ldur	x8, [x29, #-72]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.17:
	mov	x0, x19
	ldp	x29, x30, [sp, #352]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #336]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #320]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #304]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #288]            ; 16-byte Folded Reload
	add	sp, sp, #368
	ret
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_CLASS_DISPLAY_VGA,4,2      ; @PCI_CLASS_DISPLAY_VGA
	.comm	_PCI_CLASS_DISPLAY_OTHER,4,2    ; @PCI_CLASS_DISPLAY_OTHER
	.comm	_amdgpu_atpx_priv,12,2          ; @amdgpu_atpx_priv
	.comm	_ACPI_FULL_PATHNAME,4,2         ; @ACPI_FULL_PATHNAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vga_switcheroo: detected switching method %s handle\n"

	.no_dead_strip	_amdgpu_atpx_detect
.subsections_via_symbols
