#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 */

/* Variables and functions */
int /*<<< orphan*/ discrete_world_testbench_arg(int, int, int, int);
int /*<<< orphan*/ write(int, char *, int);
int discrete_world_testbench() {
  write(1,
        "|=====================================================|\n"
        "|===========	DISCRETE WORLD TESTBENCH	===========|\n"
        "|=====================================================|\n",
        sizeof("|=====================================================|\n"
               "|===========	DISCRETE WORLD TESTBENCH	===========|\n"
               "|=====================================================|\n"));
  write(1,
        "#######################################################\n"
        "###############	  BASIC TESTS		################\n"
        "#######################################################\n",
        sizeof("#######################################################\n"
               "###############	  BASIC TESTS		################\n"
               "#######################################################\n"));
  write(1, "|************* Testing 1D world (3) (Basic) *************|\n",
        sizeof("|************* Testing 1D world (3) (Basic) *************|\n"));
  if (!discrete_world_testbench_arg(1, 3, 2, 1))
    return 0;
  write(
      1, "|********** Testing 1D world (1 000 000) (Basic) *********|\n",
      sizeof("|********** Testing 1D world (1 000 000) (Basic) *********|\n"));
  if (!discrete_world_testbench_arg(1, 1000000, 2, 2))
    return 0;
  write(1,
        "#######################################################\n"
        "###############	  COMMON TEST		################\n"
        "#######################################################\n",
        sizeof("#######################################################\n"
               "###############	  COMMON TEST		################\n"
               "#######################################################\n"));
  write(1, "|*************** Testing 2D world (Common) **************|\n",
        sizeof("|*************** Testing 2D world (Common) **************|\n"));
  if (!discrete_world_testbench_arg(2, 1000, 3, 5))
    return 0;
  write(1, "|*************** Testing 3D world (Common) **************|\n",
        sizeof("|*************** Testing 3D world (Common) **************|\n"));
  if (!discrete_world_testbench_arg(3, 100, 2, 5))
    return 0;
  write(1, "|********** Testing 4D world (Possibly useful) **********|\n",
        sizeof("|********** Testing 4D world (Possibly useful) **********|\n"));
  if (!discrete_world_testbench_arg(4, 50, 2, 5))
    return 0;
  write(1,
        "#######################################################\n"
        "###############	  HEAVY TEST		################\n"
        "#######################################################\n",
        sizeof("#######################################################\n"
               "###############	  HEAVY TEST		################\n"
               "#######################################################\n"));
  write(1, "|********** Testing 10D world (Testing purpose) *********|\n",
        sizeof("|********** Testing 10D world (Testing purpose) *********|\n"));
  if (!discrete_world_testbench_arg(10, 5, 2, 1))
    return 0;
  write(1, "|*** Testing 3D world with 10 pasts (Testing purpose) ***|\n",
        sizeof("|*** Testing 3D world with 10 pasts (Testing purpose) ***|\n"));
  if (!discrete_world_testbench_arg(3, 100, 10, 1))
    return 0;
  write(1, "|*** Testing 2D world with 10 param (Testing purpose) ***|\n",
        sizeof("|*** Testing 2D world with 10 param (Testing purpose) ***|\n"));
  if (!discrete_world_testbench_arg(2, 100, 2, 10))
    return 0;
  write(1, "Done\n", sizeof("Done\n"));
  return 1;
}


x86 assembly (clang, -O0):
<discrete_world_testbench>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0xa4,%edx
call   1040 <write@plt>
mov    $0x1,%edi
lea    0xf5a(%rip),%rsi
mov    $0xa1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
lea    0xfe5(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x1,%ecx
mov    $0x3,%esi
mov    $0x2,%edx
mov    %ecx,%edi
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    1195 <discrete_world_testbench+0x75>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0xfe0(%rip),%rsi
mov    $0x3d,%edx
call   1040 <write@plt>
mov    $0x1,%edi
mov    $0xf4240,%esi
mov    $0x2,%ecx
mov    %ecx,%edx
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    11d6 <discrete_world_testbench+0xb6>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0xfdc(%rip),%rsi
mov    $0xa1,%edx
call   1040 <write@plt>
mov    $0x1,%edi
lea    0x1067(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    1230 <discrete_world_testbench+0x110>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0x105f(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x3,%edi
mov    $0x64,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    1274 <discrete_world_testbench+0x154>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0x1057(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x4,%edi
mov    $0x32,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    12b8 <discrete_world_testbench+0x198>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0x104f(%rip),%rsi
mov    $0xa0,%edx
call   1040 <write@plt>
mov    $0x1,%edi
lea    0x10d9(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0xa,%edi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    1312 <discrete_world_testbench+0x1f2>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0x10d1(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x3,%edi
mov    $0x64,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    1356 <discrete_world_testbench+0x236>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0x10c9(%rip),%rsi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x2,%edx
mov    $0x64,%esi
mov    $0xa,%ecx
mov    %edx,%edi
call   1030 <discrete_world_testbench_arg@plt>
cmp    $0x0,%eax
jne    1397 <discrete_world_testbench+0x277>
movl   $0x0,-0x4(%rbp)
jmp    13b4 <discrete_world_testbench+0x294>
mov    $0x1,%edi
lea    0x10c4(%rip),%rsi
mov    $0x6,%edx
call   1040 <write@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrete_world_testbench>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xa4,%edx
call   1040 <write@plt>
lea    0xf66(%rip),%rsi
mov    $0x1,%edi
mov    $0xa1,%edx
call   1040 <write@plt>
lea    0xff1(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x1,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <discrete_world_testbench_arg@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0xff4(%rip),%rsi
mov    $0x1,%edi
mov    $0x3d,%edx
call   1040 <write@plt>
mov    $0x1,%edi
mov    $0xf4240,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0xffa(%rip),%rsi
mov    $0x1,%edi
mov    $0xa1,%edx
call   1040 <write@plt>
lea    0x1085(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x2,%edi
mov    $0x3e8,%esi
mov    $0x3,%edx
mov    $0x5,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0x108a(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x3,%edi
mov    $0x64,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0x108f(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x4,%edi
mov    $0x32,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0x1094(%rip),%rsi
mov    $0x1,%edi
mov    $0xa0,%edx
call   1040 <write@plt>
lea    0x111e(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0xa,%edi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0x1123(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x3,%edi
mov    $0x64,%esi
mov    $0xa,%edx
mov    $0x1,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0x112c(%rip),%rsi
mov    $0x1,%edi
mov    $0x3c,%edx
call   1040 <write@plt>
mov    $0x2,%edi
mov    $0x64,%esi
mov    $0x2,%edx
mov    $0xa,%ecx
call   1030 <discrete_world_testbench_arg@plt>
test   %eax,%eax
je     1346 <discrete_world_testbench+0x226>
lea    0x1135(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1040 <write@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"|=====================================================|\0A|===========\09DISCRETE WORLD TESTBENCH\09===========|\0A|=====================================================|\0A\00"
@.str.1 = [161 x i8] c"#######################################################\0A###############\09 BASIC TESTS\09\09################\0A#######################################################\0A\00"
@.str.2 = [60 x i8] c"|************* Testing 1D world (3) (Basic) *************|\0A\00"
@.str.3 = [61 x i8] c"|********** Testing 1D world (1 000 000) (Basic) *********|\0A\00"
@.str.4 = [161 x i8] c"#######################################################\0A###############\09 COMMON TEST\09\09################\0A#######################################################\0A\00"
@.str.5 = [60 x i8] c"|*************** Testing 2D world (Common) **************|\0A\00"
@.str.6 = [60 x i8] c"|*************** Testing 3D world (Common) **************|\0A\00"
@.str.7 = [60 x i8] c"|********** Testing 4D world (Possibly useful) **********|\0A\00"
@.str.8 = [160 x i8] c"#######################################################\0A###############\09 HEAVY TEST\09\09################\0A#######################################################\0A\00"
@.str.9 = [60 x i8] c"|********** Testing 10D world (Testing purpose) *********|\0A\00"
@.str.10 = [60 x i8] c"|*** Testing 3D world with 10 pasts (Testing purpose) ***|\0A\00"
@.str.11 = [60 x i8] c"|*** Testing 2D world with 10 param (Testing purpose) ***|\0A\00"
@.str.12 = [6 x i8] c"Done\0A\00"
define i32 @discrete_world_testbench() {
%1 = alloca i32
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 164)
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 161)
%4 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 60)
%5 = call i32 @discrete_world_testbench_arg(i32 1, i32 3, i32 2, i32 1)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
store i32 0, i32* %1
br label %47
8: ; preds = %0
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i32 61)
%10 = call i32 @discrete_world_testbench_arg(i32 1, i32 1000000, i32 2, i32 2)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %8
store i32 0, i32* %1
br label %47
13: ; preds = %8
%14 = call i32 @write(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.4, i64 0, i64 0), i32 161)
%15 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 60)
%16 = call i32 @discrete_world_testbench_arg(i32 2, i32 1000, i32 3, i32 5)
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %13
store i32 0, i32* %1
br label %47
19: ; preds = %13
%20 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0), i32 60)
%21 = call i32 @discrete_world_testbench_arg(i32 3, i32 100, i32 2, i32 5)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %19
store i32 0, i32* %1
br label %47
24: ; preds = %19
%25 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), i32 60)
%26 = call i32 @discrete_world_testbench_arg(i32 4, i32 50, i32 2, i32 5)
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %24
store i32 0, i32* %1
br label %47
29: ; preds = %24
%30 = call i32 @write(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.8, i64 0, i64 0), i32 160)
%31 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0), i32 60)
%32 = call i32 @discrete_world_testbench_arg(i32 10, i32 5, i32 2, i32 1)
%33 = icmp ne i32 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %29
store i32 0, i32* %1
br label %47
35: ; preds = %29
%36 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0), i32 60)
%37 = call i32 @discrete_world_testbench_arg(i32 3, i32 100, i32 10, i32 1)
%38 = icmp ne i32 %37, 0
br i1 %38, label %40, label %39
39: ; preds = %35
store i32 0, i32* %1
br label %47
40: ; preds = %35
%41 = call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.11, i64 0, i64 0), i32 60)
%42 = call i32 @discrete_world_testbench_arg(i32 2, i32 100, i32 2, i32 10)
%43 = icmp ne i32 %42, 0
br i1 %43, label %45, label %44
44: ; preds = %40
store i32 0, i32* %1
br label %47
45: ; preds = %40
%46 = call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 6)
store i32 1, i32* %1
br label %47
47: ; preds = %45, %44, %39, %34, %28, %23, %18, %12, %7
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [164 x i8] c"|=====================================================|\0A|===========\09DISCRETE WORLD TESTBENCH\09===========|\0A|=====================================================|\0A\00"
@.str.1 = [161 x i8] c"#######################################################\0A###############\09 BASIC TESTS\09\09################\0A#######################################################\0A\00"
@.str.2 = [60 x i8] c"|************* Testing 1D world (3) (Basic) *************|\0A\00"
@.str.3 = [61 x i8] c"|********** Testing 1D world (1 000 000) (Basic) *********|\0A\00"
@.str.4 = [161 x i8] c"#######################################################\0A###############\09 COMMON TEST\09\09################\0A#######################################################\0A\00"
@.str.5 = [60 x i8] c"|*************** Testing 2D world (Common) **************|\0A\00"
@.str.6 = [60 x i8] c"|*************** Testing 3D world (Common) **************|\0A\00"
@.str.7 = [60 x i8] c"|********** Testing 4D world (Possibly useful) **********|\0A\00"
@.str.8 = [160 x i8] c"#######################################################\0A###############\09 HEAVY TEST\09\09################\0A#######################################################\0A\00"
@.str.9 = [60 x i8] c"|********** Testing 10D world (Testing purpose) *********|\0A\00"
@.str.10 = [60 x i8] c"|*** Testing 3D world with 10 pasts (Testing purpose) ***|\0A\00"
@.str.11 = [60 x i8] c"|*** Testing 2D world with 10 param (Testing purpose) ***|\0A\00"
@.str.12 = [6 x i8] c"Done\0A\00"
define i32 @discrete_world_testbench() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 164)
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0), i32 161)
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 60)
%4 = tail call i32 @discrete_world_testbench_arg(i32 1, i32 3, i32 2, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %38, label %6
6: ; preds = %0
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0), i32 61)
%8 = tail call i32 @discrete_world_testbench_arg(i32 1, i32 1000000, i32 2, i32 2)
%9 = icmp eq i32 %8, 0
br i1 %9, label %38, label %10
10: ; preds = %6
%11 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.4, i64 0, i64 0), i32 161)
%12 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.5, i64 0, i64 0), i32 60)
%13 = tail call i32 @discrete_world_testbench_arg(i32 2, i32 1000, i32 3, i32 5)
%14 = icmp eq i32 %13, 0
br i1 %14, label %38, label %15
15: ; preds = %10
%16 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.6, i64 0, i64 0), i32 60)
%17 = tail call i32 @discrete_world_testbench_arg(i32 3, i32 100, i32 2, i32 5)
%18 = icmp eq i32 %17, 0
br i1 %18, label %38, label %19
19: ; preds = %15
%20 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0), i32 60)
%21 = tail call i32 @discrete_world_testbench_arg(i32 4, i32 50, i32 2, i32 5)
%22 = icmp eq i32 %21, 0
br i1 %22, label %38, label %23
23: ; preds = %19
%24 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.8, i64 0, i64 0), i32 160)
%25 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.9, i64 0, i64 0), i32 60)
%26 = tail call i32 @discrete_world_testbench_arg(i32 10, i32 5, i32 2, i32 1)
%27 = icmp eq i32 %26, 0
br i1 %27, label %38, label %28
28: ; preds = %23
%29 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0), i32 60)
%30 = tail call i32 @discrete_world_testbench_arg(i32 3, i32 100, i32 10, i32 1)
%31 = icmp eq i32 %30, 0
br i1 %31, label %38, label %32
32: ; preds = %28
%33 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.11, i64 0, i64 0), i32 60)
%34 = tail call i32 @discrete_world_testbench_arg(i32 2, i32 100, i32 2, i32 10)
%35 = icmp eq i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %32
%37 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 6)
br label %38
38: ; preds = %32, %28, %23, %19, %15, %10, %6, %0, %36
%39 = phi i32 [ 1, %36 ], [ 0, %0 ], [ 0, %6 ], [ 0, %10 ], [ 0, %15 ], [ 0, %19 ], [ 0, %23 ], [ 0, %28 ], [ 0, %32 ]
ret i32 %39
}