	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_recv                   ## -- Begin function netplay_recv
	.p2align	4, 0x90
_netplay_recv:                          ## @netplay_recv
	.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	%r8d, -48(%rbp)                 ## 4-byte Spill
	movq	%rcx, %r14
	movq	%rdx, %r12
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	(%rdi), %rsi
	movq	8(%rdi), %rcx
	movl	$0, -44(%rbp)
	movq	16(%rdi), %rdx
	addq	%rsi, %rdx
	cmpq	%rcx, %rsi
	jge	LBB0_1
## %bb.5:
	notq	%rsi
	addq	%rsi, %rcx
	leaq	-44(%rbp), %rsi
	movl	%r15d, %edi
	callq	_socket_receive_all_nonblocking
	movl	$-1, %r13d
	testl	%eax, %eax
	js	LBB0_19
LBB0_7:
	cmpl	$0, -44(%rbp)
	jne	LBB0_19
## %bb.8:
	movl	%eax, %eax
	addq	(%rbx), %rax
	movq	%rax, (%rbx)
	jmp	LBB0_9
LBB0_1:
	xorl	%eax, %eax
	cmpq	$1, %rcx
	sbbq	%rax, %rax
	subq	%rsi, %rax
	addq	24(%rbx), %rax
	leaq	-44(%rbp), %rsi
	movl	%r15d, %edi
	movq	%rax, %rcx
	callq	_socket_receive_all_nonblocking
	movl	$-1, %r13d
	testl	%eax, %eax
	js	LBB0_19
## %bb.2:
	cmpl	$0, -44(%rbp)
	jne	LBB0_19
## %bb.3:
	movl	%eax, %eax
	addq	(%rbx), %rax
	movq	%rax, (%rbx)
	cmpq	24(%rbx), %rax
	jge	LBB0_4
LBB0_9:
	movq	32(%rbx), %rsi
	cmpq	%rsi, %rax
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	jge	LBB0_11
## %bb.10:
	movq	24(%rbx), %r13
	subq	%rsi, %r13
	cmpq	%r14, %r13
	jae	LBB0_11
## %bb.14:
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	%r12, %r15
	movq	%r14, %r12
	subq	%r13, %r12
	cmpq	%rax, %r12
	cmovaeq	%rax, %r12
	addq	16(%rbx), %rsi
	movq	%r15, %rdi
	movq	%r13, %rdx
	callq	_memcpy
	leaq	(%r15,%r13), %rdi
	movl	-52(%rbp), %r15d                ## 4-byte Reload
	movq	16(%rbx), %rsi
	movq	%r12, %rdx
	callq	_memcpy
	movq	%r12, 32(%rbx)
	addq	%r12, %r13
	jmp	LBB0_15
LBB0_11:
	movq	%rbx, %rdi
	callq	_buf_unread
	movq	32(%rbx), %rsi
	addq	16(%rbx), %rsi
	cmpq	%r14, %rax
	jae	LBB0_12
## %bb.13:
	movq	%rax, %r13
	movq	%r12, %rdi
	movq	%rax, %rdx
	callq	_memcpy
	movq	32(%rbx), %rax
	addq	%r13, %rax
	xorl	%r12d, %r12d
	cmpq	24(%rbx), %rax
	cmovlq	%rax, %r12
	movq	%r12, 32(%rbx)
	jmp	LBB0_15
LBB0_12:
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_memcpy
	movq	32(%rbx), %rax
	addq	%r14, %rax
	xorl	%r12d, %r12d
	cmpq	24(%rbx), %rax
	cmovlq	%rax, %r12
	movq	%r12, 32(%rbx)
	movq	%r14, %r13
LBB0_15:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	je	LBB0_19
## %bb.16:
	movq	%r12, 8(%rbx)
	testl	%r13d, %r13d
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	js	LBB0_18
## %bb.17:
	cmpl	%r14d, %r13d
	jge	LBB0_19
LBB0_18:
	movslq	%r13d, %rax
	addq	%rax, %rsi
	movq	%r14, %rdx
	subq	%rax, %rdx
	movl	%r15d, %edi
	callq	_socket_receive_all_blocking
	xorl	%r13d, %r13d
	cmpl	$1, %eax
	sbbl	%r13d, %r13d
	orl	%r14d, %r13d
LBB0_19:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	$0, (%rbx)
	movl	$0, -44(%rbp)
	movq	8(%rbx), %rcx
	movq	16(%rbx), %rdx
	decq	%rcx
	leaq	-44(%rbp), %rsi
	movl	%r15d, %edi
	callq	_socket_receive_all_nonblocking
	testl	%eax, %eax
	jns	LBB0_7
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_recv                   ; -- Begin function netplay_recv
	.p2align	2
_netplay_recv:                          ; @netplay_recv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x4
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	mov	x23, x0
	ldp	x8, x9, [x0]
	str	wzr, [sp, #12]
	ldr	x10, [x0, #16]
	add	x2, x10, x8
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	mvn	x8, x8
	add	x3, x9, x8
	b	LBB0_6
LBB0_2:
	ldr	x10, [x23, #24]
	cmp	x9, #0
	csetm	x9, eq
	sub	x8, x9, x8
	add	x3, x8, x10
	add	x1, sp, #12
	mov	x0, x20
	bl	_socket_receive_all_nonblocking
	mov	w24, #-1
	tbnz	w0, #31, LBB0_18
; %bb.3:
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_18
; %bb.4:
	ldr	x8, [x23]
	add	x8, x8, w0, uxtw
	str	x8, [x23]
	ldr	x9, [x23, #24]
	cmp	x8, x9
	b.lt	LBB0_9
; %bb.5:
	str	xzr, [x23]
	str	wzr, [sp, #12]
	ldp	x8, x2, [x23, #8]
	sub	x3, x8, #1
LBB0_6:
	add	x1, sp, #12
	mov	x0, x20
	bl	_socket_receive_all_nonblocking
	mov	w24, #-1
	tbnz	w0, #31, LBB0_18
; %bb.7:
	ldr	w8, [sp, #12]
	cbnz	w8, LBB0_18
; %bb.8:
	ldr	x8, [x23]
	add	x8, x8, w0, uxtw
	str	x8, [x23]
LBB0_9:
	ldr	x9, [x23, #32]
	cmp	x8, x9
	b.ge	LBB0_12
; %bb.10:
	ldr	x10, [x23, #24]
	sub	x24, x10, x9
	cmp	x24, x19
	b.hs	LBB0_12
; %bb.11:
	sub	x10, x19, x24
	cmp	x10, x8
	csel	x25, x10, x8, lo
	ldr	x8, [x23, #16]
	add	x1, x8, x9
	mov	x0, x21
	mov	x2, x24
	bl	_memcpy
	add	x0, x21, x24
	ldr	x1, [x23, #16]
	mov	x2, x25
	bl	_memcpy
	str	x25, [x23, #32]
	add	x24, x25, x24
	cbnz	w22, LBB0_15
	b	LBB0_18
LBB0_12:
	mov	x0, x23
	bl	_buf_unread
	ldr	x8, [x23, #16]
	ldr	x9, [x23, #32]
	add	x1, x9, x8
	cmp	x0, x19
	b.hs	LBB0_14
; %bb.13:
	mov	x24, x0
	mov	x0, x21
	mov	x2, x24
	bl	_memcpy
	ldp	x9, x8, [x23, #24]
	add	x8, x8, x24
	cmp	x8, x9
	csel	x25, x8, xzr, lt
	str	x25, [x23, #32]
	cbnz	w22, LBB0_15
	b	LBB0_18
LBB0_14:
	mov	x0, x21
	mov	x2, x19
	bl	_memcpy
	ldp	x9, x8, [x23, #24]
	add	x8, x8, x19
	cmp	x8, x9
	csel	x25, x8, xzr, lt
	str	x25, [x23, #32]
	mov	x24, x19
	cbz	w22, LBB0_18
LBB0_15:
	str	x25, [x23, #8]
	tbnz	w24, #31, LBB0_17
; %bb.16:
	cmp	w24, w19
	b.ge	LBB0_18
LBB0_17:
	sxtw	x8, w24
	add	x1, x21, x8
	sub	x2, x19, x8
	mov	x0, x20
	bl	_socket_receive_all_blocking
	cmp	w0, #0
	csinv	w24, w19, wzr, ne
LBB0_18:
	mov	x0, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
