	.file	"extr_tftp.c_tftp_receive_packet.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Received too short packet"
.LC1:
	.string	"TFTP error: %s\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Internal error: Unexpected packet"
	.section	.rodata.str1.1
.LC3:
	.string	"%s"
	.text
	.p2align 4
	.type	tftp_receive_packet, @function
tftp_receive_packet:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	ecx, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rbp, QWORD PTR [rdi]
	mov	r14, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	r15, rsp
	lea	r9, 4[rsp]
	mov	DWORD PTR 4[rsp], 4
	mov	rax, QWORD PTR 40[rbp]
	mov	rsi, QWORD PTR 16[rbp]
	mov	r8, r15
	mov	edi, DWORD PTR 48[rbp]
	mov	r13d, DWORD PTR CURLE_OK[rip]
	lea	rdx, 4[rax]
	call	recvfrom@PLT
	mov	edx, DWORD PTR 4[rbp]
	mov	DWORD PTR 0[rbp], eax
	test	edx, edx
	je	.L22
	mov	edx, eax
.L2:
	cmp	edx, 3
	jg	.L3
	lea	rsi, .LC0[rip]
	mov	rdi, r14
	xor	eax, eax
	call	failf@PLT
	movzx	eax, WORD PTR TFTP_EVENT_TIMEOUT[rip]
	mov	WORD PTR 8[rbp], ax
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	lea	r15, 16[rbp]
	mov	rdi, r15
	call	getrpacketevent@PLT
	mov	WORD PTR 8[rbp], ax
	cmp	ax, 132
	je	.L5
	ja	.L6
	cmp	ax, 130
	je	.L7
	cmp	ax, 131
	jne	.L9
	mov	rdi, r15
	call	getrpacketblock@PLT
	mov	ecx, DWORD PTR 0[rbp]
	mov	rbx, QWORD PTR 16[rbp]
	movzx	eax, ax
	lea	r15d, -4[rcx]
	mov	DWORD PTR 24[rbp], eax
	add	rbx, 4
	movsx	r15, r15d
	mov	rdi, rbx
	mov	rsi, r15
	call	Curl_strnlen@PLT
	cmp	rax, r15
	jb	.L24
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, r12
	call	Curl_pgrsUpdate@PLT
	test	rax, rax
	je	.L1
.L25:
	mov	esi, 131
	mov	rdi, rbp
	call	tftp_state_machine@PLT
	mov	r13d, DWORD PTR CURLE_ABORTED_BY_CALLBACK[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	cmp	ax, 133
	je	.L10
.L9:
	mov	rdi, r14
	xor	eax, eax
	lea	rdx, .LC2[rip]
	lea	rsi, .LC3[rip]
	call	failf@PLT
	mov	rdi, r12
	call	Curl_pgrsUpdate@PLT
	test	rax, rax
	je	.L1
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edx, DWORD PTR 4[rsp]
	lea	rdi, 32[rbp]
	mov	rsi, r15
	call	memcpy@PLT
	mov	eax, DWORD PTR 4[rsp]
	mov	edx, DWORD PTR 0[rbp]
	mov	DWORD PTR 4[rbp], eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L7:
	mov	eax, DWORD PTR 0[rbp]
	mov	rdi, rbp
	lea	edx, -2[rax]
	mov	rax, QWORD PTR 16[rbp]
	lea	rsi, 2[rax]
	call	tftp_parse_option_ack@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L10
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	DWORD PTR 0[rbp], 4
	jle	.L10
	mov	edi, DWORD PTR 28[rbp]
	call	NEXT_BLOCKNUM@PLT
	mov	rdi, r15
	mov	ebx, eax
	call	getrpacketblock@PLT
	cmp	bx, ax
	jne	.L10
	mov	eax, DWORD PTR 0[rbp]
	mov	esi, DWORD PTR CLIENTWRITE_BODY[rip]
	mov	rdi, r12
	lea	ecx, -4[rax]
	mov	rax, QWORD PTR 16[rbp]
	lea	rdx, 4[rax]
	call	Curl_client_write@PLT
	mov	r13d, eax
	test	eax, eax
	jne	.L26
	mov	edx, DWORD PTR 0[rbp]
	mov	eax, DWORD PTR [r14]
	mov	rdi, r14
	lea	esi, -4[rdx+rax]
	mov	DWORD PTR [r14], esi
	call	Curl_pgrsSetDownloadCounter@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L24:
	mov	rdx, rbx
	lea	rsi, .LC1[rip]
	mov	rdi, r14
	call	infof@PLT
	jmp	.L10
.L26:
	mov	esi, 131
	mov	rdi, rbp
	call	tftp_state_machine@PLT
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	tftp_receive_packet, .-tftp_receive_packet
	.comm	TFTP_EVENT_TIMEOUT,2,2
	.comm	CURLE_OK,4,4
	.comm	CURLE_ABORTED_BY_CALLBACK,4,4
	.comm	CLIENTWRITE_BODY,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_tftp.c_tftp_receive_packet.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Received too short packet\000"
	.align	2
.LC1:
	.ascii	"TFTP error: %s\012\000"
	.align	2
.LC2:
	.ascii	"Internal error: Unexpected packet\000"
	.align	2
.LC3:
	.ascii	"%s\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	tftp_receive_packet, %function
tftp_receive_packet:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	lr, #4
	mov	r5, r0
	ldr	r4, [r0]
	sub	sp, sp, #24
	ldr	r2, [r4, #28]
	ldr	ip, .L21
	ldr	r6, .L21+4
	add	r3, sp, #16
	add	r9, sp, #12
	ldr	r1, [r4, #12]
	ldr	r0, [r4, #32]
	add	r2, r2, lr
	str	r3, [sp, #4]
	str	r9, [sp]
	mov	r3, #0
	ldr	r6, [r6]
	str	r6, [sp, #20]
	mov	r6,#0
	ldr	r8, [r5, #4]
	ldr	r7, [ip]
	str	lr, [sp, #16]
	bl	recvfrom
	ldr	r3, [r4, #4]
	mov	r6, r0
	cmp	r3, #0
	str	r0, [r4]
	beq	.L18
.L2:
	cmp	r6, #3
	bgt	.L3
	mov	r0, r8
	ldr	r1, .L21+8
	bl	failf
	ldr	r3, .L21+12
	ldrh	r3, [r3]
	strh	r3, [r4, #8]	@ movhi
.L1:
	ldr	r3, .L21+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L19
	mov	r0, r7
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	add	r6, r4, #12
	mov	r0, r6
	bl	getrpacketevent
	sub	r3, r0, #130
	strh	r0, [r4, #8]	@ movhi
	cmp	r3, #3
	ldrls	pc, [pc, r3, asl #2]
	b	.L5
.L7:
	.word	.L10
	.word	.L9
	.word	.L8
	.word	.L6
.L8:
	ldr	r3, [r4]
	cmp	r3, #4
	ble	.L6
	ldr	r0, [r4, #20]
	bl	NEXT_BLOCKNUM
	mov	r3, r0
	mov	r0, r6
	mov	r6, r3
	bl	getrpacketblock
	cmp	r6, r0
	bne	.L6
	ldr	r3, [r4]
	ldr	r2, [r4, #12]
	ldr	r1, .L21+16
	mov	r0, r5
	ldr	r1, [r1]
	sub	r3, r3, #4
	add	r2, r2, #4
	bl	Curl_client_write
	subs	r7, r0, #0
	bne	.L20
	ldr	r1, [r4]
	ldr	r3, [r8]
	sub	r1, r1, #4
	add	r1, r1, r3
	mov	r0, r8
	str	r1, [r8]
	bl	Curl_pgrsSetDownloadCounter
.L6:
	mov	r0, r5
	bl	Curl_pgrsUpdate
	cmp	r0, #0
	beq	.L1
	mov	r0, r4
	mov	r1, #131
	bl	tftp_state_machine
	ldr	r3, .L21+20
	ldr	r7, [r3]
	b	.L1
.L18:
	ldr	r10, [sp, #16]
	mov	r1, r9
	mov	r2, r10
	add	r0, r4, #24
	bl	memcpy
	str	r10, [r4, #4]
	b	.L2
.L9:
	mov	r0, r6
	bl	getrpacketblock
	ldr	r9, [r4, #12]
	ldr	r6, [r4]
	add	r9, r9, #4
	sub	r6, r6, #4
	str	r0, [r4, #16]
	mov	r1, r6
	mov	r0, r9
	bl	Curl_strnlen
	cmp	r0, r6
	bcs	.L6
	mov	r2, r9
	mov	r0, r8
	ldr	r1, .L21+24
	bl	infof
	b	.L6
.L10:
	ldr	r2, [r4]
	ldr	r1, [r4, #12]
	mov	r0, r4
	sub	r2, r2, #2
	add	r1, r1, #2
	bl	tftp_parse_option_ack
	subs	r7, r0, #0
	beq	.L6
	b	.L1
.L20:
	mov	r0, r4
	mov	r1, #131
	bl	tftp_state_machine
	b	.L1
.L19:
	bl	__stack_chk_fail
.L5:
	mov	r0, r8
	ldr	r2, .L21+28
	ldr	r1, .L21+32
	bl	failf
	b	.L6
.L22:
	.align	2
.L21:
	.word	CURLE_OK
	.word	.LC4
	.word	.LC0
	.word	TFTP_EVENT_TIMEOUT
	.word	CLIENTWRITE_BODY
	.word	CURLE_ABORTED_BY_CALLBACK
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	tftp_receive_packet, .-tftp_receive_packet
	.comm	TFTP_EVENT_TIMEOUT,2,2
	.comm	CURLE_OK,4,4
	.comm	CURLE_ABORTED_BY_CALLBACK,4,4
	.comm	CLIENTWRITE_BODY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
