xunge/DecIR huggingface dataset:
/* Variables and functions */
int check_serial(char *, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int rv;
  char *password = argv[1];
  rv = check_serial(password, 6);
  if (rv == 0x1) {
    printf("Success!\n");
  } else {
    printf("Fail!\n");
  }
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x6,%esi
call   1040 <check_serial@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    116e <main+0x4e>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x5a>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x6,%esi
call   1040 <check_serial@plt>
cmp    $0x1,%eax
lea    0xecd(%rip),%rax
lea    0xec0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [6 x i8] c"Fail!\00"
@str.2 = [9 x i8] c"Success!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @check_serial(i8* %4, i32 6)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(short const, int /*<<< orphan*/ *const);
int pm_writebigshort(FILE *const ofP, short const s) {
  putc((s >> 8) & 0xff, ofP);
  putc(s & 0xff, ofP);
  return 0;
}


x86 assembly (clang, -O0):
<pm_writebigshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <putc@plt>
movswl -0xa(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movswl %ax,%edi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_writebigshort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @pm_writebigshort(i32* %0, i16 signext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i16
%10 = load i32*, i32** %3
%11 = call i32 @putc(i16 signext %9, i32* %10)
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i16
%16 = load i32*, i32** %3
%17 = call i32 @putc(i16 signext %15, i32* %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @pm_writebigshort(i32* nocapture %0, i16 signext %1) {
%3 = lshr i16 %1, 8
%4 = tail call i32 @putc(i16 signext %3, i32* %0)
%5 = and i16 %1, 255
%6 = tail call i32 @putc(i16 signext %5, i32* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double sin(int);
int main(int argc, const char *argv[]) {
  printf("Hola Curso Intel-BUAP!\n");
  printf("valor es %f\n", sin(123));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7b,%edi
call   1050 <sin@plt>
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hola Curso Intel-BUAP!\0A\00"
@.str.1 = [13 x i8] c"valor es %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%7 = call double @sin(i32 123)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"valor es %f\0A\00"
@str = [23 x i8] c"Hola Curso Intel-BUAP!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call double @sin(i32 123)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %4)
ret i32 0
}
int main() {
  struct S {
    char s;
  } v;
  v.s = 47;
  int a = (int)v.s;
  int b = (27005061 + (a + 680455));
  int c = ((1207142401 * (((8 * b) + 9483541) - 230968044)) + 469069442);
  if (c != 1676211843)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x2f,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xa6207,%eax
add    $0x19c1085,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x3,%eax
add    $0x90b515,%eax
sub    $0xdc44aec,%eax
imul   $0x47f38801,%eax,%eax
add    $0x1bf56e82,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x63e8f683,-0x14(%rbp)
je     116a <main+0x5a>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type { i8 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.S
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds %struct.S, %struct.S* %2, i32 0, i32 0
store i8 47, i8* %6
%7 = getelementptr inbounds %struct.S, %struct.S* %2, i32 0, i32 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 680455
%12 = add nsw i32 27005061, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 8, %13
%15 = add nsw i32 %14, 9483541
%16 = sub nsw i32 %15, 230968044
%17 = mul nsw i32 1207142401, %16
%18 = add nsw i32 %17, 469069442
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = icmp ne i32 %19, 1676211843
br i1 %20, label %21, label %22
21: ; preds = %0
unreachable
22: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ tmpl(char *);
void main() {
  int n;
  int k = 0;
  int i = 0;
  tmpl("(le(i,j,k,n),le(i,j,k,n))");
  while (i < n) {
    i++;
    k++;
  }
  int j = n;
  while (j > 0) {
    assert(k > 0);
    j--;
    k--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <tmpl@plt>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <main+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x22>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    119d <main+0x7d>
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    116b <main+0x4b>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"(le(i,j,k,n),le(i,j,k,n))\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
%5 = call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %1
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %6
15: ; preds = %6
%16 = load i32, i32* %1
store i32 %16, i32* %4
br label %17
17: ; preds = %20, %15
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %2
%22 = icmp sgt i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %4
%26 = add nsw i32 %25, -1
store i32 %26, i32* %4
%27 = load i32, i32* %2
%28 = add nsw i32 %27, -1
store i32 %28, i32* %2
br label %17
29: ; preds = %17
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"(le(i,j,k,n),le(i,j,k,n))\00"
define void @main() {
%1 = tail call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
void dummy_rotate(struct rb_node *old, struct rb_node *_new) {}


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

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

LLVM IR (-O0):
%struct.rb_node = type opaque
define void @dummy_rotate(%struct.rb_node* %0, %struct.rb_node* %1) {
%3 = alloca %struct.rb_node*
%4 = alloca %struct.rb_node*
store %struct.rb_node* %0, %struct.rb_node** %3
store %struct.rb_node* %1, %struct.rb_node** %4
ret void
}

LLVM IR (-O2):
%struct.rb_node = type opaque
define void @dummy_rotate(%struct.rb_node* nocapture %0, %struct.rb_node* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __CrestInit();
void __globinit_sixtimes(void) {
  { __CrestInit(); }
}


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

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

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

LLVM IR (-O2):
define void @__globinit_sixtimes() {
%1 = tail call i32 (...) @__CrestInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char);
void rebake() { output('*'); }


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

x86 assembly (clang, -O2):
<rebake>:
mov    $0x2a,%edi
jmp    1030 <output@plt>

LLVM IR (-O0):
define void @rebake() {
%1 = call i32 @output(i8 signext 42)
ret void
}

LLVM IR (-O2):
define void @rebake() {
%1 = tail call i32 @output(i8 signext 42)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
int /*<<< orphan*/ SendNU16(unsigned short *, unsigned short);
void GUI_FcolorConDots(unsigned short int *dot, unsigned short int dot_cnt) {
  SendChar((0XEE) & 0xFF);
  SendChar((0x68) & 0xFF);
  SendNU16((unsigned short int *)dot, dot_cnt * 2);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<GUI_FcolorConDots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x68,%edi
call   1030 <SendChar@plt>
mov    -0x8(%rbp),%rdi
movzwl -0xa(%rbp),%eax
shl    $0x1,%eax
movzwl %ax,%esi
call   1040 <SendNU16@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GUI_FcolorConDots>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x68,%edi
call   1030 <SendChar@plt>
add    %ebx,%ebx
movzwl %bx,%esi
mov    %r14,%rdi
call   1040 <SendNU16@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @GUI_FcolorConDots(i16* %0, i16 zeroext %1) {
%3 = alloca i16*
%4 = alloca i16
store i16* %0, i16** %3
store i16 %1, i16* %4
%5 = call i32 @SendChar(i32 238)
%6 = call i32 @SendChar(i32 104)
%7 = load i16*, i16** %3
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = mul nsw i32 %9, 2
%11 = trunc i32 %10 to i16
%12 = call i32 @SendNU16(i16* %7, i16 zeroext %11)
%13 = call i32 @SendChar(i32 255)
%14 = call i32 @SendChar(i32 252)
%15 = call i32 @SendChar(i32 255)
%16 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @GUI_FcolorConDots(i16* %0, i16 zeroext %1) {
%3 = tail call i32 @SendChar(i32 238)
%4 = tail call i32 @SendChar(i32 104)
%5 = shl i16 %1, 1
%6 = tail call i32 @SendNU16(i16* %0, i16 zeroext %5)
%7 = tail call i32 @SendChar(i32 255)
%8 = tail call i32 @SendChar(i32 252)
%9 = tail call i32 @SendChar(i32 255)
%10 = tail call i32 @SendChar(i32 255)
ret void
}
void LinemodeUnload(void) {}


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

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

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

LLVM IR (-O2):
define void @LinemodeUnload() {
ret void
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
int /*<<< orphan*/ pthread_exit(void *);
scalar_t__ pthread_self();
int /*<<< orphan*/ sleep(int);
void *thread_task2(void *args) {
  printf("thread 2: pid %ld tid %lu\n", (unsigned long)getpid(),
         (unsigned long)pthread_self());
  sleep(3);
  pthread_exit((void *)0);
}


x86 assembly (clang, -O0):
<thread_task2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_task2>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xe97(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <printf@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
xor    %edi,%edi
pop    %rbx
jmp    1050 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"thread 2: pid %ld tid %lu\0A\00"
define i8* @thread_task2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @getpid()
%5 = call i64 (...) @pthread_self()
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %5)
%7 = call i32 @sleep(i32 3)
%8 = call i32 @pthread_exit(i8* null)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [27 x i8] c"thread 2: pid %ld tid %lu\0A\00"
define noalias i8* @thread_task2(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %3)
%5 = tail call i32 @sleep(i32 3)
%6 = tail call i32 @pthread_exit(i8* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x, y;
  x = 7;
  y = x++;
  printf("x=%d\ty=%d\n", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%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
mov    $0x8,%esi
mov    $0x7,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"x=%d\09y=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 7, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
store i32 %3, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"x=%d\09y=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 8, i32 7)
ret i32 0
}
int F_blendOnRegionDrv(int index[], int etype, double *L, double drv[3]) {
  drv[0] = drv[1] = drv[2] = 0.0;
  if (etype == 4)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<F_blendOnRegionDrv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x10(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
cmpl   $0x4,-0x14(%rbp)
jne    114c <F_blendOnRegionDrv+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <F_blendOnRegionDrv+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_blendOnRegionDrv>:
xor    %eax,%eax
cmp    $0x4,%esi
sete   %al
xorps  %xmm0,%xmm0
movups %xmm0,(%rcx)
movq   $0x0,0x10(%rcx)
ret

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

LLVM IR (-O2):
define i32 @F_blendOnRegionDrv(i32* nocapture readnone %0, i32 %1, double* nocapture readnone %2, double* nocapture writeonly %3) {
%5 = icmp eq i32 %1, 4
%6 = zext i1 %5 to i32
%7 = bitcast double* %3 to i8*
ret i32 %6
}
int link(int s, int t, int *pp) {
  pp[s] = t;
  return t;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    %esi,%eax
movslq %edi,%rcx
mov    %esi,(%rdx,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @link(i32 %0, i32 returned %1, i32* nocapture writeonly %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
store i32 %1, i32* %5
ret i32 %1
}
void glLoadIdentity(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glLoadIdentity() {
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __putchar(char);
int _write_r(struct _reent *r, int file, char *ptr, int len) {
  (void)r;
  (void)file;
  (void)ptr;
  int index;
  for (index = 0; index < len; index++) {
    __putchar(ptr[index]);
  }
  return len;
}


x86 assembly (clang, -O0):
<_write_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1158 <_write_r+0x48>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <__putchar@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <_write_r+0x1d>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write_r>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
test   %ecx,%ecx
jle    1143 <_write_r+0x33>
mov    %rdx,%r15
mov    %r14d,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <__putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <_write_r+0x20>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct._reent = type { i32 }
define i32 @_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* nocapture %2, i32 returned %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %2, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @__putchar(i8 signext %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret i32 %3
}
void lace_count_reset() {}


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

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

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

LLVM IR (-O2):
define void @lace_count_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CInit();
char *fixed_value();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runTransition(int /*<<< orphan*/);
int main() {
  char *toto;
  int size;
  int i;
  printf("[C Code] Running test\n");
  CInit();
  runTransition(0);
  toto = fixed_value();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <CInit@plt>
xor    %edi,%edi
call   1050 <runTransition@plt>
mov    $0x0,%al
call   1060 <fixed_value@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <CInit@plt>
xor    %edi,%edi
call   1060 <runTransition@plt>
xor    %eax,%eax
call   1070 <fixed_value@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"[C Code] Running test\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @CInit()
%7 = call i32 @runTransition(i32 0)
%8 = call i8* (...) @fixed_value()
store i8* %8, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [22 x i8] c"[C Code] Running test\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @CInit()
%3 = tail call i32 @runTransition(i32 0)
%4 = tail call i8* (...) @fixed_value()
%5 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ hash_chain(int /*<<< orphan*/ *, int);
void hash_int(uint32_t *hash, int value) { hash_chain(hash, value); }


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

x86 assembly (clang, -O2):
<hash_int>:
jmp    1030 <hash_chain@plt>

LLVM IR (-O0):
define void @hash_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @hash_chain(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @hash_int(i32* %0, i32 %1) {
%3 = tail call i32 @hash_chain(i32* %0, i32 %1)
ret void
}
L(A, a) int A;
char *a[];
{}


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

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

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

LLVM IR (-O2):
define i32 @L(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
int attr_free_table() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @attr_free_table() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t select_int32_t() { return 1 | (2 << 1); }


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

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

LLVM IR (-O0):
define i32 @select_int32_t() {
ret i32 5
}

LLVM IR (-O2):
define i32 @select_int32_t() {
ret i32 5
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int get_cpu_features();
uint32_t does_cpu_support(uint64_t mask) {
  return ((mask != 0xFFFFFFFFFFFFFFFFLL) &&
          ((get_cpu_features() & mask) != mask))
             ? -1
             : 0;
}


x86 assembly (clang, -O0):
<does_cpu_support>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
xor    %eax,%eax
cmp    $0xffffffffffffffff,%rcx
mov    %al,-0x5(%rbp)
je     1141 <does_cpu_support+0x31>
mov    $0x0,%al
call   1030 <get_cpu_features@plt>
and    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<does_cpu_support>:
cmp    $0xffffffff,%edi
je     1129 <does_cpu_support+0x19>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_cpu_features@plt>
not    %eax
and    %eax,%ebx
neg    %ebx
sbb    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @does_cpu_support(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = icmp ne i64 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = call i32 (...) @get_cpu_features()
%8 = load i32, i32* %2
%9 = and i32 %7, %8
%10 = load i32, i32* %2
%11 = icmp ne i32 %9, %10
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 -1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @does_cpu_support(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @get_cpu_features()
%5 = and i32 %4, %0
%6 = icmp ne i32 %5, %0
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ PUT32(int, int);
void timer_init(void) {
  PUT32((0x3F000000 + 0x0000B408), 0x00F90000);
  PUT32((0x3F000000 + 0x0000B408), 0x00F90200);
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f00b408,%edi
mov    $0xf90000,%esi
call   1030 <PUT32@plt>
mov    $0x3f00b408,%edi
mov    $0xf90200,%esi
call   1030 <PUT32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
mov    $0x3f00b408,%edi
mov    $0xf90000,%esi
call   1030 <PUT32@plt>
mov    $0x3f00b408,%edi
mov    $0xf90200,%esi
pop    %rax
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @timer_init() {
%1 = call i32 @PUT32(i32 1057010696, i32 16318464)
%2 = call i32 @PUT32(i32 1057010696, i32 16318976)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
%1 = tail call i32 @PUT32(i32 1057010696, i32 16318464)
%2 = tail call i32 @PUT32(i32 1057010696, i32 16318976)
ret void
}
void overwrite(int *vptr, int rep) {}


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

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

LLVM IR (-O0):
define void @overwrite(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @overwrite(i32* nocapture %0, i32 %1) {
ret void
}
void OPM_DeleteNewSym(void) {}


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

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

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

LLVM IR (-O2):
define void @OPM_DeleteNewSym() {
ret void
}
/* Variables and functions */
double ceil(double);
int /*<<< orphan*/ is_fraction_a_half(double);
double round(double);
double lr_round_half_up(double value, double rf) {
  value *= rf;
  if (!is_fraction_a_half(value))
    return round(value) / rf;
  value = ceil(value) / rf;
  return value;
}


x86 assembly (clang, -O0):
<lr_round_half_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <is_fraction_a_half@plt>
cmp    $0x0,%eax
jne    117d <lr_round_half_up+0x4d>
movsd  -0x10(%rbp),%xmm0
call   1050 <round@plt>
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    119b <lr_round_half_up+0x6b>
movsd  -0x10(%rbp),%xmm0
call   1040 <ceil@plt>
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lr_round_half_up>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1030 <is_fraction_a_half@plt>
test   %eax,%eax
je     115a <lr_round_half_up+0x2a>
movsd  0x8(%rsp),%xmm0
call   1040 <ceil@plt>
jmp    1165 <lr_round_half_up+0x35>
movsd  0x8(%rsp),%xmm0
call   1050 <round@plt>
divsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @lr_round_half_up(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fmul double %7, %6
store double %8, double* %4
%9 = load double, double* %4
%10 = call i32 @is_fraction_a_half(double %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %2
%13 = load double, double* %4
%14 = call double @llvm.round.f64(double %13)
%15 = load double, double* %5
%16 = fdiv double %14, %15
store double %16, double* %3
br label %23
17: ; preds = %2
%18 = load double, double* %4
%19 = call double @llvm.ceil.f64(double %18)
%20 = load double, double* %5
%21 = fdiv double %19, %20
store double %21, double* %4
%22 = load double, double* %4
store double %22, double* %3
br label %23
23: ; preds = %17, %12
%24 = load double, double* %3
ret double %24
}

LLVM IR (-O2):
define double @lr_round_half_up(double %0, double %1) {
%3 = fmul double %0, %1
%4 = tail call i32 @is_fraction_a_half(double %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call double @llvm.round.f64(double %3)
br label %10
8: ; preds = %2
%9 = tail call double @llvm.ceil.f64(double %3)
br label %10
10: ; preds = %8, %6
%11 = phi double [ %9, %8 ], [ %7, %6 ]
%12 = fdiv double %11, %1
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(float *, int, int, int /*<<< orphan*/ *);
void fileWrite(FILE *fout, float *ptr, int t) {
  fwrite(ptr, sizeof(float), t, fout);
  return;
}


x86 assembly (clang, -O0):
<fileWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileWrite>:
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x4,%esi
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @fileWrite(i32* nocapture %0, float* nocapture %1, i32 %2) {
%4 = tail call i32 @fwrite(float* %1, i32 4, i32 %2, i32* %0)
ret void
}
/* Variables and functions */
double cos(int);
double blackman(double x) {
  return 0.42 - 0.5 * cos(2 * 3.14159265358979323846264338327950288 * x) +
         0.08 * cos(4 * 3.14159265358979323846264338327950288 * x);
}


x86 assembly (clang, -O0):
<blackman>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xefb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb0(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe8d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blackman>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xede(%rip),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <cos@plt>
mulsd  0xed1(%rip),%xmm0
addsd  0xed1(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xec5(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
mulsd  0xebc(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @blackman(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 0x401921FB54442D18, %3
%5 = fptosi double %4 to i32
%6 = call double @cos(i32 %5)
%7 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %6, double 4.200000e-01)
%8 = load double, double* %2
%9 = fmul double 0x402921FB54442D18, %8
%10 = fptosi double %9 to i32
%11 = call double @cos(i32 %10)
%12 = call double @llvm.fmuladd.f64(double 8.000000e-02, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @blackman(double %0) {
%2 = fmul double %0, 0x401921FB54442D18
%3 = fptosi double %2 to i32
%4 = tail call double @cos(i32 %3)
%5 = tail call double @llvm.fmuladd.f64(double %4, double -5.000000e-01, double 4.200000e-01)
%6 = fmul double %0, 0x402921FB54442D18
%7 = fptosi double %6 to i32
%8 = tail call double @cos(i32 %7)
%9 = tail call double @llvm.fmuladd.f64(double %8, double 8.000000e-02, double %5)
ret double %9
}
int tuncompressible() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tuncompressible() {
ret i32 0
}
void test_delete_insert_hundred_delete_hundred() {}


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

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

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

LLVM IR (-O2):
define void @test_delete_insert_hundred_delete_hundred() {
ret void
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_perf_event_open;
int syscall(int /*<<< orphan*/, struct perf_event_attr *, int /*<<< orphan*/,
            int, int, unsigned long);
int perf_event_open(struct perf_event_attr *hw_event_uptr, pid_t pid, int cpu,
                    int group_fd, unsigned long flags) {
  return syscall(__NR_perf_event_open, hw_event_uptr, pid, cpu, group_fd,
                 flags);
}


x86 assembly (clang, -O0):
<perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32, i32* @__NR_perf_event_open
%12 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i32 @syscall(i32 %11, %struct.perf_event_attr* %12, i32 %13, i32 %14, i32 %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = load i32, i32* @__NR_perf_event_open
%7 = tail call i32 @syscall(i32 %6, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ clrplane_x(unsigned char);
int /*<<< orphan*/ clrplane_y(unsigned char);
int /*<<< orphan*/ clrplane_z(unsigned char);
void clrplane(char axis, unsigned char i) {
  switch (axis) {
  case 1:
    clrplane_x(i);
    break;
  case 2:
    clrplane_y(i);
    break;
  case 3:
    clrplane_z(i);
    break;
  }
}


x86 assembly (clang, -O0):
<clrplane>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     117b <clrplane+0x4b>
jmp    1159 <clrplane+0x29>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1189 <clrplane+0x59>
jmp    116a <clrplane+0x3a>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     1197 <clrplane+0x67>
jmp    11a0 <clrplane+0x70>
movzbl -0x2(%rbp),%edi
call   1040 <clrplane_x@plt>
jmp    11a0 <clrplane+0x70>
movzbl -0x2(%rbp),%edi
call   1030 <clrplane_y@plt>
jmp    11a0 <clrplane+0x70>
movzbl -0x2(%rbp),%edi
call   1050 <clrplane_z@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrplane>:
cmp    $0x3,%edi
je     1148 <clrplane+0x18>
cmp    $0x2,%edi
je     1151 <clrplane+0x21>
cmp    $0x1,%edi
jne    115a <clrplane+0x2a>
movzbl %sil,%edi
jmp    1040 <clrplane_x@plt>
movzbl %sil,%edi
jmp    1050 <clrplane_z@plt>
movzbl %sil,%edi
jmp    1030 <clrplane_y@plt>
ret

LLVM IR (-O0):
define void @clrplane(i8 signext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %16 [
i32 1, label %7
i32 2, label %10
i32 3, label %13
]
7: ; preds = %2
%8 = load i8, i8* %4
%9 = call i32 @clrplane_x(i8 zeroext %8)
br label %16
10: ; preds = %2
%11 = load i8, i8* %4
%12 = call i32 @clrplane_y(i8 zeroext %11)
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = call i32 @clrplane_z(i8 zeroext %14)
br label %16
16: ; preds = %2, %13, %10, %7
ret void
}

LLVM IR (-O2):
define void @clrplane(i8 signext %0, i8 zeroext %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %10 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
]
4: ; preds = %2
%5 = tail call i32 @clrplane_x(i8 zeroext %1)
br label %10
6: ; preds = %2
%7 = tail call i32 @clrplane_y(i8 zeroext %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @clrplane_z(i8 zeroext %1)
br label %10
10: ; preds = %2, %8, %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mymemcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void test7() {
  char *p = "Hello world";
  char q[40];
  mymemcpy(q, p, 20);
  printf("q=\"%s\"\n", q);
}


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x14,%edx
call   1040 <mymemcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
push   %rbx
sub    $0x30,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%edx
call   1040 <mymemcpy@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [8 x i8] c"q=\22%s\22\0A\00"
define void @test7() {
%1 = alloca i8*
%2 = alloca [40 x i8]
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%4 = load i8*, i8** %1
%5 = call i32 @mymemcpy(i8* %3, i8* %4, i32 20)
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
@.str.1 = [8 x i8] c"q=\22%s\22\0A\00"
define void @test7() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @mymemcpy(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 20)
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000018))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<TimerIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x18(%rcx)
ret

LLVM IR (-O0):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INC8(int /*<<< orphan*/);
int /*<<< orphan*/ SA1Direct(int);
void OpE6M1(void) { INC8(SA1Direct(3)); }


x86 assembly (clang, -O0):
<OpE6M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
call   1040 <INC8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpE6M1>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <INC8@plt>

LLVM IR (-O0):
define void @OpE6M1() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @INC8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpE6M1() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @INC8(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int unlink(const char *file) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @unlink(i8* nocapture readnone %0) {
%2 = load i32, i32* @EACCES
store i32 %2, i32* @errno
ret i32 -1
}