	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_windbg_write_at                ## -- Begin function windbg_write_at
	.p2align	4, 0x90
_windbg_write_at:                       ## @windbg_write_at
	.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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	movq	$0, -48(%rbp)
	xorl	%r14d, %r14d
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.1:
	movq	%rdi, %rbx
	cmpl	$0, 4(%rdi)
	je	LBB0_9
## %bb.2:
	cmpl	$0, 12(%rbx)
	je	LBB0_9
## %bb.3:
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	_KD_MAX_PAYLOAD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$-40, %rsi
	movl	%ecx, %edi
	callq	_R_MIN
	movq	_DbgKdWriteVirtualMemoryApi@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -52(%rbp)
	movl	8(%rbx), %ecx
	movl	%ecx, -56(%rbp)
	movl	%r12d, -72(%rbp)
	movl	%eax, -80(%rbp)
	movl	(%rbx), %edx
	movl	4(%rbx), %edi
	movq	_KD_PACKET_TYPE_STATE_MANIPULATE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	xorl	$1, %edx
	movl	%edx, (%rbx)
	movl	%eax, (%rsp)
	leaq	-80(%rbp), %rcx
	movl	$40, %r8d
	movq	%r15, %r9
	callq	_kd_send_data_packet
	movq	_KD_E_OK@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	jne	LBB0_9
## %bb.4:
	movq	_KD_PACKET_TYPE_ACKNOWLEDGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_windbg_wait_packet
	cmpl	(%r15), %eax
	jne	LBB0_9
## %bb.5:
	movl	(%r12), %esi
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_windbg_wait_packet
	cmpl	(%r15), %eax
	jne	LBB0_9
## %bb.6:
	movq	-40(%rbp), %rdi
	callq	_PKT_REQ
	xorl	%r14d, %r14d
	cmpq	$0, 16(%rax)
	jne	LBB0_8
## %bb.7:
	movl	4(%rax), %r14d
LBB0_8:
	movq	-40(%rbp), %rdi
	callq	_free
LBB0_9:
	movl	%r14d, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KD_MAX_PAYLOAD,8,3             ## @KD_MAX_PAYLOAD
	.comm	_DbgKdWriteVirtualMemoryApi,4,2 ## @DbgKdWriteVirtualMemoryApi
	.comm	_KD_PACKET_TYPE_STATE_MANIPULATE,4,2 ## @KD_PACKET_TYPE_STATE_MANIPULATE
	.comm	_KD_E_OK,4,2                    ## @KD_E_OK
	.comm	_KD_PACKET_TYPE_ACKNOWLEDGE,4,2 ## @KD_PACKET_TYPE_ACKNOWLEDGE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_windbg_write_at                ; -- Begin function windbg_write_at
	.p2align	2
_windbg_write_at:                       ; @windbg_write_at
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
	str	xzr, [sp, #32]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	cbz	x0, LBB0_9
; %bb.1:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_8
; %bb.2:
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_8
; %bb.3:
	mov	x21, x2
	mov	x20, x1
Lloh0:
	adrp	x8, _KD_MAX_PAYLOAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _KD_MAX_PAYLOAD@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sub	x1, x8, #40
	mov	x0, x3
	bl	_R_MIN
	mov	x6, x0
Lloh3:
	adrp	x8, _DbgKdWriteVirtualMemoryApi@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DbgKdWriteVirtualMemoryApi@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	stp	w9, w8, [sp, #24]
Lloh6:
	adrp	x22, _KD_PACKET_TYPE_STATE_MANIPULATE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _KD_PACKET_TYPE_STATE_MANIPULATE@GOTPAGEOFF]
	str	w21, [sp, #8]
	str	w0, [sp]
	ldr	w1, [x22]
	ldp	w8, w0, [x19]
	eor	w2, w8, #0x1
	str	w2, [x19]
	mov	x3, sp
	mov	w4, #40
	mov	x5, x20
	bl	_kd_send_data_packet
Lloh8:
	adrp	x20, _KD_E_OK@GOTPAGE
Lloh9:
	ldr	x20, [x20, _KD_E_OK@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.4:
Lloh10:
	adrp	x8, _KD_PACKET_TYPE_ACKNOWLEDGE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _KD_PACKET_TYPE_ACKNOWLEDGE@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_windbg_wait_packet
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.5:
	ldr	w1, [x22]
	add	x2, sp, #40
	mov	x0, x19
	bl	_windbg_wait_packet
	ldr	w8, [x20]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.6:
	ldr	x0, [sp, #40]
	bl	_PKT_REQ
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_10
; %bb.7:
	mov	w19, #0
	b	LBB0_11
LBB0_8:
	mov	w19, #0
LBB0_9:
	mov	x0, x19
	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
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	w19, [x0, #4]
LBB0_11:
	ldr	x0, [sp, #40]
	bl	_free
	b	LBB0_9
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_KD_MAX_PAYLOAD,8,3             ; @KD_MAX_PAYLOAD
	.comm	_DbgKdWriteVirtualMemoryApi,4,2 ; @DbgKdWriteVirtualMemoryApi
	.comm	_KD_PACKET_TYPE_STATE_MANIPULATE,4,2 ; @KD_PACKET_TYPE_STATE_MANIPULATE
	.comm	_KD_E_OK,4,2                    ; @KD_E_OK
	.comm	_KD_PACKET_TYPE_ACKNOWLEDGE,4,2 ; @KD_PACKET_TYPE_ACKNOWLEDGE
.subsections_via_symbols
