	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fifolog_write_open             ## -- Begin function fifolog_write_open
	.p2align	4, 0x90
_fifolog_write_open:                    ## @fifolog_write_open
	.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
	movl	%r8d, %ebx
	movl	%ecx, %r14d
	movl	%edx, %r13d
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_FIFOLOG_WRITER_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_CHECK_OBJ_NOTNULL
	movq	_Z_BEST_COMPRESSION@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jae	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rax
	jmp	LBB0_10
LBB0_2:
	movl	%r13d, (%r15)
	movl	%r14d, 4(%r15)
	movl	%ebx, 8(%r15)
	movl	104(%r15), %edi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	leaq	56(%r15), %r14
	movq	%r14, %rdi
	movq	%r12, %rsi
	movl	$1, %edx
	callq	_fifolog_int_open
	testq	%rax, %rax
	jne	LBB0_10
## %bb.3:
	movq	(%r14), %rdi
	leaq	-48(%rbp), %rsi
	callq	_fifolog_int_findend
	testq	%rax, %rax
	jne	LBB0_10
## %bb.4:
	movq	(%r14), %rdi
	movq	-48(%rbp), %rsi
	callq	_fifolog_int_read
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rax
	jmp	LBB0_10
LBB0_6:
	movq	56(%r15), %rax
	movl	16(%rax), %edi
	callq	_be32dec
	movq	%rax, 16(%r15)
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	-48(%rbp), %rcx
	incq	%rcx
	movq	%rcx, 96(%r15)
	incq	%rax
	jmp	LBB0_9
LBB0_7:
	xorl	%eax, %eax
	callq	_random
LBB0_9:
	movq	%rax, 16(%r15)
	movq	56(%r15), %rax
	movl	(%rax), %esi
	movl	%esi, 24(%r15)
	leaq	64(%r15), %rdi
	callq	_ALLOC
	movl	24(%r15), %eax
	addl	%eax, %eax
	leal	(%rax,%rax,4), %esi
	movl	%esi, 28(%r15)
	leaq	88(%r15), %rdi
	callq	_ALLOC
	movq	$0, 80(%r15)
	movq	56(%r15), %rax
	movq	8(%rax), %rdi
	movl	8(%r15), %esi
	callq	_deflateInit
	movq	_Z_OK@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpl	(%rcx), %eax
	sete	%dil
	callq	_assert
	movq	_FIFOLOG_FLG_RESTART@GOTPCREL(%rip), %rax
	movl	72(%r15), %ecx
	orl	(%rax), %ecx
	movq	_FIFOLOG_FLG_SYNC@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, 72(%r15)
	movq	56(%r15), %rax
	movq	64(%r15), %rcx
	addq	$9, %rcx
	movq	8(%rax), %rax
	movq	%rcx, 8(%rax)
	movl	24(%r15), %ecx
	addl	$-9, %ecx
	movl	%ecx, (%rax)
	leaq	-56(%rbp), %rdi
	callq	_time
	movq	-56(%rbp), %rax
	movq	%rax, 48(%r15)
	movq	%rax, 40(%r15)
	movq	%rax, 32(%r15)
	movq	%r15, %rdi
	callq	_fifolog_write_assert
	xorl	%eax, %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FIFOLOG_WRITER_MAGIC,4,2       ## @FIFOLOG_WRITER_MAGIC
	.comm	_Z_BEST_COMPRESSION,4,2         ## @Z_BEST_COMPRESSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Illegal compression value"

L_.str.1:                               ## @.str.1
	.asciz	"Read error, looking for seq"

	.comm	_Z_OK,4,2                       ## @Z_OK
	.comm	_FIFOLOG_FLG_RESTART,4,2        ## @FIFOLOG_FLG_RESTART
	.comm	_FIFOLOG_FLG_SYNC,4,2           ## @FIFOLOG_FLG_SYNC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fifolog_write_open             ; -- Begin function fifolog_write_open
	.p2align	2
_fifolog_write_open:                    ; @fifolog_write_open
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _FIFOLOG_WRITER_MAGIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FIFOLOG_WRITER_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_CHECK_OBJ_NOTNULL
Lloh3:
	adrp	x8, _Z_BEST_COMPRESSION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Z_BEST_COMPRESSION@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w21
	b.hs	LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_10
LBB0_2:
	stp	w23, w22, [x19]
	str	w21, [x19, #8]
	ldr	w0, [x19, #104]
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x21, x19, #56
	mov	x0, x21
	mov	x1, x20
	mov	w2, #1
	bl	_fifolog_int_open
	cbnz	x0, LBB0_10
; %bb.3:
	ldr	x0, [x21]
	mov	x1, sp
	bl	_fifolog_int_findend
	cbnz	x0, LBB0_10
; %bb.4:
	ldr	x0, [x21]
	ldr	x1, [sp]
	bl	_fifolog_int_read
	cbz	w0, LBB0_6
; %bb.5:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_6:
	ldr	x8, [x19, #56]
	ldr	w0, [x8, #16]
	bl	_be32dec
	str	x0, [x19, #16]
	cbz	x0, LBB0_8
; %bb.7:
	ldr	x8, [sp]
	add	x8, x8, #1
	str	x8, [x19, #96]
	add	x0, x0, #1
	b	LBB0_9
LBB0_8:
	bl	_random
LBB0_9:
	str	x0, [x19, #16]
	ldr	x8, [x19, #56]
	ldr	w1, [x8]
	str	w1, [x19, #24]
	add	x0, x19, #64
	bl	_ALLOC
	ldr	w8, [x19, #24]
	add	w8, w8, w8, lsl #2
	lsl	w1, w8, #1
	str	w1, [x19, #28]
	add	x0, x19, #88
	bl	_ALLOC
	str	xzr, [x19, #80]
	ldr	x8, [x19, #56]
	ldr	x0, [x8, #8]
	ldr	w1, [x19, #8]
	bl	_deflateInit
Lloh10:
	adrp	x8, _Z_OK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _Z_OK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w0, w8
	cset	w0, eq
	bl	_assert
Lloh13:
	adrp	x8, _FIFOLOG_FLG_RESTART@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FIFOLOG_FLG_RESTART@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x19, #72]
Lloh16:
	adrp	x10, _FIFOLOG_FLG_SYNC@GOTPAGE
Lloh17:
	ldr	x10, [x10, _FIFOLOG_FLG_SYNC@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh18:
	ldr	w9, [x10]
	orr	w8, w9, w8
	str	w8, [x19, #72]
	ldp	x9, x8, [x19, #56]
	add	x8, x8, #9
	ldr	x9, [x9, #8]
	str	x8, [x9, #8]
	ldr	w8, [x19, #24]
	sub	w8, w8, #9
	str	w8, [x9]
	add	x0, sp, #8
	bl	_time
	ldr	x8, [sp, #8]
	stp	x8, x8, [x19, #40]
	str	x8, [x19, #32]
	mov	x0, x19
	bl	_fifolog_write_assert
	mov	x0, #0
LBB0_10:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_FIFOLOG_WRITER_MAGIC,4,2       ; @FIFOLOG_WRITER_MAGIC
	.comm	_Z_BEST_COMPRESSION,4,2         ; @Z_BEST_COMPRESSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Illegal compression value"

l_.str.1:                               ; @.str.1
	.asciz	"Read error, looking for seq"

	.comm	_Z_OK,4,2                       ; @Z_OK
	.comm	_FIFOLOG_FLG_RESTART,4,2        ; @FIFOLOG_FLG_RESTART
	.comm	_FIFOLOG_FLG_SYNC,4,2           ; @FIFOLOG_FLG_SYNC
.subsections_via_symbols
