	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_windbg_wait_packet             ## -- Begin function windbg_wait_packet
	.p2align	4, 0x90
_windbg_wait_packet:                    ## @windbg_wait_packet
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	$0, -48(%rbp)
	movl	$-10, %r14d
	movq	_KD_PACKET_DATA@GOTPCREL(%rip), %r12
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	callq	_R_FREE
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %edi
	leaq	-48(%rbp), %rsi
	callq	_kd_read_packet
	movl	%eax, %r13d
	movq	_KD_E_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rdi
	cmpl	%eax, %r13d
	jne	LBB0_19
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	testq	%rdi, %rdi
	je	LBB0_19
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rdi), %rsi
	cmpq	%rbx, %rsi
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
	movq	-48(%rbp), %rdi
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rdi), %rax
	movq	(%r12), %rdx
	cmpq	%rdx, %rax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rdi), %rcx
	movq	_KD_PACKET_TYPE_STATE_CHANGE64@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
	movq	-48(%rbp), %rdi
	movq	8(%rdi), %rax
	movq	(%r12), %rdx
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %rcx
	movq	%rdx, %rax
	cmpq	%rdx, %rcx
	jne	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rdi), %rdx
	movq	%rax, %rcx
	movq	_KD_PACKET_TYPE_FILE_IO@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdx
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
	movq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_do_io_reply
	movq	-48(%rbp), %rdi
	movq	8(%rdi), %rcx
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_KD_PACKET_CTRL@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%rdi), %rax
	movq	_KD_PACKET_TYPE_RESEND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_r_sys_backtrace
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
	movq	_KD_E_MALFORMED@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	-48(%rbp), %rdi
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rbx, (%rdi)
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%r14), %eax
	testl	%r14d, %r14d
	movl	%eax, %r14d
	jne	LBB0_1
LBB0_18:
	movq	_KD_E_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_19:
	cmpl	%eax, %r13d
	jne	LBB0_20
## %bb.21:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_23
## %bb.22:
	movq	%rdi, (%rcx)
	movl	%eax, %r13d
	jmp	LBB0_24
LBB0_20:
	callq	_free
	jmp	LBB0_24
LBB0_23:
	callq	_free
	movq	_KD_E_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_24:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_KD_E_OK,4,2                    ## @KD_E_OK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"We were not waiting for this... %08x\n"

	.comm	_KD_PACKET_DATA,8,3             ## @KD_PACKET_DATA
	.comm	_KD_PACKET_TYPE_STATE_CHANGE64,8,3 ## @KD_PACKET_TYPE_STATE_CHANGE64
L_.str.1:                               ## @.str.1
	.asciz	"State64\n"

	.comm	_KD_PACKET_TYPE_FILE_IO,8,3     ## @KD_PACKET_TYPE_FILE_IO
L_.str.2:                               ## @.str.2
	.asciz	"Replying IO\n"

	.comm	_KD_PACKET_CTRL,8,3             ## @KD_PACKET_CTRL
	.comm	_KD_PACKET_TYPE_RESEND,8,3      ## @KD_PACKET_TYPE_RESEND
L_.str.3:                               ## @.str.3
	.asciz	"Waoh. You probably sent a malformed packet !\n"

	.comm	_KD_E_MALFORMED,4,2             ## @KD_E_MALFORMED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_windbg_wait_packet             ; -- Begin function windbg_wait_packet
	.p2align	2
_windbg_wait_packet:                    ; @windbg_wait_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	stp	x2, xzr, [sp, #16]              ; 8-byte Folded Spill
	mov	x20, x1
	mov	x21, x0
	mov	x0, #0
	mov	w28, #-10
Lloh0:
	adrp	x27, _KD_E_OK@GOTPAGE
Lloh1:
	ldr	x27, [x27, _KD_E_OK@GOTPAGEOFF]
Lloh2:
	adrp	x19, _KD_PACKET_DATA@GOTPAGE
Lloh3:
	ldr	x19, [x19, _KD_PACKET_DATA@GOTPAGEOFF]
Lloh4:
	adrp	x25, _KD_PACKET_TYPE_FILE_IO@GOTPAGE
Lloh5:
	ldr	x25, [x25, _KD_PACKET_TYPE_FILE_IO@GOTPAGEOFF]
Lloh6:
	adrp	x23, _KD_PACKET_CTRL@GOTPAGE
Lloh7:
	ldr	x23, [x23, _KD_PACKET_CTRL@GOTPAGEOFF]
Lloh8:
	adrp	x22, _KD_PACKET_TYPE_RESEND@GOTPAGE
Lloh9:
	ldr	x22, [x22, _KD_PACKET_TYPE_RESEND@GOTPAGEOFF]
Lloh10:
	adrp	x26, l_.str@PAGE
Lloh11:
	add	x26, x26, l_.str@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x0]
	cmp	x8, x20
	ccmp	w28, #0, #4, ne
	add	w28, w28, #1
	b.eq	LBB0_16
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_R_FREE
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [x21]
	add	x1, sp, #24
	bl	_kd_read_packet
	mov	x24, x0
	ldr	w8, [x27]
	ldr	x0, [sp, #24]
	cmp	w24, w8
	ccmp	x0, #0, #4, eq
	b.eq	LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x0]
	cmp	x8, x20
	b.eq	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	str	x8, [sp]
	mov	x0, x26
	bl	_eprintf
	ldr	x0, [sp, #24]
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x0, #8]
	ldr	x10, [x19]
	cmp	x8, x10
	b.ne	LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x9, [x0]
Lloh12:
	adrp	x10, _KD_PACKET_TYPE_STATE_CHANGE64@GOTPAGE
Lloh13:
	ldr	x10, [x10, _KD_PACKET_TYPE_STATE_CHANGE64@GOTPAGEOFF]
Lloh14:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_eprintf
	ldr	x0, [sp, #24]
	ldr	x8, [x0, #8]
	ldr	x10, [x19]
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x9, x8
	mov	x8, x10
	cmp	x9, x10
	b.ne	LBB0_13
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x10, [x0]
	ldr	x11, [x25]
	mov	x9, x8
	cmp	x10, x11
	b.ne	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_2 Depth=1
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_eprintf
	ldr	x1, [sp, #24]
	mov	x0, x21
	bl	_do_io_reply
	ldr	x0, [sp, #24]
	ldr	x9, [x0, #8]
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x23]
	cmp	x9, x8
	b.ne	LBB0_1
; %bb.14:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x0]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_1
; %bb.15:                               ;   in Loop: Header=BB0_2 Depth=1
	bl	_r_sys_backtrace
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_eprintf
Lloh21:
	adrp	x8, _KD_E_MALFORMED@GOTPAGE
Lloh22:
	ldr	x8, [x8, _KD_E_MALFORMED@GOTPAGEOFF]
Lloh23:
	ldr	w24, [x8]
	ldr	x0, [sp, #24]
	b	LBB0_1
LBB0_16:
	ldr	w8, [x27]
LBB0_17:
	cmp	w24, w8
	b.ne	LBB0_20
; %bb.18:
	ldr	x9, [sp, #16]                   ; 8-byte Folded Reload
	cbz	x9, LBB0_21
; %bb.19:
	str	x0, [x9]
	mov	x24, x8
	b	LBB0_22
LBB0_20:
	bl	_free
	b	LBB0_22
LBB0_21:
	bl	_free
	ldr	w24, [x27]
LBB0_22:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_KD_E_OK,4,2                    ; @KD_E_OK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"We were not waiting for this... %08x\n"

	.comm	_KD_PACKET_DATA,8,3             ; @KD_PACKET_DATA
	.comm	_KD_PACKET_TYPE_STATE_CHANGE64,8,3 ; @KD_PACKET_TYPE_STATE_CHANGE64
l_.str.1:                               ; @.str.1
	.asciz	"State64\n"

	.comm	_KD_PACKET_TYPE_FILE_IO,8,3     ; @KD_PACKET_TYPE_FILE_IO
l_.str.2:                               ; @.str.2
	.asciz	"Replying IO\n"

	.comm	_KD_PACKET_CTRL,8,3             ; @KD_PACKET_CTRL
	.comm	_KD_PACKET_TYPE_RESEND,8,3      ; @KD_PACKET_TYPE_RESEND
l_.str.3:                               ; @.str.3
	.asciz	"Waoh. You probably sent a malformed packet !\n"

	.comm	_KD_E_MALFORMED,4,2             ; @KD_E_MALFORMED
.subsections_via_symbols
