xunge/DecIR huggingface dataset:
int main(void) {
  char s[] = {"AbCdEAgggE"};
  char t[] = {"AgggE"};
  if (strend(s, t))
    printf("s occur at the t end\n");
  else
    printf("s doesn't occur at the t end\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb1(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xeab(%rip),%ax
mov    %ax,-0x11(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x15(%rbp),%rsi
mov    $0x0,%al
call   1040 <strend@plt>
cmp    $0x0,%eax
je     118d <main+0x6d>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <main+0x7b>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6767414564436241,%rax
41 67 67
mov    %rax,0x8(%rsp)
movl   $0x456767,0xf(%rsp)
movw   $0x45,0x4(%rsp)
movl   $0x67676741,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <strend@plt>
test   %eax,%eax
lea    0xeaa(%rip),%rax
lea    0xec0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [11 x i8] c"AbCdEAgggE\00"
@__const.main.t = [6 x i8] c"AgggE\00"
@.str = [22 x i8] c"s occur at the t end\0A\00"
@.str.1 = [30 x i8] c"s doesn't occur at the t end\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca [6 x i8]
store i32 0, i32* %1
%4 = bitcast [11 x i8]* %2 to i8*
%5 = bitcast [6 x i8]* %3 to i8*
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strend to i32 (i8*, i8*, ...)*)(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %10
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [11 x i8] c"AbCdEAgggE\00"
@__const.main.t = [6 x i8] c"AgggE\00"
@str = [29 x i8] c"s doesn't occur at the t end\00"
@str.2 = [21 x i8] c"s occur at the t end\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strend to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
float __ocml_asinh_f32(float);
float asinhf(float x) { return __ocml_asinh_f32(x); }


x86 assembly (clang, -O0):
<asinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_asinh_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhf>:
jmp    1030 <__ocml_asinh_f32@plt>

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

LLVM IR (-O2):
define float @asinhf(float %0) {
%2 = tail call float @__ocml_asinh_f32(float %0)
ret float %2
}
/* Variables and functions */
int error(int, char *);
int b_stop(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return error(49, argv[0]);
}


x86 assembly (clang, -O0):
<b_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_stop+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <b_stop+0x46>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x31,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_stop>:
cmp    $0x2,%edi
mov    (%rsi),%rsi
mov    $0x1,%eax
mov    $0x31,%edi
cmovge %eax,%edi
jmp    1030 <error@plt>

LLVM IR (-O0):
define i32 @b_stop(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @error(i32 1, i8* %11)
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 @error(i32 49, i8* %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @b_stop(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = load i8*, i8** %1
%5 = select i1 %3, i32 1, i32 49
%6 = tail call i32 @error(i32 %5, i8* %4)
ret i32 %6
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", f(2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @f(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void goto_test(void) {
  int i;
  i = 0;
  goto bottom;
  {
  top:
    i = i + 1;
  }
bottom:
  if (i < 10) {
    goto top;
  };
}


x86 assembly (clang, -O0):
<goto_test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1119 <goto_test+0x19>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1128 <goto_test+0x28>
jmp    1110 <goto_test+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @goto_test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(short);
void foo(int x, int y) {
  __attribute__((vector_size(8 * sizeof(short)))) short s0 = {x};
  bar((short)(long)&s0 + y);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x4(%rbp),%eax
movd   %eax,%xmm0
movdqa %xmm0,-0x20(%rbp)
lea    -0x20(%rbp),%rax
cwtl
add    -0x8(%rbp),%eax
movswl %ax,%edi
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x18,%rsp
movzwl %di,%eax
movd   %eax,%xmm0
movdqa %xmm0,(%rsp)
mov    %rsp,%rax
add    %esi,%eax
movswl %ax,%edi
call   1030 <bar@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca <8 x i16>
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
%8 = insertelement <8 x i16> undef, i16 %7, i32 0
%9 = insertelement <8 x i16> %8, i16 0, i32 1
%10 = insertelement <8 x i16> %9, i16 0, i32 2
%11 = insertelement <8 x i16> %10, i16 0, i32 3
%12 = insertelement <8 x i16> %11, i16 0, i32 4
%13 = insertelement <8 x i16> %12, i16 0, i32 5
%14 = insertelement <8 x i16> %13, i16 0, i32 6
%15 = insertelement <8 x i16> %14, i16 0, i32 7
store <8 x i16> %15, <8 x i16>* %5
%16 = ptrtoint <8 x i16>* %5 to i64
%17 = trunc i64 %16 to i16
%18 = sext i16 %17 to i32
%19 = load i32, i32* %4
%20 = add nsw i32 %18, %19
%21 = trunc i32 %20 to i16
%22 = call i32 @bar(i16 signext %21)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = alloca <8 x i16>
%4 = bitcast <8 x i16>* %3 to i8*
%5 = trunc i32 %0 to i16
%6 = insertelement <8 x i16> <i16 poison, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, i16 %5, i64 0
store <8 x i16> %6, <8 x i16>* %3
%7 = ptrtoint <8 x i16>* %3 to i64
%8 = trunc i64 %7 to i32
%9 = add i32 %8, %1
%10 = trunc i32 %9 to i16
%11 = call i32 @bar(i16 signext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ putpixel(int, int, int);
int random(int);
void spray(int x, int y, int color) {
  putpixel(x, y, color);
  putpixel(x - random(10), y + random(20), color);
  delay(random(50));
}


x86 assembly (clang, -O0):
<spray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <putpixel@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0xa,%edi
call   1050 <random@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x14,%edi
call   1050 <random@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edi
add    %eax,%esi
mov    -0xc(%rbp),%edx
call   1030 <putpixel@plt>
mov    $0x32,%edi
call   1050 <random@plt>
mov    %eax,%edi
call   1040 <delay@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spray>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <putpixel@plt>
mov    $0xa,%edi
call   1050 <random@plt>
sub    %eax,%ebx
mov    $0x14,%edi
call   1050 <random@plt>
add    %eax,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <putpixel@plt>
mov    $0x32,%edi
call   1050 <random@plt>
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <delay@plt>

LLVM IR (-O0):
define void @spray(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 = load i32, i32* %6
%10 = call i32 @putpixel(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = call i32 @random(i32 10)
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %5
%15 = call i32 @random(i32 20)
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %6
%18 = call i32 @putpixel(i32 %13, i32 %16, i32 %17)
%19 = call i32 @random(i32 50)
%20 = call i32 @delay(i32 %19)
ret void
}

LLVM IR (-O2):
define void @spray(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @putpixel(i32 %0, i32 %1, i32 %2)
%5 = tail call i32 @random(i32 10)
%6 = sub nsw i32 %0, %5
%7 = tail call i32 @random(i32 20)
%8 = add nsw i32 %7, %1
%9 = tail call i32 @putpixel(i32 %6, i32 %8, i32 %2)
%10 = tail call i32 @random(i32 50)
%11 = tail call i32 @delay(i32 %10)
ret void
}
void GENERAL_NAMES_new(void) {}


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

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

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

LLVM IR (-O2):
define void @GENERAL_NAMES_new() {
ret void
}
/* Variables and functions */
int syscall(int, int, void *, unsigned int, int /*<<< orphan*/,
            int /*<<< orphan*/, int /*<<< orphan*/);
int read(int fd, void *buffer, unsigned int size) {
  return syscall(3, fd, buffer, size, 0, 0, 0);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x3,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    $0x3,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @syscall(i32 3, i32 %0, i8* %1, i32 %2, i32 0, i32 0, i32 0)
ret i32 %4
}
/* Variables and functions */
int rmdir(char const *);
int octave_rmdir_wrapper(const char *nm) { return rmdir(nm); }


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

x86 assembly (clang, -O2):
<octave_rmdir_wrapper>:
jmp    1030 <rmdir@plt>

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

LLVM IR (-O2):
define i32 @octave_rmdir_wrapper(i8* nocapture %0) {
%2 = tail call i32 @rmdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ floor(double);
int conv1D2Drow(int nX, int rowcol) {
  return ((int)floor((double)rowcol / (double)nX));
}


x86 assembly (clang, -O0):
<conv1D2Drow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv1D2Drow>:
cvtsi2sd %esi,%xmm0
cvtsi2sd %edi,%xmm1
divsd  %xmm1,%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @conv1D2Drow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sitofp i32 %5 to double
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
%10 = call i64 @floor(double %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @conv1D2Drow(i32 %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = sitofp i32 %0 to double
%5 = fdiv double %3, %4
%6 = tail call i64 @floor(double %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
scalar_t__ strncmp(char const *, char *, int);
int is_regex(const char *str) { return (strncmp(str, "regex:", 6) == 0); }


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

x86 assembly (clang, -O2):
<is_regex>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x6,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"regex:\00"
define i32 @is_regex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"regex:\00"
define i32 @is_regex(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((target("default"))) void foo_used2(int i, double d) {}


x86 assembly (clang, -O0):
<foo_used2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo_used2(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
define void @foo_used2(i32 %0, double %1) {
ret void
}
/* Variables and functions */
unsigned long long __tzcnt64(unsigned long long);
unsigned long long test__tzcnt64(unsigned long long __X) {
  return __tzcnt64(__X);
}


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

x86 assembly (clang, -O2):
<test__tzcnt64>:
jmp    1030 <__tzcnt64@plt>

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

LLVM IR (-O2):
define i64 @test__tzcnt64(i64 %0) {
%2 = tail call i64 @__tzcnt64(i64 %0)
ret i64 %2
}
long seek(int f, long o, int p) {
  long lseek(int, long, int);
  return lseek(f, o, p);
}


x86 assembly (clang, -O0):
<seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <lseek@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seek>:
jmp    1030 <lseek@plt>

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

LLVM IR (-O2):
define i64 @seek(i32 %0, i64 %1, i32 %2) {
%4 = tail call i64 @lseek(i32 %0, i64 %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  void *ptr;
  if (ptr = malloc(nmemb * size))
    memset(ptr, 0, nmemb * size);
  return (ptr);
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1160 <calloc+0x40>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Variables and functions */
double exp(double);
double rndlogistic();
double rndloglogistic(double loc, double s) {
  double t = rndlogistic(), logt = 1E300;
  if (t < 800)
    logt = exp(loc + s * t);
  return (logt);
}


x86 assembly (clang, -O0):
<rndloglogistic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rndlogistic@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xead(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    117f <rndloglogistic+0x5f>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndloglogistic>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rndlogistic@plt>
movsd  0xec1(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1162 <rndloglogistic+0x42>
movsd  0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
jmp    1040 <exp@plt>
movsd  0xe9e(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rndloglogistic(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call double (...) @rndlogistic()
store double %7, double* %5
store double 1.000000e+300, double* %6
%8 = load double, double* %5
%9 = fcmp olt double %8, 8.000000e+02
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load double, double* %3
%12 = load double, double* %4
%13 = load double, double* %5
%14 = call double @llvm.fmuladd.f64(double %12, double %13, double %11)
%15 = call double @exp(double %14)
store double %15, double* %6
br label %16
16: ; preds = %10, %2
%17 = load double, double* %6
ret double %17
}

LLVM IR (-O2):
define double @rndloglogistic(double %0, double %1) {
%3 = tail call double (...) @rndlogistic()
%4 = fcmp olt double %3, 8.000000e+02
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call double @llvm.fmuladd.f64(double %1, double %3, double %0)
%7 = tail call double @exp(double %6)
br label %8
8: ; preds = %5, %2
%9 = phi double [ %7, %5 ], [ 1.000000e+300, %2 ]
ret double %9
}
int foo_5(void) { return 5; }


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

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

LLVM IR (-O0):
define i32 @foo_5() {
ret i32 5
}

LLVM IR (-O2):
define i32 @foo_5() {
ret i32 5
}
void store_jump(char *from, char opcode, char *to) {
  from[0] = opcode;
  from[1] = (char)((to - (from + 3)) & 0377);
  from[2] = (char)((to - (from + 3)) >> 8);
}


x86 assembly (clang, -O0):
<store_jump>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x3,%rcx
sub    %rcx,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x3,%rcx
sub    %rcx,%rax
sar    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_jump>:
mov    %sil,(%rdi)
sub    %rdi,%rdx
add    $0xfffffffffffffffd,%rdx
mov    %dl,0x1(%rdi)
mov    %dh,0x2(%rdi)
ret

LLVM IR (-O0):
define void @store_jump(i8* %0, i8 signext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %5
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 3
%13 = ptrtoint i8* %10 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = and i64 %15, 255
%17 = trunc i64 %16 to i8
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i8*, i8** %6
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = ptrtoint i8* %20 to i64
%24 = ptrtoint i8* %22 to i64
%25 = sub i64 %23, %24
%26 = ashr i64 %25, 8
%27 = trunc i64 %26 to i8
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 2
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @store_jump(i8* %0, i8 signext %1, i8* %2) {
store i8 %1, i8* %0
%4 = getelementptr inbounds i8, i8* %0, i64 3
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %4 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %8, i8* %9
%10 = lshr i64 %7, 8
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void eat_space(FILE *fp) {
  char c;
  while ((c = getc(fp)) == ' ' || c == '\n')
    ;
  ungetc(c, fp);
}


x86 assembly (clang, -O0):
<eat_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1156 <eat_space+0x36>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1166 <eat_space+0x46>
jmp    116b <eat_space+0x4b>
jmp    112c <eat_space+0xc>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_space>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    $0xa,%al
je     1130 <eat_space+0x10>
cmp    $0x20,%al
je     1130 <eat_space+0x10>
movsbl %al,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ungetc@plt>

LLVM IR (-O0):
define void @eat_space(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %15, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @getc(i32* %5)
store i8 %6, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 32
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br label %13
13: ; preds = %9, %4
%14 = phi i1 [ true, %4 ], [ %12, %9 ]
br i1 %14, label %15, label %16
15: ; preds = %13
br label %4
16: ; preds = %13
%17 = load i8, i8* %3
%18 = load i32*, i32** %2
%19 = call i32 @ungetc(i8 signext %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @eat_space(i32* nocapture %0) {
br label %2
2: ; preds = %4, %1
%3 = tail call signext i8 @getc(i32* %0)
switch i8 %3, label %5 [
i8 32, label %4
i8 10, label %4
]
4: ; preds = %2, %2
br label %2
5: ; preds = %2
%6 = tail call i32 @ungetc(i8 signext %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memory_init();
int /*<<< orphan*/ pipeline_init();
int /*<<< orphan*/ register_init();
int main() {
  memory_init();
  register_init();
  pipeline_init();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <memory_init@plt>
mov    $0x0,%al
call   1040 <register_init@plt>
mov    $0x0,%al
call   1050 <pipeline_init@plt>
jmp    1154 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <memory_init@plt>
xor    %eax,%eax
call   1040 <register_init@plt>
xor    %eax,%eax
call   1050 <pipeline_init@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @memory_init()
%3 = call i32 (...) @register_init()
%4 = call i32 (...) @pipeline_init()
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @memory_init()
%2 = tail call i32 (...) @register_init()
%3 = tail call i32 (...) @pipeline_init()
br label %4
4: ; preds = %0, %4
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ KAPI_save_as_header_int_array(int /*<<< orphan*/ *, int *,
                                                 int);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void KAPI_save_as_header_int_array_list(FILE *fp, int *pint,
                                        int number_of_elements) {
  FILE *fpTmp = fp;
  KAPI_save_as_header_int_array(fp, pint, number_of_elements);
  fwrite(",", sizeof(char), 1, fpTmp);
}


x86 assembly (clang, -O0):
<KAPI_save_as_header_int_array_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <KAPI_save_as_header_int_array@plt>
mov    -0x20(%rbp),%rcx
lea    0xeaa(%rip),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KAPI_save_as_header_int_array_list>:
push   %rbx
mov    %rdi,%rbx
call   1040 <KAPI_save_as_header_int_array@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define void @KAPI_save_as_header_int_array_list(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
store i32* %8, i32** %7
%9 = load i32*, i32** %4
%10 = load i32*, i32** %5
%11 = load i32, i32* %6
%12 = call i32 @KAPI_save_as_header_int_array(i32* %9, i32* %10, i32 %11)
%13 = load i32*, i32** %7
%14 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32* %13)
ret void
}

LLVM IR (-O2):
define void @KAPI_save_as_header_int_array_list(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @KAPI_save_as_header_int_array(i32* %0, i32* %1, i32 %2)
%5 = tail call i32 @fputc(i32 44, i32* %0)
ret void
}
int dns_v_rel(void) { return 0x20161214; }


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

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

LLVM IR (-O0):
define i32 @dns_v_rel() {
ret i32 538317332
}

LLVM IR (-O2):
define i32 @dns_v_rel() {
ret i32 538317332
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("signal\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"signal\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
long sumOfSquares(long, long);
long func2(long a, long b, long c, long d) {
  long x = a * c;
  long y = b * d;
  return sumOfSquares(x, y);
}


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

x86 assembly (clang, -O2):
<func2>:
imul   %rdx,%rdi
imul   %rcx,%rsi
jmp    1030 <sumOfSquares@plt>

LLVM IR (-O0):
define i64 @func2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i64, i64* %5
%12 = load i64, i64* %7
%13 = mul nsw i64 %11, %12
store i64 %13, i64* %9
%14 = load i64, i64* %6
%15 = load i64, i64* %8
%16 = mul nsw i64 %14, %15
store i64 %16, i64* %10
%17 = load i64, i64* %9
%18 = load i64, i64* %10
%19 = call i64 @sumOfSquares(i64 %17, i64 %18)
ret i64 %19
}

LLVM IR (-O2):
define i64 @func2(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = mul nsw i64 %2, %0
%6 = mul nsw i64 %3, %1
%7 = tail call i64 @sumOfSquares(i64 %5, i64 %6)
ret i64 %7
}
void foo(int *p) {
  while (1) {
    *p = 0;
    *p = 0;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    1108 <foo+0x8>

x86 assembly (clang, -O2):
<foo>:
movl   $0x0,(%rdi)
cs nopw 0x0(%rax,%rax,1)
jmp    1110 <foo+0x10>

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0) {
store i32 0, i32* %0
br label %2
2: ; preds = %1, %2
br label %2
}
void ASN1_OCTET_STRING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_OCTET_STRING_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_dispersa(void *);
int /*<<< orphan*/ imprimir_matriz(void *);
void unaria(void *(*fun)(void *), void *A) {
  void *Z = fun(A);
  imprimir_matriz(Z);
  free_dispersa(Z);
  return;
}


x86 assembly (clang, -O0):
<unaria>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <imprimir_matriz@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free_dispersa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaria>:
push   %rbx
mov    %rdi,%rax
mov    %rsi,%rdi
call   *%rax
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <imprimir_matriz@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free_dispersa@plt>

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

LLVM IR (-O2):
define void @unaria(i8* (i8*)* nocapture %0, i8* %1) {
%3 = tail call i8* %0(i8* %1)
%4 = tail call i32 @imprimir_matriz(i8* %3)
%5 = tail call i32 @free_dispersa(i8* %3)
ret void
}
void d_fetchub(register const unsigned char **ptr,
               register unsigned char *dest) {
  *dest = *(*ptr)++;
}


x86 assembly (clang, -O0):
<d_fetchub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fetchub>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    (%rax),%al
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @d_fetchub(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** %5
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %5
%8 = load i8, i8* %6
%9 = load i8*, i8** %4
store i8 %8, i8* %9
ret void
}

LLVM IR (-O2):
define void @d_fetchub(i8** nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** %0
%5 = load i8, i8* %3
store i8 %5, i8* %1
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int decode_mknod(struct tcb *, int /*<<< orphan*/);
int sys_mknod(struct tcb *tcp) { return decode_mknod(tcp, 0); }


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

x86 assembly (clang, -O2):
<sys_mknod>:
xor    %esi,%esi
jmp    1030 <decode_mknod@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_mknod(%struct.tcb* %0) {
%2 = tail call i32 @decode_mknod(%struct.tcb* %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int opendir_compar(const void *p1, const void *p2) {
  return (strcmp((*(const struct dirent **)p1)->d_name,
                 (*(const struct dirent **)p2)->d_name));
}


x86 assembly (clang, -O0):
<opendir_compar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
call   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendir_compar>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @opendir_compar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.dirent**
%7 = load %struct.dirent*, %struct.dirent** %6
%8 = getelementptr inbounds %struct.dirent, %struct.dirent* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to %struct.dirent**
%12 = load %struct.dirent*, %struct.dirent** %11
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @strcmp(i32 %9, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @opendir_compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.dirent**
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = bitcast i8* %1 to %struct.dirent**
%8 = load %struct.dirent*, %struct.dirent** %7
%9 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @strcmp(i32 %6, i32 %10)
ret i32 %11
}
void XDrawRectangle() {}


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

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

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

LLVM IR (-O2):
define void @XDrawRectangle() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void allocator_free(void *client_state, void *data) { free(data); }


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

x86 assembly (clang, -O2):
<allocator_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @allocator_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @allocator_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
OP(fd, fe) {
  illegal_1();
  op_fe();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_fe@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_fe@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_fe()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_fe()
ret i32 undef
}
__attribute__((always_)) int test_bit(unsigned long long nr,
                                      const unsigned long long *addr) {
  return 1UL & (addr[nr >> 6] >> (nr & 63ULL));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x8(%rbp),%rcx
and    $0x3f,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %rdi,%rcx
mov    %rdi,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i64, i64* %3
%7 = lshr i64 %6, 6
%8 = getelementptr inbounds i64, i64* %5, i64 %7
%9 = load i64, i64* %8
%10 = load i64, i64* %3
%11 = and i64 %10, 63
%12 = lshr i64 %9, %11
%13 = and i64 1, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @test_bit(i64 %0, i64* nocapture %1) {
%3 = lshr i64 %0, 6
%4 = getelementptr inbounds i64, i64* %1, i64 %3
%5 = load i64, i64* %4
%6 = and i64 %0, 63
%7 = lshr i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = and i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int ce();
int main(void) { return ce(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ce()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printLoop(int number) {
  int min;
  for (min = 0; min < number; min++)
    printf("%d\n", min);
}


x86 assembly (clang, -O0):
<printLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114b <printLoop+0x3b>
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printLoop+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLoop>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1141 <printLoop+0x31>
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xedd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <printLoop+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @printLoop(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
__attribute__((always_)) unsigned long long native_read_msr(unsigned int msr) {
  unsigned long long val;
  asm volatile("rdmsr" : "=A"(val) : "c"(msr));
  return (val);
}


x86 assembly (clang, -O0):
<native_read_msr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
rdmsr
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_read_msr>:
mov    %edi,%ecx
rdmsr
ret

LLVM IR (-O0):
define i64 @native_read_msr(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @native_read_msr(i32 %0) {
%2 = tail call i64 asm sideeffect "rdmsr", "=A,{cx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i64 %2
}
/* Variables and functions */
int __builtin_preserve_field_info(int const *, int);
unsigned invalid1(const int *arg) {
  return __builtin_preserve_field_info(arg, 1);
}


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

x86 assembly (clang, -O2):
<invalid1>:
mov    $0x1,%esi
jmp    1030 <__builtin_preserve_field_info@plt>

LLVM IR (-O0):
define i32 @invalid1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @__builtin_preserve_field_info(i32* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @invalid1(i32* %0) {
%2 = tail call i32 @__builtin_preserve_field_info(i32* %0, i32 1)
ret i32 %2
}