	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alloc_log_event                ## -- Begin function alloc_log_event
	.p2align	4, 0x90
_alloc_log_event:                       ## @alloc_log_event
	.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
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	_binlogname@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_6
## %bb.1:
	movl	%edx, %r14d
	movl	%edi, %r15d
	movq	_LE_TIMESTAMP_MAGIC@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	_now@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r15d, %edi
	jne	LBB0_7
## %bb.2:
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	xorl	%edi, %edi
	callq	_time
LBB0_4:
	movq	_log_last_ts@GOTPCREL(%rip), %rcx
	movl	$8, %ebx
	cmpl	%eax, (%rcx)
	jge	LBB0_10
## %bb.5:
	movl	%eax, (%rcx)
	jmp	LBB0_10
LBB0_7:
	movl	%esi, %r13d
	leal	12(,%rcx,8), %ebx
	movq	_log_last_ts@GOTPCREL(%rip), %rcx
	movq	_MAX_LOG_TS_INTERVAL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	addl	(%rcx), %edx
	cmpl	%edx, %eax
	jle	LBB0_9
## %bb.8:
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_alloc_log_event
LBB0_9:
	movl	%r13d, %eax
LBB0_10:
	movq	_log_end@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_log_wptr@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	subl	%ecx, %esi
	cmpl	%esi, %ebx
	jle	LBB0_12
## %bb.11:
	movq	_log_endw@GOTPCREL(%rip), %rsi
	movl	%ecx, (%rsi)
	movq	_log_start@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rdx)
LBB0_12:
	movq	_log_rptr@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	addl	%ecx, %ebx
	cmpl	%esi, %ecx
	jge	LBB0_14
## %bb.13:
	cmpl	%esi, %ebx
	jge	LBB0_18
LBB0_14:
	movslq	%ecx, %rcx
	movl	%ebx, (%rdx)
	movl	%r15d, (%rcx)
	movl	%eax, 4(%rcx)
	cmpl	%r15d, (%r12)
	jne	LBB0_16
LBB0_6:
	xorl	%ecx, %ecx
	jmp	LBB0_17
LBB0_16:
	movl	%r14d, 8(%rcx)
	addq	$12, %rcx
LBB0_17:
	movq	%rcx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
	movl	$3, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_binlogname,4,2                 ## @binlogname
	.comm	_LE_TIMESTAMP_MAGIC,4,2         ## @LE_TIMESTAMP_MAGIC
	.comm	_now,4,2                        ## @now
	.comm	_log_last_ts,4,2                ## @log_last_ts
	.comm	_MAX_LOG_TS_INTERVAL,4,2        ## @MAX_LOG_TS_INTERVAL
	.comm	_log_end,4,2                    ## @log_end
	.comm	_log_wptr,4,2                   ## @log_wptr
	.comm	_log_endw,4,2                   ## @log_endw
	.comm	_log_start,4,2                  ## @log_start
	.comm	_log_rptr,4,2                   ## @log_rptr
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fatal: binlog buffer overflow!\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_alloc_log_event                ; -- Begin function alloc_log_event
	.p2align	2
_alloc_log_event:                       ; @alloc_log_event
	.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
Lloh0:
	adrp	x8, _binlogname@GOTPAGE
Lloh1:
	ldr	x8, [x8, _binlogname@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cbz	w8, LBB0_13
; %bb.1:
	mov	x19, x2
	mov	x20, x0
Lloh3:
	adrp	x22, _LE_TIMESTAMP_MAGIC@GOTPAGE
Lloh4:
	ldr	x22, [x22, _LE_TIMESTAMP_MAGIC@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh5:
	adrp	x8, _now@GOTPAGE
Lloh6:
	ldr	x8, [x8, _now@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, w20
	b.ne	LBB0_7
; %bb.2:
	mov	x21, x8
	cbnz	w8, LBB0_4
; %bb.3:
	mov	w0, #0
	bl	_time
	mov	x21, x0
LBB0_4:
Lloh8:
	adrp	x8, _log_last_ts@GOTPAGE
Lloh9:
	ldr	x8, [x8, _log_last_ts@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, w21
	b.ge	LBB0_6
; %bb.5:
	str	w21, [x8]
LBB0_6:
	mov	w23, #8
	b	LBB0_9
LBB0_7:
	mov	x21, x1
	lsl	w9, w3, #3
	add	w23, w9, #12
Lloh10:
	adrp	x9, _log_last_ts@GOTPAGE
Lloh11:
	ldr	x9, [x9, _log_last_ts@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _MAX_LOG_TS_INTERVAL@GOTPAGE
Lloh14:
	ldr	x10, [x10, _MAX_LOG_TS_INTERVAL@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	add	w9, w10, w9
	cmp	w8, w9
	b.le	LBB0_9
; %bb.8:
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	bl	_alloc_log_event
LBB0_9:
Lloh16:
	adrp	x8, _log_end@GOTPAGE
Lloh17:
	ldr	x8, [x8, _log_end@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x8]
Lloh19:
	adrp	x8, _log_wptr@GOTPAGE
Lloh20:
	ldr	x8, [x8, _log_wptr@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w10, w10, w9
	cmp	w23, w10
	b.le	LBB0_11
; %bb.10:
Lloh21:
	adrp	x10, _log_endw@GOTPAGE
Lloh22:
	ldr	x10, [x10, _log_endw@GOTPAGEOFF]
Lloh23:
	str	w9, [x10]
Lloh24:
	adrp	x9, _log_start@GOTPAGE
Lloh25:
	ldr	x9, [x9, _log_start@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	str	w9, [x8]
LBB0_11:
Lloh27:
	adrp	x10, _log_rptr@GOTPAGE
Lloh28:
	ldr	x10, [x10, _log_rptr@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x10]
	add	w10, w9, w23
	cmp	w9, w11
	ccmp	w10, w11, #8, lt
	b.ge	LBB0_16
; %bb.12:
	sxtw	x9, w9
	str	w10, [x8]
	stp	w20, w21, [x9]
	ldr	w8, [x22]
	cmp	w8, w20
	b.ne	LBB0_14
LBB0_13:
	mov	x0, #0
	b	LBB0_15
LBB0_14:
	str	w19, [x9, #8]
	add	x0, x9, #12
LBB0_15:
	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
LBB0_16:
Lloh30:
	adrp	x8, _stderr@GOTPAGE
Lloh31:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
Lloh33:
	adrp	x1, l_.str@PAGE
Lloh34:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #3
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_binlogname,4,2                 ; @binlogname
	.comm	_LE_TIMESTAMP_MAGIC,4,2         ; @LE_TIMESTAMP_MAGIC
	.comm	_now,4,2                        ; @now
	.comm	_log_last_ts,4,2                ; @log_last_ts
	.comm	_MAX_LOG_TS_INTERVAL,4,2        ; @MAX_LOG_TS_INTERVAL
	.comm	_log_end,4,2                    ; @log_end
	.comm	_log_wptr,4,2                   ; @log_wptr
	.comm	_log_endw,4,2                   ; @log_endw
	.comm	_log_start,4,2                  ; @log_start
	.comm	_log_rptr,4,2                   ; @log_rptr
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fatal: binlog buffer overflow!\n"

.subsections_via_symbols
