	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_netplay_discovery         ## -- Begin function init_netplay_discovery
	.p2align	4, 0x90
_init_netplay_discovery:                ## @init_netplay_discovery
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	$0, -16(%rbp)
	movq	_SOCKET_TYPE_DATAGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-16(%rbp), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_socket_init
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movl	%eax, %ebx
	movq	-16(%rbp), %rsi
	movl	%eax, %edi
	callq	_socket_bind
	testl	%eax, %eax
	je	LBB0_2
## %bb.7:
	movq	_lan_ad_client_fd@GOTPCREL(%rip), %rax
	movl	%ebx, (%rax)
	movq	-16(%rbp), %rdi
	callq	_freeaddrinfo_retro
	movl	$1, %eax
	jmp	LBB0_6
LBB0_2:
	movl	%ebx, %edi
	callq	_socket_close
LBB0_3:
	movq	-16(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_freeaddrinfo_retro
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_RARCH_ERR
	xorl	%eax, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCKET_TYPE_DATAGRAM,4,2       ## @SOCKET_TYPE_DATAGRAM
	.comm	_lan_ad_client_fd,4,2           ## @lan_ad_client_fd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[discovery] Failed to initialize netplay advertisement client socket.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_netplay_discovery         ; -- Begin function init_netplay_discovery
	.p2align	2
_init_netplay_discovery:                ; @init_netplay_discovery
	.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
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _SOCKET_TYPE_DATAGRAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOCKET_TYPE_DATAGRAM@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	add	x0, sp, #8
	mov	w1, #0
	mov	x2, #0
	bl	_socket_init
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	x1, [sp, #8]
	bl	_socket_bind
	cbz	w0, LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _lan_ad_client_fd@GOTPAGE
Lloh4:
	ldr	x8, [x8, _lan_ad_client_fd@GOTPAGEOFF]
Lloh5:
	str	w19, [x8]
	ldr	x0, [sp, #8]
	bl	_freeaddrinfo_retro
	mov	w0, #1
	b	LBB0_7
LBB0_3:
	mov	x0, x19
	bl	_socket_close
LBB0_4:
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_freeaddrinfo_retro
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_ERR
	mov	w0, #0
LBB0_7:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCKET_TYPE_DATAGRAM,4,2       ; @SOCKET_TYPE_DATAGRAM
	.comm	_lan_ad_client_fd,4,2           ; @lan_ad_client_fd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[discovery] Failed to initialize netplay advertisement client socket.\n"

.subsections_via_symbols
