	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function connection_migrate
_connection_migrate:                    ## @connection_migrate
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	$0, -24(%rbp)
	movslq	24(%rdi), %rbx
	movq	(%rdi), %rdi
	callq	_role2str
	leaq	L_.str(%rip), %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pjdlog_prefix_set
	movq	(%r14), %rax
	movq	_HAST_ROLE_PRIMARY@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	movl	16(%r14), %edi
	leaq	-24(%rbp), %rsi
	movl	$8, %edx
	callq	_proto_recv
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movq	8(%r14), %rax
	xorl	%edi, %edi
	cmpb	$0, (%rax)
	cmovneq	%rax, %rdi
	movl	20(%r14), %esi
	leaq	-32(%rbp), %rdx
	callq	_proto_client
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.4:
	movq	-32(%rbp), %rdi
	movl	$-1, %esi
	callq	_proto_connect
	cmpl	$-1, %eax
	je	LBB0_5
## %bb.6:
	movq	$0, -24(%rbp)
	jmp	LBB0_7
LBB0_1:
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_errno
	jmp	LBB0_13
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_errno
	jmp	LBB0_7
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r14), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_errno
	movq	-32(%rbp), %rdi
	callq	_proto_close
LBB0_7:
	movl	16(%r14), %edi
	leaq	-24(%rbp), %rsi
	movl	$8, %edx
	callq	_proto_send
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.9:
	cmpq	$0, -24(%rbp)
	jne	LBB0_12
	jmp	LBB0_10
LBB0_8:
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_errno
	cmpq	$0, -24(%rbp)
	jne	LBB0_12
LBB0_10:
	movl	16(%r14), %edi
	movq	-32(%rbp), %rsi
	callq	_proto_connection_send
	cmpl	$-1, %eax
	jne	LBB0_12
## %bb.11:
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_errno
LBB0_12:
	leaq	L_.str.6(%rip), %rdi
	leaq	L_.str.7(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_prefix_set
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[%s] (%s) "

	.comm	_HAST_ROLE_PRIMARY,8,3          ## @HAST_ROLE_PRIMARY
	.comm	_LOG_WARNING,4,2                ## @LOG_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"Unable to receive connection command"

	.comm	_errno,8,3                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"Unable to create outgoing connection to %s"

L_.str.3:                               ## @.str.3
	.asciz	"Unable to connect to %s"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to send reply to connection request"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to send connection"

L_.str.6:                               ## @.str.6
	.asciz	"%s"

L_.str.7:                               ## @.str.7
	.space	1

	.no_dead_strip	_connection_migrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function connection_migrate
_connection_migrate:                    ; @connection_migrate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	str	xzr, [sp, #16]
	ldrsw	x20, [x0, #24]
	ldr	x0, [x0]
	bl	_role2str
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_pjdlog_prefix_set
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _HAST_ROLE_PRIMARY@GOTPAGE
Lloh3:
	ldr	x9, [x9, _HAST_ROLE_PRIMARY@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	ldr	w0, [x19, #16]
	add	x1, sp, #16
	mov	w2, #8
	bl	_proto_recv
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.1:
	ldr	x8, [x19, #8]
	ldrb	w9, [x8]
	cmp	w9, #0
	csel	x0, xzr, x8, eq
	ldr	w1, [x19, #20]
	add	x2, sp, #24
	bl	_proto_client
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.2:
	ldr	x0, [sp, #24]
	mov	w1, #-1
	bl	_proto_connect
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.3:
	str	xzr, [sp, #16]
	b	LBB0_7
LBB0_4:
Lloh5:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_pjdlog_errno
	b	LBB0_13
LBB0_5:
Lloh10:
	adrp	x8, _errno@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	str	x8, [sp, #16]
Lloh13:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_pjdlog_errno
	b	LBB0_7
LBB0_6:
Lloh18:
	adrp	x8, _errno@GOTPAGE
Lloh19:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	str	x8, [sp, #16]
Lloh21:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh22:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_pjdlog_errno
	ldr	x0, [sp, #24]
	bl	_proto_close
LBB0_7:
	ldr	w0, [x19, #16]
	add	x1, sp, #16
	mov	w2, #8
	bl	_proto_send
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [sp, #16]
	cbnz	x8, LBB0_12
	b	LBB0_10
LBB0_9:
Lloh26:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh27:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_pjdlog_errno
	ldr	x8, [sp, #16]
	cbnz	x8, LBB0_12
LBB0_10:
	ldr	w0, [x19, #16]
	ldr	x1, [sp, #24]
	bl	_proto_connection_send
	cmn	w0, #1
	b.ne	LBB0_12
; %bb.11:
Lloh31:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh32:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
Lloh34:
	adrp	x1, l_.str.5@PAGE
Lloh35:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_pjdlog_errno
LBB0_12:
Lloh36:
	adrp	x0, l_.str.6@PAGE
Lloh37:
	add	x0, x0, l_.str.6@PAGEOFF
Lloh38:
	adrp	x1, l_.str.7@PAGE
Lloh39:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_pjdlog_prefix_set
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[%s] (%s) "

	.comm	_HAST_ROLE_PRIMARY,8,3          ; @HAST_ROLE_PRIMARY
	.comm	_LOG_WARNING,4,2                ; @LOG_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"Unable to receive connection command"

	.comm	_errno,8,3                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"Unable to create outgoing connection to %s"

l_.str.3:                               ; @.str.3
	.asciz	"Unable to connect to %s"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to send reply to connection request"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to send connection"

l_.str.6:                               ; @.str.6
	.asciz	"%s"

l_.str.7:                               ; @.str.7
	.space	1

	.no_dead_strip	_connection_migrate
.subsections_via_symbols
