#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 */
long atol(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ syscall(int, long);
int main(int argc, char *argv[]) {
  if (argc != 2)
    return -1;
  long pid = atol(argv[1]);
  if (pid == 0)
    return -1;
  if (syscall(286, pid) == 0) {
    printf("Succes!!\n");
  } else {
    printf("Failed!\n");
  }
  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)
cmpl   $0x2,-0x8(%rbp)
je     115c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atol@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1184 <main+0x54>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <main+0x90>
mov    -0x18(%rbp),%rsi
mov    $0x11e,%edi
call   1040 <syscall@plt>
cmp    $0x0,%rax
jne    11ad <main+0x7d>
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x89>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cmp    $0x2,%edi
jne    1172 <main+0x42>
mov    0x8(%rsi),%rdi
call   1050 <atol@plt>
test   %rax,%rax
je     1172 <main+0x42>
mov    $0x11e,%edi
mov    %rax,%rsi
call   1040 <syscall@plt>
test   %rax,%rax
lea    0xea8(%rip),%rax
lea    0xe99(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Succes!!\0A\00"
@.str.1 = [9 x i8] c"Failed!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %27
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @atol(i8* %13)
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %10
store i32 -1, i32* %3
br label %27
18: ; preds = %10
%19 = load i64, i64* %6
%20 = call i64 @syscall(i32 286, i64 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %26
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %24, %22
store i32 0, i32* %3
br label %27
27: ; preds = %26, %17, %9
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@str = [8 x i8] c"Failed!\00"
@str.2 = [9 x i8] c"Succes!!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @atol(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = tail call i64 @syscall(i32 286, i64 %7)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0)
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
br label %14
14: ; preds = %9, %4, %2
%15 = phi i32 [ -1, %2 ], [ -1, %4 ], [ 0, %9 ]
ret i32 %15
}