	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fifolog_write_output
_fifolog_write_output:                  ## @fifolog_write_output
	.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	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	48(%rdi), %rax
	movq	8(%rax), %rax
	movq	(%rax), %rbx
	movq	(%rdi), %rdi
	subq	%rdi, %rbx
	sarq	$2, %rbx
	movl	8(%r13), %esi
	callq	_be32enc
	movl	12(%r13), %eax
	movq	(%r13), %rdi
	movl	%eax, 16(%rdi)
	movq	_FIFOLOG_FLG_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%r13)
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	je	LBB0_1
## %bb.2:
	addq	$20, %rdi
	movl	%r14d, %esi
	callq	_be32enc
	movl	$9, %r14d
	jmp	LBB0_3
LBB0_1:
	movl	$5, %r14d
LBB0_3:
	movq	48(%r13), %rax
	xorl	%edi, %edi
	cmpq	(%rax), %rbx
	setle	%dil
	callq	_assert
	xorl	%edi, %edi
	cmpq	%r14, %rbx
	setge	%dil
	callq	_assert
	xorl	%r12d, %r12d
	cmpq	%r14, %rbx
	je	LBB0_11
## %bb.4:
	movq	48(%r13), %rcx
	movq	(%rcx), %rdx
	cmpq	%rbx, %rdx
	jle	LBB0_6
## %bb.5:
	movq	_Z_NO_FLUSH@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	je	LBB0_11
LBB0_6:
	movl	%edx, %eax
	subl	%ebx, %eax
	cmpl	$256, %eax                      ## imm = 0x100
	jl	LBB0_8
## %bb.7:
	movq	(%r13), %rcx
	leaq	(%rcx,%rdx,4), %rdi
	addq	$-16, %rdi
	movl	%eax, %esi
	callq	_be32enc
	movq	_FIFOLOG_FLG_4BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%r13), %rsi
	orl	%eax, 16(%rsi)
	movq	48(%r13), %rcx
	movq	(%rcx), %rdx
	jmp	LBB0_10
LBB0_8:
	movq	(%r13), %rsi
	testl	%eax, %eax
	jle	LBB0_10
## %bb.9:
	movl	%eax, -4(%rsi,%rdx,4)
	movq	_FIFOLOG_FLG_1BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%rsi)
LBB0_10:
	subl	%r14d, %ebx
	movq	16(%r13), %rax
	movq	_FIFOLOG_PT_BYTES_POST@GOTPCREL(%rip), %rdi
	movq	(%rdi), %rdi
	addl	%ebx, (%rax,%rdi,4)
	movl	16(%rcx), %edi
	movl	24(%r13), %ecx
	incl	%ecx
	imull	%edx, %ecx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_pwrite
	cltq
	movq	16(%r13), %rcx
	movq	48(%r13), %rdx
	xorl	%esi, %esi
	cmpq	%rax, (%rdx)
	sete	%sil
	movq	_FIFOLOG_PT_WRITES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	incl	(%rcx,%rax,4)
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%edi, %eax
	subl	28(%r13), %eax
	movq	_FIFOLOG_PT_RUNTIME@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%eax, (%rcx,%rdx,4)
	movl	%edi, 32(%r13)
	incl	8(%r13)
	incl	24(%r13)
	leal	(%rsi,%rsi), %r12d
	decl	%r12d
	movl	$0, 12(%r13)
	movq	(%r13), %rdi
	movq	40(%r13), %rdx
	xorl	%esi, %esi
	callq	_memset
	movq	(%r13), %rax
	movq	48(%r13), %rcx
	addq	$20, %rax
	movq	8(%rcx), %rcx
	movq	%rax, (%rcx)
	movq	40(%r13), %rax
	addq	$-5, %rax
	movq	%rax, 8(%rcx)
LBB0_11:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FIFOLOG_FLG_SYNC,4,2           ## @FIFOLOG_FLG_SYNC
	.comm	_Z_NO_FLUSH,4,2                 ## @Z_NO_FLUSH
	.comm	_FIFOLOG_FLG_4BYTE,4,2          ## @FIFOLOG_FLG_4BYTE
	.comm	_FIFOLOG_FLG_1BYTE,4,2          ## @FIFOLOG_FLG_1BYTE
	.comm	_FIFOLOG_PT_BYTES_POST,8,3      ## @FIFOLOG_PT_BYTES_POST
	.comm	_FIFOLOG_PT_WRITES,8,3          ## @FIFOLOG_PT_WRITES
	.comm	_FIFOLOG_PT_RUNTIME,8,3         ## @FIFOLOG_PT_RUNTIME
	.no_dead_strip	_fifolog_write_output
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fifolog_write_output
_fifolog_write_output:                  ; @fifolog_write_output
	.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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x8, [x0, #48]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	x0, [x0]
	sub	x8, x8, x0
	asr	x22, x8, #2
	ldr	w1, [x19, #8]
	bl	_be32enc
	ldr	w9, [x19, #12]
	ldr	x8, [x19]
	str	w9, [x8, #16]
	ldr	w9, [x19, #12]
Lloh0:
	adrp	x10, _FIFOLOG_FLG_SYNC@GOTPAGE
Lloh1:
	ldr	x10, [x10, _FIFOLOG_FLG_SYNC@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
	add	x0, x8, #20
	mov	x1, x20
	bl	_be32enc
	mov	w23, #9
	b	LBB0_3
LBB0_2:
	mov	w23, #5
LBB0_3:
	ldr	x8, [x19, #48]
	ldr	x8, [x8]
	cmp	x22, x8
	cset	w0, le
	bl	_assert
	cmp	x22, x23
	cset	w0, ge
	bl	_assert
	cmp	x22, x23
	b.eq	LBB0_7
; %bb.4:
	ldr	x9, [x19, #48]
	ldr	x2, [x9]
Lloh3:
	adrp	x8, _Z_NO_FLUSH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Z_NO_FLUSH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	x2, x22
	ccmp	w8, w21, #0, gt
	b.eq	LBB0_7
; %bb.5:
	sub	w8, w2, w22
	cmp	w8, #256
	b.lt	LBB0_8
; %bb.6:
	ldr	x9, [x19]
	add	x9, x9, x2, lsl #2
	sub	x0, x9, #16
	mov	x1, x8
	bl	_be32enc
Lloh6:
	adrp	x8, _FIFOLOG_FLG_4BYTE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FIFOLOG_FLG_4BYTE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x1, [x19]
	ldr	w9, [x1, #16]
	orr	w8, w9, w8
	str	w8, [x1, #16]
	ldr	x9, [x19, #48]
	ldr	x2, [x9]
	b	LBB0_10
LBB0_7:
	mov	w21, #0
	b	LBB0_11
LBB0_8:
	ldr	x1, [x19]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.9:
	add	x10, x1, x2, lsl #2
	stur	w8, [x10, #-4]
Lloh9:
	adrp	x8, _FIFOLOG_FLG_1BYTE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FIFOLOG_FLG_1BYTE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w10, [x1, #16]
	orr	w8, w10, w8
	str	w8, [x1, #16]
LBB0_10:
Lloh12:
	adrp	x8, _FIFOLOG_PT_BYTES_POST@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FIFOLOG_PT_BYTES_POST@GOTPAGEOFF]
	ldr	x10, [x19, #16]
Lloh14:
	ldr	x8, [x8]
	lsl	x8, x8, #2
	ldr	w11, [x10, x8]
	sub	w12, w22, w23
	add	w11, w11, w12
	str	w11, [x10, x8]
	ldr	w0, [x9, #16]
	ldr	w8, [x19, #24]
	madd	w3, w2, w8, w2
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_pwrite
Lloh15:
	adrp	x8, _FIFOLOG_PT_WRITES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FIFOLOG_PT_WRITES@GOTPAGEOFF]
	ldr	x9, [x19, #16]
Lloh17:
	ldr	x8, [x8]
	lsl	x8, x8, #2
	ldr	w10, [x9, x8]
	add	w10, w10, #1
	str	w10, [x9, x8]
	ldr	w8, [x19, #28]
	sub	w8, w20, w8
Lloh18:
	adrp	x10, _FIFOLOG_PT_RUNTIME@GOTPAGE
Lloh19:
	ldr	x10, [x10, _FIFOLOG_PT_RUNTIME@GOTPAGEOFF]
Lloh20:
	ldr	x10, [x10]
	str	w8, [x9, x10, lsl #2]
	ldp	x2, x8, [x19, #40]
	ldr	x8, [x8]
	cmp	x8, w0, sxtw
	mov	w8, #1
	cneg	w21, w8, ne
	str	w20, [x19, #32]
	ldr	w8, [x19, #8]
	add	w8, w8, #1
	ldr	w9, [x19, #24]
	add	w9, w9, #1
	str	w9, [x19, #24]
	stp	w8, wzr, [x19, #8]
	ldr	x0, [x19]
	mov	w1, #0
	bl	_memset
	ldr	x8, [x19]
	add	x8, x8, #20
	ldp	x10, x9, [x19, #40]
	ldr	x9, [x9, #8]
	sub	x10, x10, #5
	stp	x8, x10, [x9]
LBB0_11:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_FIFOLOG_FLG_SYNC,4,2           ; @FIFOLOG_FLG_SYNC
	.comm	_Z_NO_FLUSH,4,2                 ; @Z_NO_FLUSH
	.comm	_FIFOLOG_FLG_4BYTE,4,2          ; @FIFOLOG_FLG_4BYTE
	.comm	_FIFOLOG_FLG_1BYTE,4,2          ; @FIFOLOG_FLG_1BYTE
	.comm	_FIFOLOG_PT_BYTES_POST,8,3      ; @FIFOLOG_PT_BYTES_POST
	.comm	_FIFOLOG_PT_WRITES,8,3          ; @FIFOLOG_PT_WRITES
	.comm	_FIFOLOG_PT_RUNTIME,8,3         ; @FIFOLOG_PT_RUNTIME
	.no_dead_strip	_fifolog_write_output
.subsections_via_symbols
