xunge/DecIR huggingface dataset:
int length(char *word) {
  int i = 0;
  while (word[i] != 0) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <length+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <length+0x10>
ret

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

LLVM IR (-O2):
define i32 @length(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_bad() {
  char a[10];
  strcpy(a, "hello world!");
}


x86 assembly (clang, -O0):
<strcpy_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xa(%rbp),%rdi
lea    0xedd(%rip),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_bad>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\00"
define void @strcpy_bad() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define void @strcpy_bad() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_49uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x49 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_49uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0x49,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_49uint64_midword_reg>:
test   $0x490000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_49uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 73
%6 = icmp ne i64 %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_49uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 4784128
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: migratepages pid from-nodes to-nodes\n"
                  "\n"
                  "nodes is a comma delimited list of node numbers or A-B "
                  "ranges or all.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [116 x i8] c"usage: migratepages pid from-nodes to-nodes\0A\0Anodes is a comma delimited list of node numbers or A-B ranges or all.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [116 x i8] c"usage: migratepages pid from-nodes to-nodes\0A\0Anodes is a comma delimited list of node numbers or A-B ranges or all.\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void f_fpr_tracking(double a, double b, double c, double d, int8_t e) {}


x86 assembly (clang, -O0):
<f_fpr_tracking>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_fpr_tracking(double %0, double %1, double %2, double %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
define void @f_fpr_tracking(double %0, double %1, double %2, double %3, i32 %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void draw_vertical(int w, char element) {
  for (int i = 0; i < w; ++i) {
    printf("%c", element);
  }
}


x86 assembly (clang, -O0):
<draw_vertical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1152 <draw_vertical+0x42>
lea    0xec5(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <draw_vertical+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_vertical>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    113f <draw_vertical+0x2f>
mov    %edi,%ebx
movsbl %sil,%ebp
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <draw_vertical+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @draw_vertical(i32 %0, i8 signext %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %1)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %4, label %5
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ strlen(char const *);
int is_orphan_vg(char const *vg_name) {
  int tmp;
  {
    {
      strlen(vg_name);
      tmp = __VERIFIER_nondet_int();
    }
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<is_orphan_vg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_orphan_vg(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_orphan_vg(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fatorial(double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, double *);
double main() {
  double n;
  scanf("%lf", &n);
  printf("S = %lf\n", fatorial(n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <fatorial@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1040 <fatorial@plt>
lea    0xeb3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"S = %lf\0A\00"
define double @main() {
%1 = alloca double
%2 = alloca double
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%4 = load double, double* %2
%5 = call i32 @fatorial(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load double, double* %1
ret double %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [9 x i8] c"S = %lf\0A\00"
define double @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call i32 @fatorial(double %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret double undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xc0() {
  Assert_real((isbdigit(192) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              965, ("isbdigit should be 0 for 0xc0"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xc0\00"
define void @t_isbdigit_0xc0() {
%1 = tail call i64 @isbdigit(i32 192)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 965, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
struct in_addr {
  int /*<<< orphan*/ s_addr;
};

/* Variables and functions */
int htonl(int /*<<< orphan*/);
uint8_t inet_ntocidr(struct in_addr address) {
  uint8_t cidr = 0;
  uint32_t mask = htonl(address.s_addr);
  while (mask) {
    cidr++;
    mask <<= 1;
  }
  return cidr;
}


x86 assembly (clang, -O0):
<inet_ntocidr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1152 <inet_ntocidr+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <inet_ntocidr+0x1e>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_ntocidr>:
push   %rax
call   1030 <htonl@plt>
bsf    %eax,%ecx
mov    $0x20,%edx
sub    %ecx,%edx
test   %eax,%eax
cmovne %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i64 @inet_ntocidr(i32 %0) {
%2 = alloca %struct.in_addr
%3 = alloca i64
%4 = alloca i32
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %0, i32* %5
store i64 0, i64* %3
%6 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @htonl(i32 %7)
store i32 %8, i32* %4
br label %9
9: ; preds = %12, %1
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %9
%13 = load i64, i64* %3
%14 = add nsw i64 %13, 1
store i64 %14, i64* %3
%15 = load i32, i32* %4
%16 = shl i32 %15, 1
store i32 %16, i32* %4
br label %9
17: ; preds = %9
%18 = load i64, i64* %3
ret i64 %18
}

LLVM IR (-O2):
define i64 @inet_ntocidr(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = call i32 @llvm.cttz.i32(i32 %2, i1 true)
%5 = sub nuw nsw i32 32, %4
%6 = select i1 %3, i32 0, i32 %5
%7 = zext i32 %6 to i64
ret i64 %7
}
/* Variables and functions */
int strcasecmp(char *, char *);
void strcasecmp_diff_length_1() {
  char *x = "abc";
  char *y = "aBdef";
  if (strcasecmp(x, y) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strcasecmp_diff_length_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcasecmp@plt>
cmp    $0xffffffff,%eax
je     1144 <strcasecmp_diff_length_1+0x34>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [6 x i8] c"aBdef\00"
define void @strcasecmp_diff_length_1() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcasecmp(i8* %3, i8* %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strcasecmp_diff_length_1() {
ret void
}
float dot(const int *g, const float x, const float y, const float z,
          const float w) {
  return g[0] * x + g[1] * y + g[2] * z + g[3] * w;
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssl (%rax),%xmm0
movss  -0xc(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x4(%rax),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
cvtsi2ssl 0x8(%rax),%xmm1
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2ssl 0xc(%rax),%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
cvtsi2ssl (%rdi),%xmm4
cvtsi2ssl 0x4(%rdi),%xmm5
mulss  %xmm1,%xmm5
mulss  %xmm4,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl 0x8(%rdi),%xmm1
addss  %xmm5,%xmm0
xorps  %xmm4,%xmm4
cvtsi2ssl 0xc(%rdi),%xmm4
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
mulss  %xmm3,%xmm4
addss  %xmm4,%xmm0
ret

LLVM IR (-O0):
define float @dot(i32* %0, float %1, float %2, float %3, float %4) {
%6 = alloca i32*
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32* %0, i32** %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load i32*, i32** %6
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to float
%15 = load float, float* %7
%16 = load i32*, i32** %6
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to float
%20 = load float, float* %8
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %14, float %15, float %21)
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 2
%25 = load i32, i32* %24
%26 = sitofp i32 %25 to float
%27 = load float, float* %9
%28 = call float @llvm.fmuladd.f32(float %26, float %27, float %22)
%29 = load i32*, i32** %6
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = sitofp i32 %31 to float
%33 = load float, float* %10
%34 = call float @llvm.fmuladd.f32(float %32, float %33, float %28)
ret float %34
}

LLVM IR (-O2):
define float @dot(i32* nocapture %0, float %1, float %2, float %3, float %4) {
%6 = load i32, i32* %0
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to float
%11 = fmul float %10, %2
%12 = tail call float @llvm.fmuladd.f32(float %7, float %1, float %11)
%13 = getelementptr inbounds i32, i32* %0, i64 2
%14 = load i32, i32* %13
%15 = sitofp i32 %14 to float
%16 = tail call float @llvm.fmuladd.f32(float %15, float %3, float %12)
%17 = getelementptr inbounds i32, i32* %0, i64 3
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to float
%20 = tail call float @llvm.fmuladd.f32(float %19, float %4, float %16)
ret float %20
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lcg31(uint32_t x) { return (1103515245 * x + 12345) & 0x7fffffff; }


x86 assembly (clang, -O0):
<lcg31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x41c64e6d,-0x4(%rbp),%eax
add    $0x3039,%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcg31>:
imul   $0x41c64e6d,%edi,%eax
add    $0x3039,%eax
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i32 @lcg31(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1103515245, %3
%5 = add nsw i32 %4, 12345
%6 = and i32 %5, 2147483647
ret i32 %6
}

LLVM IR (-O2):
define i32 @lcg31(i32 %0) {
%2 = mul nsw i32 %0, 1103515245
%3 = add nsw i32 %2, 12345
%4 = and i32 %3, 2147483647
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strstr(char const *, char const *);
int main() {
  const char haystack[20] = "TutorialsYiibai";
  const char needle[10] = "Yiibai";
  char *ret;
  ret = strstr(haystack, needle);
  printf("The substring is: %s\n", ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xebf(%rip),%rax
mov    %rax,-0x2a(%rbp)
mov    0xebc(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x2a(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xed6(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strstr@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.haystack = [20 x i8] c"TutorialsYiibai\00\00\00\00\00"
@__const.main.needle = [10 x i8] c"Yiibai\00\00\00\00"
@.str = [22 x i8] c"The substring is: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [10 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = bitcast [20 x i8]* %2 to i8*
%6 = bitcast [10 x i8]* %3 to i8*
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i8* @strstr(i8* %7, i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.haystack = [20 x i8] c"TutorialsYiibai\00\00\00\00\00"
@__const.main.needle = [10 x i8] c"Yiibai\00\00\00\00"
@.str = [22 x i8] c"The substring is: %s\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @strstr(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @__const.main.needle, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long fgotoc(FILE *stream, long offset) {
  fseek(stream, offset, SEEK_SET);
  return ftell(stream);
}


x86 assembly (clang, -O0):
<fgotoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgotoc>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i64 @fgotoc(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @fseek(i32* %5, i64 %6, i32 %7)
%9 = load i32*, i32** %3
%10 = call i64 @ftell(i32* %9)
ret i64 %10
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i64 @fgotoc(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i64 %1, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ xop(char *, long double, long double, long double);
void fadd(long double a, long double b) { xop("add", a, b, a + b); }


x86 assembly (clang, -O0):
<fadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld    %st(0)
fldt   -0x20(%rbp)
fld    %st(0)
fxch   %st(3)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  0x20(%rax)
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xeba(%rip),%rdi
call   1030 <xop@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fadd>:
sub    $0x38,%rsp
fldt   0x50(%rsp)
fldt   0x40(%rsp)
fld    %st(0)
fadd   %st(2),%st
fstpt  0x20(%rsp)
fxch   %st(1)
fstpt  0x10(%rsp)
fstpt  (%rsp)
lea    0xecc(%rip),%rdi
call   1030 <xop@plt>
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"add\00"
define void @fadd(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
%4 = tail call i32 @xop(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %0, x86_fp80 %1, x86_fp80 %3)
ret void
}
void GraphicsSwapBuffers() {}


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

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

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

LLVM IR (-O2):
define void @GraphicsSwapBuffers() {
ret void
}
int ending(char *buffer) {
  while (*buffer) {
    if (*buffer == '\n') {
      *buffer = '\0';
      return 1;
    }
    buffer++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <ending+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1138 <ending+0x38>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1150 <ending+0x50>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <ending+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ending>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <ending+0x11>
cmp    $0xa,%al
je     1114 <ending+0x14>
add    $0x1,%rdi
jmp    1100 <ending>
xor    %eax,%eax
ret
movb   $0x0,(%rdi)
mov    $0x1,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define void @t10() {
ret void
}
/* Variables and functions */
double ldexp(double, int);
double fix_itof_body(int val, int af) { return ldexp((double)val, -af); }


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

x86 assembly (clang, -O2):
<fix_itof_body>:
cvtsi2sd %edi,%xmm0
neg    %esi
mov    %esi,%edi
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @fix_itof_body(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = call double @ldexp(double %6, i32 %8)
ret double %9
}

LLVM IR (-O2):
define double @fix_itof_body(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sub nsw i32 0, %1
%5 = tail call double @ldexp(double %3, i32 %4)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ Set_Config_PWM_Out_Param(int);
void Testing_Macro_Global_Effectivity(void) { Set_Config_PWM_Out_Param(1); }


x86 assembly (clang, -O0):
<Testing_Macro_Global_Effectivity>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Set_Config_PWM_Out_Param@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Testing_Macro_Global_Effectivity>:
mov    $0x1,%edi
jmp    1030 <Set_Config_PWM_Out_Param@plt>

LLVM IR (-O0):
define void @Testing_Macro_Global_Effectivity() {
%1 = call i32 @Set_Config_PWM_Out_Param(i32 1)
ret void
}

LLVM IR (-O2):
define void @Testing_Macro_Global_Effectivity() {
%1 = tail call i32 @Set_Config_PWM_Out_Param(i32 1)
ret void
}
int vmin(int a, int b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<vmin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <vmin+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <vmin+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @vmin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ opts_reset();
int /*<<< orphan*/ stderr;
void opts_parse_error(const char *msg, char *opt_name) {
  fprintf(stderr, "Option '%s' : %s\n", opt_name, msg);
  free(opt_name);
  opts_reset();
  exit(1);
}


x86 assembly (clang, -O0):
<opts_parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe98(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <opts_reset@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<opts_parse_error>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rcx
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <opts_reset@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Option '%s' : %s\0A\00"
define void @opts_parse_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @free(i8* %9)
%11 = call i32 (...) @opts_reset()
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Option '%s' : %s\0A\00"
define void @opts_parse_error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%5 = tail call i32 @free(i8* %1)
%6 = tail call i32 (...) @opts_reset()
%7 = tail call i32 @exit(i32 1)
unreachable
}
__attribute__((weak)) int _isatty(int fd) {
  (void)fd;
  return (1);
}


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define weak i32 @_isatty(i32 %0) {
ret i32 1
}
int fibonacci(int n) {
  int tmp, a = 0, b = 1;
  if (n == 0)
    return 0;
  while (n > 1) {
    tmp = b;
    b = a + b;
    a = tmp;
    n--;
  }
  return b;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112b <fibonacci+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1163 <fibonacci+0x63>
jmp    1130 <fibonacci+0x30>
cmpl   $0x1,-0x8(%rbp)
jle    115d <fibonacci+0x5d>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <fibonacci+0x30>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
test   %edi,%edi
je     1131 <fibonacci+0x31>
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1130 <fibonacci+0x30>
add    $0x1,%edi
xor    %ecx,%ecx
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
mov    %ecx,%eax
add    %edx,%eax
add    $0xffffffff,%edi
mov    %edx,%ecx
cmp    $0x2,%edi
ja     1120 <fibonacci+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %12
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 1, %3 ]
%7 = phi i32 [ %6, %5 ], [ 0, %3 ]
%8 = phi i32 [ %10, %5 ], [ %0, %3 ]
%9 = add nsw i32 %6, %7
%10 = add nsw i32 %8, -1
%11 = icmp ugt i32 %8, 2
br i1 %11, label %5, label %12
12: ; preds = %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %5 ]
ret i32 %13
}
extern double s1n1s2n2(float s1, int n1, float s2, int n2) {
  return s1 + n1 + s2 + n2;
}


x86 assembly (clang, -O0):
<s1n1s2n2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s1n1s2n2>:
cvtsi2ss %edi,%xmm2
cvtsi2ss %esi,%xmm3
addss  %xmm0,%xmm2
addss  %xmm1,%xmm2
addss  %xmm2,%xmm3
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @s1n1s2n2(float %0, i32 %1, float %2, i32 %3) {
%5 = alloca float
%6 = alloca i32
%7 = alloca float
%8 = alloca i32
store float %0, float* %5
store i32 %1, i32* %6
store float %2, float* %7
store i32 %3, i32* %8
%9 = load float, float* %5
%10 = load i32, i32* %6
%11 = sitofp i32 %10 to float
%12 = fadd float %9, %11
%13 = load float, float* %7
%14 = fadd float %12, %13
%15 = load i32, i32* %8
%16 = sitofp i32 %15 to float
%17 = fadd float %14, %16
%18 = fpext float %17 to double
ret double %18
}

LLVM IR (-O2):
define double @s1n1s2n2(float %0, i32 %1, float %2, i32 %3) {
%5 = sitofp i32 %1 to float
%6 = fadd float %5, %0
%7 = fadd float %6, %2
%8 = sitofp i32 %3 to float
%9 = fadd float %7, %8
%10 = fpext float %9 to double
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ sendchar(int);
void printchar(char **str, int c) {
  if (str) {
    **str = (char)c;
    ++(*str);
  } else {
    (void)sendchar(c);
  }
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <sendchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <sendchar@plt>

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

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @sendchar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ efc_free(char *);
char *strdup(char *);
char *efc_strrepl(char *old, char *from) {
  efc_free(old);
  return strdup(from);
}


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

x86 assembly (clang, -O2):
<efc_strrepl>:
push   %rbx
mov    %rsi,%rbx
call   1030 <efc_free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
define i8* @efc_strrepl(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 = call i32 @efc_free(i8* %5)
%7 = load i8*, i8** %4
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @efc_strrepl(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @efc_free(i8* %0)
%4 = tail call i8* @strdup(i8* %1)
ret i8* %4
}
/* Variables and functions */
int middle(int);
int top(int y) { return middle(y + 1); }


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

x86 assembly (clang, -O2):
<top>:
add    $0x1,%edi
jmp    1030 <middle@plt>

LLVM IR (-O0):
define i32 @top(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @middle(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @top(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @middle(i32 %2)
ret i32 %3
}
int tcompress_file() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tcompress_file() {
ret i32 0
}
/* Variables and functions */
int M_PI;
double cos(double);
double sin(double angle) { return cos(angle - (M_PI / 2)); }


x86 assembly (clang, -O0):
<sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
cvtsi2sd %ecx,%xmm1
subsd  %xmm1,%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
@M_PI = global i32 0
define double @sin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sdiv i32 %4, 2
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
%8 = call double @cos(double %7)
ret double %8
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @sin(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 2
%4 = sitofp i32 %3 to double
%5 = fsub double %0, %4
%6 = tail call double @cos(double %5)
ret double %6
}
/* Variables and functions */
int blc_read_iface_file_int(char const *, char *, int *);
int blc_get_max_brightness(const char *iface, int *err) {
  return blc_read_iface_file_int(iface, "max_brightness", err);
}


x86 assembly (clang, -O0):
<blc_get_max_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <blc_read_iface_file_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blc_get_max_brightness>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <blc_read_iface_file_int@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"max_brightness\00"
define i32 @blc_get_max_brightness(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = call i32 @blc_read_iface_file_int(i8* %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"max_brightness\00"
define i32 @blc_get_max_brightness(i8* %0, i32* %1) {
%3 = tail call i32 @blc_read_iface_file_int(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 %3
}
close_xls(fd) int fd;
{
  do_eof(fd);
  close(fd);
}


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

x86 assembly (clang, -O2):
<close_xls>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <do_eof@plt>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @close_xls(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @do_eof to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @close_xls(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @do_eof to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("./../../Files/22.sh");
  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 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"./../../Files/22.sh\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"./../../Files/22.sh\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) {}


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

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

LLVM IR (-O0):
%struct.cfs_rq = type opaque
%struct.sched_entity = type opaque
define void @enqueue_sleeper(%struct.cfs_rq* %0, %struct.sched_entity* %1) {
%3 = alloca %struct.cfs_rq*
%4 = alloca %struct.sched_entity*
store %struct.cfs_rq* %0, %struct.cfs_rq** %3
store %struct.sched_entity* %1, %struct.sched_entity** %4
ret void
}

LLVM IR (-O2):
%struct.cfs_rq = type opaque
%struct.sched_entity = type opaque
define void @enqueue_sleeper(%struct.cfs_rq* nocapture %0, %struct.sched_entity* nocapture %1) {
ret void
}
/* Variables and functions */
double erfc(double);
double derfc_(double *x) { return (erfc(*x)); }


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

x86 assembly (clang, -O2):
<derfc_>:
movsd  (%rdi),%xmm0
jmp    1030 <erfc@plt>

LLVM IR (-O0):
define double @derfc_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call double @erfc(double %4)
ret double %5
}

LLVM IR (-O2):
define double @derfc_(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @erfc(double %2)
ret double %3
}
int comp(const void *a, const void *b) { return *((int *)a) - *((int *)b); }


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @comp(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}