	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_test_map_sg
_mmc_test_map_sg:                       ## @mmc_test_map_sg
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movl	%r8d, %ebx
	movl	%ecx, %r12d
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rdx, %rdi
	movl	%r8d, %esi
	callq	_sg_init_table
	movq	%r15, %rdi
	movl	24(%rbp), %eax
	cmpl	%ebx, %eax
	cmovbl	%eax, %ebx
	movq	16(%rbp), %rax
	movl	$0, (%rax)
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movslq	%ebx, %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movl	%r14d, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	(%r15), %eax
	xorl	%r8d, %r8d
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, -60(%rbp)                ## 4-byte Spill
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	testl	%eax, %eax
	je	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	8(%rdi), %rax
	movzbl	(%rax,%rbx), %ecx
	shlq	%cl, %r15
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, %rcx
	orq	%rsi, %rcx
	shrq	$32, %rcx
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=2
	xorl	%edx, %edx
	divq	%rsi
	cmpq	%r15, %rax
	jae	LBB0_16
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	%rax, %rdi
	movl	$512, %esi                      ## imm = 0x200
	movq	%r8, %r14
	callq	_ALIGN
	movq	%r14, %r8
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %r15
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, %r15
	cmovaeq	%rax, %r15
	cmpq	-80(%rbp), %r15                 ## 8-byte Folded Reload
	jb	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	-80(%rbp), %r15                 ## 8-byte Reload
LBB0_18:                                ##   in Loop: Header=BB0_10 Depth=2
	movq	-104(%rbp), %r14                ## 8-byte Reload
	testq	%r8, %r8
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	%r8, %rdi
	callq	_sg_next
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %r14
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=2
	testq	%r14, %r14
	je	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_10 Depth=2
	movq	8(%rdi), %rax
	movl	8(%rax,%rbx), %esi
	movq	%rdi, %r13
	movq	%r14, %rdi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_sg_set_page
	movq	16(%rbp), %rax
	incl	(%rax)
	subq	%r15, -56(%rbp)                 ## 8-byte Folded Spill
	je	LBB0_23
## %bb.3:                               ##   in Loop: Header=BB0_10 Depth=2
	incq	%r12
	movl	(%r13), %eax
	addq	$16, %rbx
	movq	%r14, %r8
	cmpq	%rax, %r12
	movq	%r13, %rdi
	jb	LBB0_10
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_10 Depth=2
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	-44(%rbp)                       ## 4-byte Folded Reload
                                        ## kill: def $eax killed $eax def $rax
	cmpq	%r15, %rax
	jb	LBB0_15
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	testl	%r12d, %r12d
	jne	LBB0_6
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %r8
	movl	-60(%rbp), %r12d                ## 4-byte Reload
	testl	%r12d, %r12d
	je	LBB0_7
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	jne	LBB0_1
LBB0_7:
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_8
LBB0_21:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_26
LBB0_23:
	movq	%r14, %r8
LBB0_24:
	movq	%r8, %rdi
	callq	_sg_mark_end
LBB0_25:
	xorl	%eax, %eax
LBB0_26:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	testq	%r8, %r8
	jne	LBB0_24
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mmc_test_map_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmc_test_map_sg
_mmc_test_map_sg:                       ; @mmc_test_map_sg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x7
	mov	x19, x6
	mov	x26, x5
	mov	x27, x4
	mov	x20, x3
	mov	x22, x1
	mov	x23, x0
	str	x2, [sp, #24]                   ; 8-byte Folded Spill
	mov	x0, x2
	mov	x1, x4
	bl	_sg_init_table
	mov	x24, #0
	cmp	w25, w27
	csel	w8, w25, w27, lo
	str	wzr, [x19]
	sxtw	x27, w8
	mov	w28, w26
	ldr	w8, [x23]
	str	x22, [sp, #16]                  ; 8-byte Folded Spill
	str	w20, [sp, #12]                  ; 4-byte Folded Spill
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_3 Depth 2
	cbz	w8, LBB0_12
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x20, #0
	mov	x21, #0
LBB0_3:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x23, #8]
	ldr	x9, [x9, x20]
	lsl	x0, x8, x9
	cbz	w27, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	x8, [sp, #16]                   ; 8-byte Folded Reload
	udiv	x8, x8, x27
	cmp	x8, x0
	b.hs	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=2
	mov	x0, x8
	mov	w1, #512
	bl	_ALIGN
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=2
	cmp	x0, x22
	csel	x8, x0, x22, lo
	cmp	x8, x28
	csel	x26, x8, x28, lo
	ldr	x25, [sp, #24]                  ; 8-byte Folded Reload
	cbz	x24, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=2
	mov	x0, x24
	bl	_sg_next
	mov	x25, x0
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=2
	cbz	x25, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=2
	ldr	x8, [x23, #8]
	add	x8, x8, x20
	ldr	w1, [x8, #8]
	mov	x0, x25
	mov	x2, x26
	mov	w3, #0
	bl	_sg_set_page
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	subs	x22, x22, x26
	b.eq	LBB0_16
; %bb.10:                               ;   in Loop: Header=BB0_3 Depth=2
	add	x21, x21, #1
	ldr	w8, [x23]
	add	x20, x20, #16
	mov	x24, x25
	cmp	x21, x8
	b.lo	LBB0_3
; %bb.11:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	x24, x25
	ldr	w20, [sp, #12]                  ; 4-byte Folded Reload
LBB0_12:                                ;   in Loop: Header=BB0_1 Depth=1
	cbz	w20, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_1 Depth=1
	cbnz	x22, LBB0_1
LBB0_14:
	cbz	x22, LBB0_20
LBB0_15:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_19
LBB0_16:
	mov	x24, x25
LBB0_17:
	mov	x0, x24
	bl	_sg_mark_end
LBB0_18:
	mov	w0, #0
LBB0_19:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_20:
	cbnz	x24, LBB0_17
	b	LBB0_18
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mmc_test_map_sg
.subsections_via_symbols
