#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 */
typedef int /*<<< orphan*/ args;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int chdir(char *);
int execv(char *, char **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    fprintf(stderr, "Usage: %s [command]\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  char *args[20];
  args[0] = "python";
  int i;
  for (i = 1; i < ((sizeof(args) / sizeof(0 [args])) /
                   ((size_t)(!(sizeof(args) % sizeof(0 [args]))))) &&
              argv[i] != NULL;
       ++i) {
    args[i] = argv[i];
  }
  args[i] = NULL;
  if (i == ((sizeof(args) / sizeof(0 [args])) /
            ((size_t)(!(sizeof(args) % sizeof(0 [args])))))) {
    fprintf(stderr, "Too many args\n");
    exit(EXIT_FAILURE);
  }
  int success = chdir("/home/pi/sparkfun-avc/");
  if (success != 0) {
    fprintf(stderr, "Unable to chdir\n");
    exit(EXIT_FAILURE);
  }
  return execv("/home/pi/.virtualenvs/sparkfun/bin/python", args);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     118f <main+0x4f>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    0xed9(%rip),%rax
mov    %rax,-0xb0(%rbp)
movl   $0x1,-0xb4(%rbp)
movslq -0xb4(%rbp),%rcx
xor    %eax,%eax
cmp    $0x14,%rcx
mov    %al,-0xb9(%rbp)
jae    11d9 <main+0x99>
mov    -0x10(%rbp),%rax
movslq -0xb4(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
setne  %al
mov    %al,-0xb9(%rbp)
mov    -0xb9(%rbp),%al
test   $0x1,%al
jne    11ec <main+0xac>
jmp    121e <main+0xde>
mov    -0x10(%rbp),%rax
movslq -0xb4(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0xb4(%rbp),%rax
mov    %rcx,-0xb0(%rbp,%rax,8)
ff
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11a7 <main+0x67>
movslq -0xb4(%rbp),%rax
movq   $0x0,-0xb0(%rbp,%rax,8)
movslq -0xb4(%rbp),%rax
cmp    $0x14,%rax
jne    1267 <main+0x127>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
lea    0xdc3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    0xdb6(%rip),%rdi
call   1030 <chdir@plt>
mov    %eax,-0xb8(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     12ab <main+0x16b>
mov    0x2d53(%rip),%rax
mov    (%rax),%edi
lea    0xda5(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    -0xb0(%rbp),%rsi
lea    0xd93(%rip),%rdi
call   1060 <execv@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xa8,%rsp
cmp    $0x1,%edi
jle    1384 <main+0x244>
lea    0xf18(%rip),%rax
mov    %rax,(%rsp)
mov    0x8(%rsi),%rax
test   %rax,%rax
je     12d9 <main+0x199>
mov    %rax,0x8(%rsp)
mov    0x10(%rsi),%rax
test   %rax,%rax
je     12e0 <main+0x1a0>
mov    %rax,0x10(%rsp)
mov    0x18(%rsi),%rax
test   %rax,%rax
je     12e7 <main+0x1a7>
mov    %rax,0x18(%rsp)
mov    0x20(%rsi),%rax
test   %rax,%rax
je     12ee <main+0x1ae>
mov    %rax,0x20(%rsp)
mov    0x28(%rsi),%rax
test   %rax,%rax
je     12f5 <main+0x1b5>
mov    %rax,0x28(%rsp)
mov    0x30(%rsi),%rax
test   %rax,%rax
je     12fc <main+0x1bc>
mov    %rax,0x30(%rsp)
mov    0x38(%rsi),%rax
test   %rax,%rax
je     1303 <main+0x1c3>
mov    %rax,0x38(%rsp)
mov    0x40(%rsi),%rax
test   %rax,%rax
je     130a <main+0x1ca>
mov    %rax,0x40(%rsp)
mov    0x48(%rsi),%rax
test   %rax,%rax
je     1311 <main+0x1d1>
mov    %rax,0x48(%rsp)
mov    0x50(%rsi),%rax
test   %rax,%rax
je     1318 <main+0x1d8>
mov    %rax,0x50(%rsp)
mov    0x58(%rsi),%rax
test   %rax,%rax
je     131f <main+0x1df>
mov    %rax,0x58(%rsp)
mov    0x60(%rsi),%rax
test   %rax,%rax
je     1326 <main+0x1e6>
mov    %rax,0x60(%rsp)
mov    0x68(%rsi),%rax
test   %rax,%rax
je     132d <main+0x1ed>
mov    %rax,0x68(%rsp)
mov    0x70(%rsi),%rax
test   %rax,%rax
je     1334 <main+0x1f4>
mov    %rax,0x70(%rsp)
mov    0x78(%rsi),%rax
test   %rax,%rax
je     133b <main+0x1fb>
mov    %rax,0x78(%rsp)
mov    0x80(%rsi),%rax
test   %rax,%rax
je     1342 <main+0x202>
mov    %rax,0x80(%rsp)
mov    0x88(%rsi),%rax
test   %rax,%rax
je     1349 <main+0x209>
mov    %rax,0x88(%rsp)
mov    0x90(%rsi),%rax
test   %rax,%rax
je     1350 <main+0x210>
mov    %rax,0x90(%rsp)
mov    $0x13,%eax
cmpq   $0x0,0x98(%rsi)
je     1355 <main+0x215>
mov    0x2d15(%rip),%rax
mov    (%rax),%edi
lea    0xd41(%rip),%rsi
jmp    13b0 <main+0x270>
mov    $0x1,%eax
jmp    1355 <main+0x215>
mov    $0x2,%eax
jmp    1355 <main+0x215>
mov    $0x3,%eax
jmp    1355 <main+0x215>
mov    $0x4,%eax
jmp    1355 <main+0x215>
mov    $0x5,%eax
jmp    1355 <main+0x215>
mov    $0x6,%eax
jmp    1355 <main+0x215>
mov    $0x7,%eax
jmp    1355 <main+0x215>
mov    $0x8,%eax
jmp    1355 <main+0x215>
mov    $0x9,%eax
jmp    1355 <main+0x215>
mov    $0xa,%eax
jmp    1355 <main+0x215>
mov    $0xb,%eax
jmp    1355 <main+0x215>
mov    $0xc,%eax
jmp    1355 <main+0x215>
mov    $0xd,%eax
jmp    1355 <main+0x215>
mov    $0xe,%eax
jmp    1355 <main+0x215>
mov    $0xf,%eax
jmp    1355 <main+0x215>
mov    $0x10,%eax
jmp    1355 <main+0x215>
mov    $0x11,%eax
jmp    1355 <main+0x215>
mov    $0x12,%eax
movq   $0x0,(%rsp,%rax,8)
lea    0xcc0(%rip),%rdi
call   1030 <chdir@plt>
test   %eax,%eax
jne    13a0 <main+0x260>
lea    0xcd8(%rip),%rdi
mov    %rsp,%rsi
call   1060 <execv@plt>
add    $0xa8,%rsp
ret
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xc69(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    13b7 <main+0x277>
mov    0x2c39(%rip),%rax
mov    (%rax),%edi
lea    0xc8b(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2c1a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [command]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [7 x i8] c"python\00"
@.str.2 = [15 x i8] c"Too many args\0A\00"
@.str.3 = [23 x i8] c"/home/pi/sparkfun-avc/\00"
@.str.4 = [17 x i8] c"Unable to chdir\0A\00"
@.str.5 = [42 x i8] c"/home/pi/.virtualenvs/sparkfun/bin/python\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8*]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %20
store i32 1, i32* %7
br label %21
21: ; preds = %43, %19
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = icmp ult i64 %23, 20
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %26, i64 %28
%30 = load i8*, i8** %29
%31 = icmp ne i8* %30, null
br label %32
32: ; preds = %25, %21
%33 = phi i1 [ false, %21 ], [ %31, %25 ]
br i1 %33, label %34, label %46
34: ; preds = %32
%35 = load i8**, i8*** %5
%36 = load i32, i32* %7
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 %41
store i8* %39, i8** %42
br label %43
43: ; preds = %34
%44 = load i32, i32* %7
%45 = add nsw i32 %44, 1
store i32 %45, i32* %7
br label %21
46: ; preds = %32
%47 = load i32, i32* %7
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 %48
store i8* null, i8** %49
%50 = load i32, i32* %7
%51 = sext i32 %50 to i64
%52 = icmp eq i64 %51, 20
br i1 %52, label %53, label %58
53: ; preds = %46
%54 = load i32, i32* @stderr
%55 = call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%56 = load i32, i32* @EXIT_FAILURE
%57 = call i32 @exit(i32 %56)
unreachable
58: ; preds = %46
%59 = call i32 @chdir(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
store i32 %59, i32* %8
%60 = load i32, i32* %8
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %58
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%65 = load i32, i32* @EXIT_FAILURE
%66 = call i32 @exit(i32 %65)
unreachable
67: ; preds = %58
%68 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 0
%69 = call i32 @execv(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8** %68)
ret i32 %69
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: %s [command]\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [7 x i8] c"python\00"
@.str.2 = [15 x i8] c"Too many args\0A\00"
@.str.3 = [23 x i8] c"/home/pi/sparkfun-avc/\00"
@.str.4 = [17 x i8] c"Unable to chdir\0A\00"
@.str.5 = [42 x i8] c"/home/pi/.virtualenvs/sparkfun/bin/python\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [20 x i8*]
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %1
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
%12 = bitcast [20 x i8*]* %3 to i8*
%13 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %112, label %17
17: ; preds = %11
%18 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 1
store i8* %15, i8** %18
%19 = getelementptr inbounds i8*, i8** %1, i64 2
%20 = load i8*, i8** %19
%21 = icmp eq i8* %20, null
br i1 %21, label %112, label %22
22: ; preds = %17
%23 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 2
store i8* %20, i8** %23
%24 = getelementptr inbounds i8*, i8** %1, i64 3
%25 = load i8*, i8** %24
%26 = icmp eq i8* %25, null
br i1 %26, label %112, label %27
27: ; preds = %22
%28 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 3
store i8* %25, i8** %28
%29 = getelementptr inbounds i8*, i8** %1, i64 4
%30 = load i8*, i8** %29
%31 = icmp eq i8* %30, null
br i1 %31, label %112, label %32
32: ; preds = %27
%33 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 4
store i8* %30, i8** %33
%34 = getelementptr inbounds i8*, i8** %1, i64 5
%35 = load i8*, i8** %34
%36 = icmp eq i8* %35, null
br i1 %36, label %112, label %37
37: ; preds = %32
%38 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 5
store i8* %35, i8** %38
%39 = getelementptr inbounds i8*, i8** %1, i64 6
%40 = load i8*, i8** %39
%41 = icmp eq i8* %40, null
br i1 %41, label %112, label %42
42: ; preds = %37
%43 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 6
store i8* %40, i8** %43
%44 = getelementptr inbounds i8*, i8** %1, i64 7
%45 = load i8*, i8** %44
%46 = icmp eq i8* %45, null
br i1 %46, label %112, label %47
47: ; preds = %42
%48 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 7
store i8* %45, i8** %48
%49 = getelementptr inbounds i8*, i8** %1, i64 8
%50 = load i8*, i8** %49
%51 = icmp eq i8* %50, null
br i1 %51, label %112, label %52
52: ; preds = %47
%53 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 8
store i8* %50, i8** %53
%54 = getelementptr inbounds i8*, i8** %1, i64 9
%55 = load i8*, i8** %54
%56 = icmp eq i8* %55, null
br i1 %56, label %112, label %57
57: ; preds = %52
%58 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 9
store i8* %55, i8** %58
%59 = getelementptr inbounds i8*, i8** %1, i64 10
%60 = load i8*, i8** %59
%61 = icmp eq i8* %60, null
br i1 %61, label %112, label %62
62: ; preds = %57
%63 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 10
store i8* %60, i8** %63
%64 = getelementptr inbounds i8*, i8** %1, i64 11
%65 = load i8*, i8** %64
%66 = icmp eq i8* %65, null
br i1 %66, label %112, label %67
67: ; preds = %62
%68 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 11
store i8* %65, i8** %68
%69 = getelementptr inbounds i8*, i8** %1, i64 12
%70 = load i8*, i8** %69
%71 = icmp eq i8* %70, null
br i1 %71, label %112, label %72
72: ; preds = %67
%73 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 12
store i8* %70, i8** %73
%74 = getelementptr inbounds i8*, i8** %1, i64 13
%75 = load i8*, i8** %74
%76 = icmp eq i8* %75, null
br i1 %76, label %112, label %77
77: ; preds = %72
%78 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 13
store i8* %75, i8** %78
%79 = getelementptr inbounds i8*, i8** %1, i64 14
%80 = load i8*, i8** %79
%81 = icmp eq i8* %80, null
br i1 %81, label %112, label %82
82: ; preds = %77
%83 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 14
store i8* %80, i8** %83
%84 = getelementptr inbounds i8*, i8** %1, i64 15
%85 = load i8*, i8** %84
%86 = icmp eq i8* %85, null
br i1 %86, label %112, label %87
87: ; preds = %82
%88 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 15
store i8* %85, i8** %88
%89 = getelementptr inbounds i8*, i8** %1, i64 16
%90 = load i8*, i8** %89
%91 = icmp eq i8* %90, null
br i1 %91, label %112, label %92
92: ; preds = %87
%93 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 16
store i8* %90, i8** %93
%94 = getelementptr inbounds i8*, i8** %1, i64 17
%95 = load i8*, i8** %94
%96 = icmp eq i8* %95, null
br i1 %96, label %112, label %97
97: ; preds = %92
%98 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 17
store i8* %95, i8** %98
%99 = getelementptr inbounds i8*, i8** %1, i64 18
%100 = load i8*, i8** %99
%101 = icmp eq i8* %100, null
br i1 %101, label %112, label %102
102: ; preds = %97
%103 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 18
store i8* %100, i8** %103
%104 = getelementptr inbounds i8*, i8** %1, i64 19
%105 = load i8*, i8** %104
%106 = icmp eq i8* %105, null
br i1 %106, label %112, label %107
107: ; preds = %102
%108 = load i32, i32* @stderr
%109 = tail call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%110 = load i32, i32* @EXIT_FAILURE
%111 = tail call i32 @exit(i32 %110)
unreachable
112: ; preds = %11, %17, %22, %27, %32, %37, %42, %47, %52, %57, %62, %67, %72, %77, %82, %87, %92, %97, %102
%113 = phi i64 [ 1, %11 ], [ 2, %17 ], [ 3, %22 ], [ 4, %27 ], [ 5, %32 ], [ 6, %37 ], [ 7, %42 ], [ 8, %47 ], [ 9, %52 ], [ 10, %57 ], [ 11, %62 ], [ 12, %67 ], [ 13, %72 ], [ 14, %77 ], [ 15, %82 ], [ 16, %87 ], [ 17, %92 ], [ 18, %97 ], [ 19, %102 ]
%114 = getelementptr inbounds [20 x i8*], [20 x i8*]* %3, i64 0, i64 %113
store i8* null, i8** %114
%115 = tail call i32 @chdir(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%116 = icmp eq i32 %115, 0
br i1 %116, label %122, label %117
117: ; preds = %112
%118 = load i32, i32* @stderr
%119 = tail call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%120 = load i32, i32* @EXIT_FAILURE
%121 = tail call i32 @exit(i32 %120)
unreachable
122: ; preds = %112
%123 = call i32 @execv(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8** %13)
ret i32 %123
}