	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tftp_read
_tftp_read:                             ## @tftp_read
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %rbx
	movq	(%rbx), %rax
	movq	%rdx, %r13
	testq	%rax, %rax
	jle	LBB0_2
## %bb.1:
	movq	8(%rbx), %rcx
	movq	%rax, %r13
	subq	%rcx, %r13
	addq	%r15, %rcx
	cmpq	%rax, %rcx
	cmovbeq	%r15, %r13
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$32, %edi
	callq	_twiddle
	movq	8(%rbx), %rax
	movslq	16(%rbx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %r14
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r14d
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%r14d
	cmpl	%r14d, 20(%rbx)
	jle	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	xorl	%esi, %esi
	leaq	L_.str(%rip), %rdx
	callq	_tftp_senderr
	movq	%rbx, %rdi
	callq	_tftp_makereq
	testl	%eax, %eax
	jne	LBB0_9
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	20(%rbx), %eax
	cmpl	%r14d, %eax
	jge	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	%rbx, %rdi
	callq	_tftp_getnextblock
	testl	%eax, %eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=2
	cmpq	$0, 32(%rbx)
	je	LBB0_12
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	20(%rbx), %eax
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r14d, %eax
	jne	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	8(%rbx), %rax
	movslq	16(%rbx), %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	je	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_2 Depth=1
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
LBB0_21:                                ##   in Loop: Header=BB0_2 Depth=1
	movl	24(%rbx), %r12d
	subl	%edx, %r12d
	js	LBB0_22
## %bb.24:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, %r14d
	cmpq	%r14, %r13
	cmovbq	%r13, %r14
	movq	40(%rbx), %rax
	movslq	%edx, %rdi
	addq	(%rax), %rdi
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %r13
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_bcopy
	addq	%r14, %r15
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, %r15
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	addq	%r14, 8(%rbx)
	subq	%r14, %r13
	subq	%r14, %r15
	cmpq	$0, 32(%rbx)
	je	LBB0_2
## %bb.25:                              ##   in Loop: Header=BB0_2 Depth=1
	cmpl	%r14d, %r12d
	jne	LBB0_2
LBB0_3:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_11
	jmp	LBB0_23
LBB0_14:
                                        ## kill: def $eax killed $eax def $rax
LBB0_23:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_23
LBB0_9:
                                        ## kill: def $eax killed $eax def $rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_23
LBB0_11:
	movq	%r15, (%rcx)
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No error: read aborted"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_tftp_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tftp_read
_tftp_read:                             ; @tftp_read
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	ldr	x22, [x0]
	ldr	x8, [x22]
	mov	x25, x2
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	ldr	x9, [x22, #8]
	sub	x10, x8, x9
	add	x9, x9, x20
	cmp	x9, x8
	csel	x25, x10, x20, hi
LBB0_2:
Lloh0:
	adrp	x23, l_.str@PAGE
Lloh1:
	add	x23, x23, l_.str@PAGEOFF
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
	cbz	x25, LBB0_14
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w0, #32
	bl	_twiddle
	ldr	x8, [x22, #8]
	ldp	w9, w10, [x22, #16]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	udiv	x8, x8, x9
	add	w24, w8, #1
	cmp	w10, w24
	b.le	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	mov	w1, #0
	mov	x2, x23
	bl	_tftp_senderr
	mov	x0, x22
	bl	_tftp_makereq
	cbnz	w0, LBB0_15
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x22, #20]
	cmp	w8, w24
	b.ge	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	mov	x0, x22
	bl	_tftp_getnextblock
	cbnz	w0, LBB0_18
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x22, #32]
	cbz	x8, LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x22, #20]
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	cmp	w8, w24
	b.ne	LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, #8]
	ldrsw	x9, [x22, #16]
	udiv	x10, x8, x9
	msub	x8, x10, x9, x8
	ldr	w9, [x22, #24]
	subs	w26, w9, w8
	b.mi	LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	cmp	x25, x26
	csel	x24, x25, x26, lo
	ldr	x9, [x22, #40]
	ldr	x9, [x9]
	add	x0, x9, w8, sxtw
	mov	x1, x21
	mov	x2, x24
	bl	_bcopy
	add	x21, x21, x24
	ldr	x8, [x22, #8]
	add	x8, x8, x24
	str	x8, [x22, #8]
	sub	x25, x25, x24
	sub	x20, x20, x24
	ldr	x8, [x22, #32]
	cbz	x8, LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	cmp	w26, w24
	b.ne	LBB0_3
LBB0_14:
	mov	w0, #0
LBB0_15:
	cbz	x19, LBB0_18
; %bb.16:
	str	x20, [x19]
	b	LBB0_18
LBB0_17:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
LBB0_18:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No error: read aborted"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_tftp_read
.subsections_via_symbols
