xunge/DecIR huggingface dataset:
int my_log2(int x) {
  int i = 0;
  if (x <= 0)
    return 0;
  while ((1 << i) <= x && (1 << i) > 0)
    i++;
  if ((1 << i) <= 0)
    return 0;
  return i;
}


x86 assembly (clang, -O0):
<my_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1124 <my_log2+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1199 <my_log2+0x99>
jmp    1129 <my_log2+0x29>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1156 <my_log2+0x56>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x0,%eax
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1166 <my_log2+0x66>
jmp    1174 <my_log2+0x74>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <my_log2+0x29>
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    $0x0,%eax
jg     1193 <my_log2+0x93>
movl   $0x0,-0x4(%rbp)
jmp    1199 <my_log2+0x99>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_log2>:
test   %edi,%edi
jle    1131 <my_log2+0x31>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
mov    %edx,%ecx
mov    $0x1,%eax
shl    %cl,%eax
lea    0x1(%rcx),%edx
cmp    $0x1f,%ecx
je     1125 <my_log2+0x25>
cmp    %edi,%eax
jle    1110 <my_log2+0x10>
lea    -0x1(%rdx),%ecx
xor    %eax,%eax
cmp    $0x20,%edx
cmovne %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @my_log2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %30
8: ; preds = %1
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = load i32, i32* %3
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32, i32* %4
%16 = shl i32 1, %15
%17 = icmp sgt i32 %16, 0
br label %18
18: ; preds = %14, %9
%19 = phi i1 [ false, %9 ], [ %17, %14 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %18
%24 = load i32, i32* %4
%25 = shl i32 1, %24
%26 = icmp sle i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i32 0, i32* %2
br label %30
28: ; preds = %23
%29 = load i32, i32* %4
store i32 %29, i32* %2
br label %30
30: ; preds = %28, %27, %7
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @my_log2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 0, %1 ]
%5 = shl nuw i32 1, %4
%6 = icmp sle i32 %5, %0
%7 = icmp ne i32 %4, 31
%8 = and i1 %7, %6
%9 = add nuw nsw i32 %4, 1
br i1 %8, label %3, label %10
10: ; preds = %3
%11 = icmp eq i32 %4, 31
%12 = select i1 %11, i32 0, i32 %4
br label %13
13: ; preds = %10, %1
%14 = phi i32 [ 0, %1 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ countChar(char, char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
int /*<<< orphan*/ strcat(char *, char *);
void formatD(char *buf, double arg) {
  sprintf(buf, "%.12g", arg);
  if (countChar('.', buf) == 0 && countChar('E', buf) == 0) {
    strcat(buf, ".0");
  }
}


x86 assembly (clang, -O0):
<formatD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xeaf(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rsi
mov    $0x2e,%edi
call   1030 <countChar@plt>
cmp    $0x0,%rax
jne    1196 <formatD+0x66>
mov    -0x8(%rbp),%rsi
mov    $0x45,%edi
call   1030 <countChar@plt>
cmp    $0x0,%rax
jne    1196 <formatD+0x66>
mov    -0x8(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formatD>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1050 <sprintf@plt>
mov    $0x2e,%edi
mov    %rbx,%rsi
call   1030 <countChar@plt>
test   %rax,%rax
jne    1164 <formatD+0x34>
mov    $0x45,%edi
mov    %rbx,%rsi
call   1030 <countChar@plt>
test   %rax,%rax
je     1166 <formatD+0x36>
pop    %rbx
ret
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.12g\00"
@.str.1 = [3 x i8] c".0\00"
define void @formatD(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = load double, double* %4
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i8*, i8** %3
%9 = call i64 @countChar(i8 signext 46, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i64 @countChar(i8 signext 69, i8* %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %11, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.12g\00"
@.str.1 = [3 x i8] c".0\00"
define void @formatD(i8* %0, double %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
%4 = tail call i64 @countChar(i8 signext 46, i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i64 @countChar(i8 signext 69, i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interrupt(int);
void i_int3(void) { interrupt(3); }


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

x86 assembly (clang, -O2):
<i_int3>:
mov    $0x3,%edi
jmp    1030 <interrupt@plt>

LLVM IR (-O0):
define void @i_int3() {
%1 = call i32 @interrupt(i32 3)
ret void
}

LLVM IR (-O2):
define void @i_int3() {
%1 = tail call i32 @interrupt(i32 3)
ret void
}
/* Type definitions */
struct openconnect_info {
  int dummy;
};
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ EVP_md5();
int get_cert_fingerprint(struct openconnect_info *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/, char *);
int get_cert_md5_fingerprint(struct openconnect_info *vpninfo, X509 *cert,
                             char *buf) {
  return get_cert_fingerprint(vpninfo, cert, EVP_md5(), buf);
}


x86 assembly (clang, -O0):
<get_cert_md5_fingerprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <EVP_md5@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
call   1030 <get_cert_fingerprint@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cert_md5_fingerprint>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <EVP_md5@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %eax,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <get_cert_fingerprint@plt>

LLVM IR (-O0):
%struct.openconnect_info = type { i32 }
define i32 @get_cert_md5_fingerprint(%struct.openconnect_info* %0, i32* %1, i8* %2) {
%4 = alloca %struct.openconnect_info*
%5 = alloca i32*
%6 = alloca i8*
store %struct.openconnect_info* %0, %struct.openconnect_info** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load %struct.openconnect_info*, %struct.openconnect_info** %4
%8 = load i32*, i32** %5
%9 = call i32 (...) @EVP_md5()
%10 = load i8*, i8** %6
%11 = call i32 @get_cert_fingerprint(%struct.openconnect_info* %7, i32* %8, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.openconnect_info = type { i32 }
define i32 @get_cert_md5_fingerprint(%struct.openconnect_info* %0, i32* %1, i8* %2) {
%4 = tail call i32 (...) @EVP_md5()
%5 = tail call i32 @get_cert_fingerprint(%struct.openconnect_info* %0, i32* %1, i32 %4, i8* %2)
ret i32 %5
}
/* Variables and functions */
int sscanf(char const *, char *, int *, char *);
int /*<<< orphan*/ suicidef(char *, char const *);
int hex_string_to_int(const char *s) {
  int v;
  char extra;
  if (sscanf(s, "%X%c", &v, &extra) != 1)
    suicidef("\"%s\" is not an integer", s);
  return v;
}


x86 assembly (clang, -O0):
<hex_string_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0xd(%rbp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     115d <hex_string_to_int+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <suicidef@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_string_to_int>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0xb(%rsp),%rcx
call   1040 <sscanf@plt>
cmp    $0x1,%eax
je     1152 <hex_string_to_int+0x32>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <suicidef@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%X%c\00"
@.str.1 = [23 x i8] c"\22%s\22 is not an integer\00"
define i32 @hex_string_to_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %3, i8* %4)
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @suicidef(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"%X%c\00"
@.str.1 = [23 x i8] c"\22%s\22 is not an integer\00"
define i32 @hex_string_to_int(i8* %0) {
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i8* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @suicidef(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
ret i32 %10
}
/* Variables and functions */
scalar_t__ count_digits(int);
int nth_digits(int i) {
  int n = 0, res = 0, cres = 0;
  while (i > res) {
    cres = res;
    res += count_digits(n);
    n++;
  }
  return (cres * 10) + (n - 1);
}


x86 assembly (clang, -O0):
<nth_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1165 <nth_digits+0x55>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <count_digits@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1130 <nth_digits+0x20>
imul   $0xa,-0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_digits>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1145 <nth_digits+0x35>
mov    %edi,%r14d
xor    %eax,%eax
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <count_digits@plt>
add    %ebp,%eax
cmp    %r14d,%eax
jl     1130 <nth_digits+0x20>
jmp    114c <nth_digits+0x3c>
xor    %ebp,%ebp
mov    $0xffffffff,%ebx
lea    0x0(%rbp,%rbp,4),%eax
lea    (%rbx,%rax,2),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @nth_digits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i64 @count_digits(i32 %5)
%7 = trunc i64 %6 to i32
%8 = add i32 %4, %7
%9 = add nuw nsw i32 %5, 1
%10 = icmp slt i32 %8, %0
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ -1, %1 ], [ %5, %3 ]
%13 = phi i32 [ 0, %1 ], [ %4, %3 ]
%14 = mul nsw i32 %13, 10
%15 = add nsw i32 %12, %14
ret i32 %15
}
void delay_swap_prefetch(void) {}


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

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

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

LLVM IR (-O2):
define void @delay_swap_prefetch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int, int);
main() {
  f(-5, 5);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xfffffffb,%edi
mov    $0x5,%esi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffb,%edi
mov    $0x5,%esi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 -5, i32 5)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -5, i32 5)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void CheckLightmaps(void) {}


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

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

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

LLVM IR (-O2):
define void @CheckLightmaps() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *hnj_malloc(int size) {
  void *p;
  p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "can't allocate %d bytes\n", size);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<hnj_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <hnj_malloc+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hnj_malloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <hnj_malloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"can't allocate %d bytes\0A\00"
define i8* @hnj_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"can't allocate %d bytes\0A\00"
define noalias i8* @hnj_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glMaterialfv_size(int /*<<< orphan*/);
GLint __glMaterialiv_size(GLenum pname) { return __glMaterialfv_size(pname); }


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

x86 assembly (clang, -O2):
<__glMaterialiv_size>:
jmp    1030 <__glMaterialfv_size@plt>

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

LLVM IR (-O2):
define i32 @__glMaterialiv_size(i32 %0) {
%2 = tail call i32 @__glMaterialfv_size(i32 %0)
ret i32 %2
}
int main(void) {
  int i;
  i = 1 + 2;
  i = 2 - 1;
  i = 3 * 6;
  i = 10 / 5;
  i = 10 % 5;
  i = i % 0;
  i = i % 0;
  i = 1 << 3;
  i = 8 >> 2;
  i = 12 & 4;
  i = 8 | 4;
  i = 12 ^ 4;
  i = -(3);
  i = ~12;
  i = 1 < 3;
  i = 2 > 3;
  i = 2 >= 3;
  i = 2 <= 3;
  i = 1 == 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x12,-0x4(%rbp)
movl   $0x2,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
movl   $0x8,-0x4(%rbp)
movl   $0x2,-0x4(%rbp)
movl   $0x4,-0x4(%rbp)
movl   $0xc,-0x4(%rbp)
movl   $0x8,-0x4(%rbp)
movl   $0xfffffffd,-0x4(%rbp)
movl   $0xfffffff3,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 3, i32* %1
store i32 1, i32* %1
store i32 18, i32* %1
store i32 2, i32* %1
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = srem i32 %2, 0
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = srem i32 %4, 0
store i32 %5, i32* %1
store i32 8, i32* %1
store i32 2, i32* %1
store i32 4, i32* %1
store i32 12, i32* %1
store i32 8, i32* %1
store i32 -3, i32* %1
store i32 -13, i32* %1
store i32 1, i32* %1
store i32 0, i32* %1
store i32 0, i32* %1
store i32 1, i32* %1
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ solveNQueens(int **, int /*<<< orphan*/);
int main() {
  int board[8][8] = {
      {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0},
      {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0},
      {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0},
      {0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0},
  };
  solveNQueens(board, 0);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
call   1050 <solveNQueens@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x108,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1040 <solveNQueens@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = getelementptr inbounds [8 x [8 x i32]], [8 x [8 x i32]]* %1, i64 0, i64 0
%4 = bitcast [8 x i32]* %3 to i32**
%5 = call i32 @solveNQueens(i32** %4, i32 0)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [8 x [8 x i32]]
%2 = bitcast [8 x [8 x i32]]* %1 to i8*
%3 = bitcast [8 x [8 x i32]]* %1 to i32**
%4 = call i32 @solveNQueens(i32** %3, i32 0)
%5 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ ungetch(int);
int main(void) {
  int c;
  c = getch();
  putchar(c);
  ungetch(c);
  c = getch();
  putchar(c);
  c = getch();
  if (c == '\n')
    puts("n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1050 <ungetch@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jne    119b <main+0x5b>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <getch@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1050 <ungetch@plt>
xor    %eax,%eax
call   1060 <getch@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getch@plt>
cmp    $0xa,%eax
jne    117e <main+0x3e>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"n\00"
define i32 @main() {
%1 = tail call i32 (...) @getch()
%2 = tail call i32 @putchar(i32 %1)
%3 = tail call i32 @ungetch(i32 %1)
%4 = tail call i32 (...) @getch()
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 (...) @getch()
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
char *fail_on_null(int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char const *);
char *xstrdup(const char *s) { return fail_on_null(strdup(s)); }


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

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1030 <strdup@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fail_on_null@plt>

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strdup(i8* %0)
%3 = tail call i8* @fail_on_null(i32 %2)
ret i8* %3
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *, char *);
main() {
  char a[20], b[20];
  scanf("%s %s", a, b);
  printf("the position is %d", any(a, b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1050 <any@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xec2(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <any@plt>
lea    0xea3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [19 x i8] c"the position is %d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @any(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [19 x i8] c"the position is %d\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @any(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef char uint64_t;

/* Variables and functions */
uint64_t mp_set_hex_521(uint64_t a[9], char *hex) {
  a[1] = hex[0] + hex[1] + hex[2] + hex[3];
  return 0;
}


x86 assembly (clang, -O0):
<mp_set_hex_521>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_set_hex_521>:
mov    0x1(%rsi),%al
add    (%rsi),%al
add    0x2(%rsi),%al
add    0x3(%rsi),%al
mov    %al,0x1(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @mp_set_hex_521(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %13, %17
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %18, %22
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %3
%26 = getelementptr inbounds i8, i8* %25, i64 1
store i8 %24, i8* %26
ret i8 0
}

LLVM IR (-O2):
define signext i8 @mp_set_hex_521(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = add i8 %5, %3
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = load i8, i8* %7
%9 = add i8 %6, %8
%10 = getelementptr inbounds i8, i8* %1, i64 3
%11 = load i8, i8* %10
%12 = add i8 %9, %11
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %12, i8* %13
ret i8 0
}
/* Variables and functions */
int findSyncByte(char *buf, size_t size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    if (buf[i] == 0x47)
      break;
  }
  return i;
}


x86 assembly (clang, -O0):
<findSyncByte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1155 <findSyncByte+0x55>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x47,%eax
jne    1142 <findSyncByte+0x42>
jmp    1155 <findSyncByte+0x55>
jmp    1147 <findSyncByte+0x47>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <findSyncByte+0x1a>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSyncByte>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <findSyncByte+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x47,(%rdi,%rax,1)
je     1122 <findSyncByte+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <findSyncByte+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i32 @findSyncByte(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 71
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9
%13 = phi i64 [ %1, %9 ], [ %5, %4 ]
%14 = trunc i64 %13 to i32
br label %15
15: ; preds = %12, %2
%16 = phi i32 [ 0, %2 ], [ %14, %12 ]
ret i32 %16
}
/* Variables and functions */
double log10(int);
double logBase2(double x) { return (log10(x) / log10(2)); }


x86 assembly (clang, -O0):
<logBase2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log10@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logBase2>:
push   %rax
cvttsd2si %xmm0,%edi
call   1030 <log10@plt>
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <log10@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @logBase2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
%5 = call double @log10(i32 %4)
%6 = call double @log10(i32 2)
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @logBase2(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call double @log10(i32 %2)
%4 = tail call double @log10(i32 2)
%5 = fdiv double %3, %4
ret double %5
}
float float_swap(char *cbuf) {
  union {
    char cval[4];
    float fval;
  } f_union;
  f_union.cval[3] = cbuf[0];
  f_union.cval[2] = cbuf[1];
  f_union.cval[1] = cbuf[2];
  f_union.cval[0] = cbuf[3];
  return (f_union.fval);
}


x86 assembly (clang, -O0):
<float_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%al
mov    %al,-0xf(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%al
mov    %al,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_swap>:
mov    (%rdi),%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @float_swap(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = bitcast %union.anon* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
store i8 %6, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = bitcast %union.anon* %3 to [4 x i8]*
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 2
store i8 %11, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = bitcast %union.anon* %3 to [4 x i8]*
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 1
store i8 %16, i8* %18
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = bitcast %union.anon* %3 to [4 x i8]*
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %22, i64 0, i64 0
store i8 %21, i8* %23
%24 = bitcast %union.anon* %3 to float*
%25 = load float, float* %24
ret float %25
}

LLVM IR (-O2):
define float @float_swap(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
%19 = bitcast i32 %18 to float
ret float %19
}
int ccnl_core_RX_i_or_c(struct ccnl_relay_s *relay, struct ccnl_face_s *from,
                        unsigned char **data, int *datalen) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.ccnl_relay_s = type opaque
%struct.ccnl_face_s = type opaque
define i32 @ccnl_core_RX_i_or_c(%struct.ccnl_relay_s* %0, %struct.ccnl_face_s* %1, i8** %2, i32* %3) {
%5 = alloca %struct.ccnl_relay_s*
%6 = alloca %struct.ccnl_face_s*
%7 = alloca i8**
%8 = alloca i32*
store %struct.ccnl_relay_s* %0, %struct.ccnl_relay_s** %5
store %struct.ccnl_face_s* %1, %struct.ccnl_face_s** %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
ret i32 0
}

LLVM IR (-O2):
%struct.ccnl_relay_s = type opaque
%struct.ccnl_face_s = type opaque
define i32 @ccnl_core_RX_i_or_c(%struct.ccnl_relay_s* nocapture readnone %0, %struct.ccnl_face_s* nocapture readnone %1, i8** nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void interrupt(void) { write(2, "xyzzy\n", 6); }


x86 assembly (clang, -O0):
<interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xee0(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt>:
lea    0xee9(%rip),%rsi
mov    $0x2,%edi
mov    $0x6,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"xyzzy\0A\00"
define void @interrupt() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"xyzzy\0A\00"
define void @interrupt() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rlu_print_stats();
void print_stats() {
  rlu_print_stats();
  ;
}


x86 assembly (clang, -O0):
<print_stats>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rlu_print_stats@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stats>:
xor    %eax,%eax
jmp    1030 <rlu_print_stats@plt>

LLVM IR (-O0):
define void @print_stats() {
%1 = call i32 (...) @rlu_print_stats()
ret void
}

LLVM IR (-O2):
define void @print_stats() {
%1 = tail call i32 (...) @rlu_print_stats()
ret void
}
/* Variables and functions */
float pow(int, double);
float img_deflect_vu(float db) {
  float v = pow(10, .05 * (db - 18));
  return 5.6234149f * v;
}


x86 assembly (clang, -O0):
<img_deflect_vu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeda(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movss  %xmm0,-0x8(%rbp)
movss  0xeab(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<img_deflect_vu>:
push   %rax
addss  0xee7(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
mulss  0xecd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @img_deflect_vu(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fsub float %4, 1.800000e+01
%6 = fpext float %5 to double
%7 = fmul double 5.000000e-02, %6
%8 = call float @pow(i32 10, double %7)
store float %8, float* %3
%9 = load float, float* %3
%10 = fmul float 0x40167E6080000000, %9
ret float %10
}

LLVM IR (-O2):
define float @img_deflect_vu(float %0) {
%2 = fadd float %0, -1.800000e+01
%3 = fpext float %2 to double
%4 = fmul double %3, 5.000000e-02
%5 = tail call float @pow(i32 10, double %4)
%6 = fmul float %5, 0x40167E6080000000
ret float %6
}
void rmw(volatile char *p) { *p |= 1; }


x86 assembly (clang, -O0):
<rmw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
movsbl %cl,%ecx
or     $0x1,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmw>:
orb    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @rmw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load volatile i8, i8* %3
%5 = sext i8 %4 to i32
%6 = or i32 %5, 1
%7 = trunc i32 %6 to i8
store volatile i8 %7, i8* %3
ret void
}

LLVM IR (-O2):
define void @rmw(i8* %0) {
%2 = load volatile i8, i8* %0
%3 = or i8 %2, 1
store volatile i8 %3, i8* %0
ret void
}
int int_pow(int base, int factor) {
  if (factor == 0)
    return 1;
  if (factor == 1)
    return base;
  return base * int_pow(base, factor - 1);
}


x86 assembly (clang, -O0):
<int_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <int_pow+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1168 <int_pow+0x58>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <int_pow+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <int_pow+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <int_pow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_pow>:
mov    %edi,%eax
mov    $0x1,%ecx
test   %esi,%esi
je     111f <int_pow+0x1f>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%esi
je     1124 <int_pow+0x24>
add    $0xffffffff,%esi
imul   %eax,%ecx
test   %esi,%esi
jne    1110 <int_pow+0x10>
mov    $0x1,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int_pow(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %21
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %21
14: ; preds = %9
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
%19 = call i32 @int_pow(i32 %16, i32 %18)
%20 = mul nsw i32 %15, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %14, %12, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @int_pow(i32 %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i32 [ 1, %2 ], [ %8, %6 ]
%5 = phi i32 [ %1, %2 ], [ %7, %6 ]
switch i32 %5, label %6 [
i32 0, label %9
i32 1, label %10
]
6: ; preds = %3
%7 = add nsw i32 %5, -1
%8 = mul nsw i32 %4, %0
br label %3
9: ; preds = %3
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 1, %9 ], [ %0, %3 ]
%12 = mul nsw i32 %11, %4
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ driveRaw(int, int, int, int);
int /*<<< orphan*/ wait1Msec(int);
void driveForTime(int powerFL, int powerBL, int powerFR, int powerBR,
                  int time) {
  driveRaw(powerFL, powerBL, powerFR, powerBR);
  wait1Msec(time);
  driveRaw(0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<driveForTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <driveRaw@plt>
mov    -0x14(%rbp),%edi
call   1040 <wait1Msec@plt>
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <driveRaw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<driveForTime>:
push   %rbx
mov    %r8d,%ebx
call   1030 <driveRaw@plt>
mov    %ebx,%edi
call   1040 <wait1Msec@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <driveRaw@plt>

LLVM IR (-O0):
define void @driveForTime(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = call i32 @driveRaw(i32 %11, i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %10
%17 = call i32 @wait1Msec(i32 %16)
%18 = call i32 @driveRaw(i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @driveForTime(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @driveRaw(i32 %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @wait1Msec(i32 %4)
%8 = tail call i32 @driveRaw(i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *, char *,
                           char);
char *colorMsg(const char *msg, const char *color, char *msgc) {
  sprintf(msgc, "%s%s%s%c", color, msg, "\033[0m", '\0');
  return msgc;
}


x86 assembly (clang, -O0):
<colorMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec9(%rip),%rsi
lea    0xecb(%rip),%r8
xor    %r9d,%r9d
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colorMsg>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rcx
lea    0xedf(%rip),%rsi
lea    0xee1(%rip),%r8
mov    %rbx,%rdi
xor    %r9d,%r9d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s%s%s%c\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i8* @colorMsg(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
%7 = load i8*, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext 0)
%11 = load i8*, i8** %6
ret i8* %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s%s%s%c\00"
@.str.1 = [5 x i8] c"\1B[0m\00"
define i8* @colorMsg(i8* %0, i8* %1, i8* returned writeonly %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8 signext 0)
ret i8* %2
}
void fghRememberState(void) {}


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

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

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

LLVM IR (-O2):
define void @fghRememberState() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned int);
int Mali_MemCpy(unsigned int *malidata_page, unsigned int mali_va,
                unsigned int *refdata, unsigned int refoffset,
                unsigned int len) {
  memcpy((void *)((char *)malidata_page + (mali_va % 4096)),
         (void *)((char *)refdata + (refoffset)), len * sizeof(unsigned int));
  return 0;
}


x86 assembly (clang, -O0):
<Mali_MemCpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
and    $0xfff,%eax
mov    %eax,%eax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%eax
add    %rax,%rsi
mov    -0x20(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_MemCpy>:
push   %rax
and    $0xfff,%esi
add    %rsi,%rdi
mov    %ecx,%esi
add    %rdx,%rsi
lea    0x0(,%r8,4),%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Mali_MemCpy(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = bitcast i32* %11 to i8*
%13 = load i32, i32* %7
%14 = urem i32 %13, 4096
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = load i32*, i32** %8
%18 = bitcast i32* %17 to i8*
%19 = load i32, i32* %9
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i32, i32* %10
%23 = zext i32 %22 to i64
%24 = mul i64 %23, 4
%25 = trunc i64 %24 to i32
%26 = call i32 @memcpy(i8* %16, i8* %21, i32 %25)
ret i32 0
}

LLVM IR (-O2):
define i32 @Mali_MemCpy(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = bitcast i32* %0 to i8*
%7 = and i32 %1, 4095
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = bitcast i32* %2 to i8*
%11 = zext i32 %3 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = shl i32 %4, 2
%14 = tail call i32 @memcpy(i8* %9, i8* %12, i32 %13)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_();
void do0x08() { _I8080_(); }


x86 assembly (clang, -O0):
<do0x08>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_I8080_@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do0x08>:
xor    %eax,%eax
jmp    1030 <_I8080_@plt>

LLVM IR (-O0):
define void @do0x08() {
%1 = call i32 (...) @_I8080_()
ret void
}

LLVM IR (-O2):
define void @do0x08() {
%1 = tail call i32 (...) @_I8080_()
ret void
}