	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_netplay_new                    ## -- Begin function netplay_new
	.p2align	4, 0x90
_netplay_new:                           ## @netplay_new
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	$1, %edi
	movl	$112, %esi
	callq	_calloc
	movq	%rax, %r13
	xorl	%eax, %eax
	testq	%r13, %r13
	je	LBB0_28
## %bb.1:
	movl	32(%rbp), %r8d
	movq	24(%rbp), %rsi
	movl	16(%rbp), %edx
	movl	$-1, (%r13)
	movl	%r12d, %r9d
	movl	%r12d, 104(%r13)
	movl	(%r15), %edi
	movl	%edi, 100(%r13)
	xorl	%edi, %edi
	movq	%r14, %rcx
	orq	%rbx, %rcx
	sete	%dil
	movl	%edi, 4(%r13)
	movl	$0, 8(%r13)
	cmovnel	%eax, %edx
	movl	%edx, 12(%r13)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 16(%r13)
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 20(%r13)
	movabsq	$4294967296, %rcx               ## imm = 0x100000000
	movq	_NETPLAY_CONNECTION_NONE@GOTPCREL(%rip), %rdx
	cmoveq	_NETPLAY_CONNECTION_SPECTATING@GOTPCREL(%rip), %rdx
	movq	%rcx, 24(%r13)
	movl	%r8d, 96(%r13)
	movq	(%rdx), %rcx
	movq	%rcx, 64(%r13)
	movq	%rbx, %r15
	jne	LBB0_3
## %bb.2:
	xorl	%ecx, %ecx
	jmp	LBB0_4
LBB0_3:
	movq	%r13, %rcx
	addq	$80, %rcx
	movl	$-1, 80(%r13)
	movl	$1, %eax
LBB0_4:
	movl	%r9d, %ebx
	movq	%rcx, 56(%r13)
	movl	%eax, 32(%r13)
	movl	72(%r13), %edi
	cmpb	$0, (%rsi)
	jne	LBB0_6
## %bb.5:
	movq	_RARCH_DEFAULT_NICK@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
LBB0_6:
	movl	$4, %edx
	callq	_strlcpy
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movl	%ebx, %ecx
	callq	_init_socket
	testl	%eax, %eax
	je	LBB0_27
## %bb.7:
	movq	%r13, %rdi
	callq	_netplay_init_buffers
	testl	%eax, %eax
	je	LBB0_27
## %bb.8:
	cmpl	$0, 4(%r13)
	je	LBB0_17
## %bb.9:
	movq	_MAX_INPUT_DEVICES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_19
## %bb.10:
	movq	_RETRO_DEVICE_KEYBOARD@GOTPCREL(%rip), %r12
	movq	_RETRO_DEVICE_NONE@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	movq	_MAX_INPUT_DEVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	%rax, %rbx
	jae	LBB0_18
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_input_config_get_device
	movl	%eax, %r15d
	movq	40(%r13), %rax
	movl	%r15d, (%rax,%rbx,4)
	movq	_RETRO_DEVICE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	cmpl	(%r12), %eax
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	$1, 48(%r13)
	xorl	%eax, %eax
	callq	_netplay_key_hton_init
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	cmpl	(%r14), %r15d
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	$1, %esi
	movl	%ebx, %ecx
	shll	%cl, %esi
	movq	%r13, %rdi
	callq	_netplay_expected_input_size
	testl	%eax, %eax
	jne	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	leal	1(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_WARN
	jmp	LBB0_16
LBB0_17:
	movq	56(%r13), %rsi
	movq	%r13, %rdi
	callq	_netplay_handshake_init_send
	movq	_NETPLAY_CONNECTION_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	56(%r13), %rcx
	movq	%rax, 8(%rcx)
	movq	%rax, 64(%r13)
LBB0_18:
	cmpl	$0, 4(%r13)
	je	LBB0_20
LBB0_19:
	movl	(%r13), %edi
	jmp	LBB0_21
LBB0_20:
	movq	56(%r13), %rax
	movl	(%rax), %edi
LBB0_21:
	callq	_socket_nonblock
	testl	%eax, %eax
	jne	LBB0_29
## %bb.22:
	movl	(%r13), %edi
	testl	%edi, %edi
	js	LBB0_24
## %bb.23:
	callq	_socket_close
LBB0_24:
	movq	56(%r13), %rax
	testq	%rax, %rax
	je	LBB0_27
## %bb.25:
	movl	(%rax), %edi
	testl	%edi, %edi
	js	LBB0_27
## %bb.26:
	callq	_socket_close
LBB0_27:
	movq	%r13, %rdi
	callq	_free
LBB0_28:
	xorl	%r13d, %r13d
LBB0_29:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NETPLAY_CONNECTION_SPECTATING,8,3 ## @NETPLAY_CONNECTION_SPECTATING
	.comm	_NETPLAY_CONNECTION_NONE,8,3    ## @NETPLAY_CONNECTION_NONE
	.comm	_RARCH_DEFAULT_NICK,8,3         ## @RARCH_DEFAULT_NICK
	.comm	_MAX_INPUT_DEVICES,4,2          ## @MAX_INPUT_DEVICES
	.comm	_RETRO_DEVICE_MASK,4,2          ## @RETRO_DEVICE_MASK
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ## @RETRO_DEVICE_KEYBOARD
	.comm	_RETRO_DEVICE_NONE,4,2          ## @RETRO_DEVICE_NONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Netplay does not support input device %u\n"

	.comm	_NETPLAY_CONNECTION_INIT,8,3    ## @NETPLAY_CONNECTION_INIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function netplay_new
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_netplay_new
	.p2align	2
_netplay_new:                           ; @netplay_new
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x7
	mov	x24, x6
	mov	x27, x5
	mov	x25, x4
	mov	x26, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	w0, #1
	mov	w1, #112
	bl	_calloc
	mov	x19, x0
	cbz	x0, LBB0_25
; %bb.1:
	ldr	w9, [x29, #16]
	mov	w8, #-1
	str	w8, [x19]
	str	w20, [x19, #104]
	ldr	w10, [x27]
	orr	x11, x22, x21
Lloh0:
	adrp	x12, _NETPLAY_CONNECTION_SPECTATING@GOTPAGE
Lloh1:
	ldr	x12, [x12, _NETPLAY_CONNECTION_SPECTATING@GOTPAGEOFF]
Lloh2:
	adrp	x13, _NETPLAY_CONNECTION_NONE@GOTPAGE
Lloh3:
	ldr	x13, [x13, _NETPLAY_CONNECTION_NONE@GOTPAGEOFF]
	cmp	x11, #0
	csel	x12, x12, x13, eq
	cset	w13, eq
	stp	w13, wzr, [x19, #4]
	csel	w13, w24, wzr, eq
	stp	w13, w26, [x19, #12]
	str	w25, [x19, #20]
Lloh4:
	adrp	x13, lCPI0_0@PAGE
Lloh5:
	ldr	d0, [x13, lCPI0_0@PAGEOFF]
	str	d0, [x19, #24]
	stp	w9, w10, [x19, #96]
	ldr	x9, [x12]
	str	x9, [x19, #64]
	cbnz	x11, LBB0_3
; %bb.2:
	mov	x9, #0
	mov	w8, #0
	b	LBB0_4
LBB0_3:
	mov	x9, x19
	str	w8, [x9, #80]!
	mov	w8, #1
LBB0_4:
	str	x9, [x19, #56]
	str	w8, [x19, #32]
	ldr	w0, [x19, #72]
	ldrb	w8, [x23]
Lloh6:
	adrp	x9, _RARCH_DEFAULT_NICK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RARCH_DEFAULT_NICK@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	w8, #0
	csel	x1, x9, x23, eq
	mov	w2, #4
	bl	_strlcpy
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	mov	x3, x20
	bl	_init_socket
	cbz	w0, LBB0_24
; %bb.5:
	mov	x0, x19
	bl	_netplay_init_buffers
	cbz	w0, LBB0_24
; %bb.6:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_15
; %bb.7:
Lloh9:
	adrp	x23, _MAX_INPUT_DEVICES@GOTPAGE
Lloh10:
	ldr	x23, [x23, _MAX_INPUT_DEVICES@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_17
; %bb.8:
	mov	x20, #0
Lloh11:
	adrp	x24, _RETRO_DEVICE_MASK@GOTPAGE
Lloh12:
	ldr	x24, [x24, _RETRO_DEVICE_MASK@GOTPAGEOFF]
Lloh13:
	adrp	x25, _RETRO_DEVICE_KEYBOARD@GOTPAGE
Lloh14:
	ldr	x25, [x25, _RETRO_DEVICE_KEYBOARD@GOTPAGEOFF]
	mov	w26, #1
Lloh15:
	adrp	x27, _RETRO_DEVICE_NONE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _RETRO_DEVICE_NONE@GOTPAGEOFF]
Lloh17:
	adrp	x21, l_.str@PAGE
Lloh18:
	add	x21, x21, l_.str@PAGEOFF
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x20, x20, #1
	ldr	w8, [x23]
	cmp	x20, x8
	b.hs	LBB0_16
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_input_config_get_device
	mov	x22, x0
	ldr	x8, [x19, #40]
	str	w0, [x8, x20, lsl #2]
	ldr	w8, [x24]
	and	w8, w8, w0
	ldr	w9, [x25]
	cmp	w8, w9
	b.ne	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	str	w26, [x19, #48]
	bl	_netplay_key_hton_init
LBB0_12:                                ;   in Loop: Header=BB0_10 Depth=1
	ldr	w8, [x27]
	cmp	w22, w8
	b.eq	LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_10 Depth=1
	lsl	w1, w26, w20
	mov	x0, x19
	bl	_netplay_expected_input_size
	cbnz	w0, LBB0_9
; %bb.14:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w1, w20, #1
	mov	x0, x21
	bl	_RARCH_WARN
	b	LBB0_9
LBB0_15:
	ldr	x1, [x19, #56]
	mov	x0, x19
	bl	_netplay_handshake_init_send
Lloh19:
	adrp	x8, _NETPLAY_CONNECTION_INIT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NETPLAY_CONNECTION_INIT@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	ldr	x9, [x19, #56]
	str	x8, [x9, #8]
	str	x8, [x19, #64]
LBB0_16:
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_18
LBB0_17:
	ldr	w0, [x19]
	bl	_socket_nonblock
	cbnz	w0, LBB0_25
	b	LBB0_19
LBB0_18:
	ldr	x8, [x19, #56]
	ldr	w0, [x8]
	bl	_socket_nonblock
	cbnz	w0, LBB0_25
LBB0_19:
	ldr	w0, [x19]
	tbnz	w0, #31, LBB0_21
; %bb.20:
	bl	_socket_close
LBB0_21:
	ldr	x8, [x19, #56]
	cbz	x8, LBB0_24
; %bb.22:
	ldr	w0, [x8]
	tbnz	w0, #31, LBB0_24
; %bb.23:
	bl	_socket_close
LBB0_24:
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_25:
	mov	x0, x19
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_NETPLAY_CONNECTION_SPECTATING,8,3 ; @NETPLAY_CONNECTION_SPECTATING
	.comm	_NETPLAY_CONNECTION_NONE,8,3    ; @NETPLAY_CONNECTION_NONE
	.comm	_RARCH_DEFAULT_NICK,8,3         ; @RARCH_DEFAULT_NICK
	.comm	_MAX_INPUT_DEVICES,4,2          ; @MAX_INPUT_DEVICES
	.comm	_RETRO_DEVICE_MASK,4,2          ; @RETRO_DEVICE_MASK
	.comm	_RETRO_DEVICE_KEYBOARD,4,2      ; @RETRO_DEVICE_KEYBOARD
	.comm	_RETRO_DEVICE_NONE,4,2          ; @RETRO_DEVICE_NONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Netplay does not support input device %u\n"

	.comm	_NETPLAY_CONNECTION_INIT,8,3    ; @NETPLAY_CONNECTION_INIT
.subsections_via_symbols
