	.file	"extr_curl_stream.c_fetch_chunk.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d-%d"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"we got it all, in one request.\n"
	.text
	.p2align 4
	.type	fetch_chunk, @function
fetch_chunk:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 56
	.cfi_def_cfa_offset 96
	mov	edi, DWORD PTR 56[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	curl_easy_perform@PLT
	cmp	QWORD PTR CURLE_OK[rip], rax
	je	.L2
	mov	r12, rax
	mov	rdi, rbp
	call	lock@PLT
	mov	QWORD PTR 80[rbp], r12
	mov	rdi, rbp
	mov	DWORD PTR 0[rbp], 1
	call	unlock@PLT
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L31
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rdi, rbp
	call	lock@PLT
	cmp	QWORD PTR 72[rbp], 0
	jne	.L32
	cmp	QWORD PTR 64[rbp], 0
	lea	rdi, .LC1[rip]
	je	.L29
	mov	eax, DWORD PTR BLOCK_SHIFT[rip]
	xor	edi, edi
	sub	eax, 1
	test	DWORD PTR 4[rbp], eax
	sete	dil
	call	assert@PLT
	mov	ecx, DWORD PTR BLOCK_SHIFT[rip]
	mov	r12d, DWORD PTR 4[rbp]
	sar	r12d, cl
	cmp	QWORD PTR 16[rbp], 0
	movsx	r12, r12d
	je	.L28
	mov	rbx, QWORD PTR 24[rbp]
	mov	r13, QWORD PTR 32[rbp]
	cmp	r12, rbx
	jb	.L8
	.p2align 4,,10
	.p2align 3
.L9:
	cmp	rbx, r12
	jne	.L11
	xor	ebx, ebx
	test	r12, r12
	jne	.L12
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L14:
	add	rbx, 1
	cmp	rbx, r12
	je	.L13
.L12:
	mov	rsi, rbx
	mov	rdi, r13
	call	HAVE_BLOCK@PLT
	test	rax, rax
	jne	.L14
	cmp	r12, rbx
	je	.L13
	mov	r12, rbx
.L11:
	mov	rdi, r12
	call	DEBUG_MESSAGE@PLT
	mov	ecx, DWORD PTR BLOCK_SHIFT[rip]
	movsx	rax, DWORD PTR BLOCK_SIZE[rip]
	sal	r12, cl
	lea	r8, -1[r12+rax]
	mov	rax, QWORD PTR 16[rbp]
	mov	QWORD PTR 40[rbp], r12
	mov	rcx, r12
	cmp	rax, r8
	ja	.L15
	test	rax, rax
	setne	dl
	sub	rax, 1
	test	dl, dl
	cmovne	r8, rax
.L15:
	mov	QWORD PTR 48[rbp], r8
	mov	r12, rsp
	mov	esi, 32
	lea	rdx, .LC0[rip]
	mov	rdi, r12
	call	fz_snprintf@PLT
	mov	eax, DWORD PTR BLOCK_SIZE[rip]
	add	eax, DWORD PTR 40[rbp]
	mov	rdi, rbp
	mov	DWORD PTR 4[rbp], eax
	call	unlock@PLT
	mov	rdi, r12
	call	DEBUG_MESSAGE@PLT
	mov	edi, DWORD PTR 56[rbp]
	mov	esi, DWORD PTR CURLOPT_RANGE[rip]
	mov	rdx, r12
	call	curl_easy_setopt@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L10:
	add	r12, 1
	cmp	rbx, r12
	jbe	.L9
.L8:
	mov	rsi, r12
	mov	rdi, r13
	call	HAVE_BLOCK@PLT
	test	rax, rax
	jne	.L10
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdi, r12
	.p2align 4,,10
	.p2align 3
.L29:
	call	DEBUG_MESSAGE@PLT
.L28:
	mov	DWORD PTR 8[rbp], 1
	mov	DWORD PTR 0[rbp], 1
.L27:
	mov	rdi, rbp
	call	unlock@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L32:
	mov	QWORD PTR 72[rbp], 0
	mov	edi, DWORD PTR 56[rbp]
	xor	edx, edx
	mov	esi, DWORD PTR CURLOPT_NOBODY[rip]
	call	curl_easy_setopt@PLT
	mov	edi, DWORD PTR 56[rbp]
	mov	esi, DWORD PTR CURLOPT_HEADERFUNCTION[rip]
	xor	edx, edx
	call	curl_easy_setopt@PLT
	mov	edi, DWORD PTR 56[rbp]
	mov	esi, DWORD PTR CURLOPT_WRITEHEADER[rip]
	xor	edx, edx
	call	curl_easy_setopt@PLT
	cmp	QWORD PTR 64[rbp], 0
	je	.L27
	mov	eax, DWORD PTR BLOCK_SIZE[rip]
	mov	r12, rsp
	xor	ecx, ecx
	mov	esi, 32
	lea	rdx, .LC0[rip]
	mov	rdi, r12
	lea	r8d, -1[rax]
	movsx	r8, r8d
	call	fz_snprintf@PLT
	mov	edi, DWORD PTR 56[rbp]
	mov	esi, DWORD PTR CURLOPT_RANGE[rip]
	mov	rdx, r12
	call	curl_easy_setopt@PLT
	mov	eax, DWORD PTR BLOCK_SIZE[rip]
	mov	DWORD PTR 4[rbp], eax
	jmp	.L27
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	fetch_chunk, .-fetch_chunk
	.comm	CURLOPT_WRITEHEADER,4,4
	.comm	CURLOPT_RANGE,4,4
	.comm	CURLOPT_NOBODY,4,4
	.comm	CURLOPT_HEADERFUNCTION,4,4
	.comm	CURLE_OK,8,8
	.comm	BLOCK_SIZE,4,4
	.comm	BLOCK_SHIFT,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_curl_stream.c_fetch_chunk.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"%d-%d\000"
	.align	2
.LC1:
	.ascii	"we got it all, in one request.\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fetch_chunk, %function
fetch_chunk:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L32
	sub	sp, sp, #48
	mov	r4, r0
	ldr	r0, [r0, #32]
	ldr	r3, [r3]
	str	r3, [sp, #44]
	mov	r3,#0
	bl	curl_easy_perform
	ldr	r3, .L32+4
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L2
	mov	r5, r0
	mov	r0, r4
	bl	lock
	mov	r3, #1
	mov	r0, r4
	str	r5, [r4, #44]
	str	r3, [r4]
	bl	unlock
.L1:
	ldr	r3, .L32
	ldr	r2, [r3]
	ldr	r3, [sp, #44]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L28
	add	sp, sp, #48
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r0, r4
	bl	lock
	ldr	r3, [r4, #40]
	cmp	r3, #0
	bne	.L29
	ldr	r3, [r4, #36]
	cmp	r3, #0
	beq	.L30
	ldr	r8, .L32+8
	ldr	r2, [r4, #4]
	ldr	r3, [r8]
	sub	r3, r3, #1
	tst	r3, r2
	moveq	r0, #1
	movne	r0, #0
	bl	assert
	ldr	r2, [r4, #12]
	ldr	r3, [r8]
	ldr	r5, [r4, #4]
	cmp	r2, #0
	asr	r5, r5, r3
	beq	.L7
	ldr	r6, [r4, #16]
	ldr	r7, [r4, #20]
	cmp	r5, r6
	bcc	.L8
.L9:
	cmp	r6, r5
	bne	.L11
	cmp	r5, #0
	movne	r6, #0
	bne	.L12
	b	.L13
.L14:
	add	r6, r6, #1
	cmp	r6, r5
	beq	.L13
.L12:
	mov	r1, r6
	mov	r0, r7
	bl	HAVE_BLOCK
	cmp	r0, #0
	bne	.L14
	cmp	r5, r6
	beq	.L13
	mov	r5, r6
.L11:
	ldr	r6, .L32+12
	mov	r0, r5
	bl	DEBUG_MESSAGE
	ldr	r2, [r6]
	ldr	r3, [r8]
	ldr	r1, [r4, #12]
	lsl	r3, r5, r3
	sub	r2, r2, #1
	add	r2, r2, r3
	cmp	r1, r2
	movhi	r0, #0
	movls	r0, #1
	cmp	r1, #0
	moveq	r0, #0
	cmp	r0, #0
	subne	r2, r1, #1
	str	r3, [r4, #24]
	mov	r1, #32
	str	r2, [r4, #28]
	add	r0, sp, #12
	str	r2, [sp]
	ldr	r2, .L32+16
	bl	fz_snprintf
	ldr	r2, [r6]
	ldr	r3, [r4, #24]
	mov	r0, r4
	add	r3, r3, r2
	str	r3, [r4, #4]
	bl	unlock
	add	r0, sp, #12
	bl	DEBUG_MESSAGE
	ldr	r3, .L32+20
	ldr	r0, [r4, #32]
	ldr	r1, [r3]
	add	r2, sp, #12
	bl	curl_easy_setopt
	b	.L1
.L10:
	add	r5, r5, #1
	cmp	r6, r5
	bls	.L9
.L8:
	mov	r1, r5
	mov	r0, r7
	bl	HAVE_BLOCK
	cmp	r0, #0
	bne	.L10
	b	.L11
.L13:
	mov	r0, r5
	bl	DEBUG_MESSAGE
.L7:
	mov	r3, #1
	mov	r0, r4
	str	r3, [r4, #8]
	str	r3, [r4]
	bl	unlock
	b	.L1
.L30:
	ldr	r0, .L32+24
	bl	DEBUG_MESSAGE
	b	.L7
.L29:
	mov	r5, #0
	ldr	r3, .L32+28
	mov	r2, r5
	ldr	r1, [r3]
	ldr	r0, [r4, #32]
	str	r5, [r4, #40]
	bl	curl_easy_setopt
	ldr	r3, .L32+32
	mov	r2, r5
	ldr	r1, [r3]
	ldr	r0, [r4, #32]
	bl	curl_easy_setopt
	ldr	r3, .L32+36
	mov	r2, r5
	ldr	r1, [r3]
	ldr	r0, [r4, #32]
	bl	curl_easy_setopt
	ldr	r3, [r4, #36]
	cmp	r3, r5
	bne	.L31
.L5:
	mov	r0, r4
	bl	unlock
	b	.L1
.L31:
	ldr	r6, .L32+12
	mov	r3, r5
	ldr	r2, [r6]
	mov	r1, #32
	sub	r2, r2, #1
	str	r2, [sp]
	add	r0, sp, #12
	ldr	r2, .L32+16
	bl	fz_snprintf
	ldr	r3, .L32+20
	ldr	r0, [r4, #32]
	ldr	r1, [r3]
	add	r2, sp, #12
	bl	curl_easy_setopt
	ldr	r3, [r6]
	str	r3, [r4, #4]
	b	.L5
.L28:
	bl	__stack_chk_fail
.L33:
	.align	2
.L32:
	.word	.LC2
	.word	CURLE_OK
	.word	BLOCK_SHIFT
	.word	BLOCK_SIZE
	.word	.LC0
	.word	CURLOPT_RANGE
	.word	.LC1
	.word	CURLOPT_NOBODY
	.word	CURLOPT_HEADERFUNCTION
	.word	CURLOPT_WRITEHEADER
	.size	fetch_chunk, .-fetch_chunk
	.comm	CURLOPT_WRITEHEADER,4,4
	.comm	CURLOPT_RANGE,4,4
	.comm	CURLOPT_NOBODY,4,4
	.comm	CURLOPT_HEADERFUNCTION,4,4
	.comm	CURLE_OK,4,4
	.comm	BLOCK_SIZE,4,4
	.comm	BLOCK_SHIFT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
