	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmc_test_map_sg_max_scatter
_mmc_test_map_sg_max_scatter:           ## @mmc_test_map_sg_max_scatter
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r14
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r15
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %ebx
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rdi
	movl	%ecx, %esi
	callq	_sg_init_table
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	movl	$0, (%r14)
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	testb	$1, %r8b
	jne	LBB0_18
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_6 Depth 3
	movq	8(%r12), %rax
	decl	%ebx
	movl	4(%rax,%rbx,8), %edi
	callq	_page_address
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	sete	%r8b
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_15
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rax, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rdx
	addq	%r14, %rdx
	movq	8(%r12), %rcx
	movb	(%rcx,%rbx,8), %cl
	movl	$1, %esi
	shll	%cl, %esi
	movq	%r14, %rcx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_5:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_6 Depth 3
	movl	%esi, %ebx
	decl	%esi
	imull	%r13d, %esi
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	addq	$-1, %rbx
	jae	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=3
	movl	%esi, %r14d
	addq	%r15, %r14
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=3
	subl	%r13d, %esi
	cmpq	%r14, %rdx
	je	LBB0_6
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=2
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, %r13d
	cmovael	%eax, %r13d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%r13, %rax
	cmovbq	%rax, %r13
	movq	-88(%rbp), %r12                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	callq	_sg_next
	movq	%rax, %r12
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=2
	testq	%r12, %r12
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r14, %rdi
	callq	_virt_to_page
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%r13, %rdx
	xorl	%ecx, %ecx
	callq	_sg_set_page
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	(%r14,%rax), %rdx
	movq	%r14, %rcx
	movl	%ebx, %esi
	movq	%r12, %rdi
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	subq	%r13, -56(%rbp)                 ## 8-byte Folded Spill
	sete	%r8b
	movl	%eax, %r13d
	jne	LBB0_5
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	%rcx, %r14
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	testl	%ebx, %ebx
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jne	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %ebx
	jmp	LBB0_17
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_20
LBB0_18:
	xorl	%ebx, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_20
## %bb.19:
	callq	_sg_mark_end
	jmp	LBB0_20
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_20:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_mmc_test_map_sg_max_scatter
.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_max_scatter
_mmc_test_map_sg_max_scatter:           ; @mmc_test_map_sg_max_scatter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x5
	str	w4, [sp, #4]                    ; 4-byte Folded Spill
	mov	x22, x1
	mov	x23, x0
	ldr	w28, [x0]
	str	x2, [sp, #8]                    ; 8-byte Folded Spill
	mov	x0, x2
	mov	x1, x3
	bl	_sg_init_table
	str	wzr, [x19]
	cbz	x22, LBB0_18
; %bb.1:
	mov	x24, #0
	mov	x25, #0
Lloh0:
	adrp	x20, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	tbnz	w8, #0, LBB0_16
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
                                        ;       Child Loop BB0_6 Depth 3
	ldr	x8, [x23, #8]
	sub	w28, w28, #1
	add	x8, x8, w28, uxtw #3
	ldr	w0, [x8, #4]
	bl	_page_address
	cmp	x22, #0
	cset	w8, eq
	cbz	x22, LBB0_14
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x26, x0
	ldr	w10, [x20]
	add	x9, x24, x10
	ldr	x11, [x23, #8]
	lsl	x12, x28, #3
	ldr	w11, [x11, x12]
	mov	w12, #1
	lsl	w12, w12, w11
                                        ; kill: def $w10 killed $w10 killed $x10 def $x10
	mov	x11, x24
	mov	x0, x25
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_6 Depth 3
	mov	w21, w12
	sub	w12, w12, #1
	mul	w12, w10, w12
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ;     Parent Loop BB0_5 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	sub	x21, x21, #1
	cmn	x21, #1
	b.eq	LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=3
	add	x24, x26, w12, uxtw
	cbz	x11, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=3
	sub	w12, w12, w10
	cmp	x9, x24
	b.eq	LBB0_6
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=2
	ldr	w8, [sp, #4]                    ; 4-byte Folded Reload
	cmp	w10, w8
	csel	w8, w10, w8, lo
	cmp	x22, x8
	csel	x27, x22, x8, lo
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	cbz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	bl	_sg_next
	mov	x25, x0
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=2
	cbz	x25, LBB0_19
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x24
	bl	_virt_to_page
	mov	x1, x0
	mov	x0, x25
	mov	x2, x27
	mov	w3, #0
	bl	_sg_set_page
	subs	x22, x22, x27
	ldr	w8, [x19]
	add	w8, w8, #1
	str	w8, [x19]
	cset	w8, eq
	ldr	w10, [x20]
	add	x9, x24, x10
	mov	x11, x24
	mov	x12, x21
	mov	x0, x25
	cbnz	x22, LBB0_5
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, x0
	mov	x24, x11
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	w28, LBB0_2
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w28, [x23]
	b	LBB0_2
LBB0_16:
	cbz	x25, LBB0_18
; %bb.17:
	mov	x0, x25
	bl	_sg_mark_end
LBB0_18:
	mov	w0, #0
	b	LBB0_20
LBB0_19:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_mmc_test_map_sg_max_scatter
.subsections_via_symbols
