xunge/DecIR huggingface dataset:
void char_to_dados(char *asciidados, int *dados) {
  do {
    *dados++ = *asciidados++ - '0';
  } while (*asciidados);
}


x86 assembly (clang, -O0):
<char_to_dados>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
sub    $0x30,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    110c <char_to_dados+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_dados>:
mov    (%rdi),%cl
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
mov    %ecx,(%rsi,%rax,4)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <char_to_dados+0x10>
ret

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

LLVM IR (-O2):
define void @char_to_dados(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %4, %2
%5 = phi i8 [ %3, %2 ], [ %12, %4 ]
%6 = phi i8* [ %0, %2 ], [ %8, %4 ]
%7 = phi i32* [ %1, %2 ], [ %11, %4 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i32
%10 = add nsw i32 %9, -48
%11 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %10, i32* %7
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cBreak();
int /*<<< orphan*/ dash();
int /*<<< orphan*/ dot();
void sL() {
  dot();
  dash();
  dot();
  dot();
  cBreak();
}


x86 assembly (clang, -O0):
<sL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1040 <dash@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1030 <dot@plt>
mov    $0x0,%al
call   1050 <cBreak@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sL>:
push   %rax
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1040 <dash@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
call   1030 <dot@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cBreak@plt>

LLVM IR (-O0):
define void @sL() {
%1 = call i32 (...) @dot()
%2 = call i32 (...) @dash()
%3 = call i32 (...) @dot()
%4 = call i32 (...) @dot()
%5 = call i32 (...) @cBreak()
ret void
}

LLVM IR (-O2):
define void @sL() {
%1 = tail call i32 (...) @dot()
%2 = tail call i32 (...) @dash()
%3 = tail call i32 (...) @dot()
%4 = tail call i32 (...) @dot()
%5 = tail call i32 (...) @cBreak()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb2() {
  Assert_real((isodigit(178) == 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_isodigit.c",
              895, ("isodigit should be 0 for 0xb2"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xb2>:
push   %rax
mov    $0xb2,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x37f,%edx
pop    %rax
jmp    1030 <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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb2\00"
define void @t_isodigit_0xb2() {
%1 = call i64 @isodigit(i32 178)
%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 895, 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb2\00"
define void @t_isodigit_0xb2() {
%1 = tail call i64 @isodigit(i32 178)
%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 895, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ gmp_die(char *);
void *malloc(size_t);
void *gmp_default_alloc(size_t size) {
  void *p;
  assert(size > 0);
  p = malloc(size);
  if (!p)
    gmp_die("gmp_default_alloc: Virtual memory exhausted.");
  return p;
}


x86 assembly (clang, -O0):
<gmp_default_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1172 <gmp_default_alloc+0x42>
lea    0xe93(%rip),%rdi
call   1050 <gmp_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmp_default_alloc>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115e <gmp_default_alloc+0x2e>
lea    0xea7(%rip),%rdi
call   1050 <gmp_die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"gmp_default_alloc: Virtual memory exhausted.\00"
define i8* @gmp_default_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %2
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %1
%13 = call i32 @gmp_die(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@.str = [45 x i8] c"gmp_default_alloc: Virtual memory exhausted.\00"
define noalias i8* @gmp_default_alloc(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @gmp_die(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ dump_prov_ies(char *, int, unsigned char *, int);
void dump_prov(char *output, int maxlen, void *value, int len) {
  dump_prov_ies(output, maxlen, (unsigned char *)value, len);
}


x86 assembly (clang, -O0):
<dump_prov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <dump_prov_ies@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_prov>:
jmp    1030 <dump_prov_ies@plt>

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

LLVM IR (-O2):
define void @dump_prov(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @dump_prov_ies(i8* %0, i32 %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int _link(const char *d, const char *n) {
  assert(0);
  return -1;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 -1
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int str_equal(const char *a, const char *b) { return strcmp(a, b) == 0; }


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

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

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

LLVM IR (-O2):
define i32 @str_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ test();
void init_test() { test(); }


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

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

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

LLVM IR (-O2):
define void @init_test() {
%1 = tail call i32 (...) @test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, int, size_t);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == NULL)
    eprintf("malloc of %u bytes failed:",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/carlo0815/gstreamer1.7.1/refs/heads/"
            "master/libs/gst/check/libcheck/check_error.c",
            66 - 2, n);
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <emalloc+0x40>
mov    -0x8(%rbp),%rcx
lea    0xeb1(%rip),%rdi
lea    0xec5(%rip),%rsi
mov    $0x40,%edx
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <emalloc+0x2f>
lea    0xec5(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x40,%edx
mov    %r14,%rcx
call   1040 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"malloc of %u bytes failed:\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/carlo0815/gstreamer1.7.1/refs/heads/master/libs/gst/check/libcheck/check_error.c\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @eprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 64, i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [27 x i8] c"malloc of %u bytes failed:\00"
@.str.1 = [171 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/carlo0815/gstreamer1.7.1/refs/heads/master/libs/gst/check/libcheck/check_error.c\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str.1, i64 0, i64 0), i32 64, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ f2(int);
void f(int n) {
  if (n < 3)
    return;
  n--;
  f2(n);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    112a <f+0x1a>
jmp    113b <f+0x2b>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x3,%edi
jge    1116 <f+0x6>
ret
add    $0xffffffff,%edi
jmp    1030 <f2@plt>

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

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f2(i32 %4)
br label %6
6: ; preds = %1, %3
ret void
}
int clad_compared(double one, double two) {
  if (one < two)
    return -1;
  if (one > two)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<clad_compared>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    112e <clad_compared+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <clad_compared+0x51>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    114a <clad_compared+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <clad_compared+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_compared>:
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clad_compared(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = fcmp ogt double %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
int calculate_3sum(int s1, int s2, int s3) { return s1 + s2 + s3; }


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

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

LLVM IR (-O0):
define i32 @calculate_3sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @calculate_3sum(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct spe_fd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_char(struct spe_fd *, char const);
int print_string(struct spe_fd *fd, const char *string) {
  int i;
  for (i = 0; string[i] != 0; i++) {
    print_char(fd, string[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <print_string+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <print_char@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <print_string+0x17>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <print_string+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_string+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.spe_fd = type { i32 }
define i32 @print_string(%struct.spe_fd* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @print_char(%struct.spe_fd* %0, i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
int luaO_int2fb(unsigned int x) {
  int e = 0;
  while (x >= 16) {
    x = (x + 1) >> 1;
    e++;
  }
  if (x < 8)
    return x;
  else
    return ((e + 1) << 3) | (((int)((x))) - 8);
}


x86 assembly (clang, -O0):
<luaO_int2fb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0x8(%rbp)
jb     1132 <luaO_int2fb+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <luaO_int2fb+0xe>
cmpl   $0x8,-0x8(%rbp)
jae    1147 <luaO_int2fb+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <luaO_int2fb+0x5b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%ecx
sub    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaO_int2fb>:
mov    $0x8,%ecx
cmp    $0x10,%edi
jb     1123 <luaO_int2fb+0x23>
mov    $0x8,%ecx
nop
add    $0x1,%edi
mov    %edi,%edx
shr    %edx
add    $0x8,%ecx
cmp    $0x1f,%edi
mov    %edx,%edi
ja     1110 <luaO_int2fb+0x10>
jmp    1125 <luaO_int2fb+0x25>
mov    %edi,%edx
lea    -0x8(%rdx),%eax
or     %ecx,%eax
cmp    $0x8,%edx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @luaO_int2fb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp uge i32 %6, 16
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add i32 %9, 1
%11 = lshr i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
%16 = icmp ult i32 %15, 8
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = load i32, i32* %3
store i32 %18, i32* %2
br label %26
19: ; preds = %14
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
%22 = shl i32 %21, 3
%23 = load i32, i32* %3
%24 = sub nsw i32 %23, 8
%25 = or i32 %22, %24
store i32 %25, i32* %2
br label %26
26: ; preds = %19, %17
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @luaO_int2fb(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %5, 1
%7 = lshr i32 %6, 1
%8 = add i32 %4, 1
%9 = icmp ugt i32 %6, 31
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = shl i32 %8, 3
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ %0, %1 ], [ %7, %10 ]
%14 = phi i32 [ 8, %1 ], [ %11, %10 ]
%15 = icmp ult i32 %13, 8
%16 = add nsw i32 %13, -8
%17 = or i32 %14, %16
%18 = select i1 %15, i32 %13, i32 %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ vboxCConv();
void main(void) { vboxCConv(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @vboxCConv()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    puts(argv[i]);
  }
  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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
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
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @puts(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
typedef long uint32_t;
struct itimer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ timer_interval_start(struct itimer *, long);
void timer_interval_start_minutes(struct itimer *t, uint32_t minutes) {
  uint32_t interval = minutes;
  interval *= 1000L;
  interval *= 60L;
  timer_interval_start(t, interval);
}


x86 assembly (clang, -O0):
<timer_interval_start_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
imul   $0x3e8,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
imul   $0x3c,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <timer_interval_start@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_interval_start_minutes>:
imul   $0xea60,%rsi,%rsi
jmp    1030 <timer_interval_start@plt>

LLVM IR (-O0):
%struct.itimer = type { i32 }
define void @timer_interval_start_minutes(%struct.itimer* %0, i64 %1) {
%3 = alloca %struct.itimer*
%4 = alloca i64
%5 = alloca i64
store %struct.itimer* %0, %struct.itimer** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
store i64 %6, i64* %5
%7 = load i64, i64* %5
%8 = mul nsw i64 %7, 1000
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = mul nsw i64 %9, 60
store i64 %10, i64* %5
%11 = load %struct.itimer*, %struct.itimer** %3
%12 = load i64, i64* %5
%13 = call i32 @timer_interval_start(%struct.itimer* %11, i64 %12)
ret void
}

LLVM IR (-O2):
%struct.itimer = type { i32 }
define void @timer_interval_start_minutes(%struct.itimer* %0, i64 %1) {
%3 = mul i64 %1, 60000
%4 = tail call i32 @timer_interval_start(%struct.itimer* %0, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ load_xmm(int, void *);
int /*<<< orphan*/ print_vec_int16(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
void print_xmm_int16(int i) {
  static int16_t v[8];
  load_xmm(i, (void *)v);
  printf("xmm%d = ", i);
  print_vec_int16(v);
}


x86 assembly (clang, -O0):
<print_xmm_int16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
call   1040 <load_xmm@plt>
mov    -0x4(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
lea    0x2ef0(%rip),%rdi
call   1050 <print_vec_int16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xmm_int16>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x2f13(%rip),%r14
mov    %r14,%rsi
call   1040 <load_xmm@plt>
lea    0xeb4(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <print_vec_int16@plt>

LLVM IR (-O0):
@print_xmm_int16.v = internal global [8 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_int16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @load_xmm(i32 %3, i8* bitcast ([8 x i32]* @print_xmm_int16.v to i8*))
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @print_vec_int16(i32* getelementptr inbounds ([8 x i32], [8 x i32]* @print_xmm_int16.v, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@print_xmm_int16.v = internal global [8 x i32] zeroinitializer
@.str = [9 x i8] c"xmm%d = \00"
define void @print_xmm_int16(i32 %0) {
%2 = tail call i32 @load_xmm(i32 %0, i8* bitcast ([8 x i32]* @print_xmm_int16.v to i8*))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @print_vec_int16(i32* getelementptr inbounds ([8 x i32], [8 x i32]* @print_xmm_int16.v, i64 0, i64 0))
ret void
}
void runTestCase(void) {}


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

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

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

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

/* Variables and functions */
void I2CSlaveACKOverride(uint32_t ui32Base, bool bEnable) {
  ;
  if (bEnable) {
    (*((volatile unsigned long *)(ui32Base + 0x00000820))) |= 0x00000001;
  } else {
    (*((volatile unsigned long *)(ui32Base + 0x00000820))) &= ~0x00000001;
  }
}


x86 assembly (clang, -O0):
<I2CSlaveACKOverride>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1130 <I2CSlaveACKOverride+0x30>
mov    -0x8(%rbp),%rax
mov    0x820(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x820(%rax)
jmp    1146 <I2CSlaveACKOverride+0x46>
mov    -0x8(%rbp),%rax
mov    0x820(%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x820(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveACKOverride>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
mov    0x820(%rdi),%rcx
and    $0xfffffffffffffffe,%rcx
or     %rcx,%rax
mov    %rax,0x820(%rdi)
ret

LLVM IR (-O0):
define void @I2CSlaveACKOverride(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 2080
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 1
store volatile i64 %12, i64* %10
br label %19
13: ; preds = %2
%14 = load i64, i64* %3
%15 = add nsw i64 %14, 2080
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = and i64 %17, -2
store volatile i64 %18, i64* %16
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @I2CSlaveACKOverride(i64 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = add nsw i64 %0, 2080
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2
%8 = zext i1 %3 to i64
%9 = or i64 %7, %8
store volatile i64 %9, i64* %5
ret void
}
/* Variables and functions */
long double __qatan(long double);
long double intr_wrap_016(long double p1) { return __qatan(p1); }


x86 assembly (clang, -O0):
<intr_wrap_016>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qatan@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_016>:
jmp    1030 <__qatan@plt>

LLVM IR (-O0):
define x86_fp80 @intr_wrap_016(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @__qatan(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_016(x86_fp80 %0) {
%2 = tail call x86_fp80 @__qatan(x86_fp80 %0)
ret x86_fp80 %2
}
void plugin_exit_time(void) {}


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

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

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

LLVM IR (-O2):
define void @plugin_exit_time() {
ret void
}
/* Variables and functions */
char *__cxa_demangle(char const *, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
char *demangle_symbol_name(const char *name) {
  return name ? __cxa_demangle(name, 0, 0, 0) : "";
}


x86 assembly (clang, -O0):
<demangle_symbol_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113f <demangle_symbol_name+0x2f>
mov    -0x8(%rbp),%rdi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <__cxa_demangle@plt>
mov    %rax,-0x10(%rbp)
jmp    114f <demangle_symbol_name+0x3f>
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    114f <demangle_symbol_name+0x3f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<demangle_symbol_name>:
test   %rdi,%rdi
je     1120 <demangle_symbol_name+0x10>
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <__cxa_demangle@plt>
lea    0xed9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @demangle_symbol_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i8* @__cxa_demangle(i8* %6, i32 0, i32 0, i32 0)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %8 ]
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @demangle_symbol_name(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @__cxa_demangle(i8* %0, i32 0, i32 0, i32 0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Type definitions */
struct conscell {
  int dummy;
};

/* Variables and functions */
void initatoms() {
  int i;
  extern struct conscell *atomtable[];
  for (i = 0; i < 1499; atomtable[i++] = ((struct conscell *)(NULL)))
    ;
}


x86 assembly (clang, -O0):
<initatoms>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5db,-0x4(%rbp)
jge    113f <initatoms+0x3f>
jmp    111d <initatoms+0x1d>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
movslq %eax,%rcx
mov    0x2ec6(%rip),%rax
movq   $0x0,(%rax,%rcx,8)
jmp    110b <initatoms+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initatoms>:
push   %rax
mov    0x2ee0(%rip),%rdi
mov    $0x2ed8,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.conscell = type { i32 }
@atomtable = external global [0 x %struct.conscell*]
define void @initatoms() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1499
br i1 %4, label %5, label %11
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds [0 x %struct.conscell*], [0 x %struct.conscell*]* @atomtable, i64 0, i64 %9
store %struct.conscell* null, %struct.conscell** %10
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.conscell = type { i32 }
@atomtable = external global [0 x %struct.conscell*]
define void @initatoms() {
ret void
}
/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ printf(char *);
int is_root() {
  if (geteuid() == 0)
    return 1;
  printf("Needs to be ran as root\n");
  return 0;
}


x86 assembly (clang, -O0):
<is_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    1145 <is_root+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1158 <is_root+0x38>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_root>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
je     113d <is_root+0x1d>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
jmp    1142 <is_root+0x22>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Needs to be ran as root\0A\00"
define i32 @is_root() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %7
7: ; preds = %5, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@str = [24 x i8] c"Needs to be ran as root\00"
define i32 @is_root() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
int test_imm_32int8_reg(signed char val) {
  return ((val) & (0x32 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_32int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x32,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_32int8_reg>:
test   $0x32,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_32int8_reg(i8 signext %0) {
%2 = and i8 %0, 50
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void delay_ms(int miliseconds) {
  int i;
  while (miliseconds) {
    for (i = 0; i < 100000; ++i)
      ;
    --miliseconds;
  }
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <delay_ms+0x46>
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    1138 <delay_ms+0x38>
jmp    112a <delay_ms+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1118 <delay_ms+0x18>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay_ms+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
void printeltname2(void *d, const char *name, int l) {
  int i;
  putchar('/');
  for (i = 0; i < l; i++)
    putchar(name[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<printeltname2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x2f,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <printeltname2+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1134 <printeltname2+0x24>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printeltname2>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    $0x2f,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    1143 <printeltname2+0x33>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <printeltname2+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printeltname2(i8* nocapture readnone %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @putchar(i8 signext 47)
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @putchar(i8 signext %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %3
%16 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void put_16bitLE(uint8_t *buf, uint16_t v) {
  for (unsigned int i = 0; i < 2; i++) {
    buf[i] = v & 0xFF;
    v >>= 8;
  }
}


x86 assembly (clang, -O0):
<put_16bitLE>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jae    1146 <put_16bitLE+0x46>
mov    -0xc(%rbp),%edx
and    $0xff,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <put_16bitLE+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_16bitLE>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @put_16bitLE(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = icmp ult i32 %7, 2
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 %11, i32* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 8
store i32 %17, i32* %4
br label %18
18: ; preds = %9
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @put_16bitLE(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
store i32 %3, i32* %0
%4 = lshr i32 %1, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arrCpy(int *, int *);
int /*<<< orphan*/ arrPrint(int *);
int *arrRead();
int main() {
  int *x = arrRead();
  arrPrint(x);
  int *y = arrRead();
  arrPrint(y);
  arrCpy(x, y);
  arrPrint(x);
  arrPrint(y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <arrRead@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <arrPrint@plt>
mov    $0x0,%al
call   1050 <arrRead@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <arrPrint@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <arrCpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <arrPrint@plt>
mov    -0x18(%rbp),%rdi
call   1030 <arrPrint@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <arrRead@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1030 <arrPrint@plt>
xor    %eax,%eax
call   1050 <arrRead@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <arrPrint@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <arrCpy@plt>
mov    %r14,%rdi
call   1030 <arrPrint@plt>
mov    %rbx,%rdi
call   1030 <arrPrint@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* (...) @arrRead()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @arrPrint(i32* %5)
%7 = call i32* (...) @arrRead()
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = call i32 @arrPrint(i32* %8)
%10 = load i32*, i32** %2
%11 = load i32*, i32** %3
%12 = call i32 @arrCpy(i32* %10, i32* %11)
%13 = load i32*, i32** %2
%14 = call i32 @arrPrint(i32* %13)
%15 = load i32*, i32** %3
%16 = call i32 @arrPrint(i32* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @arrRead()
%2 = tail call i32 @arrPrint(i32* %1)
%3 = tail call i32* (...) @arrRead()
%4 = tail call i32 @arrPrint(i32* %3)
%5 = tail call i32 @arrCpy(i32* %1, i32* %3)
%6 = tail call i32 @arrPrint(i32* %1)
%7 = tail call i32 @arrPrint(i32* %3)
ret i32 0
}
int Unit_of(int n) {
  int num;
  num = n % 100;
  return num;
}


x86 assembly (clang, -O0):
<Unit_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Unit_of>:
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @Unit_of(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = srem i32 %4, 100
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @Unit_of(i32 %0) {
%2 = srem i32 %0, 100
ret i32 %2
}
int energymon_is_exclusive_dummy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @energymon_is_exclusive_dummy() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430InterruptC__2__HplInterrupt__fired();
void HplMsp430InterruptP__Port15__fired(void) {
  Msp430InterruptC__2__HplInterrupt__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port15__fired() {
%1 = tail call i32 (...) @Msp430InterruptC__2__HplInterrupt__fired()
ret void
}
int hpet_enable(void) { return 0; }


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

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

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

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