#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 scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ WEXITSTATUS(int);
scalar_t__ doseeks(int);
int /*<<< orphan*/ e_f(char *, int, int);
int /*<<< orphan*/ exit(scalar_t__);
scalar_t__ fork();
int /*<<< orphan*/ quit();
int /*<<< orphan*/ start(int);
int waitpid(scalar_t__, int *, int /*<<< orphan*/);
int main() {
  start(70);
  pid_t f;
  int result;
  if ((f = fork()) < 0) {
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test70.c",
        71, (1));
    quit();
  }
  if (f == 0) {
    exit(doseeks(0));
  }
  if (doseeks(1000)) {
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test70.c",
        75, (10));
  }
  if (waitpid(f, &result, 0) == -1)
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test70.c",
        77, (11));
  if (WEXITSTATUS(result) != 0)
    e_f("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/"
        "master/minix-master/minix/tests/test70.c",
        78, (12));
  quit();
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x46,%edi
call   1040 <start@plt>
mov    $0x0,%al
call   10a0 <fork@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jge    11cb <main+0x4b>
lea    0xe4b(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
call   1070 <e_f@plt>
mov    $0x0,%al
call   1030 <quit@plt>
cmpq   $0x0,-0x10(%rbp)
jne    11e5 <main+0x65>
xor    %edi,%edi
call   1090 <doseeks@plt>
mov    %rax,%rdi
call   1080 <exit@plt>
mov    $0x3e8,%edi
call   1090 <doseeks@plt>
cmp    $0x0,%rax
je     120f <main+0x8f>
lea    0xe00(%rip),%rdi
mov    $0x4b,%esi
mov    $0xa,%edx
call   1070 <e_f@plt>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
xor    %edx,%edx
call   1060 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    123d <main+0xbd>
lea    0xdd2(%rip),%rdi
mov    $0x4d,%esi
mov    $0xb,%edx
call   1070 <e_f@plt>
mov    -0x14(%rbp),%edi
call   1050 <WEXITSTATUS@plt>
cmp    $0x0,%rax
je     1265 <main+0xe5>
lea    0xdaa(%rip),%rdi
mov    $0x4e,%esi
mov    $0xc,%edx
call   1070 <e_f@plt>
mov    $0x0,%al
call   1030 <quit@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x46,%edi
call   1040 <start@plt>
xor    %eax,%eax
call   10a0 <fork@plt>
mov    %rax,%rbx
test   %rax,%rax
js     11af <main+0x2f>
jne    11cc <main+0x4c>
xor    %edi,%edi
call   1090 <doseeks@plt>
mov    %rax,%rdi
call   1080 <exit@plt>
lea    0xe4a(%rip),%rdi
mov    $0x47,%esi
mov    $0x1,%edx
call   1070 <e_f@plt>
xor    %eax,%eax
call   1030 <quit@plt>
mov    $0x3e8,%edi
call   1090 <doseeks@plt>
test   %rax,%rax
je     11f1 <main+0x71>
lea    0xe1e(%rip),%rdi
mov    $0x4b,%esi
mov    $0xa,%edx
call   1070 <e_f@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1060 <waitpid@plt>
cmp    $0xffffffff,%eax
jne    121b <main+0x9b>
lea    0xdf4(%rip),%rdi
mov    $0x4d,%esi
mov    $0xb,%edx
call   1070 <e_f@plt>
mov    0xc(%rsp),%edi
call   1050 <WEXITSTATUS@plt>
test   %rax,%rax
je     123f <main+0xbf>
lea    0xdd0(%rip),%rdi
mov    $0x4e,%esi
mov    $0xc,%edx
call   1070 <e_f@plt>
xor    %eax,%eax
call   1030 <quit@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/master/minix-master/minix/tests/test70.c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @start(i32 70)
%5 = call i64 (...) @fork()
store i64 %5, i64* %2
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 71, i32 1)
%9 = call i32 (...) @quit()
br label %10
10: ; preds = %7, %0
%11 = load i64, i64* %2
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = call i64 @doseeks(i32 0)
%15 = call i32 @exit(i64 %14)
unreachable
16: ; preds = %10
%17 = call i64 @doseeks(i32 1000)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 75, i32 10)
br label %21
21: ; preds = %19, %16
%22 = load i64, i64* %2
%23 = call i32 @waitpid(i64 %22, i32* %3, i32 0)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 77, i32 11)
br label %27
27: ; preds = %25, %21
%28 = load i32, i32* %3
%29 = call i64 @WEXITSTATUS(i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 78, i32 12)
br label %33
33: ; preds = %31, %27
%34 = call i32 (...) @quit()
ret i32 -1
}

LLVM IR (-O2):
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ayyucedemirbas/Minix-Source-Code/refs/heads/master/minix-master/minix/tests/test70.c\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @start(i32 70)
%3 = bitcast i32* %1 to i8*
%4 = tail call i64 (...) @fork()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 71, i32 1)
%8 = tail call i32 (...) @quit()
br label %14
9: ; preds = %0
%10 = icmp eq i64 %4, 0
br i1 %10, label %11, label %14
11: ; preds = %9
%12 = tail call i64 @doseeks(i32 0)
%13 = tail call i32 @exit(i64 %12)
unreachable
14: ; preds = %6, %9
%15 = tail call i64 @doseeks(i32 1000)
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 75, i32 10)
br label %19
19: ; preds = %17, %14
%20 = call i32 @waitpid(i64 %4, i32* %1, i32 0)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 77, i32 11)
br label %24
24: ; preds = %22, %19
%25 = load i32, i32* %1
%26 = call i64 @WEXITSTATUS(i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = call i32 @e_f(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 78, i32 12)
br label %30
30: ; preds = %28, %24
%31 = call i32 (...) @quit()
ret i32 -1
}