	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function server_listen
_server_listen:                         ## @server_listen
	.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	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	$0, -24(%rbp)
	movq	_use_rgai@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	_RAI_PASSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_rai_hints@GOTPCREL(%rip), %rdx
	orl	%eax, (%rdx)
	movq	_src_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_port@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rcx
	callq	_rdma_getaddrinfo
	jmp	LBB0_3
LBB0_2:
	movq	_AI_PASSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_ai_hints@GOTPCREL(%rip), %rdx
	orl	%eax, (%rdx)
	movq	_src_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_port@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rcx
	callq	_getaddrinfo
LBB0_3:
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%ebx, %edi
	callq	_gai_strerror
	leaq	L_.str(%rip), %rdi
	movq	%rax, %rsi
	callq	_printf
	jmp	LBB0_19
LBB0_5:
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	-32(%rbp), %rax
LBB0_7:
	movl	8(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_rsocket
	movq	_lrs@GOTPCREL(%rip), %r14
	movl	%eax, (%r14)
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movl	$1, -36(%rbp)
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-36(%rbp), %rcx
	movl	%eax, %edi
	movl	$4, %r8d
	callq	_rsetsockopt
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:
	movq	-24(%rbp), %rax
	movq	-32(%rbp), %rcx
	leaq	4(%rcx), %rdx
	leaq	4(%rax), %rsi
	testq	%rax, %rax
	movl	(%r14), %edi
	cmoveq	%rcx, %rax
	cmoveq	%rdx, %rsi
	movl	(%rsi), %esi
	movl	(%rax), %edx
	callq	_rbind
	testl	%eax, %eax
	jne	LBB0_12
## %bb.13:
	movl	(%r14), %edi
	movl	$1, %esi
	callq	_rlisten
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jne	LBB0_14
LBB0_16:
	movq	-24(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_18
## %bb.17:
	callq	_rdma_freeaddrinfo
	jmp	LBB0_19
LBB0_18:
	movq	-32(%rbp), %rdi
	callq	_freeaddrinfo
LBB0_19:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	leaq	L_.str.1(%rip), %rdi
	callq	_perror
	movl	(%r14), %ebx
	jmp	LBB0_16
LBB0_10:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_15
LBB0_12:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_15
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %ebx
LBB0_15:
	callq	_perror
	movl	(%r14), %edi
	callq	_rclose
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_use_rgai,8,3                   ## @use_rgai
	.comm	_RAI_PASSIVE,4,2                ## @RAI_PASSIVE
	.comm	_rai_hints,4,2                  ## @rai_hints
	.comm	_src_addr,4,2                   ## @src_addr
	.comm	_port,4,2                       ## @port
	.comm	_AI_PASSIVE,4,2                 ## @AI_PASSIVE
	.comm	_ai_hints,4,2                   ## @ai_hints
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getaddrinfo: %s\n"

	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_lrs,4,2                        ## @lrs
L_.str.1:                               ## @.str.1
	.asciz	"rsocket"

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
L_.str.2:                               ## @.str.2
	.asciz	"rsetsockopt SO_REUSEADDR"

L_.str.3:                               ## @.str.3
	.asciz	"rbind"

L_.str.4:                               ## @.str.4
	.asciz	"rlisten"

	.no_dead_strip	_server_listen
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function server_listen
_server_listen:                         ; @server_listen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	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
	str	xzr, [sp, #24]
Lloh0:
	adrp	x8, _use_rgai@GOTPAGE
Lloh1:
	ldr	x8, [x8, _use_rgai@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.1:
Lloh3:
	adrp	x8, _RAI_PASSIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RAI_PASSIVE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x2, _rai_hints@GOTPAGE
Lloh7:
	ldr	x2, [x2, _rai_hints@GOTPAGEOFF]
	ldr	w9, [x2]
	orr	w8, w9, w8
	str	w8, [x2]
Lloh8:
	adrp	x8, _src_addr@GOTPAGE
Lloh9:
	ldr	x8, [x8, _src_addr@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x8, _port@GOTPAGE
Lloh12:
	ldr	x8, [x8, _port@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	add	x3, sp, #24
	bl	_rdma_getaddrinfo
	mov	x19, x0
	cbz	w0, LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_gai_strerror
	mov	x1, x0
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	b	LBB0_11
LBB0_3:
Lloh16:
	adrp	x8, _AI_PASSIVE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _AI_PASSIVE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x2, _ai_hints@GOTPAGE
Lloh20:
	ldr	x2, [x2, _ai_hints@GOTPAGEOFF]
	ldr	w9, [x2]
	orr	w8, w9, w8
	str	w8, [x2]
Lloh21:
	adrp	x8, _src_addr@GOTPAGE
Lloh22:
	ldr	x8, [x8, _src_addr@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x8, _port@GOTPAGE
Lloh25:
	ldr	x8, [x8, _port@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x3, sp, #16
	bl	_getaddrinfo
	mov	x19, x0
	cbnz	w0, LBB0_2
LBB0_4:
	ldp	x9, x8, [sp, #16]
	add	x9, x9, #8
	add	x10, x8, #8
	cmp	x8, #0
	csel	x8, x9, x10, eq
	ldr	w0, [x8]
Lloh27:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_rsocket
Lloh30:
	adrp	x20, _lrs@GOTPAGE
Lloh31:
	ldr	x20, [x20, _lrs@GOTPAGEOFF]
	str	w0, [x20]
	tbnz	w0, #31, LBB0_12
; %bb.5:
	mov	w8, #1
	str	w8, [sp, #12]
Lloh32:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh33:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
Lloh35:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh36:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #4
	bl	_rsetsockopt
	cbnz	w0, LBB0_13
; %bb.6:
	ldp	x9, x8, [sp, #16]
	ldr	w0, [x20]
	add	x10, x9, #4
	add	x11, x8, #4
	cmp	x8, #0
	csel	x8, x9, x8, eq
	csel	x9, x10, x11, eq
	ldr	w1, [x9]
	ldr	w2, [x8]
	bl	_rbind
	cbnz	w0, LBB0_14
; %bb.7:
	ldr	w0, [x20]
	mov	w1, #1
	bl	_rlisten
	mov	x19, x0
	cbnz	w0, LBB0_15
LBB0_8:
	ldr	x0, [sp, #24]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_rdma_freeaddrinfo
	b	LBB0_11
LBB0_10:
	ldr	x0, [sp, #16]
	bl	_freeaddrinfo
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_12:
Lloh38:
	adrp	x0, l_.str.1@PAGE
Lloh39:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perror
	ldr	w19, [x20]
	b	LBB0_8
LBB0_13:
	mov	x19, x0
Lloh40:
	adrp	x0, l_.str.2@PAGE
Lloh41:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_16
LBB0_14:
	mov	x19, x0
Lloh42:
	adrp	x0, l_.str.3@PAGE
Lloh43:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_15:
Lloh44:
	adrp	x0, l_.str.4@PAGE
Lloh45:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_16:
	bl	_perror
	ldr	w0, [x20]
	bl	_rclose
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_use_rgai,8,3                   ; @use_rgai
	.comm	_RAI_PASSIVE,4,2                ; @RAI_PASSIVE
	.comm	_rai_hints,4,2                  ; @rai_hints
	.comm	_src_addr,4,2                   ; @src_addr
	.comm	_port,4,2                       ; @port
	.comm	_AI_PASSIVE,4,2                 ; @AI_PASSIVE
	.comm	_ai_hints,4,2                   ; @ai_hints
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getaddrinfo: %s\n"

	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_lrs,4,2                        ; @lrs
l_.str.1:                               ; @.str.1
	.asciz	"rsocket"

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
l_.str.2:                               ; @.str.2
	.asciz	"rsetsockopt SO_REUSEADDR"

l_.str.3:                               ; @.str.3
	.asciz	"rbind"

l_.str.4:                               ; @.str.4
	.asciz	"rlisten"

	.no_dead_strip	_server_listen
.subsections_via_symbols
