	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function port_fops_splice_write
_port_fops_splice_write:                ## @port_fops_splice_write
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	8(%rsi), %r14
	movq	%rcx, -104(%rbp)
	movl	%r8d, -96(%rbp)
	leaq	-72(%rbp), %rax
	movq	%rax, -88(%rbp)
	movl	(%rdx), %eax
	movl	%eax, -80(%rbp)
	callq	_pipe_lock
	cmpq	$0, (%r13)
	je	LBB0_1
## %bb.2:
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_wait_port_writable
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	(%r14), %edi
	movq	(%r13), %rdx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_alloc_buf
	testq	%rax, %rax
	je	LBB0_5
## %bb.7:
	movq	%rax, %r12
	xorps	%xmm0, %xmm0
	movups	%xmm0, -64(%rbp)
	movq	(%r13), %rsi
	movq	%rsi, -48(%rbp)
	movl	(%rax), %edi
	movl	%edi, -72(%rbp)
	callq	_sg_init_table
	movq	_pipe_to_sg@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-104(%rbp), %rsi
	movq	%r13, %rdi
	callq	___splice_from_pipe
	movl	%eax, %r15d
	movq	%r13, %rdi
	callq	_pipe_unlock
	xorl	%edi, %edi
	testl	%r15d, %r15d
	setg	%dil
	callq	_likely
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movl	(%r12), %esi
	movq	-64(%rbp), %rcx
	movq	-56(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r12, %r8
	movl	$1, %r9d
	callq	___send_to_port
	movl	%eax, %r15d
LBB0_9:
	xorl	%edi, %edi
	testl	%r15d, %r15d
	setle	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	-72(%rbp), %edi
	callq	_kfree
	jmp	LBB0_11
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_6
LBB0_3:
	movl	%eax, %r15d
	jmp	LBB0_6
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_6:
	movq	%r13, %rdi
	callq	_pipe_unlock
LBB0_11:
	movl	%r15d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_pipe_to_sg,4,2                 ## @pipe_to_sg
	.no_dead_strip	_port_fops_splice_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function port_fops_splice_write
_port_fops_splice_write:                ; @port_fops_splice_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	mov	x21, x1
	mov	x19, x0
	ldr	x20, [x1, #8]
	str	x3, [sp]
	str	w4, [sp, #8]
	add	x8, sp, #32
	str	x8, [sp, #16]
	ldr	w8, [x2]
	str	w8, [sp, #24]
	bl	_pipe_lock
	ldr	x8, [x19]
	cbz	x8, LBB0_7
; %bb.1:
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _O_NONBLOCK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_NONBLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w1, w9, w8
	mov	x0, x20
	bl	_wait_port_writable
	tbnz	w0, #31, LBB0_8
; %bb.2:
	ldr	w0, [x20]
	ldr	x2, [x19]
	mov	w1, #0
	bl	_alloc_buf
	cbz	x0, LBB0_9
; %bb.3:
	mov	x22, x0
	stp	xzr, xzr, [sp, #40]
	ldr	x1, [x19]
	str	x1, [sp, #56]
	ldr	w0, [x0]
	str	w0, [sp, #32]
	bl	_sg_init_table
Lloh3:
	adrp	x8, _pipe_to_sg@GOTPAGE
Lloh4:
	ldr	x8, [x8, _pipe_to_sg@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x1, sp
	mov	x0, x19
	bl	___splice_from_pipe
	mov	x21, x0
	mov	x0, x19
	bl	_pipe_unlock
	cmp	w21, #0
	cset	w0, gt
	bl	_likely
	cbz	x0, LBB0_5
; %bb.4:
	ldr	w1, [x22]
	ldp	x3, x2, [sp, #40]
	mov	x0, x20
	mov	x4, x22
	mov	w5, #1
	bl	___send_to_port
	mov	x21, x0
LBB0_5:
	cmp	w21, #1
	cset	w0, lt
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.6:
	ldr	w0, [sp, #32]
	bl	_kfree
	b	LBB0_11
LBB0_7:
	mov	w21, #0
	b	LBB0_10
LBB0_8:
	mov	x21, x0
	b	LBB0_10
LBB0_9:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x19
	bl	_pipe_unlock
LBB0_11:
	mov	x0, x21
	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
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_pipe_to_sg,4,2                 ; @pipe_to_sg
	.no_dead_strip	_port_fops_splice_write
.subsections_via_symbols
