xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char *, long *);
long atol(const char *nptr) {
  long n = 0;
  sscanf(nptr, "%ld", &n);
  return n;
}


x86 assembly (clang, -O0):
<atol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sscanf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atol>:
push   %rax
movq   $0x0,(%rsp)
lea    0xee0(%rip),%rsi
mov    %rsp,%rdx
call   1030 <sscanf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i64 @atol(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = load i64, i64* %2
ret i64 %5
}
int vib_phase_to_inc_ptr(int phase) {
  if (phase < 32 / 2)
    return 32 / 2 - 1 - phase;
  else if (phase >= 3 * 32 / 2)
    return 5 * 32 / 2 - 1 - phase;
  else
    return phase - 32 / 2;
}


x86 assembly (clang, -O0):
<vib_phase_to_inc_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1121 <vib_phase_to_inc_ptr+0x21>
mov    $0xf,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <vib_phase_to_inc_ptr+0x44>
cmpl   $0x30,-0x8(%rbp)
jl     113b <vib_phase_to_inc_ptr+0x3b>
mov    $0x4f,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <vib_phase_to_inc_ptr+0x44>
mov    -0x8(%rbp),%eax
sub    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vib_phase_to_inc_ptr>:
cmp    $0xf,%edi
jg     110d <vib_phase_to_inc_ptr+0xd>
mov    $0xf,%eax
sub    %edi,%eax
ret
cmp    $0x30,%edi
jb     111a <vib_phase_to_inc_ptr+0x1a>
mov    $0x4f,%eax
sub    %edi,%eax
ret
add    $0xfffffff0,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @vib_phase_to_inc_ptr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 16
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 15, %7
store i32 %8, i32* %2
br label %18
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %3
%14 = sub nsw i32 79, %13
store i32 %14, i32* %2
br label %18
15: ; preds = %9
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 16
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %12, %6
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @vib_phase_to_inc_ptr(i32 %0) {
%2 = icmp slt i32 %0, 16
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = sub nsw i32 15, %0
br label %11
5: ; preds = %1
%6 = icmp ugt i32 %0, 47
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = sub nsw i32 79, %0
br label %11
9: ; preds = %5
%10 = add nsw i32 %0, -16
br label %11
11: ; preds = %9, %7, %3
%12 = phi i32 [ %4, %3 ], [ %8, %7 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
unsigned Test0(void) {
  printf("Test 0\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Test 0\0A\00"
define i32 @Test0() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Test 0\00"
define i32 @Test0() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int *p_global = malloc(4);
  *p_global = 100;
  int *p_local = malloc(4);
  int *p_ptr_to_global = p_global;
  p_global = p_local;
  free(p_local);
  int use_after_free = *p_global;
  printf("Hi mom: %d\n", use_after_free);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x64,(%rax)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
mov    (%rbx),%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hi mom: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = call i32* @malloc(i32 4)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
store i32 100, i32* %10
%11 = call i32* @malloc(i32 4)
store i32* %11, i32** %6
%12 = load i32*, i32** %5
store i32* %12, i32** %7
%13 = load i32*, i32** %6
store i32* %13, i32** %5
%14 = load i32*, i32** %6
%15 = call i32 @free(i32* %14)
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hi mom: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @malloc(i32 4)
%4 = tail call i32* @malloc(i32 4)
%5 = tail call i32 @free(i32* %4)
%6 = load i32, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
int /*<<< orphan*/ strptime(char *, char const *, struct tm *);
time_t cvtStr2Time_t(char *date) {
  static const char *fmt = "%Y-%m-%d %H:%M";
  static struct tm tmp;
  strptime(date, fmt, &tmp);
  tmp.tm_isdst = -1;
  time_t t = mktime(&tmp);
  return t;
}


x86 assembly (clang, -O0):
<cvtStr2Time_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ef9(%rip),%rsi
lea    0x2efe(%rip),%rdx
call   1040 <strptime@plt>
movl   $0xffffffff,0x2eef(%rip)
ff ff ff
lea    0x2ee8(%rip),%rdi
call   1030 <mktime@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvtStr2Time_t>:
push   %rbx
lea    0xed8(%rip),%rsi
lea    0x2f05(%rip),%rbx
mov    %rbx,%rdx
call   1040 <strptime@plt>
movl   $0xffffffff,0x2ef3(%rip)
ff ff ff
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <mktime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@cvtStr2Time_t.fmt = internal global i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i32 0, i32 0)
@.str = [15 x i8] c"%Y-%m-%d %H:%M\00"
@cvtStr2Time_t.tmp = internal global %struct.tm zeroinitializer
define i32 @cvtStr2Time_t(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** @cvtStr2Time_t.fmt
%6 = call i32 @strptime(i8* %4, i8* %5, %struct.tm* @cvtStr2Time_t.tmp)
store i32 -1, i32* getelementptr inbounds (%struct.tm, %struct.tm* @cvtStr2Time_t.tmp, i32 0, i32 0)
%7 = call i32 @mktime(%struct.tm* @cvtStr2Time_t.tmp)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [15 x i8] c"%Y-%m-%d %H:%M\00"
@cvtStr2Time_t.tmp = internal global %struct.tm zeroinitializer
define i32 @cvtStr2Time_t(i8* %0) {
%2 = tail call i32 @strptime(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), %struct.tm* @cvtStr2Time_t.tmp)
store i32 -1, i32* getelementptr inbounds (%struct.tm, %struct.tm* @cvtStr2Time_t.tmp, i64 0, i32 0)
%3 = tail call i32 @mktime(%struct.tm* @cvtStr2Time_t.tmp)
ret i32 %3
}
void Tokenizer_destruct(struct Tokenizer *self) {}


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

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

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

LLVM IR (-O2):
%struct.Tokenizer = type opaque
define void @Tokenizer_destruct(%struct.Tokenizer* nocapture %0) {
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
scalar_t__ getrlimit(int, struct rlimit *);
int /*<<< orphan*/ shutdown(int, char *, int);
void getr(int type, struct rlimit *rlim) {
  if (getrlimit(type, rlim))
    shutdown(6, "getrlimit()", 140 - 1);
}


x86 assembly (clang, -O0):
<getr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <getrlimit@plt>
cmp    $0x0,%rax
je     115b <getr+0x3b>
mov    $0x6,%edi
lea    0xeaf(%rip),%rsi
mov    $0x8b,%edx
call   1030 <shutdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getr>:
push   %rax
call   1040 <getrlimit@plt>
test   %rax,%rax
je     1142 <getr+0x22>
lea    0xece(%rip),%rsi
mov    $0x6,%edi
mov    $0x8b,%edx
pop    %rax
jmp    1030 <shutdown@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"getrlimit()\00"
define void @getr(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* %3
%6 = load %struct.rlimit*, %struct.rlimit** %4
%7 = call i64 @getrlimit(i32 %5, %struct.rlimit* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @shutdown(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 139)
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@.str = [12 x i8] c"getrlimit()\00"
define void @getr(i32 %0, %struct.rlimit* %1) {
%3 = tail call i64 @getrlimit(i32 %0, %struct.rlimit* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @shutdown(i32 6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 139)
br label %7
7: ; preds = %5, %2
ret void
}
int mod(int n) { return n < 0 ? -n : n; }


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <mod+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <mod+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @mod(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @mod(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void uninitvar_fclose(void) {
  FILE *fp;
  fclose(fp);
}


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

x86 assembly (clang, -O2):
<uninitvar_fclose>:
jmp    1030 <fclose@plt>

LLVM IR (-O0):
define void @uninitvar_fclose() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @fclose(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fclose() {
%1 = tail call i32 @fclose(i32* undef)
ret void
}
/* Variables and functions */
int hideme(int);
int rand();
int main(int argc, char **argv) {
  int r = rand();
  int s = hideme(r);
  return (r >= s);
}


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    $0x0,%al
call   1040 <rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <hideme@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rand@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <hideme@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setge  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @rand()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @hideme(i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp sge i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rand()
%4 = tail call i32 @hideme(i32 %3)
%5 = icmp sge i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int test_imm_4Buint16_mem(unsigned short *val) {
  return ((*val) & (-0x4B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffb5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Buint16_mem>:
movzwl (%rdi),%eax
test   $0xffb5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Buint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -75
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_4Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -75
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void SecureLock(pthread_mutex_t *mutex) {
  int rc = pthread_mutex_lock(mutex);
  if (rc) {
    fprintf(stderr, "Failed to acquire mutex lock\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<SecureLock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1171 <SecureLock+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SecureLock>:
push   %rax
call   1050 <pthread_mutex_lock@plt>
test   %eax,%eax
jne    113c <SecureLock+0xc>
pop    %rax
ret
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Failed to acquire mutex lock\0A\00"
define void @SecureLock(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_lock(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Failed to acquire mutex lock\0A\00"
define void @SecureLock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
int PrimitiveVariables() {
  int var = 1L;
  return var;
}


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

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

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

LLVM IR (-O2):
define i32 @PrimitiveVariables() {
ret i32 1
}
int __ispow2(int a) {
  for (; a % 2 != 1; a = a >> 1)
    ;
  return (a > 1 ? 0 : 1);
}


x86 assembly (clang, -O0):
<__ispow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
je     112e <__ispow2+0x2e>
jmp    1120 <__ispow2+0x20>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <__ispow2+0x7>
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ispow2>:
mov    %edi,%ecx
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
mov    %edi,%edx
sub    %eax,%edx
sar    %edi
cmp    $0x1,%edx
jne    1100 <__ispow2>
xor    %eax,%eax
cmp    $0x2,%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @__ispow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = load i32, i32* %2
%13 = icmp sgt i32 %12, 1
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @__ispow2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = srem i32 %3, 2
%5 = icmp eq i32 %4, 1
%6 = ashr i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = icmp slt i32 %3, 2
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  printf("after exec pid=%d\n", getpid());
  sleep(5);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
call   1060 <sleep@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"after exec pid=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @sleep(i32 5)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"after exec pid=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 5)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int strlen(char *);
void init_unknown(char word[], char unknown[]) {
  int i;
  int length = strlen(word);
  for (i = 0; i < length; ++i) {
    unknown[i] = '-';
  }
  unknown[i] = '\0';
}


x86 assembly (clang, -O0):
<init_unknown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1159 <init_unknown+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x2d,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <init_unknown+0x23>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_unknown>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1144 <init_unknown+0x24>
mov    %eax,%ebx
mov    %r14,%rdi
mov    $0x2d,%esi
mov    %rbx,%rdx
call   1040 <memset@plt>
jmp    1146 <init_unknown+0x26>
xor    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @init_unknown(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = zext i32 %3 to i64
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %5, %2
%9 = phi i64 [ 0, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 0, i8* %10
ret void
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int f_white() { return fputs("[37m", stdout); }


x86 assembly (clang, -O0):
<f_white>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_white>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[37m\00"
@stdout = global i32 0
define i32 @f_white() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[37m\00"
@stdout = global i32 0
define i32 @f_white() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
int compseq(char s[]) {
  int i = 0;
  char *p = s;
  while (*p != '\0') {
    i++;
    p++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<compseq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <compseq+0x41>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <compseq+0x17>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compseq(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
br label %6
16: ; preds = %6
ret i32 1
}

LLVM IR (-O2):
define i32 @compseq(i8* nocapture %0) {
ret i32 1
}
double MItoCM(double MI) { return MI * 160934.4; }


x86 assembly (clang, -O0):
<MItoCM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MItoCM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MItoCM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x4103A53333333333
ret double %4
}

LLVM IR (-O2):
define double @MItoCM(double %0) {
%2 = fmul double %0, 0x4103A53333333333
ret double %2
}
long double simZ(long double v[]) {
  const long double b = 8.0 / 3.0;
  return v[0] * v[1] - b * v[2];
}


x86 assembly (clang, -O0):
<simZ>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
fldl   0xef2(%rip)
fld    %st(0)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fldt   0x20(%rax)
fmulp  %st,%st(3)
fmulp  %st,%st(1)
fsubp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simZ>:
fldt   (%rdi)
fldt   0x10(%rdi)
fmulp  %st,%st(1)
fldt   0x20(%rdi)
fmull  0xef0(%rip)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @simZ(x86_fp80* %0) {
%2 = alloca x86_fp80*
%3 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %2
store x86_fp80 0xK4000AAAAAAAAAAAAA800, x86_fp80* %3
%4 = load x86_fp80*, x86_fp80** %2
%5 = getelementptr inbounds x86_fp80, x86_fp80* %4, i64 0
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80*, x86_fp80** %2
%8 = getelementptr inbounds x86_fp80, x86_fp80* %7, i64 1
%9 = load x86_fp80, x86_fp80* %8
%10 = load x86_fp80*, x86_fp80** %2
%11 = getelementptr inbounds x86_fp80, x86_fp80* %10, i64 2
%12 = load x86_fp80, x86_fp80* %11
%13 = fmul x86_fp80 0xK4000AAAAAAAAAAAAA800, %12
%14 = fneg x86_fp80 %13
%15 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %6, x86_fp80 %9, x86_fp80 %14)
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @simZ(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 1
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds x86_fp80, x86_fp80* %0, i64 2
%6 = load x86_fp80, x86_fp80* %5
%7 = fmul x86_fp80 %6, 0xKC000AAAAAAAAAAAAA800
%8 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %2, x86_fp80 %4, x86_fp80 %7)
ret x86_fp80 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _aligned_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<_aligned_free>:
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):
<_aligned_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @_aligned_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
void gei_nbpath_format(char *path, const char *repo_path,
                       const char *notebook) {
  snprintf(path, 1023 - 1, "%s/%s", repo_path,
           (notebook ? notebook : "CURRENT"));
}


x86 assembly (clang, -O0):
<gei_nbpath_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114c <gei_nbpath_format+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <gei_nbpath_format+0x4c>
lea    0xeb3(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    115c <gei_nbpath_format+0x4c>
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%r8
mov    $0x3fe,%esi
lea    0xe8c(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gei_nbpath_format>:
mov    %rsi,%rcx
test   %rdx,%rdx
lea    0xee9(%rip),%r8
cmovne %rdx,%r8
lea    0xed8(%rip),%rdx
mov    $0x3fe,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [8 x i8] c"CURRENT\00"
define void @gei_nbpath_format(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i8*, i8** %6
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %11
%15 = phi i8* [ %12, %11 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %13 ]
%16 = call i32 @snprintf(i8* %7, i32 1022, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [8 x i8] c"CURRENT\00"
define void @gei_nbpath_format(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %2, null
%5 = select i1 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2
%6 = tail call i32 @snprintf(i8* %0, i32 1022, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %5)
ret void
}
float *mat3_zero(float *result) {
  result[0] = 0.0f;
  result[1] = 0.0f;
  result[2] = 0.0f;
  result[3] = 0.0f;
  result[4] = 0.0f;
  result[5] = 0.0f;
  result[6] = 0.0f;
  result[7] = 0.0f;
  result[8] = 0.0f;
  return result;
}


x86 assembly (clang, -O0):
<mat3_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0xc(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x10(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x18(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x1c(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x20(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat3_zero>:
mov    %rdi,%rax
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
define float* @mat3_zero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 0.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 4
store float 0.000000e+00, float* %12
%13 = load float*, float** %2
%14 = getelementptr inbounds float, float* %13, i64 5
store float 0.000000e+00, float* %14
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 6
store float 0.000000e+00, float* %16
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 7
store float 0.000000e+00, float* %18
%19 = load float*, float** %2
%20 = getelementptr inbounds float, float* %19, i64 8
store float 0.000000e+00, float* %20
%21 = load float*, float** %2
ret float* %21
}

LLVM IR (-O2):
define float* @mat3_zero(float* returned writeonly %0) {
%2 = bitcast float* %0 to i8*
ret float* %0
}
/* Variables and functions */
int logic();
int /*<<< orphan*/ printf(char *, int);
void test() { printf("%d\n", logic()); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <logic@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %eax,%eax
call   1040 <logic@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @test() {
%1 = call i32 (...) @logic()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test() {
%1 = tail call i32 (...) @logic()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void errmsg(char *msg) { fprintf(stderr, "ssl: %s\n", msg); }


x86 assembly (clang, -O0):
<errmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errmsg>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"ssl: %s\0A\00"
define void @errmsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"ssl: %s\0A\00"
define void @errmsg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ata_acpi_push_id(struct ata_port *ap, unsigned int ix) { return 0; }


x86 assembly (clang, -O0):
<ata_acpi_push_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ata_port = type opaque
define i32 @ata_acpi_push_id(%struct.ata_port* %0, i32 %1) {
%3 = alloca %struct.ata_port*
%4 = alloca i32
store %struct.ata_port* %0, %struct.ata_port** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.ata_port = type opaque
define i32 @ata_acpi_push_id(%struct.ata_port* nocapture readnone %0, i32 %1) {
ret i32 0
}
extern void pinio_nvram_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @pinio_nvram_unlock() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ __set_BASEPRI_nb(int /*<<< orphan*/);
void __basepriRestore(uint8_t *val) { __set_BASEPRI_nb(*val); }


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

x86 assembly (clang, -O2):
<__basepriRestore>:
mov    (%rdi),%edi
jmp    1030 <__set_BASEPRI_nb@plt>

LLVM IR (-O0):
define void @__basepriRestore(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @__set_BASEPRI_nb(i32 %4)
ret void
}

LLVM IR (-O2):
define void @__basepriRestore(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @__set_BASEPRI_nb(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ StubBug(char *);
int sigfillset(sigset_t *set) {
  (void)set;
  StubBug("STUB:"
          "sigfillset");
  return 0;
}


x86 assembly (clang, -O0):
<sigfillset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <StubBug@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"STUB:sigfillset\00"
define i32 @sigfillset(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @StubBug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"STUB:sigfillset\00"
define i32 @sigfillset(i32* nocapture readnone %0) {
%2 = tail call i32 @StubBug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void tv8532_stop0(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @tv8532_stop0(%struct.usb_spca50x* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ messErr(int);
void dev_read(int did, int sid, int cid) { messErr(17); }


x86 assembly (clang, -O0):
<dev_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x11,%edi
call   1030 <messErr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_read>:
mov    $0x11,%edi
jmp    1030 <messErr@plt>

LLVM IR (-O0):
define void @dev_read(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @messErr(i32 17)
ret void
}

LLVM IR (-O2):
define void @dev_read(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @messErr(i32 17)
ret void
}
void tegra_fb_remove_sysfs(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @tegra_fb_remove_sysfs(%struct.device* nocapture %0) {
ret void
}
unsigned round_to_power_of_two(unsigned value) {
  unsigned n;
  for (n = 1; n < value; n <<= 1)
    ;
  return n;
}


x86 assembly (clang, -O0):
<round_to_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112d <round_to_power_of_two+0x2d>
jmp    111f <round_to_power_of_two+0x1f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <round_to_power_of_two+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_power_of_two>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <round_to_power_of_two+0x10>
ret

LLVM IR (-O0):
define i32 @round_to_power_of_two(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = shl i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @round_to_power_of_two(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}
/* Type definitions */
struct rlimit {
  unsigned long long rlim_cur;
  unsigned long long rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ setrlimit(int, struct rlimit *);
void set_limits(char *name, int resource, unsigned long long int lim) {
  struct rlimit limit;
  limit.rlim_cur = lim;
  limit.rlim_max = lim;
  setrlimit(resource, &limit);
}


x86 assembly (clang, -O0):
<set_limits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   1030 <setrlimit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_limits>:
sub    $0x18,%rsp
mov    %esi,%edi
mov    %rdx,0x8(%rsp)
mov    %rdx,0x10(%rsp)
lea    0x8(%rsp),%rsi
call   1030 <setrlimit@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.rlimit = type { i64, i64 }
define void @set_limits(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca %struct.rlimit
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %7, i32 0, i32 0
store i64 %8, i64* %9
%10 = load i64, i64* %6
%11 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %7, i32 0, i32 1
store i64 %10, i64* %11
%12 = load i32, i32* %5
%13 = call i32 @setrlimit(i32 %12, %struct.rlimit* %7)
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i64, i64 }
define void @set_limits(i8* nocapture readnone %0, i32 %1, i64 %2) {
%4 = alloca %struct.rlimit
%5 = bitcast %struct.rlimit* %4 to i8*
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %4, i64 0, i32 0
store i64 %2, i64* %6
%7 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %4, i64 0, i32 1
store i64 %2, i64* %7
%8 = call i32 @setrlimit(i32 %1, %struct.rlimit* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ int_size_is_32();
int /*<<< orphan*/ int_size_is_32_for_16bit();
int main(int argc, char *argv[]) {
  assert(int_size_is_32());
  assert(int_size_is_32_for_16bit());
  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)
mov    $0x0,%al
call   1040 <int_size_is_32@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <int_size_is_32_for_16bit@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <int_size_is_32@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1030 <int_size_is_32_for_16bit@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
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 = call i32 (...) @int_size_is_32()
%7 = call i32 @assert(i32 %6)
%8 = call i32 (...) @int_size_is_32_for_16bit()
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @int_size_is_32()
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @int_size_is_32_for_16bit()
%6 = tail call i32 @assert(i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int EVP_MD_CTX_copy_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ const *);
int /*<<< orphan*/ EVP_MD_CTX_init(int /*<<< orphan*/ *);
int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) {
  EVP_MD_CTX_init(out);
  return EVP_MD_CTX_copy_ex(out, in);
}


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

x86 assembly (clang, -O2):
<EVP_MD_CTX_copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <EVP_MD_CTX_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <EVP_MD_CTX_copy_ex@plt>

LLVM IR (-O0):
define i32 @EVP_MD_CTX_copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = call i32 @EVP_MD_CTX_init(i32* %5)
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @EVP_MD_CTX_copy_ex(i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @EVP_MD_CTX_copy(i32* %0, i32* %1) {
%3 = tail call i32 @EVP_MD_CTX_init(i32* %0)
%4 = tail call i32 @EVP_MD_CTX_copy_ex(i32* %0, i32* %1)
ret i32 %4
}
void *emalloc(size)
int size;
{
  char *p;
  if (!(p = malloc(size)))
    err_nomsg(1);
  memset(p, 0, size);
  return (p);
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115e <emalloc+0x2e>
mov    $0x1,%edi
mov    $0x0,%al
call   1050 <err_nomsg@plt>
mov    -0x10(%rbp),%rdi
movslq -0x4(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
movslq %edi,%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1142 <emalloc+0x22>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <err_nomsg@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (i32, ...) bitcast (i32 (...)* @err_nomsg to i32 (i32, ...)*)(i32 1)
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @emalloc(i32 %0) {
%2 = sext i32 %0 to i64
%3 = call i8* @calloc(i64 1, i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @err_nomsg to i32 (i32, ...)*)(i32 1)
br label %7
7: ; preds = %5, %1
ret i8* %3
}