	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_out
_write_out:                             ## @write_out
	.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	%esi, %ebx
	movq	%rdi, %r15
	movq	_FILE_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shll	$3, %eax
	xorl	%edi, %edi
	cmpl	%esi, %eax
	seta	%dil
	callq	_assert
	movq	_woptr@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	testl	%ebx, %ebx
	jg	LBB0_3
	jmp	LBB0_8
LBB0_1:
	movq	_obuff@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_roptr@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	%rax, (%rdx)
	testl	%ebx, %ebx
	jle	LBB0_8
LBB0_3:
	movl	%ebx, %ecx
	movq	_woptr@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_obuff@GOTPCREL(%rip), %r13
	movl	(%r13), %ebx
	movq	_FILE_BUFFER_SIZE@GOTPCREL(%rip), %r12
	addl	(%r12), %ebx
	subl	%eax, %ebx
	movl	%ecx, %r13d
	cmpl	%ebx, %ecx
	cmovll	%ecx, %ebx
	xorl	%edi, %edi
	testl	%ebx, %ebx
	setg	%dil
	callq	_assert
	movq	(%r14), %rdi
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movslq	%ebx, %r12
	movq	(%r14), %rax
	addq	%r12, %rax
	movq	%rax, (%r14)
	subl	%r12d, %r13d
	movq	_wpos@GOTPCREL(%rip), %rcx
	addl	%r12d, (%rcx)
	movq	_FILE_BUFFER_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	_obuff@GOTPCREL(%rip), %rdx
	addq	(%rdx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	callq	_flush_out
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	testl	%r13d, %r13d
	jle	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, %ecx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	addq	%r12, %r15
	movq	_woptr@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	jmp	LBB0_4
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FILE_BUFFER_SIZE,4,2           ## @FILE_BUFFER_SIZE
	.comm	_woptr,8,3                      ## @woptr
	.comm	_obuff,8,3                      ## @obuff
	.comm	_roptr,8,3                      ## @roptr
	.comm	_wpos,4,2                       ## @wpos
	.no_dead_strip	_write_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_out
_write_out:                             ; @write_out
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _FILE_BUFFER_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _FILE_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w1, w8, lsl #3
	cset	w0, lo
	bl	_assert
Lloh2:
	adrp	x23, _woptr@GOTPAGE
Lloh3:
	ldr	x23, [x23, _woptr@GOTPAGEOFF]
	ldr	x8, [x23]
Lloh4:
	adrp	x24, _obuff@GOTPAGE
Lloh5:
	ldr	x24, [x24, _obuff@GOTPAGEOFF]
	cbz	x8, LBB0_2
; %bb.1:
	cmp	w19, #1
	b.ge	LBB0_3
	b	LBB0_8
LBB0_2:
	ldr	x8, [x24]
Lloh6:
	adrp	x9, _roptr@GOTPAGE
Lloh7:
	ldr	x9, [x9, _roptr@GOTPAGEOFF]
Lloh8:
	str	x8, [x9]
	str	x8, [x23]
	cmp	w19, #1
	b.lt	LBB0_8
LBB0_3:
Lloh9:
	adrp	x25, _wpos@GOTPAGE
Lloh10:
	ldr	x25, [x25, _wpos@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x24]
	ldr	w10, [x22]
	add	w9, w9, w10
	sub	w8, w9, w8
	cmp	w19, w8
	csel	w21, w19, w8, lt
	cmp	w21, #0
	cset	w0, gt
	bl	_assert
	ldr	x0, [x23]
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
	sxtw	x26, w21
	ldr	x8, [x23]
	add	x8, x8, x26
	str	x8, [x23]
	sub	w19, w19, w21
	ldr	w9, [x25]
	add	w9, w9, w21
	str	w9, [x25]
	ldr	x9, [x24]
	ldrsw	x10, [x22]
	add	x9, x9, x10
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_flush_out
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	cmp	w19, #1
	b.lt	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, x26
	ldr	x8, [x23]
	b	LBB0_4
LBB0_8:
	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 AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_FILE_BUFFER_SIZE,4,2           ; @FILE_BUFFER_SIZE
	.comm	_woptr,8,3                      ; @woptr
	.comm	_obuff,8,3                      ; @obuff
	.comm	_roptr,8,3                      ; @roptr
	.comm	_wpos,4,2                       ; @wpos
	.no_dead_strip	_write_out
.subsections_via_symbols
