	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_setup
_tcp_setup:                             ## @tcp_setup
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	_PF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movq	_listen_sock@GOTPCREL(%rip), %r15
	movq	%rax, (%r15)
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_2:
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_bzero
	movl	$16, -40(%rbp)
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	_INADDR_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movl	%eax, -32(%rbp)
	movl	%r14d, %edi
	callq	_htons
	movl	%eax, -36(%rbp)
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_bind
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_4:
	movq	(%r15), %rdi
	movl	$-1, %esi
	callq	_listen
	testq	%rax, %rax
	jns	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_listen_sock,8,3                ## @listen_sock
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp_setup: listen"

	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_INADDR_LOOPBACK,4,2            ## @INADDR_LOOPBACK
L_.str.1:                               ## @.str.1
	.asciz	"tcp_setup: bind"

	.no_dead_strip	_tcp_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_setup
_tcp_setup:                             ; @tcp_setup
	.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	x19, x0
Lloh0:
	adrp	x8, _PF_INET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
Lloh6:
	adrp	x20, _listen_sock@GOTPAGE
Lloh7:
	ldr	x20, [x20, _listen_sock@GOTPAGEOFF]
	str	x0, [x20]
	tbz	x0, #63, LBB0_2
; %bb.1:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_2:
	mov	w21, #16
	mov	x0, sp
	mov	w1, #16
	bl	_bzero
Lloh10:
	adrp	x8, _AF_INET@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w21, [sp]
	str	w8, [sp, #12]
Lloh13:
	adrp	x8, _INADDR_LOOPBACK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _INADDR_LOOPBACK@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_htonl
	str	w0, [sp, #8]
	mov	x0, x19
	bl	_htons
	str	w0, [sp, #4]
	ldr	x0, [x20]
	mov	x1, sp
	mov	w2, #16
	bl	_bind
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_4:
	ldr	x0, [x20]
	mov	w1, #-1
	bl	_listen
	tbz	x0, #63, LBB0_6
; %bb.5:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_6:
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_listen_sock,8,3                ; @listen_sock
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp_setup: listen"

	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_INADDR_LOOPBACK,4,2            ; @INADDR_LOOPBACK
l_.str.1:                               ; @.str.1
	.asciz	"tcp_setup: bind"

	.no_dead_strip	_tcp_setup
.subsections_via_symbols
