xunge/DecIR huggingface dataset:
void fnCalcVolSurfArea(int iL, int iB, int iH, int *iA, int *iV) {
  *iA = 2 * iL * iB + 2 * iB * iH + 2 * iH * iL;
  *iV = iL * iB * iH;
}


x86 assembly (clang, -O0):
<fnCalcVolSurfArea>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
imul   -0x8(%rbp),%ecx
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
imul   -0xc(%rbp),%eax
add    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
imul   -0x4(%rbp),%eax
add    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnCalcVolSurfArea>:
mov    %esi,%eax
imul   %edi,%eax
add    %edi,%esi
imul   %edx,%esi
add    %eax,%esi
add    %esi,%esi
mov    %esi,(%rcx)
imul   %edx,%eax
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define void @fnCalcVolSurfArea(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 = mul nsw i32 2, %11
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %7
%16 = mul nsw i32 2, %15
%17 = load i32, i32* %8
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %14, %18
%20 = load i32, i32* %8
%21 = mul nsw i32 2, %20
%22 = load i32, i32* %6
%23 = mul nsw i32 %21, %22
%24 = add nsw i32 %19, %23
%25 = load i32*, i32** %9
store i32 %24, i32* %25
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = mul nsw i32 %26, %27
%29 = load i32, i32* %8
%30 = mul nsw i32 %28, %29
%31 = load i32*, i32** %10
store i32 %30, i32* %31
ret void
}

LLVM IR (-O2):
define void @fnCalcVolSurfArea(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = mul i32 %1, %0
%7 = add i32 %1, %0
%8 = mul i32 %7, %2
%9 = add i32 %8, %6
%10 = shl i32 %9, 1
store i32 %10, i32* %3
%11 = mul nsw i32 %6, %2
store i32 %11, i32* %4
ret void
}
void XServerVendor() {}


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

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

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

LLVM IR (-O2):
define void @XServerVendor() {
ret void
}
/* Variables and functions */
int copysign(int, double);
int isPlusZero(double x) { return x == 0 && copysign(1, x) == 1; }


x86 assembly (clang, -O0):
<isPlusZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1152 <isPlusZero+0x42>
jp     1152 <isPlusZero+0x42>
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <copysign@plt>
cmp    $0x1,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPlusZero>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1136 <isPlusZero+0x26>
jp     1136 <isPlusZero+0x26>
push   %rax
mov    $0x1,%edi
call   1030 <copysign@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPlusZero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 @copysign(i32 1, double %6)
%8 = icmp eq i32 %7, 1
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isPlusZero(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @copysign(i32 1, double %0)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void __WRITE_BOTH(char Ch) {
  char STR1[256];
  sprintf(STR1, "%s", Ch);
  WRITETEST(STR1);
}


x86 assembly (clang, -O0):
<__WRITE_BOTH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x110(%rbp),%rdi
movsbl -0x1(%rbp),%edx
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x0,%al
call   1030 <WRITETEST@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__WRITE_BOTH>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%edx
lea    0xecf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <WRITETEST@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @__WRITE_BOTH(i8 signext %0) {
%2 = alloca i8
%3 = alloca [256 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @__WRITE_BOTH(i8 signext %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = sext i8 %0 to i32
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @WRITETEST to i32 (i8*, ...)*)(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int a = 0;
  for (int i = 0; i < 10000000; i++)
    a = i * i;
  sleep(3);
  printf("%d\n", a);
  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   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x989680,-0x18(%rbp)
jge    1169 <main+0x49>
mov    -0x18(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <main+0x24>
mov    $0x3,%edi
call   1040 <sleep@plt>
mov    -0x14(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
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 0, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %15, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 10000000
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %7
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
store i32 %14, i32* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
br label %8
18: ; preds = %8
%19 = call i32 @sleep(i32 3)
%20 = load i32, i32* %6
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 256447233)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
pid_t getppid(void) { return __syscall(64); }


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

x86 assembly (clang, -O2):
<getppid>:
mov    $0x40,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getppid() {
%1 = call i32 @__syscall(i32 64)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getppid() {
%1 = tail call i32 @__syscall(i32 64)
ret i32 %1
}
int my_cmp(const void *a, const void *b) { return *((int *)a) > *((int *)b); }


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

x86 assembly (clang, -O2):
<my_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @my_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void ext_configuration_delete() {}


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

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

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

LLVM IR (-O2):
define void @ext_configuration_delete() {
ret void
}
/* Variables and functions */
int coprthr_dmunmap(void *dptr, size_t sizeb) {}


x86 assembly (clang, -O0):
<coprthr_dmunmap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @coprthr_dmunmap(i8* nocapture readnone %0, i64 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo) {
  (void)signo;
  printf("Caught signal\n");
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Caught signal\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int _stat_r(struct _reent *r, const char *file, struct stat *st) { return -1; }


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

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

LLVM IR (-O0):
%struct._reent = type opaque
%struct.stat = type opaque
define i32 @_stat_r(%struct._reent* %0, i8* %1, %struct.stat* %2) {
%4 = alloca %struct._reent*
%5 = alloca i8*
%6 = alloca %struct.stat*
store %struct._reent* %0, %struct._reent** %4
store i8* %1, i8** %5
store %struct.stat* %2, %struct.stat** %6
ret i32 -1
}

LLVM IR (-O2):
%struct._reent = type opaque
%struct.stat = type opaque
define i32 @_stat_r(%struct._reent* nocapture readnone %0, i8* nocapture readnone %1, %struct.stat* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ greet();
int main(int argc, char **argv) {
  greet();
  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)
mov    $0x0,%al
call   1030 <greet@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <greet@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @greet()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @greet()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testdouble() {
  int a = 0;
  int *pa = &a;
  int **ppa = &pa;
  printf("a = %d, *pa = %d **ppa = %d\n", a, *pa, **ppa);
  **ppa = 2;
  printf("a = %d, *pa = %d **ppa = %d\n", a, *pa, **ppa);
}


x86 assembly (clang, -O0):
<testdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movl   $0x2,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"a = %d, *pa = %d **ppa = %d\0A\00"
define void @testdouble() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
store i32 0, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%4 = load i32, i32* %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = load i32**, i32*** %3
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %9)
%11 = load i32**, i32*** %3
%12 = load i32*, i32** %11
store i32 2, i32* %12
%13 = load i32, i32* %1
%14 = load i32*, i32** %2
%15 = load i32, i32* %14
%16 = load i32**, i32*** %3
%17 = load i32*, i32** %16
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15, i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"a = %d, *pa = %d **ppa = %d\0A\00"
define void @testdouble() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 2, i32 2, i32 2)
ret void
}
int get_encoded_index(int original_index, int modifier) {
  return (original_index + modifier) % 26;
}


x86 assembly (clang, -O0):
<get_encoded_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_encoded_index>:
add    %esi,%edi
movslq %edi,%rax
imul   $0x4ec4ec4f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,4),%edx
add    %ecx,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_encoded_index(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 = add nsw i32 %5, %6
%8 = srem i32 %7, 26
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_encoded_index(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = srem i32 %3, 26
ret i32 %4
}
void foo_1_2_2_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_1_2_1_2_2() {
ret void
}
void pmp_set_address(unsigned addr) {
  while (*(volatile unsigned *)(0xBF800000 + (0x2E010)) & 0x8000)
    ;
  *(volatile unsigned *)(0xBF800000 + (0x2E020)) = addr;
}


x86 assembly (clang, -O0):
<pmp_set_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xbf82e010,%eax
mov    (%rax),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1121 <pmp_set_address+0x21>
jmp    1107 <pmp_set_address+0x7>
mov    -0x4(%rbp),%ecx
mov    $0xbf82e020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmp_set_address>:
mov    $0xbf82e010,%eax
cs nopw 0x0(%rax,%rax,1)
nop
testl  $0x8000,(%rax)
jne    1110 <pmp_set_address+0x10>
mov    %edi,0x10(%rax)
ret

LLVM IR (-O0):
define void @pmp_set_address(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i32, i32* inttoptr (i64 3213025296 to i32*)
%5 = and i32 %4, 32768
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i32, i32* %2
store volatile i32 %9, i32* inttoptr (i64 3213025312 to i32*)
ret void
}

LLVM IR (-O2):
define void @pmp_set_address(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 3213025296 to i32*)
%4 = and i32 %3, 32768
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 3213025312 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ _unsupported();
int pthread_cond_signal(pthread_cond_t *cond) {
  _unsupported();
  return -1;
}


x86 assembly (clang, -O0):
<pthread_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_cond_signal>:
push   %rax
xor    %eax,%eax
call   1030 <_unsupported@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @pthread_cond_signal(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @_unsupported()
ret i32 -1
}

LLVM IR (-O2):
define i32 @pthread_cond_signal(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @_unsupported()
ret i32 -1
}
/* Variables and functions */
float s_brrand();
float tan(float);
float cauchy() {
  float alpha = .00628338;
  float pi = 3.1415927;
  float output;
  float randnum;
  output = -1.0;
  while ((output < 0.0) && (output > 1.0)) {
    randnum = s_brrand();
    randnum *= pi;
    output = (alpha * tan(randnum)) + 0.5;
  }
  return (output);
}


x86 assembly (clang, -O0):
<cauchy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  0xed8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xec7(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeb6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xor    %eax,%eax
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jbe    1185 <cauchy+0x65>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe95(%rip),%xmm1
ucomisd %xmm1,%xmm0
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1195 <cauchy+0x75>
jmp    11ee <cauchy+0xce>
mov    $0x0,%al
call   1040 <s_brrand@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
call   1030 <tan@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe3c(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    114f <cauchy+0x2f>
movss  -0xc(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cauchy>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @cauchy() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float 0x3F79BC9A00000000, float* %1
store float 0x400921FB60000000, float* %2
store float -1.000000e+00, float* %3
br label %5
5: ; preds = %15, %0
%6 = load float, float* %3
%7 = fpext float %6 to double
%8 = fcmp olt double %7, 0.000000e+00
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fcmp ogt double %11, 1.000000e+00
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ false, %5 ], [ %12, %9 ]
br i1 %14, label %15, label %27
15: ; preds = %13
%16 = call float (...) @s_brrand()
store float %16, float* %4
%17 = load float, float* %2
%18 = load float, float* %4
%19 = fmul float %18, %17
store float %19, float* %4
%20 = load float, float* %1
%21 = load float, float* %4
%22 = call float @tan(float %21)
%23 = fmul float %20, %22
%24 = fpext float %23 to double
%25 = fadd double %24, 5.000000e-01
%26 = fptrunc double %25 to float
store float %26, float* %3
br label %5
27: ; preds = %13
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
define float @cauchy() {
ret float -1.000000e+00
}
/* Variables and functions */
bool is_prime(const int num) {
  int i;
  for (i = 2; i < num; ++i) {
    if (num % i == 0)
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <is_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <is_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
jmp    113b <is_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = srem i32 %10, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 0, i32* %2
br label %20
15: ; preds = %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 1, i32* %2
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Type definitions */
typedef int ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no)) void check(void *a) {
  if (((ptrdiff_t)a & (128 - 1)) != 0)
    abort();
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7f,%eax
cmp    $0x0,%eax
je     1133 <check+0x23>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   $0x7f,%dil
jne    1117 <check+0x7>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @check(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = and i32 %4, 127
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @check(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ broadcastEnable;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BROADCAST;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int enableBroadCast(int fd) {
  int broadcastEnable = 1;
  return setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &broadcastEnable,
                    sizeof(broadcastEnable));
}


x86 assembly (clang, -O0):
<enableBroadCast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableBroadCast>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @enableBroadCast(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_BROADCAST
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BROADCAST = global i32 0
define i32 @enableBroadCast(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_BROADCAST
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ initbv(int **, int);
int main(int argc, char const *argv[]) {
  int *bv;
  initbv(&bv, 100);
  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)
lea    -0x18(%rbp),%rdi
mov    $0x64,%esi
call   1030 <initbv@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
mov    $0x64,%esi
call   1030 <initbv@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @initbv(i32** %6, i32 100)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = call i32 @initbv(i32** %3, i32 100)
ret i32 0
}
int getlistoffile(unsigned char *directorypath, unsigned char ***filelist) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @getlistoffile(i8* nocapture readnone %0, i8*** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *px_malloc0(size_t size) {
  void *mem = malloc(size);
  assert(mem != NULL);
  memset(mem, 0, size);
  return mem;
}


x86 assembly (clang, -O0):
<px_malloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<px_malloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @px_malloc0(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %3
%11 = load i64, i64* %2
%12 = call i32 @memset(i8* %10, i32 0, i64 %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @px_malloc0(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
char *RCSid() {
  return RCSid("$Id: xref.c,v 1.13 2011/02/28 11:39:35 markisch Exp $");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"$Id: xref.c,v 1.13 2011/02/28 11:39:35 markisch Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int parse_msgstring(char *, size_t, char **, int);
int /*<<< orphan*/ verbose(int, char *, char *);
int parse_devfile(char *msgbuf, size_t msglen, char **devfile) {
  int ret;
  ret = parse_msgstring(msgbuf, msglen, devfile, 2);
  verbose(1, "parse_devfile: devfile = %s\n", *devfile);
  return ret;
}


x86 assembly (clang, -O0):
<parse_devfile>:
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
mov    -0x18(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <parse_msgstring@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    $0x1,%edi
lea    0xea0(%rip),%rsi
call   1040 <verbose@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_devfile>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    $0x2,%ecx
call   1030 <parse_msgstring@plt>
mov    %eax,%ebp
mov    (%rbx),%rdx
lea    0xec4(%rip),%rsi
mov    $0x1,%edi
call   1040 <verbose@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"parse_devfile: devfile = %s\0A\00"
define i32 @parse_devfile(i8* %0, i64 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i8**, i8*** %6
%11 = call i32 @parse_msgstring(i8* %8, i64 %9, i8** %10, i32 2)
store i32 %11, i32* %7
%12 = load i8**, i8*** %6
%13 = load i8*, i8** %12
%14 = call i32 @verbose(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"parse_devfile: devfile = %s\0A\00"
define i32 @parse_devfile(i8* %0, i64 %1, i8** %2) {
%4 = tail call i32 @parse_msgstring(i8* %0, i64 %1, i8** %2, i32 2)
%5 = load i8*, i8** %2
%6 = tail call i32 @verbose(i32 1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 %4
}
const char *speck_version(void) { return "UNKNOWN"; }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"UNKNOWN\00"
define i8* @speck_version() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct utmp {
  int /*<<< orphan*/ ut_name;
};

/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/, char *, int);
int nonuser(struct utmp utmp_ent) {
  return (!memcmp(utmp_ent.ut_name, "shutdown", sizeof("shutdown")));
}


x86 assembly (clang, -O0):
<nonuser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x9,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonuser>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x9,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utmp = type { i32 }
@.str = [9 x i8] c"shutdown\00"
define i32 @nonuser(i32 %0) {
%2 = alloca %struct.utmp
%3 = getelementptr inbounds %struct.utmp, %struct.utmp* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.utmp, %struct.utmp* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @memcmp(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 9)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"shutdown\00"
define i32 @nonuser(i32 %0) {
%2 = tail call i32 @memcmp(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 9)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int SSL_write(int /*<<< orphan*/ *, char *, size_t);
int write(int, char *, size_t);
__attribute__((always_)) int tmail_sock_write(void *fd, char *bf, size_t sz,
                                              bool protected
                                              __attribute__((__unused__))) {
  if (protected)
    return SSL_write((SSL *)fd, bf, sz);
  return write(*(int *)fd, bf, sz);
}


x86 assembly (clang, -O0):
<tmail_sock_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115a <tmail_sock_write+0x3a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <SSL_write@plt>
mov    %eax,-0x4(%rbp)
jmp    1170 <tmail_sock_write+0x50>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmail_sock_write>:
test   %ecx,%ecx
je     1129 <tmail_sock_write+0x9>
jmp    1030 <SSL_write@plt>
mov    (%rdi),%edi
jmp    1040 <write@plt>

LLVM IR (-O0):
define i32 @tmail_sock_write(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = bitcast i8* %13 to i32*
%15 = load i8*, i8** %7
%16 = load i64, i64* %8
%17 = call i32 @SSL_write(i32* %14, i8* %15, i64 %16)
store i32 %17, i32* %5
br label %25
18: ; preds = %4
%19 = load i8*, i8** %6
%20 = bitcast i8* %19 to i32*
%21 = load i32, i32* %20
%22 = load i8*, i8** %7
%23 = load i64, i64* %8
%24 = call i32 @write(i32 %21, i8* %22, i64 %23)
store i32 %24, i32* %5
br label %25
25: ; preds = %18, %12
%26 = load i32, i32* %5
ret i32 %26
}

LLVM IR (-O2):
define i32 @tmail_sock_write(i8* %0, i8* %1, i64 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = bitcast i8* %0 to i32*
br i1 %5, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @SSL_write(i32* %6, i8* %1, i64 %2)
br label %12
9: ; preds = %4
%10 = load i32, i32* %6
%11 = tail call i32 @write(i32 %10, i8* %1, i64 %2)
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
ret i32 %13
}
void init_nodeinfo_ipv4addr(int forced) {
  do {
    ;
  } while (0);
  return;
}


x86 assembly (clang, -O0):
<init_nodeinfo_ipv4addr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    110c <init_nodeinfo_ipv4addr+0xc>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init_nodeinfo_ipv4addr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @init_nodeinfo_ipv4addr(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setup_vendor_hashes();
void vendor_init(void) { setup_vendor_hashes(); }


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

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

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

LLVM IR (-O2):
define void @vendor_init() {
%1 = tail call i32 (...) @setup_vendor_hashes()
ret void
}
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *pool_alloc(struct pool *, int);
void *pool_calloc(struct pool *pool, int size) {
  void *acquired;
  acquired = pool_alloc(pool, size);
  memset(acquired, 0, size);
  return acquired;
}


x86 assembly (clang, -O0):
<pool_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <pool_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_calloc>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <pool_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pool = type { i32 }
define i8* @pool_calloc(%struct.pool* %0, i32 %1) {
%3 = alloca %struct.pool*
%4 = alloca i32
%5 = alloca i8*
store %struct.pool* %0, %struct.pool** %3
store i32 %1, i32* %4
%6 = load %struct.pool*, %struct.pool** %3
%7 = load i32, i32* %4
%8 = call i8* @pool_alloc(%struct.pool* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = call i32 @memset(i8* %9, i32 0, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
%struct.pool = type { i32 }
define i8* @pool_calloc(%struct.pool* %0, i32 %1) {
%3 = tail call i8* @pool_alloc(%struct.pool* %0, i32 %1)
%4 = tail call i32 @memset(i8* %3, i32 0, i32 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
int copyin(const void *uaddr, void *kaddr, size_t len) {
  memcpy(kaddr, uaddr, len);
  return (0);
}


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

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

LLVM IR (-O0):
define i32 @copyin(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @copyin(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
unsigned long ftell(int /*<<< orphan*/ *);
unsigned long fileSize(char *filename) {
  FILE *fpText;
  unsigned long fsize;
  fpText = fopen(filename, "rb");
  fsize = 0;
  if (fpText) {
    fseek(fpText, 0, 2);
    fsize = ftell(fpText);
    fclose(fpText);
  }
  return fsize;
}


x86 assembly (clang, -O0):
<fileSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1199 <fileSize+0x59>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileSize>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     117f <fileSize+0x3f>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r14,%rax
jmp    1181 <fileSize+0x41>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i64 @fileSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
store i64 0, i64* %4
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %16
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32 @fseek(i32* %10, i32 0, i32 2)
%12 = load i32*, i32** %3
%13 = call i64 @ftell(i32* %12)
store i64 %13, i64* %4
%14 = load i32*, i32** %3
%15 = call i32 @fclose(i32* %14)
br label %16
16: ; preds = %9, %1
%17 = load i64, i64* %4
ret i64 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i64 @fileSize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @fseek(i32* %2, i32 0, i32 2)
%6 = tail call i64 @ftell(i32* %2)
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %4, %1
%9 = phi i64 [ %6, %4 ], [ 0, %1 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ bla();
void foo(int c, int d) {
  goto skip;
ebef:
  goto xxx;
skip:
  if (c) {
  xxx:;
    if (!c)
      bla();
  }
  if (d)
    goto ebef;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
jmp    1128 <foo+0x18>
jmp    1137 <foo+0x27>
cmpl   $0x0,-0x4(%rbp)
je     114d <foo+0x3d>
jmp    1137 <foo+0x27>
cmpl   $0x0,-0x4(%rbp)
jne    1148 <foo+0x38>
mov    $0x0,%al
call   1030 <bla@plt>
jmp    114d <foo+0x3d>
cmpl   $0x0,-0x8(%rbp)
je     115c <foo+0x4c>
jmp    1123 <foo+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
test   %esi,%esi
je     112d <foo+0x1d>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
test   %ebx,%ebx
jne    1120 <foo+0x10>
xor    %eax,%eax
call   1030 <bla@plt>
jmp    1120 <foo+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %6
5: ; preds = %19
br label %10
6: ; preds = %2
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
br label %10
10: ; preds = %9, %5
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = call i32 (...) @bla()
br label %15
15: ; preds = %13, %10
br label %16
16: ; preds = %15, %6
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
br label %5
20: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
br i1 %4, label %9, label %5
5: ; preds = %2, %8
br i1 %3, label %6, label %8
6: ; preds = %5
%7 = tail call i32 (...) @bla()
br label %8
8: ; preds = %6, %5
br label %5
9: ; preds = %2
ret void
}
void bayes_dm_CorrectInvalidDoubleValue(double *Value, int Type) {
  switch (Type) {
  case 3: {
    *Value = 1.0e-300;
    break;
  }
  case -1: {
    *Value = -1.0e25;
    break;
  }
  case 1:
  case 2: {
    *Value = 1.0e+300;
    break;
  }
  default: {
  }
  }
}


x86 assembly (clang, -O0):
<bayes_dm_CorrectInvalidDoubleValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0xffffffff,%eax
je     1159 <bayes_dm_CorrectInvalidDoubleValue+0x59>
jmp    111f <bayes_dm_CorrectInvalidDoubleValue+0x1f>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x2,%eax
jb     116e <bayes_dm_CorrectInvalidDoubleValue+0x6e>
jmp    1133 <bayes_dm_CorrectInvalidDoubleValue+0x33>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
jne    1183 <bayes_dm_CorrectInvalidDoubleValue+0x83>
jmp    1144 <bayes_dm_CorrectInvalidDoubleValue+0x44>
mov    -0x8(%rbp),%rax
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1188 <bayes_dm_CorrectInvalidDoubleValue+0x88>
mov    -0x8(%rbp),%rax
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1188 <bayes_dm_CorrectInvalidDoubleValue+0x88>
mov    -0x8(%rbp),%rax
movsd  0xe86(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    1188 <bayes_dm_CorrectInvalidDoubleValue+0x88>
jmp    1188 <bayes_dm_CorrectInvalidDoubleValue+0x88>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bayes_dm_CorrectInvalidDoubleValue>:
add    $0x1,%esi
cmp    $0x4,%esi
ja     1125 <bayes_dm_CorrectInvalidDoubleValue+0x25>
mov    $0x1d,%eax
bt     %esi,%eax
jae    1125 <bayes_dm_CorrectInvalidDoubleValue+0x25>
movslq %esi,%rax
lea    0xee4(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @bayes_dm_CorrectInvalidDoubleValue(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %12 [
i32 3, label %6
i32 -1, label %8
i32 1, label %10
i32 2, label %10
]
6: ; preds = %2
%7 = load double*, double** %3
store double 1.000000e-300, double* %7
br label %13
8: ; preds = %2
%9 = load double*, double** %3
store double -1.000000e+25, double* %9
br label %13
10: ; preds = %2, %2
%11 = load double*, double** %3
store double 1.000000e+300, double* %11
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %10, %8, %6
ret void
}

LLVM IR (-O2):
@switch.table.bayes_dm_CorrectInvalidDoubleValue = [5 x double] [double -1.000000e+25, double 1.000000e-300, double 1.000000e+300, double 1.000000e+300, double 1.000000e-300]
define void @bayes_dm_CorrectInvalidDoubleValue(double* nocapture writeonly %0, i32 %1) {
%3 = add i32 %1, 1
%4 = icmp ult i32 %3, 5
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = trunc i32 %3 to i8
%7 = lshr i8 29, %6
%8 = and i8 %7, 1
%9 = icmp eq i8 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds [5 x double], [5 x double]* @switch.table.bayes_dm_CorrectInvalidDoubleValue, i64 0, i64 %11
%13 = load double, double* %12
store double %13, double* %0
br label %14
14: ; preds = %5, %2, %10
ret void
}