#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*/ printf(char *);
scalar_t__ read_config(char *);
int run_fork_by_config();
int run_test(int, char **);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (strcmp(argv[1], "-c") == 0) {
    if (argc == 3) {
      if (read_config(argv[2]) == 0) {
        return run_fork_by_config();
      } else {
        printf("Error! Can't read config file!");
      }
    }
    printf("Error! You entered wrong parameters!");
  }
  return run_test(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe8b(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11d1 <main+0x81>
cmpl   $0x3,-0x8(%rbp)
jne    11c5 <main+0x75>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <read_config@plt>
cmp    $0x0,%rax
jne    11b4 <main+0x64>
mov    $0x0,%al
call   1030 <run_fork_by_config@plt>
mov    %eax,-0x4(%rbp)
jmp    11e0 <main+0x90>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
jmp    11c5 <main+0x75>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <run_test@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1198 <main+0x48>
cmp    $0x3,%ebp
jne    118c <main+0x3c>
mov    0x10(%rbx),%rdi
call   1070 <read_config@plt>
test   %rax,%rax
je     11a8 <main+0x58>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <run_test@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <run_fork_by_config@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-c\00"
@.str.1 = [31 x i8] c"Error! Can't read config file!\00"
@.str.2 = [37 x i8] c"Error! You entered wrong parameters!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %27
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %25
14: ; preds = %11
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i64 @read_config(i8* %17)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 (...) @run_fork_by_config()
store i32 %21, i32* %3
br label %31
22: ; preds = %14
%23 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22
br label %25
25: ; preds = %24, %11
%26 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %27
27: ; preds = %25, %2
%28 = load i32, i32* %4
%29 = load i8**, i8*** %5
%30 = call i32 @run_test(i32 %28, i8** %29)
store i32 %30, i32* %3
br label %31
31: ; preds = %27, %20
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [3 x i8] c"-c\00"
@.str.1 = [31 x i8] c"Error! Can't read config file!\00"
@.str.2 = [37 x i8] c"Error! You entered wrong parameters!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %2
%8 = icmp eq i32 %0, 3
br i1 %8, label %9, label %18
9: ; preds = %7
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i64 @read_config(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = tail call i32 (...) @run_fork_by_config()
br label %22
16: ; preds = %9
%17 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %7
%19 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = tail call i32 @run_test(i32 %0, i8** %1)
br label %22
22: ; preds = %20, %14
%23 = phi i32 [ %15, %14 ], [ %21, %20 ]
ret i32 %23
}