	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_binlog_headers           ## -- Begin function write_binlog_headers
	.p2align	4, 0x90
_write_binlog_headers:                  ## @write_binlog_headers
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_KHDR@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_4
## %bb.1:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_time
	movq	(%r14), %rdi
	movl	%eax, 28(%rdi)
	incl	24(%rdi)
	movq	$0, 16(%rdi)
	movq	_tot_crc32@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movl	%eax, 8(%rdi)
	movq	_wr_bytes@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, 4(%rdi)
	addl	%eax, (%rdi)
	callq	_fix_kfs_header_crc32
	movq	_targ_fd@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_assert
	movq	_binlog_headers@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.2:
	movq	_kfs_Hdr@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r14), %edi
	movl	(%r12), %esi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_write
	xorl	%edi, %edi
	cmpl	$4096, %eax                     ## imm = 0x1000
	sete	%dil
	callq	_assert
	incl	%ebx
	cmpl	(%r15), %ebx
	jl	LBB0_3
LBB0_4:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KHDR,8,3                       ## @KHDR
	.comm	_tot_crc32,4,2                  ## @tot_crc32
	.comm	_wr_bytes,8,3                   ## @wr_bytes
	.comm	_targ_fd,4,2                    ## @targ_fd
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_binlog_headers,4,2             ## @binlog_headers
	.comm	_kfs_Hdr,4,2                    ## @kfs_Hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_binlog_headers           ; -- Begin function write_binlog_headers
	.p2align	2
_write_binlog_headers:                  ; @write_binlog_headers
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x19, _KHDR@GOTPAGE
Lloh1:
	ldr	x19, [x19, _KHDR@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_4
; %bb.1:
	mov	w0, #0
	bl	_time
	ldr	x8, [x19]
	ldr	w9, [x8, #24]
	add	w9, w9, #1
Lloh2:
	adrp	x10, _tot_crc32@GOTPAGE
Lloh3:
	ldr	x10, [x10, _tot_crc32@GOTPAGEOFF]
	stp	w9, w0, [x8, #24]
Lloh4:
	ldr	w9, [x10]
	mvn	w9, w9
	str	w9, [x8, #8]
Lloh5:
	adrp	x9, _wr_bytes@GOTPAGE
Lloh6:
	ldr	x9, [x9, _wr_bytes@GOTPAGEOFF]
	str	xzr, [x8, #16]
	ldr	d0, [x8]
	ld1r.2s	{ v1 }, [x9]
	add.2s	v0, v0, v1
	str	d0, [x8]
	mov	x0, x8
	bl	_fix_kfs_header_crc32
Lloh7:
	adrp	x19, _targ_fd@GOTPAGE
Lloh8:
	ldr	x19, [x19, _targ_fd@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh9:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
	cmp	x0, #0
	cset	w0, eq
	bl	_assert
Lloh12:
	adrp	x20, _binlog_headers@GOTPAGE
Lloh13:
	ldr	x20, [x20, _binlog_headers@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.2:
	mov	w21, #0
Lloh14:
	adrp	x22, _kfs_Hdr@GOTPAGE
Lloh15:
	ldr	x22, [x22, _kfs_Hdr@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19]
	ldr	w1, [x22]
	mov	w2, #4096
	bl	_write
	cmp	w0, #1, lsl #12                 ; =4096
	cset	w0, eq
	bl	_assert
	add	w21, w21, #1
	ldr	w8, [x20]
	cmp	w21, w8
	b.lt	LBB0_3
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_KHDR,8,3                       ; @KHDR
	.comm	_tot_crc32,4,2                  ; @tot_crc32
	.comm	_wr_bytes,8,3                   ; @wr_bytes
	.comm	_targ_fd,4,2                    ; @targ_fd
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_binlog_headers,4,2             ; @binlog_headers
	.comm	_kfs_Hdr,4,2                    ; @kfs_Hdr
.subsections_via_symbols
