xunge/DecIR huggingface dataset:
int blankstr(char *instring) {
  while (*instring != '\0' && *instring != '#') {
    if (*instring != ' ' && *instring != '\t' && *instring != '\n')
      return (0);
    ++instring;
  };
  return (1);
}


x86 assembly (clang, -O0):
<blankstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     112d <blankstr+0x2d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <blankstr+0x3d>
jmp    118a <blankstr+0x8a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1179 <blankstr+0x79>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1179 <blankstr+0x79>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1179 <blankstr+0x79>
movl   $0x0,-0x4(%rbp)
jmp    1191 <blankstr+0x91>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <blankstr+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankstr>:
movabs $0x100000600,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
cmp    $0x23,%rcx
ja     113b <blankstr+0x3b>
bt     %rcx,%rax
jae    1125 <blankstr+0x25>
add    $0x1,%rdi
jmp    1110 <blankstr+0x10>
movabs $0x800000001,%rax
bt     %rcx,%rax
jae    113b <blankstr+0x3b>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @blankstr(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %8
i8 35, label %8
i8 32, label %5
i8 9, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ], [ 1, %2 ]
ret i32 %9
}
void gdGdcInitSystem(void) {}


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

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

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

LLVM IR (-O2):
define void @gdGdcInitSystem() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ShortSwap(uint16_t s) {
  s = (s >> 8) | (s << 8);
  return s;
}


x86 assembly (clang, -O0):
<ShortSwap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShortSwap>:
mov    %edi,%eax
sar    $0x8,%eax
shl    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @ShortSwap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = or i32 %4, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @ShortSwap(i32 %0) {
%2 = ashr i32 %0, 8
%3 = shl i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glutKeyboardFunc(void (*)(unsigned char, int, int));
void s2winKeyboardFunc(void (*func)(unsigned char key, int x, int y)) {
  glutKeyboardFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winKeyboardFunc>:
jmp    1030 <glutKeyboardFunc@plt>

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

LLVM IR (-O2):
define void @s2winKeyboardFunc(void (i8, i32, i32)* %0) {
%2 = tail call i32 @glutKeyboardFunc(void (i8, i32, i32)* %0)
ret void
}
/* Variables and functions */
int *__errno_location();
void __set_errno(int val) {
  int *error = __errno_location();
  *error = (val);
}


x86 assembly (clang, -O0):
<__set_errno>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__errno_location@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_errno>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__errno_location@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @__set_errno(i32 %0) {
%2 = tail call i32* (...) @__errno_location()
store i32 %0, i32* %2
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
scalar_t__ strlen(char *);
char *str_concat(char *s1, char *s2) {
  char *_str;
  _str = (char *)malloc(strlen(s1) + strlen(s2) + 1);
  sprintf(_str, "%s%s", s1, s2);
  return _str;
}


x86 assembly (clang, -O0):
<str_concat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe83(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_concat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i8* @str_concat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i8* @str_concat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
void ftrace_generate_nop_insn(struct ftrace_insn *insn) {}


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

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

LLVM IR (-O0):
%struct.ftrace_insn = type opaque
define void @ftrace_generate_nop_insn(%struct.ftrace_insn* %0) {
%2 = alloca %struct.ftrace_insn*
store %struct.ftrace_insn* %0, %struct.ftrace_insn** %2
ret void
}

LLVM IR (-O2):
%struct.ftrace_insn = type opaque
define void @ftrace_generate_nop_insn(%struct.ftrace_insn* nocapture %0) {
ret void
}
int e() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @e() {
ret i32 0
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int pid;
  pid = fork();
  printf("%d \n", pid);
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int exact_square(int a) {
  int i;
  for (i = 0; i <= a; i++)
    if (i * i == a)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1149 <exact_square+0x49>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1136 <exact_square+0x36>
movl   $0x1,-0x4(%rbp)
jmp    1150 <exact_square+0x50>
jmp    113b <exact_square+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
js     1120 <exact_square+0x20>
lea    0x1(%rdi),%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1123 <exact_square+0x23>
add    $0x1,%ecx
cmp    %ecx,%eax
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @exact_square(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 = %17, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %4
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %9
store i32 1, i32* %2
br label %21
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 0, i32* %2
br label %21
21: ; preds = %20, %15
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %10, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = mul nsw i32 %7, %7
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
unsigned long VIM_MARB_GetJbufEndAddr(void) {
  unsigned long Temp = 0;
  Temp = (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x009)));
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x008))) << 8;
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x007))) << 16;
  return Temp;
}


x86 assembly (clang, -O0):
<VIM_MARB_GetJbufEndAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x2409,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2408,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x2407,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_GetJbufEndAddr>:
push   %r14
push   %rbx
push   %rax
mov    $0x2409,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
mov    $0x2408,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%rbx
shl    $0x8,%rbx
or     %r14,%rbx
mov    $0x2407,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @VIM_MARB_GetJbufEndAddr() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @VIM_HIF_GetReg8(i32 9225)
store i64 %2, i64* %1
%3 = call i64 @VIM_HIF_GetReg8(i32 9224)
%4 = shl i64 %3, 8
%5 = load i64, i64* %1
%6 = or i64 %5, %4
store i64 %6, i64* %1
%7 = call i64 @VIM_HIF_GetReg8(i32 9223)
%8 = shl i64 %7, 16
%9 = load i64, i64* %1
%10 = or i64 %9, %8
store i64 %10, i64* %1
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
define i64 @VIM_MARB_GetJbufEndAddr() {
%1 = tail call i64 @VIM_HIF_GetReg8(i32 9225)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 9224)
%3 = shl i64 %2, 8
%4 = or i64 %3, %1
%5 = tail call i64 @VIM_HIF_GetReg8(i32 9223)
%6 = shl i64 %5, 16
%7 = or i64 %4, %6
ret i64 %7
}
int Q_isnumeric(int c) {
  if (c >= '0' && c <= '9') {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<Q_isnumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <Q_isnumeric+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <Q_isnumeric+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <Q_isnumeric+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_isnumeric>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @Q_isnumeric(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @Q_isnumeric(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void cli_print_nl(void) { puts(""); }


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

x86 assembly (clang, -O2):
<cli_print_nl>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @cli_print_nl() {
%1 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @cli_print_nl() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main() {
  int a, b;
  float c, d;
  a = 15;
  b = 5;
  c = a / b;
  d = (float)a / (float)b;
  printf("[integers]\t a = %d\t b = %d\n", a, b);
  printf("[floats]\t c = %f\t d=%f\n", c, d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xf,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
movss  0xecc(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"[integers]\09 a = %d\09 b = %d\0A\00"
@.str.1 = [24 x i8] c"[floats]\09 c = %f\09 d=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 15, i32* %1
store i32 5, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = sdiv i32 %5, %6
%8 = sitofp i32 %7 to float
store float %8, float* %3
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to float
%11 = load i32, i32* %2
%12 = sitofp i32 %11 to float
%13 = fdiv float %10, %12
store float %13, float* %4
%14 = load i32, i32* %1
%15 = sitofp i32 %14 to float
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to float
%18 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float %15, float %17)
%19 = load float, float* %3
%20 = load float, float* %4
%21 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %19, float %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"[integers]\09 a = %d\09 b = %d\0A\00"
@.str.1 = [24 x i8] c"[floats]\09 c = %f\09 d=%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), float 1.500000e+01, float 5.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float 3.000000e+00, float 3.000000e+00)
ret i32 0
}
/* Type definitions */
struct skin_element {
  int dummy;
};

/* Variables and functions */
scalar_t__ skin_buffer_alloc(int);
struct skin_element **skin_alloc_children(int count) {
  return (struct skin_element **)skin_buffer_alloc(
      sizeof(struct skin_element *) * count);
}


x86 assembly (clang, -O0):
<skin_alloc_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <skin_buffer_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skin_alloc_children>:
shl    $0x3,%edi
jmp    1030 <skin_buffer_alloc@plt>

LLVM IR (-O0):
%struct.skin_element = type { i32 }
define %struct.skin_element** @skin_alloc_children(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 8, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @skin_buffer_alloc(i32 %6)
%8 = inttoptr i64 %7 to %struct.skin_element**
ret %struct.skin_element** %8
}

LLVM IR (-O2):
%struct.skin_element = type { i32 }
define %struct.skin_element** @skin_alloc_children(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @skin_buffer_alloc(i32 %2)
%4 = inttoptr i64 %3 to %struct.skin_element**
ret %struct.skin_element** %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t *copy(int8_t *buff, int8_t *src) {
  while ((*buff++ = *src++))
    ;
  return buff;
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %eax,(%rcx)
cmp    $0x0,%eax
je     113c <copy+0x3c>
jmp    110c <copy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsi),%ecx
add    $0x4,%rsi
mov    %ecx,(%rax)
add    $0x4,%rax
test   %ecx,%ecx
jne    1110 <copy+0x10>
ret

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

LLVM IR (-O2):
define i32* @copy(i32* writeonly %0, i32* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32* [ %0, %2 ], [ %8, %3 ]
%5 = phi i32* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %5
%8 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %7, i32* %4
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32* %8
}
/* Variables and functions */
int fnmatch(char const *, char const *, int);
__attribute__((__weak__, __always___)) int
softboundmpx_fnmatch(const char *pattern, const char *string, int flags) {
  return fnmatch(pattern, string, flags);
}


x86 assembly (clang, -O0):
<softboundmpx_fnmatch>:
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 <fnmatch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_fnmatch>:
jmp    1030 <fnmatch@plt>

LLVM IR (-O0):
define weak i32 @softboundmpx_fnmatch(i8* %0, i8* %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 @fnmatch(i8* %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define weak i32 @softboundmpx_fnmatch(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @fnmatch(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void contador(void) {
  int count = 1;
  while (count <= 10) {
    printf("%d\n", count);
    count += 1;
  }
}


x86 assembly (clang, -O0):
<contador>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jg     1146 <contador+0x36>
mov    -0x4(%rbp),%esi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <contador+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<contador>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @contador() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @contador() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 7)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 9)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t asu_hash(uint64_t x, uint64_t *k) {
  uint64_t t = k[0] + k[1] * (uint32_t)x + k[2] * (uint32_t)(x >> 32);
  return (uint32_t)(t >> 32);
}


x86 assembly (clang, -O0):
<asu_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
imul   -0x4(%rbp),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    -0x18(%rbp),%ecx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @asu_hash(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %8, %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32, i32* %3
%19 = ashr i32 %18, 32
%20 = mul nsw i32 %17, %19
%21 = add nsw i32 %14, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = ashr i32 %22, 32
ret i32 %23
}

LLVM IR (-O2):
define i32 @asu_hash(i32 %0, i32* nocapture readnone %1) {
ret i32 poison
}
/* Variables and functions */
int bbm_byte_write(void *, unsigned short, unsigned char);
int bbm_com_byte_write(void *handle, unsigned short addr, unsigned char data) {
  int res;
  res = bbm_byte_write(handle, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_byte_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
movzwl %ax,%esi
movzbl -0xb(%rbp),%edx
call   1030 <bbm_byte_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_byte_write>:
jmp    1030 <bbm_byte_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_byte_write(i8* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i8, i8* %6
%11 = call i32 @bbm_byte_write(i8* %8, i16 zeroext %9, i8 zeroext %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @bbm_com_byte_write(i8* %0, i16 zeroext %1, i8 zeroext %2) {
%4 = tail call i32 @bbm_byte_write(i8* %0, i16 zeroext %1, i8 zeroext %2)
ret i32 %4
}
void fc118(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
  a:
    goto a;
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc118>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc118+0x7>

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

LLVM IR (-O0):
define void @fc118(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %1
br label %11
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc118(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
char *dlerror();
char *Sys_Library_ErrorString(void) { return dlerror(); }


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

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

LLVM IR (-O0):
define i8* @Sys_Library_ErrorString() {
%1 = call i8* (...) @dlerror()
ret i8* %1
}

LLVM IR (-O2):
define i8* @Sys_Library_ErrorString() {
%1 = tail call i8* (...) @dlerror()
ret i8* %1
}
void *test_anti_range_101(short n) {
  extern void *alloc_anti_range_101(short) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_101(n);
}


x86 assembly (clang, -O0):
<test_anti_range_101>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_101+0x30>
movswl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1140 <test_anti_range_101+0x30>
movw   $0xffff,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_101@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_101>:
cmp    $0x3,%di
mov    $0xffff,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_101@plt>

LLVM IR (-O0):
define i8* @test_anti_range_101(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -1, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_101(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_101(i16 signext %0) {
%2 = icmp ult i16 %0, 3
%3 = select i1 %2, i16 -1, i16 %0
%4 = tail call i8* @alloc_anti_range_101(i16 signext %3)
ret i8* %4
}
void rpdr2_(dx, dy) float *dx, *dy;
{ rpdr2(*dx, *dy); }


x86 assembly (clang, -O0):
<rpdr2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <rpdr2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpdr2_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
jmp    1030 <rpdr2@plt>

LLVM IR (-O0):
define void @rpdr2_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (double, double, ...) bitcast (i32 (...)* @rpdr2 to i32 (double, double, ...)*)(double %7, double %10)
ret void
}

LLVM IR (-O2):
define void @rpdr2_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @rpdr2 to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
void hlt(void) { __asm__ __volatile__("hlt"); }


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

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

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

LLVM IR (-O2):
define void @hlt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *malloc(int);
int main() {
  int *p, *q;
  int havoc;
  p = malloc(sizeof(int));
  if (havoc) {
    q = p;
  } else {
    q = malloc(sizeof(int));
  }
  *p = 0;
  *q = 1;
  assert(*p == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1154 <main+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1162 <main+0x42>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32* @malloc(i32 4)
%3 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo();
__attribute__((constructor)) void init() { foo(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
#define S_IFBLK 133
#define S_IFCHR 132
#define S_IFDIR 131
#define S_IFIFO 130
#define S_IFLNK 129
int S_IFMT;
#define S_IFSOCK 128
char filetype(mode_t mode) {
  switch (mode & S_IFMT) {
  case S_IFSOCK:
    return 's';
  case S_IFLNK:
    return 'l';
  case S_IFBLK:
    return 'b';
  case S_IFDIR:
    return 'd';
  case S_IFCHR:
    return 'c';
  case S_IFIFO:
    return 'f';
  }
  return '-';
}


x86 assembly (clang, -O0):
<filetype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
and    %ecx,%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1171 <filetype+0x71>
mov    -0x10(%rbp),%rax
lea    0xece(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x73,-0x1(%rbp)
jmp    1175 <filetype+0x75>
movb   $0x6c,-0x1(%rbp)
jmp    1175 <filetype+0x75>
movb   $0x62,-0x1(%rbp)
jmp    1175 <filetype+0x75>
movb   $0x64,-0x1(%rbp)
jmp    1175 <filetype+0x75>
movb   $0x63,-0x1(%rbp)
jmp    1175 <filetype+0x75>
movb   $0x66,-0x1(%rbp)
jmp    1175 <filetype+0x75>
movb   $0x2d,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filetype>:
mov    0x2ed9(%rip),%rax
and    (%rax),%edi
lea    -0x400(,%rdi,8),%ecx
mov    %edi,%eax
add    $0xffffff80,%eax
movabs $0x626364666c73,%rdx
shr    %cl,%rdx
cmp    $0x6,%eax
mov    $0x2d,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
@S_IFMT = global i32 0
define signext i8 @filetype(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @S_IFMT
%6 = and i32 %4, %5
switch i32 %6, label %13 [
i32 128, label %7
i32 129, label %8
i32 133, label %9
i32 131, label %10
i32 132, label %11
i32 130, label %12
]
7: ; preds = %1
store i8 115, i8* %2
br label %14
8: ; preds = %1
store i8 108, i8* %2
br label %14
9: ; preds = %1
store i8 98, i8* %2
br label %14
10: ; preds = %1
store i8 100, i8* %2
br label %14
11: ; preds = %1
store i8 99, i8* %2
br label %14
12: ; preds = %1
store i8 102, i8* %2
br label %14
13: ; preds = %1
store i8 45, i8* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@S_IFMT = global i32 0
define signext i8 @filetype(i32 %0) {
%2 = load i32, i32* @S_IFMT
%3 = and i32 %2, %0
%4 = add i32 %3, -128
%5 = icmp ult i32 %4, 6
%6 = zext i32 %4 to i48
%7 = shl nuw nsw i48 %6, 3
%8 = lshr i48 108179025718387, %7
%9 = trunc i48 %8 to i8
%10 = select i1 %5, i8 %9, i8 45
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int m1();
int m2();
int main() {
  assert(m1() == 1);
  assert(m2() == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <m1@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <m2@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <m1@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <m2@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @m1()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = call i32 @assert(i32 %3)
%5 = call i32 (...) @m2()
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @m1()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 (...) @m2()
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char s[5];
  printf("Inserisci un numero in stringa");
  scanf("%s", s);
  printf("%g\n", atof(s));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x5(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x5(%rbp),%rdi
call   1030 <atof@plt>
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0xb(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Inserisci un numero in stringa\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%6 = call double @atof(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Inserisci un numero in stringa\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"%g\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call double @atof(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Type definitions */
struct AdvFormatter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ advFormatter_kill(struct AdvFormatter *);
int /*<<< orphan*/ free(struct AdvFormatter *);
void advFormatter_free(struct AdvFormatter *formatter) {
  advFormatter_kill(formatter);
  free(formatter);
}


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

x86 assembly (clang, -O2):
<advFormatter_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <advFormatter_kill@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.AdvFormatter = type { i32 }
define void @advFormatter_free(%struct.AdvFormatter* %0) {
%2 = tail call i32 @advFormatter_kill(%struct.AdvFormatter* %0)
%3 = tail call i32 @free(%struct.AdvFormatter* %0)
ret void
}
void VP8EncDspInitAVX2(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8EncDspInitAVX2() {
ret void
}
/* Variables and functions */
int rand();
int randint(int min, int max) { return rand() % (max - min) + min; }


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randint(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @randint(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
int test_imm_D1uint32_mem(unsigned int *val) {
  return ((*val) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xd1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1uint32_mem>:
testb  $0xd1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D1uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 209
%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_D1uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 209
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int strhash(string)
register char *string;
{
  register int c;
  register int val = 0;
  while ((c = *string++) != '\0') {
    val = val * 997 + c;
  }
  return val + (val >> 5);
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113f <strhash+0x3f>
imul   $0x3e5,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <strhash+0xf>
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x5,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%al
test   %al,%al
je     1128 <strhash+0x28>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
imul   $0x3e5,%ecx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strhash+0x10>
jmp    112a <strhash+0x2a>
xor    %ecx,%ecx
mov    %ecx,%eax
sar    $0x5,%eax
add    %ecx,%eax
ret

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

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