	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function rsxx_dma_setup
LCPI0_0:
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	1                               ## 0x1
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
	.byte	0                               ## 0x0
LCPI0_1:
	.quad	8192                            ## 0x2000
	.quad	8192                            ## 0x2000
LCPI0_2:
	.quad	4294963200                      ## 0xfffff000
	.quad	4294963200                      ## 0xfffff000
LCPI0_3:
	.quad	4                               ## 0x4
	.quad	4                               ## 0x4
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_rsxx_dma_setup
	.p2align	4, 0x90
_rsxx_dma_setup:                        ## @rsxx_dma_setup
	.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	%rdi, %r15
	callq	_CARD_TO_DEV
	movl	(%r15), %edx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_info
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	movq	16(%r15), %rdx
	movq	48(%r15), %rcx
	cmpl	$4, %eax
	jae	LBB0_3
## %bb.2:
	xorl	%esi, %esi
	jmp	LBB0_6
LBB0_3:
	movl	%eax, %esi
	andl	$-4, %esi
	movq	%rcx, %xmm0
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movq	%rax, %rdi
	shlq	$4, %rdi
	andq	$-64, %rdi
	leaq	(%rdi,%rdi,4), %rdi
	movdqa	LCPI0_0(%rip), %xmm1            ## xmm1 = [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0]
	xorl	%ebx, %ebx
	movdqa	LCPI0_1(%rip), %xmm2            ## xmm2 = [8192,8192]
	movdqa	LCPI0_2(%rip), %xmm3            ## xmm3 = [4294963200,4294963200]
	movdqa	LCPI0_3(%rip), %xmm4            ## xmm4 = [4,4]
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm1, %xmm5
	psllq	$12, %xmm5
	movdqa	%xmm5, %xmm6
	pand	%xmm3, %xmm5
	paddq	%xmm0, %xmm5
	movq	%xmm5, 72(%rdx,%rbx)
	pextrq	$1, %xmm5, 152(%rdx,%rbx)
	paddq	%xmm2, %xmm6
	pand	%xmm3, %xmm6
	paddq	%xmm0, %xmm6
	movq	%xmm6, 232(%rdx,%rbx)
	pextrq	$1, %xmm6, 312(%rdx,%rbx)
	paddq	%xmm4, %xmm1
	addq	$320, %rbx                      ## imm = 0x140
	cmpq	%rbx, %rdi
	jne	LBB0_4
## %bb.5:
	cmpq	%rax, %rsi
	je	LBB0_8
LBB0_6:
	movq	%rsi, %rdi
	shlq	$12, %rdi
	leaq	(%rsi,%rsi,4), %rbx
	shlq	$4, %rbx
	addq	%rbx, %rdx
	addq	$72, %rdx
	subq	%rsi, %rax
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edi, %esi
	andl	$-4096, %esi                    ## imm = 0xF000
	addq	%rcx, %rsi
	movq	%rsi, (%rdx)
	addq	$4096, %rdi                     ## imm = 0x1000
	addq	$80, %rdx
	decq	%rax
	jne	LBB0_7
LBB0_8:
	movq	$0, 40(%r15)
	movq	%r15, %rdi
	callq	_rsxx_dma_queue_reset
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_25
## %bb.9:
	movq	16(%r15), %rsi
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	8(%r15), %edi
	addq	%rbx, %rsi
	callq	_rsxx_dma_ctrl_init
	testl	%eax, %eax
	jne	LBB0_11
## %bb.24:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	16(%r15), %rsi
	movq	%r15, 64(%rsi,%rbx)
	movl	%r12d, (%rsi,%rbx)
	incq	%r12
	movslq	(%r15), %rax
	addq	$80, %rbx
	cmpq	%rax, %r12
	jl	LBB0_10
LBB0_25:
	movl	$1, 4(%r15)
	cmpq	$0, 32(%r15)
	je	LBB0_27
## %bb.26:
	movq	%r15, %rdi
	callq	_rsxx_dma_configure
	movl	(%r15), %eax
LBB0_27:
	testl	%eax, %eax
	jle	LBB0_28
## %bb.29:
	leaq	24(%r15), %r12
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movl	%ebx, %edi
	callq	_CR_INTR_DMA
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_rsxx_enable_ier_and_isr
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_30
	jmp	LBB0_31
LBB0_11:
	movl	%eax, %r14d
	cmpl	$0, (%r15)
	jle	LBB0_31
## %bb.12:
	movl	$56, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_13 Depth=1
	incq	%r12
	movslq	(%r15), %rax
	addq	$80, %rbx
	cmpq	%rax, %r12
	jge	LBB0_31
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %r13
	movq	(%r13,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=1
	callq	_destroy_workqueue
	movq	$0, (%r13,%rbx)
LBB0_15:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-8(%r13,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_13 Depth=1
	callq	_destroy_workqueue
	movq	$0, -8(%r13,%rbx)
LBB0_17:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-16(%r13,%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_13 Depth=1
	callq	_vfree
LBB0_19:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-24(%r13,%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	8(%r15), %edi
	movq	_STATUS_BUFFER_SIZE8@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-32(%r13,%rbx), %ecx
	callq	_pci_free_consistent
LBB0_21:                                ##   in Loop: Header=BB0_13 Depth=1
	movq	-40(%r13,%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_13 Depth=1
	movl	8(%r15), %edi
	movq	_COMMAND_BUFFER_SIZE8@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-48(%r13,%rbx), %ecx
	callq	_pci_free_consistent
	jmp	LBB0_23
LBB0_28:
	xorl	%r14d, %r14d
LBB0_31:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Initializing %d DMA targets\n"

	.comm	_STATUS_BUFFER_SIZE8,4,2        ## @STATUS_BUFFER_SIZE8
	.comm	_COMMAND_BUFFER_SIZE8,4,2       ## @COMMAND_BUFFER_SIZE8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rsxx_dma_setup                 ; -- Begin function rsxx_dma_setup
	.p2align	2
_rsxx_dma_setup:                        ; @rsxx_dma_setup
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	bl	_CARD_TO_DEV
	ldr	w2, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	ldr	w9, [x19]
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.1:
	ldr	x8, [x19, #48]
	ldr	x10, [x19, #16]
	cmp	w9, #4
	b.hs	LBB0_3
; %bb.2:
	mov	x11, #0
	b	LBB0_6
LBB0_3:
	mov	x12, #0
	and	x11, x9, #0xfffffffc
	lsl	x13, x9, #12
	and	x13, x13, #0xfffffffc000
	add	x14, x10, #232
	mov	w15, #-12288
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	w16, w12, #1, lsl #12           ; =4096
	add	w17, w12, #2, lsl #12           ; =8192
	add	w0, w12, #3, lsl #12            ; =12288
	and	x1, x12, #0xffffc000
	and	x16, x16, x15
	and	x17, x17, #0xffffe000
	and	x0, x0, #0xfffff000
	add	x1, x8, x1
	add	x16, x8, x16
	add	x17, x8, x17
	add	x0, x8, x0
	stur	x1, [x14, #-160]
	stur	x16, [x14, #-80]
	str	x17, [x14]
	str	x0, [x14, #80]
	add	x12, x12, #4, lsl #12           ; =16384
	add	x14, x14, #320
	cmp	x13, x12
	b.ne	LBB0_4
; %bb.5:
	cmp	x11, x9
	b.eq	LBB0_8
LBB0_6:
	lsl	x12, x11, #12
	mov	w13, #80
	madd	x10, x11, x13, x10
	add	x10, x10, #72
	sub	x9, x9, x11
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	and	x11, x12, #0xfffff000
	add	x11, x8, x11
	str	x11, [x10], #80
	add	x12, x12, #1, lsl #12           ; =4096
	subs	x9, x9, #1
	b.ne	LBB0_7
LBB0_8:
	str	xzr, [x19, #40]
	mov	x0, x19
	bl	_rsxx_dma_queue_reset
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	mov	x21, #0
	mov	x22, #0
	ldr	x9, [x19, #16]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #8]
	add	x1, x9, x21
	bl	_rsxx_dma_ctrl_init
	cbnz	w0, LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x9, [x19, #16]
	add	x8, x9, x21
	str	x19, [x8, #64]
	str	w22, [x8]
	add	x22, x22, #1
	ldrsw	x8, [x19]
	add	x21, x21, #80
	cmp	x22, x8
	b.lt	LBB0_10
LBB0_12:
	mov	w9, #1
	str	w9, [x19, #4]
	ldr	x9, [x19, #32]
	cbz	x9, LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_rsxx_dma_configure
	ldr	w8, [x19]
LBB0_14:
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.15:
	mov	w20, #0
	add	x21, x19, #24
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x20
	bl	_CR_INTR_DMA
	mov	x1, x0
	mov	x0, x19
	bl	_rsxx_enable_ier_and_isr
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	add	w20, w20, #1
	ldr	w8, [x19]
	cmp	w20, w8
	b.lt	LBB0_16
LBB0_17:
	mov	w20, #0
LBB0_18:
	mov	x0, x20
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_19:
	mov	x20, x0
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.20:
	mov	x21, #0
	mov	x22, #0
Lloh2:
	adrp	x23, _COMMAND_BUFFER_SIZE8@GOTPAGE
Lloh3:
	ldr	x23, [x23, _COMMAND_BUFFER_SIZE8@GOTPAGEOFF]
Lloh4:
	adrp	x24, _STATUS_BUFFER_SIZE8@GOTPAGE
Lloh5:
	ldr	x24, [x24, _STATUS_BUFFER_SIZE8@GOTPAGEOFF]
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x19]
	add	x21, x21, #80
	cmp	x22, x8
	b.ge	LBB0_18
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x19, #16]
	add	x26, x25, x21
	ldr	x0, [x26, #56]
	cbz	x0, LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	bl	_destroy_workqueue
	str	xzr, [x26, #56]
LBB0_24:                                ;   in Loop: Header=BB0_22 Depth=1
	ldr	x0, [x26, #48]
	cbz	x0, LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_22 Depth=1
	bl	_destroy_workqueue
	str	xzr, [x26, #48]
LBB0_26:                                ;   in Loop: Header=BB0_22 Depth=1
	add	x26, x25, x21
	ldr	x0, [x26, #40]
	cbz	x0, LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_22 Depth=1
	bl	_vfree
LBB0_28:                                ;   in Loop: Header=BB0_22 Depth=1
	ldr	x2, [x26, #32]
	cbz	x2, LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	w0, [x19, #8]
	ldr	w1, [x24]
	add	x8, x25, x21
	ldr	w3, [x8, #24]
	bl	_pci_free_consistent
LBB0_30:                                ;   in Loop: Header=BB0_22 Depth=1
	add	x8, x25, x21
	ldr	x2, [x8, #16]
	cbz	x2, LBB0_21
; %bb.31:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	w0, [x19, #8]
	ldr	w1, [x23]
	ldr	w3, [x8, #8]
	bl	_pci_free_consistent
	b	LBB0_21
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Initializing %d DMA targets\n"

	.comm	_STATUS_BUFFER_SIZE8,4,2        ; @STATUS_BUFFER_SIZE8
	.comm	_COMMAND_BUFFER_SIZE8,4,2       ; @COMMAND_BUFFER_SIZE8
.subsections_via_symbols
