	.file	"extr_buffer.c_evbuffer_file_segment_new.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	evbuffer_file_segment_new
	.type	evbuffer_file_segment_new, @function
evbuffer_file_segment_new:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14d, edi
	mov	edi, 48
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13d, ecx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	ebp, esi
	mov	esi, 1
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	ebx, edx
	sub	rsp, 16
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	mm_calloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L1
	mov	DWORD PTR [rax], 1
	mov	DWORD PTR 4[rax], r14d
	mov	DWORD PTR 8[rax], r13d
	mov	DWORD PTR 12[rax], ebp
	mov	QWORD PTR 40[rax], 0
	mov	QWORD PTR 32[rax], 0
	cmp	ebx, -1
	je	.L13
.L3:
	mov	DWORD PTR 16[r12], ebx
	test	ebp, ebp
	js	.L5
	test	ebx, ebx
	js	.L5
	mov	eax, DWORD PTR EVBUFFER_CHAIN_MAX[rip]
	cmp	eax, ebx
	jl	.L5
	sub	eax, ebx
	cmp	eax, ebp
	jl	.L5
	mov	rdi, r12
	call	evbuffer_file_segment_materialize@PLT
	test	rax, rax
	js	.L5
	test	DWORD PTR EVBUF_FS_DISABLE_LOCKING[rip], r13d
	jne	.L1
	mov	edi, DWORD PTR 24[r12]
	xor	esi, esi
	call	EVTHREAD_ALLOC_LOCK@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rsi, 4[rsp]
	mov	edi, r14d
	call	fstat@PLT
	mov	ebx, DWORD PTR 4[rsp]
	test	rax, rax
	jns	.L3
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdi, r12
	xor	r12d, r12d
	call	mm_free@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	evbuffer_file_segment_new, .-evbuffer_file_segment_new
	.comm	EVBUF_FS_DISABLE_SENDFILE,4,4
	.comm	EVBUF_FS_DISABLE_LOCKING,4,4
	.comm	EVBUFFER_CHAIN_MAX,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_buffer.c_evbuffer_file_segment_new.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	evbuffer_file_segment_new
	.syntax unified
	.arm
	.fpu softvfp
	.type	evbuffer_file_segment_new, %function
evbuffer_file_segment_new:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r7, r3
	ldr	r3, .L15
	sub	sp, sp, #8
	mov	r8, r0
	mov	r6, r1
	mov	r0, #36
	mov	r1, #1
	mov	r5, r2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	bl	mm_calloc
	subs	r4, r0, #0
	beq	.L1
	mov	r2, #0
	mov	r3, #1
	cmn	r5, #1
	str	r8, [r4, #4]
	str	r7, [r4, #8]
	str	r6, [r4, #12]
	str	r3, [r4]
	str	r2, [r4, #32]
	str	r2, [r4, #28]
	beq	.L13
.L3:
	orrs	r3, r6, r5
	str	r5, [r4, #16]
	bmi	.L5
	ldr	r3, .L15+4
	ldr	r0, [r3]
	cmp	r0, r5
	blt	.L5
	sub	r0, r0, r5
	cmp	r0, r6
	blt	.L5
	mov	r0, r4
	bl	evbuffer_file_segment_materialize
	cmp	r0, #0
	blt	.L5
	ldr	r3, .L15+8
	ldr	r1, [r3]
	ands	r1, r7, r1
	bne	.L1
	ldr	r0, [r4, #24]
	bl	EVTHREAD_ALLOC_LOCK
	b	.L1
.L5:
	mov	r0, r4
	bl	mm_free
	mov	r4, #0
.L1:
	ldr	r3, .L15
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r4
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L13:
	mov	r0, r8
	mov	r1, sp
	bl	fstat
	cmp	r0, #0
	blt	.L5
	ldr	r5, [sp]
	b	.L3
.L14:
	bl	__stack_chk_fail
.L16:
	.align	2
.L15:
	.word	.LC0
	.word	EVBUFFER_CHAIN_MAX
	.word	EVBUF_FS_DISABLE_LOCKING
	.size	evbuffer_file_segment_new, .-evbuffer_file_segment_new
	.comm	EVBUF_FS_DISABLE_SENDFILE,4,4
	.comm	EVBUF_FS_DISABLE_LOCKING,4,4
	.comm	EVBUFFER_CHAIN_MAX,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
