	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -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:
	xorl	%eax, %eax
	callq	_getpid
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_fork
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_3
## %bb.6:
	jne	LBB0_4
	jmp	LBB0_7
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_4:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_tcp_client
	movq	_SIGTERM@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_kill
	movl	$5, %edi
	callq	_sleep
	xorl	%eax, %eax
	callq	_getpid
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_fork
	movq	%rax, %rbx
	testq	%rax, %rax
	js	LBB0_5
## %bb.8:
	jne	LBB0_9
LBB0_7:
	xorl	%eax, %eax
	callq	_getpid
	movq	%r14, %rdi
	callq	_tcp_server
	jmp	LBB0_10
LBB0_5:
	leaq	L_.str.1(%rip), %rsi
	movl	$-1, %edi
	callq	_err
LBB0_9:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_tcp_client
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_kill
LBB0_10:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	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"

L_.str.1:                               ## @.str.1
	.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:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
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:
	bl	_getpid
	mov	x20, x0
	bl	_fork
	mov	x19, x0
	tbnz	x0, #63, LBB0_4
; %bb.3:
	cbnz	x19, LBB0_5
	b	LBB0_7
LBB0_4:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_5:
	mov	x0, x19
	mov	w1, #0
	bl	_tcp_client
Lloh13:
	adrp	x21, _SIGTERM@GOTPAGE
Lloh14:
	ldr	x21, [x21, _SIGTERM@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_kill
	mov	w0, #5
	bl	_sleep
	bl	_getpid
	mov	x20, x0
	bl	_fork
	mov	x19, x0
	tbnz	x0, #63, LBB0_8
; %bb.6:
	cbnz	x19, LBB0_9
LBB0_7:
	bl	_getpid
	mov	x0, x20
	bl	_tcp_server
	b	LBB0_10
LBB0_8:
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #-1
	bl	_err
LBB0_9:
	mov	x0, x19
	mov	w1, #1
	bl	_tcp_client
	ldr	w1, [x21]
	mov	x0, x19
	bl	_kill
LBB0_10:
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.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"

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

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