	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mips_enter_debug
_mips_enter_debug:                      ## @mips_enter_debug
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_mips_send_seq@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_mips_receive_seq@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_mips_monitor@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_MON_IDT@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str(%rip), %rdi
	cmoveq	%rax, %rdi
	xorl	%esi, %esi
	callq	_mips_send_command
	movl	$1, %edi
	callq	_sleep
	movq	_mips_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edx
	callq	_serial_write
	movq	(%r14), %rax
	cmpq	(%rbx), %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	callq	_mips_expect
LBB0_2:
	movq	_DATA_MAXLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	movl	$1, %esi
	movl	$3, %edx
	callq	_mips_receive_packet
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str.3(%rip), %rdi
	callq	_mips_error
LBB0_4:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_mips_send_seq,8,3              ## @mips_send_seq
	.comm	_mips_receive_seq,8,3           ## @mips_receive_seq
	.comm	_mips_monitor,8,3               ## @mips_monitor
	.comm	_MON_IDT,8,3                    ## @MON_IDT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"debug\r"

L_.str.1:                               ## @.str.1
	.asciz	"db tty0\r"

	.comm	_mips_desc,4,2                  ## @mips_desc
L_.str.2:                               ## @.str.2
	.asciz	"\r"

	.comm	_DATA_MAXLEN,4,2                ## @DATA_MAXLEN
L_.str.3:                               ## @.str.3
	.asciz	"Failed to initialize (didn't receive packet)."

	.no_dead_strip	_mips_enter_debug
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mips_enter_debug
_mips_enter_debug:                      ; @mips_enter_debug
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _mips_send_seq@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mips_send_seq@GOTPAGEOFF]
Lloh5:
	str	xzr, [x8]
Lloh6:
	adrp	x8, _mips_receive_seq@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mips_receive_seq@GOTPAGEOFF]
Lloh8:
	str	xzr, [x8]
Lloh9:
	adrp	x19, _mips_monitor@GOTPAGE
Lloh10:
	ldr	x19, [x19, _mips_monitor@GOTPAGEOFF]
	ldr	x8, [x19]
Lloh11:
	adrp	x20, _MON_IDT@GOTPAGE
Lloh12:
	ldr	x20, [x20, _MON_IDT@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh13:
	adrp	x10, l_.str@PAGE
Lloh14:
	add	x10, x10, l_.str@PAGEOFF
Lloh15:
	adrp	x11, l_.str.1@PAGE
Lloh16:
	add	x11, x11, l_.str.1@PAGEOFF
	cmp	x8, x9
	csel	x0, x11, x10, eq
	mov	w1, #0
	bl	_mips_send_command
	mov	w0, #1
	bl	_sleep
Lloh17:
	adrp	x8, _mips_desc@GOTPAGE
Lloh18:
	ldr	x8, [x8, _mips_desc@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w2, #1
	bl	_serial_write
	ldr	x8, [x19]
	ldr	x9, [x20]
	cmp	x8, x9
	b.eq	LBB0_2
; %bb.1:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_mips_expect
LBB0_2:
Lloh24:
	adrp	x8, _DATA_MAXLEN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _DATA_MAXLEN@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	add	w8, w8, #1
	mov	x9, x8
Lloh27:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh28:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x0, x9, x8
	mov	sp, x0
	mov	w1, #1
	mov	w2, #3
	bl	_mips_receive_packet
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_mips_error
LBB0_4:
	ldur	x8, [x29, #-24]
Lloh31:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh32:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_mips_send_seq,8,3              ; @mips_send_seq
	.comm	_mips_receive_seq,8,3           ; @mips_receive_seq
	.comm	_mips_monitor,8,3               ; @mips_monitor
	.comm	_MON_IDT,8,3                    ; @MON_IDT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"debug\r"

l_.str.1:                               ; @.str.1
	.asciz	"db tty0\r"

	.comm	_mips_desc,4,2                  ; @mips_desc
l_.str.2:                               ; @.str.2
	.asciz	"\r"

	.comm	_DATA_MAXLEN,4,2                ; @DATA_MAXLEN
l_.str.3:                               ; @.str.3
	.asciz	"Failed to initialize (didn't receive packet)."

	.no_dead_strip	_mips_enter_debug
.subsections_via_symbols
