	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_pre_frame              ## -- Begin function netplay_pre_frame
	.p2align	4, 0x90
_netplay_pre_frame:                     ## @netplay_pre_frame
	.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, %rbx
	xorl	%eax, %eax
	callq	_config_get_ptr
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_retro_assert
	cmpq	$0, 8(%r14)
	je	LBB0_13
## %bb.1:
	movq	_reannounce@GOTPCREL(%rip), %rdx
	movl	(%rdx), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%rdx)
	movq	24(%rbx), %rdx
	movq	_is_mitm@GOTPCREL(%rip), %rsi
	orq	(%rsi), %rdx
	je	LBB0_4
## %bb.2:
	movslq	%ecx, %rcx
	imulq	$458129845, %rcx, %rcx          ## imm = 0x1B4E81B5
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$38, %rcx
	addl	%edx, %ecx
	imull	$600, %ecx, %ecx                ## imm = 0x258
	negl	%ecx
	addl	%ecx, %eax
	incl	%eax
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	xorl	%eax, %eax
	callq	_netplay_announce
LBB0_4:
	cmpq	$0, 80(%rbx)
	je	LBB0_6
LBB0_5:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_netplay_frontend_paused
LBB0_6:
	movq	_NETPLAY_QUIRK_INITIALIZATION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_netplay_try_init_serialization
LBB0_8:
	cmpq	$0, 24(%rbx)
	je	LBB0_10
## %bb.9:
	cmpl	$0, (%r14)
	je	LBB0_20
LBB0_10:
	movq	%rbx, %rdi
	callq	_netplay_sync_pre_frame
	cmpq	$0, 24(%rbx)
	je	LBB0_14
## %bb.11:
	testl	%eax, %eax
	je	LBB0_18
## %bb.12:
	movl	$1, %eax
	cmpl	$2, 4(%rbx)
	jge	LBB0_16
	jmp	LBB0_19
LBB0_13:
	movq	_reannounce@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	cmpq	$0, 80(%rbx)
	jne	LBB0_5
	jmp	LBB0_6
LBB0_14:
	movq	32(%rbx), %rcx
	cmpl	$0, (%rcx)
	je	LBB0_29
## %bb.15:
	testl	%eax, %eax
	je	LBB0_18
LBB0_16:
	cmpq	$0, 16(%rbx)
	jne	LBB0_18
## %bb.17:
	cmpq	$0, 8(%rbx)
	je	LBB0_30
LBB0_18:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_netplay_sync_post_frame
	xorl	%eax, %eax
	jmp	LBB0_19
LBB0_20:
	movq	%rbx, %rdi
	callq	_netplay_lan_ad_server
	cmpq	$0, 72(%rbx)
	je	LBB0_10
## %bb.21:
	cmpl	$0, 64(%rbx)
	jne	LBB0_10
## %bb.22:
	cmpq	$0, 48(%rbx)
	je	LBB0_10
## %bb.23:
	leaq	40(%rbx), %r14
	cmpq	$0, (%r14)
	jne	LBB0_10
## %bb.24:
	movl	$0, -24(%rbp)
	movl	60(%rbx), %eax
	movl	%eax, -28(%rbp)
	movl	56(%rbx), %edi
	leaq	-28(%rbp), %rsi
	leaq	-24(%rbp), %r8
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_socket_select
	testq	%rax, %rax
	jle	LBB0_26
## %bb.25:
	movq	%r14, %rdi
	callq	_natt_read
LBB0_26:
	cmpq	$0, 48(%rbx)
	je	LBB0_28
## %bb.27:
	cmpq	$0, (%r14)
	je	LBB0_10
LBB0_28:
	movq	%rbx, %rdi
	callq	_netplay_announce_nat_traversal
	jmp	LBB0_10
LBB0_29:
	movq	%rbx, %rdi
	callq	_netplay_disconnect
LBB0_30:
	movl	$1, %eax
LBB0_19:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_reannounce,4,2                 ## @reannounce
	.comm	_is_mitm,8,3                    ## @is_mitm
	.comm	_NETPLAY_QUIRK_INITIALIZATION,4,2 ## @NETPLAY_QUIRK_INITIALIZATION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_pre_frame              ; -- Begin function netplay_pre_frame
	.p2align	2
_netplay_pre_frame:                     ; @netplay_pre_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_config_get_ptr
	mov	x20, x0
	mov	x0, x19
	bl	_retro_assert
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_12
; %bb.1:
Lloh0:
	adrp	x8, _reannounce@GOTPAGE
Lloh1:
	ldr	x8, [x8, _reannounce@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh2:
	adrp	x8, _is_mitm@GOTPAGE
Lloh3:
	ldr	x8, [x8, _is_mitm@GOTPAGEOFF]
	ldr	x10, [x19, #24]
Lloh4:
	ldr	x8, [x8]
	orr	x8, x10, x8
	mov	w10, #33205
	movk	w10, #6990, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	asr	x10, x10, #38
	add	w10, w10, w11
	mov	w11, #600
	msub	w9, w10, w11, w9
	cmp	x8, #0
	ccmp	w9, #0, #0, ne
	b.ne	LBB0_3
; %bb.2:
	bl	_netplay_announce
LBB0_3:
	ldr	x8, [x19, #80]
	cbz	x8, LBB0_5
LBB0_4:
	mov	x0, x19
	mov	w1, #0
	bl	_netplay_frontend_paused
LBB0_5:
	ldr	w8, [x19]
Lloh5:
	adrp	x9, _NETPLAY_QUIRK_INITIALIZATION@GOTPAGE
Lloh6:
	ldr	x9, [x9, _NETPLAY_QUIRK_INITIALIZATION@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_netplay_try_init_serialization
LBB0_7:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	w8, [x20]
	cbz	w8, LBB0_18
LBB0_9:
	mov	x0, x19
	bl	_netplay_sync_pre_frame
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_13
; %bb.10:
	cbz	w0, LBB0_17
; %bb.11:
	ldr	w8, [x19, #4]
	cmp	w8, #2
	b.ge	LBB0_15
	b	LBB0_28
LBB0_12:
Lloh8:
	adrp	x8, _reannounce@GOTPAGE
Lloh9:
	ldr	x8, [x8, _reannounce@GOTPAGEOFF]
	mov	w9, #-1
Lloh10:
	str	w9, [x8]
	ldr	x8, [x19, #80]
	cbnz	x8, LBB0_4
	b	LBB0_5
LBB0_13:
	ldr	x8, [x19, #32]
	ldr	w8, [x8]
	cbz	w8, LBB0_27
; %bb.14:
	cbz	w0, LBB0_17
LBB0_15:
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_17
; %bb.16:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_28
LBB0_17:
	mov	x0, x19
	mov	w1, #1
	bl	_netplay_sync_post_frame
	mov	w0, #0
	b	LBB0_29
LBB0_18:
	mov	x0, x19
	bl	_netplay_lan_ad_server
	ldr	x8, [x19, #72]
	cbz	x8, LBB0_9
; %bb.19:
	ldr	w8, [x19, #64]
	cbnz	w8, LBB0_9
; %bb.20:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_9
; %bb.21:
	add	x20, x19, #40
	ldr	x8, [x20]
	cbnz	x8, LBB0_9
; %bb.22:
	ldp	w0, w8, [x19, #56]
	stp	w8, wzr, [sp, #4]
	add	x1, sp, #4
	add	x4, sp, #8
	mov	x2, #0
	mov	x3, #0
	bl	_socket_select
	cmp	x0, #1
	b.lt	LBB0_24
; %bb.23:
	mov	x0, x20
	bl	_natt_read
LBB0_24:
	ldr	x8, [x19, #48]
	cbz	x8, LBB0_26
; %bb.25:
	ldr	x8, [x20]
	cbz	x8, LBB0_9
LBB0_26:
	mov	x0, x19
	bl	_netplay_announce_nat_traversal
	b	LBB0_9
LBB0_27:
	mov	x0, x19
	bl	_netplay_disconnect
LBB0_28:
	mov	w0, #1
LBB0_29:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_reannounce,4,2                 ; @reannounce
	.comm	_is_mitm,8,3                    ; @is_mitm
	.comm	_NETPLAY_QUIRK_INITIALIZATION,4,2 ; @NETPLAY_QUIRK_INITIALIZATION
.subsections_via_symbols
