	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_storage_append_to_binlog       ## -- Begin function storage_append_to_binlog
	.p2align	4, 0x90
_storage_append_to_binlog:              ## @storage_append_to_binlog
	.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
	movq	$0, (%rdi)
	movl	8(%rdi), %edx
	testl	%edx, %edx
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %r14
	movq	_O_WRONLY@GOTPCREL(%rip), %r13
	movq	_SEEK_END@GOTPCREL(%rip), %r12
	xorl	%r15d, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	12(%rax), %esi
	movl	12(%rcx), %edx
	movq	%r14, %rdi
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	callq	_kprintf
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	24(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movl	$-1, 8(%rax)
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	incq	%r15
	movslq	8(%rbx), %rdx
	cmpq	%rdx, %r15
	jge	LBB0_16
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %rcx
	movq	(%rcx,%r15,8), %rax
	movq	(%rax), %rdx
	movq	(%rcx), %rcx
	cmpq	(%rcx), %rdx
	jl	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$0, 16(%rax)
	movl	12(%rax), %eax
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %esi
	movl	%eax, %edi
	callq	_open
	movq	24(%rbx), %rcx
	movq	(%rcx,%r15,8), %rcx
	movl	%eax, 8(%rcx)
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_lseek
	movq	16(%rbx), %rcx
	movq	24(%rbx), %rdx
	movq	(%rdx,%r15,8), %rdx
	cmpq	%rcx, %rax
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	8(%rdx), %edi
	movq	_F_WRLCK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_lock_whole_file
	testq	%rax, %rax
	jle	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	incq	(%rbx)
	jmp	LBB0_15
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	12(%rcx), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	jmp	LBB0_7
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	12(%rcx), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_kprintf
	jmp	LBB0_8
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	12(%rdx), %esi
	leaq	L_.str.3(%rip), %rdi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_kprintf
	movq	24(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movl	8(%rax), %edi
	callq	_close
	jmp	LBB0_8
LBB0_16:
	movq	(%rbx), %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jg	LBB0_18
	jmp	LBB0_17
LBB0_1:
	xorl	%ecx, %ecx
LBB0_17:
	leaq	L_.str.5(%rip), %rsi
	movl	$1, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_vkprintf
	movq	_STORAGE_ERR_NO_WRONLY_BINLOGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	24(%rbx), %rax
	movq	(%rax,%r15,8), %rax
	movl	12(%rax), %esi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_kprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Skip \"%s\", since it is shorter than %s.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Skip \"%s\", since it isn't prefix of %s.\n"

	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
L_.str.2:                               ## @.str.2
	.asciz	"open (\"%s\", O_WRONLY) fail. %m"

	.comm	_SEEK_END,4,2                   ## @SEEK_END
L_.str.3:                               ## @.str.3
	.asciz	"lseek (\"%s\", 0, SEEK_END) returns %lld, but V->log_readto_pos is equal to %lld.\n"

	.comm	_F_WRLCK,4,2                    ## @F_WRLCK
L_.str.4:                               ## @.str.4
	.asciz	"lock_whole_file (%s, F_WRLCK) fail.\n"

L_.str.5:                               ## @.str.5
	.asciz	"binlogs: %d, wronly: %d\n"

	.comm	_STORAGE_ERR_NO_WRONLY_BINLOGS,4,2 ## @STORAGE_ERR_NO_WRONLY_BINLOGS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_storage_append_to_binlog       ; -- Begin function storage_append_to_binlog
	.p2align	2
_storage_append_to_binlog:              ; @storage_append_to_binlog
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	xzr, [x0]
	ldr	w2, [x0, #8]
	cmp	w2, #1
	b.lt	LBB0_17
; %bb.1:
	mov	x19, x0
	mov	x24, #0
Lloh0:
	adrp	x20, l_.str@PAGE
Lloh1:
	add	x20, x20, l_.str@PAGEOFF
	mov	w25, #-1
Lloh2:
	adrp	x21, l_.str.1@PAGE
Lloh3:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh4:
	adrp	x26, _O_WRONLY@GOTPAGE
Lloh5:
	ldr	x26, [x26, _O_WRONLY@GOTPAGEOFF]
Lloh6:
	adrp	x22, l_.str.2@PAGE
Lloh7:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh8:
	adrp	x27, _SEEK_END@GOTPAGE
Lloh9:
	ldr	x27, [x27, _SEEK_END@GOTPAGEOFF]
Lloh10:
	adrp	x23, l_.str.3@PAGE
Lloh11:
	add	x23, x23, l_.str.3@PAGEOFF
	b	LBB0_6
LBB0_2:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x8, #12]
	ldr	w8, [x9, #12]
	str	x8, [sp]
	mov	x0, x20
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
	bl	_kprintf
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x24, lsl #3]
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	w25, [x8, #8]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	add	x24, x24, #1
	ldrsw	x2, [x19, #8]
	cmp	x24, x2
	b.ge	LBB0_15
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #24]
	ldr	x8, [x9, x24, lsl #3]
	ldr	x10, [x8]
	ldr	x9, [x9]
	ldr	x11, [x9]
	cmp	x10, x11
	b.lt	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldp	w8, w10, [x8, #12]
	cbz	w10, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x26]
	mov	x0, x8
	bl	_open
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x24, lsl #3]
	str	w0, [x8, #8]
	tbnz	w0, #31, LBB0_13
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w2, [x27]
	mov	w1, #0
	bl	_lseek
	ldp	x8, x9, [x19, #16]
	ldr	x9, [x9, x24, lsl #3]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	w0, [x9, #8]
Lloh12:
	adrp	x8, _F_WRLCK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _F_WRLCK@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	bl	_lock_whole_file
	cmp	x0, #0
	b.le	LBB0_20
; %bb.11:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	b	LBB0_5
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x9, #12]
	str	x9, [sp]
	mov	x0, x21
	mov	x1, x8
	b	LBB0_3
LBB0_13:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x8, #12]
	mov	x0, x22
	b	LBB0_3
LBB0_14:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x9, #12]
	stp	x0, x8, [sp]
	mov	x0, x23
	bl	_kprintf
	ldr	x8, [x19, #24]
	lsl	x28, x24, #3
	ldr	x8, [x8, x28]
	ldr	w0, [x8, #8]
	bl	_close
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x28]
	b	LBB0_4
LBB0_15:
	ldr	x3, [x19]
	cmp	x3, #0
	b.le	LBB0_18
; %bb.16:
	mov	w0, #0
	b	LBB0_19
LBB0_17:
	mov	x3, #0
LBB0_18:
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_vkprintf
Lloh17:
	adrp	x8, _STORAGE_ERR_NO_WRONLY_BINLOGS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _STORAGE_ERR_NO_WRONLY_BINLOGS@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
LBB0_19:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
	ldr	x8, [x19, #24]
	ldr	x8, [x8, x24, lsl #3]
	ldr	w1, [x8, #12]
Lloh20:
	adrp	x0, l_.str.4@PAGE
Lloh21:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_kprintf
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Skip \"%s\", since it is shorter than %s.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Skip \"%s\", since it isn't prefix of %s.\n"

	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
l_.str.2:                               ; @.str.2
	.asciz	"open (\"%s\", O_WRONLY) fail. %m"

	.comm	_SEEK_END,4,2                   ; @SEEK_END
l_.str.3:                               ; @.str.3
	.asciz	"lseek (\"%s\", 0, SEEK_END) returns %lld, but V->log_readto_pos is equal to %lld.\n"

	.comm	_F_WRLCK,4,2                    ; @F_WRLCK
l_.str.4:                               ; @.str.4
	.asciz	"lock_whole_file (%s, F_WRLCK) fail.\n"

l_.str.5:                               ; @.str.5
	.asciz	"binlogs: %d, wronly: %d\n"

	.comm	_STORAGE_ERR_NO_WRONLY_BINLOGS,4,2 ; @STORAGE_ERR_NO_WRONLY_BINLOGS
.subsections_via_symbols
