xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printLine(void) {
  int counter = 0;
  while (counter < 25) {
    if (counter % 8 == 0) {
      printf("+");
    } else {
      printf("-");
    }
    counter++;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x19,-0x4(%rbp)
jge    1168 <printLine+0x58>
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114e <printLine+0x3e>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    115a <printLine+0x4a>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <printLine+0xf>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLine>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
test   $0x7,%bl
setne  %al
lea    (%rax,%rax,1),%edi
add    $0x2b,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x19,%ebx
jne    1120 <printLine+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printLine() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = and i32 %2, 7
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 43, i32 45
%6 = tail call i32 @putchar(i32 %5)
%7 = add nuw nsw i32 %2, 1
%8 = icmp eq i32 %7, 25
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void cld() { db(0xFC); }


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

x86 assembly (clang, -O2):
<cld>:
mov    $0xfc,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @cld() {
%1 = call i32 @db(i32 252)
ret void
}

LLVM IR (-O2):
define void @cld() {
%1 = tail call i32 @db(i32 252)
ret void
}
int getpgrp(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @getpgrp() {
ret i32 0
}
int main(int argc, char **argv) {
  int *ptr = 0;
  {
    int a;
    ptr = &a;
    *ptr = 12345;
  }
  *ptr = 12345;
  return *ptr;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x3039,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x3039,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* %7, i32** %6
%8 = load i32*, i32** %6
store i32 12345, i32* %8
%9 = load i32*, i32** %6
store i32 12345, i32* %9
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 12345
}
int bar() { return 10; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 10
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 10
}
/* Type definitions */
struct nameserver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ nameserver_send_probe(struct nameserver *const);
void nameserver_prod_callback(int fd, short events, void *arg) {
  struct nameserver *const ns = (struct nameserver *)arg;
  (void)fd;
  (void)events;
  nameserver_send_probe(ns);
}


x86 assembly (clang, -O0):
<nameserver_prod_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <nameserver_send_probe@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nameserver_prod_callback>:
mov    %rdx,%rdi
jmp    1030 <nameserver_send_probe@plt>

LLVM IR (-O0):
%struct.nameserver = type { i32 }
define void @nameserver_prod_callback(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.nameserver*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.nameserver*
store %struct.nameserver* %9, %struct.nameserver** %7
%10 = load i32, i32* %4
%11 = load i16, i16* %5
%12 = load %struct.nameserver*, %struct.nameserver** %7
%13 = call i32 @nameserver_send_probe(%struct.nameserver* %12)
ret void
}

LLVM IR (-O2):
%struct.nameserver = type { i32 }
define void @nameserver_prod_callback(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.nameserver*
%5 = tail call i32 @nameserver_send_probe(%struct.nameserver* %4)
ret void
}
/* Variables and functions */
float fmaf(float, float, float);
float test_func_00(float a, float b, float c) { return fmaf(a, b, c); }


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

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

LLVM IR (-O0):
define float @test_func_00(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @llvm.fma.f32(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @test_func_00(float %0, float %1, float %2) {
%4 = tail call float @llvm.fma.f32(float %0, float %1, float %2)
ret float %4
}
int is_upperchar(const char c) {
  if (c >= 'A' && c <= 'Z')
    return 1;
  else
    return 0;
}


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

x86 assembly (clang, -O2):
<is_upperchar>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_upperchar(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void clean_colors(char **colors, int i) {
  while (i--) {
    free(colors[i]);
  }
  free(colors[0]);
  free(colors);
}


x86 assembly (clang, -O0):
<clean_colors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1149 <clean_colors+0x39>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <clean_colors+0xf>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_colors>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
je     1152 <clean_colors+0x42>
mov    %esi,%r12d
movslq %esi,%rax
lea    (%r14,%rax,8),%r15
add    $0xfffffffffffffff8,%r15
neg    %r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1140 <clean_colors+0x30>
mov    (%r14),%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @clean_colors(i8** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = trunc i64 %8 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = load i8*, i8** %0
tail call void @free(i8* %14)
%15 = bitcast i8** %0 to i8*
tail call void @free(i8* %15)
ret void
}
void release_fdt_parser(void) {}


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

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

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

LLVM IR (-O2):
define void @release_fdt_parser() {
ret void
}
unsigned char hex2bin(unsigned char h, unsigned char l) {
  h |= 0x20;
  h -= 0x30;
  h -= -(h > 9) & 0x27;
  l |= 0x20;
  l -= 0x30;
  l -= -(l > 9) & 0x27;
  return h << 4 | l;
}


x86 assembly (clang, -O0):
<hex2bin>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
xor    %ecx,%ecx
sub    %eax,%ecx
and    $0x27,%ecx
movzbl -0x1(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x9,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
xor    %ecx,%ecx
sub    %eax,%ecx
and    $0x27,%ecx
movzbl -0x2(%rbp),%eax
sub    %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x4,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2bin>:
or     $0x20,%dil
lea    -0x30(%rdi),%ecx
xor    %eax,%eax
cmp    $0xa,%cl
setae  %al
lea    (%rax,%rax,8),%eax
add    %cl,%al
or     $0x20,%sil
lea    -0x30(%rsi),%ecx
xor    %edx,%edx
cmp    $0xa,%cl
mov    $0xd9,%esi
cmovb  %edx,%esi
add    %cl,%sil
shl    $0x4,%al
or     %sil,%al
ret

LLVM IR (-O0):
define zeroext i8 @hex2bin(i8 zeroext %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 = zext i8 %5 to i32
%7 = or i32 %6, 32
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = sub nsw i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = icmp sgt i32 %14, 9
%16 = zext i1 %15 to i32
%17 = sub nsw i32 0, %16
%18 = and i32 %17, 39
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = sub nsw i32 %20, %18
%22 = trunc i32 %21 to i8
store i8 %22, i8* %3
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = or i32 %24, 32
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = sub nsw i32 %28, 48
%30 = trunc i32 %29 to i8
store i8 %30, i8* %4
%31 = load i8, i8* %4
%32 = zext i8 %31 to i32
%33 = icmp sgt i32 %32, 9
%34 = zext i1 %33 to i32
%35 = sub nsw i32 0, %34
%36 = and i32 %35, 39
%37 = load i8, i8* %4
%38 = zext i8 %37 to i32
%39 = sub nsw i32 %38, %36
%40 = trunc i32 %39 to i8
store i8 %40, i8* %4
%41 = load i8, i8* %3
%42 = zext i8 %41 to i32
%43 = shl i32 %42, 4
%44 = load i8, i8* %4
%45 = zext i8 %44 to i32
%46 = or i32 %43, %45
%47 = trunc i32 %46 to i8
ret i8 %47
}

LLVM IR (-O2):
define zeroext i8 @hex2bin(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %0, 32
%4 = add i8 %3, -48
%5 = icmp ugt i8 %4, 9
%6 = select i1 %5, i8 9, i8 0
%7 = add i8 %6, %4
%8 = or i8 %1, 32
%9 = add i8 %8, -48
%10 = icmp ugt i8 %9, 9
%11 = select i1 %10, i8 -39, i8 0
%12 = add i8 %11, %9
%13 = shl i8 %7, 4
%14 = or i8 %13, %12
ret i8 %14
}
void gtk_statusbar_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_statusbar_new() {
ret void
}
/* Variables and functions */
int daemon(int, int /*<<< orphan*/);
int ez_daemon() {
  int res = daemon(1, 0);
  return res == 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<ez_daemon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <daemon@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ez_daemon>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <daemon@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ez_daemon() {
%1 = alloca i32
%2 = call i32 @daemon(i32 1, i32 0)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @ez_daemon() {
%1 = tail call i32 @daemon(i32 1, i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void simple_test(void) {
  void *ptr = malloc(sizeof(void *));
  free(ptr);
  ptr = &ptr;
}


x86 assembly (clang, -O0):
<simple_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_test>:
push   %rax
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @simple_test() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 8)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @free(i8* %3)
%5 = bitcast i8** %1 to i8*
store i8* %5, i8** %1
ret void
}

LLVM IR (-O2):
define void @simple_test() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%2 = tail call i32 @free(i8* %1)
ret void
}
int check_sc_param(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_sc_param() {
ret i32 0
}
long map(int x, int in_min, int in_max, int out_min, int out_max) {
  return map((long)x, (long)in_min, (long)in_max, (long)out_min, (long)out_max);
}


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

x86 assembly (clang, -O2):
<map>:
jmp    1100 <map>

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

LLVM IR (-O2):
define i64 @map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
br label %6
6: ; preds = %6, %5
br label %6
}
/* Variables and functions */
int /*<<< orphan*/ ldiv(long, long);
int /*<<< orphan*/ lldiv(long long, long long);
void uninitvar_ldiv(void) {
  long int l1;
  long int l2;
  (void)ldiv(l1, l2);
  long long int ll1;
  long long int ll2;
  (void)lldiv(ll1, ll2);
}


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

x86 assembly (clang, -O2):
<uninitvar_ldiv>:
push   %rax
call   1040 <ldiv@plt>
pop    %rax
jmp    1030 <lldiv@plt>

LLVM IR (-O0):
define void @uninitvar_ldiv() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = load i64, i64* %1
%6 = load i64, i64* %2
%7 = call i32 @ldiv(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @lldiv(i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @uninitvar_ldiv() {
%1 = tail call i32 @ldiv(i64 undef, i64 undef)
%2 = tail call i32 @lldiv(i64 undef, i64 undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int x, y;
  x = 0;
  y = 0;
  int flag;
  if (!(i == 0 && j == 0))
    return 0;
  while (1) {
    x++;
    y++;
    i += x;
    j += y;
    if (flag)
      j += 1;
    assert(j >= i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <main+0x31>
cmpl   $0x0,-0xc(%rbp)
je     1149 <main+0x39>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    114e <main+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1185 <main+0x75>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
jmp    114e <main+0x3e>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9, %0
ret i32 0
13: ; preds = %9
br label %14
14: ; preds = %13, %30
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load i32, i32* %4
%20 = load i32, i32* %2
%21 = add nsw i32 %20, %19
store i32 %21, i32* %2
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = add nsw i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %14
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
br label %30
30: ; preds = %27, %14
%31 = load i32, i32* %3
%32 = load i32, i32* %2
%33 = icmp sge i32 %31, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
br label %14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_SIGNATURE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_SIGNATURE_it;
int i2d_OCSP_SIGNATURE(OCSP_SIGNATURE *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &OCSP_SIGNATURE_it);
}


x86 assembly (clang, -O0):
<i2d_OCSP_SIGNATURE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_OCSP_SIGNATURE>:
mov    0x2ec1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@OCSP_SIGNATURE_it = global i32 0
define i32 @i2d_OCSP_SIGNATURE(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @OCSP_SIGNATURE_it)
ret i32 %7
}

LLVM IR (-O2):
@OCSP_SIGNATURE_it = global i32 0
define i32 @i2d_OCSP_SIGNATURE(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @OCSP_SIGNATURE_it)
ret i32 %3
}
void CIN_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @CIN_Shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, unsigned int,
                           unsigned int, unsigned int);
char *ip4_to_str(unsigned int ip, char *buffer) {
  sprintf(buffer, "%d.%d.%d.%d", ip >> 24, (ip >> 16) & 0xff, (ip >> 8) & 0xff,
          ip & 0xff);
  return buffer;
}


x86 assembly (clang, -O0):
<ip4_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
shr    $0x18,%edx
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%r8d
shr    $0x8,%r8d
and    $0xff,%r8d
mov    -0x4(%rbp),%r9d
and    $0xff,%r9d
lea    0xeaa(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4_to_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%edx
mov    %edi,%eax
movzbl %dh,%ebp
movzbl %dl,%r9d
shr    $0x18,%edx
shr    $0x10,%eax
movzbl %al,%ecx
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @ip4_to_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = lshr i32 %6, 24
%8 = load i32, i32* %3
%9 = lshr i32 %8, 16
%10 = and i32 %9, 255
%11 = load i32, i32* %3
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = load i32, i32* %3
%15 = and i32 %14, 255
%16 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %13, i32 %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @ip4_to_str(i32 %0, i8* returned writeonly %1) {
%3 = lshr i32 %0, 24
%4 = lshr i32 %0, 16
%5 = and i32 %4, 255
%6 = lshr i32 %0, 8
%7 = and i32 %6, 255
%8 = and i32 %0, 255
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %8)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_4500(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_4500() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main(int argc, char **argv) {
  int age = 33;
  f1(age);
  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)
movl   $0x21,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <f1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x21,%edi
call   1030 <f1@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
store i32 33, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @f1(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f1(i32 33)
ret i32 0
}
void rul__ref_remove_refs_to_timetag(long old_timetag) { return; }


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

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

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

LLVM IR (-O2):
define void @rul__ref_remove_refs_to_timetag(i64 %0) {
ret void
}
/* Variables and functions */
int printf(char *, int);
int print_int(int v) { return printf("%d", v); }


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @print_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %2
}
int null_test_deref_basic_bad(int *p) {
  int ret = *p;
  if (p == 0)
    return -1;
  return ret;
}


x86 assembly (clang, -O0):
<null_test_deref_basic_bad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <null_test_deref_basic_bad+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    112e <null_test_deref_basic_bad+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_test_deref_basic_bad>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @null_test_deref_basic_bad(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_data(__le16 fc) {
  return (fc & cpu_to_le16(0x000c)) == cpu_to_le16(0x0008);
}


x86 assembly (clang, -O0):
<ieee80211_is_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_data>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x8,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ieee80211_is_data(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 12)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 8)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void vec3_add(double o[3], const double u[3], const double v[3]) {
  int i;
  for (i = 0; i < 3; i++)
    o[i] = u[i] + v[i];
}


x86 assembly (clang, -O0):
<vec3_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1156 <vec3_add+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <vec3_add+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_add>:
movsd  (%rsi),%xmm0
addsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
addsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
addsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

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

LLVM IR (-O2):
define void @vec3_add(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void _Exit(int status) { _exit(status); }


x86 assembly (clang, -O0):
<_Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_Exit>:
push   %rax
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_Exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_exit(i32 %3)
unreachable
}

LLVM IR (-O2):
define void @_Exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Type definitions */
struct yaffs_stat {
  int dummy;
};

/* Variables and functions */
int yaffs_lstat_reldir(int /*<<< orphan*/, char const *, struct yaffs_stat *);
int yaffs_lstat(const char *path, struct yaffs_stat *buf) {
  return yaffs_lstat_reldir((0), path, buf);
}


x86 assembly (clang, -O0):
<yaffs_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
call   1030 <yaffs_lstat_reldir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_lstat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_lstat_reldir@plt>

LLVM IR (-O0):
%struct.yaffs_stat = type { i32 }
define i32 @yaffs_lstat(i8* %0, %struct.yaffs_stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.yaffs_stat*
store i8* %0, i8** %3
store %struct.yaffs_stat* %1, %struct.yaffs_stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.yaffs_stat*, %struct.yaffs_stat** %4
%7 = call i32 @yaffs_lstat_reldir(i32 0, i8* %5, %struct.yaffs_stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.yaffs_stat = type { i32 }
define i32 @yaffs_lstat(i8* %0, %struct.yaffs_stat* %1) {
%3 = tail call i32 @yaffs_lstat_reldir(i32 0, i8* %0, %struct.yaffs_stat* %1)
ret i32 %3
}
long NICE(incr)
long *incr;
{ return ((long)nice(*incr)); }


x86 assembly (clang, -O0):
<NICE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <nice@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NICE>:
push   %rax
mov    (%rdi),%rdi
xor    %eax,%eax
call   1030 <nice@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @NICE(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i32 (i64, ...) bitcast (i32 (...)* @nice to i32 (i64, ...)*)(i64 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @NICE(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @nice to i32 (i64, ...)*)(i64 %2)
%4 = sext i32 %3 to i64
ret i64 %4
}
int system_get_hardware_list() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @system_get_hardware_list() {
ret i32 0
}
/* Variables and functions */
size_t yystrlen(const char *yystr) {
  register const char *yys = yystr;
  while (*yys++ != '\0')
    continue;
  return yys - yystr - 1;
}


x86 assembly (clang, -O0):
<yystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <yystrlen+0x30>
jmp    1110 <yystrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yystrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <yystrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @yystrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
ret i64 %11
}
unsigned short hc_is_little_endian() {
  static const unsigned long a = 1;
  return *(const unsigned char *)&a;
}


x86 assembly (clang, -O0):
<hc_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movzbl 0xef5(%rip),%eax
movzwl %ax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@hc_is_little_endian.a = internal constant i64 1
define zeroext i16 @hc_is_little_endian() {
%1 = load i8, i8* bitcast (i64* @hc_is_little_endian.a to i8*)
%2 = zext i8 %1 to i16
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @hc_is_little_endian() {
ret i16 1
}
const char *str_expr_deref() { return "dereference"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"dereference\00"
define i8* @str_expr_deref() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [12 x i8] c"dereference\00"
define i8* @str_expr_deref() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct bilist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add2bilist(struct bilist *, struct bilist **);
int /*<<< orphan*/ removebilist(struct bilist *, struct bilist **);
void movebilist(struct bilist *lptr, struct bilist **oldlist,
                struct bilist **newlist) {
  removebilist(lptr, oldlist);
  add2bilist(lptr, newlist);
}


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

x86 assembly (clang, -O2):
<movebilist>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <removebilist@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <add2bilist@plt>

LLVM IR (-O0):
%struct.bilist = type { i32 }
define void @movebilist(%struct.bilist* %0, %struct.bilist** %1, %struct.bilist** %2) {
%4 = alloca %struct.bilist*
%5 = alloca %struct.bilist**
%6 = alloca %struct.bilist**
store %struct.bilist* %0, %struct.bilist** %4
store %struct.bilist** %1, %struct.bilist*** %5
store %struct.bilist** %2, %struct.bilist*** %6
%7 = load %struct.bilist*, %struct.bilist** %4
%8 = load %struct.bilist**, %struct.bilist*** %5
%9 = call i32 @removebilist(%struct.bilist* %7, %struct.bilist** %8)
%10 = load %struct.bilist*, %struct.bilist** %4
%11 = load %struct.bilist**, %struct.bilist*** %6
%12 = call i32 @add2bilist(%struct.bilist* %10, %struct.bilist** %11)
ret void
}

LLVM IR (-O2):
%struct.bilist = type { i32 }
define void @movebilist(%struct.bilist* %0, %struct.bilist** %1, %struct.bilist** %2) {
%4 = tail call i32 @removebilist(%struct.bilist* %0, %struct.bilist** %1)
%5 = tail call i32 @add2bilist(%struct.bilist* %0, %struct.bilist** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ waiting_progress(int);
void dev_mode() {
  system("clear");
  printf("Wellcome to Developer mode!\n");
  waiting_progress(10);
  getchar();
  getchar();
  system("clear");
}


x86 assembly (clang, -O0):
<dev_mode>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <system@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <waiting_progress@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
lea    0xe85(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_mode>:
push   %rbx
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <system@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1060 <waiting_progress@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <system@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [29 x i8] c"Wellcome to Developer mode!\0A\00"
define void @dev_mode() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @waiting_progress(i32 10)
%4 = call i32 (...) @getchar()
%5 = call i32 (...) @getchar()
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@str = [28 x i8] c"Wellcome to Developer mode!\00"
define void @dev_mode() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @waiting_progress(i32 10)
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 (...) @getchar()
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double RAND_MAX;
double rand();
double GetUniform(int from, unsigned long long int to) {
  double uniform_num = from + (rand() / (RAND_MAX + 1.0)) * (to - from + 1);
  return uniform_num;
}


x86 assembly (clang, -O0):
<GetUniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  -0x20(%rbp),%xmm1
mov    0x2eac(%rip),%rax
movsd  (%rax),%xmm2
movsd  0xeb8(%rip),%xmm3
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
movq   %rax,%xmm2
movaps 0xea5(%rip),%xmm3
punpckldq %xmm3,%xmm2
movapd 0xea9(%rip),%xmm3
subpd  %xmm3,%xmm2
movaps %xmm2,%xmm3
unpckhpd %xmm2,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetUniform>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq %ebp,%rax
sub    %rax,%rbx
add    $0x1,%rbx
movq   %rbx,%xmm1
punpckldq 0xeba(%rip),%xmm1
subpd  0xec2(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @GetUniform(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca double
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = call double (...) @rand()
%9 = load double, double* @RAND_MAX
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %8, %10
%12 = load i64, i64* %4
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = sub i64 %12, %14
%16 = add i64 %15, 1
%17 = uitofp i64 %16 to double
%18 = call double @llvm.fmuladd.f64(double %11, double %17, double %7)
store double %18, double* %5
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @GetUniform(i32 %0, i64 %1) {
%3 = sitofp i32 %0 to double
%4 = tail call double (...) @rand()
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = sext i32 %0 to i64
%9 = sub nsw i64 1, %8
%10 = add i64 %9, %1
%11 = uitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %7, double %11, double %3)
ret double %12
}
/* Variables and functions */
int __nacl_irt_close(int);
int __close(int fd) {
  int result = __nacl_irt_close(fd);
  return result;
}


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

x86 assembly (clang, -O2):
<__close>:
jmp    1030 <__nacl_irt_close@plt>

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

LLVM IR (-O2):
define i32 @__close(i32 %0) {
%2 = tail call i32 @__nacl_irt_close(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ __v2si;
typedef scalar_t__ __m64;

/* Variables and functions */
__m64 __attribute__((__always___, __nodebug__))
_mm_cmpeq_pi32(__m64 __m1, __m64 __m2) {
  return (__m64)((__v2si)__m1 == (__v2si)__m2);
}


x86 assembly (clang, -O0):
<_mm_cmpeq_pi32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cmpeq_pi32>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @_mm_cmpeq_pi32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mm_cmpeq_pi32(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}