	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tifm_sd_set_dma_data
_tifm_sd_set_dma_data:                  ## @tifm_sd_set_dma_data
	.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, %rbx
	movq	(%rdi), %rdi
	movl	$1, %r15d
	cmpq	8(%rbx), %rdi
	je	LBB0_19
## %bb.1:
	movq	%rsi, %r13
	movq	32(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_TIFM_DMA_TSIZE@GOTPCREL(%rip), %r14
	movl	(%rsi), %r12d
	imull	(%r14), %r12d
	movl	16(%rbx), %eax
	movq	_DATA_CARRY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_3
## %bb.2:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, 16(%rbx)
	callq	_local_irq_save
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_tifm_sd_bounce_block
	callq	_local_irq_restore
	movq	(%rbx), %rdi
	cmpq	8(%rbx), %rdi
	je	LBB0_19
LBB0_3:
	shlq	$2, %rdi
	addq	8(%r13), %rdi
	callq	_sg_dma_len
	movl	%eax, %ecx
	subl	20(%rbx), %ecx
	je	LBB0_4
## %bb.6:
	cmpl	%r12d, %ecx
	jae	LBB0_8
LBB0_7:
	movq	%r13, %rdi
	movl	(%r13), %esi
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r14d
	movl	20(%rbx), %r13d
	movl	%eax, %r12d
	imull	%esi, %r12d
	jmp	LBB0_9
LBB0_4:
	movl	$0, 20(%rbx)
	movq	(%rbx), %rdi
	incq	%rdi
	movq	%rdi, (%rbx)
	cmpq	8(%rbx), %rdi
	je	LBB0_19
## %bb.5:
	shlq	$2, %rdi
	addq	8(%r13), %rdi
	callq	_sg_dma_len
	movl	%eax, %ecx
	cmpl	%r12d, %ecx
	jb	LBB0_7
LBB0_8:
	movq	%r13, %rdi
	movl	(%r14), %r14d
	movl	20(%rbx), %r13d
LBB0_9:
	addl	%r13d, %r12d
	movl	%r12d, 20(%rbx)
	testl	%r14d, %r14d
	je	LBB0_11
## %bb.10:
	movq	(%rbx), %rbx
	shlq	$2, %rbx
	movq	%rdi, %r12
	addq	8(%rdi), %rbx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_11:
	testl	%ecx, %ecx
	je	LBB0_19
## %bb.12:
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%rdi, %r14
	testl	%eax, 4(%rdi)
	je	LBB0_14
## %bb.13:
	callq	_local_irq_save
	movq	%rbx, %rdi
	movq	%r14, %r12
	movq	%r14, %rsi
	callq	_tifm_sd_bounce_block
	callq	_local_irq_restore
	jmp	LBB0_15
LBB0_14:
	movq	%r14, %r12
	movq	_DATA_CARRY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rbx)
LBB0_15:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	addq	$24, %rbx
	xorl	%r13d, %r13d
	movl	$1, %r14d
LBB0_16:
	leaq	8(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_dbg
	movq	%rbx, %rdi
	callq	_sg_dma_address
	addl	%eax, %r13d
	movq	_SOCK_DMA_ADDRESS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	%r13d, %edi
	callq	_writel
	movq	_MMC_DATA_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%r12), %eax
	shll	$8, %r14d
	movq	_TIFM_DMA_EN@GOTPCREL(%rip), %rcx
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movq	_TIFM_DMA_TX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	orl	%eax, %r14d
	orl	(%rcx), %r14d
	movq	_SOCK_DMA_CONTROL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	movl	%r14d, %edi
	callq	_writel
	xorl	%r15d, %r15d
LBB0_19:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TIFM_DMA_TSIZE,4,2             ## @TIFM_DMA_TSIZE
	.comm	_DATA_CARRY,4,2                 ## @DATA_CARRY
	.comm	_MMC_DATA_WRITE,4,2             ## @MMC_DATA_WRITE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setting dma for %d blocks\n"

	.comm	_SOCK_DMA_ADDRESS,8,3           ## @SOCK_DMA_ADDRESS
	.comm	_TIFM_DMA_TX,4,2                ## @TIFM_DMA_TX
	.comm	_TIFM_DMA_EN,4,2                ## @TIFM_DMA_EN
	.comm	_SOCK_DMA_CONTROL,8,3           ## @SOCK_DMA_CONTROL
	.no_dead_strip	_tifm_sd_set_dma_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tifm_sd_set_dma_data
_tifm_sd_set_dma_data:                  ; @tifm_sd_set_dma_data
	.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
	ldp	x8, x9, [x0]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x0, #32]
Lloh0:
	adrp	x21, _TIFM_DMA_TSIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _TIFM_DMA_TSIZE@GOTPAGEOFF]
	ldr	w24, [x21]
	ldr	w25, [x1]
	ldr	w9, [x0, #16]
Lloh2:
	adrp	x23, _DATA_CARRY@GOTPAGE
Lloh3:
	ldr	x23, [x23, _DATA_CARRY@GOTPAGEOFF]
	ldr	w10, [x23]
	tst	w10, w9
	b.eq	LBB0_3
; %bb.2:
	bic	w8, w9, w10
	str	w8, [x20, #16]
	bl	_local_irq_save
	mov	x0, x20
	mov	x1, x19
	bl	_tifm_sd_bounce_block
	bl	_local_irq_restore
	ldp	x8, x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_14
LBB0_3:
	ldr	x9, [x19, #8]
	add	x0, x9, x8, lsl #2
	bl	_sg_dma_len
	ldr	w8, [x20, #20]
	subs	w0, w0, w8
	b.ne	LBB0_6
; %bb.4:
	str	wzr, [x20, #20]
	ldp	x8, x9, [x20]
	add	x8, x8, #1
	str	x8, [x20]
	cmp	x8, x9
	b.eq	LBB0_14
; %bb.5:
	ldr	x9, [x19, #8]
	add	x0, x9, x8, lsl #2
	bl	_sg_dma_len
LBB0_6:
	mul	w8, w25, w24
	cmp	w0, w8
	b.hs	LBB0_8
; %bb.7:
	ldr	w8, [x19]
	udiv	w21, w0, w8
	ldr	w25, [x20, #20]
	madd	w8, w21, w8, w25
	b	LBB0_9
LBB0_8:
	ldr	w21, [x21]
	ldr	w25, [x20, #20]
	add	w8, w25, w8
LBB0_9:
	str	w8, [x20, #20]
Lloh4:
	adrp	x24, _MMC_DATA_WRITE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _MMC_DATA_WRITE@GOTPAGEOFF]
	cbz	w21, LBB0_11
; %bb.10:
	ldr	x8, [x19, #8]
	ldr	x9, [x20]
	add	x20, x8, x9, lsl #2
	b	LBB0_17
LBB0_11:
	cbz	w0, LBB0_14
; %bb.12:
	ldr	w8, [x19, #4]
	ldr	w9, [x24]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.13:
	bl	_local_irq_save
	mov	x0, x20
	mov	x1, x19
	bl	_tifm_sd_bounce_block
	bl	_local_irq_restore
	b	LBB0_16
LBB0_14:
	mov	w0, #1
	b	LBB0_18
LBB0_15:
	ldr	w8, [x23]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
LBB0_16:
	mov	w25, #0
	add	x20, x20, #24
	mov	w21, #1
LBB0_17:
	add	x0, x22, #8
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_dev_dbg
	mov	x0, x20
	bl	_sg_dma_address
	add	w0, w0, w25
	ldr	x8, [x22]
Lloh8:
	adrp	x9, _SOCK_DMA_ADDRESS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _SOCK_DMA_ADDRESS@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x19, #4]
	ldr	w9, [x24]
Lloh11:
	adrp	x10, _TIFM_DMA_TX@GOTPAGE
Lloh12:
	ldr	x10, [x10, _TIFM_DMA_TX@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
Lloh14:
	adrp	x11, _TIFM_DMA_EN@GOTPAGE
Lloh15:
	ldr	x11, [x11, _TIFM_DMA_EN@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	tst	w9, w8
	csel	w8, wzr, w10, eq
	orr	w8, w8, w21, lsl #8
	orr	w0, w11, w8
	ldr	x8, [x22]
Lloh17:
	adrp	x9, _SOCK_DMA_CONTROL@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SOCK_DMA_CONTROL@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	w0, #0
LBB0_18:
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_TIFM_DMA_TSIZE,4,2             ; @TIFM_DMA_TSIZE
	.comm	_DATA_CARRY,4,2                 ; @DATA_CARRY
	.comm	_MMC_DATA_WRITE,4,2             ; @MMC_DATA_WRITE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setting dma for %d blocks\n"

	.comm	_SOCK_DMA_ADDRESS,8,3           ; @SOCK_DMA_ADDRESS
	.comm	_TIFM_DMA_TX,4,2                ; @TIFM_DMA_TX
	.comm	_TIFM_DMA_EN,4,2                ; @TIFM_DMA_EN
	.comm	_SOCK_DMA_CONTROL,8,3           ; @SOCK_DMA_CONTROL
	.no_dead_strip	_tifm_sd_set_dma_data
.subsections_via_symbols
