#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*/ check_all_numbers();
int /*<<< orphan*/ print_result();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_file(char *);
int /*<<< orphan*/ wait_all_childs();
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("Error! You entered wrong parameters!\n");
    return 1;
  }
  read_file(argv[1]);
  check_all_numbers();
  wait_all_childs();
  print_result();
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
je     1188 <main+0x38>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <read_file@plt>
mov    $0x0,%al
call   1050 <check_all_numbers@plt>
mov    $0x0,%al
call   1070 <wait_all_childs@plt>
mov    $0x0,%al
call   1040 <print_result@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    1178 <main+0x28>
mov    0x8(%rsi),%rdi
call   1060 <read_file@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <check_all_numbers@plt>
xor    %eax,%eax
call   1070 <wait_all_childs@plt>
xor    %eax,%eax
call   1040 <print_result@plt>
jmp    1189 <main+0x39>
lea    0xe81(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Error! You entered wrong parameters!\0A\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 i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @read_file(i8* %13)
%15 = call i32 (...) @check_all_numbers()
%16 = call i32 (...) @wait_all_childs()
%17 = call i32 (...) @print_result()
store i32 0, i32* %3
br label %18
18: ; preds = %10, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [37 x i8] c"Error! You entered wrong parameters!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %13
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @read_file(i8* %8)
%10 = tail call i32 (...) @check_all_numbers()
%11 = tail call i32 (...) @wait_all_childs()
%12 = tail call i32 (...) @print_result()
br label %13
13: ; preds = %6, %4
%14 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %14
}