xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
unsigned int tests_get_free_space();
uint64_t tests_get_big_file_size(unsigned numerator, unsigned denominator) {
  if (denominator == 0)
    denominator = 1;
  if (numerator > denominator)
    numerator = denominator;
  return numerator * (tests_get_free_space() / denominator);
}


x86 assembly (clang, -O0):
<tests_get_big_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112f <tests_get_big_file_size+0x1f>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1141 <tests_get_big_file_size+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <tests_get_free_space@plt>
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tests_get_big_file_size>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
mov    $0x1,%ebp
cmovne %esi,%ebp
mov    %edi,%ebx
cmp    %edi,%ebp
cmovb  %ebp,%ebx
xor    %eax,%eax
call   1030 <tests_get_free_space@plt>
xor    %edx,%edx
div    %ebp
imul   %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @tests_get_big_file_size(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 1, i32 %1
%5 = icmp ult i32 %4, %0
%6 = select i1 %5, i32 %4, i32 %0
%7 = tail call i32 (...) @tests_get_free_space()
%8 = udiv i32 %7, %4
%9 = mul i32 %8, %6
ret i32 %9
}
int qryopt_get_index_col(int colmap) {
  int colidx;
  int tmp_colmap;
  colidx = 0;
  tmp_colmap = colmap;
  while (tmp_colmap) {
    tmp_colmap >>= 1;
    colidx++;
  }
  return colidx;
}


x86 assembly (clang, -O0):
<qryopt_get_index_col>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1135 <qryopt_get_index_col+0x35>
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <qryopt_get_index_col+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qryopt_get_index_col>:
xor    %eax,%eax
test   %edi,%edi
je     111c <qryopt_get_index_col+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <qryopt_get_index_col+0x10>
ret

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

LLVM IR (-O2):
define i32 @qryopt_get_index_col(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = ashr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp ult i32 %4, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
char *gnu_basename(filename) const char *filename;
{
  char *p = strrchr(filename, '/');
  return p ? p + 1 : (char *)filename;
}


x86 assembly (clang, -O0):
<gnu_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <gnu_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <gnu_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @gnu_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @gnu_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x9c() {
  Assert_real((isprint(156) == 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_isprint.c",
              785, ("isprint should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x9c\00"
define void @t_isprint_0x9c() {
%1 = call i64 @isprint(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x9c\00"
define void @t_isprint_0x9c() {
%1 = tail call i64 @isprint(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_unpacklo_pi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 __attribute__((no, unused)) test(__m64 s1, __m64 s2) {
  return _mm_unpacklo_pi8(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_unpacklo_pi8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_unpacklo_pi8@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_unpacklo_pi8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_unpacklo_pi8(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int GLint;
typedef scalar_t__ GLenum;

/* Variables and functions */
scalar_t__ GL_COLOR_INDEX;
scalar_t__ GL_STENCIL_INDEX;
GLint is_index(GLenum format) {
  return format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX;
}


x86 assembly (clang, -O0):
<is_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
mov    0x2ecb(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1135 <is_index+0x35>
mov    -0x8(%rbp),%rax
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_index>:
mov    0x2ed9(%rip),%rax
cmp    %rdi,(%rax)
sete   %al
mov    0x2ed4(%rip),%rcx
cmp    %rdi,(%rcx)
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@GL_COLOR_INDEX = global i64 0
@GL_STENCIL_INDEX = global i64 0
define i32 @is_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @GL_COLOR_INDEX
%5 = icmp eq i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = load i64, i64* @GL_STENCIL_INDEX
%9 = icmp eq i64 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@GL_COLOR_INDEX = global i64 0
@GL_STENCIL_INDEX = global i64 0
define i32 @is_index(i64 %0) {
%2 = load i64, i64* @GL_COLOR_INDEX
%3 = icmp eq i64 %2, %0
%4 = load i64, i64* @GL_STENCIL_INDEX
%5 = icmp eq i64 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
bool __str_startswith(const char *restrict str, const char *restrict prefix) {
  do
    if ('\0' == *prefix)
      return true;
  while (*str++ == *prefix++);
  return false;
}


x86 assembly (clang, -O0):
<__str_startswith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1129 <__str_startswith+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1161 <__str_startswith+0x61>
jmp    112e <__str_startswith+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     110c <__str_startswith+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__str_startswith>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
test   %cl,%cl
je     1127 <__str_startswith+0x27>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <__str_startswith+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @__str_startswith(i8* noalias nocapture %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %8, %3
%14 = phi i32 [ 1, %3 ], [ 0, %8 ]
ret i32 %14
}
int max(int *arr, int sz) {
  static int m = 0, ii = 0;
  if (ii < sz) {
    if (*(arr + ii) > m)
      m = *(arr + ii);
    ii++;
    max((arr), sz);
  }
  return m;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2f0b(%rip),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <max+0x67>
mov    -0x8(%rbp),%rax
movslq 0x2ef7(%rip),%rcx
mov    (%rax,%rcx,4),%eax
cmp    0x2eea(%rip),%eax
jle    115c <max+0x4c>
mov    -0x8(%rbp),%rax
movslq 0x2edd(%rip),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,0x2ed0(%rip)
mov    0x2ece(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ec5(%rip)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <max@plt>
mov    0x2eaf(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
push   %rax
movslq 0x2f18(%rip),%rax
cmp    %esi,%eax
jge    113b <max+0x2b>
mov    (%rdi,%rax,4),%ecx
cmp    0x2f07(%rip),%ecx
jle    112d <max+0x1d>
mov    %ecx,0x2eff(%rip)
add    $0x1,%eax
mov    %eax,0x2efa(%rip)
call   1030 <max@plt>
mov    0x2eeb(%rip),%eax
pop    %rcx
ret

LLVM IR (-O0):
@max.m = internal global i32 0
@max.ii = internal global i32 0
define i32 @max(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* @max.ii
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %28
8: ; preds = %2
%9 = load i32*, i32** %3
%10 = load i32, i32* @max.ii
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* @max.m
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %8
%17 = load i32*, i32** %3
%18 = load i32, i32* @max.ii
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %17, i64 %19
%21 = load i32, i32* %20
store i32 %21, i32* @max.m
br label %22
22: ; preds = %16, %8
%23 = load i32, i32* @max.ii
%24 = add nsw i32 %23, 1
store i32 %24, i32* @max.ii
%25 = load i32*, i32** %3
%26 = load i32, i32* %4
%27 = call i32 @max(i32* %25, i32 %26)
br label %28
28: ; preds = %22, %2
%29 = load i32, i32* @max.m
ret i32 %29
}

LLVM IR (-O2):
@max.m = internal unnamed_addr global i32 0
@max.ii = internal unnamed_addr global i32 0
define i32 @max(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* @max.ii
%4 = icmp slt i32 %3, %1
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = load i32, i32* @max.m
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
store i32 %8, i32* @max.m
br label %12
12: ; preds = %11, %5
%13 = add nsw i32 %3, 1
store i32 %13, i32* @max.ii
%14 = tail call i32 @max(i32* %0, i32 %1)
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* @max.m
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ alter(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *animal = "cat";
  printf("Turn the %s ", animal);
  alter(animal);
  printf("into a %s\n", animal);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xedc(%rip),%rdi
lea    0xed1(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <alter@plt>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cat\00"
@.str.1 = [13 x i8] c"Turn the %s \00"
@.str.2 = [11 x i8] c"into a %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @alter(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cat\00"
@.str.1 = [13 x i8] c"Turn the %s \00"
@.str.2 = [11 x i8] c"into a %s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @alter(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int null_is_muted(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @null_is_muted() {
ret i32 0
}
int whitespace(ch)
char ch;
{
  switch (ch) {
  case ' ':
  case '\n':
  case 0x0D:
  case '\t':
    return (1);
  default:
    return (0);
  }
}


x86 assembly (clang, -O0):
<whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     1144 <whitespace+0x44>
jmp    1122 <whitespace+0x22>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
je     1144 <whitespace+0x44>
jmp    1133 <whitespace+0x33>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1150 <whitespace+0x50>
jmp    1144 <whitespace+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1157 <whitespace+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<whitespace>:
movsbl %dil,%ecx
cmp    $0x20,%ecx
ja     111f <whitespace+0x1f>
mov    $0x1,%eax
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111f <whitespace+0x1f>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @whitespace(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %8 [
i32 32, label %7
i32 10, label %7
i32 13, label %7
i32 9, label %7
]
7: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @whitespace(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
switch i32 %3, label %4 [
i32 32, label %5
i32 10, label %5
i32 13, label %5
i32 9, label %5
]
4: ; preds = %1
br label %5
5: ; preds = %1, %1, %1, %1, %4
%6 = phi i32 [ 0, %4 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(int, char *);
int flag_attention(unsigned char *element, int element_len) {
  lprintf(6, " - ATTENTION - \r\n");
  return 0;
}


x86 assembly (clang, -O0):
<flag_attention>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x6,%edi
lea    0xed5(%rip),%rsi
call   1030 <lprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c" - ATTENTION - \0D\0A\00"
define i32 @flag_attention(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @lprintf(i32 6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c" - ATTENTION - \0D\0A\00"
define i32 @flag_attention(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @lprintf(i32 6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void __ompc_begin(void) {}


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

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

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

LLVM IR (-O2):
define void @__ompc_begin() {
ret void
}
/* Variables and functions */
int BKDRHash(char *);
unsigned int s_hash(char *key, int bucket_size) {
  return BKDRHash(key) % bucket_size;
}


x86 assembly (clang, -O0):
<s_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <BKDRHash@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_hash>:
push   %rbx
mov    %esi,%ebx
call   1030 <BKDRHash@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @s_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @BKDRHash(i8* %5)
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @s_hash(i8* %0, i32 %1) {
%3 = tail call i32 @BKDRHash(i8* %0)
%4 = srem i32 %3, %1
ret i32 %4
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_ni_syscall(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_ni_syscall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_ni_syscall>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_ni_syscall(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_ni_syscall(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;

/* Variables and functions */
int /*<<< orphan*/ strtoull(char const *, char **, int);
uintmax_t strtoumax(const char *restrict s, char **restrict p, int base) {
  return strtoull(s, p, base);
}


x86 assembly (clang, -O0):
<strtoumax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoumax>:
jmp    1030 <strtoull@plt>

LLVM IR (-O0):
define i32 @strtoumax(i8* noalias %0, i8** noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 @strtoull(i8* %7, i8** %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @strtoumax(i8* noalias %0, i8** noalias nocapture %1, i32 %2) {
%4 = tail call i32 @strtoull(i8* %0, i8** %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord4i(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
void TexCoord4i(GLint s, GLint t, GLint r, GLint q) {
  glTexCoord4i(s, t, r, q);
}


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

x86 assembly (clang, -O2):
<TexCoord4i>:
jmp    1030 <glTexCoord4i@plt>

LLVM IR (-O0):
define void @TexCoord4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @glTexCoord4i(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @TexCoord4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glTexCoord4i(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_version(void) {
  printf("gzip compression program v"
         "1.7"
         "\n"
         "Copyright 2016 Eric Biggers\n"
         "\n"
         "This program is free software which may be modified and/or "
         "redistributed\n"
         "under the terms of the MIT license.  There is NO WARRANTY, to the "
         "extent\n"
         "permitted by law.  See the COPYING file for details.\n");
}


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

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

LLVM IR (-O0):
@.str = [259 x i8] c"gzip compression program v1.7\0ACopyright 2016 Eric Biggers\0A\0AThis program is free software which may be modified and/or redistributed\0Aunder the terms of the MIT license. There is NO WARRANTY, to the extent\0Apermitted by law. See the COPYING file for details.\0A\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([259 x i8], [259 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [258 x i8] c"gzip compression program v1.7\0ACopyright 2016 Eric Biggers\0A\0AThis program is free software which may be modified and/or redistributed\0Aunder the terms of the MIT license. There is NO WARRANTY, to the extent\0Apermitted by law. See the COPYING file for details.\00"
define void @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([258 x i8], [258 x i8]* @str, i64 0, i64 0))
ret void
}
void RTRandAdvU32(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandAdvU32() {
ret void
}
/* Variables and functions */
size_t frag_svc_read(void *buf, size_t len, size_t n, void *fh) { return 0; }


x86 assembly (clang, -O0):
<frag_svc_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @frag_svc_read(i8* %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
ret i64 0
}

LLVM IR (-O2):
define i64 @frag_svc_read(i8* nocapture readnone %0, i64 %1, i64 %2, i8* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  int height;
  printf("我这麽高了%d", height);
  puts("hello");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\E6\88\91\E8\BF\99\E9\BA\BD\E9\AB\98\E4\BA\86%d\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\E6\88\91\E8\BF\99\E9\BA\BD\E9\AB\98\E4\BA\86%d\00"
@.str.1 = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 undef)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct roff_node {
  int dummy;
};
struct roff_meta {
  int dummy;
};
struct html {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_paragraph(struct html *);
int mdoc_pp_pre(const struct roff_meta *meta, struct roff_node *n,
                struct html *h) {
  print_paragraph(h);
  return 0;
}


x86 assembly (clang, -O0):
<mdoc_pp_pre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <print_paragraph@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdoc_pp_pre>:
push   %rax
mov    %rdx,%rdi
call   1030 <print_paragraph@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
%struct.html = type { i32 }
define i32 @mdoc_pp_pre(%struct.roff_meta* %0, %struct.roff_node* %1, %struct.html* %2) {
%4 = alloca %struct.roff_meta*
%5 = alloca %struct.roff_node*
%6 = alloca %struct.html*
store %struct.roff_meta* %0, %struct.roff_meta** %4
store %struct.roff_node* %1, %struct.roff_node** %5
store %struct.html* %2, %struct.html** %6
%7 = load %struct.html*, %struct.html** %6
%8 = call i32 @print_paragraph(%struct.html* %7)
ret i32 0
}

LLVM IR (-O2):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
%struct.html = type { i32 }
define i32 @mdoc_pp_pre(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1, %struct.html* %2) {
%4 = tail call i32 @print_paragraph(%struct.html* %2)
ret i32 0
}
double vector_dot_product3(double a[3], double b[3]) {
  double m = 0;
  for (int i = 0; i < 3; ++i) {
    m += a[i] * b[i];
  }
  return m;
}


x86 assembly (clang, -O0):
<vector_dot_product3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    115f <vector_dot_product3+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <vector_dot_product3+0x1b>
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_dot_product3>:
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
mulsd  (%rsi),%xmm0
xorpd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
mulsd  0x8(%rsi),%xmm1
addsd  %xmm2,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @vector_dot_product3(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca i32
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %5
store i32 0, i32* %6
br label %7
7: ; preds = %23, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 3
br i1 %9, label %10, label %26
10: ; preds = %7
%11 = load double*, double** %3
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = load double*, double** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds double, double* %16, i64 %18
%20 = load double, double* %19
%21 = load double, double* %5
%22 = call double @llvm.fmuladd.f64(double %15, double %20, double %21)
store double %22, double* %5
br label %23
23: ; preds = %10
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
store i32 %25, i32* %6
br label %7
26: ; preds = %7
%27 = load double, double* %5
ret double %27
}

LLVM IR (-O2):
define double @vector_dot_product3(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double 0.000000e+00)
%6 = getelementptr inbounds double, double* %0, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %9, double %5)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char s[2000000];
  scanf("%s", s);
  printf("Hello %s!\n", s);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"Hello %s!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2000000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [2000000 x i8], [2000000 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 [2000000 x i8], [2000000 x i8]* %2, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 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 = [11 x i8] c"Hello %s!\0A\00"
define i32 @main() {
%1 = alloca [2000000 x i8]
%2 = getelementptr inbounds [2000000 x i8], [2000000 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 ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int getchar_unlocked();
int get() {
  int res = 0;
  int c;
  do {
    c = getchar_unlocked();
  } while (c <= 32);
  do {
    res = 10 * res + c - '0';
    c = getchar_unlocked();
  } while (c > 32);
  return res;
}


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jle    111f <get+0xf>
jmp    1138 <get+0x28>
imul   $0xa,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jg     1138 <get+0x28>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
cmp    $0x21,%eax
jl     1120 <get+0x10>
xor    %ebx,%ebx
xchg   %ax,%ax
lea    (%rbx,%rbx,4),%ecx
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
cmp    $0x20,%eax
jg     1130 <get+0x20>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar_unlocked()
%3 = icmp slt i32 %2, 33
br i1 %3, label %1, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %2, %1 ]
%7 = mul nsw i32 %5, 10
%8 = add nsw i32 %6, -48
%9 = add i32 %8, %7
%10 = tail call i32 (...) @getchar_unlocked()
%11 = icmp sgt i32 %10, 32
br i1 %11, label %4, label %12
12: ; preds = %4
ret i32 %9
}
/* Type definitions */
struct fsobject {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ die(char *, unsigned int);
struct fsobject *findsub(struct fsobject *, int, unsigned int);
struct fsobject *finddir(struct fsobject *rootdir, unsigned id) {
  struct fsobject *ret;
  ret = findsub(rootdir, 1, id);
  if (ret == NULL) {
    die("Directory %u not found in current state", id);
  }
  return ret;
}


x86 assembly (clang, -O0):
<finddir>:
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 <findsub@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <finddir+0x3e>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finddir>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    $0x1,%esi
mov    %ebp,%edx
call   1030 <findsub@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1147 <finddir+0x27>
lea    0xec0(%rip),%rdi
mov    %ebp,%esi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.fsobject = type { i32 }
@.str = [40 x i8] c"Directory %u not found in current state\00"
define %struct.fsobject* @finddir(%struct.fsobject* %0, i32 %1) {
%3 = alloca %struct.fsobject*
%4 = alloca i32
%5 = alloca %struct.fsobject*
store %struct.fsobject* %0, %struct.fsobject** %3
store i32 %1, i32* %4
%6 = load %struct.fsobject*, %struct.fsobject** %3
%7 = load i32, i32* %4
%8 = call %struct.fsobject* @findsub(%struct.fsobject* %6, i32 1, i32 %7)
store %struct.fsobject* %8, %struct.fsobject** %5
%9 = load %struct.fsobject*, %struct.fsobject** %5
%10 = icmp eq %struct.fsobject* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %2
%15 = load %struct.fsobject*, %struct.fsobject** %5
ret %struct.fsobject* %15
}

LLVM IR (-O2):
%struct.fsobject = type { i32 }
@.str = [40 x i8] c"Directory %u not found in current state\00"
define %struct.fsobject* @finddir(%struct.fsobject* %0, i32 %1) {
%3 = tail call %struct.fsobject* @findsub(%struct.fsobject* %0, i32 1, i32 %1)
%4 = icmp eq %struct.fsobject* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %7
7: ; preds = %5, %2
ret %struct.fsobject* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_upto(char *str, int idx) {
  for (int i = 0; i <= idx; i++)
    printf("%c", str[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_upto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     115a <print_upto+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_upto+0x16>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_upto>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
js     1143 <print_upto+0x33>
mov    %esi,%r15d
mov    %rdi,%r14
add    $0x1,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <print_upto+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_upto(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @print_upto(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %9
7: ; preds = %9, %2
%8 = tail call i32 @putchar(i32 10)
ret void
9: ; preds = %4, %9
%10 = phi i64 [ 0, %4 ], [ %15, %9 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = tail call i32 @putchar(i32 %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %9
}
domake(ap, c) char **ap;
{
  if (c > 0)
    pbstr(mktemp(ap[1]));
}


x86 assembly (clang, -O0):
<domake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1151 <domake+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <mktemp@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <pbstr@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<domake>:
test   %esi,%esi
jle    113d <domake+0x1d>
push   %rax
mov    0x8(%rdi),%rdi
xor    %eax,%eax
call   1040 <mktemp@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <pbstr@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @domake(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i8** %0, i8*** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @mktemp to i32 (i8*, ...)*)(i8* %11)
%13 = call i32 (i32, ...) bitcast (i32 (...)* @pbstr to i32 (i32, ...)*)(i32 %12)
br label %14
14: ; preds = %8, %2
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @domake(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %0, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mktemp to i32 (i8*, ...)*)(i8* %6)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @pbstr to i32 (i32, ...)*)(i32 %7)
br label %9
9: ; preds = %4, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_fiq(void) { puts("BAD\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_fiq() {
%1 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_fiq() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void ARGBToRGB565Row_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB565Row_Any_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void GP_add_xp(void *arg, int num) { printf("XP # %d\n", num); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"XP # %d\0A\00"
define void @GP_add_xp(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 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"XP # %d\0A\00"
define void @GP_add_xp(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
double toDegrees(double rads) {
  double convert = 360 / (2 * 3.1415926535897932384626433832795);
  return rads * convert;
}


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

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

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

LLVM IR (-O2):
define double @toDegrees(double %0) {
%2 = fmul double %0, 0x404CA5DC1A63C1F8
ret double %2
}