	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_destroy_server                 ## -- Begin function destroy_server
	.p2align	4, 0x90
_destroy_server:                        ## @destroy_server
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	(%rdi), %edx
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_vkprintf
	movq	24(%rbx), %rax
	movq	32(%rbx), %rcx
	movq	%rcx, (%rax)
	movq	%rax, (%rcx)
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_free
LBB0_2:
	movq	8(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	movl	$1, %esi
	callq	_close_binlog
LBB0_4:
	movl	(%rbx), %edi
	movl	$-1, %esi
	callq	_get_server_by_session
	movq	_active_repl_servers@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	-1(%rcx), %rdx
	movq	%rdx, (%rax)
	xorl	%edi, %edi
	testq	%rcx, %rcx
	setg	%dil
	callq	_assert
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"destroyed server %d\n"

	.comm	_active_repl_servers,8,3        ## @active_repl_servers
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_destroy_server                 ; -- Begin function destroy_server
	.p2align	2
_destroy_server:                        ; @destroy_server
	.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	w2, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_vkprintf
	ldp	x9, x8, [x19, #24]
	ldr	x0, [x19, #16]
	str	x8, [x9]
	str	x9, [x8]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_free
LBB0_2:
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_4
; %bb.3:
	mov	w1, #1
	bl	_close_binlog
LBB0_4:
	ldr	w0, [x19]
	mov	w1, #-1
	bl	_get_server_by_session
Lloh2:
	adrp	x8, _active_repl_servers@GOTPAGE
Lloh3:
	ldr	x8, [x8, _active_repl_servers@GOTPAGEOFF]
	ldr	x9, [x8]
	sub	x10, x9, #1
	str	x10, [x8]
	cmp	x9, #0
	cset	w0, gt
	bl	_assert
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"destroyed server %d\n"

	.comm	_active_repl_servers,8,3        ; @active_repl_servers
.subsections_via_symbols
