	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function monitor_write_to_file
_monitor_write_to_file:                 ## @monitor_write_to_file
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-32(%rbp), %rdi
	leaq	-28(%rbp), %rsi
	callq	_get_hex2
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	movl	-32(%rbp), %eax
	cmpl	-28(%rbp), %eax
	jg	LBB0_7
## %bb.2:
	xorl	%eax, %eax
	callq	_get_token
	testq	%rax, %rax
	leaq	L_.str(%rip), %r14
	cmovneq	%rax, %r14
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movslq	-28(%rbp), %rbx
	movslq	-32(%rbp), %rdi
	subq	%rdi, %rbx
	incq	%rbx
	movq	_MEMORY_mem@GOTPCREL(%rip), %rax
	shlq	$2, %rdi
	addq	(%rax), %rdi
	movl	$1, %esi
	movl	%ebx, %edx
	movq	%r15, %rcx
	callq	_fwrite
	cmpq	%rbx, %rax
	jb	LBB0_5
LBB0_6:
	movq	%r15, %rdi
	callq	_fclose
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_perror
	jmp	LBB0_7
LBB0_5:
	movq	%r14, %rdi
	callq	_perror
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"memdump.dat"

L_.str.1:                               ## @.str.1
	.asciz	"wb"

	.comm	_MEMORY_mem,8,3                 ## @MEMORY_mem
	.no_dead_strip	_monitor_write_to_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function monitor_write_to_file
_monitor_write_to_file:                 ; @monitor_write_to_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	add	x0, sp, #12
	add	x1, sp, #8
	bl	_get_hex2
	cbz	x0, LBB0_5
; %bb.1:
	ldp	w9, w8, [sp, #8]
	cmp	w8, w9
	b.gt	LBB0_5
; %bb.2:
	bl	_get_token
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	cmp	x0, #0
	csel	x19, x8, x0, eq
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_fopen
	cbz	x0, LBB0_6
; %bb.3:
	mov	x20, x0
	ldpsw	x8, x9, [sp, #8]
	sub	x8, x8, x9
	add	x21, x8, #1
Lloh4:
	adrp	x8, _MEMORY_mem@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MEMORY_mem@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	add	x0, x8, x9, lsl #2
	mov	w1, #1
	mov	x2, x21
	mov	x3, x20
	bl	_fwrite
	cmp	x0, x21
	b.lo	LBB0_7
LBB0_4:
	mov	x0, x20
	bl	_fclose
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_6:
	mov	x0, x19
	bl	_perror
	b	LBB0_5
LBB0_7:
	mov	x0, x19
	bl	_perror
	b	LBB0_4
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memdump.dat"

l_.str.1:                               ; @.str.1
	.asciz	"wb"

	.comm	_MEMORY_mem,8,3                 ; @MEMORY_mem
	.no_dead_strip	_monitor_write_to_file
.subsections_via_symbols
