	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cmd64x_set_dmamode
_cmd64x_set_dmamode:                    ## @cmd64x_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	$40, %rsp
	.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), %rax
	movl	(%rax), %edi
	callq	_to_pci_dev
	movq	%rax, %r12
	movq	_UDIDETCR0@GOTPCREL(%rip), %rax
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %esi
	shll	$3, %esi
	movl	(%rax), %r13d
	addl	%esi, %r13d
	movq	_BMIDESR0@GOTPCREL(%rip), %rax
	addl	(%rax), %esi
	movl	(%r15), %r14d
	addl	%r14d, %r14d
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	callq	_pci_read_config_byte
	leaq	-48(%rbp), %rdx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movq	%r12, %rdi
	movq	%r15, %r12
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movl	%r13d, %esi
	callq	_pci_read_config_byte
	movl	(%r15), %r9d
	movl	$32, %r15d
	movl	$32, %edi
	movl	%r9d, %ecx
	shll	%cl, %edi
	movl	%edi, %esi
	notl	%esi
	andl	-44(%rbp), %esi
	movl	%esi, -44(%rbp)
	movl	$48, %ebx
	movl	%r14d, %ecx
	shll	%cl, %ebx
	movl	$5, %edx
	movl	%r9d, %ecx
	shll	%cl, %edx
	orl	%ebx, %edx
	notl	%edx
	andl	-48(%rbp), %edx
	movq	8(%r12), %rbx
	movq	_XFER_UDMA_0@GOTPCREL(%rip), %r8
	movq	%rbx, %rcx
	subq	(%r8), %rcx
	jge	LBB0_1
## %bb.3:
	btrl	%r9d, %edx
	movl	%edx, -48(%rbp)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_cmd64x_set_timing
	movb	(%r12), %cl
	movl	-44(%rbp), %esi
	movl	-48(%rbp), %edx
	shll	%cl, %r15d
	movl	%r15d, %edi
	jmp	LBB0_4
LBB0_1:
	leaq	_cmd64x_set_dmamode.udma_data(%rip), %rax
	movl	(%rax,%rcx,4), %eax
	movl	%r14d, %ecx
	shll	%cl, %eax
	btsl	%r9d, %edx
	orl	%eax, %edx
	movl	%edx, -48(%rbp)
	movq	_XFER_UDMA_2@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jle	LBB0_4
## %bb.2:
	movl	$4, %eax
	movl	%r9d, %ecx
	shll	%cl, %eax
	orl	%eax, %edx
	movl	%edx, -48(%rbp)
LBB0_4:
	orl	%esi, %edi
	movl	%edi, -44(%rbp)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	-56(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_byte
	movl	-44(%rbp), %edx
	movq	%rbx, %rdi
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_pci_write_config_byte
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @cmd64x_set_dmamode.udma_data
_cmd64x_set_dmamode.udma_data:
	.long	48                              ## 0x30
	.long	32                              ## 0x20
	.long	16                              ## 0x10
	.long	32                              ## 0x20
	.long	16                              ## 0x10
	.long	0                               ## 0x0

	.comm	_UDIDETCR0,4,2                  ## @UDIDETCR0
	.comm	_BMIDESR0,4,2                   ## @BMIDESR0
	.comm	_XFER_UDMA_0,8,3                ## @XFER_UDMA_0
	.comm	_XFER_UDMA_2,8,3                ## @XFER_UDMA_2
	.no_dead_strip	_cmd64x_set_dmamode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cmd64x_set_dmamode
_cmd64x_set_dmamode:                    ; @cmd64x_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	x22, x1
	mov	x23, x0
	ldr	x8, [x0, #8]
	ldr	w0, [x8]
	bl	_to_pci_dev
	mov	x19, x0
Lloh0:
	adrp	x8, _UDIDETCR0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UDIDETCR0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x23]
	lsl	w9, w9, #3
	add	w21, w9, w8
Lloh3:
	adrp	x8, _BMIDESR0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BMIDESR0@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	w20, w8, w9
	ldr	w8, [x22]
	lsl	w24, w8, #1
	add	x2, sp, #8
	mov	x1, x20
	bl	_pci_read_config_byte
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_pci_read_config_byte
	ldr	w11, [x22]
	mov	w25, #32
	lsl	w10, w25, w11
	ldp	w8, w12, [sp, #8]
	bic	w9, w8, w10
	str	w9, [sp, #8]
	mov	w8, #48
	lsl	w8, w8, w24
	mov	w13, #5
	lsl	w13, w13, w11
	orr	w8, w13, w8
	bic	w12, w12, w8
	ldr	x8, [x22, #8]
Lloh6:
	adrp	x13, _XFER_UDMA_0@GOTPAGE
Lloh7:
	ldr	x13, [x13, _XFER_UDMA_0@GOTPAGEOFF]
Lloh8:
	ldr	x13, [x13]
	subs	x13, x8, x13
	b.ge	LBB0_2
; %bb.1:
	mov	w9, #1
	lsl	w9, w9, w11
	bic	w9, w12, w9
	str	w9, [sp, #12]
	mov	x0, x23
	mov	x1, x22
	mov	x2, x8
	bl	_cmd64x_set_timing
	ldr	w8, [x22]
	ldp	w9, w2, [sp, #8]
	lsl	w10, w25, w8
	b	LBB0_4
LBB0_2:
Lloh9:
	adrp	x14, _cmd64x_set_dmamode.udma_data@PAGE
Lloh10:
	add	x14, x14, _cmd64x_set_dmamode.udma_data@PAGEOFF
	ldr	w13, [x14, x13, lsl #2]
	lsl	w13, w13, w24
	mov	w14, #1
	lsl	w14, w14, w11
	orr	w12, w12, w14
	orr	w2, w12, w13
	str	w2, [sp, #12]
Lloh11:
	adrp	x12, _XFER_UDMA_2@GOTPAGE
Lloh12:
	ldr	x12, [x12, _XFER_UDMA_2@GOTPAGEOFF]
Lloh13:
	ldr	x12, [x12]
	cmp	x8, x12
	b.le	LBB0_4
; %bb.3:
	mov	w8, #4
	lsl	w8, w8, w11
	orr	w2, w2, w8
	str	w2, [sp, #12]
LBB0_4:
	orr	w8, w9, w10
	str	w8, [sp, #8]
	mov	x0, x19
	mov	x1, x21
	bl	_pci_write_config_byte
	ldr	w2, [sp, #8]
	mov	x0, x19
	mov	x1, x20
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @cmd64x_set_dmamode.udma_data
_cmd64x_set_dmamode.udma_data:
	.long	48                              ; 0x30
	.long	32                              ; 0x20
	.long	16                              ; 0x10
	.long	32                              ; 0x20
	.long	16                              ; 0x10
	.long	0                               ; 0x0

	.comm	_UDIDETCR0,4,2                  ; @UDIDETCR0
	.comm	_BMIDESR0,4,2                   ; @BMIDESR0
	.comm	_XFER_UDMA_0,8,3                ; @XFER_UDMA_0
	.comm	_XFER_UDMA_2,8,3                ; @XFER_UDMA_2
	.no_dead_strip	_cmd64x_set_dmamode
.subsections_via_symbols
