	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_sham_copy_sg_lists
_omap_sham_copy_sg_lists:               ## @omap_sham_copy_sg_lists
	.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
	movl	%ecx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	%rsi, %rdi
	callq	_sg_nents
	movl	%eax, %ebx
	movl	(%r12), %r14d
	cmpl	$1, 4(%r12)
	sbbl	$-1, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movl	$8, %esi
	callq	_kmalloc_array
	movq	%rax, 24(%r12)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rdi
	movl	%ebx, %esi
	callq	_sg_init_table
	movq	%r12, %rbx
	movq	24(%r12), %r12
	movq	$0, 16(%rbx)
	movl	4(%rbx), %edx
	testl	%edx, %edx
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_4
## %bb.3:
	movq	8(%rbx), %rax
	movl	4(%rax), %esi
	movq	%r12, %rdi
	callq	_sg_set_buf
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	incq	16(%rbx)
LBB0_4:
	testq	%r13, %r13
	je	LBB0_12
	.p2align	4, 0x90
## %bb.5:
	testl	%r15d, %r15d
	je	LBB0_12
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r14d, %eax
	movl	(%r13), %ebx
	subl	%ebx, %r14d
	subl	%eax, %ebx
	testl	%r14d, %r14d
	movl	$0, %ecx
	cmovlel	%ecx, %r14d
	testl	%eax, %eax
	cmovel	%eax, %r14d
	cmpl	%ebx, %r15d
	cmovll	%r15d, %ebx
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	callq	_sg_page
	movl	4(%r13), %ecx
	movq	%r12, %rdi
	movl	%eax, %esi
	movl	%ebx, %edx
	callq	_sg_set_page
	subl	%ebx, %r15d
	jg	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	callq	_sg_mark_end
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	callq	_sg_next
	movq	%rax, %r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incq	16(%rax)
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r13, %rdi
	callq	_sg_next
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, %r13
	testl	%r15d, %r15d
	jne	LBB0_6
LBB0_12:
	movq	_FLAGS_SGS_ALLOCED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	8(%rbx), %rsi
	callq	_set_bit
	movl	$0, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_FLAGS_SGS_ALLOCED,4,2          ## @FLAGS_SGS_ALLOCED
	.no_dead_strip	_omap_sham_copy_sg_lists
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_sham_copy_sg_lists
_omap_sham_copy_sg_lists:               ; @omap_sham_copy_sg_lists
	.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	x20, x3
	mov	x21, x1
	mov	x19, x0
	mov	x0, x1
	bl	_sg_nents
	ldp	w24, w8, [x19]
	cmp	w8, #0
	cinc	w22, w0, ne
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #8
	bl	_kmalloc_array
	str	x0, [x19, #24]
	cbz	x0, LBB0_12
; %bb.1:
	mov	x1, x22
	bl	_sg_init_table
	ldr	x22, [x19, #24]
	str	xzr, [x19, #16]
	ldr	w2, [x19, #4]
	cbz	w2, LBB0_3
; %bb.2:
	ldr	x8, [x19, #8]
	ldr	w1, [x8, #4]
	mov	x0, x22
	bl	_sg_set_buf
	mov	x0, x22
	bl	_sg_next
	mov	x22, x0
	ldr	x8, [x19, #16]
	add	x8, x8, #1
	str	x8, [x19, #16]
LBB0_3:
	cbz	x21, LBB0_11
; %bb.4:
	cbz	w20, LBB0_11
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x21]
	sub	w9, w8, w24
	sub	w8, w24, w8
	cmp	w8, #0
	csel	w8, w8, wzr, gt
	cmp	w24, #0
	csel	w24, wzr, w8, eq
	cmp	w20, w9
	csel	w23, w20, w9, lt
	cmp	w23, #1
	b.lt	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	sub	w20, w20, w23
	mov	x0, x21
	bl	_sg_page
	mov	x1, x0
	ldr	w3, [x21, #4]
	mov	x0, x22
	mov	x2, x23
	bl	_sg_set_page
	cmp	w20, #0
	b.gt	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_sg_mark_end
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_sg_next
	mov	x22, x0
	ldr	x8, [x19, #16]
	add	x8, x8, #1
	str	x8, [x19, #16]
LBB0_9:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	bl	_sg_next
	cbz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x21, x0
	cbnz	w20, LBB0_5
LBB0_11:
Lloh3:
	adrp	x8, _FLAGS_SGS_ALLOCED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FLAGS_SGS_ALLOCED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	x1, [x19, #8]
	bl	_set_bit
	mov	w0, #0
	str	wzr, [x19, #4]
	b	LBB0_13
LBB0_12:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	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	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_FLAGS_SGS_ALLOCED,4,2          ; @FLAGS_SGS_ALLOCED
	.no_dead_strip	_omap_sham_copy_sg_lists
.subsections_via_symbols
