	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FCEUD_NetworkConnect           ## -- Begin function FCEUD_NetworkConnect
	.p2align	4, 0x90
_FCEUD_NetworkConnect:                  ## @FCEUD_NetworkConnect
	.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	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	xorl	%eax, %eax
	callq	_SDLNet_Init
	movq	_netplay@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_LocalPortUDP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -100(%rbp)
	movq	_LocalPortTCP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-96(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_SDLNet_ResolveHost
	leaq	-100(%rbp), %rdi
	callq	_SDLNet_UDP_Open
	movq	_UDPSocket@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	%rbx, %rdi
	callq	_SDLNet_TCP_Open
	movq	%rax, -88(%rbp)
	leaq	-88(%rbp), %rdi
	callq	_SDLNet_TCP_Accept
	movq	_Socket@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	movq	%rax, %rdi
	callq	_SDLNet_TCP_GetPeerAddress
	movq	%rbx, %rdi
	movl	%eax, %esi
	movl	$8, %edx
	callq	_memcpy
	xorl	%eax, %eax
	callq	_SDL_GetTicks
	movq	_magic@GOTPCREL(%rip), %r15
	movl	%eax, (%r15)
	movq	_uport@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_SDLNet_Write32
	leaq	-64(%rbp), %rdi
	movl	$1, %esi
	callq	_SDLNet_Write32
	leaq	-48(%rbp), %rdi
	movl	(%r15), %esi
	callq	_SDLNet_Write32
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	movl	$12, %edx
	callq	_SDLNet_TCP_Send
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	movl	$2, %edx
	callq	_SDLNet_TCP_Recv
	movq	%rbx, %rdi
	callq	_de32
	movq	_RemotePortUDP@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_3
LBB0_2:
	movq	_ServerHost@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_RemotePortTCP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-96(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_SDLNet_ResolveHost
	movq	%rbx, %rdi
	callq	_SDLNet_TCP_Open
	movq	_Socket@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	movq	_LocalPortUDP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -88(%rbp)
	leaq	-88(%rbp), %rdi
	callq	_SDLNet_UDP_Open
	movq	_UDPSocket@GOTPCREL(%rip), %r14
	movl	%eax, (%r14)
	movl	-88(%rbp), %esi
	leaq	-80(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_en32
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_SDLNet_TCP_Send
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$12, %edx
	callq	_SDLNet_TCP_Recv
	movq	%rbx, %rdi
	callq	_de32
	movq	_RemotePortUDP@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	leaq	-48(%rbp), %rdi
	callq	_de32
	movq	_magic@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$1, %edi
	callq	_SDLNet_AllocSocketSet
	movq	_set@GOTPCREL(%rip), %rbx
	movl	%eax, (%rbx)
	movq	_TCPSocket@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_SDLNet_TCP_AddSocket
	movl	(%rbx), %edi
	movl	(%r14), %esi
	callq	_SDLNet_UDP_AddSocket
	movq	(%r15), %rax
LBB0_3:
	movq	%rax, -96(%rbp)
	movq	_UDPSocket@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-96(%rbp), %rdx
	xorl	%esi, %esi
	callq	_SDLNet_UDP_Bind
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$88, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_netplay,4,2                    ## @netplay
	.comm	_LocalPortUDP,4,2               ## @LocalPortUDP
	.comm	_LocalPortTCP,4,2               ## @LocalPortTCP
	.comm	_UDPSocket,4,2                  ## @UDPSocket
	.comm	_Socket,8,3                     ## @Socket
	.comm	_magic,4,2                      ## @magic
	.comm	_uport,4,2                      ## @uport
	.comm	_RemotePortUDP,8,3              ## @RemotePortUDP
	.comm	_ServerHost,8,3                 ## @ServerHost
	.comm	_RemotePortTCP,4,2              ## @RemotePortTCP
	.comm	_set,4,2                        ## @set
	.comm	_TCPSocket,4,2                  ## @TCPSocket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FCEUD_NetworkConnect           ; -- Begin function FCEUD_NetworkConnect
	.p2align	2
_FCEUD_NetworkConnect:                  ; @FCEUD_NetworkConnect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	bl	_SDLNet_Init
Lloh3:
	adrp	x8, _netplay@GOTPAGE
Lloh4:
	ldr	x8, [x8, _netplay@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x19, _UDPSocket@GOTPAGE
Lloh7:
	ldr	x19, [x19, _UDPSocket@GOTPAGEOFF]
	cmp	w8, #1
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _LocalPortUDP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LocalPortUDP@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [sp, #4]
Lloh11:
	adrp	x8, _LocalPortTCP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LocalPortTCP@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	add	x0, sp, #16
	mov	x1, #0
	bl	_SDLNet_ResolveHost
	add	x0, sp, #4
	bl	_SDLNet_UDP_Open
	str	w0, [x19]
	add	x0, sp, #16
	bl	_SDLNet_TCP_Open
	str	x0, [sp, #8]
	add	x0, sp, #8
	bl	_SDLNet_TCP_Accept
Lloh14:
	adrp	x20, _Socket@GOTPAGE
Lloh15:
	ldr	x20, [x20, _Socket@GOTPAGEOFF]
	str	x0, [x20]
	bl	_SDLNet_TCP_GetPeerAddress
	mov	x1, x0
	add	x0, sp, #16
	mov	w2, #8
	bl	_memcpy
	bl	_SDL_GetTicks
Lloh16:
	adrp	x21, _magic@GOTPAGE
Lloh17:
	ldr	x21, [x21, _magic@GOTPAGEOFF]
	str	w0, [x21]
Lloh18:
	adrp	x8, _uport@GOTPAGE
Lloh19:
	ldr	x8, [x8, _uport@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	add	x22, sp, #24
	add	x0, sp, #24
	bl	_SDLNet_Write32
	add	x0, x22, #16
	mov	w1, #1
	bl	_SDLNet_Write32
	add	x0, x22, #32
	ldr	w1, [x21]
	bl	_SDLNet_Write32
	ldr	x0, [x20]
	add	x1, sp, #24
	mov	w2, #12
	bl	_SDLNet_TCP_Send
	ldr	x0, [x20]
	add	x1, sp, #24
	mov	w2, #2
	bl	_SDLNet_TCP_Recv
	add	x0, sp, #24
	bl	_de32
Lloh21:
	adrp	x8, _RemotePortUDP@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RemotePortUDP@GOTPAGEOFF]
Lloh23:
	str	x0, [x8]
	b	LBB0_3
LBB0_2:
Lloh24:
	adrp	x8, _ServerHost@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ServerHost@GOTPAGEOFF]
Lloh26:
	ldr	x1, [x8]
Lloh27:
	adrp	x8, _RemotePortTCP@GOTPAGE
Lloh28:
	ldr	x8, [x8, _RemotePortTCP@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	add	x0, sp, #16
	bl	_SDLNet_ResolveHost
	add	x0, sp, #16
	bl	_SDLNet_TCP_Open
Lloh30:
	adrp	x20, _Socket@GOTPAGE
Lloh31:
	ldr	x20, [x20, _Socket@GOTPAGEOFF]
	str	x0, [x20]
Lloh32:
	adrp	x8, _LocalPortUDP@GOTPAGE
Lloh33:
	ldr	x8, [x8, _LocalPortUDP@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	add	x0, sp, #8
	bl	_SDLNet_UDP_Open
	str	w0, [x19]
	ldr	w1, [sp, #8]
	add	x21, sp, #24
	add	x0, sp, #24
	bl	_en32
	ldr	x0, [x20]
	add	x1, sp, #24
	mov	w2, #4
	bl	_SDLNet_TCP_Send
	ldr	x0, [x20]
	add	x1, sp, #24
	mov	w2, #12
	bl	_SDLNet_TCP_Recv
	add	x0, sp, #24
	bl	_de32
Lloh35:
	adrp	x20, _RemotePortUDP@GOTPAGE
Lloh36:
	ldr	x20, [x20, _RemotePortUDP@GOTPAGEOFF]
	str	x0, [x20]
	add	x0, x21, #32
	bl	_de32
Lloh37:
	adrp	x8, _magic@GOTPAGE
Lloh38:
	ldr	x8, [x8, _magic@GOTPAGEOFF]
Lloh39:
	str	w0, [x8]
	mov	w0, #1
	bl	_SDLNet_AllocSocketSet
Lloh40:
	adrp	x21, _set@GOTPAGE
Lloh41:
	ldr	x21, [x21, _set@GOTPAGEOFF]
	str	w0, [x21]
Lloh42:
	adrp	x8, _TCPSocket@GOTPAGE
Lloh43:
	ldr	x8, [x8, _TCPSocket@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	bl	_SDLNet_TCP_AddSocket
	ldr	w0, [x21]
	ldr	w1, [x19]
	bl	_SDLNet_UDP_AddSocket
	ldr	x0, [x20]
LBB0_3:
	str	x0, [sp, #16]
	ldr	w0, [x19]
	add	x2, sp, #16
	mov	w1, #0
	bl	_SDLNet_UDP_Bind
	ldur	x8, [x29, #-40]
Lloh45:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh46:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_netplay,4,2                    ; @netplay
	.comm	_LocalPortUDP,4,2               ; @LocalPortUDP
	.comm	_LocalPortTCP,4,2               ; @LocalPortTCP
	.comm	_UDPSocket,4,2                  ; @UDPSocket
	.comm	_Socket,8,3                     ; @Socket
	.comm	_magic,4,2                      ; @magic
	.comm	_uport,4,2                      ; @uport
	.comm	_RemotePortUDP,8,3              ; @RemotePortUDP
	.comm	_ServerHost,8,3                 ; @ServerHost
	.comm	_RemotePortTCP,4,2              ; @RemotePortTCP
	.comm	_set,4,2                        ; @set
	.comm	_TCPSocket,4,2                  ; @TCPSocket
.subsections_via_symbols
