xunge/DecIR huggingface dataset:
void free2DArray(int **arr, int n) {
  int i = 0;
  for (i = 0; i < n; i++) {
    free(arr[i]);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free2DArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <free2DArray+0x48>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <free2DArray+0x1d>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free2DArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free2DArray+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free2DArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free2DArray(i32** %0, i32 %1) {
%3 = alloca i32**
%4 = alloca i32
%5 = alloca i32
store i32** %0, i32*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32**, i32*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = bitcast i32* %15 to i8*
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = load i32**, i32*** %3
%22 = bitcast i32** %21 to i8*
ret void
}

LLVM IR (-O2):
define void @free2DArray(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
void *BG_TempAlloc(int);
void *B_TempAlloc(int size) { return BG_TempAlloc(size); }


x86 assembly (clang, -O0):
<B_TempAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BG_TempAlloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B_TempAlloc>:
jmp    1030 <BG_TempAlloc@plt>

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

LLVM IR (-O2):
define i8* @B_TempAlloc(i32 %0) {
%2 = tail call i8* @BG_TempAlloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void nomem() {
  (void)fprintf(stderr, "hexdump: %s.\n", strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<nomem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nomem>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"hexdump: %s.\0A\00"
@errno = global i32 0
define void @nomem() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = call i8* @strerror(i32 %2)
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"hexdump: %s.\0A\00"
@errno = global i32 0
define void @nomem() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgdefc(int c) { ngen("%s\t'%c'", ".byte", c); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s\09'%c'\00"
@.str.1 = [6 x i8] c".byte\00"
define void @cgdefc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s\09'%c'\00"
@.str.1 = [6 x i8] c".byte\00"
define void @cgdefc(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
void foo342(int p) {}


x86 assembly (clang, -O0):
<foo342>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo342(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @foo342(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_call_credentials_release() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_call_credentials_release>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_call_credentials_release>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_credentials_release() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_call_credentials_release() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ getNumbers(double *, double *);
double mult(double a, double b) {
  getNumbers(&a, &b);
  return (a * b);
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <getNumbers@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <getNumbers@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @mult(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @getNumbers(double* %3, double* %4)
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
define double @mult(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i32 @getNumbers(double* %3, double* %4)
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fmul double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int slen(char *);
int main(void) {
  char str[] = "abc";
  printf("str = %s,  length = %d\n", str, slen(str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <slen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x636261,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <slen@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"abc\00"
@.str = [24 x i8] c"str = %s, length = %d\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = call i32 @slen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"str = %s, length = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 @slen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret i32 0
}
void a_and(volatile void *p, int v) {
  __asm__("lock ; andl %1, %0" : "=m"(*(int *)p) : "r"(v) : "memory");
}


x86 assembly (clang, -O0):
<a_and>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
lock and %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_and>:
lock and %esi,(%rdi)
ret

LLVM IR (-O0):
define void @a_and(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @a_and(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
tail call void asm "lock ; andl $1, $0", "=*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OpenLRSStatusHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void OpenLRSStatusUpdated() { UAVObjUpdated(OpenLRSStatusHandle()); }


x86 assembly (clang, -O0):
<OpenLRSStatusUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OpenLRSStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenLRSStatusUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <OpenLRSStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @OpenLRSStatusUpdated() {
%1 = call i32 (...) @OpenLRSStatusHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpenLRSStatusUpdated() {
%1 = tail call i32 (...) @OpenLRSStatusHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
int open(const char *pathname, int flags, int mode) {
  int result;
  asm("movl $0x5, %%eax;"
      "int $0x80;"
      : "=a"(result)
      : "b"(pathname), "c"(flags), "d"(mode));
  return result;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rbx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
mov    $0x5,%eax
int    $0x80
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
mov    %esi,%ecx
mov    %rdi,%rbx
mov    $0x5,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 asm "movl $$0x5, %eax;int $$0x80;", "={ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @open(i8* readnone %0, i32 %1, i32 %2) {
%4 = tail call i32 asm "movl $$0x5, %eax;int $$0x80;", "={ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
void BN_mod_sub(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_sub() {
ret void
}
int aa_pro_ctr_a03(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a03>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a03 = [15 x i8] c"aa_pro_ctr_a03\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a03(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a03, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a03 = [15 x i8] c"aa_pro_ctr_a03\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a03(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a03, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
double sin(double);
int /*<<< orphan*/ track_stats(void *);
double sinsinx(double x, void *params) {
  track_stats(params);
  return sin(sin(x));
}


x86 assembly (clang, -O0):
<sinsinx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <track_stats@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <sin@plt>
call   1040 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinsinx>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <track_stats@plt>
movsd  (%rsp),%xmm0
call   1040 <sin@plt>
pop    %rax
jmp    1040 <sin@plt>

LLVM IR (-O0):
define double @sinsinx(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @track_stats(i8* %5)
%7 = load double, double* %3
%8 = call double @sin(double %7)
%9 = call double @sin(double %8)
ret double %9
}

LLVM IR (-O2):
define double @sinsinx(double %0, i8* %1) {
%3 = tail call i32 @track_stats(i8* %1)
%4 = tail call double @sin(double %0)
%5 = tail call double @sin(double %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
__attribute__((__noreturn__)) void exitfunc9(void) {
  printf("Executing exitfunc"
         "9"
         ".\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc9.\0A\00"
define void @exitfunc9() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc9.\00"
define void @exitfunc9() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pattern(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  pattern(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <pattern@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @pattern(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @pattern(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage_scan(void) {
  printf("Usage:\t%s scan [options] <path>\n\nDescription:\n\tDetermine the "
         "types of the data values in a newline-delimited JSON "
         "file.\n\nOptions:\n\t-l\t\tPrints type information for each "
         "line.\n\t-o <path>\tSaves output at the given path.\n",
         "corpus");
}


x86 assembly (clang, -O0):
<usage_scan>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xfb8(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage_scan>:
lea    0xee9(%rip),%rdi
lea    0xfbc(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [218 x i8] c"Usage:\09%s scan [options] <path>\0A\0ADescription:\0A\09Determine the types of the data values in a newline-delimited JSON file.\0A\0AOptions:\0A\09-l\09\09Prints type information for each line.\0A\09-o <path>\09Saves output at the given path.\0A\00"
@.str.1 = [7 x i8] c"corpus\00"
define void @usage_scan() {
%1 = call i32 @printf(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [218 x i8] c"Usage:\09%s scan [options] <path>\0A\0ADescription:\0A\09Determine the types of the data values in a newline-delimited JSON file.\0A\0AOptions:\0A\09-l\09\09Prints type information for each line.\0A\09-o <path>\09Saves output at the given path.\0A\00"
@.str.1 = [7 x i8] c"corpus\00"
define void @usage_scan() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([218 x i8], [218 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Aula de comentarios\n");
  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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [20 x i8] c"Aula de comentarios\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *malloc(int);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *strdup4(char *str) {
  char *dup;
  int len;
  len = (((strlen(str) + 1) / 4) * 4 + 4);
  if ((dup = malloc(len)) == NULL)
    return NULL;
  strncpy(dup, str, len);
  return dup;
}


x86 assembly (clang, -O0):
<strdup4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117c <strdup4+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    1194 <strdup4+0x64>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup4>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%eax
add    $0x4,%ebx
test   %eax,%eax
cmovns %eax,%ebx
and    $0xfffffffc,%ebx
add    $0x4,%ebx
mov    %ebx,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     116c <strdup4+0x3c>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup4(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 4
%10 = mul nsw i32 %9, 4
%11 = add nsw i32 %10, 4
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i8* @malloc(i32 %12)
store i8* %13, i8** %4
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %1
store i8* null, i8** %2
br label %22
16: ; preds = %1
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = call i32 @strncpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %4
store i8* %21, i8** %2
br label %22
22: ; preds = %16, %15
%23 = load i8*, i8** %2
ret i8* %23
}

LLVM IR (-O2):
define i8* @strdup4(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sdiv i32 %3, 4
%5 = shl nsw i32 %4, 2
%6 = add nsw i32 %5, 4
%7 = tail call i8* @malloc(i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = tail call i32 @strncpy(i8* %7, i8* %0, i32 %6)
br label %11
11: ; preds = %1, %9
ret i8* %7
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ *uc_link;
};
typedef TYPE_1__ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ setcontext(TYPE_1__ const *);
void ctx_done(ucontext_t *ucp) {
  if (ucp->uc_link == NULL)
    exit(0);
  else {
    setcontext((const ucontext_t *)ucp->uc_link);
    abort();
  }
}


x86 assembly (clang, -O0):
<ctx_done>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1151 <ctx_done+0x21>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <setcontext@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<ctx_done>:
push   %rax
mov    (%rdi),%rdi
test   %rdi,%rdi
jne    1140 <ctx_done+0x10>
xor    %edi,%edi
call   1050 <exit@plt>
call   1040 <setcontext@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32* }
define void @ctx_done(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %1
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32*, i32** %11
%13 = bitcast i32* %12 to %struct.TYPE_4__*
%14 = call i32 @setcontext(%struct.TYPE_4__* %13)
%15 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32* }
define void @ctx_done(%struct.TYPE_4__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
%8 = bitcast i32* %3 to %struct.TYPE_4__*
%9 = tail call i32 @setcontext(%struct.TYPE_4__* %8)
%10 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ LSR16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Direct(int);
void Op46M0(void) { LSR16(SA1Direct(3), 0xFFFF); }


x86 assembly (clang, -O0):
<Op46M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
call   1040 <LSR16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op46M0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
mov    $0xffff,%esi
pop    %rax
jmp    1040 <LSR16@plt>

LLVM IR (-O0):
define void @Op46M0() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @LSR16(i32 %1, i32 65535)
ret void
}

LLVM IR (-O2):
define void @Op46M0() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @LSR16(i32 %1, i32 65535)
ret void
}
unsigned secure_api_call(unsigned service_id, unsigned arg0, unsigned arg1,
                         unsigned arg2, unsigned arg3) {
  return 0;
}


x86 assembly (clang, -O0):
<secure_api_call>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @secure_api_call(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @secure_api_call(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int strlen(char *);
int main(void) {
  char nomeString[] = "nomedoarquivo.txt";
  nomeString[strlen(nomeString) - 4] = '\0';
  printf("%s", nomeString);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x4,%eax
cltq
movb   $0x0,-0x20(%rbp,%rax,1)
lea    -0x20(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x74,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x4(%rax,%rbx,1)
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.nomeString = [18 x i8] c"nomedoarquivo.txt\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = bitcast [18 x i8]* %1 to i8*
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = sub nsw i32 %4, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 %6
store i8 0, i8* %7
%8 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nomeString = [18 x i8] c"nomedoarquivo.txt\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -4
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 %5
store i8 0, i8* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int test3(int a) { return 1 - a != a; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
sub    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
add    %edi,%edi
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 1, %3
%5 = load i32, i32* %2
%6 = icmp ne i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = sub nsw i32 1, %0
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int subdir();
int main(void) { return subdir(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @subdir()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @subdir()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ShowUsage(void) {
  printf("Usage: txt2bin in_file out_file\n");
  return;
}


x86 assembly (clang, -O0):
<ShowUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowUsage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: txt2bin in_file out_file\0A\00"
define void @ShowUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"Usage: txt2bin in_file out_file\00"
define void @ShowUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
uint8_t charNibbleToUInt(char hexch) {
  hexch -= '0';
  if (hexch > 9) {
    hexch -= 7;
  }
  assert(hexch >= 0 && hexch <= 15);
  return hexch;
}


x86 assembly (clang, -O0):
<charNibbleToUInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
jle    113f <charNibbleToUInt+0x2f>
movsbl -0x1(%rbp),%eax
sub    $0x7,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
jl     115e <charNibbleToUInt+0x4e>
movsbl -0x1(%rbp),%eax
cmp    $0xf,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charNibbleToUInt>:
push   %rbx
lea    -0x30(%rdi),%eax
add    $0xc9,%dil
cmp    $0xa,%al
movzbl %dil,%ecx
movzbl %al,%ebx
cmovge %ecx,%ebx
xor    %edi,%edi
cmp    $0x10,%bl
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @charNibbleToUInt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sgt i32 %8, 9
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 7
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %1
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 15
br label %23
23: ; preds = %19, %15
%24 = phi i1 [ false, %15 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load i8, i8* %2
ret i8 %27
}

LLVM IR (-O2):
define signext i8 @charNibbleToUInt(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp sgt i8 %2, 9
%4 = add i8 %0, -55
%5 = select i1 %3, i8 %4, i8 %2
%6 = icmp ult i8 %5, 16
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i8 %5
}
int isspace(int c) {
  return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 12
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 9
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
char *toLowerCase(char *str) {
  char *head = str;
  while (*str != '\0') {
    if (*str >= 'A' && *str < 'a') {
      *str += 'a' - 'A';
    }
    str++;
  }
  return head;
}


x86 assembly (clang, -O0):
<toLowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <toLowerCase+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <toLowerCase+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jge    114c <toLowerCase+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <toLowerCase+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLowerCase>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <toLowerCase+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <toLowerCase+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <toLowerCase+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x1f,%sil
ja     1110 <toLowerCase+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <toLowerCase+0x10>
ret

LLVM IR (-O0):
define i8* @toLowerCase(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %18, 97
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %2
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %2
br label %5
29: ; preds = %5
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
define i8* @toLowerCase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 32
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
void psmouse_smbus_cleanup(struct psmouse *psmouse) {}


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

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

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

LLVM IR (-O2):
%struct.psmouse = type opaque
define void @psmouse_smbus_cleanup(%struct.psmouse* nocapture %0) {
ret void
}
/* Variables and functions */
int msg_byte();
int /*<<< orphan*/ msg_open(int);
int /*<<< orphan*/ trm_chr(int);
void print(int msg) {
  int ch;
  msg_open(msg);
  while (ch = msg_byte())
    trm_chr(ch);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <msg_open@plt>
mov    $0x0,%al
call   1040 <msg_byte@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1163 <print+0x33>
mov    -0x8(%rbp),%edi
call   1050 <trm_chr@plt>
jmp    1143 <print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
call   1030 <msg_open@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <msg_byte@plt>
test   %eax,%eax
je     1154 <print+0x24>
mov    %eax,%edi
call   1050 <trm_chr@plt>
jmp    1140 <print+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @print(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @msg_open(i32 %4)
br label %6
6: ; preds = %9, %1
%7 = call i32 (...) @msg_byte()
store i32 %7, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 @trm_chr(i32 %10)
br label %6
12: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print(i32 %0) {
%2 = tail call i32 @msg_open(i32 %0)
%3 = tail call i32 (...) @msg_byte()
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %8, %5 ], [ %3, %1 ]
%7 = tail call i32 @trm_chr(i32 %6)
%8 = tail call i32 (...) @msg_byte()
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
ret void
}
int GPIOValid(int pin) { return 1; }


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

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

LLVM IR (-O0):
define i32 @GPIOValid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 1
}

LLVM IR (-O2):
define i32 @GPIOValid(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int /*<<< orphan*/ posix_memalign(void **, int, int /*<<< orphan*/);
int /*<<< orphan*/ spm_internal_malloc(int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
uint64_t spm_malloc(uint64_t bytes, uint64_t spm_n) {
  void *p = (void *)malloc(bytes);
  posix_memalign(&p, 4096, bytes);
  spm_internal_malloc((uint64_t)p, bytes, spm_n);
  return (uint64_t)p;
}


x86 assembly (clang, -O0):
<spm_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
mov    $0x1000,%esi
call   1050 <posix_memalign@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <spm_internal_malloc@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spm_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x1000,%esi
mov    %ebp,%edx
call   1050 <posix_memalign@plt>
mov    (%rsp),%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <spm_internal_malloc@plt>
mov    (%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @spm_malloc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i32, i32* %3
%10 = call i32 @posix_memalign(i8** %5, i32 4096, i32 %9)
%11 = load i8*, i8** %5
%12 = ptrtoint i8* %11 to i32
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @spm_internal_malloc(i32 %12, i32 %13, i32 %14)
%16 = load i8*, i8** %5
%17 = ptrtoint i8* %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @spm_malloc(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i64 @malloc(i32 %0)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = call i32 @posix_memalign(i8** %3, i32 4096, i32 %0)
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %8 to i64
%10 = trunc i64 %9 to i32
%11 = call i32 @spm_internal_malloc(i32 %10, i32 %0, i32 %1)
%12 = load i8*, i8** %3
%13 = ptrtoint i8* %12 to i64
%14 = trunc i64 %13 to i32
ret i32 %14
}
/* Variables and functions */
int PAPI_flops(float *, float *, long long *, float *);
void papif_flops__(float *real_time, float *proc_time, long long *flpops,
                   float *mflops, int *check) {
  *check = PAPI_flops(real_time, proc_time, flpops, mflops);
}


x86 assembly (clang, -O0):
<papif_flops__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_flops@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_flops__>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_flops@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_flops__(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_flops(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_flops__(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_flops(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xunmap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xunmap_type(void *_p) {
  return (int)((XEvent *)_p)->xunmap.type;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xunmap_type>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xunmap_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xunmap_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void foo(int a[]) { a[2] = 123; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x7b,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x7b,0x8(%rdi)
ret

LLVM IR (-O0):
define void @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
store i32 123, i32* %4
ret void
}

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
store i32 123, i32* %2
ret void
}
/* Type definitions */
struct ibv_mr {
  int dummy;
};

/* Variables and functions */
int ibv_dereg_mr(struct ibv_mr *);
int mlx4_glue_dereg_mr(struct ibv_mr *mr) { return ibv_dereg_mr(mr); }


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

x86 assembly (clang, -O2):
<mlx4_glue_dereg_mr>:
jmp    1030 <ibv_dereg_mr@plt>

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

LLVM IR (-O2):
%struct.ibv_mr = type { i32 }
define i32 @mlx4_glue_dereg_mr(%struct.ibv_mr* %0) {
%2 = tail call i32 @ibv_dereg_mr(%struct.ibv_mr* %0)
ret i32 %2
}