	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pipe_to_sg
_pipe_to_sg:                            ## @pipe_to_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdx), %r14
	movq	(%r14), %rax
	xorl	%ebx, %ebx
	cmpq	8(%r14), %rax
	je	LBB0_7
## %bb.1:
	movq	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	8(%rsi), %rax
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_page
	movq	%rax, %rbx
	movq	8(%r15), %rax
	movq	%r13, %rdi
	movq	%r15, %rsi
	movl	$1, %edx
	callq	*8(%rax)
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.5:
	movq	%rbx, %rdi
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	callq	_kmap
	movq	_PAGE_MASK@GOTPCREL(%rip), %rcx
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	(%rcx), %r13d
	notl	%r13d
	andl	4(%r12), %r13d
	movl	(%r12), %ecx
	leal	(%rcx,%r13), %edx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%esi, %ebx
	subl	%r13d, %ebx
	cmpl	%esi, %edx
	cmovbel	%ecx, %ebx
	leaq	(%rax,%r13), %rdi
	movl	(%r15), %esi
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	addq	%r12, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_kunmap
	movq	8(%r15), %rax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	*16(%rax)
	movq	(%r14), %rdi
	shlq	$2, %rdi
	addq	24(%r14), %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%ebx, %edx
	movl	%r13d, %ecx
	jmp	LBB0_6
LBB0_2:
	movq	16(%r15), %rdi
	callq	_get_page
	movq	16(%r15), %rdi
	callq	_unlock_page
	movl	24(%r15), %edi
	movl	(%r12), %esi
	callq	_min
	movl	%eax, %ebx
	movq	(%r14), %rdi
	shlq	$2, %rdi
	addq	24(%r14), %rdi
	movq	16(%r15), %rsi
	movl	(%r15), %ecx
	movl	%eax, %edx
LBB0_6:
	callq	_sg_set_page
	incq	(%r14)
	addl	%ebx, 16(%r14)
	jmp	LBB0_7
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %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	_PAGE_MASK,4,2                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.no_dead_strip	_pipe_to_sg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pipe_to_sg
_pipe_to_sg:                            ; @pipe_to_sg
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x25, [x2, #8]
	ldp	x8, x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w21, #0
	b	LBB0_8
LBB0_2:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x1, #8]
	ldr	x8, [x8]
	blr	x8
	cbz	x0, LBB0_5
; %bb.3:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_alloc_page
	mov	x22, x0
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #8]
	mov	x0, x20
	mov	x1, x19
	mov	w2, #1
	blr	x8
	cbz	x22, LBB0_7
; %bb.4:
	mov	x23, x0
	mov	x0, x22
	bl	_kmap
Lloh3:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldp	w10, w9, [x21]
	bic	w24, w9, w8
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	sub	w9, w8, w24
	add	w11, w10, w24
	cmp	w11, w8
	csel	w21, w9, w10, hi
	add	x0, x0, x24
	ldr	w8, [x19]
	add	x1, x23, x8
	mov	x2, x21
	bl	_memcpy
	mov	x0, x22
	bl	_kunmap
	ldr	x8, [x19, #8]
	ldr	x8, [x8, #16]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x23
	blr	x8
	ldr	x8, [x25, #24]
	ldr	x9, [x25]
	add	x0, x8, x9, lsl #2
	mov	x1, x22
	mov	x2, x21
	mov	x3, x24
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19, #16]
	bl	_get_page
	ldr	x0, [x19, #16]
	bl	_unlock_page
	ldr	w0, [x19, #24]
	ldr	w1, [x21]
	bl	_min
	mov	x21, x0
	ldr	x8, [x25, #24]
	ldr	x9, [x25]
	add	x0, x8, x9, lsl #2
	ldr	x1, [x19, #16]
	ldr	w3, [x19]
	mov	x2, x21
LBB0_6:
	bl	_sg_set_page
	ldr	x8, [x25]
	add	x8, x8, #1
	str	x8, [x25]
	ldr	w8, [x25, #16]
	add	w8, w8, w21
	str	w8, [x25, #16]
	b	LBB0_8
LBB0_7:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_8:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_MASK,4,2                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.no_dead_strip	_pipe_to_sg
.subsections_via_symbols
