#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  pid_t pid;
  pid = fork();
  int i;
  if (pid == -1) {
    printf("Error");
    exit(-1);
  } else if (pid == 0) {
    printf("èäåíòèôèêàòîð òåêóùåãî ïðîöåññà:%d; èäåíòèôèêàòîð "
           "ïðîöåññà-ðîäèòåëÿ äëÿ òåêóùåãî ïðîöåññà:%d\n",
           getpid(), getppid());
    for (i = 0; i < 10; i++) {
      printf("Ìîðå âîëíóåòñÿ:%d\n", i);
    }
  } else {
    printf("èäåíòèôèêàòîð òåêóùåãî ïðîöåññà:%d; èäåíòèôèêàòîð "
           "ïðîöåññà-ðîäèòåëÿ äëÿ òåêóùåãî ïðîöåññà:%d\n",
           getpid(), pid);
    for (i = 100; i > 90; i--) {
      printf("Ìîðå âîëíóåòñÿ:%d\n", i);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    118b <main+0x3b>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11ee <main+0x9e>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11e9 <main+0x99>
mov    -0xc(%rbp),%esi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c0 <main+0x70>
jmp    123d <main+0xed>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x8(%rbp),%edx
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x64,-0xc(%rbp)
cmpl   $0x5a,-0xc(%rbp)
jle    1238 <main+0xe8>
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    120f <main+0xbf>
jmp    123d <main+0xed>
jmp    1242 <main+0xf2>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
xor    %r14d,%r14d
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
je     118c <main+0x3c>
mov    %eax,%r15d
cmp    $0xffffffff,%eax
jne    11e5 <main+0x95>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%r13d
xor    %eax,%eax
call   1050 <getppid@plt>
mov    %eax,%r15d
movl   $0x9,0x24(%rsp)
movl   $0x8,0x20(%rsp)
movl   $0x7,0x1c(%rsp)
movl   $0x6,0x18(%rsp)
movl   $0x5,0x14(%rsp)
movl   $0x4,0x10(%rsp)
movl   $0x3,0xc(%rsp)
mov    $0x2,%r12d
mov    $0x1,%ebp
jmp    1238 <main+0xe8>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%r13d
movl   $0x5b,0x24(%rsp)
movl   $0x5c,0x20(%rsp)
movl   $0x5d,0x1c(%rsp)
movl   $0x5e,0x18(%rsp)
movl   $0x5f,0x14(%rsp)
movl   $0x60,0x10(%rsp)
movl   $0x61,0xc(%rsp)
mov    $0x62,%r12d
mov    $0x63,%ebp
mov    $0x64,%r14d
lea    0xdc7(%rip),%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5e(%rip),%rbx
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0xc(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x10(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x14(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x18(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x1c(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x20(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    0x24(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Error\00"
@.str.1 = [171 x i8] c"\C3\A8\C3\A4\C3\A5\C3\AD\C3\B2\C3\A8\C3\B4\C3\A8\C3\AA\C3\A0\C3\B2\C3\AE\C3\B0 \C3\B2\C3\A5\C3\AA\C3\B3\C3\B9\C3\A5\C3\A3\C3\AE \C3\AF\C3\B0\C3\AE\C3\B6\C3\A5\C3\B1\C3\B1\C3\A0:%d; \C3\A8\C3\A4\C3\A5\C3\AD\C3\B2\C3\A8\C3\B4\C3\A8\C3\AA\C3\A0\C3\B2\C3\AE\C3\B0 \C3\AF\C3\B0\C3\AE\C3\B6\C3\A5\C3\B1\C3\B1\C3\A0-\C3\B0\C3\AE\C3\A4\C3\A8\C3\B2\C3\A5\C3\AB\C3\BF \C3\A4\C3\AB\C3\BF \C3\B2\C3\A5\C3\AA\C3\B3\C3\B9\C3\A5\C3\A3\C3\AE \C3\AF\C3\B0\C3\AE\C3\B6\C3\A5\C3\B1\C3\B1\C3\A0:%d\0A\00"
@.str.2 = [32 x i8] c"\C3\8C\C3\AE\C3\B0\C3\A5 \C3\A2\C3\AE\C3\AB\C3\AD\C3\B3\C3\A5\C3\B2\C3\B1\C3\BF:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @fork()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %0
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %27
13: ; preds = %10
%14 = call i32 (...) @getpid()
%15 = call i32 (...) @getppid()
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
store i32 0, i32* %3
br label %17
17: ; preds = %23, %13
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = load i32, i32* %3
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %17
26: ; preds = %17
br label %41
27: ; preds = %10
%28 = call i32 (...) @getpid()
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 %28, i32 %29)
store i32 100, i32* %3
br label %31
31: ; preds = %37, %27
%32 = load i32, i32* %3
%33 = icmp sgt i32 %32, 90
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = load i32, i32* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34
%38 = load i32, i32* %3
%39 = add nsw i32 %38, -1
store i32 %39, i32* %3
br label %31
40: ; preds = %31
br label %41
41: ; preds = %40, %26
br label %42
42: ; preds = %41
%43 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"Error\00"
@.str.1 = [171 x i8] c"\C3\A8\C3\A4\C3\A5\C3\AD\C3\B2\C3\A8\C3\B4\C3\A8\C3\AA\C3\A0\C3\B2\C3\AE\C3\B0 \C3\B2\C3\A5\C3\AA\C3\B3\C3\B9\C3\A5\C3\A3\C3\AE \C3\AF\C3\B0\C3\AE\C3\B6\C3\A5\C3\B1\C3\B1\C3\A0:%d; \C3\A8\C3\A4\C3\A5\C3\AD\C3\B2\C3\A8\C3\B4\C3\A8\C3\AA\C3\A0\C3\B2\C3\AE\C3\B0 \C3\AF\C3\B0\C3\AE\C3\B6\C3\A5\C3\B1\C3\B1\C3\A0-\C3\B0\C3\AE\C3\A4\C3\A8\C3\B2\C3\A5\C3\AB\C3\BF \C3\A4\C3\AB\C3\BF \C3\B2\C3\A5\C3\AA\C3\B3\C3\B9\C3\A5\C3\A3\C3\AE \C3\AF\C3\B0\C3\AE\C3\B6\C3\A5\C3\B1\C3\B1\C3\A0:%d\0A\00"
@.str.2 = [32 x i8] c"\C3\8C\C3\AE\C3\B0\C3\A5 \C3\A2\C3\AE\C3\AB\C3\AD\C3\B3\C3\A5\C3\B2\C3\B1\C3\BF:%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %8 [
i32 -1, label %2
i32 0, label %5
]
2: ; preds = %0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @getpid()
%7 = tail call i32 (...) @getppid()
br label %10
8: ; preds = %0
%9 = tail call i32 (...) @getpid()
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %7, %5 ], [ %1, %8 ]
%12 = phi i32 [ %6, %5 ], [ %9, %8 ]
%13 = phi i32 [ 0, %5 ], [ 100, %8 ]
%14 = phi i32 [ 1, %5 ], [ 99, %8 ]
%15 = phi i32 [ 2, %5 ], [ 98, %8 ]
%16 = phi i32 [ 3, %5 ], [ 97, %8 ]
%17 = phi i32 [ 4, %5 ], [ 96, %8 ]
%18 = phi i32 [ 5, %5 ], [ 95, %8 ]
%19 = phi i32 [ 6, %5 ], [ 94, %8 ]
%20 = phi i32 [ 7, %5 ], [ 93, %8 ]
%21 = phi i32 [ 8, %5 ], [ 92, %8 ]
%22 = phi i32 [ 9, %5 ], [ 91, %8 ]
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %11)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %19)
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%34 = tail call i32 @exit(i32 0)
unreachable
}