	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usdhi6_sg_unmap
_usdhi6_sg_unmap:                       ## @usdhi6_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	32(%rdi), %r13
	testq	%r13, %r13
	je	LBB0_6
## %bb.1:
	movl	%esi, %r15d
	movq	64(%r12), %rax
	movq	(%rax), %rbx
	leaq	56(%r12), %rax
	leaq	24(%rbx), %rcx
	cmpl	$2, (%rbx)
	cmovgeq	%rax, %rcx
	movq	(%rcx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	(%r12), %r14
	cmpl	$0, 16(%rbx)
	jne	LBB0_4
## %bb.2:
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_4
## %bb.3:
	movq	40(%r12), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	subq	%r14, %rdi
	addq	(%rax), %rdi
	movl	48(%r12), %esi
	movq	%r14, %rdx
	callq	_memcpy
	movq	24(%r12), %rdi
	movl	48(%r12), %esi
	addl	%r14d, %esi
	movq	8(%rbx), %rdx
	subq	%r14, %rdx
	callq	_memcpy
LBB0_4:
	movq	%r13, %rdi
	callq	_flush_dcache_page
	movq	%r13, %rdi
	callq	_kunmap
	movq	$0, 32(%r12)
	testl	%r15d, %r15d
	jne	LBB0_6
## %bb.5:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_sg_dma_len
	addq	(%r15), %rax
	movq	8(%r12), %rdx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shlq	%cl, %rdx
	movq	8(%rbx), %rcx
	subq	%r14, %rcx
	addq	%rdx, %rcx
	cmpq	%rcx, %rax
	ja	LBB0_8
LBB0_6:
	movq	16(%r12), %rbx
	testq	%rbx, %rbx
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_flush_dcache_page
	movq	%rbx, %rdi
	callq	_kunmap
	movq	$0, 16(%r12)
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.no_dead_strip	_usdhi6_sg_unmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usdhi6_sg_unmap
_usdhi6_sg_unmap:                       ; @usdhi6_sg_unmap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	ldr	x22, [x0, #32]
	cbz	x22, LBB0_6
; %bb.1:
	mov	x21, x1
	ldr	x8, [x19, #64]
	ldr	x24, [x8]
	ldr	w8, [x24]
	add	x9, x24, #24
	cmp	w8, #1
	mov	x8, x19
	ldr	x20, [x8], #56
	csel	x8, x8, x9, gt
	ldr	x23, [x8]
	ldr	w8, [x24, #16]
	cbnz	w8, LBB0_4
; %bb.2:
	ldr	w8, [x24, #4]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x19, #40]
Lloh3:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	sub	x8, x8, x20
	add	x0, x8, x9
	ldr	w1, [x19, #48]
	mov	x2, x20
	bl	_memcpy
	ldr	x0, [x19, #24]
	ldr	w8, [x19, #48]
	add	w1, w8, w20
	ldr	x8, [x24, #8]
	sub	x2, x8, x20
	bl	_memcpy
LBB0_4:
	mov	x0, x22
	bl	_flush_dcache_page
	mov	x0, x22
	bl	_kunmap
	str	xzr, [x19, #32]
	cbnz	w21, LBB0_6
; %bb.5:
	mov	x0, x23
	bl	_sg_dma_len
	ldr	x8, [x23]
	ldr	x9, [x19, #8]
Lloh6:
	adrp	x10, _PAGE_SHIFT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PAGE_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	lsl	x9, x9, x10
	ldr	x10, [x24, #8]
	sub	x10, x10, x20
	add	x9, x10, x9
	add	x8, x8, x0
	cmp	x8, x9
	b.hi	LBB0_8
LBB0_6:
	ldr	x20, [x19, #16]
	cbz	x20, LBB0_8
; %bb.7:
	mov	x0, x20
	bl	_flush_dcache_page
	mov	x0, x20
	bl	_kunmap
	str	xzr, [x19, #16]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.no_dead_strip	_usdhi6_sg_unmap
.subsections_via_symbols
