	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function run_server
_run_server:                            ## @run_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	%r9d, -44(%rbp)                 ## 4-byte Spill
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r12
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	$1, -48(%rbp)
	movl	(%rdi), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rcx
	movl	%ebx, %edi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	jne	LBB0_3
## %bb.5:
	movl	%ebx, %edi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_bind
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:
	movq	_SOMAXCONN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_listen
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:
	movq	_stderr@GOTPCREL(%rip), %r15
	movq	%r14, %rax
	movl	(%r15), %r14d
	movl	(%rax), %edi
	callq	_ntohs
	leaq	L_.str.4(%rip), %rsi
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf
	leaq	L_.str.5(%rip), %r14
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movl	%ebx, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_accept
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	$0, (%rsp)
	movl	%eax, %edi
	movq	%r13, %rsi
	xorl	%edx, %edx
	movq	%r12, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_handle_connection
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
LBB0_4:
	callq	_perror
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"socket(2) failed"

	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
L_.str.1:                               ## @.str.1
	.asciz	"setsockopt(SO_REUSEADDR) failed"

L_.str.2:                               ## @.str.2
	.asciz	"bind(2) failed"

	.comm	_SOMAXCONN,4,2                  ## @SOMAXCONN
L_.str.3:                               ## @.str.3
	.asciz	"listen(2) failed"

	.comm	_stderr,4,2                     ## @stderr
L_.str.4:                               ## @.str.4
	.asciz	"server started on port %d\n"

L_.str.5:                               ## @.str.5
	.asciz	"waiting for connections\n"

	.no_dead_strip	_run_server
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function run_server
_run_server:                            ; @run_server
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x25, x1
	mov	x24, x0
	mov	w8, #1
	str	w8, [sp, #12]
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.1:
	mov	x23, x0
Lloh3:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #4
	bl	_setsockopt
	cbnz	x0, LBB0_8
; %bb.2:
	mov	x0, x23
	mov	x1, x24
	mov	x2, x25
	bl	_bind
	cbnz	x0, LBB0_9
; %bb.3:
Lloh9:
	adrp	x8, _SOMAXCONN@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SOMAXCONN@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_listen
	cbnz	x0, LBB0_10
; %bb.4:
Lloh12:
	adrp	x26, _stderr@GOTPAGE
Lloh13:
	ldr	x26, [x26, _stderr@GOTPAGEOFF]
	ldr	w25, [x26]
	ldr	w0, [x24]
	bl	_ntohs
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x25
	bl	_fprintf
Lloh16:
	adrp	x24, l_.str.5@PAGE
Lloh17:
	add	x24, x24, l_.str.5@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	mov	x1, x24
	bl	_fprintf
	mov	x0, x23
	mov	x1, #0
	mov	w2, #0
	bl	_accept
	cmn	w0, #1
	b.eq	LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x1, x22
	mov	x2, #0
	mov	x3, x21
	mov	x4, x20
	mov	x5, x19
	mov	w6, #0
	bl	_handle_connection
	b	LBB0_5
LBB0_7:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_8:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_9:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh24:
	adrp	x0, l_.str.3@PAGE
Lloh25:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_11:
	bl	_perror
	mov	w0, #1
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"socket(2) failed"

	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
l_.str.1:                               ; @.str.1
	.asciz	"setsockopt(SO_REUSEADDR) failed"

l_.str.2:                               ; @.str.2
	.asciz	"bind(2) failed"

	.comm	_SOMAXCONN,4,2                  ; @SOMAXCONN
l_.str.3:                               ; @.str.3
	.asciz	"listen(2) failed"

	.comm	_stderr,4,2                     ; @stderr
l_.str.4:                               ; @.str.4
	.asciz	"server started on port %d\n"

l_.str.5:                               ; @.str.5
	.asciz	"waiting for connections\n"

	.no_dead_strip	_run_server
.subsections_via_symbols
