	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function monitor_write_memory
_monitor_write_memory:                  ## @monitor_write_memory
	.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	%edx, %r12d
	movq	%rsi, %r15
	movl	%edi, %r14d
	callq	_paddr
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_monitor_debug
	movq	_current_monitor@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	_MO_ADDR_BITS_REMOVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_2
## %bb.1:
	movl	%r14d, %edi
	callq	_ADDR_BITS_REMOVE
	movl	%eax, %r14d
	movq	(%rbx), %rax
LBB0_2:
	cmpq	$0, 64(%rax)
	je	LBB0_10
## %bb.3:
	testl	%r12d, %r12d
	jle	LBB0_16
## %bb.4:
	movl	%r12d, %ecx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpb	$0, (%r15,%rbx)
	jne	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpq	%rbx, %rcx
	jne	LBB0_5
## %bb.7:
	movl	%ecx, %ebx
LBB0_8:
	cmpl	$5, %ebx
	jb	LBB0_10
## %bb.9:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_monitor_debug
	movq	_current_monitor@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_MO_FILL_USES_ADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	leal	-1(%r14), %edx
	testl	%ecx, %ecx
	movq	64(%rax), %rdi
	cmovel	%ecx, %edx
	addl	%ebx, %edx
	movl	%r14d, %esi
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_monitor_printf
	jmp	LBB0_29
LBB0_10:
	cmpl	$4, %r12d
	jl	LBB0_13
## %bb.11:
	movl	%r14d, %ecx
	andl	$3, %ecx
	jne	LBB0_13
## %bb.12:
	movq	16(%rax), %r13
	testq	%r13, %r13
	je	LBB0_13
## %bb.18:
	movl	$4, %ebx
	movq	%r15, %rdi
	movl	$4, %esi
	callq	_extract_unsigned_integer
	movl	%eax, %r12d
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_monitor_debug
	jmp	LBB0_19
LBB0_13:
	cmpl	$2, %r12d
	jl	LBB0_16
## %bb.14:
	movl	%r14d, %ecx
	andl	$1, %ecx
	jne	LBB0_16
## %bb.15:
	movq	24(%rax), %r13
	movl	$2, %ebx
	testq	%r13, %r13
	jne	LBB0_17
LBB0_16:
	movq	32(%rax), %r13
	movl	$1, %ebx
LBB0_17:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_extract_unsigned_integer
	movl	%eax, %r12d
LBB0_19:
	movq	_current_monitor@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %eax
	movq	_MO_NO_ECHO_ON_SETMEM@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_21
## %bb.20:
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_monitor_printf_noecho
LBB0_29:
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_monitor_expect_prompt
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_MO_SETMEM_INTERACTIVE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_28
## %bb.22:
	movq	%r13, %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_monitor_printf_noecho
	movq	(%r15), %rax
	cmpq	$0, 56(%rax)
	je	LBB0_24
## %bb.23:
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_monitor_debug
	movq	_setmem_resp_delim_pattern@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_monitor_expect_regexp
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_monitor_printf
	movq	(%r15), %rax
LBB0_24:
	cmpq	$0, 48(%rax)
	je	LBB0_26
## %bb.25:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_monitor_debug
	movq	(%r15), %rax
	movq	48(%rax), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_monitor_expect
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_monitor_printf
	movq	(%r15), %rax
LBB0_26:
	movl	40(%rax), %esi
	testl	%esi, %esi
	je	LBB0_29
## %bb.27:
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_monitor_printf
	jmp	LBB0_29
LBB0_28:
	movq	%r13, %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_monitor_printf
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MON write %d %s\n"

	.comm	_current_monitor,8,3            ## @current_monitor
	.comm	_MO_ADDR_BITS_REMOVE,4,2        ## @MO_ADDR_BITS_REMOVE
L_.str.1:                               ## @.str.1
	.asciz	"MON FILL %d\n"

	.comm	_MO_FILL_USES_ADDR,4,2          ## @MO_FILL_USES_ADDR
L_.str.2:                               ## @.str.2
	.asciz	"Hostval(%08x) val(%08x)\n"

	.comm	_MO_NO_ECHO_ON_SETMEM,4,2       ## @MO_NO_ECHO_ON_SETMEM
	.comm	_MO_SETMEM_INTERACTIVE,4,2      ## @MO_SETMEM_INTERACTIVE
L_.str.3:                               ## @.str.3
	.asciz	"EXP setmem.resp_delim"

	.comm	_setmem_resp_delim_pattern,4,2  ## @setmem_resp_delim_pattern
L_.str.4:                               ## @.str.4
	.asciz	"%x\r"

L_.str.5:                               ## @.str.5
	.asciz	"EXP setmem.term"

L_.str.6:                               ## @.str.6
	.asciz	"%s"

	.no_dead_strip	_monitor_write_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function monitor_write_memory
_monitor_write_memory:                  ; @monitor_write_memory
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	bl	_paddr
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_monitor_debug
Lloh2:
	adrp	x24, _current_monitor@GOTPAGE
Lloh3:
	ldr	x24, [x24, _current_monitor@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	w9, [x8]
Lloh4:
	adrp	x10, _MO_ADDR_BITS_REMOVE@GOTPAGE
Lloh5:
	ldr	x10, [x10, _MO_ADDR_BITS_REMOVE@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_ADDR_BITS_REMOVE
	mov	x20, x0
	ldr	x8, [x24]
LBB0_2:
	ldr	x9, [x8, #64]
	cbz	x9, LBB0_10
; %bb.3:
	cmp	w22, #1
	b.lt	LBB0_18
; %bb.4:
	mov	x19, #0
	mov	w9, w22
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w10, [x21, x19]
	cbnz	w10, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x19, x19, #1
	cmp	x9, x19
	b.ne	LBB0_5
; %bb.7:
	mov	x19, x9
LBB0_8:
	cmp	w19, #5
	b.lo	LBB0_10
; %bb.9:
	mov	x8, x19
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_monitor_debug
	ldr	x8, [x24]
	ldr	w9, [x8]
Lloh9:
	adrp	x10, _MO_FILL_USES_ADDR@GOTPAGE
Lloh10:
	ldr	x10, [x10, _MO_FILL_USES_ADDR@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	ldr	x0, [x8, #64]
	sub	w8, w20, #1
	tst	w10, w9
	csel	w8, wzr, w8, eq
	add	w8, w19, w8
	stp	x8, xzr, [sp]
	b	LBB0_30
LBB0_10:
	cmp	w22, #4
	b.lt	LBB0_14
; %bb.11:
	and	w9, w20, #0x3
	cbnz	w9, LBB0_14
; %bb.12:
	ldr	x23, [x8, #16]
	cbz	x23, LBB0_14
; %bb.13:
	mov	w19, #4
	mov	x0, x21
	mov	w1, #4
	bl	_extract_unsigned_integer
	mov	x22, x0
	ldr	w8, [x21]
	stp	x8, x22, [sp]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_monitor_debug
	b	LBB0_20
LBB0_14:
	cmp	w22, #2
	b.lt	LBB0_18
; %bb.15:
	tbnz	w20, #0, LBB0_18
; %bb.16:
	ldr	x23, [x8, #24]
	cbz	x23, LBB0_18
; %bb.17:
	mov	w19, #2
	b	LBB0_19
LBB0_18:
	ldr	x23, [x8, #32]
	mov	w19, #1
LBB0_19:
	mov	x0, x21
	mov	x1, x19
	bl	_extract_unsigned_integer
	mov	x22, x0
LBB0_20:
	ldr	x8, [x24]
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _MO_NO_ECHO_ON_SETMEM@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MO_NO_ECHO_ON_SETMEM@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_22
; %bb.21:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	str	x22, [sp]
	mov	x0, x23
	mov	x1, x20
	bl	_monitor_printf_noecho
	b	LBB0_32
LBB0_22:
Lloh17:
	adrp	x9, _MO_SETMEM_INTERACTIVE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MO_SETMEM_INTERACTIVE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_29
; %bb.23:
	mov	x0, x23
	mov	x1, x20
	bl	_monitor_printf_noecho
	ldr	x8, [x24]
	ldr	x9, [x8, #56]
	cbz	x9, LBB0_25
; %bb.24:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_monitor_debug
Lloh22:
	adrp	x0, _setmem_resp_delim_pattern@GOTPAGE
Lloh23:
	ldr	x0, [x0, _setmem_resp_delim_pattern@GOTPAGEOFF]
	mov	x1, #0
	mov	w2, #0
	bl	_monitor_expect_regexp
Lloh24:
	adrp	x0, l_.str.4@PAGE
Lloh25:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x22
	bl	_monitor_printf
	ldr	x8, [x24]
LBB0_25:
	ldr	x9, [x8, #48]
	cbz	x9, LBB0_27
; %bb.26:
Lloh26:
	adrp	x0, l_.str.5@PAGE
Lloh27:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_monitor_debug
	ldr	x8, [x24]
	ldr	x0, [x8, #48]
	mov	x1, #0
	mov	w2, #0
	bl	_monitor_expect
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x22
	bl	_monitor_printf
	ldr	x8, [x24]
LBB0_27:
	ldr	w1, [x8, #40]
	cbz	w1, LBB0_32
; %bb.28:
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_31
LBB0_29:
                                        ; kill: def $w22 killed $w22 killed $x22 def $x22
	str	x22, [sp]
	mov	x0, x23
LBB0_30:
	mov	x1, x20
LBB0_31:
	bl	_monitor_printf
LBB0_32:
	mov	x0, #0
	mov	w1, #0
	bl	_monitor_expect_prompt
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MON write %d %s\n"

	.comm	_current_monitor,8,3            ; @current_monitor
	.comm	_MO_ADDR_BITS_REMOVE,4,2        ; @MO_ADDR_BITS_REMOVE
l_.str.1:                               ; @.str.1
	.asciz	"MON FILL %d\n"

	.comm	_MO_FILL_USES_ADDR,4,2          ; @MO_FILL_USES_ADDR
l_.str.2:                               ; @.str.2
	.asciz	"Hostval(%08x) val(%08x)\n"

	.comm	_MO_NO_ECHO_ON_SETMEM,4,2       ; @MO_NO_ECHO_ON_SETMEM
	.comm	_MO_SETMEM_INTERACTIVE,4,2      ; @MO_SETMEM_INTERACTIVE
l_.str.3:                               ; @.str.3
	.asciz	"EXP setmem.resp_delim"

	.comm	_setmem_resp_delim_pattern,4,2  ; @setmem_resp_delim_pattern
l_.str.4:                               ; @.str.4
	.asciz	"%x\r"

l_.str.5:                               ; @.str.5
	.asciz	"EXP setmem.term"

l_.str.6:                               ; @.str.6
	.asciz	"%s"

	.no_dead_strip	_monitor_write_memory
.subsections_via_symbols
