xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  long character_count;
  for (character_count = 0; getchar() != EOF; character_count++) {
    ;
  }
  printf("Count of Character is %ld.\n", character_count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     1164 <main+0x44>
jmp    1153 <main+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [28 x i8] c"Count of Character is %ld.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
br label %3
3: ; preds = %8, %0
%4 = call i64 (...) @getchar()
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
br label %8
8: ; preds = %7
%9 = load i64, i64* %2
%10 = add nsw i64 %9, 1
store i64 %10, i64* %2
br label %3
11: ; preds = %3
%12 = load i64, i64* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [28 x i8] c"Count of Character is %ld.\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t getR3(uint32_t instruction) {
  uint32_t mask = 0x0007C00;
  return ((mask & instruction) >> 11);
}


x86 assembly (clang, -O0):
<getR3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x7c00,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
sar    $0xb,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getR3>:
mov    %edi,%eax
shr    $0xb,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @getR3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 31744, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %2
%6 = and i32 %4, %5
%7 = ashr i32 %6, 11
ret i32 %7
}

LLVM IR (-O2):
define i32 @getR3(i32 %0) {
%2 = lshr i32 %0, 11
%3 = and i32 %2, 15
ret i32 %3
}
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash+0x28>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, long);
void forf_proc_exch(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, a);
  forf_push_num(env, b);
}


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

x86 assembly (clang, -O2):
<forf_proc_exch>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <forf_push_num@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_exch(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %3
%11 = call i32 @forf_push_num(%struct.forf_env* %9, i64 %10)
%12 = load %struct.forf_env*, %struct.forf_env** %2
%13 = load i64, i64* %4
%14 = call i32 @forf_push_num(%struct.forf_env* %12, i64 %13)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_exch(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %2)
%5 = tail call i32 @forf_push_num(%struct.forf_env* %0, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(long);
void mu_sleep(long time) { usleep(time); }


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

x86 assembly (clang, -O2):
<mu_sleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @mu_sleep(i64 %0) {
%2 = tail call i32 @usleep(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  int age = 5;
  char name[31] = "Bob The builder";
  printf("My name is \"%s\" and I am %d years old\n", name, age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x14(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x12(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef4(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeed(%rip),%rdi
mov    %rsp,%rsi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.name = [31 x i8] c"Bob The builder\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [39 x i8] c"My name is \22%s\22 and I am %d years old\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [31 x i8]
store i32 0, i32* %1
store i32 5, i32* %2
%4 = bitcast [31 x i8]* %3 to i8*
%5 = getelementptr inbounds [31 x i8], [31 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.name = [31 x i8] c"Bob The builder\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [39 x i8] c"My name is \22%s\22 and I am %d years old\0A\00"
define i32 @main() {
%1 = alloca [31 x i8]
%2 = getelementptr inbounds [31 x i8], [31 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %2, i32 5)
ret i32 0
}
int dummy() { return 42; }


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

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

LLVM IR (-O0):
define i32 @dummy() {
ret i32 42
}

LLVM IR (-O2):
define i32 @dummy() {
ret i32 42
}
double I(double r) {
  double v = 0.0;
  if (r > 1.2 && r < 3.8)
    v = 1.0;
  return (v);
}


x86 assembly (clang, -O0):
<I>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1148 <I+0x48>
movsd  0xed8(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1148 <I+0x48>
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<I>:
movsd  0xef8(%rip),%xmm1
cmpltsd %xmm0,%xmm1
cmpltsd 0xef2(%rip),%xmm0
movsd  0xef2(%rip),%xmm2
andpd  %xmm2,%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @I(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0.000000e+00, double* %3
%4 = load double, double* %2
%5 = fcmp ogt double %4, 1.200000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 3.800000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
store double 1.000000e+00, double* %3
br label %10
10: ; preds = %9, %6, %1
%11 = load double, double* %3
ret double %11
}

LLVM IR (-O2):
define double @I(double %0) {
%2 = fcmp ogt double %0, 1.200000e+00
%3 = fcmp olt double %0, 3.800000e+00
%4 = and i1 %2, %3
%5 = select i1 %4, double 1.000000e+00, double 0.000000e+00
ret double %5
}
/* Variables and functions */
int errno;
int inputToken(char *, double *, char *, char *);
double readDouble(char *prompt, char *errorMessage) {
  double ret = 0;
  int err;
  err = inputToken("%lf", &ret, prompt, errorMessage);
  if (err) {
    errno = err;
    return 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<readDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <inputToken@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1166 <readDouble+0x56>
mov    -0x24(%rbp),%ecx
mov    0x2e89(%rip),%rax
mov    %ecx,(%rax)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1170 <readDouble+0x60>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readDouble>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
movq   $0x0,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rsi
call   1030 <inputToken@plt>
test   %eax,%eax
je     1140 <readDouble+0x30>
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
xorps  %xmm0,%xmm0
pop    %rax
ret
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@errno = global i32 0
define double @readDouble(i8* %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store double 0.000000e+00, double* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @inputToken(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6, i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %7
store i32 %14, i32* @errno
store double 0.000000e+00, double* %3
br label %17
15: ; preds = %2
%16 = load double, double* %6
store double %16, double* %3
br label %17
17: ; preds = %15, %13
%18 = load double, double* %3
ret double %18
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@errno = global i32 0
define double @readDouble(i8* %0, i8* %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
store double 0.000000e+00, double* %3
%5 = call i32 @inputToken(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3, i8* %0, i8* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
store i32 %5, i32* @errno
br label %10
8: ; preds = %2
%9 = load double, double* %3
br label %10
10: ; preds = %8, %7
%11 = phi double [ 0.000000e+00, %7 ], [ %9, %8 ]
ret double %11
}
int isTopFloor(int floorID) {
  int retValue_acc;
  {
    retValue_acc = floorID == 4;
    return (retValue_acc);
    return (retValue_acc);
  }
}


x86 assembly (clang, -O0):
<isTopFloor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isTopFloor>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isTopFloor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @isTopFloor(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
void _falwcGenericDrawImageString() { return; }


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

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

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

LLVM IR (-O2):
define void @_falwcGenericDrawImageString() {
ret void
}
/* Variables and functions */
int ENOSYS;
int hwconfig_f(const char *opt, char *buf) { return -ENOSYS; }


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

x86 assembly (clang, -O2):
<hwconfig_f>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @hwconfig_f(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @hwconfig_f(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
void adis16060_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16060_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int Fibonnaci(int);
int /*<<< orphan*/ printf(char *, int);
void generateFibonacci(int numbers) {
  int n = 0;
  for (int i = 0; i < numbers; i++) {
    printf("%d\n", Fibonnaci(n));
    n++;
  }
}


x86 assembly (clang, -O0):
<generateFibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1172 <generateFibonacci+0x52>
mov    -0x8(%rbp),%edi
call   1040 <Fibonnaci@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <generateFibonacci+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateFibonacci>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1158 <generateFibonacci+0x38>
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xecd(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebp,%edi
call   1040 <Fibonnaci@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1140 <generateFibonacci+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @generateFibonacci(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = tail call i32 @Fibonnaci(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %3, label %4
}
/* Variables and functions */
int log10(int);
int dobi_dolzino(int n) { return log10(n) + 1; }


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

x86 assembly (clang, -O2):
<dobi_dolzino>:
push   %rax
call   1030 <log10@plt>
add    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dobi_dolzino(i32 %0) {
%2 = tail call i32 @log10(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
bool is_num(char sym) {
  if (sym >= '0' && sym <= '9')
    return true;
  return false;
}


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <is_num+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <is_num+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <is_num+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_num(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 %12
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 %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_num(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ drop_queue(int);
void drop_queues(int *qids, int no) {
  int i;
  for (i = 0; i < no; i++, qids++) {
    drop_queue(*qids);
  }
}


x86 assembly (clang, -O0):
<drop_queues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <drop_queues+0x47>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <drop_queue@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1126 <drop_queues+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_queues>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <drop_queues+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1030 <drop_queue@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <drop_queues+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @drop_queues(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ 0, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 @drop_queue(i32 %7)
%9 = add nuw nsw i32 %5, 1
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp eq i32 %9, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t h265hvcc_get_constant_frame_rate(const uint8_t *p) {
  return p[20] >> 6;
}


x86 assembly (clang, -O0):
<h265hvcc_get_constant_frame_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x50(%rax),%eax
sar    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265hvcc_get_constant_frame_rate>:
mov    0x50(%rdi),%eax
sar    $0x6,%eax
ret

LLVM IR (-O0):
define i32 @h265hvcc_get_constant_frame_rate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 20
%5 = load i32, i32* %4
%6 = ashr i32 %5, 6
ret i32 %6
}

LLVM IR (-O2):
define i32 @h265hvcc_get_constant_frame_rate(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 20
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
ret i32 %4
}
void av_read_frame() {}


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

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

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

LLVM IR (-O2):
define void @av_read_frame() {
ret void
}
void TMTimerSetMillies(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerSetMillies() {
ret void
}
/* Variables and functions */
bool my_is_strlen_even(const char *str) {
even:
  if (*str++ == '\0')
    return true;
  else
    goto odd;
odd:
  if (*str++ == '\0')
    return false;
  else
    goto even;
}


x86 assembly (clang, -O0):
<my_is_strlen_even>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    112f <my_is_strlen_even+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1160 <my_is_strlen_even+0x60>
jmp    1134 <my_is_strlen_even+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    115b <my_is_strlen_even+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1160 <my_is_strlen_even+0x60>
jmp    1108 <my_is_strlen_even+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_is_strlen_even>:
cmpb   $0x0,(%rdi)
je     1112 <my_is_strlen_even+0x12>
cmpb   $0x0,0x1(%rdi)
lea    0x2(%rdi),%rdi
jne    1100 <my_is_strlen_even>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @my_is_strlen_even(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = getelementptr inbounds i8, i8* %3, i64 2
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %6, %2
%12 = phi i32 [ 1, %2 ], [ 0, %6 ]
ret i32 %12
}
unsigned char clamp(int i) {
  if (i < 0)
    return (0);
  if (i > 255)
    return (255);
  return (i);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111a <clamp+0x1a>
movb   $0x0,-0x1(%rbp)
jmp    1136 <clamp+0x36>
cmpl   $0xff,-0x8(%rbp)
jle    1130 <clamp+0x30>
movb   $0xff,-0x1(%rbp)
jmp    1136 <clamp+0x36>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @clamp(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
struct timeval __pfcq_us_to_timeval(uint64_t _us) {
  struct timeval ret;
  ret.tv_sec = _us / 1000000ULL;
  ret.tv_usec = _us - ret.tv_sec * 1000000ULL;
  return ret;
}


x86 assembly (clang, -O0):
<__pfcq_us_to_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mul    %rcx
shr    $0x12,%rdx
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   $0xf4240,%rcx,%rcx
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfcq_us_to_timeval>:
movabs $0x431bde82d7b634db,%rcx
de 1b 43
mov    %rdi,%rax
mul    %rcx
mov    %rdx,%rax
shr    $0x12,%rax
imul   $0xfffffffffff0bdc0,%rax,%rdx
add    %rdi,%rdx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define { i64, i64 } @__pfcq_us_to_timeval(i64 %0) {
%2 = alloca %struct.timeval
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = udiv i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = mul i64 %9, 1000000
%11 = sub i64 %7, %10
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %11, i64* %12
%13 = bitcast %struct.timeval* %2 to { i64, i64 }*
%14 = load { i64, i64 }, { i64, i64 }* %13
ret { i64, i64 } %14
}

LLVM IR (-O2):
define { i64, i64 } @__pfcq_us_to_timeval(i64 %0) {
%2 = udiv i64 %0, 1000000
%3 = mul i64 %2, -1000000
%4 = add i64 %3, %0
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
int /*<<< orphan*/ getsn(char *, int);
int htoi(char *);
int /*<<< orphan*/ puts0(char *);
int /*<<< orphan*/ videomod(int);
void videomod_(void) {
  char str[256];
  int ax;
  puts0("ax? ");
  getsn(str, 256);
  ax = (htoi(str));
  videomod(ax);
}


x86 assembly (clang, -O0):
<videomod_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xeae(%rip),%rdi
call   1060 <puts0@plt>
lea    -0x100(%rbp),%rdi
mov    $0x100,%esi
call   1030 <getsn@plt>
lea    -0x100(%rbp),%rdi
call   1050 <htoi@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%edi
call   1040 <videomod@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<videomod_>:
push   %rbx
sub    $0x100,%rsp
lea    0xeb1(%rip),%rdi
call   1060 <puts0@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <getsn@plt>
mov    %rbx,%rdi
call   1050 <htoi@plt>
mov    %eax,%edi
call   1040 <videomod@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"ax? \00"
define void @videomod_() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = call i32 @puts0(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @getsn(i8* %4, i32 256)
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @htoi(i8* %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @videomod(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ax? \00"
define void @videomod_() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts0(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @getsn(i8* %2, i32 256)
%5 = call i32 @htoi(i8* %2)
%6 = call i32 @videomod(i32 %5)
ret void
}
/* Variables and functions */
long long f2_foo();
signed long long f2(signed long long v_a, signed long long v_b) {
  signed long long v_anda = v_a & -15;
  signed long long v_andb = v_b & 14;
  signed long long v_or = v_anda | v_andb;
  if (!v_or)
    return f2_foo();
  else
    return v_or;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffff1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
and    $0xe,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
or     -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    115f <f2+0x4f>
mov    $0x0,%al
call   1030 <f2_foo@plt>
mov    %rax,-0x8(%rbp)
jmp    1167 <f2+0x57>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
and    $0xfffffffffffffff1,%rdi
and    $0xe,%esi
or     %rdi,%rsi
je     1120 <f2+0x10>
mov    %rsi,%rax
ret
xor    %eax,%eax
jmp    1030 <f2_foo@plt>

LLVM IR (-O0):
define i64 @f2(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%9 = load i64, i64* %4
%10 = and i64 %9, -15
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = and i64 %11, 14
store i64 %12, i64* %7
%13 = load i64, i64* %6
%14 = load i64, i64* %7
%15 = or i64 %13, %14
store i64 %15, i64* %8
%16 = load i64, i64* %8
%17 = icmp ne i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %2
%19 = call i64 (...) @f2_foo()
store i64 %19, i64* %3
br label %22
20: ; preds = %2
%21 = load i64, i64* %8
store i64 %21, i64* %3
br label %22
22: ; preds = %20, %18
%23 = load i64, i64* %3
ret i64 %23
}

LLVM IR (-O2):
define i64 @f2(i64 %0, i64 %1) {
%3 = and i64 %0, -15
%4 = and i64 %1, 14
%5 = or i64 %4, %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i64 (...) @f2_foo()
br label %9
9: ; preds = %2, %7
%10 = phi i64 [ %8, %7 ], [ %5, %2 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int sum, j, k, i, m;
  k = 0;
  sum = 1;
  do {
    i = 10;
    j = i - k;
    sum = sum * j;
    k = k + 1;
  } while (k != 9);
  printf("%d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jne    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sha256_block(int /*<<< orphan*/ *, void const *, size_t,
                                int);
void sha256_block_host_order(SHA256_CTX *ctx, const void *in, size_t num) {
  sha256_block(ctx, in, num, 1);
}


x86 assembly (clang, -O0):
<sha256_block_host_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <sha256_block@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha256_block_host_order>:
mov    $0x1,%ecx
jmp    1030 <sha256_block@plt>

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

LLVM IR (-O2):
define void @sha256_block_host_order(i32* %0, i8* %1, i64 %2) {
%4 = tail call i32 @sha256_block(i32* %0, i8* %1, i64 %2, i32 1)
ret void
}
int rand_r(unsigned *seed) {
  return (*seed = *seed * 1103515245 + 12345) & 0x7fffffff;
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%eax
add    $0x3039,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
and    $0x7fffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, 1103515245
%4 = add i32 %3, 12345
store i32 %4, i32* %0
%5 = and i32 %4, 2147483647
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ channels_getfirst();
int channels_getprev(int /*<<< orphan*/);
int channels_getlast(void) { return channels_getprev(channels_getfirst()); }


x86 assembly (clang, -O0):
<channels_getlast>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <channels_getfirst@plt>
mov    %eax,%edi
call   1040 <channels_getprev@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<channels_getlast>:
push   %rax
xor    %eax,%eax
call   1030 <channels_getfirst@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <channels_getprev@plt>

LLVM IR (-O0):
define i32 @channels_getlast() {
%1 = call i32 (...) @channels_getfirst()
%2 = call i32 @channels_getprev(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @channels_getlast() {
%1 = tail call i32 (...) @channels_getfirst()
%2 = tail call i32 @channels_getprev(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f2(unsigned long x,
                                              unsigned long y) {
  unsigned long r = x + y;
  if (r <= y)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1141 <f2+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
cmp    %rsi,%rbx
ja     1123 <f2+0x13>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @f2(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ugt i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void show(float flRateList[], int size) {
  int i = 0;
  for (i = 0; i < size; ++i) {
    printf("%.1f\n", flRateList[i]);
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <show+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <show+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <show+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movss  (%r15,%rbx,4),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <show+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
define void @show(float* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds float, float* %0, i64 %7
%9 = load float, float* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void get_relative_path(char *path_complete, char *index_path, char *result) {
  int n = strlen(index_path);
  strcpy(result, path_complete + n + 1);
}


x86 assembly (clang, -O0):
<get_relative_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x1c(%rbp),%rax
add    %rax,%rsi
add    $0x1,%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_relative_path>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rsi
add    $0x1,%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @get_relative_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = call i32 @strcpy(i8* %10, i8* %15)
ret void
}

LLVM IR (-O2):
define void @get_relative_path(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @strcpy(i8* %2, i8* %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int hal_flash_ioctl(uint8_t id, uint32_t cmd, void *args) { return 0; }


x86 assembly (clang, -O0):
<hal_flash_ioctl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hal_flash_ioctl(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @hal_flash_ioctl(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
void syscall_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @syscall_exit() {
ret void
}
void gtk_tree_path_is_ancestor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_is_ancestor() {
ret void
}