#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_2D_testbench_arg(int, int, int, int);
int /*<<< orphan*/ write(int, char *, int);
int discrete_world_2D_testbench() {
  write(1,
        "|=====================================================|\n"
        "|===========  DISCRETE WORLD 2D TESTBENCH	===========|\n"
        "|=====================================================|\n",
        sizeof("|=====================================================|\n"
               "|===========  DISCRETE WORLD 2D TESTBENCH	===========|\n"
               "|=====================================================|\n"));
  write(1,
        "#######################################################\n"
        "###############	  BASIC TESTS		################\n"
        "#######################################################\n",
        sizeof("#######################################################\n"
               "###############	  BASIC TESTS		################\n"
               "#######################################################\n"));
  write(1, "|************** Testing world (3) (Basic) **************|\n",
        sizeof("|************** Testing world (3) (Basic) **************|\n"));
  if (!discrete_world_2D_testbench_arg(3, 3, 2, 1))
    return 0;
  write(1,
        "#######################################################\n"
        "###############	  COMMON TEST		################\n"
        "#######################################################\n",
        sizeof("#######################################################\n"
               "###############	  COMMON TEST		################\n"
               "#######################################################\n"));
  write(1, "|**************** Testing world (Common) ***************|\n",
        sizeof("|**************** Testing world (Common) ***************|\n"));
  if (!discrete_world_2D_testbench_arg(500, 500, 2, 5))
    return 0;
  write(1,
        "#######################################################\n"
        "###############	  HEAVY TEST		################\n"
        "#######################################################\n",
        sizeof("#######################################################\n"
               "###############	  HEAVY TEST		################\n"
               "#######################################################\n"));
  write(1, "|*********** Testing world (Testing purpose) ***********|\n",
        sizeof("|*********** Testing world (Testing purpose) ***********|\n"));
  if (!discrete_world_2D_testbench_arg(5000, 5000, 5, 2))
    return 0;
  write(1, "Done\n", sizeof("Done\n"));
  return 1;
}


x86 assembly (clang, -O0):
<discrete_world_2D_testbench>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0xa8,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0xf5e(%rip),%rsi
mov    $0xa1,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0xfe9(%rip),%rsi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    %esi,%edi
call   1040 <discrete_world_2D_testbench_arg@plt>
cmp    $0x0,%eax
jne    1195 <discrete_world_2D_testbench+0x75>
movl   $0x0,-0x4(%rbp)
jmp    1260 <discrete_world_2D_testbench+0x140>
mov    $0x1,%edi
lea    0xfe3(%rip),%rsi
mov    $0xa1,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0x106e(%rip),%rsi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x1f4,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
mov    %esi,%edi
call   1040 <discrete_world_2D_testbench_arg@plt>
cmp    $0x0,%eax
jne    11ec <discrete_world_2D_testbench+0xcc>
movl   $0x0,-0x4(%rbp)
jmp    1260 <discrete_world_2D_testbench+0x140>
mov    $0x1,%edi
lea    0x1068(%rip),%rsi
mov    $0xa0,%edx
call   1030 <write@plt>
mov    $0x1,%edi
lea    0x10f2(%rip),%rsi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x1388,%esi
mov    $0x5,%edx
mov    $0x2,%ecx
mov    %esi,%edi
call   1040 <discrete_world_2D_testbench_arg@plt>
cmp    $0x0,%eax
jne    1243 <discrete_world_2D_testbench+0x123>
movl   $0x0,-0x4(%rbp)
jmp    1260 <discrete_world_2D_testbench+0x140>
mov    $0x1,%edi
lea    0x10ec(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discrete_world_2D_testbench>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xa8,%edx
call   1030 <write@plt>
lea    0xf6a(%rip),%rsi
mov    $0x1,%edi
mov    $0xa1,%edx
call   1030 <write@plt>
lea    0xff5(%rip),%rsi
mov    $0x1,%edi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x3,%edi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1040 <discrete_world_2D_testbench_arg@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1233 <discrete_world_2D_testbench+0x113>
lea    0xff7(%rip),%rsi
mov    $0x1,%edi
mov    $0xa1,%edx
call   1030 <write@plt>
lea    0x1082(%rip),%rsi
mov    $0x1,%edi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x1f4,%edi
mov    $0x1f4,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
call   1040 <discrete_world_2D_testbench_arg@plt>
test   %eax,%eax
je     1233 <discrete_world_2D_testbench+0x113>
lea    0x108a(%rip),%rsi
mov    $0x1,%edi
mov    $0xa0,%edx
call   1030 <write@plt>
lea    0x1114(%rip),%rsi
mov    $0x1,%edi
mov    $0x3b,%edx
call   1030 <write@plt>
mov    $0x1388,%edi
mov    $0x1388,%esi
mov    $0x5,%edx
mov    $0x2,%ecx
call   1040 <discrete_world_2D_testbench_arg@plt>
test   %eax,%eax
je     1233 <discrete_world_2D_testbench+0x113>
lea    0x111c(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1030 <write@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [168 x i8] c"|=====================================================|\0A|=========== DISCRETE WORLD 2D TESTBENCH\09===========|\0A|=====================================================|\0A\00"
@.str.1 = [161 x i8] c"#######################################################\0A###############\09 BASIC TESTS\09\09################\0A#######################################################\0A\00"
@.str.2 = [59 x i8] c"|************** Testing world (3) (Basic) **************|\0A\00"
@.str.3 = [161 x i8] c"#######################################################\0A###############\09 COMMON TEST\09\09################\0A#######################################################\0A\00"
@.str.4 = [59 x i8] c"|**************** Testing world (Common) ***************|\0A\00"
@.str.5 = [160 x i8] c"#######################################################\0A###############\09 HEAVY TEST\09\09################\0A#######################################################\0A\00"
@.str.6 = [59 x i8] c"|*********** Testing world (Testing purpose) ***********|\0A\00"
@.str.7 = [6 x i8] c"Done\0A\00"
define i32 @discrete_world_2D_testbench() {
%1 = alloca i32
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 168)
%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 ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 59)
%5 = call i32 @discrete_world_2D_testbench_arg(i32 3, 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 %22
8: ; preds = %0
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.3, i64 0, i64 0), i32 161)
%10 = call i32 @write(i32 1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), i32 59)
%11 = call i32 @discrete_world_2D_testbench_arg(i32 500, i32 500, i32 2, i32 5)
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8
store i32 0, i32* %1
br label %22
14: ; preds = %8
%15 = call i32 @write(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.5, i64 0, i64 0), i32 160)
%16 = call i32 @write(i32 1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), i32 59)
%17 = call i32 @discrete_world_2D_testbench_arg(i32 5000, i32 5000, i32 5, i32 2)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %14
store i32 0, i32* %1
br label %22
20: ; preds = %14
%21 = call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 6)
store i32 1, i32* %1
br label %22
22: ; preds = %20, %19, %13, %7
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [168 x i8] c"|=====================================================|\0A|=========== DISCRETE WORLD 2D TESTBENCH\09===========|\0A|=====================================================|\0A\00"
@.str.1 = [161 x i8] c"#######################################################\0A###############\09 BASIC TESTS\09\09################\0A#######################################################\0A\00"
@.str.2 = [59 x i8] c"|************** Testing world (3) (Basic) **************|\0A\00"
@.str.3 = [161 x i8] c"#######################################################\0A###############\09 COMMON TEST\09\09################\0A#######################################################\0A\00"
@.str.4 = [59 x i8] c"|**************** Testing world (Common) ***************|\0A\00"
@.str.5 = [160 x i8] c"#######################################################\0A###############\09 HEAVY TEST\09\09################\0A#######################################################\0A\00"
@.str.6 = [59 x i8] c"|*********** Testing world (Testing purpose) ***********|\0A\00"
@.str.7 = [6 x i8] c"Done\0A\00"
define i32 @discrete_world_2D_testbench() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 168)
%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 ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i32 59)
%4 = tail call i32 @discrete_world_2D_testbench_arg(i32 3, i32 3, i32 2, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %0
%7 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.3, i64 0, i64 0), i32 161)
%8 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0), i32 59)
%9 = tail call i32 @discrete_world_2D_testbench_arg(i32 500, i32 500, i32 2, i32 5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %6
%12 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.5, i64 0, i64 0), i32 160)
%13 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0), i32 59)
%14 = tail call i32 @discrete_world_2D_testbench_arg(i32 5000, i32 5000, i32 5, i32 2)
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %11
%17 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 6)
br label %18
18: ; preds = %11, %6, %0, %16
%19 = phi i32 [ 1, %16 ], [ 0, %0 ], [ 0, %6 ], [ 0, %11 ]
ret i32 %19
}