	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tftp_receive                   ## -- Begin function tftp_receive
	.p2align	4, 0x90
_tftp_receive:                          ## @tftp_receive
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r13
	movq	%rdx, %r12
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAXPKTSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	$0, 8(%r12)
	testq	%r13, %r13
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_10
## %bb.1:
	movl	16(%r13), %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_write_file
	cltq
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	%rax, 8(%rcx)
	movq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_send_ack
	testl	%eax, %eax
	jle	LBB0_7
## %bb.2:
	movl	$-1, %ebx
	movq	_LOG_ERR@GOTPCREL(%rip), %r12
	leaq	L_.str.1(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	movq	(%r14), %rdx
	incl	%ebx
	movq	_maxtimeouts@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_tftp_log
	movq	(%r14), %rsi
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_send_ack
	testl	%eax, %eax
	jg	LBB0_3
LBB0_7:
	movq	_segsize@GOTPCREL(%rip), %rax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, (%rax)
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_10
## %bb.8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_49
## %bb.9:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gettimeofday                   ## TAILCALL
	.p2align	4, 0x90
LBB0_42:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_gettimeofday
	movslq	%r13d, %rax
	movq	_segsize@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_43
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
                                        ##     Child Loop BB0_38 Depth 2
	movq	(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	incq	%rax
	movq	%rax, (%r14)
	xorl	%r12d, %r12d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	callq	_packettype
	movl	%ebx, %edi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	leaq	L_.str.8(%rip), %rsi
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_tftp_log
LBB0_27:                                ##   in Loop: Header=BB0_11 Depth=2
	incl	%r12d
LBB0_11:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_DEBUG_SIMPLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_debug@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_tftp_log
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	_MAXPKTSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_timeoutpacket@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	%ebx, %edi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_receive_packet
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_14
## %bb.22:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	(%r15), %rdi
	movq	_DATA@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	jne	LBB0_26
## %bb.23:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	incl	20(%rax)
	movq	8(%r15), %rcx
	movq	(%r14), %rdx
	cmpq	%rdx, %rcx
	je	LBB0_28
## %bb.24:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_tftp_log
	movl	%ebx, %edi
	callq	_synchnet
	movq	(%r14), %rax
	decq	%rax
	cmpq	%rax, 8(%r15)
	jne	LBB0_27
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=2
	movq	_maxtimeouts@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	je	LBB0_15
## %bb.18:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_RP_TIMEOUT@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_11 Depth=2
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rcx
	leaq	L_.str.4(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_tftp_log
	movl	%ebx, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_send_ack
	incl	%r12d
	jmp	LBB0_11
LBB0_28:                                ##   in Loop: Header=BB0_10 Depth=1
	testl	%r13d, %r13d
	je	LBB0_36
## %bb.29:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	16(%r15), %edi
	movl	%r13d, %esi
	callq	_write_file
	movl	%eax, %r12d
	cltq
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	addq	%rax, 8(%rcx)
	testl	%r12d, %r12d
	jle	LBB0_30
## %bb.34:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%r13d, %eax
	movq	_segsize@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_36
## %bb.35:                              ##   in Loop: Header=BB0_10 Depth=1
	xorl	%eax, %eax
	callq	_write_close
	jmp	LBB0_36
LBB0_25:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	_LOG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_tftp_log
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	incl	16(%rax)
LBB0_36:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_send_ack
	testl	%eax, %eax
	movq	_LOG_ERR@GOTPCREL(%rip), %r12
	jle	LBB0_42
## %bb.37:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	$-1, %ebx
	.p2align	4, 0x90
LBB0_38:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r12), %edi
	movq	(%r14), %rdx
	incl	%ebx
	movq	_maxtimeouts@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_39
## %bb.41:                              ##   in Loop: Header=BB0_38 Depth=2
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_tftp_log
	movq	(%r14), %rsi
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_send_ack
	testl	%eax, %eax
	jg	LBB0_38
	jmp	LBB0_42
LBB0_15:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rcx
	leaq	L_.str.3(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_tftp_log
	jmp	LBB0_16
LBB0_20:
	movq	_DEBUG_SIMPLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_debug@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_16
## %bb.21:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r13d, %edi
	callq	_rp_strerror
	leaq	L_.str.5(%rip), %rsi
	movl	%ebx, %edi
	movq	%rax, %rdx
	jmp	LBB0_40
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_49
## %bb.5:
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tftp_log                       ## TAILCALL
LBB0_39:
	leaq	L_.str(%rip), %rsi
LBB0_40:
	xorl	%eax, %eax
	callq	_tftp_log
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_49
## %bb.17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_43:
	movq	_acting_as_client@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_16
## %bb.44:
	movq	_pktsize@GOTPCREL(%rip), %rbx
LBB0_45:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %edx
	movq	_timeoutpacket@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	_receive_packet
	testl	%eax, %eax
	jle	LBB0_16
## %bb.46:                              ##   in Loop: Header=BB0_45 Depth=1
	movq	(%r15), %rax
	movq	_DATA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_45
## %bb.47:                              ##   in Loop: Header=BB0_45 Depth=1
	movq	(%r14), %rsi
	cmpq	8(%r15), %rsi
	jne	LBB0_45
## %bb.48:                              ##   in Loop: Header=BB0_45 Depth=1
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	callq	_send_ack
	jmp	LBB0_45
LBB0_30:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.9(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_tftp_log
	testl	%r12d, %r12d
	js	LBB0_31
## %bb.32:
	movq	_ENOSPACE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	jmp	LBB0_33
LBB0_31:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$100, %rsi
LBB0_33:
	movl	%ebx, %edi
	callq	_send_error
	jmp	LBB0_16
LBB0_49:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPKTSIZE,4,2                 ## @MAXPKTSIZE
	.comm	_maxtimeouts,4,2                ## @maxtimeouts
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot send ACK packet #%d, giving up"

L_.str.1:                               ## @.str.1
	.asciz	"Cannot send ACK packet #%d, trying again"

	.comm	_segsize,8,3                    ## @segsize
	.comm	_options,8,3                    ## @options
	.comm	_OPT_ROLLOVER,8,3               ## @OPT_ROLLOVER
	.comm	_debug,4,2                      ## @debug
	.comm	_DEBUG_SIMPLE,4,2               ## @DEBUG_SIMPLE
	.comm	_LOG_DEBUG,4,2                  ## @LOG_DEBUG
L_.str.2:                               ## @.str.2
	.asciz	"Receiving DATA block %d"

	.comm	_timeoutpacket,4,2              ## @timeoutpacket
L_.str.3:                               ## @.str.3
	.asciz	"Timeout #%d on DATA block %d, giving up"

	.comm	_RP_TIMEOUT,4,2                 ## @RP_TIMEOUT
	.comm	_LOG_WARNING,4,2                ## @LOG_WARNING
L_.str.4:                               ## @.str.4
	.asciz	"Timeout #%d on DATA block %d"

L_.str.5:                               ## @.str.5
	.asciz	"Aborting: %s"

	.comm	_DATA,8,3                       ## @DATA
L_.str.6:                               ## @.str.6
	.asciz	"Expected DATA block %d, got block %d"

	.comm	_LOG_INFO,4,2                   ## @LOG_INFO
L_.str.7:                               ## @.str.7
	.asciz	"Trying to sync"

L_.str.8:                               ## @.str.8
	.asciz	"Expected DATA block, got %s block"

L_.str.9:                               ## @.str.9
	.asciz	"write_file returned %d"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOSPACE,8,3                   ## @ENOSPACE
	.comm	_acting_as_client,8,3           ## @acting_as_client
	.comm	_pktsize,4,2                    ## @pktsize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tftp_receive                   ; -- Begin function tftp_receive
	.p2align	2
_tftp_receive:                          ; @tftp_receive
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x23, x4
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _MAXPKTSIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPKTSIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	str	xzr, [x2, #8]
Lloh8:
	adrp	x28, _segsize@GOTPAGE
Lloh9:
	ldr	x28, [x28, _segsize@GOTPAGEOFF]
	cbz	x3, LBB0_6
; %bb.1:
	ldr	w0, [x3, #16]
	mov	x1, x23
	bl	_write_file
	ldr	x8, [x22, #8]
	add	x8, x8, w0, sxtw
	str	x8, [x22, #8]
	ldr	x1, [x20]
	mov	x0, x19
	bl	_send_ack
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.2:
	mov	w25, #-1
Lloh10:
	adrp	x26, _maxtimeouts@GOTPAGE
Lloh11:
	ldr	x26, [x26, _maxtimeouts@GOTPAGEOFF]
Lloh12:
	adrp	x27, _LOG_ERR@GOTPAGE
Lloh13:
	ldr	x27, [x27, _LOG_ERR@GOTPAGEOFF]
Lloh14:
	adrp	x24, l_.str.1@PAGE
Lloh15:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x26]
	ldr	w0, [x27]
	ldr	x8, [x20]
	add	w25, w25, #1
	sub	sp, sp, #16
	cmp	w25, w9
	b.eq	LBB0_31
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	x8, [sp]
	mov	x1, x24
	bl	_tftp_log
	add	sp, sp, #16
	ldr	x1, [x20]
	mov	x0, x19
	bl	_send_ack
	cmp	w0, #0
	b.gt	LBB0_3
LBB0_5:
	ldr	x8, [x28]
	cmp	x8, x23
	b.ne	LBB0_38
LBB0_6:
Lloh16:
	adrp	x23, _debug@GOTPAGE
Lloh17:
	ldr	x23, [x23, _debug@GOTPAGEOFF]
Lloh18:
	adrp	x28, _DEBUG_SIMPLE@GOTPAGE
Lloh19:
	ldr	x28, [x28, _DEBUG_SIMPLE@GOTPAGEOFF]
Lloh20:
	adrp	x25, _LOG_WARNING@GOTPAGE
Lloh21:
	ldr	x25, [x25, _LOG_WARNING@GOTPAGEOFF]
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_26 Depth 2
	mov	w27, #0
	ldr	x24, [x20]
	add	x8, x24, #1
	str	x8, [x20]
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_10 Depth=2
	ldr	w26, [x25]
	bl	_packettype
	str	x0, [sp, #-16]!
	mov	x0, x26
Lloh22:
	adrp	x1, l_.str.8@PAGE
Lloh23:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_tftp_log
	add	sp, sp, #16
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	w27, w27, #1
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x23]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
Lloh24:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	x8, [x20]
	str	x8, [sp, #-16]!
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_tftp_log
	add	sp, sp, #16
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=2
Lloh29:
	adrp	x8, _MAXPKTSIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MAXPKTSIZE@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
Lloh32:
	adrp	x8, _timeoutpacket@GOTPAGE
Lloh33:
	ldr	x8, [x8, _timeoutpacket@GOTPAGEOFF]
Lloh34:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x3, #0
	bl	_receive_packet
	mov	x26, x0
	tbnz	w0, #31, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	x0, [x21]
Lloh35:
	adrp	x8, _DATA@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DATA@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w8, [x22, #20]
	add	w8, w8, #1
	str	w8, [x22, #20]
	ldr	x8, [x21, #8]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w0, [x25]
	stp	x9, x8, [sp, #-16]!
Lloh38:
	adrp	x1, l_.str.6@PAGE
Lloh39:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_tftp_log
	add	sp, sp, #16
	mov	x0, x19
	bl	_synchnet
	ldr	x8, [x21, #8]
	ldr	x9, [x20]
	sub	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_9
	b	LBB0_23
LBB0_16:                                ;   in Loop: Header=BB0_10 Depth=2
Lloh40:
	adrp	x8, _maxtimeouts@GOTPAGE
Lloh41:
	ldr	x8, [x8, _maxtimeouts@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	cmp	w27, w8
	b.eq	LBB0_32
; %bb.17:                               ;   in Loop: Header=BB0_10 Depth=2
Lloh43:
	adrp	x8, _RP_TIMEOUT@GOTPAGE
Lloh44:
	ldr	x8, [x8, _RP_TIMEOUT@GOTPAGEOFF]
Lloh45:
	ldr	w8, [x8]
	cmp	w26, w8
	b.ne	LBB0_33
; %bb.18:                               ;   in Loop: Header=BB0_10 Depth=2
	ldr	w0, [x25]
	ldr	x8, [x20]
	stp	x27, x8, [sp, #-16]!
Lloh46:
	adrp	x1, l_.str.4@PAGE
Lloh47:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_tftp_log
	add	sp, sp, #16
	mov	x0, x19
	mov	x1, x24
	bl	_send_ack
	add	w27, w27, #1
	b	LBB0_10
LBB0_19:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh48:
	adrp	x27, _LOG_ERR@GOTPAGE
Lloh49:
	ldr	x27, [x27, _LOG_ERR@GOTPAGEOFF]
	cbz	w26, LBB0_24
; %bb.20:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x21, #16]
	mov	x1, x26
	bl	_write_file
	ldr	x8, [x22, #8]
	add	x8, x8, w0, sxtw
	str	x8, [x22, #8]
	cmp	w0, #0
	b.le	LBB0_44
; %bb.21:                               ;   in Loop: Header=BB0_7 Depth=1
Lloh50:
	adrp	x8, _segsize@GOTPAGE
Lloh51:
	ldr	x8, [x8, _segsize@GOTPAGEOFF]
Lloh52:
	ldr	x8, [x8]
	cmp	x8, w26, uxtw
	b.eq	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_7 Depth=1
	bl	_write_close
	b	LBB0_24
LBB0_23:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh53:
	adrp	x8, _LOG_INFO@GOTPAGE
Lloh54:
	ldr	x8, [x8, _LOG_INFO@GOTPAGEOFF]
Lloh55:
	ldr	w0, [x8]
Lloh56:
	adrp	x1, l_.str.7@PAGE
Lloh57:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_tftp_log
	str	x24, [x20]
	ldr	w8, [x22, #16]
	add	w8, w8, #1
	str	w8, [x22, #16]
Lloh58:
	adrp	x27, _LOG_ERR@GOTPAGE
Lloh59:
	ldr	x27, [x27, _LOG_ERR@GOTPAGEOFF]
LBB0_24:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x1, [x20]
	mov	x0, x19
	bl	_send_ack
	cmp	w0, #1
	b.lt	LBB0_28
; %bb.25:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	w24, #-1
LBB0_26:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh60:
	adrp	x8, _maxtimeouts@GOTPAGE
Lloh61:
	ldr	x8, [x8, _maxtimeouts@GOTPAGEOFF]
Lloh62:
	ldr	w9, [x8]
	ldr	w0, [x27]
	ldr	x8, [x20]
	add	w24, w24, #1
	sub	sp, sp, #16
	cmp	w24, w9
	b.eq	LBB0_31
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=2
	str	x8, [sp]
Lloh63:
	adrp	x1, l_.str.1@PAGE
Lloh64:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_tftp_log
	add	sp, sp, #16
	ldr	x1, [x20]
	mov	x0, x19
	bl	_send_ack
	cmp	w0, #0
	b.gt	LBB0_26
LBB0_28:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x22
	mov	x1, #0
	bl	_gettimeofday
Lloh65:
	adrp	x8, _segsize@GOTPAGE
Lloh66:
	ldr	x8, [x8, _segsize@GOTPAGEOFF]
Lloh67:
	ldr	x8, [x8]
	cmp	x8, w26, sxtw
	b.eq	LBB0_7
; %bb.29:
Lloh68:
	adrp	x8, _acting_as_client@GOTPAGE
Lloh69:
	ldr	x8, [x8, _acting_as_client@GOTPAGEOFF]
Lloh70:
	ldr	x8, [x8]
	cbnz	x8, LBB0_36
; %bb.30:
Lloh71:
	adrp	x22, _pktsize@GOTPAGE
Lloh72:
	ldr	x22, [x22, _pktsize@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh73:
	adrp	x8, _timeoutpacket@GOTPAGE
Lloh74:
	ldr	x8, [x8, _timeoutpacket@GOTPAGEOFF]
Lloh75:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x3, #0
	bl	_receive_packet
	cmp	w0, #1
	b.ge	LBB0_41
	b	LBB0_36
LBB0_31:
	str	x8, [sp]
Lloh76:
	adrp	x1, l_.str@PAGE
Lloh77:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_35
LBB0_32:
Lloh78:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh79:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh80:
	ldr	w0, [x8]
	ldr	x8, [x20]
                                        ; kill: def $w27 killed $w27 killed $x27 def $x27
	stp	x27, x8, [sp, #-16]!
Lloh81:
	adrp	x1, l_.str.3@PAGE
Lloh82:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_35
LBB0_33:
	ldr	w8, [x23]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_36
; %bb.34:
Lloh83:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh84:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh85:
	ldr	w19, [x8]
	mov	x0, x26
	bl	_rp_strerror
	str	x0, [sp, #-16]!
Lloh86:
	adrp	x1, l_.str.5@PAGE
Lloh87:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
LBB0_35:
	bl	_tftp_log
	add	sp, sp, #16
LBB0_36:
	ldur	x8, [x29, #-88]
Lloh88:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh89:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh90:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_48
; %bb.37:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_38:
	ldur	x8, [x29, #-88]
Lloh91:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh92:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh93:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_48
; %bb.39:
	mov	x0, x22
	mov	x1, #0
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_gettimeofday
LBB0_40:                                ;   in Loop: Header=BB0_41 Depth=1
	ldr	w2, [x22]
Lloh94:
	adrp	x8, _timeoutpacket@GOTPAGE
Lloh95:
	ldr	x8, [x8, _timeoutpacket@GOTPAGEOFF]
Lloh96:
	ldr	w4, [x8]
	mov	x0, x19
	mov	x1, x21
	mov	x3, #0
	bl	_receive_packet
	cmp	w0, #0
	b.le	LBB0_36
LBB0_41:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21]
Lloh97:
	adrp	x9, _DATA@GOTPAGE
Lloh98:
	ldr	x9, [x9, _DATA@GOTPAGEOFF]
Lloh99:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_40
; %bb.42:                               ;   in Loop: Header=BB0_41 Depth=1
	ldr	x1, [x20]
	ldr	x8, [x21, #8]
	cmp	x1, x8
	b.ne	LBB0_40
; %bb.43:                               ;   in Loop: Header=BB0_41 Depth=1
	mov	x0, x19
	bl	_send_ack
	b	LBB0_40
LBB0_44:
	mov	x24, x0
	ldr	w0, [x27]
	str	x24, [sp, #-16]!
Lloh100:
	adrp	x1, l_.str.9@PAGE
Lloh101:
	add	x1, x1, l_.str.9@PAGEOFF
	bl	_tftp_log
	add	sp, sp, #16
	tbnz	w24, #31, LBB0_46
; %bb.45:
Lloh102:
	adrp	x8, _ENOSPACE@GOTPAGE
Lloh103:
	ldr	x8, [x8, _ENOSPACE@GOTPAGEOFF]
Lloh104:
	ldr	x1, [x8]
	b	LBB0_47
LBB0_46:
Lloh105:
	adrp	x8, _errno@GOTPAGE
Lloh106:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh107:
	ldr	x8, [x8]
	add	x1, x8, #100
LBB0_47:
	mov	x0, x19
	bl	_send_error
	b	LBB0_36
LBB0_48:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh58, Lloh59
	.loh AdrpAdd	Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpAdd	Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGotLdr	Lloh73, Lloh74, Lloh75
	.loh AdrpLdrGot	Lloh71, Lloh72
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.loh AdrpAdd	Lloh86, Lloh87
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotLdr	Lloh88, Lloh89, Lloh90
	.loh AdrpLdrGotLdr	Lloh91, Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh94, Lloh95, Lloh96
	.loh AdrpLdrGotLdr	Lloh97, Lloh98, Lloh99
	.loh AdrpAdd	Lloh100, Lloh101
	.loh AdrpLdrGotLdr	Lloh102, Lloh103, Lloh104
	.loh AdrpLdrGotLdr	Lloh105, Lloh106, Lloh107
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPKTSIZE,4,2                 ; @MAXPKTSIZE
	.comm	_maxtimeouts,4,2                ; @maxtimeouts
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot send ACK packet #%d, giving up"

l_.str.1:                               ; @.str.1
	.asciz	"Cannot send ACK packet #%d, trying again"

	.comm	_segsize,8,3                    ; @segsize
	.comm	_options,8,3                    ; @options
	.comm	_OPT_ROLLOVER,8,3               ; @OPT_ROLLOVER
	.comm	_debug,4,2                      ; @debug
	.comm	_DEBUG_SIMPLE,4,2               ; @DEBUG_SIMPLE
	.comm	_LOG_DEBUG,4,2                  ; @LOG_DEBUG
l_.str.2:                               ; @.str.2
	.asciz	"Receiving DATA block %d"

	.comm	_timeoutpacket,4,2              ; @timeoutpacket
l_.str.3:                               ; @.str.3
	.asciz	"Timeout #%d on DATA block %d, giving up"

	.comm	_RP_TIMEOUT,4,2                 ; @RP_TIMEOUT
	.comm	_LOG_WARNING,4,2                ; @LOG_WARNING
l_.str.4:                               ; @.str.4
	.asciz	"Timeout #%d on DATA block %d"

l_.str.5:                               ; @.str.5
	.asciz	"Aborting: %s"

	.comm	_DATA,8,3                       ; @DATA
l_.str.6:                               ; @.str.6
	.asciz	"Expected DATA block %d, got block %d"

	.comm	_LOG_INFO,4,2                   ; @LOG_INFO
l_.str.7:                               ; @.str.7
	.asciz	"Trying to sync"

l_.str.8:                               ; @.str.8
	.asciz	"Expected DATA block, got %s block"

l_.str.9:                               ; @.str.9
	.asciz	"write_file returned %d"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOSPACE,8,3                   ; @ENOSPACE
	.comm	_acting_as_client,8,3           ; @acting_as_client
	.comm	_pktsize,4,2                    ; @pktsize
.subsections_via_symbols
