xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ asmadd(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("Goodbye universe!\n");
  printf("Calling asmadd, 2+2=%zu", asmadd(2, 2));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Goodbye universe!\0A\00"
@.str.1 = [24 x i8] c"Calling asmadd, 2+2=%zu\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @asmadd(i32 2, i32 2)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"Calling asmadd, 2+2=%zu\00"
@str = [18 x i8] c"Goodbye universe!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @asmadd(i32 2, i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int srcu_read_lock_held(struct srcu_struct *sp) { return 1; }


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

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

LLVM IR (-O0):
%struct.srcu_struct = type opaque
define i32 @srcu_read_lock_held(%struct.srcu_struct* %0) {
%2 = alloca %struct.srcu_struct*
store %struct.srcu_struct* %0, %struct.srcu_struct** %2
ret i32 1
}

LLVM IR (-O2):
%struct.srcu_struct = type opaque
define i32 @srcu_read_lock_held(%struct.srcu_struct* nocapture readnone %0) {
ret i32 1
}
void strtobuf(const char *str, char **buff) {
  while (*str)
    *((*buff)++) = *str++;
}


x86 assembly (clang, -O0):
<strtobuf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <strtobuf+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
jmp    110c <strtobuf+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtobuf>:
mov    (%rdi),%al
test   %al,%al
je     1127 <strtobuf+0x27>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    (%rsi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rsi)
mov    %al,(%rcx)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strtobuf+0x10>
ret

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

LLVM IR (-O2):
define void @strtobuf(i8* nocapture %0, i8** nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8*, i8** %1
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %1
store i8 %6, i8* %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int M_PI;
int rng();
double rng_phi(void) {
  double r = 2 * M_PI * rng();
  return r;
}


x86 assembly (clang, -O0):
<rng_phi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rng@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_phi>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <rng@plt>
imul   %ebx,%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @rng_phi() {
%1 = alloca double
%2 = load i32, i32* @M_PI
%3 = mul nsw i32 2, %2
%4 = call i32 (...) @rng()
%5 = mul nsw i32 %3, %4
%6 = sitofp i32 %5 to double
store double %6, double* %1
%7 = load double, double* %1
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @rng_phi() {
%1 = load i32, i32* @M_PI
%2 = shl nsw i32 %1, 1
%3 = tail call i32 (...) @rng()
%4 = mul nsw i32 %2, %3
%5 = sitofp i32 %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ generate_parser_table();
int /*<<< orphan*/ generate_switch_table(char *);
int /*<<< orphan*/ strcasecmp(char *, char *);
int main(int argc, char **argv) {
  if (argc > 2 && !strcasecmp(argv[1], "switchtable"))
    generate_switch_table(argv[2]);
  else
    generate_parser_table();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    117f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    117f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <generate_switch_table@plt>
jmp    1186 <main+0x56>
mov    $0x0,%al
call   1050 <generate_parser_table@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jl     114d <main+0x1d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1156 <main+0x26>
xor    %eax,%eax
call   1050 <generate_parser_table@plt>
jmp    115f <main+0x2f>
mov    0x10(%rbx),%rdi
call   1040 <generate_switch_table@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"switchtable\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 2
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcasecmp(i8* %11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @generate_switch_table(i8* %17)
br label %21
19: ; preds = %8, %2
%20 = call i32 (...) @generate_parser_table()
br label %21
21: ; preds = %19, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"switchtable\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @generate_switch_table(i8* %11)
br label %15
13: ; preds = %4, %2
%14 = tail call i32 (...) @generate_parser_table()
br label %15
15: ; preds = %13, %9
ret i32 0
}
void clntraw_destroy() {}


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

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

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

LLVM IR (-O2):
define void @clntraw_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(char const *s) {
  int i;
  if (!s)
    return;
  i = 0;
  while (s[i])
    i++;
  write(1, s, i);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ft_putendl+0x1c>
jmp    1177 <ft_putendl+0x67>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1153 <ft_putendl+0x43>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <ft_putendl+0x23>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe90(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     114e <ft_putendl+0x3e>
push   %rax
mov    %rdi,%rsi
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putendl+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xec2(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %23
7: ; preds = %1
store i32 0, i32* %3
br label %8
8: ; preds = %15, %7
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %8
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = call i32 @write(i32 1, i8* %19, i32 %20)
%22 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %23
23: ; preds = %18, %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @write(i32 1, i8* %0, i32 %10)
%12 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %13
13: ; preds = %1, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_recvdpkt();
int /*<<< orphan*/ initctdtree();
int /*<<< orphan*/ initph1tree();
int /*<<< orphan*/ initph2tree();
int /*<<< orphan*/ isakmp_close();
scalar_t__ isakmp_open();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int isakmp_init() {
  initph1tree();
  initph2tree();
  initctdtree();
  init_recvdpkt();
  srandom(time(0));
  if (isakmp_open() < 0)
    goto err;
  return (0);
err:
  isakmp_close();
  return (-1);
}


x86 assembly (clang, -O0):
<isakmp_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   10a0 <initph1tree@plt>
mov    $0x0,%al
call   1070 <initph2tree@plt>
mov    $0x0,%al
call   1050 <initctdtree@plt>
mov    $0x0,%al
call   1030 <init_recvdpkt@plt>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1040 <srandom@plt>
mov    $0x0,%al
call   1090 <isakmp_open@plt>
cmp    $0x0,%rax
jge    11c8 <isakmp_init+0x48>
jmp    11d4 <isakmp_init+0x54>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <isakmp_init+0x62>
mov    $0x0,%al
call   1060 <isakmp_close@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isakmp_init>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   10a0 <initph1tree@plt>
xor    %eax,%eax
call   1070 <initph2tree@plt>
xor    %eax,%eax
call   1050 <initctdtree@plt>
xor    %eax,%eax
call   1030 <init_recvdpkt@plt>
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1040 <srandom@plt>
xor    %eax,%eax
call   1090 <isakmp_open@plt>
test   %rax,%rax
jns    11c5 <isakmp_init+0x45>
xor    %eax,%eax
call   1060 <isakmp_close@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isakmp_init() {
%1 = alloca i32
%2 = call i32 (...) @initph1tree()
%3 = call i32 (...) @initph2tree()
%4 = call i32 (...) @initctdtree()
%5 = call i32 (...) @init_recvdpkt()
%6 = call i32 @time(i32 0)
%7 = call i32 @srandom(i32 %6)
%8 = call i64 (...) @isakmp_open()
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
br label %12
11: ; preds = %0
store i32 0, i32* %1
br label %14
12: ; preds = %10
%13 = call i32 (...) @isakmp_close()
store i32 -1, i32* %1
br label %14
14: ; preds = %12, %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @isakmp_init() {
%1 = tail call i32 (...) @initph1tree()
%2 = tail call i32 (...) @initph2tree()
%3 = tail call i32 (...) @initctdtree()
%4 = tail call i32 (...) @init_recvdpkt()
%5 = tail call i32 @time(i32 0)
%6 = tail call i32 @srandom(i32 %5)
%7 = tail call i64 (...) @isakmp_open()
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = tail call i32 (...) @isakmp_close()
br label %11
11: ; preds = %0, %9
%12 = phi i32 [ -1, %9 ], [ 0, %0 ]
ret i32 %12
}
void GB_FIRST_f_FP64(double *z, const double *x, const double *y) {
  (*z) = (*x);
}


x86 assembly (clang, -O0):
<GB_FIRST_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_FIRST_f_FP64>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @GB_FIRST_f_FP64(double* nocapture writeonly %0, double* nocapture %1, double* nocapture readnone %2) {
%4 = load double, double* %1
store double %4, double* %0
ret void
}
OP(dd, d4) {
  illegal_1();
  op_d4();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d4()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char);
void fprint_inc_atRi(FILE *stream, unsigned char i) {
  fprintf(stream, "INC   @R%X                       ", i);
}


x86 assembly (clang, -O0):
<fprint_inc_atRi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed3(%rip),%rsi
movzbl -0x9(%rbp),%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_inc_atRi>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"INC @R%X \00"
define void @fprint_inc_atRi(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = load i8, i8* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %6)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"INC @R%X \00"
define void @fprint_inc_atRi(i32* nocapture %0, i8 zeroext %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long pci_config_read_long(unsigned char bus, unsigned char dev, int func,
                          unsigned cmd) {
  printf("pci_config_read_long: generic function call\n");
  return 0;
}


x86 assembly (clang, -O0):
<pci_config_read_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %ecx,-0xc(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [45 x i8] c"pci_config_read_long: generic function call\0A\00"
define i64 @pci_config_read_long(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@str = [44 x i8] c"pci_config_read_long: generic function call\00"
define i64 @pci_config_read_long(i8 zeroext %0, i8 zeroext %1, i32 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i64 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t nybble(uint8_t *data, int n) {
  uint8_t byte = data[(n >> 1) & 0xF];
  return (n & 1) ? byte & 0xF : (byte >> 4) & 0xF;
}


x86 assembly (clang, -O0):
<nybble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
and    $0xf,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113e <nybble+0x3e>
mov    -0x10(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
jmp    114a <nybble+0x4a>
mov    -0x10(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nybble>:
mov    %esi,%eax
shr    %eax
and    $0xf,%eax
mov    (%rdi,%rax,4),%ecx
mov    %ecx,%eax
shr    $0x4,%eax
test   $0x1,%sil
cmovne %ecx,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @nybble(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 = load i32, i32* %4
%8 = ashr i32 %7, 1
%9 = and i32 %8, 15
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %6, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* %5
%18 = and i32 %17, 15
br label %23
19: ; preds = %2
%20 = load i32, i32* %5
%21 = ashr i32 %20, 4
%22 = and i32 %21, 15
br label %23
23: ; preds = %19, %16
%24 = phi i32 [ %18, %16 ], [ %22, %19 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @nybble(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 1
%4 = and i32 %3, 15
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %1, 1
%9 = icmp eq i32 %8, 0
%10 = lshr i32 %7, 4
%11 = select i1 %9, i32 %10, i32 %7
%12 = and i32 %11, 15
ret i32 %12
}
long __attribute__((no)) lnegv(long a) { return -a; }


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

x86 assembly (clang, -O2):
<lnegv>:
mov    %rdi,%rax
neg    %rax
ret

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

LLVM IR (-O2):
define i64 @lnegv(i64 %0) {
%2 = sub nsw i64 0, %0
ret i64 %2
}
Actions() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Actions() {
ret i32 0
}
const char *unqlite_lib_ident(void) {
  return "unqlite:c12ef78a5263baff9673264cdae36";
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"unqlite:c12ef78a5263baff9673264cdae36\00"
define i8* @unqlite_lib_ident() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [38 x i8] c"unqlite:c12ef78a5263baff9673264cdae36\00"
define i8* @unqlite_lib_ident() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}
unsigned HT_GenHash(const void *Key) { return (*(const unsigned *)Key & 0x1F); }


x86 assembly (clang, -O0):
<HT_GenHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HT_GenHash>:
mov    (%rdi),%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @HT_GenHash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, 31
ret i32 %6
}

LLVM IR (-O2):
define i32 @HT_GenHash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = and i32 %3, 31
ret i32 %4
}
/* Variables and functions */
double atan2(double, double);
extern double phi_of_accel(double an, double ae, double ad) {
  return atan2(ae, ad);
}


x86 assembly (clang, -O0):
<phi_of_accel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <atan2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phi_of_accel>:
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <atan2@plt>

LLVM IR (-O0):
define double @phi_of_accel(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = call double @atan2(double %7, double %8)
ret double %9
}

LLVM IR (-O2):
define double @phi_of_accel(double %0, double %1, double %2) {
%4 = tail call double @atan2(double %1, double %2)
ret double %4
}
unsigned setbits(unsigned x, int p, int n, unsigned y) {
  unsigned xmask = ~(~0 << (p - n + 1)) | (~0 << (p + 1));
  x = x & xmask;
  unsigned ymask = ~(~0 << n) & y;
  ymask = ymask << (p - n + 1);
  return x | ymask;
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
add    $0x1,%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%r9d
lea    0x1(%rsi),%r10d
mov    %esi,%r11d
sub    %edx,%r11d
add    $0x1,%r11b
mov    $0xffffffff,%eax
mov    $0xffffffff,%edx
mov    %r11d,%ecx
shl    %cl,%edx
mov    $0xffffffff,%esi
mov    %r10d,%ecx
shl    %cl,%esi
not    %edx
mov    %r9d,%ecx
shl    %cl,%eax
or     %edx,%esi
and    %edi,%esi
not    %eax
and    %r8d,%eax
mov    %r11d,%ecx
shl    %cl,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = add nsw i32 %13, 1
%15 = shl i32 -1, %14
%16 = xor i32 %15, -1
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
%19 = shl i32 -1, %18
%20 = or i32 %16, %19
store i32 %20, i32* %9
%21 = load i32, i32* %5
%22 = load i32, i32* %9
%23 = and i32 %21, %22
store i32 %23, i32* %5
%24 = load i32, i32* %7
%25 = shl i32 -1, %24
%26 = xor i32 %25, -1
%27 = load i32, i32* %8
%28 = and i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %10
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = sub nsw i32 %30, %31
%33 = add nsw i32 %32, 1
%34 = shl i32 %29, %33
store i32 %34, i32* %10
%35 = load i32, i32* %5
%36 = load i32, i32* %10
%37 = or i32 %35, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %1, %2
%6 = add nsw i32 %5, 1
%7 = shl nsw i32 -1, %6
%8 = xor i32 %7, -1
%9 = add nsw i32 %1, 1
%10 = shl nsw i32 -1, %9
%11 = or i32 %10, %8
%12 = and i32 %11, %0
%13 = shl nsw i32 -1, %2
%14 = xor i32 %13, -1
%15 = and i32 %14, %3
%16 = shl i32 %15, %6
%17 = or i32 %12, %16
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int /*<<< orphan*/ mark1();
int /*<<< orphan*/ mark2();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("inside main calling foo\n");
  mark1();
  foo();
  printf("inside main calling bar\n");
  mark2();
  bar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <mark1@plt>
mov    $0x0,%al
call   1070 <foo@plt>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <mark2@plt>
mov    $0x0,%al
call   1040 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <mark1@plt>
xor    %eax,%eax
call   1070 <foo@plt>
lea    0xea6(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <mark2@plt>
xor    %eax,%eax
call   1050 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"inside main calling foo\0A\00"
@.str.1 = [25 x i8] c"inside main calling bar\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @mark1()
%4 = call i32 (...) @foo()
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @mark2()
%7 = call i32 (...) @bar()
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"inside main calling foo\00"
@str.2 = [24 x i8] c"inside main calling bar\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @mark1()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 (...) @mark2()
%6 = tail call i32 (...) @bar()
ret i32 0
}
/* Variables and functions */
unsigned char VIM_HIF_GetReg8(int);
unsigned char VIM_JPEG_GetTargetCompressRatio(void) {
  unsigned char bRatio;
  bRatio = VIM_HIF_GetReg8((0x0000 + 0x004));
  bRatio--;
  bRatio >>= 2;
  return bRatio;
}


x86 assembly (clang, -O0):
<VIM_JPEG_GetTargetCompressRatio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x2,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_GetTargetCompressRatio>:
push   %rax
mov    $0x4,%edi
call   1030 <VIM_HIF_GetReg8@plt>
add    $0xff,%al
shr    $0x2,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @VIM_JPEG_GetTargetCompressRatio() {
%1 = alloca i8
%2 = call zeroext i8 @VIM_HIF_GetReg8(i32 4)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = add i8 %3, -1
store i8 %4, i8* %1
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 2
%8 = trunc i32 %7 to i8
store i8 %8, i8* %1
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @VIM_JPEG_GetTargetCompressRatio() {
%1 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 4)
%2 = add i8 %1, -1
%3 = lshr i8 %2, 2
ret i8 %3
}
/* Variables and functions */
int cursor_pos();
int /*<<< orphan*/ outb(int, unsigned short);
void fb_move_cursor() {
  unsigned short pos = cursor_pos() / 2;
  outb(0x3D4, 14);
  outb(0x3D5, ((pos >> 8) & 0x00FF));
  outb(0x3D4, 15);
  outb(0x3D5, pos & 0x00FF);
}


x86 assembly (clang, -O0):
<fb_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <cursor_pos@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %ax,-0x2(%rbp)
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzwl %ax,%esi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzwl %ax,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_move_cursor>:
push   %rbx
xor    %eax,%eax
call   1040 <cursor_pos@plt>
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <outb@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
call   1030 <outb@plt>
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <outb@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @fb_move_cursor() {
%1 = alloca i16
%2 = call i32 (...) @cursor_pos()
%3 = sdiv i32 %2, 2
%4 = trunc i32 %3 to i16
store i16 %4, i16* %1
%5 = call i32 @outb(i32 980, i16 zeroext 14)
%6 = load i16, i16* %1
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i16
%11 = call i32 @outb(i32 981, i16 zeroext %10)
%12 = call i32 @outb(i32 980, i16 zeroext 15)
%13 = load i16, i16* %1
%14 = zext i16 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i16
%17 = call i32 @outb(i32 981, i16 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @fb_move_cursor() {
%1 = tail call i32 (...) @cursor_pos()
%2 = sdiv i32 %1, 2
%3 = tail call i32 @outb(i32 980, i16 zeroext 14)
%4 = trunc i32 %2 to i16
%5 = lshr i16 %4, 8
%6 = tail call i32 @outb(i32 981, i16 zeroext %5)
%7 = tail call i32 @outb(i32 980, i16 zeroext 15)
%8 = and i16 %4, 255
%9 = tail call i32 @outb(i32 981, i16 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (sizeof(void *) == 4) {
    printf("Running Win32\n");
  } else if (sizeof(void *) == 8) {
    printf("Running x64\n");
  } else {
    printf("Unexpected platform\n");
  }
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Running x64\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int ti_md_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_md_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_md_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_md_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_md_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(float const, float const, float const,
                                 float const);
void glWindowPos4fv(const float v[4]) { glWindowPos4f(v[0], v[1], v[2], v[3]); }


x86 assembly (clang, -O0):
<glWindowPos4fv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm3
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos4fv>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movss  0x8(%rdi),%xmm2
movss  0xc(%rdi),%xmm3
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos4fv(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 2
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 3
%14 = load float, float* %13
%15 = call i32 @glWindowPos4f(float %5, float %8, float %11, float %14)
ret void
}

LLVM IR (-O2):
define void @glWindowPos4fv(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = getelementptr inbounds float, float* %0, i64 2
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %0, i64 3
%8 = load float, float* %7
%9 = tail call i32 @glWindowPos4f(float %2, float %4, float %6, float %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ consoleAddLine(char const *, int);
int /*<<< orphan*/ printf(char *, char const *);
void consolePrint(const char *text, int status) {
  printf("%s\n", text);
  consoleAddLine(text, status);
}


x86 assembly (clang, -O0):
<consolePrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <consoleAddLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<consolePrint>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <consoleAddLine@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @consolePrint(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 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @consoleAddLine(i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @consolePrint(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @consoleAddLine(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ v;

/* Variables and functions */
int bitarithm_lsb(unsigned int);
unsigned bitarithm_msb(unsigned v) {
  if ((signed)v >= 0) {
    v &= -v;
    return bitarithm_lsb(v);
  } else {
    return sizeof(v) * 8 - 1;
  }
}


x86 assembly (clang, -O0):
<bitarithm_msb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1140 <bitarithm_msb+0x30>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <bitarithm_lsb@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <bitarithm_msb+0x37>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitarithm_msb>:
test   %edi,%edi
js     1121 <bitarithm_msb+0x11>
mov    %edi,%eax
neg    %eax
and    %edi,%eax
mov    %eax,%edi
jmp    1030 <bitarithm_lsb@plt>
mov    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @bitarithm_msb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub i32 0, %7
%9 = load i32, i32* %3
%10 = and i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @bitarithm_lsb(i32 %11)
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 31, i32* %2
br label %14
14: ; preds = %13, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @bitarithm_msb(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = and i32 %4, %0
%6 = tail call i32 @bitarithm_lsb(i32 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 31, %1 ]
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcolormap_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcolormap.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcolormap_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcolormap_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t
detexGetCompressedFormat(uint32_t texture_format) {
  return texture_format >> 24;
}


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

x86 assembly (clang, -O2):
<detexGetCompressedFormat>:
mov    %edi,%eax
sar    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @detexGetCompressedFormat(i32 %0) {
%2 = ashr i32 %0, 24
ret i32 %2
}
int isDigit(char d) {
  if (d >= '0' && d <= '9')
    return d - '0';
  else
    return -1;
}


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <isDigit+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <isDigit+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <isDigit+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
lea    -0x30(%rdi),%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%al
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -48
%6 = select i1 %3, i32 %5, i32 -1
ret i32 %6
}
void initialiseStatesAndConstants(double *states, double *variables) {
  states[0] = 3.0;
  states[1] = 5.0;
}


x86 assembly (clang, -O0):
<initialiseStatesAndConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
store double 3.000000e+00, double* %6
%7 = load double*, double** %3
%8 = getelementptr inbounds double, double* %7, i64 1
store double 5.000000e+00, double* %8
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture readnone %1) {
%3 = bitcast double* %0 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 5.000000e+00>, <2 x double>* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die_errno(char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ set_cloexec(int);
void xpipe(int pipefd[2]) {
  if (pipe(pipefd))
    die_errno("cannot create pipe");
  set_cloexec(pipefd[0]);
  set_cloexec(pipefd[1]);
}


x86 assembly (clang, -O0):
<xpipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pipe@plt>
cmp    $0x0,%rax
je     115b <xpipe+0x2b>
lea    0xeaa(%rip),%rdi
call   1050 <die_errno@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <set_cloexec@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <set_cloexec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xpipe>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pipe@plt>
test   %rax,%rax
je     114a <xpipe+0x1a>
lea    0xebb(%rip),%rdi
call   1050 <die_errno@plt>
mov    (%rbx),%edi
call   1030 <set_cloexec@plt>
mov    0x4(%rbx),%edi
pop    %rbx
jmp    1030 <set_cloexec@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"cannot create pipe\00"
define void @xpipe(i32* %0) {
%2 = tail call i64 @pipe(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @die_errno(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = load i32, i32* %0
%8 = tail call i32 @set_cloexec(i32 %7)
%9 = getelementptr inbounds i32, i32* %0, i64 1
%10 = load i32, i32* %9
%11 = tail call i32 @set_cloexec(i32 %10)
ret void
}
void handle_FPE(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_FPE(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ utlisupper(int);
int utlfoldchar(int ch) {
  if (utlisupper(ch))
    ch += 32;
  return ch;
}


x86 assembly (clang, -O0):
<utlfoldchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <utlisupper@plt>
cmp    $0x0,%rax
je     1136 <utlfoldchar+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utlfoldchar>:
push   %rbx
mov    %edi,%ebx
call   1030 <utlisupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @utlfoldchar(i32 %0) {
%2 = tail call i64 @utlisupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}