	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bind_socket_ai
_bind_socket_ai:                        ## @bind_socket_ai
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	$1, -28(%rbp)
	testq	%rdi, %rdi
	jne	LBB0_1
## %bb.2:
	movq	_AF_INET@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	leaq	12(%r14), %rax
LBB0_3:
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rcx
	movq	_EVUTIL_SOCK_NONBLOCK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	orl	(%rcx), %esi
	movl	(%rax), %edi
	movq	_EVUTIL_SOCK_CLOEXEC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	xorl	%edx, %edx
	callq	_evutil_socket_
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.5:
	movl	%eax, %ebx
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_KEEPALIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-28(%rbp), %rcx
	movl	%ebx, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	js	LBB0_10
## %bb.6:
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.7:
	movl	%ebx, %edi
	callq	_evutil_make_listen_socket_reuseable
	testq	%rax, %rax
	js	LBB0_10
LBB0_8:
	testq	%r14, %r14
	je	LBB0_11
## %bb.9:
	movl	(%r14), %edx
	movl	8(%r14), %esi
	movl	%ebx, %edi
	callq	_bind
	cmpl	$-1, %eax
	jne	LBB0_11
LBB0_10:
	xorl	%eax, %eax
	callq	_EVUTIL_SOCKET_ERROR
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_evutil_closesocket
	movl	%r14d, %edi
	callq	_EVUTIL_SET_SOCKET_ERROR
	movl	$-1, %ebx
	jmp	LBB0_11
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movl	$-1, %ebx
	movl	$-1, %edi
	callq	_event_sock_warn
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_EVUTIL_SOCK_NONBLOCK,4,2       ## @EVUTIL_SOCK_NONBLOCK
	.comm	_EVUTIL_SOCK_CLOEXEC,4,2        ## @EVUTIL_SOCK_CLOEXEC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"socket"

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_KEEPALIVE,4,2               ## @SO_KEEPALIVE
	.no_dead_strip	_bind_socket_ai
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bind_socket_ai
_bind_socket_ai:                        ; @bind_socket_ai
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x20, x0
	mov	w8, #1
	str	w8, [sp, #12]
	add	x8, x0, #12
Lloh0:
	adrp	x9, _AF_INET@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AF_INET@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
	ldr	w0, [x8]
Lloh2:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _EVUTIL_SOCK_NONBLOCK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _EVUTIL_SOCK_NONBLOCK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _EVUTIL_SOCK_CLOEXEC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _EVUTIL_SOCK_CLOEXEC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	w2, #0
	bl	_evutil_socket_
	mov	x19, x0
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.1:
Lloh11:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _SO_KEEPALIVE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SO_KEEPALIVE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	x0, x19
	mov	w4, #4
	bl	_setsockopt
	tbnz	x0, #63, LBB0_6
; %bb.2:
	cbz	w21, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_evutil_make_listen_socket_reuseable
	tbnz	x0, #63, LBB0_6
LBB0_4:
	cbz	x20, LBB0_8
; %bb.5:
	ldr	w1, [x20, #8]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_bind
	cmn	w0, #1
	b.ne	LBB0_8
LBB0_6:
	bl	_EVUTIL_SOCKET_ERROR
	mov	x20, x0
	mov	x0, x19
	bl	_evutil_closesocket
	mov	x0, x20
	bl	_EVUTIL_SET_SOCKET_ERROR
	mov	w19, #-1
	b	LBB0_8
LBB0_7:
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_event_sock_warn
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_EVUTIL_SOCK_NONBLOCK,4,2       ; @EVUTIL_SOCK_NONBLOCK
	.comm	_EVUTIL_SOCK_CLOEXEC,4,2        ; @EVUTIL_SOCK_CLOEXEC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"socket"

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_KEEPALIVE,4,2               ; @SO_KEEPALIVE
	.no_dead_strip	_bind_socket_ai
.subsections_via_symbols
