	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ali_set_dma_mode
_ali_set_dma_mode:                      ## @ali_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
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movl	8(%r14), %edi
	callq	_to_pci_dev
	movl	(%rbx), %ebx
	andl	$1, %ebx
	movq	$0, -48(%rbp)
	cmpq	$1, (%r14)
	movl	$87, %r12d
	sbbl	$0, %r12d
	movq	%rax, %r14
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jle	LBB0_2
## %bb.1:
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_pci_read_config_byte
	testl	%ebx, %ebx
	movl	$247, %eax
	movl	$127, %edx
	cmovel	%eax, %edx
	andl	-48(%rbp), %edx
	movq	%rdx, -48(%rbp)
	movq	%r14, %rdi
	movl	%r12d, %esi
	jmp	LBB0_4
LBB0_2:
	movq	_XFER_UDMA_6@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_pci_read_config_byte
	shll	$2, %ebx
	movl	%ebx, %ecx
	xorb	$4, %cl
	movl	$15, %eax
	shll	%cl, %eax
	andl	-48(%rbp), %eax
	movl	$4, %ecx
	subl	%r15d, %ecx
	andl	$7, %ecx
	orq	$8, %rcx
	cmpq	%r15, %r13
	movl	$13, %edx
	cmovneq	%rcx, %rdx
	movl	%ebx, %ecx
	shlq	%cl, %rdx
	orq	%rax, %rdx
	movq	%rdx, -48(%rbp)
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_pci_write_config_byte
	movq	_XFER_UDMA_3@GOTPCREL(%rip), %rax
	cmpq	%r15, (%rax)
	jg	LBB0_5
## %bb.3:
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movl	$75, %esi
	callq	_pci_read_config_byte
	movq	-48(%rbp), %rdx
	orq	$1, %rdx
	movq	%rdx, -48(%rbp)
	movq	%r14, %rdi
	movl	$75, %esi
LBB0_4:
	callq	_pci_write_config_byte
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_XFER_UDMA_6,8,3                ## @XFER_UDMA_6
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_XFER_UDMA_3,8,3                ## @XFER_UDMA_3
	.no_dead_strip	_ali_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 ali_set_dma_mode
_ali_set_dma_mode:                      ; @ali_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	x23, [x0, #8]
	ldr	w0, [x23, #8]
	bl	_to_pci_dev
	mov	x19, x0
	ldr	w8, [x21]
	and	x22, x8, #0x1
	str	xzr, [sp, #8]
	ldr	x8, [x23]
	cmp	x8, #0
	mov	w8, #86
	cinc	w21, w8, ne
Lloh0:
	adrp	x8, _XFER_UDMA_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _XFER_UDMA_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x20
	b.le	LBB0_2
; %bb.1:
	cmp	w22, #0
	mov	w8, #127
	mov	w9, #247
	csel	x20, x9, x8, eq
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_byte
	ldr	x8, [sp, #8]
	and	x2, x8, x20
	str	x2, [sp, #8]
	mov	x0, x19
	mov	x1, x21
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _XFER_UDMA_6@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XFER_UDMA_6@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_byte
	lsl	x8, x22, #2
	eor	w9, w8, #0x4
	mov	w10, #15
	lsl	w9, w10, w9
	ldr	x10, [sp, #8]
	and	x9, x10, x9
	mov	w10, #4
	sub	w10, w10, w20
	mov	w11, #8
	bfxil	x11, x10, #0, #3
	mov	w10, #13
	cmp	x23, x20
	csel	x10, x10, x11, eq
	lsl	x8, x10, x8
	orr	x2, x9, x8
	str	x2, [sp, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
Lloh6:
	adrp	x8, _XFER_UDMA_3@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XFER_UDMA_3@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x8, x20
	b.gt	LBB0_5
; %bb.3:
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #75
	bl	_pci_read_config_byte
	ldr	x8, [sp, #8]
	orr	x2, x8, #0x1
	str	x2, [sp, #8]
	mov	x0, x19
	mov	w1, #75
LBB0_4:
	bl	_pci_write_config_byte
LBB0_5:
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_XFER_UDMA_6,8,3                ; @XFER_UDMA_6
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_XFER_UDMA_3,8,3                ; @XFER_UDMA_3
	.no_dead_strip	_ali_set_dma_mode
.subsections_via_symbols
