#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_arguments(int, char **);
int /*<<< orphan*/ check_capabilities();
int /*<<< orphan*/ printf(char *);
scalar_t__ run_container(char *, char *, char *);
int main(int argc, char **argv) {
  check_capabilities();
  check_arguments(argc, argv);
  printf("Supervisor started\n");
  if (run_container(argv[1], "ext4", argv[2]) == 0) {
    printf("Supervisor finished\n");
    return 0;
  }
  return -1;
}


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    $0x0,%al
call   1050 <check_capabilities@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <check_arguments@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xe88(%rip),%rsi
call   1030 <run_container@plt>
cmp    $0x0,%rax
jne    11b3 <main+0x73>
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ba <main+0x7a>
movl   $0xffffffff,-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
xor    %eax,%eax
call   1050 <check_capabilities@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1060 <check_arguments@plt>
lea    0xea5(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rdx
lea    0xe8c(%rip),%rsi
call   1030 <run_container@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1194 <main+0x54>
lea    0xe8b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Supervisor started\0A\00"
@.str.1 = [5 x i8] c"ext4\00"
@.str.2 = [21 x i8] c"Supervisor finished\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 = call i32 (...) @check_capabilities()
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @check_arguments(i32 %7, i8** %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i64 @run_container(i8* %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %22
21: ; preds = %2
store i32 -1, i32* %3
br label %22
22: ; preds = %21, %19
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"ext4\00"
@str = [19 x i8] c"Supervisor started\00"
@str.3 = [20 x i8] c"Supervisor finished\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @check_capabilities()
%4 = tail call i32 @check_arguments(i32 %0, i8** %1)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i64 @run_container(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
br label %14
14: ; preds = %2, %12
%15 = phi i32 [ 0, %12 ], [ -1, %2 ]
ret i32 %15
}