xunge/DecIR huggingface dataset:
/* Variables and functions */
bool has_int_tag(void *p) { return (((uintptr_t)p) & ((uintptr_t)1)); }


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

x86 assembly (clang, -O2):
<has_int_tag>:
mov    %rdi,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @has_int_tag(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 1
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @has_int_tag(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = and i32 %3, 1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
void fileWrite(char *fname, char *s) {
  FILE *fp = fopen(fname, "w");
  fwrite(s, strlen(s), 1, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<fileWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileWrite>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xeb2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1060 <fwrite@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
define void @fileWrite(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fwrite(i8* %8, i32 %10, i32 1, i32* %11)
%13 = load i32*, i32** %5
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @fileWrite(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @fwrite(i8* %1, i32 %4, i32 1, i32* %3)
%6 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int strlen(char *);
void reverse_string(char *str) {
  int x = strlen(str);
  while (x >= 0) {
    printf("%c", str[x]);
    x--;
  }
}


x86 assembly (clang, -O0):
<reverse_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1168 <reverse_string+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeaf(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <reverse_string+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
js     1153 <reverse_string+0x33>
mov    %eax,%ebx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xffffffffffffffff,%rbx
jb     1140 <reverse_string+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @f(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void avpicture_fill() {}


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

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

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

LLVM IR (-O2):
define void @avpicture_fill() {
ret void
}
unsigned long HibernateRTCTrimGet(void) {
  return ((*((volatile unsigned long *)(0x400FC024))));
}


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

x86 assembly (clang, -O2):
<HibernateRTCTrimGet>:
mov    0x400fc024,%rax
40
ret

LLVM IR (-O0):
define i64 @HibernateRTCTrimGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774052 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @HibernateRTCTrimGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774052 to i64*)
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int get_n_from_user();
int /*<<< orphan*/ move(int, char, char, char);
int main(void) {
  int n;
  n = get_n_from_user();
  assert(n > 0);
  move(n, 'A', 'B', 'C');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <get_n_from_user@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <move@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <get_n_from_user@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1030 <assert@plt>
mov    %ebx,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1050 <move@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @get_n_from_user()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @move(i32 %8, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_n_from_user()
%2 = icmp sgt i32 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @move(i32 %1, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
/* Variables and functions */
int f(int, int);
int g(int x) { return f(x, x + 1); }


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

x86 assembly (clang, -O2):
<g>:
lea    0x1(%rdi),%esi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @f(i32 %0, i32 %2)
ret i32 %3
}
int array_non_zero(int *v, int i_count) {
  int i;
  for (i = 0; i < i_count; i++)
    if (v[i])
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<array_non_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <array_non_zero+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     113c <array_non_zero+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1156 <array_non_zero+0x56>
jmp    1141 <array_non_zero+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <array_non_zero+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_non_zero>:
test   %esi,%esi
jle    111f <array_non_zero+0x1f>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rdi,%rcx,4)
jne    1122 <array_non_zero+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <array_non_zero+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @array_non_zero(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %6, label %14
14: ; preds = %8, %6, %2
%15 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}
int test_imm_98int8_reg(signed char val) {
  return ((val) & (0x98 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_98int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x98,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_98int8_reg>:
test   $0x98,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_98int8_reg(i8 signext %0) {
%2 = and i8 %0, -104
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ setPromisc(char const *, int, int /*<<< orphan*/);
void endSniffer(const char *device, int sd) {
  setPromisc(device, sd, 0);
  close(sd);
}


x86 assembly (clang, -O0):
<endSniffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <setPromisc@plt>
mov    -0xc(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endSniffer>:
push   %rbx
mov    %esi,%ebx
xor    %edx,%edx
call   1040 <setPromisc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @endSniffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @setPromisc(i8* %5, i32 %6, i32 0)
%8 = load i32, i32* %4
%9 = call i32 @close(i32 %8)
ret void
}

LLVM IR (-O2):
define void @endSniffer(i8* %0, i32 %1) {
%3 = tail call i32 @setPromisc(i8* %0, i32 %1, i32 0)
%4 = tail call i32 @close(i32 %1)
ret void
}
int test_imm_14int16_reg(short val) {
  return ((val) & (-0x14 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_14int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffec,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_14int16_reg>:
test   $0xffec,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_14int16_reg(i16 signext %0) {
%2 = and i16 %0, -20
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  typedef long long u64;
  u64 first = 0, second = 1, next = 0;
  while (next < (1ULL << 62)) {
    next = first + second;
    first = second;
    second = next;
  }
  assert(next == 4660046610375530309ULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movabs $0x4000000000000000,%rax
cmp    %rax,-0x20(%rbp)
jae    116c <main+0x5c>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <main+0x27>
movabs $0x40abcfb3c0325745,%rax
cf ab 40
cmp    %rax,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store i64 1, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %8, %0
%6 = load i64, i64* %4
%7 = icmp ult i64 %6, 4611686018427387904
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i64, i64* %2
%10 = load i64, i64* %3
%11 = add nsw i64 %9, %10
store i64 %11, i64* %4
%12 = load i64, i64* %3
store i64 %12, i64* %2
%13 = load i64, i64* %4
store i64 %13, i64* %3
br label %5
14: ; preds = %5
%15 = load i64, i64* %4
%16 = icmp eq i64 %15, 4660046610375530309
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
void WcAllowDuplicateClassNameReg(ignored) int ignored;
{ return; }


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

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

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

LLVM IR (-O2):
define void @WcAllowDuplicateClassNameReg(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
void arithFB(void) { lua_error("unexpected type at conversion to number"); }


x86 assembly (clang, -O0):
<arithFB>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <lua_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arithFB>:
lea    0xee9(%rip),%rdi
jmp    1030 <lua_error@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"unexpected type at conversion to number\00"
define void @arithFB() {
%1 = call i32 @lua_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"unexpected type at conversion to number\00"
define void @arithFB() {
%1 = tail call i32 @lua_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main_fini3() {
  printf("main_fini3"
         "\n");
}


x86 assembly (clang, -O0):
<main_fini3>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_fini3>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"main_fini3\0A\00"
define void @main_fini3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"main_fini3\00"
define void @main_fini3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ vt_write_str(char *);
int /*<<< orphan*/ vt_write_uint16(int /*<<< orphan*/);
void vt_pos_goto(uint32_t row, uint32_t column) {
  vt_write_str("\x1B"
               "[");
  vt_write_uint16(row);
  vt_write_str(";");
  vt_write_uint16(column);
  vt_write_str("H");
}


x86 assembly (clang, -O0):
<vt_pos_goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    -0x4(%rbp),%edi
call   1030 <vt_write_uint16@plt>
lea    0xeba(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    -0x8(%rbp),%edi
call   1030 <vt_write_uint16@plt>
lea    0xea8(%rip),%rdi
call   1040 <vt_write_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_pos_goto>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    %ebp,%edi
call   1030 <vt_write_uint16@plt>
lea    0xec2(%rip),%rdi
call   1040 <vt_write_str@plt>
mov    %ebx,%edi
call   1030 <vt_write_uint16@plt>
lea    0xeb1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <vt_write_str@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\1B[\00"
@.str.1 = [2 x i8] c";\00"
@.str.2 = [2 x i8] c"H\00"
define void @vt_pos_goto(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 @vt_write_uint16(i32 %6)
%8 = call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = call i32 @vt_write_uint16(i32 %9)
%11 = call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1B[\00"
@.str.1 = [2 x i8] c";\00"
@.str.2 = [2 x i8] c"H\00"
define void @vt_pos_goto(i32 %0, i32 %1) {
%3 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @vt_write_uint16(i32 %0)
%5 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @vt_write_uint16(i32 %1)
%7 = tail call i32 @vt_write_str(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
float fabsf(float x) {
  float t;
  __asm__("pcmpeqd %0, %0" : "=x"(t));
  __asm__("psrld   $1, %0" : "+x"(t));
  __asm__("andps   %1, %0" : "+x"(x) : "x"(t));
  return x;
}


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
pcmpeqd %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
psrld  $0x1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
andps  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
pcmpeqd %xmm1,%xmm1
psrld  $0x1,%xmm1
andps  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabsf(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call float asm "pcmpeqd $0, $0", "=x,~{dirflag},~{fpsr},~{flags}"()
store float %4, float* %3
%5 = load float, float* %3
%6 = call float asm "psrld $$1, $0", "=x,0,~{dirflag},~{fpsr},~{flags}"(float %5)
store float %6, float* %3
%7 = load float, float* %2
%8 = load float, float* %3
%9 = call float asm "andps $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(float %8, float %7)
store float %9, float* %2
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = tail call float asm "pcmpeqd $0, $0", "=x,~{dirflag},~{fpsr},~{flags}"()
%3 = tail call float asm "psrld $$1, $0", "=x,0,~{dirflag},~{fpsr},~{flags}"(float %2)
%4 = tail call float asm "andps $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(float %3, float %0)
ret float %4
}
/* Variables and functions */
int shmdt(char *);
int IPC_UnMapShm(void *unmapaddr) {
  int rv;
  rv = shmdt((char *)unmapaddr);
  if (rv == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<IPC_UnMapShm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <shmdt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    113e <IPC_UnMapShm+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <IPC_UnMapShm+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @IPC_UnMapShm(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @shmdt(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %11
10: ; preds = %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 @IPC_UnMapShm(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wctomb(char *, int /*<<< orphan*/);
void uninitvar_wctomb(void) {
  char *s;
  wchar_t wc;
  (void)wctomb(s, wc);
}


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

x86 assembly (clang, -O2):
<uninitvar_wctomb>:
jmp    1030 <wctomb@plt>

LLVM IR (-O0):
define void @uninitvar_wctomb() {
%1 = alloca i8*
%2 = alloca i32
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = call i32 @wctomb(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_wctomb() {
%1 = tail call i32 @wctomb(i8* undef, i32 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clip_x(long);
long get_chr_left(long x, long dx) {
  if (!clip_x(x))
    return (20 * 4);
  return (x - (dx / 2));
}


x86 assembly (clang, -O0):
<get_chr_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <clip_x@plt>
cmp    $0x0,%eax
jne    113f <get_chr_left+0x2f>
movq   $0x50,-0x8(%rbp)
jmp    1163 <get_chr_left+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chr_left>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <clip_x@plt>
test   %eax,%eax
je     1135 <get_chr_left+0x25>
mov    %r14,%rax
shr    $0x3f,%rax
add    %r14,%rax
sar    %rax
sub    %rax,%rbx
jmp    113a <get_chr_left+0x2a>
mov    $0x50,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @get_chr_left(i64 %0, i64 %1) {
%3 = tail call i32 @clip_x(i64 %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = sdiv i64 %1, -2
%7 = add i64 %6, %0
br label %8
8: ; preds = %2, %5
%9 = phi i64 [ %7, %5 ], [ 80, %2 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ BaroAirspeedHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void BaroAirspeedUpdated() { UAVObjUpdated(BaroAirspeedHandle()); }


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

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

LLVM IR (-O0):
define void @BaroAirspeedUpdated() {
%1 = call i32 (...) @BaroAirspeedHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BaroAirspeedUpdated() {
%1 = tail call i32 (...) @BaroAirspeedHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int XcmBigEndian() {
  int big = 0;
  char testc[2] = {0, 0};
  uint16_t *testu = (uint16_t *)testc;
  *testu = 1;
  big = testc[1];
  return big;
}


x86 assembly (clang, -O0):
<XcmBigEndian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
lea    -0x6(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @XcmBigEndian() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [2 x i8]* %2 to i8*
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
store i32 1, i32* %7
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
store i32 %10, i32* %1
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @XcmBigEndian() {
ret i32 0
}
/* Variables and functions */
int rand();
int card_suit_prng() { return rand() % 4; }


x86 assembly (clang, -O0):
<card_suit_prng>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<card_suit_prng>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @card_suit_prng() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}

LLVM IR (-O2):
define i32 @card_suit_prng() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}
void foo221(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo221(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Content-type: text/html\n\n");
  printf("<marquee>look im writing my web pages in C</marquee>\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Content-type: text/html\0A\0A\00"
@.str.1 = [54 x i8] c"<marquee>look im writing my web pages in C</marquee>\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-type: text/html\0A\00"
@str.2 = [53 x i8] c"<marquee>look im writing my web pages in C</marquee>\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
void handle_und(void) {
  uart_puts("\nUndefined Instruction.");
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<handle_und>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <uart_puts@plt>
jmp    1120 <handle_und+0x10>

x86 assembly (clang, -O2):
<handle_und>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_puts@plt>
nopl   (%rax)
jmp    1120 <handle_und+0x10>

LLVM IR (-O0):
@.str = [24 x i8] c"\0AUndefined Instruction.\00"
define void @handle_und() {
%1 = call i32 @uart_puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0AUndefined Instruction.\00"
define void @handle_und() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
int func5_in_obj(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @func5_in_obj() {
ret i32 0
}
/* Variables and functions */
long get_flat_data_length(void *);
long get_net_map_data_length(void *data) { return get_flat_data_length(data); }


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

x86 assembly (clang, -O2):
<get_net_map_data_length>:
jmp    1030 <get_flat_data_length@plt>

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

LLVM IR (-O2):
define i64 @get_net_map_data_length(i8* %0) {
%2 = tail call i64 @get_flat_data_length(i8* %0)
ret i64 %2
}
double __cabs(double _Complex z) { return __hypot(__real__ z, __imag__ z); }


x86 assembly (clang, -O0):
<__cabs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    $0x2,%al
call   1030 <__hypot@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cabs>:
push   %rax
mov    $0x2,%al
call   1030 <__hypot@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @__cabs(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = call i32 (double, double, ...) bitcast (i32 (...)* @__hypot to i32 (double, double, ...)*)(double %7, double %9)
%11 = sitofp i32 %10 to double
ret double %11
}

LLVM IR (-O2):
define double @__cabs(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @__hypot to i32 (double, double, ...)*)(double %0, double %1)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ l6480_send_cmd(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void l6480_cmd_nop(void) { l6480_send_cmd(0x00, 1, 0, 0); }


x86 assembly (clang, -O0):
<l6480_cmd_nop>:
push   %rbp
mov    %rsp,%rbp
xor    %ecx,%ecx
mov    $0x1,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <l6480_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l6480_cmd_nop>:
xor    %edi,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <l6480_send_cmd@plt>

LLVM IR (-O0):
define void @l6480_cmd_nop() {
%1 = call i32 @l6480_send_cmd(i32 0, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @l6480_cmd_nop() {
%1 = tail call i32 @l6480_send_cmd(i32 0, i32 1, i32 0, i32 0)
ret void
}
void gpio_free(unsigned gpio) {}


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

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

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

LLVM IR (-O2):
define void @gpio_free(i32 %0) {
ret void
}
void test1() {
  if (sizeof(int){1}) {
  }
  if (sizeof(int)) {
  }
  (void)(int)4;
  (void)(int){4};
  int A = (struct { int a; }){1}.a;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @test1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.anon
store i32 4, i32* %1
%4 = load i32, i32* %1
%5 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
store i32 1, i32* %5
store i32 1, i32* %2
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void _android_assert_log_default(const char *fmt, va_list args) {
  vfprintf(stderr, fmt, args);
}


x86 assembly (clang, -O0):
<_android_assert_log_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_android_assert_log_default>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @_android_assert_log_default(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfprintf(i32 %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @_android_assert_log_default(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_min;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_min(void) {
  time_t t;
  struct tm *lt;
  t = time(NULL);
  lt = localtime(&t);
  return lt->tm_min;
}


x86 assembly (clang, -O0):
<date_get_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_min>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_min() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_min() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
char *calloc(unsigned int, int);
char *getmem(unsigned int nbytes) { return (calloc(nbytes, 1)); }


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

x86 assembly (clang, -O2):
<getmem>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @getmem(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ latency1(int);
int main(int argc, char *argv[]) {
  int capacity;
  capacity = (argc > 1 ? atoi(argv[1]) : 1);
  latency1(capacity);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1162 <main+0x42>
mov    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1162 <main+0x42>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <latency1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x1,%edi
cmp    $0x2,%eax
jl     1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <latency1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
br label %15
14: ; preds = %2
br label %15
15: ; preds = %14, %9
%16 = phi i32 [ %13, %9 ], [ 1, %14 ]
store i32 %16, i32* %6
%17 = load i32, i32* %6
%18 = call i32 @latency1(i32 %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
%10 = tail call i32 @latency1(i32 %9)
ret i32 0
}
long SIO1_close(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1_close() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_close() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main() {
  int a[5];
  f(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <f@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%3 = call i32 @f(i32* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
ret i32 0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t bigEndian16(unsigned char b[]) {
  return ((int16_t)b[0] << 8) | (int16_t)b[1];
}


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

x86 assembly (clang, -O2):
<bigEndian16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @bigEndian16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_greater_flt(int *, float, float);
int xil_fpo_greater_flt(float a, float b) {
  int res_int;
  xip_fpo_greater_flt(&res_int, a, b);
  return res_int;
}


x86 assembly (clang, -O0):
<xil_fpo_greater_flt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <xip_fpo_greater_flt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_greater_flt>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_greater_flt@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xil_fpo_greater_flt(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call i32 @xip_fpo_greater_flt(i32* %5, float %6, float %7)
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @xil_fpo_greater_flt(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @xip_fpo_greater_flt(i32* %3, float %0, float %1)
%6 = load i32, i32* %3
ret i32 %6
}
void calcula(int x) { x = x + 10; }


x86 assembly (clang, -O0):
<calcula>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @calcula(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 10
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @calcula(i32 %0) {
ret void
}
/* Variables and functions */
size_t dict_hash_int(const int *key) { return (size_t)(*key * 2654435761U); }


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

x86 assembly (clang, -O2):
<dict_hash_int>:
imul   $0x9e3779b1,(%rdi),%eax
ret

LLVM IR (-O0):
define i64 @dict_hash_int(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul i32 %4, -1640531535
%6 = zext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @dict_hash_int(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul i32 %2, -1640531535
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("hello world!");
  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 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_8Eint8_reg(signed char val) {
  return ((val) & (0x8E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Eint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x8e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Eint8_reg>:
test   $0x8e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Eint8_reg(i8 signext %0) {
%2 = and i8 %0, -114
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}