	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tcp_server
_tcp_server:                            ## @tcp_server
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -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
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movq	_errno@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	_SIGKILL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	%ebx, (%r12)
	leaq	L_.str(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_2:
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$16, %esi
	callq	_bzero
	movq	_AF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	$16, -56(%rbp)
	movq	_INADDR_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movl	%eax, -48(%rbp)
	movq	_TCP_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htons
	movl	%eax, -52(%rbp)
	movl	%r15d, %edi
	movq	%rbx, %rsi
	movl	$16, %edx
	callq	_bind
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	movq	_errno@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	_SIGKILL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	%ebx, (%r12)
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_4:
	movl	%r15d, %edi
	movl	$-1, %esi
	callq	_listen
	testq	%rax, %rax
	jns	LBB0_6
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movq	_SIGKILL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	%ebx, (%r12)
	leaq	L_.str.2(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_6:
	movl	$10, %edi
	callq	_sleep
	movl	%r15d, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_accept
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_8
## %bb.7:
	movq	_errno@GOTPCREL(%rip), %r12
	movl	(%r12), %r13d
	movq	_SIGKILL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edi
	callq	_kill
	movl	%r13d, (%r12)
	leaq	L_.str.3(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_8:
	movl	%ebx, %edi
	callq	_close
	movl	%r15d, %edi
	callq	_close
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	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	_errno,4,2                      ## @errno
	.comm	_SIGKILL,4,2                    ## @SIGKILL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tcp_server: socket"

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

L_.str.2:                               ## @.str.2
	.asciz	"tcp_server: listen"

L_.str.3:                               ## @.str.3
	.asciz	"tcp_server: accept"

	.no_dead_strip	_tcp_server
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tcp_server
_tcp_server:                            ; @tcp_server
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, 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
	mov	x19, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
Lloh6:
	adrp	x21, _errno@GOTPAGE
Lloh7:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	w22, [x21]
Lloh8:
	adrp	x8, _SIGKILL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SIGKILL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kill
	str	w22, [x21]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_2:
	mov	w21, #16
	mov	x0, sp
	mov	w1, #16
	bl	_bzero
Lloh13:
	adrp	x8, _AF_INET@GOTPAGE
Lloh14:
	ldr	x8, [x8, _AF_INET@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [sp, #12]
	str	w21, [sp]
Lloh16:
	adrp	x8, _INADDR_LOOPBACK@GOTPAGE
Lloh17:
	ldr	x8, [x8, _INADDR_LOOPBACK@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_htonl
	str	w0, [sp, #8]
Lloh19:
	adrp	x8, _TCP_PORT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TCP_PORT@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	bl	_htons
	str	w0, [sp, #4]
	mov	x1, sp
	mov	x0, x19
	mov	w2, #16
	bl	_bind
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh22:
	adrp	x21, _errno@GOTPAGE
Lloh23:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	w22, [x21]
Lloh24:
	adrp	x8, _SIGKILL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SIGKILL@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kill
	str	w22, [x21]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_4:
	mov	x0, x19
	mov	w1, #-1
	bl	_listen
	tbz	x0, #63, LBB0_6
; %bb.5:
Lloh29:
	adrp	x21, _errno@GOTPAGE
Lloh30:
	ldr	x21, [x21, _errno@GOTPAGEOFF]
	ldr	w22, [x21]
Lloh31:
	adrp	x8, _SIGKILL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SIGKILL@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kill
	str	w22, [x21]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_6:
	mov	w0, #10
	bl	_sleep
	mov	x0, x19
	mov	x1, #0
	mov	x2, #0
	bl	_accept
	mov	x21, x0
	tbz	w0, #31, LBB0_8
; %bb.7:
Lloh36:
	adrp	x22, _errno@GOTPAGE
Lloh37:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	ldr	w23, [x22]
Lloh38:
	adrp	x8, _SIGKILL@GOTPAGE
Lloh39:
	ldr	x8, [x8, _SIGKILL@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_kill
	str	w23, [x22]
Lloh41:
	adrp	x1, l_.str.3@PAGE
Lloh42:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_8:
	mov	x0, x21
	bl	_close
	mov	x0, x19
	bl	_close
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_errno,4,2                      ; @errno
	.comm	_SIGKILL,4,2                    ; @SIGKILL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tcp_server: socket"

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

l_.str.2:                               ; @.str.2
	.asciz	"tcp_server: listen"

l_.str.3:                               ; @.str.3
	.asciz	"tcp_server: accept"

	.no_dead_strip	_tcp_server
.subsections_via_symbols
