	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handshake
_handshake:                             ## @handshake
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	8(%rdi), %r14
	movq	$0, -56(%rbp)
	callq	_connect_setup
	movq	16(%r14), %rax
	movq	_PACKET_READ_CHOMP_NEWLINE@GOTPCREL(%rip), %rcx
	movq	_PACKET_READ_GENTLE_ON_EOF@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	orl	(%rcx), %r8d
	movl	(%rax), %esi
	movq	_PACKET_READ_DIE_ON_ERR_PACKET@GOTPCREL(%rip), %rax
	orl	(%rax), %r8d
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_packet_reader_init
	movq	%rbx, %rdi
	callq	_discover_version
                                        ## kill: def $eax killed $eax def $rax
	movl	%eax, (%r14)
	leal	-129(%rax), %ecx
	cmpl	$2, %ecx
	jb	LBB0_5
## %bb.1:
	cmpl	$131, %eax
	je	LBB0_8
## %bb.2:
	cmpl	$128, %eax
	jne	LBB0_9
## %bb.3:
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.4:
	movq	16(%r14), %rax
	movl	4(%rax), %edi
	movl	(%r13), %r9d
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	movl	%r15d, %ecx
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	callq	_get_remote_refs
	jmp	LBB0_9
LBB0_5:
	movq	%r13, %rdi
	callq	_die_if_server_options
	testl	%r15d, %r15d
	je	LBB0_7
## %bb.6:
	movq	_REF_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_7:
	leaq	12(%r14), %rcx
	leaq	8(%r14), %r8
	leaq	-48(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	movl	%r15d, %edx
	callq	_get_remote_heads
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_BUG
LBB0_9:
	movl	$1, 4(%r14)
	cmpq	$0, -48(%rbp)
	je	LBB0_11
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	callq	_BUG
LBB0_11:
	movq	-56(%rbp), %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PACKET_READ_CHOMP_NEWLINE,4,2  ## @PACKET_READ_CHOMP_NEWLINE
	.comm	_PACKET_READ_GENTLE_ON_EOF,4,2  ## @PACKET_READ_GENTLE_ON_EOF
	.comm	_PACKET_READ_DIE_ON_ERR_PACKET,4,2 ## @PACKET_READ_DIE_ON_ERR_PACKET
	.comm	_REF_NORMAL,4,2                 ## @REF_NORMAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown protocol version"

L_.str.1:                               ## @.str.1
	.asciz	"buffer must be empty at the end of handshake()"

	.no_dead_strip	_handshake
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handshake
_handshake:                             ; @handshake
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x3
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x23, [x0, #8]
	str	xzr, [sp, #8]
	bl	_connect_setup
	ldr	x8, [x23, #16]
	ldr	w1, [x8]
Lloh0:
	adrp	x8, _PACKET_READ_CHOMP_NEWLINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PACKET_READ_CHOMP_NEWLINE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _PACKET_READ_GENTLE_ON_EOF@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PACKET_READ_GENTLE_ON_EOF@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _PACKET_READ_DIE_ON_ERR_PACKET@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PACKET_READ_DIE_ON_ERR_PACKET@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w4, w8, w9
	mov	x0, sp
	mov	x2, #0
	mov	w3, #0
	bl	_packet_reader_init
	mov	x0, sp
	bl	_discover_version
	str	w0, [x23]
	sub	w8, w0, #129
	cmp	w8, #2
	b.lo	LBB0_5
; %bb.1:
	cmp	w0, #131
	b.eq	LBB0_6
; %bb.2:
	cmp	w0, #128
	b.ne	LBB0_7
; %bb.3:
	cbz	w22, LBB0_7
; %bb.4:
	ldr	x8, [x23, #16]
	ldr	w0, [x8, #4]
	ldr	w5, [x21]
	mov	x1, sp
	add	x2, sp, #8
	mov	x3, x19
	mov	x4, x20
	bl	_get_remote_refs
	b	LBB0_7
LBB0_5:
	mov	x0, x21
	bl	_die_if_server_options
Lloh9:
	adrp	x8, _REF_NORMAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REF_NORMAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w19, #0
	csel	w2, wzr, w8, eq
	add	x3, x23, #12
	add	x4, x23, #8
	mov	x0, sp
	add	x1, sp, #8
	bl	_get_remote_heads
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BUG
LBB0_7:
	mov	w8, #1
	str	w8, [x23, #4]
	ldr	x8, [sp]
	cbz	x8, LBB0_9
; %bb.8:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BUG
LBB0_9:
	ldr	x0, [sp, #8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PACKET_READ_CHOMP_NEWLINE,4,2  ; @PACKET_READ_CHOMP_NEWLINE
	.comm	_PACKET_READ_GENTLE_ON_EOF,4,2  ; @PACKET_READ_GENTLE_ON_EOF
	.comm	_PACKET_READ_DIE_ON_ERR_PACKET,4,2 ; @PACKET_READ_DIE_ON_ERR_PACKET
	.comm	_REF_NORMAL,4,2                 ; @REF_NORMAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown protocol version"

l_.str.1:                               ; @.str.1
	.asciz	"buffer must be empty at the end of handshake()"

	.no_dead_strip	_handshake
.subsections_via_symbols
