	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function serverworks_set_piomode
_serverworks_set_piomode:               ## @serverworks_set_piomode
	.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
	movq	%rsi, %r14
	movl	(%rdi), %ebx
	addl	%ebx, %ebx
	movl	(%rsi), %r12d
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	movslq	4(%r14), %r14
	movq	_XFER_PIO_0@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	subq	%rax, %r14
	movl	%ebx, %esi
	subl	%r12d, %esi
	addl	$65, %esi
	leaq	_serverworks_set_piomode.pio_mode(%rip), %rax
	movl	(%rax,%r14,4), %edx
	movq	%r15, %rdi
	callq	_pci_write_config_byte
	movq	%r15, %rdi
	callq	_serverworks_is_csb
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	addl	%r12d, %ebx
	shll	$2, %ebx
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	movl	$74, %esi
	callq	_pci_read_config_word
	movl	$15, %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	-36(%rbp), %eax
	movl	%eax, -36(%rbp)
	shll	%cl, %r14d
	orl	%eax, %r14d
	movq	%r15, %rdi
	movl	$74, %esi
	movl	%r14d, %edx
	callq	_pci_write_config_byte
LBB0_2:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @serverworks_set_piomode.pio_mode
_serverworks_set_piomode.pio_mode:
	.long	93                              ## 0x5d
	.long	71                              ## 0x47
	.long	52                              ## 0x34
	.long	34                              ## 0x22
	.long	32                              ## 0x20

	.comm	_XFER_PIO_0,4,2                 ## @XFER_PIO_0
	.no_dead_strip	_serverworks_set_piomode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function serverworks_set_piomode
_serverworks_set_piomode:               ; @serverworks_set_piomode
	.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
	ldr	w8, [x0]
	lsl	w21, w8, #1
	ldr	w22, [x1]
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w8, [x20, #4]
Lloh0:
	adrp	x9, _XFER_PIO_0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _XFER_PIO_0@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w20, w8, w9
	sub	w8, w21, w22
	add	w1, w8, #65
Lloh3:
	adrp	x8, _serverworks_set_piomode.pio_mode@PAGE
Lloh4:
	add	x8, x8, _serverworks_set_piomode.pio_mode@PAGEOFF
	ldr	w2, [x8, w20, sxtw #2]
	bl	_pci_write_config_byte
	mov	x0, x19
	bl	_serverworks_is_csb
	cbz	x0, LBB0_2
; %bb.1:
	add	w8, w21, w22
	lsl	w21, w8, #2
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #74
	bl	_pci_read_config_word
	mov	w8, #15
	lsl	w8, w8, w21
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	lsl	w9, w20, w21
	orr	w2, w8, w9
	mov	x0, x19
	mov	w1, #74
	bl	_pci_write_config_byte
LBB0_2:
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @serverworks_set_piomode.pio_mode
_serverworks_set_piomode.pio_mode:
	.long	93                              ; 0x5d
	.long	71                              ; 0x47
	.long	52                              ; 0x34
	.long	34                              ; 0x22
	.long	32                              ; 0x20

	.comm	_XFER_PIO_0,4,2                 ; @XFER_PIO_0
	.no_dead_strip	_serverworks_set_piomode
.subsections_via_symbols
