	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function remote_detach
_remote_detach:                         ## @remote_detach
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_get_remote_state
	movq	%rax, %r15
	movl	(%rax), %edi
	callq	_alloca
	movq	%rax, %rbx
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_error
LBB0_2:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcpy
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_remote_send
	xorl	%eax, %eax
	callq	_target_is_async_p
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_remote_desc@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_serial_async
LBB0_4:
	xorl	%eax, %eax
	callq	_target_mourn_inferior
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.6:
	leaq	L_.str.2(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_puts_filtered                  ## TAILCALL
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Argument given to \"detach\" when remotely debugging."

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

	.comm	_remote_desc,4,2                ## @remote_desc
L_.str.2:                               ## @.str.2
	.asciz	"Ending remote debugging.\n"

	.no_dead_strip	_remote_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function remote_detach
_remote_detach:                         ; @remote_detach
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x22, x0
	bl	_get_remote_state
	mov	x20, x0
	ldr	w0, [x0]
	bl	_alloca
	mov	x21, x0
	cbz	x22, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_error
LBB0_2:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_strcpy
	ldr	w1, [x20]
	mov	x0, x21
	bl	_remote_send
	bl	_target_is_async_p
	cbz	x0, LBB0_4
; %bb.3:
Lloh4:
	adrp	x8, _remote_desc@GOTPAGE
Lloh5:
	ldr	x8, [x8, _remote_desc@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	mov	x1, #0
	mov	w2, #0
	bl	_serial_async
LBB0_4:
	bl	_target_mourn_inferior
	cbz	w19, LBB0_6
; %bb.5:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_puts_filtered
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Argument given to \"detach\" when remotely debugging."

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

	.comm	_remote_desc,4,2                ; @remote_desc
l_.str.2:                               ; @.str.2
	.asciz	"Ending remote debugging.\n"

	.no_dead_strip	_remote_detach
.subsections_via_symbols
