	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fcgi_write                     ## -- Begin function fcgi_write
	.p2align	4, 0x90
_fcgi_write:                            ## @fcgi_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%ecx, %ecx
	jle	LBB0_13
## %bb.1:
	movl	%ecx, %r14d
	movq	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	16(%rdi), %rcx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.2:
	cmpq	%r12, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	callq	_close_packet
	movq	16(%r15), %rcx
LBB0_4:
	movl	(%r15), %edi
	movl	4(%r15), %edx
	subl	%edi, %edx
	xorl	%eax, %eax
	testl	%edx, %edx
	movl	$0, %r13d
	cmovgl	%edx, %r13d
	testq	%rcx, %rcx
	je	LBB0_15
## %bb.5:
	addl	$4, %edx
	movl	%edx, %r13d
	cmpl	%r14d, %r13d
	jg	LBB0_16
LBB0_6:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%r14d, %ebx
	subl	%r13d, %ebx
	js	LBB0_20
## %bb.7:
	movq	%r15, %rdi
	callq	_close_packet
	xorl	%ecx, %ecx
	cmpl	$65536, %r14d                   ## imm = 0x10000
	jb	LBB0_27
## %bb.8:
	movl	%r14d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_open_packet
	movq	16(%r15), %rdi
	movl	24(%r15), %edx
	movq	%r12, %rsi
	movl	$65528, %ecx                    ## imm = 0xFFF8
	callq	_fcgi_make_header
	movq	$0, 16(%r15)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fcgi_flush
	testl	%eax, %eax
	je	LBB0_35
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	$65528, %edx                    ## imm = 0xFFF8
	callq	_safe_write
	cmpl	$65528, %eax                    ## imm = 0xFFF8
	jne	LBB0_33
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	addq	$65528, %rbx                    ## imm = 0xFFF8
	addq	$-65528, %r13                   ## imm = 0xFFFF0008
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%r13d, %eax
	cmpl	$65535, %eax                    ## imm = 0xFFFF
	jg	LBB0_9
## %bb.12:
	movq	%r13, %rax
	negq	%rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	addl	%r14d, %r13d
	xorl	%ecx, %ecx
	jmp	LBB0_28
LBB0_13:
	xorl	%r14d, %r14d
	jmp	LBB0_19
LBB0_14:
	movl	(%r15), %edi
	movl	4(%r15), %eax
	subl	%edi, %eax
	xorl	%r13d, %r13d
	testl	%eax, %eax
	cmovgl	%eax, %r13d
LBB0_15:
	movb	$1, %al
	cmpl	%r14d, %r13d
	jle	LBB0_6
LBB0_16:
	testb	%al, %al
	je	LBB0_18
## %bb.17:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_open_packet
	movl	(%r15), %edi
LBB0_18:
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	addl	%r14d, (%r15)
	jmp	LBB0_19
LBB0_20:
	testb	%al, %al
	je	LBB0_22
## %bb.21:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_open_packet
LBB0_22:
	testl	%r13d, %r13d
	jle	LBB0_24
## %bb.23:
	movl	(%r15), %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r13d, %edx
	callq	_memcpy
	addl	%r13d, (%r15)
LBB0_24:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fcgi_flush
	testl	%eax, %eax
	je	LBB0_35
## %bb.25:
	cmpl	%r14d, %r13d
	jge	LBB0_19
## %bb.26:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_open_packet
	movl	(%r15), %edi
	movslq	%r13d, %rax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	addq	%rax, %rsi
	jmp	LBB0_32
LBB0_27:
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %r13d
LBB0_28:
	leal	7(%r13), %edx
	andl	$-8, %edx
	movl	%r13d, %eax
	movl	%edx, -64(%rbp)                 ## 4-byte Spill
	subl	%edx, %eax
	leal	8(%rax), %ebx
	cmovel	%ecx, %ebx
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_open_packet
	movq	16(%r15), %rdi
	movl	24(%r15), %edx
	movl	%r13d, %eax
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	subl	%ebx, %eax
	movl	%eax, %ebx
	movq	%r12, %rsi
	movl	%eax, %ecx
	callq	_fcgi_make_header
	movq	$0, 16(%r15)
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_fcgi_flush
	testl	%eax, %eax
	je	LBB0_35
## %bb.29:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	addq	-48(%rbp), %rsi                 ## 8-byte Folded Reload
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_safe_write
	cmpl	%ebx, %eax
	jne	LBB0_33
## %bb.30:
	cmpl	-64(%rbp), %r13d                ## 4-byte Folded Reload
	je	LBB0_19
## %bb.31:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_open_packet
	movl	(%r15), %edi
	movslq	%r14d, %rax
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	addq	%rax, %rsi
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movslq	%ebx, %rax
	subq	%rax, %rsi
LBB0_32:
	movl	%ebx, %edx
	callq	_memcpy
	addl	%ebx, (%r15)
	jmp	LBB0_19
LBB0_33:
	movq	$0, 8(%r15)
LBB0_35:
	movl	$-1, %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fcgi_write                     ; -- Begin function fcgi_write
	.p2align	2
_fcgi_write:                            ; @fcgi_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	cmp	w3, #1
	b.lt	LBB0_13
; %bb.1:
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_14
; %bb.2:
	ldr	x9, [x8]
	cmp	x9, x22
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_close_packet
	ldr	x8, [x20, #16]
LBB0_4:
	ldp	w0, w9, [x20]
	sub	w9, w9, w0
	cmp	w9, #0
	csel	w23, w9, wzr, gt
	cbz	x8, LBB0_15
; %bb.5:
	mov	w8, #0
	add	w23, w9, #4
	cmp	w23, w19
	b.gt	LBB0_16
LBB0_6:
	subs	w24, w19, w23
	b.mi	LBB0_20
; %bb.7:
	mov	x0, x20
	bl	_close_packet
	cmp	w19, #16, lsl #12               ; =65536
	b.lo	LBB0_27
; %bb.8:
	mov	x24, #0
	mov	w25, #65528
	mov	x26, #-65528
	mov	x23, x21
	mov	w27, w19
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x22
	bl	_open_packet
	ldr	x0, [x20, #16]
	ldr	w2, [x20, #24]
	mov	x1, x22
	mov	w3, #65528
	bl	_fcgi_make_header
	str	xzr, [x20, #16]
	mov	x0, x20
	mov	w1, #0
	bl	_fcgi_flush
	cbz	w0, LBB0_33
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x20
	mov	x1, x23
	mov	w2, #65528
	bl	_safe_write
	cmp	w0, w25
	b.ne	LBB0_32
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x23, x23, x25
	add	x24, x24, x26
	add	w8, w27, w24
	cmp	w8, #16, lsl #12                ; =65536
	b.ge	LBB0_9
; %bb.12:
	neg	x26, x24
	add	w25, w19, w24
	b	LBB0_28
LBB0_13:
	mov	w19, #0
	b	LBB0_34
LBB0_14:
	ldp	w0, w8, [x20]
	sub	w8, w8, w0
	cmp	w8, #0
	csel	w23, w8, wzr, gt
LBB0_15:
	mov	w8, #1
	cmp	w23, w19
	b.le	LBB0_6
LBB0_16:
	cbz	w8, LBB0_18
; %bb.17:
	mov	x0, x20
	mov	x1, x22
	bl	_open_packet
	ldr	w0, [x20]
LBB0_18:
	mov	x1, x21
	mov	x2, x19
	bl	_memcpy
	ldr	w8, [x20]
	add	w8, w8, w19
LBB0_19:
	str	w8, [x20]
	b	LBB0_34
LBB0_20:
	cbz	w8, LBB0_22
; %bb.21:
	mov	x0, x20
	mov	x1, x22
	bl	_open_packet
LBB0_22:
	cmp	w23, #1
	b.lt	LBB0_24
; %bb.23:
	ldr	w0, [x20]
	mov	x1, x21
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x20]
	add	w8, w8, w23
	str	w8, [x20]
LBB0_24:
	mov	x0, x20
	mov	w1, #0
	bl	_fcgi_flush
	cbz	w0, LBB0_33
; %bb.25:
	cmp	w23, w19
	b.ge	LBB0_34
; %bb.26:
	mov	x0, x20
	mov	x1, x22
	bl	_open_packet
	ldr	w0, [x20]
	add	x1, x21, w23, sxtw
	mov	x2, x24
	bl	_memcpy
	ldr	w8, [x20]
	add	w8, w8, w24
	b	LBB0_19
LBB0_27:
	mov	x26, #0
	mov	x25, x19
LBB0_28:
	add	w8, w25, #7
	and	w27, w8, #0xfffffff8
	subs	w8, w25, w27
	add	w8, w8, #8
	csel	w23, wzr, w8, eq
	mov	x0, x20
	mov	x1, x22
	bl	_open_packet
	ldr	x0, [x20, #16]
	ldr	w2, [x20, #24]
	sub	w24, w25, w23
	mov	x1, x22
	mov	x3, x24
	bl	_fcgi_make_header
	str	xzr, [x20, #16]
	mov	x0, x20
	mov	w1, #0
	bl	_fcgi_flush
	cbz	w0, LBB0_33
; %bb.29:
	add	x1, x21, x26
	mov	x0, x20
	mov	x2, x24
	bl	_safe_write
	cmp	w0, w24
	b.ne	LBB0_32
; %bb.30:
	cmp	w25, w27
	b.eq	LBB0_34
; %bb.31:
	mov	x0, x20
	mov	x1, x22
	bl	_open_packet
	ldr	w0, [x20]
	add	x8, x21, w19, sxtw
	sub	x1, x8, w23, sxtw
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x20]
	add	w8, w8, w23
	b	LBB0_19
LBB0_32:
	str	xzr, [x20, #8]
LBB0_33:
	mov	w19, #-1
LBB0_34:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
