xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void f5() { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @f5() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
int rand_255();
unsigned long int rand_32(void) {
  int x1, x2, x3, x4;
  long int temp;
  x1 = rand_255();
  x2 = rand_255();
  x3 = rand_255();
  x4 = rand_255();
  temp = x1 + (x2 << 8) + (x3 << 16) + (x4 << 24);
  return temp;
}


x86 assembly (clang, -O0):
<rand_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <rand_255@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand_255@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand_255@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand_255@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_32>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <rand_255@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1030 <rand_255@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1030 <rand_255@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand_255@plt>
shl    $0x8,%ebp
add    %r14d,%ebp
shl    $0x10,%ebx
add    %ebp,%ebx
shl    $0x18,%eax
add    %ebx,%eax
cltq
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @rand_32() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = call i32 (...) @rand_255()
store i32 %6, i32* %1
%7 = call i32 (...) @rand_255()
store i32 %7, i32* %2
%8 = call i32 (...) @rand_255()
store i32 %8, i32* %3
%9 = call i32 (...) @rand_255()
store i32 %9, i32* %4
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = shl i32 %11, 8
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %3
%15 = shl i32 %14, 16
%16 = add nsw i32 %13, %15
%17 = load i32, i32* %4
%18 = shl i32 %17, 24
%19 = add nsw i32 %16, %18
%20 = sext i32 %19 to i64
store i64 %20, i64* %5
%21 = load i64, i64* %5
ret i64 %21
}

LLVM IR (-O2):
define i64 @rand_32() {
%1 = tail call i32 (...) @rand_255()
%2 = tail call i32 (...) @rand_255()
%3 = tail call i32 (...) @rand_255()
%4 = tail call i32 (...) @rand_255()
%5 = shl i32 %2, 8
%6 = add nsw i32 %5, %1
%7 = shl i32 %3, 16
%8 = add nsw i32 %6, %7
%9 = shl i32 %4, 24
%10 = add nsw i32 %8, %9
%11 = sext i32 %10 to i64
ret i64 %11
}
int enclave_lseek() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_lseek() {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int strcmp_lt(void *a, void *b) { return strcmp(*(char **)a, *(char **)b) < 0; }


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

x86 assembly (clang, -O2):
<strcmp_lt>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
call   1030 <strcmp@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @strcmp_lt(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i64 @strcmp(i8* %7, i8* %10)
%12 = icmp slt i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @strcmp_lt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %4, i8* %6)
%8 = lshr i64 %7, 63
%9 = trunc i64 %8 to i32
ret i32 %9
}
match(s1, s2) char *s1, *s2;
{
  while (*s1 == *s2)
    if (*s1++ == '\0')
      return (1);
    else
      *s2++;
  return (0);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115a <match+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1149 <match+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1161 <match+0x61>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <match+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <match+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <match+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <match+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void h265hvcc_array_init(uint8_t *p) { p[0] = 0; }


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

x86 assembly (clang, -O2):
<h265hvcc_array_init>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @h265hvcc_array_init(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ giterr_set_oom();
void *git__calloc(size_t nelem, size_t elsize) {
  void *ptr = calloc(nelem, elsize);
  if (!ptr)
    giterr_set_oom();
  return ptr;
}


x86 assembly (clang, -O0):
<git__calloc>:
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 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <git__calloc+0x33>
mov    $0x0,%al
call   1030 <giterr_set_oom@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__calloc>:
push   %rbx
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <git__calloc+0x15>
xor    %eax,%eax
call   1030 <giterr_set_oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @git__calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @giterr_set_oom()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void split(char *buffer, char **part) {
  char *args;
  for (args = buffer; *args != 0 && *args != ' '; args++)
    ;
  if (*args == ' ') {
    *args = 0;
    args++;
  }
  *part = args;
}


x86 assembly (clang, -O0):
<split>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1139 <split+0x39>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1149 <split+0x49>
jmp    115f <split+0x5f>
jmp    114e <split+0x4e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <split+0x14>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1182 <split+0x82>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<split>:
movzbl (%rdi),%eax
test   %al,%al
je     1118 <split+0x18>
cmp    $0x20,%al
je     1111 <split+0x11>
add    $0x1,%rdi
jmp    1100 <split>
movb   $0x0,(%rdi)
add    $0x1,%rdi
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define void @split(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8*
store i8* %0, i8** %3
store i8** %1, i8*** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %20, %2
%8 = load i8*, i8** %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 32
br label %17
17: ; preds = %12, %7
%18 = phi i1 [ false, %7 ], [ %16, %12 ]
br i1 %18, label %19, label %23
19: ; preds = %17
br label %20
20: ; preds = %19
%21 = load i8*, i8** %5
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %5
br label %7
23: ; preds = %17
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 32
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = load i8*, i8** %5
store i8 0, i8* %29
%30 = load i8*, i8** %5
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %5
br label %32
32: ; preds = %28, %23
%33 = load i8*, i8** %5
%34 = load i8**, i8*** %4
store i8* %33, i8** %34
ret void
}

LLVM IR (-O2):
define void @split(i8* %0, i8** nocapture writeonly %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %0, %2 ], [ %7, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 32, label %8
i8 0, label %10
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
store i8 0, i8* %4
%9 = getelementptr inbounds i8, i8* %4, i64 1
br label %10
10: ; preds = %3, %8
%11 = phi i8* [ %9, %8 ], [ %4, %3 ]
store i8* %11, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xa7() {
  Assert_real((isxdigit(167) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              840, ("isxdigit should be 0 for 0xa7"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0xa7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa7,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x348,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0xa7>:
push   %rax
mov    $0xa7,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x348,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa7\00"
define void @t_isxdigit_0xa7() {
%1 = call i64 @isxdigit(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa7\00"
define void @t_isxdigit_0xa7() {
%1 = tail call i64 @isxdigit(i32 167)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 840, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gtk_tree_view_column_get_spacing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_spacing() {
ret void
}
int replace_nl(char *str) {
  while (*str != '\0') {
    if (*str == '\n')
      *str = ' ';
    else if (*str == '\r')
      *str = ',';
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<replace_nl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <replace_nl+0x61>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1134 <replace_nl+0x34>
mov    -0x8(%rbp),%rax
movb   $0x20,(%rax)
jmp    1150 <replace_nl+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    114b <replace_nl+0x4b>
mov    -0x8(%rbp),%rax
movb   $0x2c,(%rax)
jmp    1150 <replace_nl+0x50>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <replace_nl+0x8>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace_nl>:
jmp    1118 <replace_nl+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2c,%al
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1130 <replace_nl+0x30>
cmp    $0xd,%al
je     1110 <replace_nl+0x10>
test   %al,%al
jne    1114 <replace_nl+0x14>
jmp    1134 <replace_nl+0x34>
nopl   0x0(%rax)
mov    $0x20,%al
jmp    1112 <replace_nl+0x12>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @replace_nl(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %10
i8 10, label %6
i8 13, label %5
]
5: ; preds = %2
br label %6
6: ; preds = %2, %5
%7 = phi i8 [ 44, %5 ], [ 32, %2 ]
store i8 %7, i8* %3
br label %8
8: ; preds = %6, %2
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int x = 5;
  printf("%*d", x, x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed4(%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
mov    $0x5,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%*d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void clear_input(void) { fflush(stdin); }


x86 assembly (clang, -O0):
<clear_input>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_input>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @clear_input() {
%1 = load i32, i32* @stdin
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @clear_input() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_clrrts();
int /*<<< orphan*/ waitms(int);
void clrrts(void) {
  waitms(50);
  serial_clrrts();
  waitms(50);
}


x86 assembly (clang, -O0):
<clrrts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
call   1030 <waitms@plt>
mov    $0x0,%al
call   1040 <serial_clrrts@plt>
mov    $0x32,%edi
call   1030 <waitms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrrts>:
push   %rax
mov    $0x32,%edi
call   1030 <waitms@plt>
xor    %eax,%eax
call   1040 <serial_clrrts@plt>
mov    $0x32,%edi
pop    %rax
jmp    1030 <waitms@plt>

LLVM IR (-O0):
define void @clrrts() {
%1 = call i32 @waitms(i32 50)
%2 = call i32 (...) @serial_clrrts()
%3 = call i32 @waitms(i32 50)
ret void
}

LLVM IR (-O2):
define void @clrrts() {
%1 = tail call i32 @waitms(i32 50)
%2 = tail call i32 (...) @serial_clrrts()
%3 = tail call i32 @waitms(i32 50)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("five = %d\n", 5);
  printf("hello\n");
  printf("%d %s\n", 2, "yo");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x2,%esi
lea    0xed1(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0xec4(%rip),%rdx
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"five = %d\0A\00"
@.str.1 = [7 x i8] c"hello\0A\00"
@.str.2 = [7 x i8] c"%d %s\0A\00"
@.str.3 = [3 x i8] c"yo\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"five = %d\0A\00"
@.str.2 = [7 x i8] c"%d %s\0A\00"
@.str.3 = [3 x i8] c"yo\00"
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
long long get_arch_specific_mem_size(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_arch_specific_mem_size() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_arch_specific_mem_size() {
ret i64 0
}
char next(char c) { return c == 'G' ? 'A' : (char)(c + 1); }


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x47,%eax
jne    1124 <next+0x24>
mov    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <next+0x31>
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
movsbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
lea    0x1(%rdi),%eax
cmp    $0x47,%dil
movzbl %al,%ecx
mov    $0x41,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @next(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 71
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %7, %6
%14 = phi i32 [ 65, %6 ], [ %12, %7 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @next(i8 signext %0) {
%2 = icmp eq i8 %0, 71
%3 = add i8 %0, 1
%4 = select i1 %2, i8 65, i8 %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int main() {
  setuid(0);
  system("/usr/share/blueproximity-plus/proximity.py");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"/usr/share/blueproximity-plus/proximity.py\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setuid(i32 0)
%3 = call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"/usr/share/blueproximity-plus/proximity.py\00"
define i32 @main() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @system(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double calculate_taxes(double monthly_bill) {
  double taxes = monthly_bill * 0.0525;
  return taxes;
}


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

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

LLVM IR (-O0):
define double @calculate_taxes(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 5.250000e-02
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @calculate_taxes(double %0) {
%2 = fmul double %0, 5.250000e-02
ret double %2
}
/* Type definitions */
struct C_Map_MatrixXd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Map_MatrixXd_delete(struct C_Map_MatrixXd *);
struct C_Map_MatrixXd *Map_MatrixXd_new(double *, int, int);
int /*<<< orphan*/ Map_MatrixXd_print(struct C_Map_MatrixXd *);
void print_array(double *array, int n) {
  struct C_Map_MatrixXd *m = Map_MatrixXd_new(array, 1, n);
  Map_MatrixXd_print(m);
  Map_MatrixXd_delete(m);
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <Map_MatrixXd_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <Map_MatrixXd_print@plt>
mov    -0x18(%rbp),%rdi
call   1050 <Map_MatrixXd_delete@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %rbx
mov    %esi,%edx
mov    $0x1,%esi
call   1030 <Map_MatrixXd_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <Map_MatrixXd_print@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <Map_MatrixXd_delete@plt>

LLVM IR (-O0):
%struct.C_Map_MatrixXd = type { i32 }
define void @print_array(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca %struct.C_Map_MatrixXd*
store double* %0, double** %3
store i32 %1, i32* %4
%6 = load double*, double** %3
%7 = load i32, i32* %4
%8 = call %struct.C_Map_MatrixXd* @Map_MatrixXd_new(double* %6, i32 1, i32 %7)
store %struct.C_Map_MatrixXd* %8, %struct.C_Map_MatrixXd** %5
%9 = load %struct.C_Map_MatrixXd*, %struct.C_Map_MatrixXd** %5
%10 = call i32 @Map_MatrixXd_print(%struct.C_Map_MatrixXd* %9)
%11 = load %struct.C_Map_MatrixXd*, %struct.C_Map_MatrixXd** %5
%12 = call i32 @Map_MatrixXd_delete(%struct.C_Map_MatrixXd* %11)
ret void
}

LLVM IR (-O2):
%struct.C_Map_MatrixXd = type { i32 }
define void @print_array(double* %0, i32 %1) {
%3 = tail call %struct.C_Map_MatrixXd* @Map_MatrixXd_new(double* %0, i32 1, i32 %1)
%4 = tail call i32 @Map_MatrixXd_print(%struct.C_Map_MatrixXd* %3)
%5 = tail call i32 @Map_MatrixXd_delete(%struct.C_Map_MatrixXd* %3)
ret void
}
unsigned char convert_unsigned_int_to_unsigned_char(unsigned int x) {
  return x;
}


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

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

LLVM IR (-O0):
define zeroext i8 @convert_unsigned_int_to_unsigned_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @convert_unsigned_int_to_unsigned_char(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
void glClearBufferfi(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glClearBufferfi() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char str[100];
  scanf("%s", str);
  printf("hello %s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [10 x i8] c"hello %s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int getter_file(void *cookie) { return (fgetc((FILE *)cookie)); }


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

x86 assembly (clang, -O2):
<getter_file>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @getter_file(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @fgetc(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ VIM_HIF_SetReg16(int, unsigned short);
void VIM_IPP_SetDisplayDropFrame(unsigned short wDropFrame) {
  VIM_HIF_SetReg16((0x1c00 + 0x05A), wDropFrame);
}


x86 assembly (clang, -O0):
<VIM_IPP_SetDisplayDropFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x1c5a,%edi
movzwl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_IPP_SetDisplayDropFrame>:
mov    %edi,%esi
mov    $0x1c5a,%edi
jmp    1030 <VIM_HIF_SetReg16@plt>

LLVM IR (-O0):
define void @VIM_IPP_SetDisplayDropFrame(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @VIM_HIF_SetReg16(i32 7258, i16 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @VIM_IPP_SetDisplayDropFrame(i16 zeroext %0) {
%2 = tail call i32 @VIM_HIF_SetReg16(i32 7258, i16 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *);
void clear(void) {
  scanf("%*[^\n]");
  scanf("%*c");
}


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

x86 assembly (clang, -O2):
<clear>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <scanf@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <scanf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%*[^\0A]\00"
@.str.1 = [4 x i8] c"%*c\00"
define void @clear() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int num_len(int n) {
  int len;
  len = 0;
  while (n /= 10)
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<num_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1133 <num_len+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <num_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_len>:
lea    0x9(%rdi),%ecx
xor    %eax,%eax
cmp    $0x13,%ecx
jb     1135 <num_len+0x35>
xor    %eax,%eax
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <num_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @num_len(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double GetRealTime(void) {
  struct timeval t;
  if (0 != gettimeofday(&t, NULL))
    assert(0);
  return t.tv_sec + 1.e-6 * t.tv_usec;
}


x86 assembly (clang, -O0):
<GetRealTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     114a <GetRealTime+0x2a>
xor    %edi,%edi
call   1040 <assert@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xea4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRealTime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     113c <GetRealTime+0x1c>
xor    %edi,%edi
call   1040 <assert@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xeb6(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @GetRealTime() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp ne i64 0, %2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @assert(i32 0)
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load double, double* %9
%11 = call double @llvm.fmuladd.f64(double 0x3EB0C6F7A0B5ED8D, double %10, double %8)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @GetRealTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @assert(i32 0)
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load double, double* %10
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %12
}
int fun680() { return 680; }


x86 assembly (clang, -O0):
<fun680>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a8,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun680() {
ret i32 680
}

LLVM IR (-O2):
define i32 @fun680() {
ret i32 680
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ system(char *);
int cleanup() {
  chdir("../");
  system("rm -rf sandbox");
  return 0;
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <chdir@plt>
lea    0xecd(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <chdir@plt>
lea    0xed0(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"../\00"
@.str.1 = [15 x i8] c"rm -rf sandbox\00"
define i32 @cleanup() {
%1 = call i32 @chdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"../\00"
@.str.1 = [15 x i8] c"rm -rf sandbox\00"
define i32 @cleanup() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ wall_time();
double seconds() { return (((double)wall_time()) / 1000); }


x86 assembly (clang, -O0):
<seconds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <wall_time@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<seconds>:
push   %rax
xor    %eax,%eax
call   1030 <wall_time@plt>
cvtsi2sd %rax,%xmm0
divsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @seconds() {
%1 = call i64 (...) @wall_time()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+03
ret double %3
}

LLVM IR (-O2):
define double @seconds() {
%1 = tail call i64 (...) @wall_time()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+03
ret double %3
}
void vhdcFinal() {}


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

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

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

LLVM IR (-O2):
define void @vhdcFinal() {
ret void
}
/* Variables and functions */
unsigned char *hmac_md4(unsigned char *, unsigned char const *, size_t,
                        unsigned char const *, size_t);
unsigned char *mac_hmac_md4(unsigned char *out, const unsigned char *key,
                            size_t key_len, const unsigned char *msg,
                            size_t msg_len) {
  return hmac_md4(out, key, key_len, msg, msg_len);
}


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

x86 assembly (clang, -O2):
<mac_hmac_md4>:
jmp    1030 <hmac_md4@plt>

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

LLVM IR (-O2):
define i8* @mac_hmac_md4(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_md4(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
int compare_decr(const void *a, const void *b) {
  return -(*(float *)a - *(float *)b);
}


x86 assembly (clang, -O0):
<compare_decr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_decr>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
xorps  0xef1(%rip),%xmm0
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @compare_decr(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 = bitcast i8* %5 to float*
%7 = load float, float* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fsub float %7, %10
%12 = fneg float %11
%13 = fptosi float %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @compare_decr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fneg float %7
%9 = fptosi float %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_adds_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_adds_pu8(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_adds_pu8@plt>

LLVM IR (-O0):
define i32 @test(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 @_mm_adds_pu8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_adds_pu8(i32 %0, i32 %1)
ret i32 %3
}
unsigned long int hashit(char *str) {
  unsigned long int hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return (hash);
}


x86 assembly (clang, -O0):
<hashit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <hashit+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hashit+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashit>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hashit+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hashit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
void TestA() {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @TestA() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint16_t;
struct pcg_state_setseq_16 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_16_rxs_m_xs_16_random_r(struct pcg_state_setseq_16 *);
uint16_t
pcg_setseq_16_rxs_m_xs_16_boundedrand_r(struct pcg_state_setseq_16 *rng,
                                        uint16_t bound) {
  uint16_t threshold = ((uint16_t)(-bound)) % bound;
  for (;;) {
    uint16_t r = pcg_setseq_16_rxs_m_xs_16_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_16_rxs_m_xs_16_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_16_rxs_m_xs_16_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_16_rxs_m_xs_16_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_16_rxs_m_xs_16_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_16_rxs_m_xs_16_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_16_rxs_m_xs_16_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_16_rxs_m_xs_16_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_16 = type { i32 }
define i32 @pcg_setseq_16_rxs_m_xs_16_boundedrand_r(%struct.pcg_state_setseq_16* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_16*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_16* %0, %struct.pcg_state_setseq_16** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_16*, %struct.pcg_state_setseq_16** %3
%13 = call i32 @pcg_setseq_16_rxs_m_xs_16_random_r(%struct.pcg_state_setseq_16* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_16 = type { i32 }
define i32 @pcg_setseq_16_rxs_m_xs_16_boundedrand_r(%struct.pcg_state_setseq_16* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_16_rxs_m_xs_16_random_r(%struct.pcg_state_setseq_16* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}