xunge/DecIR huggingface dataset:
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ memset(struct timezone *, char, int);
long get_time_usecs() {
  struct timeval time;
  struct timezone tz;
  memset(&tz, '\0', sizeof(struct timezone));
  gettimeofday(&time, &tz);
  long usecs = time.tv_sec * 1000000 + time.tv_usec;
  return usecs;
}


x86 assembly (clang, -O0):
<get_time_usecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_usecs>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rsp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i64 @get_time_usecs() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i64
%4 = call i32 @memset(%struct.timezone* %2, i8 signext 0, i32 4)
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %3
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
define i64 @get_time_usecs() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @memset(%struct.timezone* %2, i8 signext 0, i32 4)
%6 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
%13 = sext i32 %12 to i64
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ logSysExit(char *);
void *malloc(size_t);
void *smalloc(size_t size) {
  void *rv;
  if ((rv = malloc(size)) == NULL) {
    logSysExit("malloc (smalloc)");
  }
  return rv;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114f <smalloc+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <logSysExit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <smalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <logSysExit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"malloc (smalloc)\00"
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @logSysExit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [17 x i8] c"malloc (smalloc)\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @logSysExit(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char is_bool_n(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
char is_bool(const char *str) { return (is_bool_n(str, strlen(str))); }


x86 assembly (clang, -O0):
<is_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <is_bool_n@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bool>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <is_bool_n@plt>

LLVM IR (-O0):
define signext i8 @is_bool(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call signext i8 @is_bool_n(i8* %3, i32 %5)
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @is_bool(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call signext i8 @is_bool_n(i8* %0, i32 %2)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, int, int, int);
int p(const char *fmt, int x, int y, int sum) {
  printf(fmt, x, y, sum);
  return 0;
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
push   %rax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @p(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* %9, i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @p(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 0
}
void gtk_target_flags_get_type() {}


x86 assembly (clang, -O0):
<gtk_target_flags_get_type>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_target_flags_get_type>:
ret

LLVM IR (-O0):
define void @gtk_target_flags_get_type() {
ret void
}

LLVM IR (-O2):
define void @gtk_target_flags_get_type() {
ret void
}
/* Variables and functions */
double exp(double);
double cosh(double x) { return (exp(x) + exp(-x)) / 2.0; }


x86 assembly (clang, -O0):
<cosh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  0xe9f(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosh>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xece(%rip),%xmm0
call   1030 <exp@plt>
addsd  0x8(%rsp),%xmm0
mulsd  0xecb(%rip),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @cosh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @exp(double %3)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call double @exp(double %6)
%8 = fadd double %4, %7
%9 = fdiv double %8, 2.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @cosh(double %0) {
%2 = tail call double @exp(double %0)
%3 = fneg double %0
%4 = tail call double @exp(double %3)
%5 = fadd double %2, %4
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ compareString(char *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc == 3) {
    compareString(argv[1], argv[2]);
  } else
    printf("arguments should be 2 strings\n");
}


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   $0x3,-0x8(%rbp)
jne    115a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <compareString@plt>
jmp    1166 <main+0x46>
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x3,%edi
jne    1135 <main+0x15>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <compareString@plt>
jmp    1141 <main+0x21>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"arguments should be 2 strings\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 = load i32, i32* %4
%7 = icmp eq i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @compareString(i8* %11, i8* %14)
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [30 x i8] c"arguments should be 2 strings\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @compareString(i8* %6, i8* %8)
br label %12
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x36() {
  Assert_real((isgraph(54)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              275, ("isgraph should be 1 for 6"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x36>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x113,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x36>:
push   %rax
mov    $0x36,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x113,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 6\00"
define void @t_isgraph_0x36() {
%1 = call i32 @isgraph(i32 54)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 6\00"
define void @t_isgraph_0x36() {
%1 = tail call i32 @isgraph(i32 54)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 275, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mp_limb_t;

/* Variables and functions */
char *gmp_version;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  if (sizeof(mp_limb_t) == sizeof(long))
    printf("%s", gmp_version);
  else
    printf("unsupported");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"unsupported\00"
@gmp_version = global i8* null
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"unsupported\00"
@gmp_version = global i8* null
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int get16(int);
unsigned get32(int addr) { return get16(addr) + (get16(addr + 2) << 16); }


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x2,%edi
call   1030 <get16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x10,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <get16@plt>
mov    %eax,%ebp
add    $0x2,%ebx
mov    %ebx,%edi
call   1030 <get16@plt>
shl    $0x10,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get16(i32 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 2
%7 = call i32 @get16(i32 %6)
%8 = shl i32 %7, 16
%9 = add nsw i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get32(i32 %0) {
%2 = tail call i32 @get16(i32 %0)
%3 = add nsw i32 %0, 2
%4 = tail call i32 @get16(i32 %3)
%5 = shl i32 %4, 16
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *strchr(char const *, char);
char *getStrVal(const char *sz) {
  char *idx = strchr(sz, '=');
  assert(idx != NULL);
  return idx + 1;
}


x86 assembly (clang, -O0):
<getStrVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStrVal>:
push   %rbx
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @getStrVal(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 61)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
ret i8* %11
}

LLVM IR (-O2):
define i8* @getStrVal(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %6
}
void najeWriteMap() { return; }


x86 assembly (clang, -O0):
<najeWriteMap>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<najeWriteMap>:
ret

LLVM IR (-O0):
define void @najeWriteMap() {
ret void
}

LLVM IR (-O2):
define void @najeWriteMap() {
ret void
}
int help_version(int argc, char **argv) { return 1; }


x86 assembly (clang, -O0):
<help_version>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_version>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @help_version(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 1
}

LLVM IR (-O2):
define i32 @help_version(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *string_alloc(scalar_t__);
scalar_t__ string_length(char *);
char *smt_unary(char *opt, char *op) {
  char *string;
  string = string_alloc(1 + string_length(opt) + 1 + string_length(op) + 1);
  sprintf(string, "(%s %s)", opt, op);
  return string;
}


x86 assembly (clang, -O0):
<smt_unary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_length@plt>
add    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <string_length@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1030 <string_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7b(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smt_unary>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <string_length@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <string_length@plt>
lea    (%r15,%rax,1),%rdi
add    $0x3,%rdi
call   1030 <string_alloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"(%s %s)\00"
define i8* @smt_unary(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @string_length(i8* %6)
%8 = add nsw i64 1, %7
%9 = add nsw i64 %8, 1
%10 = load i8*, i8** %4
%11 = call i64 @string_length(i8* %10)
%12 = add nsw i64 %9, %11
%13 = add nsw i64 %12, 1
%14 = call i8* @string_alloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"(%s %s)\00"
define i8* @smt_unary(i8* %0, i8* %1) {
%3 = tail call i64 @string_length(i8* %0)
%4 = tail call i64 @string_length(i8* %1)
%5 = add i64 %3, 3
%6 = add i64 %5, %4
%7 = tail call i8* @string_alloc(i64 %6)
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ lgen(char *, char *, int);
void cgldswtch(int n) { lgen("%s\tdx,offset %c%d", "mov", n); }


x86 assembly (clang, -O0):
<cgldswtch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1030 <lgen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgldswtch>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <lgen@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s\09dx,offset %c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldswtch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @lgen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s\09dx,offset %c%d\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgldswtch(i32 %0) {
%2 = tail call i32 @lgen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
bool readChar(FILE *file, int *value) {
  int readChar = fgetc(file);
  if (readChar == EOF)
    return false;
  *value = readChar;
  return true;
}


x86 assembly (clang, -O0):
<readChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%eax
jne    114a <readChar+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    115a <readChar+0x4a>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar>:
push   %rbx
mov    %rsi,%rbx
call   1030 <fgetc@plt>
mov    0x2ec8(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%eax
je     112d <readChar+0x1d>
mov    %eax,(%rbx)
mov    $0x1,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @readChar(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
%7 = load i32*, i32** %4
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %16
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32*, i32** %5
store i32 %14, i32* %15
store i32 1, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @readChar(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
store i32 %3, i32* %1
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int pow(double, double);
double h(double x) { return (pow(x, 4.0) - 3 * pow(x, 2.0) - 8); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    %ecx,%eax
sub    $0x8,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm1
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  0xed6(%rip),%xmm1
movsd  0x8(%rsp),%xmm0
call   1030 <pow@plt>
lea    (%rax,%rax,2),%eax
neg    %eax
add    %ebx,%eax
add    $0xfffffff8,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, double 4.000000e+00)
%5 = load double, double* %2
%6 = call i32 @pow(double %5, double 2.000000e+00)
%7 = mul nsw i32 3, %6
%8 = sub nsw i32 %4, %7
%9 = sub nsw i32 %8, 8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @h(double %0) {
%2 = tail call i32 @pow(double %0, double 4.000000e+00)
%3 = tail call i32 @pow(double %0, double 2.000000e+00)
%4 = mul i32 %3, -3
%5 = add i32 %2, -8
%6 = add i32 %5, %4
%7 = sitofp i32 %6 to double
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, World");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello, World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct stack *);
void dispose_stack(struct stack *stack) { free(stack); }


x86 assembly (clang, -O0):
<dispose_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dispose_stack>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @dispose_stack(%struct.stack* %0) {
%2 = alloca %struct.stack*
store %struct.stack* %0, %struct.stack** %2
%3 = load %struct.stack*, %struct.stack** %2
%4 = call i32 @free(%struct.stack* %3)
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @dispose_stack(%struct.stack* nocapture %0) {
%2 = tail call i32 @free(%struct.stack* %0)
ret void
}
/* Type definitions */
typedef int uintmax_t;

/* Variables and functions */
uintmax_t zero_rightmost_1bit(uintmax_t x) { return x & (x - 1); }


x86 assembly (clang, -O0):
<zero_rightmost_1bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_rightmost_1bit>:
lea    -0x1(%rdi),%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @zero_rightmost_1bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = and i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @zero_rightmost_1bit(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = and i32 %2, %0
ret i32 %3
}
int main() {
  int A, B;
  int q, r, b;
  q = 0;
  r = A;
  b = B;
  while (1) {
    if (A) {
      q = 2 * q;
      b = b / 2;
      if (r >= b) {
        q++;
        r -= b;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1164 <main+0x64>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jl     115f <main+0x5f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1164 <main+0x64>
jmp    111e <main+0x1e>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%7 = load i32, i32* %2
store i32 %7, i32* %5
%8 = load i32, i32* %3
store i32 %8, i32* %6
br label %9
9: ; preds = %0, %27
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %4
%14 = mul nsw i32 2, %13
store i32 %14, i32* %4
%15 = load i32, i32* %6
%16 = sdiv i32 %15, 2
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp sge i32 %17, %18
br i1 %19, label %20, label %26
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, %23
store i32 %25, i32* %5
br label %26
26: ; preds = %20, %12
br label %27
27: ; preds = %26, %9
br label %9
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
scalar_t__ getpid();
int g_getpid(void) { return (int)getpid(); }


x86 assembly (clang, -O0):
<g_getpid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_getpid>:
xor    %eax,%eax
jmp    1030 <getpid@plt>

LLVM IR (-O0):
define i32 @g_getpid() {
%1 = call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @g_getpid() {
%1 = tail call i64 (...) @getpid()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SPI1_IRQHandler() { default_handler(); }


x86 assembly (clang, -O0):
<SPI1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <default_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI1_IRQHandler>:
xor    %eax,%eax
jmp    1030 <default_handler@plt>

LLVM IR (-O0):
define weak void @SPI1_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @SPI1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void why_here(void) {
  printf("why u r here?!\n");
  exit(0);
}


x86 assembly (clang, -O0):
<why_here>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<why_here>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"why u r here?!\0A\00"
define void @why_here() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [15 x i8] c"why u r here?!\00"
define void @why_here() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int main(int argc, char *argv[]) {
  if (argc > 1)
    main(argc - 1, argv);
  return 0;
}


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   $0x1,-0x8(%rbp)
jle    113f <main+0x2f>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <main@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
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 sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = load i8**, i8*** %5
%12 = call i32 @main(i32 %10, i8** %11)
br label %13
13: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void imv_window_free(struct imv_window *window) { (void)window; }


x86 assembly (clang, -O0):
<imv_window_free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<imv_window_free>:
ret

LLVM IR (-O0):
%struct.imv_window = type opaque
define void @imv_window_free(%struct.imv_window* %0) {
%2 = alloca %struct.imv_window*
store %struct.imv_window* %0, %struct.imv_window** %2
%3 = load %struct.imv_window*, %struct.imv_window** %2
ret void
}

LLVM IR (-O2):
%struct.imv_window = type opaque
define void @imv_window_free(%struct.imv_window* nocapture %0) {
ret void
}
void VID_MenuInit(void) {}


x86 assembly (clang, -O0):
<VID_MenuInit>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VID_MenuInit>:
ret

LLVM IR (-O0):
define void @VID_MenuInit() {
ret void
}

LLVM IR (-O2):
define void @VID_MenuInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbits(int);
int rightrot(int, int);
int main(void) {
  printbits(7);
  printbits(rightrot(7, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1040 <printbits@plt>
mov    $0x7,%edi
mov    $0x3,%esi
call   1030 <rightrot@plt>
mov    %eax,%edi
call   1040 <printbits@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1040 <printbits@plt>
mov    $0x7,%edi
mov    $0x3,%esi
call   1030 <rightrot@plt>
mov    %eax,%edi
call   1040 <printbits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printbits(i32 7)
%3 = call i32 @rightrot(i32 7, i32 3)
%4 = call i32 @printbits(i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printbits(i32 7)
%2 = tail call i32 @rightrot(i32 7, i32 3)
%3 = tail call i32 @printbits(i32 %2)
ret i32 0
}
/* Variables and functions */
char *calloc(size_t, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *string_new(const char *s) {
  size_t size = strlen(s);
  char *retVal = calloc(size + 1, sizeof(char));
  if (retVal == NULL) {
    printf("ERROR: Out of memeory!\n");
    exit(1);
  }
  strncpy(retVal, s, size);
  return retVal;
}


x86 assembly (clang, -O0):
<string_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11a0 <string_new+0x50>
lea    0xe6f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_new>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
mov    $0x1,%esi
call   1060 <calloc@plt>
test   %rax,%rax
je     118d <string_new+0x3d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe6c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ERROR: Out of memeory!\0A\00"
define i8* @string_new(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @calloc(i64 %8, i32 1)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = call i32 @strncpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
@str = [23 x i8] c"ERROR: Out of memeory!\00"
define i8* @string_new(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @calloc(i64 %3, i32 1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ reverseString(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char string[1024];
  scanf("%[^\n]s", string);
  if (string == NULL) {
    printf("\nERROR : Invalid input\n");
    return 1;
  }
  if (reverseString(string) == 0) {
    printf("\nconverted:%s\n", string);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x410(%rbp),%rdi
call   1050 <reverseString@plt>
cmp    $0x0,%rax
jne    118c <main+0x5c>
lea    -0x410(%rbp),%rsi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1193 <main+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xec1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <reverseString@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    116f <main+0x3f>
lea    0xea4(%rip),%rdi
xor    %ebx,%ebx
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [15 x i8] c"\0Aconverted:%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%6 = call i64 @reverseString(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %9)
store i32 0, i32* %1
br label %12
11: ; preds = %0
store i32 1, i32* %1
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [15 x i8] c"\0Aconverted:%s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @reverseString(i8* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ 0, %6 ], [ 1, %0 ]
ret i32 %9
}
/* Variables and functions */
int remote_chdir_aux(char *, int /*<<< orphan*/);
int remote_chdir(char *arg) { return remote_chdir_aux(arg, 0); }


x86 assembly (clang, -O0):
<remote_chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <remote_chdir_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_chdir>:
xor    %esi,%esi
jmp    1030 <remote_chdir_aux@plt>

LLVM IR (-O0):
define i32 @remote_chdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @remote_chdir_aux(i8* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @remote_chdir(i8* %0) {
%2 = tail call i32 @remote_chdir_aux(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char ch[] = "char";
  char *a = ch, *b = ch;
  int i = 10;
  printf("%d\n", a + i - b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xedd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0xa,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.ch = [5 x i8] c"char\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = bitcast [5 x i8]* %1 to i8*
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8* %6, i8** %2
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
store i8* %7, i8** %3
store i32 10, i32* %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M141_f(char *s) {
  debug("M141_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M141_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M141_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M141_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M141_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M141_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M141_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int bar(int, int);
int foo(int, int);
int main(int argc, char **argv) {
  int a = argc;
  a = foo(a, a);
  a = bar(a, a);
  a = foo(a, a);
  return ((a > 100) ? 0 : 1);
}


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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <bar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x64,%edx
cmovg  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%esi
call   1040 <foo@plt>
mov    %eax,%edi
mov    %eax,%esi
call   1030 <bar@plt>
mov    %eax,%edi
mov    %eax,%esi
call   1040 <foo@plt>
xor    %ecx,%ecx
cmp    $0x65,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @foo(i32 %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @bar(i32 %11, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = call i32 @foo(i32 %14, i32 %15)
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = icmp sgt i32 %17, 100
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 0, i32 1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0, i32 %0)
%4 = tail call i32 @bar(i32 %3, i32 %3)
%5 = tail call i32 @foo(i32 %4, i32 %4)
%6 = icmp slt i32 %5, 101
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char w[100];
  while (1) {
    scanf("%s", w);
    if (strcmp(w, "done") == 0) {
      break;
    }
  }
  printf(":-)\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    116e <main+0x3e>
jmp    1173 <main+0x43>
jmp    113f <main+0xf>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xec0(%rip),%r14
mov    %rsp,%rbx
lea    0xeb9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1150 <main+0x20>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"done\00"
@.str.2 = [5 x i8] c":-)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %10
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %11
10: ; preds = %3
br label %3
11: ; preds = %9
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"done\00"
@str = [4 x i8] c":-)\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}