xunge/DecIR huggingface dataset:
/* Variables and functions */
int MI_save_routine_name(char *);
int MI2_save_routine_name(char *name) { return MI_save_routine_name(name); }


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

x86 assembly (clang, -O2):
<MI2_save_routine_name>:
jmp    1030 <MI_save_routine_name@plt>

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

LLVM IR (-O2):
define i32 @MI2_save_routine_name(i8* %0) {
%2 = tail call i32 @MI_save_routine_name(i8* %0)
ret i32 %2
}
void foo_smp() {}


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

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

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

LLVM IR (-O2):
define void @foo_smp() {
ret void
}
int check_option(int option) {
  if (option <= 3 && option >= 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_option>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jg     1127 <check_option+0x27>
cmpl   $0x1,-0x8(%rbp)
jl     1127 <check_option+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <check_option+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_option>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x3,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @check_option(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
%4 = zext i1 %3 to i32
ret i32 %4
}
void XClearWindow() {}


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

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

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

LLVM IR (-O2):
define void @XClearWindow() {
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
char *strerror(int);
void fatal(const char *msg) {
  do {
    fprintf(stderr, "%s Error: %d. %s", msg, errno, strerror(errno));
    fprintf(stderr, "\n");
  } while (0);
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    %rax,%r8
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2e9f(%rip),%r15
mov    (%r15),%ebp
mov    0x2e8d(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   1050 <strerror@plt>
lea    0xea5(%rip),%rsi
mov    %ebp,%edi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %rax,%r8
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xe9b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"%s Error: %d. %s\00"
@errno = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = load i32, i32* @errno
%7 = load i32, i32* @errno
%8 = call i8* @strerror(i32 %7)
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %3
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"%s Error: %d. %s\00"
@errno = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i8* %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct timespec {
  int tv_sec;
  long long tv_nsec;
};

/* Variables and functions */
long long timediff(struct timespec *start, struct timespec *end) {
  return (end->tv_sec - start->tv_sec) * 1000000000 + end->tv_nsec -
         start->tv_nsec;
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3b9aca00,%eax,%eax
cltq
mov    -0x10(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x8(%rbp),%rcx
sub    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
movslq (%rsi),%rax
movslq (%rdi),%rcx
sub    %rcx,%rax
imul   $0x3b9aca00,%rax,%rcx
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @timediff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000000
%13 = sext i32 %12 to i64
%14 = load %struct.timespec*, %struct.timespec** %4
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = add nsw i64 %13, %16
%18 = load %struct.timespec*, %struct.timespec** %3
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %18, i32 0, i32 1
%20 = load i64, i64* %19
%21 = sub nsw i64 %17, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @timediff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add i64 %14, %9
ret i64 %15
}
void PrintObjectCmpConstant(void *theEnv, const char *logicalName,
                            void *theValue) {}


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

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

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

LLVM IR (-O2):
define void @PrintObjectCmpConstant(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printfunc(char *, char *, char *);
int /*<<< orphan*/ seperation(char *, char *, char *, char *);
int main(void) {
  char input[100], ware[100], pro[100], quali[100];
  seperation(input, ware, pro, quali);
  printfunc(ware, pro, quali);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
lea    -0x150(%rbp),%rdx
lea    -0x1c0(%rbp),%rcx
call   1040 <seperation@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
lea    -0x1c0(%rbp),%rdx
call   1030 <printfunc@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1c0,%rsp
lea    0x150(%rsp),%rdi
lea    0xe0(%rsp),%rbx
lea    0x70(%rsp),%r14
mov    %rsp,%r15
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <seperation@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <printfunc@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
store i32 0, i32* %1
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = call i32 @seperation(i8* %6, i8* %7, i8* %8, i8* %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%14 = call i32 @printfunc(i8* %11, i8* %12, i8* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = call i32 @seperation(i8* %5, i8* %6, i8* %7, i8* %8)
%10 = call i32 @printfunc(i8* %6, i8* %7, i8* %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ isprime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 2; i < 100; ++i) {
    if (isprime(i)) {
      printf("%d\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1174 <main+0x54>
mov    -0x8(%rbp),%edi
call   1040 <isprime@plt>
cmp    $0x0,%rax
je     1161 <main+0x41>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
jmp    1166 <main+0x46>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
jmp    1148 <main+0x28>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x64,%ebx
je     1160 <main+0x40>
mov    %ebx,%edi
call   1040 <isprime@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 2, %0 ], [ %8, %7 ]
%3 = tail call i64 @isprime(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Variables and functions */
int findComplement(int);
char *when5_shouldReturn2() {
  int complement = findComplement(5);
  do {
    if (!(complement == 2))
      return "error, something went wrong";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<when5_shouldReturn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <findComplement@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     113f <when5_shouldReturn2+0x2f>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <when5_shouldReturn2+0x3c>
jmp    1144 <when5_shouldReturn2+0x34>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<when5_shouldReturn2>:
push   %rax
mov    $0x5,%edi
call   1030 <findComplement@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
lea    0xed9(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"error, something went wrong\00"
define i8* @when5_shouldReturn2() {
%1 = alloca i8*
%2 = alloca i32
%3 = call i32 @findComplement(i32 5)
store i32 %3, i32* %2
br label %4
4: ; preds = %0
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 2
br i1 %6, label %8, label %7
7: ; preds = %4
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %1
br label %10
8: ; preds = %4
br label %9
9: ; preds = %8
store i8* null, i8** %1
br label %10
10: ; preds = %9, %7
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"error, something went wrong\00"
define i8* @when5_shouldReturn2() {
%1 = tail call i32 @findComplement(i32 5)
%2 = icmp eq i32 %1, 2
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
void RTErrConvertFromErrno(void) {}


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

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

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

LLVM IR (-O2):
define void @RTErrConvertFromErrno() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void test_assignment(void) {
  int x, y = -1;
  x = (y == 10);
  printf("x = %d, y= %d \n", x, y);
  x = (y = 10);
  printf("x = %d, y= %d \n", x, y);
}


x86 assembly (clang, -O0):
<test_assignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assignment>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"x = %d, y= %d \0A\00"
define void @test_assignment() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
%5 = zext i1 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
store i32 10, i32* %2
store i32 10, i32* %1
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"x = %d, y= %d \0A\00"
define void @test_assignment() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0, i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 10, i32 10)
ret void
}
int template_wrap() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @template_wrap() {
ret i32 1
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=23 REPO_URL=heads/master "
         "REVISION=r3p2-01rel3-137c649 CHANGED_REVISION=137c649 "
         "CHANGE_DATE=2013-08-22 17:45:49 +0900 BUILD_DATE=Fri Aug 23 20:48:48 "
         "KST 2013 BUILD=release TARGET_PLATFORM=pegasus-m400 "
         "MALI_PLATFORM=pegasus-m400 KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [401 x i8] c"malidrv: API_VERSION=23 REPO_URL=heads/master REVISION=r3p2-01rel3-137c649 CHANGED_REVISION=137c649 CHANGE_DATE=2013-08-22 17:45:49 +0900 BUILD_DATE=Fri Aug 23 20:48:48 KST 2013 BUILD=release TARGET_PLATFORM=pegasus-m400 MALI_PLATFORM=pegasus-m400 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([401 x i8], [401 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [401 x i8] c"malidrv: API_VERSION=23 REPO_URL=heads/master REVISION=r3p2-01rel3-137c649 CHANGED_REVISION=137c649 CHANGE_DATE=2013-08-22 17:45:49 +0900 BUILD_DATE=Fri Aug 23 20:48:48 KST 2013 BUILD=release TARGET_PLATFORM=pegasus-m400 MALI_PLATFORM=pegasus-m400 KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP=y USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([401 x i8], [401 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct task_security_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int syscall(int, int, int /*<<< orphan*/, struct task_security_struct *);
int set_task_xattr(struct task_security_struct *tss) {
  int i = 0;
  i = syscall(349, 1, 0, tss);
  if (i < 0) {
    perror("set current's xattr error");
    return -1;
  }
}


x86 assembly (clang, -O0):
<set_task_xattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x15d,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1168 <set_task_xattr+0x48>
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_task_xattr>:
push   %rax
mov    %rdi,%rcx
mov    $0x15d,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <syscall@plt>
test   %eax,%eax
js     1140 <set_task_xattr+0x20>
mov    $0xffffffff,%eax
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
jmp    1139 <set_task_xattr+0x19>

LLVM IR (-O0):
%struct.task_security_struct = type { i32 }
@.str = [26 x i8] c"set current's xattr error\00"
define i32 @set_task_xattr(%struct.task_security_struct* %0) {
%2 = alloca i32
%3 = alloca %struct.task_security_struct*
%4 = alloca i32
store %struct.task_security_struct* %0, %struct.task_security_struct** %3
store i32 0, i32* %4
%5 = load %struct.task_security_struct*, %struct.task_security_struct** %3
%6 = call i32 @syscall(i32 349, i32 1, i32 0, %struct.task_security_struct* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %11
11: ; preds = %9, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.task_security_struct = type { i32 }
@.str = [26 x i8] c"set current's xattr error\00"
define i32 @set_task_xattr(%struct.task_security_struct* %0) {
%2 = tail call i32 @syscall(i32 349, i32 1, i32 0, %struct.task_security_struct* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EKFStateVarianceHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void EKFStateVarianceLogging() { UAVObjLogging(EKFStateVarianceHandle()); }


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

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

LLVM IR (-O0):
define void @EKFStateVarianceLogging() {
%1 = call i32 (...) @EKFStateVarianceHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @EKFStateVarianceLogging() {
%1 = tail call i32 (...) @EKFStateVarianceHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare_str(void const *a, void const *b) {
  const char **ia = (const char **)a;
  const char **ib = (const char **)b;
  return strcmp(*ia, *ib);
}


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

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

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

LLVM IR (-O2):
define i32 @compare_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("NHDP compiled!");
  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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"NHDP compiled!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long get_microseconds(void) {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) != 0)
    abort();
  return ((long long)tv.tv_sec) * 1000000LL + (long long)tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_microseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
cmp    $0x0,%rax
je     1146 <get_microseconds+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_microseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
test   %rax,%rax
jne    1148 <get_microseconds+0x28>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_microseconds() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%11 = load i64, i64* %10
%12 = add nsw i64 %9, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_microseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = mul nsw i64 %9, 1000000
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i64, i64* %11
%13 = add nsw i64 %10, %12
ret i64 %13
}
/* Variables and functions */
scalar_t__ str_ncmp(char *, int, char const *, int);
int is_declaration(const char *token) {
  return 0 == str_ncmp("int", 4, token, 1000);
}


x86 assembly (clang, -O0):
<is_declaration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
mov    $0x4,%esi
mov    $0x3e8,%ecx
call   1030 <str_ncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_declaration>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x3e8,%ecx
call   1030 <str_ncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"int\00"
define i32 @is_declaration(i8* %0) {
%2 = tail call i64 @str_ncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4, i8* %0, i32 1000)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
float multiply(float f1, float f2) { return f1 * f2; }


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @multiply(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @multiply(float %0, float %1) {
%3 = fmul float %0, %1
ret float %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t rotateL_fun_int32_t(int32_t x, int32_t i) {
  if ((i %= 32) == 0)
    return x;
  return (x << i) | ((0x7fffffff >> (31 - i)) & (x >> (32 - i)));
}


x86 assembly (clang, -O0):
<rotateL_fun_int32_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmp    $0x0,%edx
jne    112c <rotateL_fun_int32_t+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <rotateL_fun_int32_t+0x5d>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    $0x1f,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x7fffffff,%edx
sar    %cl,%edx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x20,%ecx
sub    -0xc(%rbp),%ecx
sar    %cl,%edx
mov    -0x10(%rbp),%ecx
and    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotateL_fun_int32_t>:
mov    %edi,%eax
lea    0x1f(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%esi
je     112e <rotateL_fun_int32_t+0x2e>
mov    %eax,%edx
mov    %esi,%ecx
shl    %cl,%edx
mov    $0x1f,%cl
sub    %sil,%cl
mov    $0x7fffffff,%edi
shr    %cl,%edi
neg    %sil
mov    %esi,%ecx
sar    %cl,%eax
and    %edi,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rotateL_fun_int32_t(i32 %0, i32 %1) {
%3 = srem i32 %1, 32
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = shl i32 %0, %3
%7 = sub nsw i32 31, %3
%8 = lshr i32 2147483647, %7
%9 = sub nsw i32 32, %3
%10 = ashr i32 %0, %9
%11 = and i32 %8, %10
%12 = or i32 %11, %6
br label %13
13: ; preds = %2, %5
%14 = phi i32 [ %12, %5 ], [ %0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ writeGenerationalSolutionsBestFinal();
int /*<<< orphan*/ writeGenerationalSolutionsBestNotFinal();
void writeGenerationalSolutionsBest(short final) {
  if (final)
    writeGenerationalSolutionsBestFinal();
  else
    writeGenerationalSolutionsBestNotFinal();
}


x86 assembly (clang, -O0):
<writeGenerationalSolutionsBest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
je     1146 <writeGenerationalSolutionsBest+0x26>
mov    $0x0,%al
call   1030 <writeGenerationalSolutionsBestFinal@plt>
jmp    114d <writeGenerationalSolutionsBest+0x2d>
mov    $0x0,%al
call   1040 <writeGenerationalSolutionsBestNotFinal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeGenerationalSolutionsBest>:
xor    %eax,%eax
test   %di,%di
je     112c <writeGenerationalSolutionsBest+0xc>
jmp    1030 <writeGenerationalSolutionsBestFinal@plt>
jmp    1040 <writeGenerationalSolutionsBestNotFinal@plt>

LLVM IR (-O0):
define void @writeGenerationalSolutionsBest(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = icmp ne i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @writeGenerationalSolutionsBestFinal()
br label %9
7: ; preds = %1
%8 = call i32 (...) @writeGenerationalSolutionsBestNotFinal()
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @writeGenerationalSolutionsBest(i16 signext %0) {
%2 = icmp eq i16 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @writeGenerationalSolutionsBestFinal()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @writeGenerationalSolutionsBestNotFinal()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int marc_find_genre(char const *);
int is_marc_genre(const char *query) {
  if (marc_find_genre(query) != -1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_marc_genre>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <marc_find_genre@plt>
cmp    $0xffffffff,%eax
je     113a <is_marc_genre+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <is_marc_genre+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_marc_genre>:
push   %rax
call   1030 <marc_find_genre@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_marc_genre(i8* %0) {
%2 = tail call i32 @marc_find_genre(i8* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bwa_pac_rev_core(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int bwa_pac_rev(int argc, char *argv[]) {
  if (argc < 3) {
    fprintf(stderr, "Usage: bwa pac_rev <in.pac> <out.pac>\n");
    return 1;
  }
  bwa_pac_rev_core(argv[1], argv[2]);
  return 0;
}


x86 assembly (clang, -O0):
<bwa_pac_rev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    115a <bwa_pac_rev+0x3a>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1176 <bwa_pac_rev+0x56>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <bwa_pac_rev_core@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwa_pac_rev>:
push   %rax
cmp    $0x2,%edi
jg     1142 <bwa_pac_rev+0x22>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1030 <bwa_pac_rev_core@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: bwa pac_rev <in.pac> <out.pac>\0A\00"
define i32 @bwa_pac_rev(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @bwa_pac_rev_core(i8* %14, i8* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %11, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Usage: bwa pac_rev <in.pac> <out.pac>\0A\00"
define i32 @bwa_pac_rev(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @bwa_pac_rev_core(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
void Delay(unsigned long Cycles) {
  while (Cycles != 0) {
    Cycles--;
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1124 <Delay+0x24>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <Delay+0x8>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @Delay(i64 %0) {
ret void
}
char *element_toggle_button_get_heading(char *element_name, char *heading) {
  if (!heading)
    heading = element_name;
  return heading;
}


x86 assembly (clang, -O0):
<element_toggle_button_get_heading>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <element_toggle_button_get_heading+0x1f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_toggle_button_get_heading>:
mov    %rdi,%rax
test   %rsi,%rsi
cmovne %rsi,%rax
ret

LLVM IR (-O0):
define i8* @element_toggle_button_get_heading(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i8*, i8** %3
store i8* %8, i8** %4
br label %9
9: ; preds = %7, %2
%10 = load i8*, i8** %4
ret i8* %10
}

LLVM IR (-O2):
define i8* @element_toggle_button_get_heading(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %1, null
%4 = select i1 %3, i8* %0, i8* %1
ret i8* %4
}
int MQTTPacket_encode(unsigned char *buf, int length) {
  int rc = 0;
  do {
    char d = length % 128;
    length /= 128;
    if (length > 0)
      d |= 0x80;
    buf[rc++] = d;
  } while (length > 0);
  return rc;
}


x86 assembly (clang, -O0):
<MQTTPacket_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x11(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1146 <MQTTPacket_encode+0x46>
movsbl -0x11(%rbp),%eax
or     $0x80,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
cmpl   $0x0,-0xc(%rbp)
jg     1112 <MQTTPacket_encode+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MQTTPacket_encode>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x7f(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
mov    %ecx,%edx
and    $0xffffff80,%edx
mov    %esi,%r8d
sub    %edx,%r8d
sar    $0x7,%ecx
mov    %r8d,%edx
or     $0x80,%dl
movzbl %dl,%edx
cmp    $0x7f,%esi
cmovle %r8d,%edx
mov    %dl,(%rdi,%rax,1)
lea    0x1(%rax),%rax
mov    %ecx,%esi
jg     1110 <MQTTPacket_encode+0x10>
ret

LLVM IR (-O0):
define i32 @MQTTPacket_encode(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %4
%9 = srem i32 %8, 128
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
%11 = load i32, i32* %4
%12 = sdiv i32 %11, 128
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %7
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = or i32 %17, 128
%19 = trunc i32 %18 to i8
store i8 %19, i8* %6
br label %20
20: ; preds = %15, %7
%21 = load i8, i8* %6
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
%25 = sext i32 %23 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
store i8 %21, i8* %26
br label %27
27: ; preds = %20
%28 = load i32, i32* %4
%29 = icmp sgt i32 %28, 0
br i1 %29, label %7, label %30
30: ; preds = %27
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @MQTTPacket_encode(i8* nocapture writeonly %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %12, %3 ], [ 0, %2 ]
%5 = phi i32 [ %8, %3 ], [ %1, %2 ]
%6 = srem i32 %5, 128
%7 = trunc i32 %6 to i8
%8 = sdiv i32 %5, 128
%9 = icmp sgt i32 %5, 127
%10 = or i8 %7, -128
%11 = select i1 %9, i8 %10, i8 %7
%12 = add nuw i64 %4, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %11, i8* %13
br i1 %9, label %3, label %14
14: ; preds = %3
%15 = trunc i64 %12 to i32
ret i32 %15
}
/* Variables and functions */
unsigned long long atoi(char *);
unsigned long long int half(char *p) {
  unsigned long long int q = atoi(p);
  q = q / 2;
  return (q);
}


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

x86 assembly (clang, -O2):
<half>:
push   %rax
call   1030 <atoi@plt>
shr    %rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @half(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @atoi(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = udiv i64 %6, 2
store i64 %7, i64* %3
%8 = load i64, i64* %3
ret i64 %8
}

LLVM IR (-O2):
define i64 @half(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
%3 = lshr i64 %2, 1
ret i64 %3
}
void cc_debugfs_global_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @cc_debugfs_global_fini() {
ret void
}
unsigned int perfctr_mk_cstatus(unsigned int tsc_on, unsigned int nractrs,
                                unsigned int nrictrs) {
  return (tsc_on << 31) | (nrictrs << 16) | ((nractrs + nrictrs) << 8) |
         nractrs;
}


x86 assembly (clang, -O0):
<perfctr_mk_cstatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<perfctr_mk_cstatus>:
shl    $0x1f,%edi
lea    (%rdx,%rsi,1),%ecx
mov    %edx,%eax
shl    $0x10,%eax
shl    $0x8,%ecx
or     %esi,%edi
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @perfctr_mk_cstatus(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 31
%9 = load i32, i32* %6
%10 = shl i32 %9, 16
%11 = or i32 %8, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add i32 %12, %13
%15 = shl i32 %14, 8
%16 = or i32 %11, %15
%17 = load i32, i32* %5
%18 = or i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @perfctr_mk_cstatus(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 31
%5 = shl i32 %2, 16
%6 = add i32 %2, %1
%7 = shl i32 %6, 8
%8 = or i32 %4, %1
%9 = or i32 %8, %5
%10 = or i32 %9, %7
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void get_time_str(char *time_str) {
  time_t t = time(NULL);
  struct tm *timeinfo;
  timeinfo = localtime(&t);
  strftime(time_str, 15, "%T", timeinfo);
}


x86 assembly (clang, -O0):
<get_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xf,%esi
lea    0xe97(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_str>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%T\00"
define void @get_time_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca %struct.tm*
store i8* %0, i8** %2
%5 = call i32 @time(i32* null)
store i32 %5, i32* %3
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %2
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%T\00"
define void @get_time_str(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call %struct.tm* @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t dvbsubs_get_page(const uint8_t *p_dvbsubs) {
  return (p_dvbsubs[2] << 8) | p_dvbsubs[3];
}


x86 assembly (clang, -O0):
<dvbsubs_get_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvbsubs_get_page>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @dvbsubs_get_page(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @dvbsubs_get_page(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}