	.file	"extr_hints-log-split.c_prepare_write.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	prepare_write
	.type	prepare_write, @function
prepare_write:
.LFB0:
	.cfi_startproc
	endbr64
	test	edi, edi
	push	rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	mov	ebx, edi
	cmovs	ebx, DWORD PTR WRITE_THRESHOLD[rip]
	xor	edi, edi
	test	ebx, ebx
	jle	.L3
	xor	edi, edi
	cmp	DWORD PTR WRITE_THRESHOLD[rip], ebx
	setge	dil
.L3:
	call	assert@PLT
	mov	edx, DWORD PTR wptr[rip]
	mov	eax, DWORD PTR WB[rip]
	test	edx, edx
	jne	.L5
	mov	DWORD PTR wst[rip], eax
	mov	edx, eax
	mov	DWORD PTR wptr[rip], eax
.L5:
	add	eax, DWORD PTR WRITE_BUFFER_SIZE[rip]
	sub	eax, edx
	cmp	eax, ebx
	jl	.L11
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 8
	jmp	flush_out@PLT
	.cfi_endproc
.LFE0:
	.size	prepare_write, .-prepare_write
	.comm	wst,4,4
	.comm	wptr,4,4
	.comm	WRITE_THRESHOLD,4,4
	.comm	WRITE_BUFFER_SIZE,4,4
	.comm	WB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_hints-log-split.c_prepare_write.c"
	.text
	.align	2
	.global	prepare_write
	.syntax unified
	.arm
	.fpu softvfp
	.type	prepare_write, %function
prepare_write:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, lr}
	subs	r4, r0, #0
	ldrlt	r3, .L10
	ldrlt	r4, [r3]
	cmp	r4, #0
	movle	r0, #0
	ble	.L3
	ldr	r3, .L10
	ldr	r0, [r3]
	cmp	r0, r4
	movlt	r0, #0
	movge	r0, #1
.L3:
	bl	assert
	ldr	r1, .L10+4
	ldr	r3, .L10+8
	ldr	r2, [r1]
	cmp	r2, #0
	ldreq	r3, [r3]
	ldrne	r3, [r3]
	moveq	r2, r3
	streq	r3, [r1]
	ldr	r1, .L10+12
	ldreq	r0, .L10+16
	ldr	r1, [r1]
	streq	r3, [r0]
	add	r3, r3, r1
	sub	r3, r3, r2
	cmp	r3, r4
	popge	{r4, pc}
	pop	{r4, lr}
	b	flush_out
.L11:
	.align	2
.L10:
	.word	WRITE_THRESHOLD
	.word	wptr
	.word	WB
	.word	WRITE_BUFFER_SIZE
	.word	wst
	.size	prepare_write, .-prepare_write
	.comm	wst,4,4
	.comm	wptr,4,4
	.comm	WRITE_THRESHOLD,4,4
	.comm	WRITE_BUFFER_SIZE,4,4
	.comm	WB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
