	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function open_and_bind_socket
_open_and_bind_socket:                  ## @open_and_bind_socket
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_PF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IPPROTO_UDP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_socket
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	_doreuseport@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.3:
	movl	$1, -20(%rbp)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_REUSEPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-20(%rbp), %rcx
	movl	%ebx, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	js	LBB0_4
LBB0_5:
	testq	%r14, %r14
	je	LBB0_10
## %bb.6:
	movl	(%r14), %edx
	movl	%ebx, %edi
	movq	%r14, %rsi
	callq	_bind
	cmpl	$-1, %eax
	jne	LBB0_10
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_warn
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
LBB0_8:
	callq	_warn
	movl	%ebx, %edi
	callq	_close
LBB0_9:
	movl	$-1, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_DGRAM,4,2                 ## @SOCK_DGRAM
	.comm	_IPPROTO_UDP,4,2                ## @IPPROTO_UDP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"socket"

	.comm	_doreuseport,8,3                ## @doreuseport
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEPORT,4,2               ## @SO_REUSEPORT
L_.str.1:                               ## @.str.1
	.asciz	"setsockopt SO_REUSEPORT"

L_.str.2:                               ## @.str.2
	.asciz	"bind"

	.no_dead_strip	_open_and_bind_socket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function open_and_bind_socket
_open_and_bind_socket:                  ; @open_and_bind_socket
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _PF_INET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SOCK_DGRAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOCK_DGRAM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _IPPROTO_UDP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _IPPROTO_UDP@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	bl	_socket
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.1:
Lloh9:
	adrp	x8, _doreuseport@GOTPAGE
Lloh10:
	ldr	x8, [x8, _doreuseport@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
	mov	w8, #1
	str	w8, [sp, #12]
Lloh12:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _SO_REUSEPORT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SO_REUSEPORT@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w4, #4
	bl	_setsockopt
	tbnz	x0, #63, LBB0_7
LBB0_3:
	cbz	x20, LBB0_9
; %bb.4:
	ldr	w2, [x20]
	mov	x0, x19
	mov	x1, x20
	bl	_bind
	cmn	w0, #1
	b.ne	LBB0_9
; %bb.5:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_6:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
	b	LBB0_9
LBB0_7:
Lloh22:
	adrp	x0, l_.str.1@PAGE
Lloh23:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_8:
	bl	_warn
	mov	x0, x19
	bl	_close
	mov	w19, #-1
LBB0_9:
	mov	x0, x19
	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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_DGRAM,4,2                 ; @SOCK_DGRAM
	.comm	_IPPROTO_UDP,4,2                ; @IPPROTO_UDP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"socket"

	.comm	_doreuseport,8,3                ; @doreuseport
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEPORT,4,2               ; @SO_REUSEPORT
l_.str.1:                               ; @.str.1
	.asciz	"setsockopt SO_REUSEPORT"

l_.str.2:                               ; @.str.2
	.asciz	"bind"

	.no_dead_strip	_open_and_bind_socket
.subsections_via_symbols
