	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function svwks_set_dma_mode
_svwks_set_dma_mode:                    ## @svwks_set_dma_mode
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	8(%rdi), %r13
	movl	4(%r13), %edi
	callq	_to_pci_dev
	movq	%rax, %r14
	movl	(%r12), %ebx
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	(%r13), %esi
	orl	$86, %esi
	leaq	-44(%rbp), %rdx
	movq	%rax, %rdi
	callq	_pci_read_config_byte
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	$84, %esi
	callq	_pci_read_config_byte
	shll	$2, %ebx
	andl	$4, %ebx
	movl	$15, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	notl	%edx
	andl	-44(%rbp), %edx
	movl	%edx, -44(%rbp)
	movslq	(%r12), %r9
	movl	$1, %esi
	movl	%r9d, %ecx
	shll	%cl, %esi
	movl	-48(%rbp), %edi
	movl	%edi, %ecx
	btrl	%r9d, %ecx
	movl	%ecx, -48(%rbp)
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%r15d, %ecx
	jle	LBB0_1
## %bb.2:
	movq	_XFER_MW_DMA_0@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edx, %edx
	cmpl	%r15d, %ecx
	jg	LBB0_4
## %bb.3:
	subl	%ecx, %r15d
	movslq	%r15d, %rax
	leaq	_svwks_set_dma_mode.dma_modes(%rip), %rcx
	movl	(%rcx,%rax,4), %edx
	jmp	LBB0_4
LBB0_1:
	subl	%ecx, %r15d
	movslq	%r15d, %r8
	leaq	_svwks_set_dma_mode.udma_modes(%rip), %rcx
	movl	(%rcx,%r8,4), %eax
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%edx, %eax
	movl	%eax, -44(%rbp)
	orl	%esi, %edi
	movl	%edi, -48(%rbp)
	movl	$32, %edx
LBB0_4:
	leaq	_svwks_set_dma_mode.drive_pci2(%rip), %rax
	movl	(%rax,%r9,4), %esi
	movq	%r14, %rdi
	callq	_pci_write_config_byte
	movl	(%r13), %esi
	orl	$86, %esi
	movl	-44(%rbp), %edx
	movq	%r14, %rdi
	callq	_pci_write_config_byte
	movl	-48(%rbp), %edx
	movq	%r14, %rdi
	movl	$84, %esi
	callq	_pci_write_config_byte
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @svwks_set_dma_mode.udma_modes
_svwks_set_dma_mode.udma_modes:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
	.long	4                               ## 0x4
	.long	5                               ## 0x5

	.p2align	2                               ## @svwks_set_dma_mode.dma_modes
_svwks_set_dma_mode.dma_modes:
	.long	119                             ## 0x77
	.long	33                              ## 0x21
	.long	32                              ## 0x20

	.p2align	4                               ## @svwks_set_dma_mode.drive_pci2
_svwks_set_dma_mode.drive_pci2:
	.long	69                              ## 0x45
	.long	68                              ## 0x44
	.long	71                              ## 0x47
	.long	70                              ## 0x46

	.comm	_XFER_UDMA_0,4,2                ## @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,4,2              ## @XFER_MW_DMA_0
	.no_dead_strip	_svwks_set_dma_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function svwks_set_dma_mode
_svwks_set_dma_mode:                    ; @svwks_set_dma_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0, #8]
	ldr	w0, [x22, #4]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w23, [x21]
	str	xzr, [sp, #8]
	ldr	w8, [x22]
	mov	w9, #86
	orr	w1, w8, w9
	add	x2, sp, #8
	bl	_pci_read_config_byte
	add	x2, sp, #12
	mov	x0, x19
	mov	w1, #84
	bl	_pci_read_config_byte
	ubfiz	w9, w23, #2, #1
	mov	w8, #15
	lsl	w8, w8, w9
	ldp	w10, w12, [sp, #8]
	bic	w10, w10, w8
	ldr	w8, [x21]
	sxtw	x8, w8
	mov	w11, #1
	lsl	w11, w11, w8
	bic	w13, w12, w11
	stp	w10, w13, [sp, #8]
Lloh0:
	adrp	x13, _XFER_UDMA_0@GOTPAGE
Lloh1:
	ldr	x13, [x13, _XFER_UDMA_0@GOTPAGEOFF]
Lloh2:
	ldr	w13, [x13]
	cmp	w13, w20
	b.le	LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, _XFER_MW_DMA_0@GOTPAGE
Lloh4:
	ldr	x9, [x9, _XFER_MW_DMA_0@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, w20
	b.le	LBB0_4
; %bb.2:
	mov	w2, #0
	b	LBB0_5
LBB0_3:
	sub	w13, w20, w13
Lloh6:
	adrp	x14, _svwks_set_dma_mode.udma_modes@PAGE
Lloh7:
	add	x14, x14, _svwks_set_dma_mode.udma_modes@PAGEOFF
	ldr	w13, [x14, w13, sxtw #2]
	lsl	w9, w13, w9
	orr	w9, w9, w10
	str	w9, [sp, #8]
	orr	w9, w12, w11
	str	w9, [sp, #12]
	mov	w2, #32
	b	LBB0_5
LBB0_4:
	sub	w9, w20, w9
Lloh8:
	adrp	x10, _svwks_set_dma_mode.dma_modes@PAGE
Lloh9:
	add	x10, x10, _svwks_set_dma_mode.dma_modes@PAGEOFF
	ldr	w2, [x10, w9, sxtw #2]
LBB0_5:
Lloh10:
	adrp	x9, _svwks_set_dma_mode.drive_pci2@PAGE
Lloh11:
	add	x9, x9, _svwks_set_dma_mode.drive_pci2@PAGEOFF
	ldr	w1, [x9, x8, lsl #2]
	mov	x0, x19
	bl	_pci_write_config_byte
	ldr	w8, [x22]
	mov	w9, #86
	orr	w1, w8, w9
	ldr	w2, [sp, #8]
	mov	x0, x19
	bl	_pci_write_config_byte
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	w1, #84
	bl	_pci_write_config_byte
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @svwks_set_dma_mode.udma_modes
_svwks_set_dma_mode.udma_modes:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.long	4                               ; 0x4
	.long	5                               ; 0x5

	.p2align	2                               ; @svwks_set_dma_mode.dma_modes
_svwks_set_dma_mode.dma_modes:
	.long	119                             ; 0x77
	.long	33                              ; 0x21
	.long	32                              ; 0x20

	.p2align	2                               ; @svwks_set_dma_mode.drive_pci2
_svwks_set_dma_mode.drive_pci2:
	.long	69                              ; 0x45
	.long	68                              ; 0x44
	.long	71                              ; 0x47
	.long	70                              ; 0x46

	.comm	_XFER_UDMA_0,4,2                ; @XFER_UDMA_0
	.comm	_XFER_MW_DMA_0,4,2              ; @XFER_MW_DMA_0
	.no_dead_strip	_svwks_set_dma_mode
.subsections_via_symbols
