	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function serverworks_set_dmamode
_serverworks_set_dmamode:               ## @serverworks_set_dmamode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movl	(%rdi), %eax
	leal	(%rax,%rax), %ebx
	incl	%ebx
	movl	(%rsi), %ecx
	subl	%ecx, %ebx
	leal	(%rcx,%rax,2), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r15
	leaq	-44(%rbp), %rdx
	movq	%rax, %rdi
	movl	$84, %esi
	callq	_pci_read_config_byte
	movl	(%r14), %esi
	addl	$86, %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_byte
	movb	(%r12), %cl
	shlb	$2, %cl
	movl	$15, %eax
	shll	%cl, %eax
	notl	%eax
	andl	%eax, -48(%rbp)
	movq	8(%r12), %rax
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %r13
	addl	$68, %ebx
	cmpq	(%r13), %rax
	jge	LBB0_1
## %bb.2:
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rax
	leaq	_serverworks_set_dmamode.dma_mode(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_pci_write_config_byte
	movl	-44(%rbp), %eax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	btrl	%ecx, %eax
	movl	-48(%rbp), %edx
	jmp	LBB0_3
LBB0_1:
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$32, %edx
	callq	_pci_write_config_byte
	movq	8(%r12), %rdx
	subq	(%r13), %rdx
	movb	(%r12), %cl
	shlb	$2, %cl
	shlq	%cl, %rdx
	orl	-48(%rbp), %edx
	movl	%edx, -48(%rbp)
	movl	-44(%rbp), %eax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	btsl	%ecx, %eax
LBB0_3:
	movl	%eax, -44(%rbp)
	movl	(%r14), %esi
	addl	$86, %esi
	movq	%r15, %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pci_write_config_byte
	movl	-44(%rbp), %edx
	movq	%r15, %rdi
	movl	$84, %esi
	callq	_pci_write_config_byte
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	2                               ## @serverworks_set_dmamode.dma_mode
_serverworks_set_dmamode.dma_mode:
	.long	119                             ## 0x77
	.long	33                              ## 0x21
	.long	32                              ## 0x20

	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,8,3              ## @XFER_MW_DMA_0
	.no_dead_strip	_serverworks_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function serverworks_set_dmamode
_serverworks_set_dmamode:               ; @serverworks_set_dmamode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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 w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x19, x0
	ldr	w8, [x0]
	mov	w22, #1
	mov	w9, #1
	bfi	w9, w8, #1, #31
	ldr	w10, [x1]
	sub	w25, w9, w10
	add	w23, w10, w8, lsl #1
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x20, x0
	add	x2, sp, #8
	mov	w1, #84
	bl	_pci_read_config_byte
	ldr	w8, [x19]
	add	w1, w8, #86
	add	x2, sp, #12
	mov	x0, x20
	bl	_pci_read_config_byte
	ldr	w8, [x21]
	lsl	w8, w8, #2
	mov	w9, #15
	lsl	w8, w9, w8
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	ldr	x8, [x21, #8]
Lloh0:
	adrp	x24, _XFER_UDMA_0@GOTPAGE
Lloh1:
	ldr	x24, [x24, _XFER_UDMA_0@GOTPAGEOFF]
	ldr	x9, [x24]
	add	w1, w25, #68
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
Lloh2:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh3:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	sub	x8, x8, x9
Lloh5:
	adrp	x9, _serverworks_set_dmamode.dma_mode@PAGE
Lloh6:
	add	x9, x9, _serverworks_set_dmamode.dma_mode@PAGEOFF
	ldr	w2, [x9, x8, lsl #2]
	mov	x0, x20
	bl	_pci_write_config_byte
	lsl	w8, w22, w23
	ldp	w9, w2, [sp, #8]
	bic	w8, w9, w8
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	mov	w2, #32
	bl	_pci_write_config_byte
	ldr	x8, [x21, #8]
	ldr	x9, [x24]
	sub	x8, x8, x9
	ldr	w9, [x21]
	lsl	w9, w9, #2
	lsl	x8, x8, x9
	ldr	w9, [sp, #12]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	lsl	w8, w22, w23
	ldr	w9, [sp, #8]
	orr	w8, w9, w8
LBB0_3:
	str	w8, [sp, #8]
	ldr	w8, [x19]
	add	w1, w8, #86
	mov	x0, x20
	bl	_pci_write_config_byte
	ldr	w2, [sp, #8]
	mov	x0, x20
	mov	w1, #84
	bl	_pci_write_config_byte
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @serverworks_set_dmamode.dma_mode
_serverworks_set_dmamode.dma_mode:
	.long	119                             ; 0x77
	.long	33                              ; 0x21
	.long	32                              ; 0x20

	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,8,3              ; @XFER_MW_DMA_0
	.no_dead_strip	_serverworks_set_dmamode
.subsections_via_symbols
