xunge/DecIR huggingface dataset:
/* Type definitions */
struct RNAplot_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct RNAplot_args_info *);
int /*<<< orphan*/ clear_given(struct RNAplot_args_info *);
int /*<<< orphan*/ init_args_info(struct RNAplot_args_info *);
void RNAplot_cmdline_parser_init(struct RNAplot_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<RNAplot_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAplot_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.RNAplot_args_info = type { i32 }
define void @RNAplot_cmdline_parser_init(%struct.RNAplot_args_info* %0) {
%2 = alloca %struct.RNAplot_args_info*
store %struct.RNAplot_args_info* %0, %struct.RNAplot_args_info** %2
%3 = load %struct.RNAplot_args_info*, %struct.RNAplot_args_info** %2
%4 = call i32 @clear_given(%struct.RNAplot_args_info* %3)
%5 = load %struct.RNAplot_args_info*, %struct.RNAplot_args_info** %2
%6 = call i32 @clear_args(%struct.RNAplot_args_info* %5)
%7 = load %struct.RNAplot_args_info*, %struct.RNAplot_args_info** %2
%8 = call i32 @init_args_info(%struct.RNAplot_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.RNAplot_args_info = type { i32 }
define void @RNAplot_cmdline_parser_init(%struct.RNAplot_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.RNAplot_args_info* %0)
%3 = tail call i32 @clear_args(%struct.RNAplot_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.RNAplot_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ tell_me_a_joke();
void tell_me_two_jokes() {
  printf("You're so stupid you had to call 411 to get the number for 911.");
  tell_me_a_joke();
}


x86 assembly (clang, -O0):
<tell_me_two_jokes>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <tell_me_a_joke@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [64 x i8] c"You're so stupid you had to call 411 to get the number for 911.\00"
define void @tell_me_two_jokes() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @tell_me_a_joke()
ret void
}

LLVM IR (-O2):
@.str = [64 x i8] c"You're so stupid you had to call 411 to get the number for 911.\00"
define void @tell_me_two_jokes() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @tell_me_a_joke()
ret void
}
int is_letter(char c) {
  return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
}


x86 assembly (clang, -O0):
<is_letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1129 <is_letter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <is_letter+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <is_letter+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_letter>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_letter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 122
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_letter(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int dm_uevent_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dm_uevent_init() {
ret i32 0
}
int getInt() { return 1; }


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

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

LLVM IR (-O0):
define i32 @getInt() {
ret i32 1
}

LLVM IR (-O2):
define i32 @getInt() {
ret i32 1
}
int test_imm_64int16_mem(short *val) {
  return ((*val) & (0x64 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_64int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 100
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double foo(double, double, double);
int main() {
  double a, b, c;
  a = 2.;
  b = 1.;
  c = 3.;
  double d = 4.;
  double *p = &d;
  int i;
  for (i = 0; i < 10000; i++) {
    *p = foo(a, b, c);
  }
  return (int)*p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xedc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x2710,-0x34(%rbp)
jge    1199 <main+0x89>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   1030 <foo@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1162 <main+0x52>
mov    -0x30(%rbp),%rax
cvttsd2si (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
movsd  0xed8(%rip),%xmm2
call   1030 <foo@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
cvttsd2si %xmm0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double*
%7 = alloca i32
store i32 0, i32* %1
store double 2.000000e+00, double* %2
store double 1.000000e+00, double* %3
store double 3.000000e+00, double* %4
store double 4.000000e+00, double* %5
store double* %5, double** %6
store i32 0, i32* %7
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 10000
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = load double, double* %2
%13 = load double, double* %3
%14 = load double, double* %4
%15 = call double @foo(double %12, double %13, double %14)
%16 = load double*, double** %6
store double %15, double* %16
br label %17
17: ; preds = %11
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %8
20: ; preds = %8
%21 = load double*, double** %6
%22 = load double, double* %21
%23 = fptosi double %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call double @foo(double 2.000000e+00, double 1.000000e+00, double 3.000000e+00)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 10000
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = fptosi double %3 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void Indent(short Sh, char *Mark) {
  printf("\n");
  while (Sh--)
    printf("%s", Mark);
}


x86 assembly (clang, -O0):
<Indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x2(%rbp)
cmp    $0x0,%ax
je     1161 <Indent+0x51>
mov    -0x10(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1131 <Indent+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Indent>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %bp,%bp
je     1153 <Indent+0x33>
lea    0xec1(%rip),%r14
nop
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffff,%bp
jne    1140 <Indent+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
define void @Indent(i16 signext %0, i8* %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = icmp eq i16 %0, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i16 [ %7, %5 ], [ %0, %2 ]
%7 = add i16 %6, -1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%9 = icmp eq i16 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
ret void
}
int int_comp(const void *a, const void *b) {
  int *x = (int *)a;
  int *y = (int *)b;
  if (*x < *y)
    return -1;
  else if (*y < *x)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<int_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <int_comp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <int_comp+0x64>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <int_comp+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1164 <int_comp+0x64>
jmp    115d <int_comp+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_comp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %eax,%ecx
setl   %dl
mov    $0xffffffff,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @int_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp slt i32 %6, %5
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int sum(int a, int b) {
  int j;
  if (a) {
    j = a + b;
  } else {
    j = a - b;
  }
  return j;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1122 <sum+0x22>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112b <sum+0x2b>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rsi,%rdi,1),%eax
neg    %esi
test   %edi,%edi
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = add nsw i32 %1, %0
%5 = sub nsw i32 0, %1
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
main() {
  double sum, atof(char[]);
  char line[100];
  int getline(char line[], int max);
  sum = 0;
  while (getline(line, 100) > 0)
    printf("\t%g\n", sum += atof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
cmp    $0x0,%eax
jle    1185 <main+0x55>
lea    -0x80(%rbp),%rdi
call   1030 <atof@plt>
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
jmp    114a <main+0x1a>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    1195 <main+0x65>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rbx
lea    0xea0(%rip),%r14
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
mov    %r14,%rdi
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [100 x i8]
store i32 0, i32* %1
store double 0.000000e+00, double* %2
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 100)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call double @atof(i8* %9)
%11 = load double, double* %2
%12 = fadd double %11, %10
store double %12, double* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %12)
br label %4
14: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"\09%g\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 100)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0, %5
%6 = phi double [ %8, %5 ], [ 0.000000e+00, %0 ]
%7 = call double @atof(i8* %2)
%8 = fadd double %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %8)
%10 = call i32 @getline(i8* %2, i32 100)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putserr(char *);
void show_version() {
  putserr("PET -- The Personal Expense Tracker -- Version "
          "0.2");
  putserr("Copyright 2012-2013 Fred Morcos <fred.morcos@gmail.com>");
  putserr("http://github.com/fredmorcos/pet.git");
  putserr("Licensed under the GPLv3");
}


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

x86 assembly (clang, -O2):
<show_version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <putserr@plt>
lea    0xf0f(%rip),%rdi
call   1030 <putserr@plt>
lea    0xf3b(%rip),%rdi
call   1030 <putserr@plt>
lea    0xf54(%rip),%rdi
pop    %rax
jmp    1030 <putserr@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"PET -- The Personal Expense Tracker -- Version 0.2\00"
@.str.1 = [56 x i8] c"Copyright 2012-2013 Fred Morcos <fred.morcos@gmail.com>\00"
@.str.2 = [37 x i8] c"http://github.com/fredmorcos/pet.git\00"
@.str.3 = [25 x i8] c"Licensed under the GPLv3\00"
define void @show_version() {
%1 = call i32 @putserr(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @putserr(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @putserr(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @putserr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [51 x i8] c"PET -- The Personal Expense Tracker -- Version 0.2\00"
@.str.1 = [56 x i8] c"Copyright 2012-2013 Fred Morcos <fred.morcos@gmail.com>\00"
@.str.2 = [37 x i8] c"http://github.com/fredmorcos/pet.git\00"
@.str.3 = [25 x i8] c"Licensed under the GPLv3\00"
define void @show_version() {
%1 = tail call i32 @putserr(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putserr(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putserr(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putserr(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void div_reg32(unsigned int reg32) {
  put8(0xF7);
  put8(0xF0 + reg32);
}


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

x86 assembly (clang, -O2):
<div_reg32>:
push   %rbx
mov    %edi,%ebx
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xf0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @div_reg32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 247)
%4 = load i32, i32* %2
%5 = add i32 240, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @div_reg32(i32 %0) {
%2 = tail call i32 @put8(i32 247)
%3 = add i32 %0, 240
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};
struct slInt {
  int dummy;
};

/* Variables and functions */
struct slInt *matchingExtId(struct sqlConnection *, char *, char *);
struct slInt *genePixSelectUniProt(struct sqlConnection *conn, char *acc) {
  return matchingExtId(conn, acc, "uniProt");
}


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

x86 assembly (clang, -O2):
<genePixSelectUniProt>:
lea    0xee9(%rip),%rdx
jmp    1030 <matchingExtId@plt>

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

LLVM IR (-O2):
%struct.slInt = type { i32 }
%struct.sqlConnection = type { i32 }
@.str = [8 x i8] c"uniProt\00"
define %struct.slInt* @genePixSelectUniProt(%struct.sqlConnection* %0, i8* %1) {
%3 = tail call %struct.slInt* @matchingExtId(%struct.sqlConnection* %0, i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.slInt* %3
}
void DUMMY_Debug(char *a) { return; }


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

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

LLVM IR (-O0):
define void @DUMMY_Debug(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @DUMMY_Debug(i8* nocapture %0) {
ret void
}
int drm_debugfs_init(struct drm_minor *minor, int minor_id,
                     struct dentry *root) {
  return 0;
}


x86 assembly (clang, -O0):
<drm_debugfs_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.drm_minor = type opaque
%struct.dentry = type opaque
define i32 @drm_debugfs_init(%struct.drm_minor* %0, i32 %1, %struct.dentry* %2) {
%4 = alloca %struct.drm_minor*
%5 = alloca i32
%6 = alloca %struct.dentry*
store %struct.drm_minor* %0, %struct.drm_minor** %4
store i32 %1, i32* %5
store %struct.dentry* %2, %struct.dentry** %6
ret i32 0
}

LLVM IR (-O2):
%struct.drm_minor = type opaque
%struct.dentry = type opaque
define i32 @drm_debugfs_init(%struct.drm_minor* nocapture readnone %0, i32 %1, %struct.dentry* nocapture readnone %2) {
ret i32 0
}
signed int signedint_ignoring_unsignedlonglong(signed int x,
                                               unsigned long long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedint_ignoring_unsignedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedint_ignoring_unsignedlonglong>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @signedint_ignoring_unsignedlonglong(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @signedint_ignoring_unsignedlonglong(i32 returned %0, i64 %1) {
ret i32 %0
}
int reassemble_17(int as17) {
  return (((as17 & 0x10000) >> 16) | ((as17 & 0x0f800) << 5) |
          ((as17 & 0x00400) >> 8) | ((as17 & 0x003ff) << 3));
}


x86 assembly (clang, -O0):
<reassemble_17>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
sar    $0x10,%eax
mov    -0x4(%rbp),%ecx
and    $0xf800,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x400,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x3ff,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reassemble_17>:
mov    %edi,%eax
shr    $0x10,%eax
mov    %edi,%ecx
shl    $0x5,%ecx
or     %eax,%ecx
and    $0x1f0001,%ecx
mov    %edi,%eax
shr    $0x8,%eax
and    $0x4,%eax
or     %ecx,%eax
and    $0x3ff,%edi
lea    (%rax,%rdi,8),%eax
ret

LLVM IR (-O0):
define i32 @reassemble_17(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65536
%5 = ashr i32 %4, 16
%6 = load i32, i32* %2
%7 = and i32 %6, 63488
%8 = shl i32 %7, 5
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 1024
%12 = ashr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 1023
%16 = shl i32 %15, 3
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @reassemble_17(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 1
%4 = shl i32 %0, 5
%5 = and i32 %4, 2031616
%6 = or i32 %3, %5
%7 = lshr i32 %0, 8
%8 = and i32 %7, 4
%9 = or i32 %6, %8
%10 = shl i32 %0, 3
%11 = and i32 %10, 8184
%12 = or i32 %9, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ sleepfunc();
int main() {
  sleepfunc();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sleepfunc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sleepfunc()
ret i32 0
}
int fossil_isdigit(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<fossil_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <fossil_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fossil_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @fossil_isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @fossil_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
double determinant2d(double const a, double const b, double const c,
                     double const d) {
  return a * d - c * b;
}


x86 assembly (clang, -O0):
<determinant2d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<determinant2d>:
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @determinant2d(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %8
%11 = load double, double* %7
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @determinant2d(double %0, double %1, double %2, double %3) {
%5 = fneg double %2
%6 = fmul double %5, %1
%7 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ M_E;
double pow(int /*<<< orphan*/, double);
double f(double x) { return pow(M_E, x * x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mulsd  %xmm0,%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
@M_E = global i32 0
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_E
%4 = load double, double* %2
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = call double @pow(i32 %3, double %6)
ret double %7
}

LLVM IR (-O2):
@M_E = global i32 0
define double @f(double %0) {
%2 = load i32, i32* @M_E
%3 = fmul double %0, %0
%4 = tail call double @pow(i32 %2, double %3)
ret double %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t bswap16(uint16_t v) {
  return ((v & 0xFF00) >> 8) | ((v & 0x00FF) << 8);
}


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

x86 assembly (clang, -O2):
<bswap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @bswap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void hexdump(unsigned char *buf, int buf_len, int cols, int group, char *info) {
  int i;
  return;
  if (info) {
    printf("hexdump: %s (%d)\n", info, buf_len);
  }
  for (i = 0; i < buf_len; i++) {
    if (i != 0) {
      if (i % group == 0) {
        printf(" ");
      }
      if (i % cols == 0) {
        printf("\n");
      }
    }
    printf("%02x", buf[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @hexdump(i8* nocapture %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
struct _Locale_numeric {
  int dummy;
};

/* Variables and functions */
const char *_Locale_false(struct _Locale_numeric *lnum) { return "false"; }


x86 assembly (clang, -O0):
<_Locale_false>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    0xef1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_false>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_numeric = type { i32 }
@.str = [6 x i8] c"false\00"
define i8* @_Locale_false(%struct._Locale_numeric* %0) {
%2 = alloca %struct._Locale_numeric*
store %struct._Locale_numeric* %0, %struct._Locale_numeric** %2
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
@.str = [6 x i8] c"false\00"
define i8* @_Locale_false(%struct._Locale_numeric* nocapture readnone %0) {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
float fasterexp(float);
float fastersigmoid(float x) { return 1.0f / (1.0f + fasterexp(-x)); }


x86 assembly (clang, -O0):
<fastersigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <fasterexp@plt>
movss  0xec4(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xeb8(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastersigmoid>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <fasterexp@plt>
movss  0xeeb(%rip),%xmm1
addss  %xmm1,%xmm0
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fastersigmoid(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call float @fasterexp(float %4)
%6 = fadd float 1.000000e+00, %5
%7 = fdiv float 1.000000e+00, %6
ret float %7
}

LLVM IR (-O2):
define float @fastersigmoid(float %0) {
%2 = fneg float %0
%3 = tail call float @fasterexp(float %2)
%4 = fadd float %3, 1.000000e+00
%5 = fdiv float 1.000000e+00, %4
ret float %5
}
int char_to_digit(int buffer[4]) {
  int x = 0;
  for (int i = 0; i < 4; ++i)
    x = (x << 8) | (buffer[i] & 255);
  return x;
}


x86 assembly (clang, -O0):
<char_to_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    114a <char_to_digit+0x4a>
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <char_to_digit+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_digit>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x18,%eax
movzbl %cl,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
shl    $0x8,%edx
movzwl %dx,%edx
or     %ecx,%edx
movzbl 0xc(%rdi),%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @char_to_digit(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %2, 24
%8 = shl i32 %4, 16
%9 = and i32 %8, 16711680
%10 = or i32 %7, %9
%11 = shl i32 %6, 8
%12 = and i32 %11, 65280
%13 = or i32 %10, %12
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = or i32 %16, %13
ret i32 %17
}
void handle_DANGER(sig) int sig;
{}


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

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

LLVM IR (-O0):
define void @handle_DANGER(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @handle_DANGER(i32 %0) {
ret void
}
int function(int arg) {
  int i;
  for (i = 0; i < 5; i++) {
  }
  if (i < 0) {
  }
  return (0);
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112b <function+0x2b>
jmp    111d <function+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <function+0xe>
cmpl   $0x0,-0x8(%rbp)
jge    113a <function+0x3a>
jmp    113a <function+0x3a>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @function(i32 %0) {
ret i32 0
}
char *langDbgDevF4Device() { return "F4 Device"; }


x86 assembly (clang, -O0):
<langDbgDevF4Device>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevF4Device>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"F4 Device\00"
define i8* @langDbgDevF4Device() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"F4 Device\00"
define i8* @langDbgDevF4Device() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
int fun898() { return 898; }


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

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

LLVM IR (-O0):
define i32 @fun898() {
ret i32 898
}

LLVM IR (-O2):
define i32 @fun898() {
ret i32 898
}
void FP_array_access4_Ok(int x, int *y) {
  int a[1];
  *y = x * 3 + 1;
  if (x * 3 + 1 == 1) {
    if (*y != 1) {
      a[3] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<FP_array_access4_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
imul   $0x3,-0x4(%rbp),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
imul   $0x3,-0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x1,%eax
jne    1141 <FP_array_access4_Ok+0x41>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
je     113c <FP_array_access4_Ok+0x3c>
movl   $0x0,-0x8(%rbp)
jmp    1141 <FP_array_access4_Ok+0x41>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FP_array_access4_Ok>:
lea    (%rdi,%rdi,2),%eax
add    $0x1,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @FP_array_access4_Ok(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [1 x i32]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 3
%8 = add nsw i32 %7, 1
%9 = load i32*, i32** %4
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = mul nsw i32 %10, 3
%12 = add nsw i32 %11, 1
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 3
store i32 0, i32* %19
br label %20
20: ; preds = %18, %14
br label %21
21: ; preds = %20, %2
ret void
}

LLVM IR (-O2):
define void @FP_array_access4_Ok(i32 %0, i32* nocapture writeonly %1) {
%3 = mul nsw i32 %0, 3
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int f115(int *);
int f116(int *p) { return f115(p); }


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

x86 assembly (clang, -O2):
<f116>:
jmp    1030 <f115@plt>

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

LLVM IR (-O2):
define i32 @f116(i32* %0) {
%2 = tail call i32 @f115(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __io_putchar(int /*<<< orphan*/);
__attribute__((weak)) int _write(int file, char *ptr, int len) {
  int DataIdx;
  for (DataIdx = 0; DataIdx < len; DataIdx++) {
    __io_putchar(*ptr++);
  }
  return len;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <_write+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <__io_putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <_write+0x19>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
test   %edx,%edx
jle    1142 <_write+0x32>
mov    %rsi,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <__io_putchar@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1130 <_write+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define weak i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ 0, %3 ]
%7 = phi i8* [ %8, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @__io_putchar(i32 %10)
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret i32 %2
}
int utf16IsSurrogatePair(unsigned short *utf16) {
  return (utf16[1] >= 0xdc00 && utf16[1] <= 0xdfff && *utf16 >= 0xd800 &&
          *utf16 <= 0xdbff);
}


x86 assembly (clang, -O0):
<utf16IsSurrogatePair>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0xdc00,%ecx
mov    %al,-0x9(%rbp)
jl     1164 <utf16IsSurrogatePair+0x64>
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0xdfff,%ecx
mov    %al,-0x9(%rbp)
jg     1164 <utf16IsSurrogatePair+0x64>
mov    -0x8(%rbp),%rax
movzwl (%rax),%ecx
xor    %eax,%eax
cmp    $0xd800,%ecx
mov    %al,-0x9(%rbp)
jl     1164 <utf16IsSurrogatePair+0x64>
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
cmp    $0xdbff,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf16IsSurrogatePair>:
movzwl 0x2(%rdi),%ecx
and    $0xfc00,%ecx
xor    %eax,%eax
cmp    $0xdc00,%ecx
jne    112d <utf16IsSurrogatePair+0x2d>
movzwl (%rdi),%ecx
cmp    $0xd800,%ecx
jb     112d <utf16IsSurrogatePair+0x2d>
movzwl %cx,%ecx
xor    %eax,%eax
cmp    $0xdc00,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @utf16IsSurrogatePair(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 1
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = icmp sge i32 %6, 56320
br i1 %7, label %8, label %24
8: ; preds = %1
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = zext i16 %11 to i32
%13 = icmp sle i32 %12, 57343
br i1 %13, label %14, label %24
14: ; preds = %8
%15 = load i16*, i16** %2
%16 = load i16, i16* %15
%17 = zext i16 %16 to i32
%18 = icmp sge i32 %17, 55296
br i1 %18, label %19, label %24
19: ; preds = %14
%20 = load i16*, i16** %2
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = icmp sle i32 %22, 56319
br label %24
24: ; preds = %19, %14, %8, %1
%25 = phi i1 [ false, %14 ], [ false, %8 ], [ false, %1 ], [ %23, %19 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @utf16IsSurrogatePair(i16* nocapture %0) {
%2 = getelementptr inbounds i16, i16* %0, i64 1
%3 = load i16, i16* %2
%4 = and i16 %3, -1024
%5 = icmp eq i16 %4, -9216
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i16, i16* %0
%8 = icmp ugt i16 %7, -10241
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = icmp ult i16 %7, -9216
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %9, %6, %1
%13 = phi i32 [ 0, %6 ], [ 0, %1 ], [ %11, %9 ]
ret i32 %13
}
void UART0_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @UART0_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 0, t = 0;
  t = sizeof a;
  printf("El tamaño del entero 'a' es: %d bytes\n", t);
  printf("El tamaño de un entero es: %d bytes\n", sizeof(int));
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"El tama\C3\B1o del entero 'a' es: %d bytes\0A\00"
@.str.1 = [38 x i8] c"El tama\C3\B1o de un entero es: %d bytes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 4, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"El tama\C3\B1o del entero 'a' es: %d bytes\0A\00"
@.str.1 = [38 x i8] c"El tama\C3\B1o de un entero es: %d bytes\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 4)
ret i32 0
}