	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fbsd_write_memory
_fbsd_write_memory:                     ## @fbsd_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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rsi, %r14
	movl	%edi, %ebx
	movl	%edi, %r13d
	andl	$-4, %r13d
	movl	%edi, %r15d
	andl	$3, %r15d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	leal	(%r15,%rdx), %eax
	movslq	%eax, %rdi
	addq	$3, %rdi
	movq	%rdi, %rax
	shrq	$2, %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	andl	$-4, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_alloca
	movq	%rax, %r12
	movq	_debug_threads@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movsbl	(%r14), %edx
	movslq	%ebx, %rcx
	leaq	L_.str(%rip), %rsi
	callq	_fprintf
LBB0_2:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_PT_READ_D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_inferior_pid@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	xorl	%ebx, %ebx
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	callq	_ptrace
	movl	%eax, (%r12)
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpl	$2, %ecx
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	jl	LBB0_4
## %bb.3:
	movq	_PT_READ_D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r14), %esi
	movl	$4294967295, %eax               ## imm = 0xFFFFFFFF
	addq	%rcx, %rax
	movl	%eax, %ebx
	leal	(%r13,%rax,4), %edx
	xorl	%ecx, %ecx
	callq	_ptrace
	movl	%eax, (%r12,%rbx,4)
	movl	%r15d, %eax
	addq	%rax, %r12
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	jmp	LBB0_5
LBB0_4:
	movl	%r15d, %eax
	addq	%rax, %r12
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpl	$1, %eax
	jne	LBB0_9
LBB0_5:
	movl	%eax, %r15d
	xorl	%r12d, %r12d
	movq	_errno@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, (%r14)
	movq	_PT_WRITE_D@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_inferior_pid@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r12,4), %ecx
	movl	%r13d, %edx
	callq	_ptrace
	movl	(%r14), %ebx
	testl	%ebx, %ebx
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%r12
	addl	$4, %r13d
	cmpq	%r12, %r15
	jne	LBB0_6
## %bb.8:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug_threads,8,3              ## @debug_threads
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Writing %02x to %08lx\n"

	.comm	_PT_READ_D,4,2                  ## @PT_READ_D
	.comm	_inferior_pid,4,2               ## @inferior_pid
	.comm	_PT_WRITE_D,4,2                 ## @PT_WRITE_D
	.no_dead_strip	_fbsd_write_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fbsd_write_memory
_fbsd_write_memory:                     ; @fbsd_write_memory
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x22, x1
	mov	x23, x0
	and	w19, w0, #0xfffffffc
	and	w25, w0, #0x3
	add	w8, w25, w2
	sxtw	x8, w8
	add	x24, x8, #3
	lsr	x26, x24, #2
	and	w0, w24, #0xfffffffc
	bl	_alloca
	mov	x20, x0
Lloh0:
	adrp	x8, _debug_threads@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug_threads@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _stderr@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldrsb	w2, [x22]
	sxtw	x3, w23
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
LBB0_2:
Lloh8:
	adrp	x27, _PT_READ_D@GOTPAGE
Lloh9:
	ldr	x27, [x27, _PT_READ_D@GOTPAGEOFF]
	ldr	w0, [x27]
Lloh10:
	adrp	x23, _inferior_pid@GOTPAGE
Lloh11:
	ldr	x23, [x23, _inferior_pid@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x2, x19
	mov	w3, #0
	bl	_ptrace
	str	w0, [x20]
	cmp	w26, #2
	b.lt	LBB0_4
; %bb.3:
	ldr	w0, [x27]
	ldr	w1, [x23]
	mov	w8, #-1
	add	x26, x26, x8
	add	w2, w19, w26, lsl #2
	mov	w3, #0
	bl	_ptrace
	str	w0, [x20, w26, uxtw #2]
	add	x0, x20, w25, uxtw
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	b	LBB0_5
LBB0_4:
	add	x0, x20, w25, uxtw
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	cmp	w26, #1
	b.ne	LBB0_8
LBB0_5:
	ubfx	x21, x24, #2, #32
Lloh12:
	adrp	x22, _errno@GOTPAGE
Lloh13:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
Lloh14:
	adrp	x24, _PT_WRITE_D@GOTPAGE
Lloh15:
	ldr	x24, [x24, _PT_WRITE_D@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [x22]
	ldr	w0, [x24]
	ldr	w1, [x23]
	ldr	w3, [x20]
	mov	x2, x19
	bl	_ptrace
	ldr	w0, [x22]
	cbnz	w0, LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	w19, w19, #4
	add	x20, x20, #4
	subs	x21, x21, #1
	b.ne	LBB0_6
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_debug_threads,8,3              ; @debug_threads
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Writing %02x to %08lx\n"

	.comm	_PT_READ_D,4,2                  ; @PT_READ_D
	.comm	_inferior_pid,4,2               ; @inferior_pid
	.comm	_PT_WRITE_D,4,2                 ; @PT_WRITE_D
	.no_dead_strip	_fbsd_write_memory
.subsections_via_symbols
