	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function serverworks_fixup_csb
_serverworks_fixup_csb:                 ## @serverworks_fixup_csb
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	callq	_PCI_FUNC
	testb	$1, %al
	jne	LBB0_3
## %bb.1:
	movl	$0, -28(%rbp)
	movq	_PCI_VENDOR_ID_SERVERWORKS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PCI_DEVICE_ID_SERVERWORKS_CSB5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %rbx
	leaq	-28(%rbp), %rdx
	movq	%rax, %rdi
	movl	$76, %esi
	callq	_pci_read_config_dword
	movl	$-2048, %edx                    ## imm = 0xF800
	andl	-28(%rbp), %edx
	orl	$96, %edx
	movl	%edx, -28(%rbp)
	movq	%rbx, %rdi
	movl	$76, %esi
	callq	_pci_write_config_dword
	jmp	LBB0_5
LBB0_3:
	movl	$0, -24(%rbp)
	movq	_PCI_VENDOR_ID_SERVERWORKS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PCI_DEVICE_ID_SERVERWORKS_CSB6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_pci_get_device
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%rax, %rbx
	leaq	-24(%rbp), %rdx
	movq	%rax, %rdi
	movl	$65, %esi
	callq	_pci_read_config_byte
	movl	-24(%rbp), %edx
	andl	$-65, %edx
	movl	%edx, -24(%rbp)
	movq	%rbx, %rdi
	movl	$65, %esi
	callq	_pci_write_config_byte
LBB0_5:
	movq	%rbx, %rdi
	callq	_pci_dev_put
LBB0_6:
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	movl	$90, %esi
	callq	_pci_read_config_byte
	andb	$-65, -20(%rbp)
	movl	8(%r14), %edi
	callq	_PCI_FUNC
	testb	$1, %al
	jne	LBB0_8
## %bb.7:
	movl	-20(%rbp), %edx
	orl	$2, %edx
	jmp	LBB0_9
LBB0_8:
	movq	(%r14), %rax
	movq	_SVWKS_CSB5_REVISION_NEW@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	setl	%dl
	xorl	$3, %edx
	orl	-20(%rbp), %edx
LBB0_9:
	movl	%edx, -20(%rbp)
	movq	%r14, %rdi
	movl	$90, %esi
	callq	_pci_write_config_byte
	movl	-20(%rbp), %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_VENDOR_ID_SERVERWORKS,4,2  ## @PCI_VENDOR_ID_SERVERWORKS
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB5,4,2 ## @PCI_DEVICE_ID_SERVERWORKS_CSB5
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB6,4,2 ## @PCI_DEVICE_ID_SERVERWORKS_CSB6
	.comm	_SVWKS_CSB5_REVISION_NEW,8,3    ## @SVWKS_CSB5_REVISION_NEW
	.no_dead_strip	_serverworks_fixup_csb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function serverworks_fixup_csb
_serverworks_fixup_csb:                 ; @serverworks_fixup_csb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_PCI_FUNC
	tbnz	w0, #0, LBB0_3
; %bb.1:
	str	wzr, [sp, #8]
Lloh0:
	adrp	x8, _PCI_VENDOR_ID_SERVERWORKS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_VENDOR_ID_SERVERWORKS@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _PCI_DEVICE_ID_SERVERWORKS_CSB5@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_DEVICE_ID_SERVERWORKS_CSB5@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_pci_get_device
	cbz	x0, LBB0_6
; %bb.2:
	mov	x20, x0
	add	x2, sp, #8
	mov	w1, #76
	bl	_pci_read_config_dword
	ldr	w8, [sp, #8]
	and	w8, w8, #0xfffff800
	orr	w2, w8, #0x60
	str	w2, [sp, #8]
	mov	x0, x20
	mov	w1, #76
	bl	_pci_write_config_dword
	b	LBB0_5
LBB0_3:
	str	wzr, [sp, #4]
Lloh6:
	adrp	x8, _PCI_VENDOR_ID_SERVERWORKS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PCI_VENDOR_ID_SERVERWORKS@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x8, _PCI_DEVICE_ID_SERVERWORKS_CSB6@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PCI_DEVICE_ID_SERVERWORKS_CSB6@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x2, #0
	bl	_pci_get_device
	cbz	x0, LBB0_6
; %bb.4:
	mov	x20, x0
	add	x2, sp, #4
	mov	w1, #65
	bl	_pci_read_config_byte
	ldr	w8, [sp, #4]
	and	w2, w8, #0xffffffbf
	str	w2, [sp, #4]
	mov	x0, x20
	mov	w1, #65
	bl	_pci_write_config_byte
LBB0_5:
	mov	x0, x20
	bl	_pci_dev_put
LBB0_6:
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #90
	bl	_pci_read_config_byte
	ldr	w8, [sp, #12]
	and	w8, w8, #0xffffffbf
	str	w8, [sp, #12]
	ldr	w0, [x19, #8]
	bl	_PCI_FUNC
	tbnz	w0, #0, LBB0_8
; %bb.7:
	ldr	w8, [sp, #12]
	orr	w2, w8, #0x2
	b	LBB0_9
LBB0_8:
	ldr	x8, [x19]
Lloh12:
	adrp	x9, _SVWKS_CSB5_REVISION_NEW@GOTPAGE
Lloh13:
	ldr	x9, [x9, _SVWKS_CSB5_REVISION_NEW@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #2
	cinc	w8, w8, ge
	ldr	w9, [sp, #12]
	orr	w2, w8, w9
LBB0_9:
	str	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #90
	bl	_pci_write_config_byte
	ldr	w0, [sp, #12]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_VENDOR_ID_SERVERWORKS,4,2  ; @PCI_VENDOR_ID_SERVERWORKS
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB5,4,2 ; @PCI_DEVICE_ID_SERVERWORKS_CSB5
	.comm	_PCI_DEVICE_ID_SERVERWORKS_CSB6,4,2 ; @PCI_DEVICE_ID_SERVERWORKS_CSB6
	.comm	_SVWKS_CSB5_REVISION_NEW,8,3    ; @SVWKS_CSB5_REVISION_NEW
	.no_dead_strip	_serverworks_fixup_csb
.subsections_via_symbols
