	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function schizo_setup_device
_schizo_setup_device:                   ## @schizo_setup_device
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_OF_getproplen
	testq	%rax, %rax
	js	LBB0_2
## %bb.1:
	movq	_STX_PCI_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_SCHIZO_PCI_READ_8
	movq	_STX_PCI_CTRL_ARB_PARK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_SCHIZO_PCI_SET
LBB0_2:
	movq	(%r15), %rax
	movq	_SCHIZO_MODE_XMS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.3:
	movq	_SCHIZO_FLAGS_XMODE@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, 8(%r15)
	je	LBB0_7
## %bb.4:
	movq	_PCIR_HDRTYPE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movl	%r14d, %edi
	movl	$1, %edx
	callq	_pci_read_config
	movq	_PCIM_HDRTYPE@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_PCIM_HDRTYPE_BRIDGE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_7
## %bb.5:
	movq	_PCIY_PCIX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_pci_find_cap
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movslq	-36(%rbp), %rbx
	movq	_PCIXR_COMMAND@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_pci_read_config
	andl	$124, %eax
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	%eax, %edx
	movl	$2, %ecx
	callq	_pci_write_config
LBB0_7:
	cmpl	$4, 12(%r15)
	jl	LBB0_10
## %bb.8:
	movl	(%r12), %eax
	andl	8(%r15), %eax
	movl	$255, %eax
	movl	$160, %ebx
	cmoveq	%rax, %rbx
	movq	_XMS_PCI_X_DIAG_BUGCNTL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %rbx
	movq	_XMS_PCI_X_DIAG@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r15, %rdi
	callq	_SCHIZO_PCI_READ_8
	movq	_XMS_PCI_X_DIAG_BUGCNTL_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	cmpl	%ebx, %eax
	je	LBB0_10
## %bb.9:
	movl	(%r14), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_SCHIZO_PCI_SET
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pci-req-removal"

	.comm	_STX_PCI_CTRL,4,2               ## @STX_PCI_CTRL
	.comm	_STX_PCI_CTRL_ARB_PARK,4,2      ## @STX_PCI_CTRL_ARB_PARK
	.comm	_SCHIZO_MODE_XMS,8,3            ## @SCHIZO_MODE_XMS
	.comm	_SCHIZO_FLAGS_XMODE,4,2         ## @SCHIZO_FLAGS_XMODE
	.comm	_PCIR_HDRTYPE,8,3               ## @PCIR_HDRTYPE
	.comm	_PCIM_HDRTYPE,4,2               ## @PCIM_HDRTYPE
	.comm	_PCIM_HDRTYPE_BRIDGE,4,2        ## @PCIM_HDRTYPE_BRIDGE
	.comm	_PCIY_PCIX,4,2                  ## @PCIY_PCIX
	.comm	_PCIXR_COMMAND,8,3              ## @PCIXR_COMMAND
	.comm	_XMS_PCI_X_DIAG_BUGCNTL_SHIFT,4,2 ## @XMS_PCI_X_DIAG_BUGCNTL_SHIFT
	.comm	_XMS_PCI_X_DIAG,4,2             ## @XMS_PCI_X_DIAG
	.comm	_XMS_PCI_X_DIAG_BUGCNTL_MASK,4,2 ## @XMS_PCI_X_DIAG_BUGCNTL_MASK
	.no_dead_strip	_schizo_setup_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function schizo_setup_device
_schizo_setup_device:                   ; @schizo_setup_device
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	bl	_device_get_softc
	mov	x19, x0
	mov	x0, x20
	bl	_ofw_bus_get_node
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_OF_getproplen
	tbnz	x0, #63, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _STX_PCI_CTRL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _STX_PCI_CTRL@GOTPAGEOFF]
Lloh4:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_SCHIZO_PCI_READ_8
Lloh5:
	adrp	x8, _STX_PCI_CTRL_ARB_PARK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _STX_PCI_CTRL_ARB_PARK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	bic	w2, w0, w8
	mov	x0, x19
	mov	x1, x21
	bl	_SCHIZO_PCI_SET
LBB0_2:
	ldr	x8, [x19]
Lloh8:
	adrp	x9, _SCHIZO_MODE_XMS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SCHIZO_MODE_XMS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.3:
	ldr	w8, [x19, #8]
Lloh11:
	adrp	x22, _SCHIZO_FLAGS_XMODE@GOTPAGE
Lloh12:
	ldr	x22, [x22, _SCHIZO_FLAGS_XMODE@GOTPAGEOFF]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.4:
Lloh13:
	adrp	x8, _PCIR_HDRTYPE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PCIR_HDRTYPE@GOTPAGEOFF]
Lloh15:
	ldr	x1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_pci_read_config
Lloh16:
	adrp	x8, _PCIM_HDRTYPE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PCIM_HDRTYPE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh19:
	adrp	x9, _PCIM_HDRTYPE_BRIDGE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PCIM_HDRTYPE_BRIDGE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_7
; %bb.5:
Lloh22:
	adrp	x8, _PCIY_PCIX@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PCIY_PCIX@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_find_cap
	cbnz	x0, LBB0_7
; %bb.6:
	ldrsw	x8, [sp, #12]
Lloh25:
	adrp	x9, _PCIXR_COMMAND@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PCIXR_COMMAND@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	add	x21, x9, x8
	mov	x0, x20
	mov	x1, x21
	mov	w2, #2
	bl	_pci_read_config
	and	w2, w0, #0x7c
	mov	x0, x20
	mov	x1, x21
	mov	w3, #2
	bl	_pci_write_config
LBB0_7:
	ldr	w8, [x19, #12]
	cmp	w8, #4
	b.lt	LBB0_10
; %bb.8:
	ldr	w8, [x19, #8]
	ldr	w9, [x22]
	tst	w9, w8
	mov	w8, #160
	mov	w9, #255
Lloh28:
	adrp	x10, _XMS_PCI_X_DIAG_BUGCNTL_SHIFT@GOTPAGE
Lloh29:
	ldr	x10, [x10, _XMS_PCI_X_DIAG_BUGCNTL_SHIFT@GOTPAGEOFF]
	csel	x8, x9, x8, eq
Lloh30:
	ldr	w9, [x10]
	lsl	x20, x8, x9
Lloh31:
	adrp	x21, _XMS_PCI_X_DIAG@GOTPAGE
Lloh32:
	ldr	x21, [x21, _XMS_PCI_X_DIAG@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_SCHIZO_PCI_READ_8
Lloh33:
	adrp	x8, _XMS_PCI_X_DIAG_BUGCNTL_MASK@GOTPAGE
Lloh34:
	ldr	x8, [x8, _XMS_PCI_X_DIAG_BUGCNTL_MASK@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	and	w8, w8, w0
	cmp	w8, w20
	b.eq	LBB0_10
; %bb.9:
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, x20
	bl	_SCHIZO_PCI_SET
LBB0_10:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pci-req-removal"

	.comm	_STX_PCI_CTRL,4,2               ; @STX_PCI_CTRL
	.comm	_STX_PCI_CTRL_ARB_PARK,4,2      ; @STX_PCI_CTRL_ARB_PARK
	.comm	_SCHIZO_MODE_XMS,8,3            ; @SCHIZO_MODE_XMS
	.comm	_SCHIZO_FLAGS_XMODE,4,2         ; @SCHIZO_FLAGS_XMODE
	.comm	_PCIR_HDRTYPE,8,3               ; @PCIR_HDRTYPE
	.comm	_PCIM_HDRTYPE,4,2               ; @PCIM_HDRTYPE
	.comm	_PCIM_HDRTYPE_BRIDGE,4,2        ; @PCIM_HDRTYPE_BRIDGE
	.comm	_PCIY_PCIX,4,2                  ; @PCIY_PCIX
	.comm	_PCIXR_COMMAND,8,3              ; @PCIXR_COMMAND
	.comm	_XMS_PCI_X_DIAG_BUGCNTL_SHIFT,4,2 ; @XMS_PCI_X_DIAG_BUGCNTL_SHIFT
	.comm	_XMS_PCI_X_DIAG,4,2             ; @XMS_PCI_X_DIAG
	.comm	_XMS_PCI_X_DIAG_BUGCNTL_MASK,4,2 ; @XMS_PCI_X_DIAG_BUGCNTL_MASK
	.no_dead_strip	_schizo_setup_device
.subsections_via_symbols
