xunge/DecIR huggingface dataset:
/* Variables and functions */
int add(int, int);
int mul(int, int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("2*3=%d; 2+3=%d\n", mul(2, 3), add(2, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <mul@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <mul@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"2*3=%d; 2+3=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @mul(i32 2, i32 3)
%3 = call i32 @add(i32 2, i32 3)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"2*3=%d; 2+3=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @mul(i32 2, i32 3)
%2 = tail call i32 @add(i32 2, i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ farenheat();
int main() {
  farenheat();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @farenheat()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void my_fini(void) { fputs("libstupid unloaded\n", stdout); }


x86 assembly (clang, -O0):
<my_fini>:
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):
<my_fini>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"libstupid unloaded\0A\00"
@stdout = global i32 0
define void @my_fini() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"libstupid unloaded\0A\00"
@stdout = global i32 0
define void @my_fini() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
__typeof__(strdup(1)) test_strdup_156(void) { return strdup(1); }


x86 assembly (clang, -O0):
<test_strdup_156>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <strdup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strdup_156>:
mov    $0x1,%edi
jmp    1030 <strdup@plt>

LLVM IR (-O0):
define i8* @test_strdup_156() {
%1 = call i8* @strdup(i8* inttoptr (i64 1 to i8*))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @test_strdup_156() {
%1 = tail call i8* @strdup(i8* inttoptr (i64 1 to i8*))
ret i8* %1
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn96() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn96");
  return result;
}


x86 assembly (clang, -O0):
<fn96>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn96>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn96\00"
define i8* @fn96() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn96\00"
define i8* @fn96() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ srl_hl();
void opcb_3e() { srl_hl(); }


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

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

LLVM IR (-O0):
define void @opcb_3e() {
%1 = call i32 (...) @srl_hl()
ret void
}

LLVM IR (-O2):
define void @opcb_3e() {
%1 = tail call i32 (...) @srl_hl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hello_world(int);
int main(int argc, char **argv) {
  hello_world(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 <hello_world@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @hello_world(i32 5)
ret i32 0
}
int sum5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }


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

x86 assembly (clang, -O2):
<sum5>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
ret

LLVM IR (-O0):
define i32 @sum5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = add nsw i32 %17, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @sum5(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %1, %0
%7 = add nsw i32 %6, %2
%8 = add nsw i32 %7, %3
%9 = add nsw i32 %8, %4
ret i32 %9
}
int main(int argc, char **argv) {
  __builtin_ia32_sfence();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
sfence
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void @llvm.x86.sse.sfence()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void key_destructor(void *privdata, void *key) {
  if (key != NULL)
    free(key);
}


x86 assembly (clang, -O0):
<key_destructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <key_destructor+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_destructor>:
test   %rsi,%rsi
je     111d <key_destructor+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @key_destructor(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @key_destructor(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AL_writeRegister(int, int);
void AL_resetTimers(void) {
  AL_writeRegister(0X04, 0X40 | 0X20);
  AL_writeRegister(0X04, 0X80);
}


x86 assembly (clang, -O0):
<AL_resetTimers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x60,%esi
call   1030 <AL_writeRegister@plt>
mov    $0x4,%edi
mov    $0x80,%esi
call   1030 <AL_writeRegister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AL_resetTimers>:
push   %rax
mov    $0x4,%edi
mov    $0x60,%esi
call   1030 <AL_writeRegister@plt>
mov    $0x4,%edi
mov    $0x80,%esi
pop    %rax
jmp    1030 <AL_writeRegister@plt>

LLVM IR (-O0):
define void @AL_resetTimers() {
%1 = call i32 @AL_writeRegister(i32 4, i32 96)
%2 = call i32 @AL_writeRegister(i32 4, i32 128)
ret void
}

LLVM IR (-O2):
define void @AL_resetTimers() {
%1 = tail call i32 @AL_writeRegister(i32 4, i32 96)
%2 = tail call i32 @AL_writeRegister(i32 4, i32 128)
ret void
}
int todosResolveramAoMenosUmProblema(int problemas[][128],
                                     int numeroDeParticipantes,
                                     int numeroDeProblemas) {
  int i;
  for (i = 0; i < numeroDeParticipantes; i++) {
    if (problemas[i][101] == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<todosResolveramAoMenosUmProblema>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115c <todosResolveramAoMenosUmProblema+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
shl    $0x9,%rcx
add    %rcx,%rax
cmpl   $0x0,0x194(%rax)
jne    1149 <todosResolveramAoMenosUmProblema+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1163 <todosResolveramAoMenosUmProblema+0x63>
jmp    114e <todosResolveramAoMenosUmProblema+0x4e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <todosResolveramAoMenosUmProblema+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<todosResolveramAoMenosUmProblema>:
mov    $0x1,%eax
test   %esi,%esi
jle    1136 <todosResolveramAoMenosUmProblema+0x36>
mov    %esi,%ecx
shl    $0x9,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,0x194(%rdi,%rdx,1)
je     1137 <todosResolveramAoMenosUmProblema+0x37>
add    $0x200,%rdx
cmp    %rdx,%rcx
jne    1120 <todosResolveramAoMenosUmProblema+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @todosResolveramAoMenosUmProblema([128 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca [128 x i32]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [128 x i32]* %0, [128 x i32]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
br label %9
9: ; preds = %23, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load [128 x i32]*, [128 x i32]** %5
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [128 x i32], [128 x i32]* %14, i64 %16
%18 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 101
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %13
store i32 0, i32* %4
br label %27
22: ; preds = %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %9
26: ; preds = %9
store i32 1, i32* %4
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @todosResolveramAoMenosUmProblema([128 x i32]* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds [128 x i32], [128 x i32]* %0, i64 %10, i64 101
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %16
}
unsigned int RSHash(char *str) {
  static unsigned int b = 378551;
  unsigned int a = 63689;
  unsigned int hash = 0;
  while (*str) {
    hash = hash * a + (*str++);
    a = a * b;
  }
  return (hash & 0x7FFFFFFF);
}


x86 assembly (clang, -O0):
<RSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xf8c9,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <RSHash+0x53>
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   0x2ed5(%rip),%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <RSHash+0x16>
mov    -0x10(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <RSHash+0x41>
add    $0x1,%rdi
mov    $0xf8c9,%edx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%esi
imul   %edx,%esi
movsbl %cl,%eax
add    %esi,%eax
imul   $0x5c6b7,%edx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <RSHash+0x20>
and    $0x7fffffff,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@RSHash.b = internal global i32 378551
define i32 @RSHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 63689, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = mul i32 %10, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
%17 = add i32 %12, %16
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = load i32, i32* @RSHash.b
%20 = mul i32 %18, %19
store i32 %20, i32* %3
br label %5
21: ; preds = %5
%22 = load i32, i32* %4
%23 = and i32 %22, 2147483647
ret i32 %23
}

LLVM IR (-O2):
define i32 @RSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %13, %4 ], [ 63689, %1 ]
%8 = phi i8* [ %10, %4 ], [ %0, %1 ]
%9 = mul i32 %6, %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %5 to i32
%12 = add i32 %9, %11
%13 = mul i32 %7, 378551
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = and i32 %12, 2147483647
br label %18
18: ; preds = %16, %1
%19 = phi i32 [ 0, %1 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
bool bnot(bool a) { return !a; }


x86 assembly (clang, -O0):
<bnot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bnot>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bnot(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @bnot(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void set_char(addr, val) char *addr;
int val;
{ *addr = val; }


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

x86 assembly (clang, -O2):
<set_char>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @set_char(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 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
store i8 %6, i8* %7
ret void
}

LLVM IR (-O2):
define void @set_char(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stack_overflow(void) { printf("error, stack overflow\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"error, stack overflow\0A\00"
define void @stack_overflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"error, stack overflow\00"
define void @stack_overflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long root;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
void set_XPointerMovedEvent_root(void *_p, unsigned long _v) {
  ((XPointerMovedEvent *)_p)->root = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XPointerMovedEvent_root>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XPointerMovedEvent_root(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %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 i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XPointerMovedEvent_root(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void IntDefaultHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<IntDefaultHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <IntDefaultHandler+0x9>
jmp    1109 <IntDefaultHandler+0x9>

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

LLVM IR (-O0):
define void @IntDefaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @IntDefaultHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
bool ncg(bool s, bool c) {
  if (c)
    return s;
  else
    return !s;
}


x86 assembly (clang, -O0):
<ncg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     111f <ncg+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1130 <ncg+0x30>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ncg>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
test   %esi,%esi
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @ncg(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 ne 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 %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
br label %15
15: ; preds = %10, %8
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @ncg(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %0, 0
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 %5, i32 %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void fb_show_cursor() {
  outb(0x3D4, 0xA);
  outb(0x3D5, 0x0);
}


x86 assembly (clang, -O0):
<fb_show_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
xor    %esi,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_show_cursor>:
push   %rax
mov    $0x3d4,%edi
mov    $0xa,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fb_show_cursor() {
%1 = call i32 @outb(i32 980, i32 10)
%2 = call i32 @outb(i32 981, i32 0)
ret void
}

LLVM IR (-O2):
define void @fb_show_cursor() {
%1 = tail call i32 @outb(i32 980, i32 10)
%2 = tail call i32 @outb(i32 981, i32 0)
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pci_dev *);
void HsFreePciDevice(struct pci_dev *dev) {
  free(dev);
  return;
}


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

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

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define void @HsFreePciDevice(%struct.pci_dev* nocapture %0) {
%2 = tail call i32 @free(%struct.pci_dev* %0)
ret void
}
void dummy_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pendfunc1();
void pendfunc(void) { pendfunc1(); }


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

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

LLVM IR (-O0):
define void @pendfunc() {
%1 = call i32 (...) @pendfunc1()
ret void
}

LLVM IR (-O2):
define void @pendfunc() {
%1 = tail call i32 (...) @pendfunc1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize(char *, int, char *);
int /*<<< orphan*/ printf(char *);
void sim(char *instr_hex, char *pc_values_hex) {
  printf("MIPS Simulator\n\n");
  initialize(instr_hex, 1, pc_values_hex);
}


x86 assembly (clang, -O0):
<sim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1040 <initialize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <initialize@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"MIPS Simulator\0A\0A\00"
define void @sim(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @initialize(i8* %6, i32 1, i8* %7)
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"MIPS Simulator\0A\00"
define void @sim(i8* %0, i8* %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @initialize(i8* %0, i32 1, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_generic_serial_write(char *, int);
void drv_CF_start_1(void) {
  drv_generic_serial_write("\014", 1);
  drv_generic_serial_write("\004", 1);
  drv_generic_serial_write("\024", 1);
  drv_generic_serial_write("\030", 1);
}


x86 assembly (clang, -O0):
<drv_CF_start_1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
lea    0xed6(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
lea    0xec7(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
lea    0xeb8(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_CF_start_1>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
lea    0xed9(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
call   1030 <drv_generic_serial_write@plt>
lea    0xebb(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1030 <drv_generic_serial_write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0C\00"
@.str.1 = [2 x i8] c"\04\00"
@.str.2 = [2 x i8] c"\14\00"
@.str.3 = [2 x i8] c"\18\00"
define void @drv_CF_start_1() {
%1 = call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0C\00"
@.str.1 = [2 x i8] c"\04\00"
@.str.2 = [2 x i8] c"\14\00"
@.str.3 = [2 x i8] c"\18\00"
define void @drv_CF_start_1() {
%1 = tail call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @drv_generic_serial_write(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}
void opcode_db() {}


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

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

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

LLVM IR (-O2):
define void @opcode_db() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SXTB16(uint32_t x) {
  return ((uint32_t)(((((int32_t)x << 24) >> 24) & (int32_t)0x0000FFFF) |
                     ((((int32_t)x << 8) >> 8) & (int32_t)0xFFFF0000)));
}


x86 assembly (clang, -O0):
<__SXTB16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%eax
sar    $0x18,%eax
and    $0xffff,%eax
mov    -0x8(%rbp),%rcx
shl    $0x8,%ecx
sar    $0x8,%ecx
and    $0xffff0000,%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SXTB16>:
movsbl %dil,%eax
movzwl %ax,%eax
shl    $0x8,%edi
sar    $0x8,%edi
and    $0xffff0000,%edi
or     %eax,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @__SXTB16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 24
%6 = ashr i32 %5, 24
%7 = and i32 %6, 65535
%8 = load i64, i64* %2
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 8
%11 = ashr i32 %10, 8
%12 = and i32 %11, -65536
%13 = or i32 %7, %12
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @__SXTB16(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = shl i32 %2, 24
%4 = ashr exact i32 %3, 24
%5 = and i32 %4, 65535
%6 = shl i32 %2, 8
%7 = ashr exact i32 %6, 8
%8 = and i32 %7, -65536
%9 = or i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Variables and functions */
int eeprom_read_int16(int);
int eeprom_read_uint16(int);
int /*<<< orphan*/ settings_reset_to_defaults();
int settings_get_channel() {
  if (eeprom_read_uint16(128) != 0xfafbul) {
    settings_reset_to_defaults();
    return 1;
  }
  return eeprom_read_int16(32);
}


x86 assembly (clang, -O0):
<settings_get_channel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80,%edi
call   1030 <eeprom_read_uint16@plt>
cltq
cmp    $0xfafb,%rax
je     1163 <settings_get_channel+0x33>
mov    $0x0,%al
call   1050 <settings_reset_to_defaults@plt>
movl   $0x1,-0x4(%rbp)
jmp    1170 <settings_get_channel+0x40>
mov    $0x20,%edi
call   1040 <eeprom_read_int16@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<settings_get_channel>:
push   %rax
mov    $0x80,%edi
call   1030 <eeprom_read_uint16@plt>
cmp    $0xfafb,%eax
jne    114d <settings_get_channel+0x1d>
mov    $0x20,%edi
pop    %rax
jmp    1040 <eeprom_read_int16@plt>
xor    %eax,%eax
call   1050 <settings_reset_to_defaults@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @settings_get_channel() {
%1 = alloca i32
%2 = call i32 @eeprom_read_uint16(i32 128)
%3 = sext i32 %2 to i64
%4 = icmp ne i64 %3, 64251
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @settings_reset_to_defaults()
store i32 1, i32* %1
br label %9
7: ; preds = %0
%8 = call i32 @eeprom_read_int16(i32 32)
store i32 %8, i32* %1
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @settings_get_channel() {
%1 = tail call i32 @eeprom_read_uint16(i32 128)
%2 = icmp eq i32 %1, 64251
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @settings_reset_to_defaults()
br label %7
5: ; preds = %0
%6 = tail call i32 @eeprom_read_int16(i32 32)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ 1, %3 ], [ %6, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ test(char *);
int main() {
  test("~/{Downloads,Pictures}/*.{jpg,gif,png}");
  test("It{{em,alic}iz,erat}e{d,}, please.");
  test("{,{,gotta have{ ,\\, again\\, }}more }cowbell!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"~/{Downloads,Pictures}/*.{jpg,gif,png}\00"
@.str.1 = [35 x i8] c"It{{em,alic}iz,erat}e{d,}, please.\00"
@.str.2 = [45 x i8] c"{,{,gotta have{ ,\\, again\\, }}more }cowbell!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @test(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @test(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @test(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"~/{Downloads,Pictures}/*.{jpg,gif,png}\00"
@.str.1 = [35 x i8] c"It{{em,alic}iz,erat}e{d,}, please.\00"
@.str.2 = [45 x i8] c"{,{,gotta have{ ,\\, again\\, }}more }cowbell!\00"
define i32 @main() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @test(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int __fxstatat(int, int, char const *, struct stat *, int);
__attribute__((__weak__, __always___)) int
softboundcets___fxstatat(int ver, int file_des, const char *filename,
                         struct stat *stat_struct, int flag) {
  return __fxstatat(ver, file_des, filename, stat_struct, flag);
}


x86 assembly (clang, -O0):
<softboundcets___fxstatat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <__fxstatat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets___fxstatat>:
jmp    1030 <__fxstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define weak i32 @softboundcets___fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.stat*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store %struct.stat* %3, %struct.stat** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i8*, i8** %8
%14 = load %struct.stat*, %struct.stat** %9
%15 = load i32, i32* %10
%16 = call i32 @__fxstatat(i32 %11, i32 %12, i8* %13, %struct.stat* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define weak i32 @softboundcets___fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4) {
%6 = tail call i32 @__fxstatat(i32 %0, i32 %1, i8* %2, %struct.stat* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ bar();
void foo(int x) {
  unsigned char error = 0;
  if (!(error = ((x == 0) || bar())))
    bar();
  if (!error)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
je     114f <foo+0x2f>
mov    $0x0,%al
call   1040 <bar@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x5(%rbp)
cmp    $0x0,%al
jne    1169 <foo+0x49>
mov    $0x0,%al
call   1040 <bar@plt>
cmpb   $0x0,-0x5(%rbp)
jne    117a <foo+0x5a>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
test   %edi,%edi
je     1131 <foo+0x11>
xor    %eax,%eax
call   1040 <bar@plt>
test   %rax,%rax
je     1133 <foo+0x13>
pop    %rax
ret
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
store i8 0, i8* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i64 (...) @bar()
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = icmp ne i8 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = call i64 (...) @bar()
br label %16
16: ; preds = %14, %9
%17 = load i8, i8* %3
%18 = icmp ne i8 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %16
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 (...) @bar()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i64 (...) @bar()
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ aes_decrypt(unsigned char const *, int const,
                               unsigned char *, void *, unsigned char const *,
                               int);
void aes_128_decrypt(const unsigned char *ciphertext, const int ciphertext_len,
                     unsigned char plaintext[], void *iv,
                     const unsigned char *key) {
  aes_decrypt(ciphertext, ciphertext_len, plaintext, iv, key, 16);
}


x86 assembly (clang, -O0):
<aes_128_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0x10,%r9d
call   1030 <aes_decrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_128_decrypt>:
mov    $0x10,%r9d
jmp    1030 <aes_decrypt@plt>

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

LLVM IR (-O2):
define void @aes_128_decrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = tail call i32 @aes_decrypt(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i32 16)
ret void
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRABORTDOC_get(void) { return U_WMRCORENONE_get("U_WMRABORTDOC"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"U_WMRABORTDOC\00"
define i32 @U_WMRABORTDOC_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [14 x i8] c"U_WMRABORTDOC\00"
define i32 @U_WMRABORTDOC_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR5B_get(void) { return U_WMRCORENONE_get("U_WMR5B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR5B\00"
define i32 @U_WMR5B_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
double to_double(void *data) { return *((double *)data); }


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

x86 assembly (clang, -O2):
<to_double>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @to_double(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to double*
%5 = load double, double* %4
ret double %5
}

LLVM IR (-O2):
define double @to_double(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
int nonet_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @nonet_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nonet_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Subroutine_addr(int, int);
void CALL(void) { Subroutine_addr(205, 196); }


x86 assembly (clang, -O0):
<CALL>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcd,%edi
mov    $0xc4,%esi
call   1030 <Subroutine_addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CALL>:
mov    $0xcd,%edi
mov    $0xc4,%esi
jmp    1030 <Subroutine_addr@plt>

LLVM IR (-O0):
define void @CALL() {
%1 = call i32 @Subroutine_addr(i32 205, i32 196)
ret void
}

LLVM IR (-O2):
define void @CALL() {
%1 = tail call i32 @Subroutine_addr(i32 205, i32 196)
ret void
}
int countBits(int input) {
  int bitCount = 0;
  if (input > 0) {
    while (input > 0) {
      bitCount++;
      input = input >> 1;
    }
  } else {
    bitCount = sizeof(int) * 8;
  }
  return bitCount;
}


x86 assembly (clang, -O0):
<countBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <countBits+0x43>
jmp    111d <countBits+0x1d>
cmpl   $0x0,-0x4(%rbp)
jle    113e <countBits+0x3e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111d <countBits+0x1d>
jmp    114a <countBits+0x4a>
movl   $0x20,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBits>:
test   %edi,%edi
jle    111d <countBits+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <countBits+0x10>
ret
mov    $0x20,%eax
ret

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

LLVM IR (-O2):
define i32 @countBits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 32, %1 ], [ %6, %3 ]
ret i32 %10
}
int test_imm_2Fint16_reg(short val) {
  return ((val) & (-0x2F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffd1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Fint16_reg>:
test   $0xffd1,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Fint16_reg(i16 signext %0) {
%2 = and i16 %0, -47
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void amaret_local_A1_makeInput__E() { printf("Pin.makeInput\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Pin.makeInput\00"
define void @amaret_local_A1_makeInput__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void playWav(char *file) {
  char str[100];
  strcpy(str, "aplay -D hw:1,0 ");
  strcat(str, file);
  system(str);
}


x86 assembly (clang, -O0):
<playWav>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x70(%rbp),%rdi
call   1040 <system@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playWav>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r14,%rdi
call   1040 <system@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"aplay -D hw:1,0 \00"
define void @playWav(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strcat(i8* %6, i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @system(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"aplay -D hw:1,0 \00"
define void @playWav(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strcat(i8* %3, i8* %0)
%6 = call i32 @system(i8* %3)
ret void
}
int ckgolinp(int spec) {
  switch (spec) { default:; }
  return 0;
}


x86 assembly (clang, -O0):
<ckgolinp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <ckgolinp+0xc>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ckgolinp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
br label %5
5: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @ckgolinp(i32 %0) {
ret i32 0
}