#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*/ execvp(char *, char **);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char **argv) {
  if (argc != 2)
    printf("Usage: rdp-mime-winxp.exe pcxxx.tbrdp\n");
  else {
    argv[0] = "rdp-mime-winxp.pl";
    execvp(argv[0], argv);
    perror("rdp-mime-winxp.pl");
  }
  sleep(5);
  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)
cmpl   $0x2,-0x8(%rbp)
je     1171 <main+0x31>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x5b>
mov    -0x10(%rbp),%rax
lea    0xeab(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <execvp@plt>
lea    0xe91(%rip),%rdi
call   1040 <perror@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
je     1163 <main+0x23>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    $0x1,%eax
pop    %rbx
ret
lea    0xe96(%rip),%rbx
mov    %rbx,(%rsi)
mov    %rbx,%rdi
call   1050 <execvp@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
jmp    1152 <main+0x12>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: rdp-mime-winxp.exe pcxxx.tbrdp\0A\00"
@.str.1 = [18 x i8] c"rdp-mime-winxp.pl\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 ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %12
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %5
%17 = call i32 @execvp(i8* %15, i8** %16)
%18 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %10, %8
%20 = call i32 @sleep(i32 5)
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"rdp-mime-winxp.pl\00"
@str = [38 x i8] c"Usage: rdp-mime-winxp.exe pcxxx.tbrdp\00"
define i32 @main(i32 %0, i8** %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 ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %9
6: ; preds = %2
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %1
%7 = tail call i32 @execvp(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8** %1)
%8 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @sleep(i32 5)
ret i32 1
}