	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usdhi6_sg_map
_usdhi6_sg_map:                         ## @usdhi6_sg_map
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	24(%rdi), %rax
	movq	8(%rax), %r15
	leaq	56(%rdi), %rax
	leaq	16(%r15), %rcx
	cmpl	$2, (%r15)
	cmovgeq	%rax, %rcx
	movq	(%rcx), %r14
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	40(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	movl	%edi, %edx
	xorl	%eax, %eax
	callq	_WARN
	movq	%r14, %rdi
	callq	_sg_dma_len
	movslq	%eax, %rcx
	movq	8(%r15), %rsi
	movq	%rcx, %rdx
	orq	%rsi, %rdx
	shrq	$32, %rdx
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.2:
	movq	%rcx, %rax
	xorl	%edx, %edx
	divq	%rsi
	movq	%rdx, %r12
	jmp	LBB0_3
LBB0_1:
	xorl	%edx, %edx
	divl	%esi
	movl	%edx, %r12d
LBB0_3:
	movq	%r14, %rdi
	callq	_sg_dma_len
	movq	8(%r15), %rcx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movl	%r12d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_WARN
	testq	%rax, %rax
	jne	LBB0_11
## %bb.4:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	subq	-48(%rbp), %rbx                 ## 8-byte Folded Reload
	movq	%rbx, %rax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_5
## %bb.6:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rdx, %r12
	jmp	LBB0_7
LBB0_5:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %r12d
LBB0_7:
	movq	%r14, %rdi
	callq	_sg_page
	movl	%eax, 40(%r13)
	movl	%eax, %edi
	callq	_kmap
	movq	%rax, 32(%r13)
	movq	(%r14), %rcx
	movq	%rcx, (%r13)
	movq	%r12, 8(%r13)
	cmpq	8(%r15), %rbx
	jae	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_usdhi6_blk_bounce
	jmp	LBB0_10
LBB0_9:
	movq	%rax, 16(%r13)
LBB0_10:
	movl	48(%r13), %edi
	callq	_mmc_dev
	movl	%eax, %r15d
	movl	40(%r13), %r12d
	movl	%r12d, %edi
	callq	_page_to_pfn
	movq	24(%r13), %rbx
	movq	32(%r13), %r8
	movq	(%r14), %r9
	movq	(%rbx), %rcx
	movl	(%rcx), %r10d
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edi
	movl	%r12d, %edx
	movl	%eax, %ecx
	pushq	%rbx
	pushq	%r10
	callq	_dev_dbg
	addq	$16, %rsp
	movq	16(%r13), %rbx
	addq	(%r13), %rbx
LBB0_11:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%p not properly unmapped!\n"

L_.str.1:                               ## @.str.1
	.asciz	"SG size %u isn't a multiple of block size %u\n"

L_.str.2:                               ## @.str.2
	.asciz	"Mapped %p (%lx) at %p + %u for CMD%u @ 0x%p\n"

	.no_dead_strip	_usdhi6_sg_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usdhi6_sg_map
_usdhi6_sg_map:                         ; @usdhi6_sg_map
	.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	x19, x0
	ldr	x8, [x0, #24]
	ldr	x22, [x8, #8]
	ldr	w8, [x22]
	add	x9, x0, #56
	add	x10, x22, #16
	cmp	w8, #1
	csel	x8, x9, x10, gt
	ldr	x20, [x8]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	ldr	x25, [x20]
	ldr	x24, [x22, #8]
	ldr	w0, [x0, #40]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x0
	bl	_WARN
	mov	x0, x20
	bl	_sg_dma_len
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	ldr	x9, [x22, #8]
	udiv	x8, x8, x9
	msub	w21, w8, w9, w0
	mov	x0, x20
	bl	_sg_dma_len
	mov	x2, x0
	ldr	x8, [x22, #8]
	str	x8, [sp]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_WARN
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, #0
	b	LBB0_6
LBB0_2:
	sub	x21, x23, x25
	udiv	x8, x21, x24
	msub	x23, x8, x24, x21
	mov	x0, x20
	bl	_sg_page
	str	w0, [x19, #40]
	bl	_kmap
	str	x0, [x19, #32]
	ldr	x8, [x20]
	stp	x8, x23, [x19]
	ldr	x8, [x22, #8]
	cmp	x21, x8
	b.hs	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_usdhi6_blk_bounce
	b	LBB0_5
LBB0_4:
	str	x0, [x19, #16]
LBB0_5:
	ldr	w0, [x19, #48]
	bl	_mmc_dev
	mov	x21, x0
	ldr	w22, [x19, #40]
	mov	x0, x22
	bl	_page_to_pfn
	mov	x3, x0
	ldr	x5, [x20]
	ldp	x7, x4, [x19, #24]
	ldr	x8, [x7]
	ldr	w6, [x8]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_dev_dbg
	ldr	x8, [x19, #16]
	ldr	x9, [x19]
	add	x0, x8, x9
LBB0_6:
	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 AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%p not properly unmapped!\n"

l_.str.1:                               ; @.str.1
	.asciz	"SG size %u isn't a multiple of block size %u\n"

l_.str.2:                               ; @.str.2
	.asciz	"Mapped %p (%lx) at %p + %u for CMD%u @ 0x%p\n"

	.no_dead_strip	_usdhi6_sg_map
.subsections_via_symbols
