	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dbg_monitor_init               ## -- Begin function dbg_monitor_init
	.p2align	4, 0x90
_dbg_monitor_init:                      ## @dbg_monitor_init
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	xorl	%eax, %eax
	callq	_dbg_get_debug_model
	movq	_dbg_model@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	xorl	%eax, %eax
	callq	_dbg_arch_supported
	testl	%eax, %eax
	je	LBB0_15
## %bb.1:
	movq	_bootverbose@GOTPCREL(%rip), %r14
	cmpq	$0, (%r14)
	je	LBB0_10
## %bb.2:
	movq	(%rbx), %rax
	movq	_ID_DFR0_CP_DEBUG_M_V6@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_15:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_db_printf                      ## TAILCALL
LBB0_4:
	movq	_ID_DFR0_CP_DEBUG_M_V6_1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_6:
	movq	_ID_DFR0_CP_DEBUG_M_V7@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_9
LBB0_8:
	movq	_ID_DFR0_CP_DEBUG_M_V7_1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	leaq	L_.str.5(%rip), %rax
	leaq	L_.str.6(%rip), %rsi
	cmoveq	%rax, %rsi
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_db_printf
LBB0_10:
	xorl	%eax, %eax
	callq	_dbg_get_ossr
	movq	_dbg_ossr@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_dbg_get_wrp_num
	movq	_dbg_watchpoint_num@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	callq	_dgb_get_brp_num
	movq	_dbg_breakpoint_num@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	cmpq	$0, (%r14)
	je	LBB0_12
## %bb.11:
	movl	(%rbx), %esi
	leaq	L_.str.7(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_db_printf
LBB0_12:
	xorl	%eax, %eax
	callq	_dbg_reset_state
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	callq	_dbg_enable_monitor
	testl	%eax, %eax
	je	LBB0_16
LBB0_14:
	movq	_cpuid@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PCPU_GET
	leaq	L_.str.8(%rip), %rdi
	movq	%rax, %rsi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_db_printf                      ## TAILCALL
LBB0_16:
	movq	_dbg_capable_var@GOTPCREL(%rip), %rdi
	movl	$1, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_atomic_set_int                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_dbg_model,8,3                  ## @dbg_model
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ARM Debug Architecture not supported\n"

	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.1:                               ## @.str.1
	.asciz	"ARM Debug Architecture %s\n"

	.comm	_ID_DFR0_CP_DEBUG_M_V6,8,3      ## @ID_DFR0_CP_DEBUG_M_V6
L_.str.2:                               ## @.str.2
	.asciz	"v6"

	.comm	_ID_DFR0_CP_DEBUG_M_V6_1,8,3    ## @ID_DFR0_CP_DEBUG_M_V6_1
L_.str.3:                               ## @.str.3
	.asciz	"v6.1"

	.comm	_ID_DFR0_CP_DEBUG_M_V7,8,3      ## @ID_DFR0_CP_DEBUG_M_V7
L_.str.4:                               ## @.str.4
	.asciz	"v7"

	.comm	_ID_DFR0_CP_DEBUG_M_V7_1,8,3    ## @ID_DFR0_CP_DEBUG_M_V7_1
L_.str.5:                               ## @.str.5
	.asciz	"v7.1"

L_.str.6:                               ## @.str.6
	.asciz	"unknown"

	.comm	_dbg_ossr,4,2                   ## @dbg_ossr
	.comm	_dbg_watchpoint_num,4,2         ## @dbg_watchpoint_num
	.comm	_dbg_breakpoint_num,4,2         ## @dbg_breakpoint_num
L_.str.7:                               ## @.str.7
	.asciz	"%d watchpoints and %d breakpoints supported\n"

	.comm	_dbg_capable_var,4,2            ## @dbg_capable_var
L_.str.8:                               ## @.str.8
	.asciz	"HW Breakpoints/Watchpoints not enabled on CPU%d\n"

	.comm	_cpuid,4,2                      ## @cpuid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dbg_monitor_init               ; -- Begin function dbg_monitor_init
	.p2align	2
_dbg_monitor_init:                      ; @dbg_monitor_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_dbg_get_debug_model
Lloh0:
	adrp	x20, _dbg_model@GOTPAGE
Lloh1:
	ldr	x20, [x20, _dbg_model@GOTPAGEOFF]
	str	x0, [x20]
	bl	_dbg_arch_supported
	cbz	w0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x19, _bootverbose@GOTPAGE
Lloh3:
	ldr	x19, [x19, _bootverbose@GOTPAGEOFF]
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.2:
	ldr	x8, [x20]
Lloh4:
	adrp	x9, _ID_DFR0_CP_DEBUG_M_V6@GOTPAGE
Lloh5:
	ldr	x9, [x9, _ID_DFR0_CP_DEBUG_M_V6@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
Lloh7:
	adrp	x8, l_.str.2@PAGE
Lloh8:
	add	x8, x8, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_4:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_db_printf
LBB0_5:
Lloh11:
	adrp	x9, _ID_DFR0_CP_DEBUG_M_V6_1@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ID_DFR0_CP_DEBUG_M_V6_1@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
Lloh14:
	adrp	x8, l_.str.3@PAGE
Lloh15:
	add	x8, x8, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_7:
Lloh16:
	adrp	x9, _ID_DFR0_CP_DEBUG_M_V7@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ID_DFR0_CP_DEBUG_M_V7@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
Lloh19:
	adrp	x8, l_.str.4@PAGE
Lloh20:
	add	x8, x8, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh21:
	adrp	x9, _ID_DFR0_CP_DEBUG_M_V7_1@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ID_DFR0_CP_DEBUG_M_V7_1@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
Lloh24:
	adrp	x10, l_.str.6@PAGE
Lloh25:
	add	x10, x10, l_.str.6@PAGEOFF
Lloh26:
	adrp	x11, l_.str.5@PAGE
Lloh27:
	add	x11, x11, l_.str.5@PAGEOFF
	cmp	x8, x9
	csel	x8, x11, x10, eq
LBB0_10:
	str	x8, [sp]
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_db_printf
LBB0_11:
	bl	_dbg_get_ossr
Lloh30:
	adrp	x8, _dbg_ossr@GOTPAGE
Lloh31:
	ldr	x8, [x8, _dbg_ossr@GOTPAGEOFF]
Lloh32:
	str	w0, [x8]
	bl	_dbg_get_wrp_num
Lloh33:
	adrp	x20, _dbg_watchpoint_num@GOTPAGE
Lloh34:
	ldr	x20, [x20, _dbg_watchpoint_num@GOTPAGEOFF]
	str	w0, [x20]
	bl	_dgb_get_brp_num
                                        ; kill: def $w0 killed $w0 def $x0
Lloh35:
	adrp	x8, _dbg_breakpoint_num@GOTPAGE
Lloh36:
	ldr	x8, [x8, _dbg_breakpoint_num@GOTPAGEOFF]
Lloh37:
	str	w0, [x8]
	ldr	x8, [x19]
	cbz	x8, LBB0_13
; %bb.12:
	ldr	w8, [x20]
	stp	x8, x0, [sp]
Lloh38:
	adrp	x0, l_.str.7@PAGE
Lloh39:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_db_printf
LBB0_13:
	bl	_dbg_reset_state
	cbnz	w0, LBB0_15
; %bb.14:
	bl	_dbg_enable_monitor
	cbz	w0, LBB0_16
LBB0_15:
Lloh40:
	adrp	x8, _cpuid@GOTPAGE
Lloh41:
	ldr	x8, [x8, _cpuid@GOTPAGEOFF]
Lloh42:
	ldr	w0, [x8]
	bl	_PCPU_GET
	str	x0, [sp]
Lloh43:
	adrp	x0, l_.str.8@PAGE
Lloh44:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_db_printf
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_16:
Lloh45:
	adrp	x0, _dbg_capable_var@GOTPAGE
Lloh46:
	ldr	x0, [x0, _dbg_capable_var@GOTPAGEOFF]
	mov	w1, #1
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_atomic_set_int
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_dbg_model,8,3                  ; @dbg_model
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ARM Debug Architecture not supported\n"

	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.1:                               ; @.str.1
	.asciz	"ARM Debug Architecture %s\n"

	.comm	_ID_DFR0_CP_DEBUG_M_V6,8,3      ; @ID_DFR0_CP_DEBUG_M_V6
l_.str.2:                               ; @.str.2
	.asciz	"v6"

	.comm	_ID_DFR0_CP_DEBUG_M_V6_1,8,3    ; @ID_DFR0_CP_DEBUG_M_V6_1
l_.str.3:                               ; @.str.3
	.asciz	"v6.1"

	.comm	_ID_DFR0_CP_DEBUG_M_V7,8,3      ; @ID_DFR0_CP_DEBUG_M_V7
l_.str.4:                               ; @.str.4
	.asciz	"v7"

	.comm	_ID_DFR0_CP_DEBUG_M_V7_1,8,3    ; @ID_DFR0_CP_DEBUG_M_V7_1
l_.str.5:                               ; @.str.5
	.asciz	"v7.1"

l_.str.6:                               ; @.str.6
	.asciz	"unknown"

	.comm	_dbg_ossr,4,2                   ; @dbg_ossr
	.comm	_dbg_watchpoint_num,4,2         ; @dbg_watchpoint_num
	.comm	_dbg_breakpoint_num,4,2         ; @dbg_breakpoint_num
l_.str.7:                               ; @.str.7
	.asciz	"%d watchpoints and %d breakpoints supported\n"

	.comm	_dbg_capable_var,4,2            ; @dbg_capable_var
l_.str.8:                               ; @.str.8
	.asciz	"HW Breakpoints/Watchpoints not enabled on CPU%d\n"

	.comm	_cpuid,4,2                      ; @cpuid
.subsections_via_symbols
