	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmon_end_download
_pmon_end_download:                     ## @pmon_end_download
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movl	%edi, %r15d
	movq	_tftp_in_use@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_6
## %bb.1:
	movq	_tftp_file@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	callq	_fclose
	movq	$0, (%rbx)
	movq	_tftp_localname@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	-48(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movl	(%rbx), %edi
	movq	_S_IROTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	-48(%rbp), %esi
	callq	_chmod
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	movl	$-1, %esi
	callq	_mips_send_command
	movq	_tftp_name@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_strlen
	leaq	13(%rax), %rdi
	callq	_xmalloc
	movq	%rax, %rbx
	leaq	L_.str(%rip), %rsi
	movq	%rax, %rdi
	callq	_strcpy
	movq	(%r13), %rsi
	movq	%rbx, %rdi
	callq	_strcat
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcat
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_mips_send_command
	movq	%rbx, %rdi
	callq	_xfree
	leaq	L_.str.3(%rip), %rdi
	callq	_mips_expect_download
	testl	%eax, %eax
	je	LBB0_12
## %bb.4:
	movq	(%r13), %rdi
	callq	_mips_expect_download
	testl	%eax, %eax
	je	LBB0_12
## %bb.5:
	leaq	L_.str.4(%rip), %rdi
	callq	_mips_expect_download
	testl	%eax, %eax
	je	LBB0_12
LBB0_6:
	movq	_mips_monitor@GOTPCREL(%rip), %rax
	cmpl	$128, (%rax)
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.5(%rip), %rdi
	callq	_pmon_check_ack
	leaq	L_.str.6(%rip), %rdi
	movl	%r15d, %esi
	callq	_pmon_check_entry_address
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.7(%rip), %rdi
	movl	%r15d, %esi
	callq	_pmon_check_entry_address
	leaq	L_.str.5(%rip), %rdi
	callq	_pmon_check_ack
LBB0_9:
	movl	%r14d, %edi
	callq	_pmon_check_total
	testl	%eax, %eax
	je	LBB0_12
## %bb.10:
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.11:
	movq	_tftp_localname@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_remove
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_tftp_in_use,8,3                ## @tftp_in_use
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"load -b -s "

	.comm	_tftp_file,8,3                  ## @tftp_file
	.comm	_tftp_localname,4,2             ## @tftp_localname
	.comm	_S_IROTH,4,2                    ## @S_IROTH
L_.str.1:                               ## @.str.1
	.asciz	"initEther\r"

	.comm	_tftp_name,8,3                  ## @tftp_name
L_.str.2:                               ## @.str.2
	.asciz	"\r"

L_.str.3:                               ## @.str.3
	.asciz	"Downloading from "

L_.str.4:                               ## @.str.4
	.asciz	", ^C to abort\r\n"

	.comm	_mips_monitor,4,2               ## @mips_monitor
L_.str.5:                               ## @.str.5
	.asciz	"termination"

L_.str.6:                               ## @.str.6
	.asciz	"Entry address is "

L_.str.7:                               ## @.str.7
	.asciz	"Entry Address  = "

	.no_dead_strip	_pmon_end_download
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmon_end_download
_pmon_end_download:                     ; @pmon_end_download
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _tftp_in_use@GOTPAGE
Lloh1:
	ldr	x22, [x22, _tftp_in_use@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_6
; %bb.1:
Lloh2:
	adrp	x21, _tftp_file@GOTPAGE
Lloh3:
	ldr	x21, [x21, _tftp_file@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_fclose
	str	xzr, [x21]
Lloh4:
	adrp	x21, _tftp_localname@GOTPAGE
Lloh5:
	ldr	x21, [x21, _tftp_localname@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x1, sp, #8
	bl	_stat
	cbnz	x0, LBB0_3
; %bb.2:
	ldr	w0, [x21]
	ldr	w8, [sp, #8]
Lloh6:
	adrp	x9, _S_IROTH@GOTPAGE
Lloh7:
	ldr	x9, [x9, _S_IROTH@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_chmod
LBB0_3:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #-1
	bl	_mips_send_command
Lloh11:
	adrp	x23, _tftp_name@GOTPAGE
Lloh12:
	ldr	x23, [x23, _tftp_name@GOTPAGEOFF]
	ldr	x0, [x23]
	bl	_strlen
	add	x0, x0, #13
	bl	_xmalloc
	mov	x21, x0
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcpy
	ldr	x1, [x23]
	mov	x0, x21
	bl	_strcat
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_strcat
	mov	x0, x21
	mov	w1, #0
	bl	_mips_send_command
	mov	x0, x21
	bl	_xfree
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_mips_expect_download
	cbz	w0, LBB0_12
; %bb.4:
	ldr	x0, [x23]
	bl	_mips_expect_download
	cbz	w0, LBB0_12
; %bb.5:
Lloh19:
	adrp	x0, l_.str.4@PAGE
Lloh20:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_mips_expect_download
	cbz	w0, LBB0_12
LBB0_6:
Lloh21:
	adrp	x8, _mips_monitor@GOTPAGE
Lloh22:
	ldr	x8, [x8, _mips_monitor@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, #128
	b.ne	LBB0_8
; %bb.7:
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pmon_check_ack
Lloh26:
	adrp	x0, l_.str.6@PAGE
Lloh27:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x20
	bl	_pmon_check_entry_address
	b	LBB0_9
LBB0_8:
Lloh28:
	adrp	x0, l_.str.7@PAGE
Lloh29:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x1, x20
	bl	_pmon_check_entry_address
Lloh30:
	adrp	x0, l_.str.5@PAGE
Lloh31:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pmon_check_ack
LBB0_9:
	mov	x0, x19
	bl	_pmon_check_total
	cbz	w0, LBB0_12
; %bb.10:
	ldr	x8, [x22]
	cbz	x8, LBB0_12
; %bb.11:
Lloh32:
	adrp	x8, _tftp_localname@GOTPAGE
Lloh33:
	ldr	x8, [x8, _tftp_localname@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
	bl	_remove
LBB0_12:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_tftp_in_use,8,3                ; @tftp_in_use
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"load -b -s "

	.comm	_tftp_file,8,3                  ; @tftp_file
	.comm	_tftp_localname,4,2             ; @tftp_localname
	.comm	_S_IROTH,4,2                    ; @S_IROTH
l_.str.1:                               ; @.str.1
	.asciz	"initEther\r"

	.comm	_tftp_name,8,3                  ; @tftp_name
l_.str.2:                               ; @.str.2
	.asciz	"\r"

l_.str.3:                               ; @.str.3
	.asciz	"Downloading from "

l_.str.4:                               ; @.str.4
	.asciz	", ^C to abort\r\n"

	.comm	_mips_monitor,4,2               ; @mips_monitor
l_.str.5:                               ; @.str.5
	.asciz	"termination"

l_.str.6:                               ; @.str.6
	.asciz	"Entry address is "

l_.str.7:                               ; @.str.7
	.asciz	"Entry Address  = "

	.no_dead_strip	_pmon_end_download
.subsections_via_symbols
