	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_poll_net_input         ## -- Begin function netplay_poll_net_input
	.p2align	4, 0x90
_netplay_poll_net_input:                ## @netplay_poll_net_input
	.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	(%rdi), %r9
	testq	%r9, %r9
	je	LBB0_34
## %bb.1:
	movq	%rdi, %r13
	movq	40(%rdi), %r8
	cmpq	$1, %r9
	jne	LBB0_3
## %bb.2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
LBB0_9:
	testb	$1, %r9b
	je	LBB0_12
## %bb.10:
	shlq	$4, %rdx
	cmpq	$0, 8(%r8,%rdx)
	je	LBB0_12
## %bb.11:
	movl	(%r8,%rdx), %eax
	leal	1(%rax), %edx
	cmpl	%ecx, %eax
	cmovll	%ecx, %edx
	movl	%edx, %ecx
LBB0_12:
	testl	%ecx, %ecx
	je	LBB0_34
## %bb.13:
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movl	$1, %eax
	xorl	%ecx, %ecx
	leaq	-44(%rbp), %rbx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_16 Depth 2
                                        ##     Child Loop BB0_25 Depth 2
	movl	$0, -44(%rbp)
	incq	%rcx
	movq	%rcx, 8(%r13)
	testq	%rax, %rax
	je	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_19:                                ##   in Loop: Header=BB0_16 Depth=2
	incq	%r15
	addq	$16, %r12
	cmpq	(%r13), %r15
	jae	LBB0_20
LBB0_16:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	40(%r13), %r14
	cmpq	$0, 8(%r14,%r12)
	je	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=2
	addq	%r12, %r14
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_netplay_get_cmd
	testl	%eax, %eax
	jne	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=2
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_netplay_hangup
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	testl	%r15d, %r15d
	leaq	-68(%rbp), %r12
	je	LBB0_33
## %bb.21:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r13, %rdi
	callq	_netplay_update_unread_ptr
	movq	16(%r13), %rax
	cmpq	24(%r13), %rax
	jg	LBB0_34
## %bb.22:                              ##   in Loop: Header=BB0_14 Depth=1
	cmpl	$0, -44(%rbp)
	jne	LBB0_33
## %bb.23:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	$0, -56(%rbp)
	movq	_RETRY_MS@GOTPCREL(%rip), %rax
	imull	$1000, (%rax), %eax             ## imm = 0x3E8
	movl	%eax, -56(%rbp)
	movq	%r12, %rdi
	callq	_FD_ZERO
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_28
## %bb.24:                              ##   in Loop: Header=BB0_14 Depth=1
	movl	$8, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_25 Depth=2
	incq	%r14
	addq	$16, %rbx
	cmpq	%rax, %r14
	jae	LBB0_28
LBB0_25:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	40(%r13), %rcx
	cmpq	$0, (%rcx,%rbx)
	je	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=2
	movl	-8(%rcx,%rbx), %edi
	movq	%r12, %rsi
	callq	_FD_SET
	movq	(%r13), %rax
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_28:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	leaq	-56(%rbp), %r8
	callq	_socket_select
	testq	%rax, %rax
	js	LBB0_31
## %bb.29:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	8(%r13), %rdx
	movq	24(%r13), %rsi
	movq	_MAX_RETRIES@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_LOG
	movq	8(%r13), %rax
	cmpq	(%rbx), %rax
	jl	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_14 Depth=1
	cmpl	$0, 32(%r13)
	je	LBB0_31
LBB0_32:                                ##   in Loop: Header=BB0_14 Depth=1
	leaq	-44(%rbp), %rbx
LBB0_33:                                ##   in Loop: Header=BB0_14 Depth=1
	movl	-44(%rbp), %eax
	orl	%r15d, %eax
	je	LBB0_34
## %bb.36:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	(%r13), %rax
	movq	8(%r13), %rcx
	jmp	LBB0_14
LBB0_34:
	xorl	%eax, %eax
LBB0_35:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%r9, %r10
	andq	$-2, %r10
	leaq	24(%r8), %rdi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$2, %rdx
	addq	$32, %rdi
	cmpq	%rdx, %r10
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, -16(%rdi)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-24(%rdi), %ebx
	leal	1(%rbx), %eax
	cmpl	%ecx, %ebx
	cmovgel	%eax, %ecx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	cmpq	$0, (%rdi)
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	-8(%rdi), %eax
	leal	1(%rax), %ebx
	cmpl	%ecx, %eax
	cmovgel	%ebx, %ecx
	jmp	LBB0_8
LBB0_31:
	movl	$-1, %eax
	jmp	LBB0_35
	.cfi_endproc
                                        ## -- End function
	.comm	_RETRY_MS,4,2                   ## @RETRY_MS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[netplay] Network is stalling at frame %u, count %u of %d ...\n"

	.comm	_MAX_RETRIES,8,3                ## @MAX_RETRIES
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_poll_net_input         ; -- Begin function netplay_poll_net_input
	.p2align	2
_netplay_poll_net_input:                ; @netplay_poll_net_input
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_26
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	mov	w21, #0
	ldr	x9, [x0, #40]
	add	x9, x9, #8
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x9, x9, #16
	subs	x8, x8, #1
	b.eq	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9]
	cbz	x10, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldur	w10, [x9, #-8]
	cmp	w10, w21
	csinc	w21, w21, w10, lt
	b	LBB0_2
LBB0_5:
	cbz	w21, LBB0_26
; %bb.6:
	mov	x8, #0
Lloh0:
	adrp	x24, _RETRY_MS@GOTPAGE
Lloh1:
	ldr	x24, [x24, _RETRY_MS@GOTPAGEOFF]
	mov	w9, #1
	mov	w25, #1000
Lloh2:
	adrp	x26, _MAX_RETRIES@GOTPAGE
Lloh3:
	ldr	x26, [x26, _MAX_RETRIES@GOTPAGEOFF]
Lloh4:
	adrp	x22, l_.str@PAGE
Lloh5:
	add	x22, x22, l_.str@PAGEOFF
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
                                        ;     Child Loop BB0_19 Depth 2
	str	wzr, [sp, #12]
	add	x8, x8, #1
	str	x8, [x20, #8]
	cbz	x9, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x27, #0
	mov	x28, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=2
	add	x28, x28, #1
	ldr	x8, [x20]
	add	x27, x27, #16
	cmp	x28, x8
	b.hs	LBB0_13
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x20, #40]
	add	x23, x8, x27
	ldr	x8, [x23, #8]
	cbz	x8, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x23
	bl	_netplay_get_cmd
	cbnz	w0, LBB0_9
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	x0, x20
	mov	x1, x23
	bl	_netplay_hangup
	b	LBB0_9
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	cbz	w19, LBB0_24
; %bb.14:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x20
	bl	_netplay_update_unread_ptr
	ldp	x8, x9, [x20, #16]
	cmp	x8, x9
	b.gt	LBB0_26
; %bb.15:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_24
; %bb.16:                               ;   in Loop: Header=BB0_7 Depth=1
	str	xzr, [sp]
	ldr	w8, [x24]
	mul	w8, w8, w25
	str	w8, [sp]
	add	x0, sp, #8
	bl	_FD_ZERO
	ldr	x8, [x20]
	cbz	x8, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x23, #0
	mov	x27, #0
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=2
	add	x27, x27, #1
	add	x23, x23, #16
	cmp	x27, x8
	b.hs	LBB0_21
LBB0_19:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x20, #40]
	add	x10, x9, x23
	ldr	x10, [x10, #8]
	cbz	x10, LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	ldr	w0, [x9, x23]
	add	x1, sp, #8
	bl	_FD_SET
	ldr	x8, [x20]
	b	LBB0_18
LBB0_21:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x1, sp, #8
	mov	x4, sp
	mov	x0, x21
	mov	x2, #0
	mov	x3, #0
	bl	_socket_select
	tbnz	x0, #63, LBB0_28
; %bb.22:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x1, [x20, #24]
	ldr	x2, [x20, #8]
	ldr	x3, [x26]
	mov	x0, x22
	bl	_RARCH_LOG
	ldr	x8, [x20, #8]
	ldr	x9, [x26]
	cmp	x8, x9
	b.lt	LBB0_24
; %bb.23:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x20, #32]
	cbz	w8, LBB0_28
LBB0_24:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [sp, #12]
	orr	w8, w8, w19
	cbz	w8, LBB0_26
; %bb.25:                               ;   in Loop: Header=BB0_7 Depth=1
	ldp	x9, x8, [x20]
	b	LBB0_7
LBB0_26:
	mov	w0, #0
LBB0_27:
	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
LBB0_28:
	mov	w0, #-1
	b	LBB0_27
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_RETRY_MS,4,2                   ; @RETRY_MS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[netplay] Network is stalling at frame %u, count %u of %d ...\n"

	.comm	_MAX_RETRIES,8,3                ; @MAX_RETRIES
.subsections_via_symbols
