	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SIGCHLD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SIG_IGN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_signal
	movq	_SIG_ERR@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_2:
	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, %r14d
	testl	%eax, %eax
	jns	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_4:
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_bzero
	movq	_AF_INET@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	%rax, -64(%rbp)
	movl	$24, -72(%rbp)
	movq	_INADDR_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movq	%rax, -56(%rbp)
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	$24, %edx
	callq	_bind
	testq	%rax, %rax
	jns	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_6:
	movl	%r14d, %edi
	movl	$-1, %esi
	callq	_listen
	testq	%rax, %rax
	jns	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_8:
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_bzero
	movq	(%r13), %rax
	movq	%rax, -64(%rbp)
	movl	$24, -72(%rbp)
	movl	$24, -44(%rbp)
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_getsockname
	testq	%rax, %rax
	jns	LBB0_10
## %bb.9:
	leaq	L_.str.4(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_10:
	movl	-68(%rbp), %r15d
	movl	%r15d, %edi
	callq	_ntohs
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
	xorl	%eax, %eax
	callq	_getpid
	movq	%rax, %r12
	xorl	%eax, %eax
	callq	_fork
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_11
## %bb.12:
	jne	LBB0_13
## %bb.27:
	xorl	%eax, %eax
	callq	_getpid
	movq	%rax, %rdi
	movl	%r14d, %esi
	callq	_tcp_server
	xorl	%edi, %edi
	callq	_exit
LBB0_11:
	leaq	L_.str.6(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_13:
	movq	%r12, %rdi
	movl	%r15d, %esi
	movl	$1, %edx
	callq	_tcp_client
	movq	_SIGTERM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_kill
	movl	%r14d, %edi
	callq	_close
	movl	$5, %edi
	callq	_sleep
	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, %r14d
	testl	%eax, %eax
	jns	LBB0_15
## %bb.14:
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_15:
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_bzero
	movq	(%r13), %rax
	movq	%rax, -64(%rbp)
	movl	$24, -72(%rbp)
	movq	_INADDR_LOOPBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_htonl
	movq	%rax, -56(%rbp)
	movl	%r14d, %edi
	movq	%rbx, %rsi
	movl	$24, %edx
	callq	_bind
	testq	%rax, %rax
	jns	LBB0_17
## %bb.16:
	leaq	L_.str.2(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_17:
	movl	%r14d, %edi
	movl	$-1, %esi
	callq	_listen
	testq	%rax, %rax
	jns	LBB0_19
## %bb.18:
	leaq	L_.str.3(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_19:
	leaq	-72(%rbp), %rbx
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_bzero
	movq	(%r13), %rax
	movq	%rax, -64(%rbp)
	movl	$24, -72(%rbp)
	movl	$24, -44(%rbp)
	leaq	-44(%rbp), %rdx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_getsockname
	testq	%rax, %rax
	jns	LBB0_21
## %bb.20:
	leaq	L_.str.4(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_21:
	movl	-68(%rbp), %r12d
	movl	%r12d, %edi
	callq	_ntohs
	leaq	L_.str.5(%rip), %rdi
	movl	%eax, %esi
	callq	_printf
	xorl	%eax, %eax
	callq	_getpid
	movq	%rax, %r15
	xorl	%eax, %eax
	callq	_fork
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_22
## %bb.24:
	jne	LBB0_23
## %bb.25:
	xorl	%eax, %eax
	callq	_getpid
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_tcp_server
	jmp	LBB0_26
LBB0_22:
	leaq	L_.str.6(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_23:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	movl	$800, %edx                      ## imm = 0x320
	callq	_tcp_client
LBB0_26:
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SIGCHLD,4,2                    ## @SIGCHLD
	.comm	_SIG_IGN,4,2                    ## @SIG_IGN
	.comm	_SIG_ERR,8,3                    ## @SIG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"signal"

	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
L_.str.1:                               ## @.str.1
	.asciz	"socket"

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

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

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

L_.str.5:                               ## @.str.5
	.asciz	"Using port %d\n"

L_.str.6:                               ## @.str.6
	.asciz	"fork"

	.comm	_SIGTERM,4,2                    ## @SIGTERM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, _SIGCHLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SIGCHLD@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SIG_IGN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SIG_IGN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_signal
Lloh6:
	adrp	x8, _SIG_ERR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SIG_ERR@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_2:
Lloh11:
	adrp	x24, _PF_INET@GOTPAGE
Lloh12:
	ldr	x24, [x24, _PF_INET@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh13:
	adrp	x25, _SOCK_STREAM@GOTPAGE
Lloh14:
	ldr	x25, [x25, _SOCK_STREAM@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	w2, #0
	bl	_socket
	mov	x19, x0
	tbz	w0, #31, LBB0_4
; %bb.3:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_4:
	mov	w20, #24
	add	x0, sp, #8
	mov	w1, #24
	bl	_bzero
Lloh17:
	adrp	x23, _AF_INET@GOTPAGE
Lloh18:
	ldr	x23, [x23, _AF_INET@GOTPAGEOFF]
	ldr	x8, [x23]
	str	x8, [sp, #16]
	str	w20, [sp, #8]
Lloh19:
	adrp	x26, _INADDR_LOOPBACK@GOTPAGE
Lloh20:
	ldr	x26, [x26, _INADDR_LOOPBACK@GOTPAGEOFF]
	ldr	w0, [x26]
	bl	_htonl
	str	x0, [sp, #24]
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #24
	bl	_bind
	tbz	x0, #63, LBB0_6
; %bb.5:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_6:
	mov	x0, x19
	mov	w1, #-1
	bl	_listen
	tbz	x0, #63, LBB0_8
; %bb.7:
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_8:
	mov	w20, #24
	add	x0, sp, #8
	mov	w1, #24
	bl	_bzero
	ldr	x8, [x23]
	str	x8, [sp, #16]
	stp	w20, w20, [sp, #4]
	add	x1, sp, #8
	add	x2, sp, #4
	mov	x0, x19
	bl	_getsockname
	tbz	x0, #63, LBB0_10
; %bb.9:
Lloh25:
	adrp	x1, l_.str.4@PAGE
Lloh26:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_10:
	ldr	w20, [sp, #12]
	mov	x0, x20
	bl	_ntohs
	mov	x1, x0
Lloh27:
	adrp	x0, l_.str.5@PAGE
Lloh28:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
	bl	_getpid
	mov	x22, x0
	bl	_fork
	mov	x21, x0
	tbnz	x0, #63, LBB0_13
; %bb.11:
	cbnz	x21, LBB0_14
; %bb.12:
	bl	_getpid
	mov	x1, x19
	bl	_tcp_server
	mov	w0, #0
	bl	_exit
LBB0_13:
Lloh29:
	adrp	x1, l_.str.6@PAGE
Lloh30:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_14:
	mov	x0, x22
	mov	x1, x20
	mov	w2, #1
	bl	_tcp_client
Lloh31:
	adrp	x8, _SIGTERM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SIGTERM@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_kill
	mov	x0, x19
	bl	_close
	mov	w0, #5
	bl	_sleep
	ldr	w0, [x24]
	ldr	w1, [x25]
	mov	w2, #0
	bl	_socket
	mov	x19, x0
	tbz	w0, #31, LBB0_16
; %bb.15:
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_16:
	mov	w20, #24
	add	x0, sp, #8
	mov	w1, #24
	bl	_bzero
	ldr	x8, [x23]
	str	x8, [sp, #16]
	str	w20, [sp, #8]
	ldr	w0, [x26]
	bl	_htonl
	str	x0, [sp, #24]
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #24
	bl	_bind
	tbz	x0, #63, LBB0_18
; %bb.17:
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_18:
	mov	x0, x19
	mov	w1, #-1
	bl	_listen
	tbz	x0, #63, LBB0_20
; %bb.19:
Lloh38:
	adrp	x1, l_.str.3@PAGE
Lloh39:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_20:
	mov	w20, #24
	add	x0, sp, #8
	mov	w1, #24
	bl	_bzero
	ldr	x8, [x23]
	str	x8, [sp, #16]
	stp	w20, w20, [sp, #4]
	add	x1, sp, #8
	add	x2, sp, #4
	mov	x0, x19
	bl	_getsockname
	tbz	x0, #63, LBB0_22
; %bb.21:
Lloh40:
	adrp	x1, l_.str.4@PAGE
Lloh41:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_22:
	ldr	w20, [sp, #12]
	mov	x0, x20
	bl	_ntohs
	mov	x1, x0
Lloh42:
	adrp	x0, l_.str.5@PAGE
Lloh43:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
	bl	_getpid
	mov	x22, x0
	bl	_fork
	mov	x21, x0
	tbnz	x0, #63, LBB0_25
; %bb.23:
	cbnz	x21, LBB0_26
; %bb.24:
	bl	_getpid
	mov	x0, x22
	mov	x1, x19
	bl	_tcp_server
	b	LBB0_27
LBB0_25:
Lloh44:
	adrp	x1, l_.str.6@PAGE
Lloh45:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_26:
	mov	x0, x21
	mov	x1, x20
	mov	w2, #800
	bl	_tcp_client
LBB0_27:
	mov	w0, #0
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_SIGCHLD,4,2                    ; @SIGCHLD
	.comm	_SIG_IGN,4,2                    ; @SIG_IGN
	.comm	_SIG_ERR,8,3                    ; @SIG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"signal"

	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
l_.str.1:                               ; @.str.1
	.asciz	"socket"

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

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

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

l_.str.5:                               ; @.str.5
	.asciz	"Using port %d\n"

l_.str.6:                               ; @.str.6
	.asciz	"fork"

	.comm	_SIGTERM,4,2                    ; @SIGTERM
.subsections_via_symbols
