	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_handshake_sync         ## -- Begin function netplay_handshake_sync
	.p2align	4, 0x90
_netplay_handshake_sync:                ## @netplay_handshake_sync
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$0, -68(%rbp)
	movq	_RETRO_MEMORY_SAVE_RAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -96(%rbp)
	leaq	-112(%rbp), %rdi
	callq	_core_get_memory
	movq	_NETPLAY_CMD_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movl	%eax, -64(%rbp)
	movq	_MAX_INPUT_DEVICES@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	movq	_NETPLAY_NICK_LEN@GOTPCREL(%rip), %rdx
	movl	-112(%rbp), %ecx
	leal	(%rax,%rax,2), %eax
	shll	$2, %eax
	addl	(%rdx), %eax
	leal	(%rcx,%rax), %edi
	addl	$8, %edi
	callq	_htonl
	movl	%eax, -60(%rbp)
	movl	(%r14), %edi
	callq	_htonl
	movl	%eax, -56(%rbp)
	movq	%r15, %rdi
	subq	48(%r14), %rdi
	shrq	$5, %rdi
	incl	%edi
	cmpq	$0, 64(%r14)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 56(%r14)
	je	LBB0_3
LBB0_2:
	movq	_NETPLAY_CMD_SYNC_BIT_PAUSED@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
LBB0_3:
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_htonl
	movl	%eax, -52(%rbp)
	leaq	20(%r15), %rbx
	movl	16(%r15), %esi
	leaq	-64(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$16, %ecx
	callq	_netplay_send
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_35
## %bb.4:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r12)
	je	LBB0_8
## %bb.5:
	xorl	%ebx, %ebx
	leaq	-68(%rbp), %r13
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_htonl
	movl	%eax, -68(%rbp)
	movl	16(%r15), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rdx
	movl	$4, %ecx
	callq	_netplay_send
	testl	%eax, %eax
	je	LBB0_34
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jb	LBB0_6
LBB0_8:
	movl	16(%r15), %esi
	movq	16(%r14), %rdx
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	$8, %ecx
	callq	_netplay_send
	testl	%eax, %eax
	movl	$0, %r13d
	je	LBB0_35
## %bb.9:
	cmpl	$0, (%r12)
	je	LBB0_13
## %bb.10:
	leaq	-68(%rbp), %r13
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	24(%r14), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_htonl
	movl	%eax, -68(%rbp)
	movl	16(%r15), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rdx
	movl	$4, %ecx
	callq	_netplay_send
	testl	%eax, %eax
	je	LBB0_34
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	movslq	(%r12), %rax
	cmpq	%rax, %rbx
	jb	LBB0_11
LBB0_13:
	movq	(%r15), %rdi
	callq	_strlen
	movq	_NETPLAY_NICK_LEN@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rcx
	addq	$-5, %rcx
	cmpq	%rcx, %rax
	cmovbq	%rax, %rcx
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	$1, %r12d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	(%r15), %rdi
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	addq	%rax, %rdi
	movq	_NETPLAY_NICK_LEN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	subl	%eax, %esi
	incl	%r12d
	leaq	L_.str(%rip), %rdx
	movl	%r12d, %ecx
	callq	_snprintf
	movq	(%r15), %rax
	movslq	(%rbx), %rcx
	movb	$0, -1(%rcx,%rax)
LBB0_15:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_18 Depth 2
	movq	32(%r14), %rax
	testq	%rax, %rax
	je	LBB0_25
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%r12d, -72(%rbp)                ## 4-byte Spill
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_18 Depth=2
	incq	%r12
	addq	$32, %r13
	cmpq	%rax, %r12
	jae	LBB0_23
LBB0_18:                                ##   Parent Loop BB0_15 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	48(%r14), %rcx
	leaq	(%rcx,%r13), %rdx
	cmpq	%r15, %rdx
	je	LBB0_17
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=2
	cmpq	$0, 24(%rcx,%r13)
	je	LBB0_17
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=2
	movq	8(%rcx,%r13), %rdx
	movq	_NETPLAY_CONNECTION_CONNECTED@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jl	LBB0_17
## %bb.21:                              ##   in Loop: Header=BB0_18 Depth=2
	movq	(%r15), %rdi
	movq	(%rcx,%r13), %rsi
	movl	(%rbx), %edx
	callq	_strncmp
	testl	%eax, %eax
	je	LBB0_28
## %bb.22:                              ##   in Loop: Header=BB0_18 Depth=2
	movq	32(%r14), %rax
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_15 Depth=1
	xorl	%ebx, %ebx
LBB0_24:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	-72(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_15 Depth=1
	xorl	%ebx, %ebx
LBB0_26:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	(%r15), %rdi
	movq	40(%r14), %rsi
	movq	_NETPLAY_NICK_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_strncmp
	testb	%bl, %bl
	jne	LBB0_14
## %bb.27:                              ##   in Loop: Header=BB0_15 Depth=1
	testl	%eax, %eax
	je	LBB0_14
	jmp	LBB0_30
LBB0_28:                                ##   in Loop: Header=BB0_15 Depth=1
	movb	$1, %bl
	jmp	LBB0_24
LBB0_34:
	xorl	%r13d, %r13d
LBB0_35:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_37
## %bb.36:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	movl	16(%r15), %esi
	movq	(%r15), %rdx
	movq	_NETPLAY_NICK_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_netplay_send
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_35
## %bb.31:
	movl	16(%r15), %esi
	movq	-104(%rbp), %rdx
	movl	-112(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_netplay_send
	testl	%eax, %eax
	je	LBB0_35
## %bb.32:
	movl	16(%r15), %esi
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_netplay_send_flush
	testl	%eax, %eax
	je	LBB0_35
## %bb.33:
	movq	_NETPLAY_CONNECTION_SPECTATING@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_netplay_handshake_ready
	movl	$1, %r13d
	jmp	LBB0_35
LBB0_37:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRO_MEMORY_SAVE_RAM,4,2      ## @RETRO_MEMORY_SAVE_RAM
	.comm	_NETPLAY_CMD_SYNC,4,2           ## @NETPLAY_CMD_SYNC
	.comm	_MAX_INPUT_DEVICES,4,2          ## @MAX_INPUT_DEVICES
	.comm	_NETPLAY_NICK_LEN,4,2           ## @NETPLAY_NICK_LEN
	.comm	_NETPLAY_CMD_SYNC_BIT_PAUSED,4,2 ## @NETPLAY_CMD_SYNC_BIT_PAUSED
	.comm	_NETPLAY_CONNECTION_CONNECTED,8,3 ## @NETPLAY_CONNECTION_CONNECTED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	" (%d)"

	.comm	_NETPLAY_CONNECTION_SPECTATING,8,3 ## @NETPLAY_CONNECTION_SPECTATING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_handshake_sync         ; -- Begin function netplay_handshake_sync
	.p2align	2
_netplay_handshake_sync:                ; @netplay_handshake_sync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	str	wzr, [sp, #12]
Lloh3:
	adrp	x8, _RETRO_MEMORY_SAVE_RAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RETRO_MEMORY_SAVE_RAM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [sp, #32]
	add	x0, sp, #16
	bl	_core_get_memory
Lloh6:
	adrp	x8, _NETPLAY_CMD_SYNC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NETPLAY_CMD_SYNC@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_htonl
	str	w0, [sp, #40]
Lloh9:
	adrp	x22, _MAX_INPUT_DEVICES@GOTPAGE
Lloh10:
	ldr	x22, [x22, _MAX_INPUT_DEVICES@GOTPAGEOFF]
	ldr	w8, [x22]
Lloh11:
	adrp	x24, _NETPLAY_NICK_LEN@GOTPAGE
Lloh12:
	ldr	x24, [x24, _NETPLAY_NICK_LEN@GOTPAGEOFF]
	ldr	w9, [x24]
	ldr	w10, [sp, #16]
	mov	w11, #12
	madd	w8, w8, w11, w9
	add	w8, w8, w10
	add	w0, w8, #8
	bl	_htonl
	str	w0, [sp, #44]
	ldr	w0, [x20]
	bl	_htonl
	str	w0, [sp, #48]
	ldr	x8, [x20, #48]
	sub	x8, x19, x8
	lsr	x8, x8, #5
	add	w0, w8, #1
	ldr	x8, [x20, #64]
	cbnz	x8, LBB0_2
; %bb.1:
	ldr	x8, [x20, #56]
	cbz	x8, LBB0_3
LBB0_2:
Lloh13:
	adrp	x8, _NETPLAY_CMD_SYNC_BIT_PAUSED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _NETPLAY_CMD_SYNC_BIT_PAUSED@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w0, w8, w0
LBB0_3:
	bl	_htonl
	str	w0, [sp, #52]
	add	x21, x19, #20
	ldr	w1, [x19, #16]
	add	x2, sp, #40
	mov	x0, x21
	mov	w3, #16
	bl	_netplay_send
	cbz	w0, LBB0_31
; %bb.4:
	ldr	w8, [x22]
	cbz	w8, LBB0_8
; %bb.5:
	mov	x23, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	w0, [x8, x23, lsl #2]
	bl	_htonl
	str	w0, [sp, #12]
	ldr	w1, [x19, #16]
	add	x2, sp, #12
	mov	x0, x21
	mov	w3, #4
	bl	_netplay_send
	cbz	w0, LBB0_31
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.lo	LBB0_6
LBB0_8:
	ldr	w1, [x19, #16]
	ldr	x2, [x20, #16]
	mov	x0, x21
	mov	w3, #8
	bl	_netplay_send
	cbz	w0, LBB0_31
; %bb.9:
	ldr	w8, [x22]
	cbz	w8, LBB0_13
; %bb.10:
	mov	x23, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #24]
	ldr	w0, [x8, x23, lsl #2]
	bl	_htonl
	str	w0, [sp, #12]
	ldr	w1, [x19, #16]
	add	x2, sp, #12
	mov	x0, x21
	mov	w3, #4
	bl	_netplay_send
	cbz	w0, LBB0_31
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x23, x23, #1
	ldrsw	x8, [x22]
	cmp	x23, x8
	b.lo	LBB0_11
LBB0_13:
	ldr	x0, [x19]
	bl	_strlen
	ldrsw	x8, [x24]
	sub	x8, x8, #5
	cmp	x0, x8
	csel	x25, x0, x8, lo
	mov	w22, #1
Lloh16:
	adrp	x23, l_.str@PAGE
Lloh17:
	add	x23, x23, l_.str@PAGEOFF
Lloh18:
	adrp	x26, _NETPLAY_CONNECTION_CONNECTED@GOTPAGE
Lloh19:
	ldr	x26, [x26, _NETPLAY_CONNECTION_CONNECTED@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x19]
	add	x0, x8, x25
	ldr	w8, [x24]
	sub	w1, w8, w25
	add	w22, w22, #1
	mov	x2, x23
	mov	x3, x22
	bl	_snprintf
	ldr	x8, [x19]
	ldrsw	x9, [x24]
	add	x8, x9, x8
	sturb	wzr, [x8, #-1]
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_23
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x27, #0
	mov	x28, #0
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=2
	add	x28, x28, #1
	add	x27, x27, #32
	cmp	x28, x8
	b.hs	LBB0_23
LBB0_18:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x20, #48]
	add	x10, x9, x27
	cmp	x10, x19
	b.eq	LBB0_17
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	ldr	x10, [x10, #24]
	cbz	x10, LBB0_17
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=2
	add	x10, x9, x27
	ldr	x10, [x10, #8]
	ldr	x11, [x26]
	cmp	x10, x11
	b.lt	LBB0_17
; %bb.21:                               ;   in Loop: Header=BB0_18 Depth=2
	ldr	x0, [x19]
	ldr	x1, [x9, x27]
	ldr	w2, [x24]
	bl	_strncmp
	cbz	w0, LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_18 Depth=2
	ldr	x8, [x20, #32]
	b	LBB0_17
LBB0_23:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w27, #0
LBB0_24:                                ;   in Loop: Header=BB0_15 Depth=1
	ldr	x0, [x19]
	ldr	x1, [x20, #40]
	ldr	w2, [x24]
	bl	_strncmp
	tbnz	w27, #0, LBB0_14
; %bb.25:                               ;   in Loop: Header=BB0_15 Depth=1
	cbz	w0, LBB0_14
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w27, #1
	b	LBB0_24
LBB0_27:
	ldr	w1, [x19, #16]
	ldr	x2, [x19]
	ldr	w3, [x24]
	mov	x0, x21
	bl	_netplay_send
	cbz	w0, LBB0_31
; %bb.28:
	ldr	w1, [x19, #16]
	ldr	x2, [sp, #24]
	ldr	w3, [sp, #16]
	mov	x0, x21
	bl	_netplay_send
	cbz	w0, LBB0_31
; %bb.29:
	ldr	w1, [x19, #16]
	mov	x0, x21
	mov	w2, #0
	bl	_netplay_send_flush
	cbz	w0, LBB0_31
; %bb.30:
Lloh20:
	adrp	x8, _NETPLAY_CONNECTION_SPECTATING@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NETPLAY_CONNECTION_SPECTATING@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	str	x8, [x19, #8]
	mov	x0, x20
	mov	x1, x19
	bl	_netplay_handshake_ready
	mov	w0, #1
LBB0_31:
	ldr	x8, [sp, #56]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_33
; %bb.32:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_33:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRO_MEMORY_SAVE_RAM,4,2      ; @RETRO_MEMORY_SAVE_RAM
	.comm	_NETPLAY_CMD_SYNC,4,2           ; @NETPLAY_CMD_SYNC
	.comm	_MAX_INPUT_DEVICES,4,2          ; @MAX_INPUT_DEVICES
	.comm	_NETPLAY_NICK_LEN,4,2           ; @NETPLAY_NICK_LEN
	.comm	_NETPLAY_CMD_SYNC_BIT_PAUSED,4,2 ; @NETPLAY_CMD_SYNC_BIT_PAUSED
	.comm	_NETPLAY_CONNECTION_CONNECTED,8,3 ; @NETPLAY_CONNECTION_CONNECTED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	" (%d)"

	.comm	_NETPLAY_CONNECTION_SPECTATING,8,3 ; @NETPLAY_CONNECTION_SPECTATING
.subsections_via_symbols
