	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_transfer_listening_sockets     ## -- Begin function transfer_listening_sockets
	.p2align	4, 0x90
_transfer_listening_sockets:            ## @transfer_listening_sockets
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rdi)
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	jle	LBB0_5
## %bb.1:
	movq	%rdi, %r13
	movl	$40, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r12,%rbx), %rdx
	movl	-24(%r12,%rbx), %edi
	movq	_ct_memcache_server@GOTPCREL(%rip), %rsi
	callq	_init_listening_connection
	shrq	$63, %rax
	xorl	$1, %eax
	movl	%eax, %edi
	callq	_assert
	movslq	-24(%r12,%rbx), %rax
	leaq	(%rax,%rax,2), %rax
	shlq	$3, %rax
	movq	_Connections@GOTPCREL(%rip), %rcx
	addq	(%rcx), %rax
	movq	%rax, -8(%r12,%rbx)
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r15
	movslq	(%r13), %rax
	addq	$48, %rbx
	cmpq	%rax, %r15
	jge	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r12
	movl	-40(%r12,%rbx), %r14d
	testl	%r14d, %r14d
	js	LBB0_14
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%edi, %edi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	cmpl	(%r13), %r14d
	setl	%dil
	callq	_assert
	movq	8(%r13), %r13
	leaq	(%r14,%r14,2), %r14
	shlq	$4, %r14
	movq	8(%r13,%r14), %rax
	cmpq	-32(%r12,%rbx), %rax
	jne	LBB0_4
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13,%r14), %eax
	cmpq	%rax, %r15
	sete	%al
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movzbl	%al, %edi
	callq	_assert
	movl	16(%r13,%r14), %eax
	leaq	(%r12,%rbx), %rcx
	movl	%eax, -24(%r12,%rbx)
	movq	32(%r13,%r14), %rax
	movq	%rax, -8(%r12,%rbx)
	movl	$-1, 16(%r13,%r14)
	movq	$0, 32(%r13,%r14)
	movq	-8(%r12,%rbx), %rax
	movq	%rcx, 16(%rax)
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_5:
	movq	_max_connection@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	js	LBB0_16
## %bb.6:
	movq	_Connections@GOTPCREL(%rip), %rdx
	movq	_ct_inbound@GOTPCREL(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_22:                                ##   in Loop: Header=BB0_7 Depth=1
	addq	%r15, %r12
	movq	8(%r13), %rcx
	movl	$2, %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	xorl	%eax, %eax
	callq	_vkprintf
	movq	%r12, %rdi
	callq	_force_clear_connection
	movl	%ebx, %edi
	callq	_epoll_close
	movl	%ebx, %edi
	callq	_close
	movq	_Connections@GOTPCREL(%rip), %rdx
	movq	_ct_inbound@GOTPCREL(%rip), %rsi
	movq	_max_connection@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_7 Depth=1
	leaq	1(%rbx), %rax
	movslq	(%r14), %rcx
	addq	$24, %r15
	cmpq	%rcx, %rbx
	movq	%rax, %rbx
	jge	LBB0_16
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rdx), %r12
	movq	(%r12,%r15), %rax
	cmpq	(%rsi), %rax
	jne	LBB0_23
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	8(%r12,%r15), %eax
	cmpq	%rax, %rbx
	jne	LBB0_23
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	16(%r12,%r15), %rax
	movq	(%rax), %r13
	testq	%r13, %r13
	setne	%cl
	leaq	40(%r13), %rdx
	cmpq	%rax, %rdx
	sete	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movslq	20(%r13), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rax,2), %rax
	shlq	$4, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	addq	8(%rcx), %rax
	movl	(%r13), %r14d
	xorl	%edi, %edi
	cmpq	%rax, %r13
	sete	%dil
	callq	_assert
	movq	%r14, %rdx
	testl	%edx, %edx
	js	LBB0_22
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	leaq	(%rdx,%rdx,2), %r14
	shlq	$4, %r14
	cmpl	%edx, 20(%rax,%r14)
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	jne	LBB0_11
## %bb.20:                              ##   in Loop: Header=BB0_7 Depth=1
	cmpl	%ecx, (%rax,%r14)
	sete	%al
	jmp	LBB0_21
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%eax, %eax
LBB0_21:                                ##   in Loop: Header=BB0_7 Depth=1
	movzbl	%al, %edi
	callq	_assert
	movq	8(%r13), %rcx
	movl	$2, %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	movq	-80(%rbp), %r9                  ## 8-byte Reload
                                        ## kill: def $r9d killed $r9d killed $r9
	xorl	%eax, %eax
	callq	_vkprintf
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	addq	%r14, %rax
	addq	$40, %rax
	movq	%rax, 16(%r12,%r15)
	movq	_max_connection@GOTPCREL(%rip), %r14
	movq	_Connections@GOTPCREL(%rip), %rdx
	movq	_ct_inbound@GOTPCREL(%rip), %rsi
	jmp	LBB0_23
LBB0_16:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	cmpl	$0, (%r15)
	jle	LBB0_29
## %bb.17:
	movl	$32, %ebx
	movq	_Connections@GOTPCREL(%rip), %r14
	xorl	%r12d, %r12d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_18 Depth=1
	notl	%edi
	shrl	$31, %edi
	callq	_assert
	movslq	-16(%r13,%rbx), %r15
	movq	-24(%r13,%rbx), %rcx
	movl	-8(%r13,%rbx), %r9d
	movl	$1, %edi
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edx
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_vkprintf
	leaq	(%r15,%r15,2), %rdi
	shlq	$3, %rdi
	addq	(%r14), %rdi
	callq	_force_clear_connection
	movl	%r15d, %edi
	callq	_epoll_close
	movl	%r15d, %edi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	callq	_close
	movl	$-1, -16(%r13,%rbx)
	movq	$0, (%r13,%rbx)
LBB0_28:                                ##   in Loop: Header=BB0_18 Depth=1
	incq	%r12
	movslq	(%r15), %rax
	addq	$48, %rbx
	cmpq	%rax, %r12
	jge	LBB0_29
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %r13
	movl	-16(%r13,%rbx), %edi
	cmpl	$-1, -32(%r13,%rbx)
	je	LBB0_19
## %bb.24:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	$-1, %edi
	je	LBB0_26
## %bb.25:                              ##   in Loop: Header=BB0_18 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_18 Depth=1
	cmpq	$0, (%r13,%rbx)
	sete	%al
LBB0_27:                                ##   in Loop: Header=BB0_18 Depth=1
	movzbl	%al, %edi
	callq	_assert
	jmp	LBB0_28
LBB0_29:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ct_memcache_server,4,2         ## @ct_memcache_server
	.comm	_Connections,8,3                ## @Connections
	.comm	_max_connection,4,2             ## @max_connection
	.comm	_ct_inbound,8,3                 ## @ct_inbound
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"transferring inbound connection #%d (port %d) from old cluster %d to new cluster %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"closing inbound connection #%d (port %d) belonging to old cluster %d, no new cluster\n"

L_.str.2:                               ## @.str.2
	.asciz	"closing unneeded listening connection #%d for port %d belonging to old cluster %d (%s)\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_transfer_listening_sockets     ; -- Begin function transfer_listening_sockets
	.p2align	2
_transfer_listening_sockets:            ; @transfer_listening_sockets
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.1:
	mov	x22, #0
	mov	x23, #0
	mov	w24, #48
	mov	w25, #-1
Lloh0:
	adrp	x21, _ct_memcache_server@GOTPAGE
Lloh1:
	ldr	x21, [x21, _ct_memcache_server@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x28, x22
	ldr	w0, [x26, #16]
	add	x2, x26, #40
	mov	x1, x21
	bl	_init_listening_connection
	lsr	x8, x0, #63
	eor	w0, w8, #0x1
	bl	_assert
Lloh2:
	adrp	x8, _Connections@GOTPAGE
Lloh3:
	ldr	x8, [x8, _Connections@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldrsw	x9, [x26, #16]
	mov	w10, #24
	madd	x8, x9, x10, x8
	str	x8, [x26, #32]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x20]
	add	x22, x22, #48
	cmp	x23, x8
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x28, [x20, #8]
	ldr	w26, [x28, x22]
	tbnz	w26, #31, LBB0_2
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x19]
	cmp	w26, w8
	cset	w0, lt
	bl	_assert
	ldr	x27, [x19, #8]
	madd	x8, x26, x24, x27
	ldr	x8, [x8, #8]
	add	x28, x28, x22
	ldr	x9, [x28, #8]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mul	x8, x26, x24
	ldr	w8, [x27, x8]
	cmp	x23, x8
	cset	w0, eq
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w0, #0
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	bl	_assert
	madd	x8, x26, x24, x27
	ldr	w9, [x8, #16]
	str	w9, [x28, #16]
	ldr	x9, [x8, #32]
	str	x9, [x28, #32]
	str	w25, [x8, #16]
	str	xzr, [x8, #32]
	add	x8, x28, #40
	ldr	x9, [x28, #32]
	str	x8, [x9, #16]
	b	LBB0_3
LBB0_9:
Lloh5:
	adrp	x11, _max_connection@GOTPAGE
Lloh6:
	ldr	x11, [x11, _max_connection@GOTPAGEOFF]
	ldr	w8, [x11]
	tbnz	w8, #31, LBB0_21
; %bb.10:
	mov	x28, #0
	mov	x21, #0
Lloh7:
	adrp	x12, _ct_inbound@GOTPAGE
Lloh8:
	ldr	x12, [x12, _ct_inbound@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_14 Depth=1
	ldr	x3, [x26, #8]
	mov	w0, #2
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x21
	mov	x4, x24
	bl	_vkprintf
	mov	x0, x25
	bl	_force_clear_connection
	mov	x0, x21
	bl	_epoll_close
	mov	x0, x21
	bl	_close
LBB0_12:                                ;   in Loop: Header=BB0_14 Depth=1
Lloh11:
	adrp	x12, _ct_inbound@GOTPAGE
Lloh12:
	ldr	x12, [x12, _ct_inbound@GOTPAGEOFF]
Lloh13:
	adrp	x11, _max_connection@GOTPAGE
Lloh14:
	ldr	x11, [x11, _max_connection@GOTPAGEOFF]
LBB0_13:                                ;   in Loop: Header=BB0_14 Depth=1
	add	x8, x21, #1
	ldrsw	x9, [x11]
	add	x28, x28, #24
	cmp	x21, x9
	mov	x21, x8
	b.ge	LBB0_21
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
Lloh15:
	adrp	x8, _Connections@GOTPAGE
Lloh16:
	ldr	x8, [x8, _Connections@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	add	x25, x8, x28
	ldr	x9, [x25]
	ldr	x10, [x12]
	cmp	x9, x10
	b.ne	LBB0_13
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	w9, [x25, #8]
	cmp	x21, x9
	b.ne	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_14 Depth=1
	add	x22, x8, x28
	ldr	x8, [x22, #16]
	ldr	x26, [x8]
	cmp	x26, #0
	add	x9, x26, #40
	ccmp	x9, x8, #0, ne
	cset	w0, eq
	bl	_assert
	ldrsw	x24, [x26, #20]
	ldr	w23, [x26]
	ldr	x8, [x19, #8]
	mov	w27, #48
	madd	x8, x24, x27, x8
	cmp	x26, x8
	cset	w0, eq
	bl	_assert
	tbnz	w23, #31, LBB0_11
; %bb.17:                               ;   in Loop: Header=BB0_14 Depth=1
	ldr	x25, [x20, #8]
	madd	x8, x23, x27, x25
	ldr	w8, [x8, #20]
	cmp	w8, w23
	mov	w8, #48
	b.ne	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_14 Depth=1
	mul	x8, x23, x8
	ldr	w8, [x25, x8]
	cmp	w8, w24
	cset	w0, eq
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	w0, #0
LBB0_20:                                ;   in Loop: Header=BB0_14 Depth=1
	mov	w27, #48
	bl	_assert
	ldr	x3, [x26, #8]
	str	x23, [sp]
	mov	w0, #2
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	mov	x4, x24
	bl	_vkprintf
	madd	x8, x23, x27, x25
	add	x8, x8, #40
	str	x8, [x22, #16]
	b	LBB0_12
LBB0_21:
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_30
; %bb.22:
	mov	x23, #0
	mov	x20, #0
	mov	w24, #24
	mov	w25, #-1
Lloh20:
	adrp	x21, l_.str.2@PAGE
Lloh21:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_25
LBB0_23:                                ;   in Loop: Header=BB0_25 Depth=1
	mvn	w8, w9
	lsr	w0, w8, #31
	bl	_assert
	ldrsw	x22, [x26, #16]
	ldr	x3, [x26, #8]
	ldr	w8, [x26, #24]
	str	x8, [sp]
	mov	w0, #1
	mov	x1, x21
	mov	x2, x22
	mov	x4, x20
	bl	_vkprintf
Lloh22:
	adrp	x8, _Connections@GOTPAGE
Lloh23:
	ldr	x8, [x8, _Connections@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	madd	x0, x22, x24, x8
	bl	_force_clear_connection
	mov	x0, x22
	bl	_epoll_close
	mov	x0, x22
	bl	_close
	str	w25, [x26, #16]
	str	xzr, [x26, #32]
LBB0_24:                                ;   in Loop: Header=BB0_25 Depth=1
	add	x20, x20, #1
	ldrsw	x8, [x19]
	add	x23, x23, #48
	cmp	x20, x8
	b.ge	LBB0_30
LBB0_25:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x26, x8, x23
	ldr	w10, [x26]
	ldr	w9, [x26, #16]
	cmn	w10, #1
	b.eq	LBB0_23
; %bb.26:                               ;   in Loop: Header=BB0_25 Depth=1
	cmn	w9, #1
	b.eq	LBB0_28
; %bb.27:                               ;   in Loop: Header=BB0_25 Depth=1
	mov	w0, #0
	b	LBB0_29
LBB0_28:                                ;   in Loop: Header=BB0_25 Depth=1
	add	x8, x8, x23
	ldr	x8, [x8, #32]
	cmp	x8, #0
	cset	w0, eq
LBB0_29:                                ;   in Loop: Header=BB0_25 Depth=1
	bl	_assert
	b	LBB0_24
LBB0_30:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_ct_memcache_server,4,2         ; @ct_memcache_server
	.comm	_Connections,8,3                ; @Connections
	.comm	_max_connection,4,2             ; @max_connection
	.comm	_ct_inbound,8,3                 ; @ct_inbound
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"transferring inbound connection #%d (port %d) from old cluster %d to new cluster %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"closing inbound connection #%d (port %d) belonging to old cluster %d, no new cluster\n"

l_.str.2:                               ; @.str.2
	.asciz	"closing unneeded listening connection #%d for port %d belonging to old cluster %d (%s)\n"

.subsections_via_symbols
