	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function talitos_sg_unmap
_talitos_sg_unmap:                      ## @talitos_sg_unmap
	.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
	movl	%r9d, -44(%rbp)                 ## 4-byte Spill
	movl	%r8d, -64(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r15
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_dev_get_drvdata
	movq	%rax, %rdi
	callq	_has_ftr_sec1
	movl	%eax, %r12d
	movl	(%r14), %r13d
	movl	4(%r14), %ebx
	testl	%r13d, %r13d
	movl	$1, %eax
	cmovel	%eax, %r13d
	testl	%ebx, %ebx
	cmovel	%eax, %ebx
	testq	%r15, %r15
	je	LBB0_4
## %bb.1:
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.2:
	cmpl	$2, %ebx
	jb	LBB0_4
## %bb.3:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movq	16(%r14), %rsi
	addq	%r15, %rsi
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movl	-64(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %edx
	callq	_dma_sync_single_for_device
	addq	8(%r14), %r15
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movq	%r15, %rdx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movl	%r12d, %ecx
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_sg_pcopy_from_buffer
LBB0_4:
	testl	%r12d, %r12d
	setne	%cl
	cmpl	$1, %r13d
	setne	%al
	andb	%cl, %al
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	cmpq	%r15, %rsi
	je	LBB0_11
## %bb.5:
	testb	%al, %al
	jne	LBB0_7
## %bb.6:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_dma_unmap_sg
LBB0_7:
	testl	%r12d, %r12d
	setne	%al
	cmpl	$1, %ebx
	setne	%cl
	testq	%r15, %r15
	je	LBB0_13
## %bb.8:
	andb	%al, %cl
	jne	LBB0_13
## %bb.9:
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%ebx, %edx
	jmp	LBB0_10
LBB0_11:
	testb	%al, %al
	je	LBB0_12
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%r13d, %edx
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dma_unmap_sg                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.no_dead_strip	_talitos_sg_unmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function talitos_sg_unmap
_talitos_sg_unmap:                      ; @talitos_sg_unmap
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x5
	mov	x26, x4
	mov	x19, x3
	mov	x22, x2
	mov	x27, x1
	mov	x20, x0
	bl	_dev_get_drvdata
	bl	_has_ftr_sec1
	mov	x23, x0
	ldp	w8, w9, [x27]
	cmp	w8, #0
	csinc	w24, w8, wzr, ne
	cmp	w9, #0
	csinc	w21, w9, wzr, ne
	cbz	x19, LBB0_4
; %bb.1:
	cbz	w23, LBB0_4
; %bb.2:
	cmp	w21, #2
	b.lo	LBB0_4
; %bb.3:
	ldr	x8, [x27, #16]
	mov	w28, w25
	add	x1, x8, x28
Lloh0:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x2, x26
	bl	_dma_sync_single_for_device
	ldr	x8, [x27, #8]
	add	x2, x8, x28
	mov	x0, x19
	mov	x1, x21
	mov	x3, x26
	mov	x4, x25
	bl	_sg_pcopy_from_buffer
LBB0_4:
	cmp	w24, #1
	ccmp	w23, #0, #4, ne
	cset	w8, ne
	cmp	x22, x19
	b.eq	LBB0_10
; %bb.5:
	tbnz	w8, #0, LBB0_7
; %bb.6:
Lloh3:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x24
	bl	_dma_unmap_sg
LBB0_7:
	cmp	w21, #1
	ccmp	w23, #0, #4, ne
	cset	w8, ne
	cbz	x19, LBB0_11
; %bb.8:
	tbnz	w8, #0, LBB0_11
; %bb.9:
Lloh6:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	b	LBB0_13
LBB0_10:
	tbz	w8, #0, LBB0_12
LBB0_11:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
Lloh9:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x24
LBB0_13:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_dma_unmap_sg
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_talitos_sg_unmap
.subsections_via_symbols
