	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmemcached_replay_logevent     ## -- Begin function pmemcached_replay_logevent
	.p2align	4, 0x90
_pmemcached_replay_logevent:            ## @pmemcached_replay_logevent
	.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	$-2, %r12d
	cmpl	$4, %esi
	jl	LBB0_15
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	(%rdi), %r14d
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_get_logrec_size
	cmpl	%ebx, %eax
	jg	LBB0_15
## %bb.2:
	movl	%eax, %r13d
	cmpl	$-2, %eax
	je	LBB0_15
## %bb.3:
	testl	%r13d, %r13d
	js	LBB0_4
## %bb.5:
	movq	_targ_existed@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_6
LBB0_9:
	movq	_rd_bytes@GOTPCREL(%rip), %rax
	addl	%r13d, (%rax)
	movq	_rd_rec@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	%r14d, _pmemcached_replay_logevent.type_ok(%rip)
	addl	$3, %r13d
	movl	%r13d, %r12d
	andl	$-4, %r12d
	movl	%r14d, %edi
	movq	%r15, %rsi
	callq	_want_write
	testq	%rax, %rax
	je	LBB0_15
## %bb.10:
	movq	_LogTs@GOTPCREL(%rip), %rbx
	cmpq	$0, 24(%rbx)
	je	LBB0_12
## %bb.11:
	movl	$8, %edi
	callq	_write_alloc
	movq	%rax, %rdi
	movq	%rbx, %rsi
	movl	$8, %edx
	callq	_memcpy
	movq	_wr_bytes@GOTPCREL(%rip), %rax
	addq	$8, (%rax)
	movq	_wr_rec@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	$0, 24(%rbx)
LBB0_12:
	movl	%r12d, %edi
	callq	_write_alloc
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	callq	_memcpy
	movq	_LEV_START@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_14
## %bb.13:
	movq	_copy_mod@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	movq	_copy_rem@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%rbx)
	incq	%rax
	movq	%rax, (%rbx)
LBB0_14:
	movl	%r12d, %eax
	movq	_wr_bytes@GOTPCREL(%rip), %rcx
	addq	%rax, (%rcx)
	movq	_wr_rec@GOTPCREL(%rip), %rax
	incl	(%rax)
	jmp	LBB0_15
LBB0_4:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_log_cur_pos
	movq	_wr_bytes@GOTPCREL(%rip), %rcx
	movq	_targ_orig_size@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r8
	addq	(%rcx), %r8
	movl	_pmemcached_replay_logevent.type_ok(%rip), %ecx
	movl	%ecx, (%rsp)
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	%r13d, %edx
	movl	%eax, %ecx
	movl	%r14d, %r9d
	xorl	%eax, %eax
	callq	_fprintf
	movl	%r13d, %r12d
	jmp	LBB0_15
LBB0_6:
	movq	_LEV_START@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	je	LBB0_9
## %bb.7:
	movq	_jump_log_pos@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	$-1, %r12d
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @pmemcached_replay_logevent.type_ok
_pmemcached_replay_logevent.type_ok:
	.long	4294967295                      ## 0xffffffff

	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d reading binlog at position %lld, write position %lld, type %08x (prev type %08x)\n"

	.comm	_wr_bytes,8,3                   ## @wr_bytes
	.comm	_targ_orig_size,8,3             ## @targ_orig_size
	.comm	_targ_existed,4,2               ## @targ_existed
	.comm	_LEV_START,4,2                  ## @LEV_START
	.comm	_jump_log_pos,8,3               ## @jump_log_pos
L_.str.1:                               ## @.str.1
	.asciz	"error: first record must be a LEV_START\n"

	.comm	_rd_bytes,4,2                   ## @rd_bytes
	.comm	_rd_rec,4,2                     ## @rd_rec
	.comm	_LogTs,32,3                     ## @LogTs
	.comm	_wr_rec,4,2                     ## @wr_rec
	.comm	_copy_mod,4,2                   ## @copy_mod
	.comm	_copy_rem,8,3                   ## @copy_rem
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pmemcached_replay_logevent     ; -- Begin function pmemcached_replay_logevent
	.p2align	2
_pmemcached_replay_logevent:            ; @pmemcached_replay_logevent
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	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
	cmp	w1, #4
	b.lt	LBB0_2
; %bb.1:
	mov	x22, x1
	mov	x21, x0
	ldr	w20, [x0]
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_get_logrec_size
	cmp	w0, w22
	ccmn	w0, #2, #4, le
	b.ne	LBB0_4
LBB0_2:
	mov	w19, #-2
LBB0_3:
	mov	x0, x19
	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
	add	sp, sp, #112
	ret
LBB0_4:
	mov	x19, x0
	tbnz	w0, #31, LBB0_13
; %bb.5:
Lloh0:
	adrp	x8, _targ_existed@GOTPAGE
Lloh1:
	ldr	x8, [x8, _targ_existed@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbnz	w8, LBB0_7
; %bb.6:
Lloh3:
	adrp	x8, _LEV_START@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LEV_START@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _jump_log_pos@GOTPAGE
Lloh7:
	ldr	x9, [x9, _jump_log_pos@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	w20, w8
	ccmp	x9, #0, #0, ne
	b.eq	LBB0_14
LBB0_7:
Lloh9:
	adrp	x8, _rd_bytes@GOTPAGE
Lloh10:
	ldr	x8, [x8, _rd_bytes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w19
	str	w9, [x8]
Lloh11:
	adrp	x8, _rd_rec@GOTPAGE
Lloh12:
	ldr	x8, [x8, _rd_rec@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	adrp	x8, _pmemcached_replay_logevent.type_ok@PAGE
	str	w20, [x8, _pmemcached_replay_logevent.type_ok@PAGEOFF]
	add	w8, w19, #3
	and	w19, w8, #0xfffffffc
	mov	x0, x20
	mov	x1, x21
	bl	_want_write
	cbz	x0, LBB0_3
; %bb.8:
Lloh13:
	adrp	x22, _LogTs@GOTPAGE
Lloh14:
	ldr	x22, [x22, _LogTs@GOTPAGEOFF]
	ldr	x8, [x22, #24]
Lloh15:
	adrp	x24, _wr_bytes@GOTPAGE
Lloh16:
	ldr	x24, [x24, _wr_bytes@GOTPAGEOFF]
Lloh17:
	adrp	x23, _wr_rec@GOTPAGE
Lloh18:
	ldr	x23, [x23, _wr_rec@GOTPAGEOFF]
	cbz	x8, LBB0_10
; %bb.9:
	mov	w0, #8
	bl	_write_alloc
	mov	x1, x22
	mov	w2, #8
	bl	_memcpy
	ldr	x8, [x24]
	add	x8, x8, #8
	str	x8, [x24]
	ldr	w8, [x23]
	add	w8, w8, #1
	str	w8, [x23]
	str	xzr, [x22, #24]
LBB0_10:
	mov	x0, x19
	bl	_write_alloc
	mov	x22, x0
	mov	x1, x21
	mov	x2, x19
	bl	_memcpy
Lloh19:
	adrp	x8, _LEV_START@GOTPAGE
Lloh20:
	ldr	x8, [x8, _LEV_START@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_12
; %bb.11:
Lloh22:
	adrp	x8, _copy_mod@GOTPAGE
Lloh23:
	ldr	x8, [x8, _copy_mod@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x22, #16]
Lloh25:
	adrp	x8, _copy_rem@GOTPAGE
Lloh26:
	ldr	x8, [x8, _copy_rem@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	add	x9, x8, #1
	stp	x9, x8, [x22]
LBB0_12:
	ldr	x8, [x24]
	add	x8, x8, w19, uxtw
	str	x8, [x24]
	ldr	w8, [x23]
	add	w8, w8, #1
	str	w8, [x23]
	b	LBB0_3
LBB0_13:
Lloh28:
	adrp	x8, _stderr@GOTPAGE
Lloh29:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh30:
	ldr	w21, [x8]
	bl	_log_cur_pos
                                        ; kill: def $w0 killed $w0 def $x0
Lloh31:
	adrp	x8, _wr_bytes@GOTPAGE
Lloh32:
	ldr	x8, [x8, _wr_bytes@GOTPAGEOFF]
Lloh33:
	ldr	x8, [x8]
Lloh34:
	adrp	x9, _targ_orig_size@GOTPAGE
Lloh35:
	ldr	x9, [x9, _targ_orig_size@GOTPAGEOFF]
Lloh36:
	ldr	x9, [x9]
	add	x8, x9, x8
Lloh37:
	adrp	x9, _pmemcached_replay_logevent.type_ok@PAGE
Lloh38:
	ldr	w9, [x9, _pmemcached_replay_logevent.type_ok@PAGEOFF]
	stp	x20, x9, [sp, #24]
	stp	x0, x8, [sp, #8]
	str	x19, [sp]
Lloh39:
	adrp	x1, l_.str@PAGE
Lloh40:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_fprintf
	b	LBB0_3
LBB0_14:
Lloh41:
	adrp	x8, _stderr@GOTPAGE
Lloh42:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
Lloh44:
	adrp	x1, l_.str.1@PAGE
Lloh45:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	w19, #-1
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdr	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @pmemcached_replay_logevent.type_ok
_pmemcached_replay_logevent.type_ok:
	.long	4294967295                      ; 0xffffffff

	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d reading binlog at position %lld, write position %lld, type %08x (prev type %08x)\n"

	.comm	_wr_bytes,8,3                   ; @wr_bytes
	.comm	_targ_orig_size,8,3             ; @targ_orig_size
	.comm	_targ_existed,4,2               ; @targ_existed
	.comm	_LEV_START,4,2                  ; @LEV_START
	.comm	_jump_log_pos,8,3               ; @jump_log_pos
l_.str.1:                               ; @.str.1
	.asciz	"error: first record must be a LEV_START\n"

	.comm	_rd_bytes,4,2                   ; @rd_bytes
	.comm	_rd_rec,4,2                     ; @rd_rec
	.comm	_LogTs,32,3                     ; @LogTs
	.comm	_wr_rec,4,2                     ; @wr_rec
	.comm	_copy_mod,4,2                   ; @copy_mod
	.comm	_copy_rem,8,3                   ; @copy_rem
.subsections_via_symbols
