	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_datalink_Destroy               ## -- Begin function datalink_Destroy
	.p2align	4, 0x90
_datalink_Destroy:                      ## @datalink_Destroy
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	movq	_DATALINK_CLOSED@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_3
## %bb.1:
	movq	_LogERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%rbx, %rdi
	callq	_datalink_State
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	callq	_log_Printf
	movl	(%rbx), %eax
	addl	$-128, %eax
	cmpl	$2, %eax
	ja	LBB0_3
## %bb.2:
	leaq	36(%rbx), %rdi
	callq	_chat_Finish
LBB0_3:
	leaq	36(%rbx), %rdi
	callq	_chat_Destroy
	leaq	32(%rbx), %rdi
	callq	_timer_Stop
	movq	24(%rbx), %r14
	movl	16(%rbx), %edi
	callq	_physical_Destroy
	movq	8(%rbx), %rdi
	callq	_free
	movq	%rbx, %rdi
	callq	_free
	movq	%r14, %rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DATALINK_CLOSED,4,2            ## @DATALINK_CLOSED
	.comm	_LogERROR,4,2                   ## @LogERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Oops, destroying a datalink in state %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_datalink_Destroy               ; -- Begin function datalink_Destroy
	.p2align	2
_datalink_Destroy:                      ; @datalink_Destroy
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _DATALINK_CLOSED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DATALINK_CLOSED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _LogERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LogERROR@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_datalink_State
	mov	x2, x0
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_log_Printf
	ldr	w8, [x19]
	sub	w8, w8, #128
	cmp	w8, #2
	b.hi	LBB0_3
; %bb.2:
	add	x0, x19, #36
	bl	_chat_Finish
LBB0_3:
	add	x0, x19, #36
	bl	_chat_Destroy
	add	x0, x19, #32
	bl	_timer_Stop
	ldr	x20, [x19, #24]
	ldr	w0, [x19, #16]
	bl	_physical_Destroy
	ldr	x0, [x19, #8]
	bl	_free
	mov	x0, x19
	bl	_free
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DATALINK_CLOSED,4,2            ; @DATALINK_CLOSED
	.comm	_LogERROR,4,2                   ; @LogERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Oops, destroying a datalink in state %s\n"

.subsections_via_symbols
