#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 checkLenght(int);
int deleteFile(char **);
int encryption(char **);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int result = 1;
  int pid = getpid();
  printf("This program run in this %d process\n", pid);
  result = checkLenght(argc);
  if (result == 0) {
    return 0;
  }
  result = encryption(argv);
  if (result == 0) {
    return 0;
  }
  result = deleteFile(argv);
  if (result == 0) {
    return 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe7f(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
call   1070 <checkLenght@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11a7 <main+0x57>
movl   $0x0,-0x4(%rbp)
jmp    11f2 <main+0xa2>
mov    -0x10(%rbp),%rdi
call   1040 <encryption@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11c9 <main+0x79>
movl   $0x0,-0x4(%rbp)
jmp    11f2 <main+0xa2>
mov    -0x10(%rbp),%rdi
call   1060 <deleteFile@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11eb <main+0x9b>
movl   $0x0,-0x4(%rbp)
jmp    11f2 <main+0xa2>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    %ebp,%edi
call   1070 <checkLenght@plt>
test   %eax,%eax
je     118c <main+0x3c>
mov    %rbx,%rdi
call   1040 <encryption@plt>
test   %eax,%eax
je     118c <main+0x3c>
mov    %rbx,%rdi
call   1060 <deleteFile@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"This program run in this %d process\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%8 = call i32 (...) @getpid()
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @checkLenght(i32 %11)
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %29
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = call i32 @encryption(i8** %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 0, i32* %3
br label %29
22: ; preds = %16
%23 = load i8**, i8*** %5
%24 = call i32 @deleteFile(i8** %23)
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 0, i32* %3
br label %29
28: ; preds = %22
store i32 0, i32* %3
br label %29
29: ; preds = %28, %27, %21, %15
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
@.str = [37 x i8] c"This program run in this %d process\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @checkLenght(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = tail call i32 @encryption(i8** %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @deleteFile(i8** %1)
br label %12
12: ; preds = %10, %7, %2
ret i32 0
}