	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_sockets
_setup_sockets:                         ## @setup_sockets
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	leaq	-96(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	_PF_UNSPEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -84(%rbp)
	movq	_AI_PASSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	leaq	L_.str(%rip), %rsi
	leaq	-48(%rbp), %rcx
	xorl	%edi, %edi
	movq	%rbx, %rdx
	callq	_getaddrinfo
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %edi
	callq	_gai_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_errx
LBB0_2:
	movq	-48(%rbp), %r14
	testq	%r14, %r14
	je	LBB0_3
## %bb.4:
	movq	_HEIM_SIPC_TYPE_HTTP@GOTPCREL(%rip), %r12
	movq	_test_service@GOTPCREL(%rip), %r15
	leaq	-52(%rbp), %r13
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.2(%rip), %rdi
	callq	_warn
LBB0_11:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	24(%r14), %r14
	testq	%r14, %r14
	je	LBB0_12
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%r14), %edi
	movl	8(%r14), %edx
	movl	12(%r14), %esi
	callq	_socket
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %ebx
	movl	%eax, %edi
	movl	$1, %esi
	callq	_socket_set_reuseaddr
	movl	%ebx, %edi
	movl	$1, %esi
	callq	_socket_set_ipv6only
	movl	(%r14), %edx
	movl	4(%r14), %esi
	movl	%ebx, %edi
	callq	_bind
	testq	%rax, %rax
	js	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%ebx, %edi
	movl	$5, %esi
	callq	_listen
	movl	(%r12), %esi
	movl	(%r15), %edx
	movl	%ebx, %edi
	xorl	%ecx, %ecx
	movq	%r13, %r8
	callq	_heim_sipc_stream_listener
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	$1, %edi
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edx
	callq	_errx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.3(%rip), %rdi
	callq	_warn
	movl	%ebx, %edi
	callq	_close
	jmp	LBB0_11
LBB0_12:
	movq	-48(%rbp), %rdi
	jmp	LBB0_13
LBB0_3:
	xorl	%edi, %edi
LBB0_13:
	callq	_freeaddrinfo
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_UNSPEC,4,2                  ## @PF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_AI_PASSIVE,4,2                 ## @AI_PASSIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"8080"

L_.str.1:                               ## @.str.1
	.asciz	"%s"

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

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

	.comm	_HEIM_SIPC_TYPE_HTTP,4,2        ## @HEIM_SIPC_TYPE_HTTP
	.comm	_test_service,4,2               ## @test_service
L_.str.4:                               ## @.str.4
	.asciz	"heim_sipc_stream_listener: %d"

	.no_dead_strip	_setup_sockets
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_sockets
_setup_sockets:                         ; @setup_sockets
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #40
	bl	_memset
Lloh0:
	adrp	x8, _PF_UNSPEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_UNSPEC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SOCK_STREAM@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SOCK_STREAM@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #36]
Lloh6:
	adrp	x8, _AI_PASSIVE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AI_PASSIVE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [sp, #56]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #24
	add	x3, sp, #16
	mov	x0, #0
	bl	_getaddrinfo
	cbz	w0, LBB0_2
; %bb.1:
	bl	_gai_strerror
	mov	x2, x0
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_2:
	ldr	x23, [sp, #16]
	cbz	x23, LBB0_12
; %bb.3:
Lloh13:
	adrp	x19, l_.str.2@PAGE
Lloh14:
	add	x19, x19, l_.str.2@PAGEOFF
Lloh15:
	adrp	x20, l_.str.3@PAGE
Lloh16:
	add	x20, x20, l_.str.3@PAGEOFF
Lloh17:
	adrp	x24, _HEIM_SIPC_TYPE_HTTP@GOTPAGE
Lloh18:
	ldr	x24, [x24, _HEIM_SIPC_TYPE_HTTP@GOTPAGEOFF]
Lloh19:
	adrp	x25, _test_service@GOTPAGE
Lloh20:
	ldr	x25, [x25, _test_service@GOTPAGEOFF]
Lloh21:
	adrp	x21, l_.str.4@PAGE
Lloh22:
	add	x21, x21, l_.str.4@PAGEOFF
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x19
	bl	_warn
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x23, [x23, #24]
	cbz	x23, LBB0_11
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w1, w0, [x23, #12]
	ldr	w2, [x23, #8]
	bl	_socket
	tbnz	w0, #31, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x22, x0
	mov	w1, #1
	bl	_socket_set_reuseaddr
	mov	x0, x22
	mov	w1, #1
	bl	_socket_set_ipv6only
	ldp	w2, w1, [x23]
	mov	x0, x22
	bl	_bind
	tbnz	x0, #63, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x22
	mov	w1, #5
	bl	_listen
	ldr	w1, [x24]
	ldr	w2, [x25]
	add	x4, sp, #12
	mov	x0, x22
	mov	x3, #0
	bl	_heim_sipc_stream_listener
	cbz	w0, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x2, x0
	mov	w0, #1
	mov	x1, x21
	bl	_errx
	b	LBB0_5
LBB0_10:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_warn
	mov	x0, x22
	bl	_close
	b	LBB0_5
LBB0_11:
	ldr	x0, [sp, #16]
	b	LBB0_13
LBB0_12:
	mov	x0, #0
LBB0_13:
	bl	_freeaddrinfo
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_UNSPEC,4,2                  ; @PF_UNSPEC
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_AI_PASSIVE,4,2                 ; @AI_PASSIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"8080"

l_.str.1:                               ; @.str.1
	.asciz	"%s"

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

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

	.comm	_HEIM_SIPC_TYPE_HTTP,4,2        ; @HEIM_SIPC_TYPE_HTTP
	.comm	_test_service,4,2               ; @test_service
l_.str.4:                               ; @.str.4
	.asciz	"heim_sipc_stream_listener: %d"

	.no_dead_strip	_setup_sockets
.subsections_via_symbols
