xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  const int outra_coisa = 78;
  int unsigned idade_minima_votar = 16, outra = 16;
  int var = 0;
  double aceleracao = 9.6;
  float outra_float = 8.7f;
  char letras = 'a';
  scanf("%d", &var);
  printf("EMB5603\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4e,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
movl   $0x10,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  0xeb5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movb   $0x61,-0x25(%rbp)
lea    0xea0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [9 x i8] c"EMB5603\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca float
%8 = alloca i8
store i32 0, i32* %1
store i32 78, i32* %2
store i32 16, i32* %3
store i32 16, i32* %4
store i32 0, i32* %5
store double 0x4023333333333333, double* %6
store float 0x4021666660000000, float* %7
store i8 97, i8* %8
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [8 x i8] c"EMB5603\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int main() {
  char foo[10];
  char bar[10];
  bar[4] = 'k';
  memcpy(foo, bar, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x6b,-0x14(%rbp)
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x6b,0x8(%rsp)
lea    0xe(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0xa,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 4
store i8 107, i8* %4
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 4
store i8 107, i8* %5
%6 = call i32 @memcpy(i8* %3, i8* %4, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int /*<<< orphan*/, int, int);
void C67_SPDP(int r, int v) { C67_asm("SPDP.L", 0, r, v); }


x86 assembly (clang, -O0):
<C67_SPDP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_SPDP>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
xor    %esi,%esi
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"SPDP.L\00"
define void @C67_SPDP(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 = load i32, i32* %4
%7 = call i32 @C67_asm(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"SPDP.L\00"
define void @C67_SPDP(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32 %0, i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y_root;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
void set_XMotionEvent_y_root(void *_p, int _v) {
  ((XMotionEvent *)_p)->y_root = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XMotionEvent_y_root>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XMotionEvent_y_root(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XMotionEvent_y_root(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void test1(int *q, int *p) { int v = 10; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1(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 10, i32* %5
ret void
}

LLVM IR (-O2):
define void @test1(i32* nocapture %0, i32* nocapture %1) {
ret void
}
int socket4_sendto_list_remove(char *ip) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @socket4_sendto_list_remove(i8* nocapture readnone %0) {
ret i32 0
}
void gdk_selection_convert() {}


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

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

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

LLVM IR (-O2):
define void @gdk_selection_convert() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cs2thv(int);
void cs2thv_(int *enabledisable) { cs2thv(*enabledisable); }


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

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

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

LLVM IR (-O2):
define void @cs2thv_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @cs2thv(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello! World.\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%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 = [15 x i8] c"Hello! World.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello! World.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void PR7527(int *p) {
  if (((int)p) & 1)
    return;
}


x86 assembly (clang, -O0):
<PR7527>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1,%eax
cmp    $0x0,%eax
je     111d <PR7527+0x1d>
jmp    111d <PR7527+0x1d>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @PR7527(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i32
%5 = and i32 %4, 1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @PR7527(i32* nocapture %0) {
ret void
}
int set_sta_disallow_tkip(int radio, int disallow) { return 0; }


x86 assembly (clang, -O0):
<set_sta_disallow_tkip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set_sta_disallow_tkip(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ reg(void *, size_t, char const *, int);
void *ml_calloc(size_t n, size_t size, const char *file, int line) {
  void *ptr = calloc(n, size);
  reg(ptr, size * n, file, line);
  return ptr;
}


x86 assembly (clang, -O0):
<ml_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <reg@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_calloc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <calloc@plt>
mov    %rax,%r12
imul   %rbx,%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <reg@plt>
mov    %r12,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ml_calloc(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = call i8* @calloc(i64 %10, i64 %11)
store i8* %12, i8** %9
%13 = load i8*, i8** %9
%14 = load i64, i64* %6
%15 = load i64, i64* %5
%16 = mul i64 %14, %15
%17 = load i8*, i8** %7
%18 = load i32, i32* %8
%19 = call i32 @reg(i8* %13, i64 %16, i8* %17, i32 %18)
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
define i8* @ml_calloc(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i8* @calloc(i64 %0, i64 %1)
%6 = mul i64 %1, %0
%7 = tail call i32 @reg(i8* %5, i64 %6, i8* %2, i32 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ greet(int);
int main(int argc, char **argv) {
  greet(5);
  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    $0x5,%edi
call   1030 <greet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <greet@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 @greet(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @greet(i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned long long);
char *subst(char *, char const *, char *);
char *substull(char *tgt, const char *oldstr, unsigned long long ull) {
  char buf[21];
  snprintf(buf, sizeof buf, "%llu", ull);
  return subst(tgt, oldstr, buf);
}


x86 assembly (clang, -O0):
<substull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x15,%esi
lea    0xeb8(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <subst@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substull>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rcx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec7(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x15,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <subst@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i8* @substull(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [21 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %6
%10 = call i32 @snprintf(i8* %8, i32 21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds [21 x i8], [21 x i8]* %7, i64 0, i64 0
%14 = call i8* @subst(i8* %11, i8* %12, i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i8* @substull(i8* %0, i8* %1, i64 %2) {
%4 = alloca [21 x i8]
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 21, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
%7 = call i8* @subst(i8* %0, i8* %1, i8* %5)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ hash1(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  printf("hash1 = %ld , hash2= %d\n", hash1(argv[1]), hash(argv[1]));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <hash1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <hash@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <hash1@plt>
mov    %eax,%ebp
mov    0x8(%rbx),%rdi
call   1030 <hash@plt>
lea    0xeaf(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"hash1 = %ld , hash2= %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @hash1(i8* %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @hash(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"hash1 = %ld , hash2= %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @hash1(i8* %4)
%6 = load i8*, i8** %3
%7 = tail call i32 @hash(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}
void EVP_sha256(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ASN1_ITEM_rptr(int /*<<< orphan*/);
int ASN1_item_i2d_fp(int /*<<< orphan*/, int /*<<< orphan*/ *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ RSAPrivateKey;
int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa) {
  return ASN1_item_i2d_fp(ASN1_ITEM_rptr(RSAPrivateKey), fp, rsa);
}


x86 assembly (clang, -O0):
<i2d_RSAPrivateKey_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <ASN1_item_i2d_fp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_RSAPrivateKey_fp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <ASN1_ITEM_rptr@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ASN1_item_i2d_fp@plt>

LLVM IR (-O0):
@RSAPrivateKey = global i32 0
define i32 @i2d_RSAPrivateKey_fp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @RSAPrivateKey
%6 = call i32 @ASN1_ITEM_rptr(i32 %5)
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = call i32 @ASN1_item_i2d_fp(i32 %6, i32* %7, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
@RSAPrivateKey = global i32 0
define i32 @i2d_RSAPrivateKey_fp(i32* %0, i32* %1) {
%3 = load i32, i32* @RSAPrivateKey
%4 = tail call i32 @ASN1_ITEM_rptr(i32 %3)
%5 = tail call i32 @ASN1_item_i2d_fp(i32 %4, i32* %0, i32* %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ malloc(unsigned int);
long *xmalloc(int size) {
  long *result = (long *)malloc(((unsigned)size));
  if (result == ((long *)NULL)) {
    fatal("virtual memory exhausted");
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xmalloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i64*
ret i64* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_superset() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_superset"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_channel_map_superset\0A\00"
define i32 @pa_channel_map_superset() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_channel_map_superset\00"
define i32 @pa_channel_map_superset() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void printEnvironments(char *envp[]) {
  while (*envp)
    printf("%s\n", *envp++);
}


x86 assembly (clang, -O0):
<printEnvironments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     114f <printEnvironments+0x3f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    111c <printEnvironments+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printEnvironments>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <printEnvironments+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <printEnvironments+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printEnvironments(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %11, %4 ], [ %2, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = ptrtoint i8* %5 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %7
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int M_PI;
int atan2(double, double);
double angle(double real, double imag) {
  return (atan2(imag, real) * 180 / M_PI);
}


x86 assembly (clang, -O0):
<angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
mov    0x2eaa(%rip),%rcx
cltd
idivl  (%rcx)
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle>:
push   %rax
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <atan2@plt>
imul   $0xb4,%eax,%eax
mov    0x2ebc(%rip),%rcx
cltd
idivl  (%rcx)
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @angle(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = call i32 @atan2(double %5, double %6)
%8 = mul nsw i32 %7, 180
%9 = load i32, i32* @M_PI
%10 = sdiv i32 %8, %9
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @angle(double %0, double %1) {
%3 = tail call i32 @atan2(double %1, double %0)
%4 = mul nsw i32 %3, 180
%5 = load i32, i32* @M_PI
%6 = sdiv i32 %4, %5
%7 = sitofp i32 %6 to double
ret double %7
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void clear_bit(uint64_t *number, uint32_t bit_num) {
  *number &= ~(1 << bit_num);
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %esi,%ecx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @clear_bit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = and i32 %9, %7
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @clear_bit(i32* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = load i32, i32* %0
%6 = and i32 %5, %4
store i32 %6, i32* %0
ret void
}
/* Variables and functions */
double exp(int);
void sfcE(double *cnst) { *cnst = exp(1); }


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

x86 assembly (clang, -O2):
<sfcE>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <exp@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sfcE(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call double @exp(i32 1)
%4 = load double*, double** %2
store double %3, double* %4
ret void
}

LLVM IR (-O2):
define void @sfcE(double* nocapture writeonly %0) {
%2 = tail call double @exp(i32 1)
store double %2, double* %0
ret void
}
int gcd(int m, int n) {
  if (n == 0)
    return m;
  else
    return gcd(n, m % n);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <gcd+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <gcd+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
unsigned int f(unsigned int a, unsigned int b, unsigned int c) {
  a += (b >> 16) * (c >> 16);
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
mov    -0xc(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shr    $0x10,%esi
shr    $0x10,%edx
imul   %esi,%edx
lea    (%rdx,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f(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 = load i32, i32* %5
%8 = lshr i32 %7, 16
%9 = load i32, i32* %6
%10 = lshr i32 %9, 16
%11 = mul i32 %8, %10
%12 = load i32, i32* %4
%13 = add i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %1, 16
%5 = lshr i32 %2, 16
%6 = mul nuw i32 %5, %4
%7 = add i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ is_power_of_2_i(int);
int power_of_2_min_i(int n) {
  while (!is_power_of_2_i(n))
    n = n & (n - 1);
  return n;
}


x86 assembly (clang, -O0):
<power_of_2_min_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_power_of_2_i@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <power_of_2_min_i+0x28>
jmp    114b <power_of_2_min_i+0x3b>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <power_of_2_min_i+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power_of_2_min_i>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <is_power_of_2_i@plt>
test   %eax,%eax
je     1130 <power_of_2_min_i+0x20>
mov    %ebx,%ebp
jmp    1142 <power_of_2_min_i+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%ebp
and    %ebx,%ebp
mov    %ebp,%edi
call   1030 <is_power_of_2_i@plt>
mov    %ebp,%ebx
test   %eax,%eax
je     1130 <power_of_2_min_i+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @power_of_2_min_i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = call i32 @is_power_of_2_i(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = and i32 %9, %11
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @power_of_2_min_i(i32 %0) {
%2 = tail call i32 @is_power_of_2_i(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = tail call i32 @is_power_of_2_i(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ %0, %1 ], [ %7, %4 ]
ret i32 %11
}
/* Variables and functions */
int unknown_function();
void deduplicate_issues_1_Bad() {
  int a[10];
  int x = 10;
  a[x] = 0;
  x = unknown_function();
  if (x >= 10) {
    a[x] = 0;
  }
}


x86 assembly (clang, -O0):
<deduplicate_issues_1_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0xa,-0x34(%rbp)
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    $0x0,%al
call   1030 <unknown_function@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jl     114b <deduplicate_issues_1_Bad+0x3b>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @deduplicate_issues_1_Bad() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
%6 = call i32 (...) @unknown_function()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %11
store i32 0, i32* %12
br label %13
13: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
define void @deduplicate_issues_1_Bad() {
%1 = tail call i32 (...) @unknown_function()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int hash_equal(const char *h1, const char *h2) { return !strcmp(h1, h2); }


x86 assembly (clang, -O0):
<hash_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hash_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcmp(i8* %5, i8* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @hash_equal(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ arm32_dsb();
int /*<<< orphan*/ segment_lcd_data(unsigned long, unsigned char);
void segment_lcd_clear(unsigned char data) {
  for (unsigned long int i = 0; i < 32; i++) {
    segment_lcd_data(i, data);
    arm32_dsb();
  }
}


x86 assembly (clang, -O0):
<segment_lcd_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x20,-0x10(%rbp)
jae    1166 <segment_lcd_clear+0x46>
mov    -0x10(%rbp),%rdi
movzbl -0x1(%rbp),%esi
call   1030 <segment_lcd_data@plt>
mov    $0x0,%al
call   1040 <arm32_dsb@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <segment_lcd_clear+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<segment_lcd_clear>:
push   %rbp
push   %rbx
push   %rax
movzbl %dil,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <segment_lcd_data@plt>
xor    %eax,%eax
call   1040 <arm32_dsb@plt>
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1130 <segment_lcd_clear+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @segment_lcd_clear(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i64
store i8 %0, i8* %2
store i64 0, i64* %3
br label %4
4: ; preds = %12, %1
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 32
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %3
%9 = load i8, i8* %2
%10 = call i32 @segment_lcd_data(i64 %8, i8 zeroext %9)
%11 = call i32 (...) @arm32_dsb()
br label %12
12: ; preds = %7
%13 = load i64, i64* %3
%14 = add i64 %13, 1
store i64 %14, i64* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @segment_lcd_clear(i8 zeroext %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %7, %3 ]
%5 = tail call i32 @segment_lcd_data(i64 %4, i8 zeroext %0)
%6 = tail call i32 (...) @arm32_dsb()
%7 = add nuw nsw i64 %4, 1
%8 = icmp eq i64 %7, 32
br i1 %8, label %2, label %3
}
int main() {
  int a = 3;
  int b = !!4;
  int sum = a == b;
  sum += 0 || b;
  sum += a || b;
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jne    1155 <main+0x55>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("pid: %d\n", getpid());
  foo();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"pid: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (...) @foo()
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"pid: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @foo()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EOPNOTSUPP;
int /*<<< orphan*/ errno;
int setflags(int fd, unsigned long flags) {
  errno = EOPNOTSUPP;
  return -1;
}


x86 assembly (clang, -O0):
<setflags>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setflags>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @setflags(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* @EOPNOTSUPP
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @setflags(i32 %0, i64 %1) {
%3 = load i32, i32* @EOPNOTSUPP
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
struct sset_node {
  int dummy;
};
struct sset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
struct sset_node *sset_add(struct sset *, char *);
struct sset_node *sset_add_and_free(struct sset *set, char *name) {
  struct sset_node *node = sset_add(set, name);
  free(name);
  return node;
}


x86 assembly (clang, -O0):
<sset_add_and_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <sset_add@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sset_add_and_free>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <sset_add@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sset_node = type { i32 }
%struct.sset = type { i32 }
define %struct.sset_node* @sset_add_and_free(%struct.sset* %0, i8* %1) {
%3 = alloca %struct.sset*
%4 = alloca i8*
%5 = alloca %struct.sset_node*
store %struct.sset* %0, %struct.sset** %3
store i8* %1, i8** %4
%6 = load %struct.sset*, %struct.sset** %3
%7 = load i8*, i8** %4
%8 = call %struct.sset_node* @sset_add(%struct.sset* %6, i8* %7)
store %struct.sset_node* %8, %struct.sset_node** %5
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
%11 = load %struct.sset_node*, %struct.sset_node** %5
ret %struct.sset_node* %11
}

LLVM IR (-O2):
%struct.sset_node = type { i32 }
%struct.sset = type { i32 }
define %struct.sset_node* @sset_add_and_free(%struct.sset* %0, i8* %1) {
%3 = tail call %struct.sset_node* @sset_add(%struct.sset* %0, i8* %1)
%4 = tail call i32 @free(i8* %1)
ret %struct.sset_node* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(double **);
void freeMatrix(double **ret, int r) { free(ret); }


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

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

LLVM IR (-O0):
define void @freeMatrix(double** %0, i32 %1) {
%3 = alloca double**
%4 = alloca i32
store double** %0, double*** %3
store i32 %1, i32* %4
%5 = load double**, double*** %3
%6 = call i32 @free(double** %5)
ret void
}

LLVM IR (-O2):
define void @freeMatrix(double** nocapture %0, i32 %1) {
%3 = tail call i32 @free(double** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_bad_scalar();
int /*<<< orphan*/ test_ecdh_api();
int /*<<< orphan*/ test_ecdh_generator_basepoint();
void run_ecdh_tests(void) {
  test_ecdh_api();
  test_ecdh_generator_basepoint();
  test_bad_scalar();
}


x86 assembly (clang, -O0):
<run_ecdh_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_ecdh_api@plt>
mov    $0x0,%al
call   1030 <test_ecdh_generator_basepoint@plt>
mov    $0x0,%al
call   1040 <test_bad_scalar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_ecdh_tests>:
push   %rax
xor    %eax,%eax
call   1050 <test_ecdh_api@plt>
xor    %eax,%eax
call   1030 <test_ecdh_generator_basepoint@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_bad_scalar@plt>

LLVM IR (-O0):
define void @run_ecdh_tests() {
%1 = call i32 (...) @test_ecdh_api()
%2 = call i32 (...) @test_ecdh_generator_basepoint()
%3 = call i32 (...) @test_bad_scalar()
ret void
}

LLVM IR (-O2):
define void @run_ecdh_tests() {
%1 = tail call i32 (...) @test_ecdh_api()
%2 = tail call i32 (...) @test_ecdh_generator_basepoint()
%3 = tail call i32 (...) @test_bad_scalar()
ret void
}
/* Variables and functions */
int PTHREAD_SCOPE_SYSTEM;
void test_PTHREAD_SCOPE_SYSTEM(void) {
  int dummy = PTHREAD_SCOPE_SYSTEM;
  (void)dummy;
}


x86 assembly (clang, -O0):
<test_PTHREAD_SCOPE_SYSTEM>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@PTHREAD_SCOPE_SYSTEM = global i32 0
define void @test_PTHREAD_SCOPE_SYSTEM() {
%1 = alloca i32
%2 = load i32, i32* @PTHREAD_SCOPE_SYSTEM
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret void
}

LLVM IR (-O2):
@PTHREAD_SCOPE_SYSTEM = global i32 0
define void @test_PTHREAD_SCOPE_SYSTEM() {
ret void
}
int ft_is_odd(void *data) {
  if ((*(int *)data) & 1)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_is_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1126 <ft_is_odd+0x26>
movl   $0x1,-0x4(%rbp)
jmp    112d <ft_is_odd+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ft_is_odd(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_is_odd(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ panic(char *);
int open_or_die_m(const char *file, int flags, mode_t mode) {
  int ret = open(file, flags, mode);
  if (ret < 0)
    panic("Cannot open or create file!");
  return ret;
}


x86 assembly (clang, -O0):
<open_or_die_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    115a <open_or_die_m+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <panic@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_or_die_m>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <open_or_die_m+0x18>
lea    0xecd(%rip),%rdi
call   1030 <panic@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Cannot open or create file!\00"
define i32 @open_or_die_m(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 @open(i8* %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [28 x i8] c"Cannot open or create file!\00"
define i32 @open_or_die_m(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @panic(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}