xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void wav_store_word(const unsigned int value, FILE *f) {
  fputc((int)(value & 0xff), f);
  fputc((int)((value >> 8) & 0xff), f);
}


x86 assembly (clang, -O0):
<wav_store_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wav_store_word>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @wav_store_word(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = call i32 @fputc(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = lshr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = call i32 @fputc(i32 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @wav_store_word(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @fputc(i32 %3, i32* %1)
%5 = lshr i32 %0, 8
%6 = and i32 %5, 255
%7 = tail call i32 @fputc(i32 %6, i32* %1)
ret void
}
/* Variables and functions */
bool isRootDirectory(const char *name) {
  return name[0] == 0 || (name[0] == '/' && name[1] == 0);
}


x86 assembly (clang, -O0):
<isRootDirectory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1149 <isRootDirectory+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0xa(%rbp)
jne    1143 <isRootDirectory+0x43>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isRootDirectory>:
mov    (%rdi),%al
test   %al,%al
je     1114 <isRootDirectory+0x14>
cmp    $0x2f,%al
jne    111a <isRootDirectory+0x1a>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isRootDirectory(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %8 [
i8 0, label %9
i8 47, label %3
]
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = zext i1 %6 to i32
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %3
%10 = phi i32 [ 1, %1 ], [ %7, %3 ], [ 0, %8 ]
ret i32 %10
}
int foo(unsigned int x) { return ((int)(x + 1U) + 1) < (int)x; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x7ffffffe,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 1
%5 = add nsw i32 %4, 1
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp sgt i32 %0, 2147483645
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_sha512;
int jksengine_digests_update(int /*<<< orphan*/ *, void const *, unsigned long,
                             int /*<<< orphan*/);
int jksengine_sha512_update(EVP_MD_CTX *ctx, const void *data,
                            unsigned long count) {
  ;
  return (jksengine_digests_update(ctx, data, count, NID_sha512));
}


x86 assembly (clang, -O0):
<jksengine_sha512_update>:
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    0x2ea9(%rip),%rax
mov    (%rax),%ecx
call   1030 <jksengine_digests_update@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_sha512_update>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <jksengine_digests_update@plt>

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

LLVM IR (-O2):
@NID_sha512 = global i32 0
define i32 @jksengine_sha512_update(i32* %0, i8* %1, i64 %2) {
%4 = load i32, i32* @NID_sha512
%5 = tail call i32 @jksengine_digests_update(i32* %0, i8* %1, i64 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) { printf("Hello, World! \n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hello, World! \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello, World! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int equal_string(void *s1, void *s2) { return *(char *)s1 == *(char *)s2; }


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

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

LLVM IR (-O0):
define i32 @equal_string(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 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @equal_string(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
size_t saslc__dict_hashval(const char *cp) {
  size_t hval;
  hval = 0;
  for (; *cp != '\0'; cp++) {
    hval <<= 2;
    hval += (size_t)*cp;
  }
  return hval % 18;
}


x86 assembly (clang, -O0):
<saslc__dict_hashval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <saslc__dict_hashval+0x4d>
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbq (%rax),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <saslc__dict_hashval+0x10>
mov    -0x10(%rbp),%rax
mov    $0x12,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saslc__dict_hashval>:
mov    (%rdi),%al
test   %al,%al
je     1146 <saslc__dict_hashval+0x46>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbq %al,%rax
lea    (%rax,%rcx,4),%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <saslc__dict_hashval+0x10>
movabs $0xe38e38e38e38e38f,%rdx
38 8e e3
mov    %rcx,%rax
mul    %rdx
shr    $0x3,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,8),%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @saslc__dict_hashval(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = shl i64 %6, 2
%9 = sext i8 %5 to i64
%10 = add i64 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %10, 18
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
double variance_diff(double val, const double good_enough) {
  val *= val;
  if (val < good_enough * good_enough)
    return val * 0.25;
  return val;
}


x86 assembly (clang, -O0):
<variance_diff>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114d <variance_diff+0x4d>
movsd  0xec2(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1157 <variance_diff+0x57>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<variance_diff>:
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
movsd  0xef0(%rip),%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @variance_diff(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %4
%8 = fmul double %7, %6
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %5
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = fcmp olt double %9, %12
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load double, double* %4
%16 = fmul double %15, 2.500000e-01
store double %16, double* %3
br label %19
17: ; preds = %2
%18 = load double, double* %4
store double %18, double* %3
br label %19
19: ; preds = %17, %14
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @variance_diff(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %1, %1
%5 = fcmp olt double %3, %4
%6 = fmul double %3, 2.500000e-01
%7 = select i1 %5, double %6, double %3
ret double %7
}
void RTPathAppPrivateNoArch(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathAppPrivateNoArch() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fibonacci(int);
int /*<<< orphan*/ getchar();
int strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int nbr_terms = strtol(argv[argc - 1], NULL, 10);
  fibonacci(nbr_terms);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <fibonacci@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movslq %edi,%rax
mov    -0x8(%rsi,%rax,8),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %eax,%edi
call   1050 <fibonacci@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %7, i64 %10
%12 = load i8*, i8** %11
%13 = call i32 @strtol(i8* %12, i32* null, i32 10)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @fibonacci(i32 %14)
%16 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @strtol(i8* nocapture %6, i32* null, i32 10)
%8 = tail call i32 @fibonacci(i32 %7)
%9 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putint(int);
void f(int a[]) { putint(a[3]); }


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

x86 assembly (clang, -O2):
<f>:
mov    0xc(%rdi),%edi
jmp    1030 <putint@plt>

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = call i32 @putint(i32 %5)
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = tail call i32 @putint(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *const);
void fail(char *const str) {
  printf("%s\n", str);
  exit(-1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int strlen(char *);
char *xstrdup(char const *);
char *directory_name(const char *_path) {
  char *path, *c;
  path = xstrdup(_path);
  c = path + strlen(path) - 1;
  while (*c != '/') {
    *c = '\0';
    c--;
  }
  return path;
}


x86 assembly (clang, -O0):
<directory_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xstrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1186 <directory_name+0x66>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    115e <directory_name+0x3e>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<directory_name>:
push   %rbx
call   1040 <xstrdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rbx,%rax,1)
je     115d <directory_name+0x3d>
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x0,(%rax)
cmpb   $0x2f,-0x1(%rax)
lea    -0x1(%rax),%rax
jne    1150 <directory_name+0x30>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @directory_name(i8* %0) {
%2 = tail call i8* @xstrdup(i8* %0)
%3 = tail call i32 @strlen(i8* %2)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %2, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 -1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %14, label %9
9: ; preds = %1, %9
%10 = phi i8* [ %11, %9 ], [ %6, %1 ]
store i8 0, i8* %10
%11 = getelementptr inbounds i8, i8* %10, i64 -1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 47
br i1 %13, label %14, label %9
14: ; preds = %9, %1
ret i8* %2
}
int test_imm_7Dint64_midword_reg(long long val) {
  return ((val >> 16) & (0x7D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Dint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x7d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_7Dint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8192000
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int f(int *);
int main(void) {
  int a[2];
  return f(a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <f@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ diskInit();
void cmdDiskPrintFsize(char *path) {
  if (!diskInit()) {
    return;
  }
}


x86 assembly (clang, -O0):
<cmdDiskPrintFsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <diskInit@plt>
cmp    $0x0,%eax
jne    1131 <cmdDiskPrintFsize+0x21>
jmp    1131 <cmdDiskPrintFsize+0x21>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cmdDiskPrintFsize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @diskInit()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @cmdDiskPrintFsize(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @diskInit()
ret void
}
void __list_del(struct list_head *prev, struct list_head *next) { ; }


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

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

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

LLVM IR (-O2):
%struct.list_head = type opaque
define void @__list_del(%struct.list_head* nocapture %0, %struct.list_head* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int m_entry_nr3(void) {
  int res = 1;
  printf("\n>> Called m_entry_nr3\n");
  res = 0;
  return res;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"\0A>> Called m_entry_nr3\00"
define i32 @m_entry_nr3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int code(int buf[4]) {
  int i = 0;
  int pak = 0;
  for (i = 0; i < 4; i++)
    pak = (pak << 8) | (buf[i] & 255);
  return pak;
}


x86 assembly (clang, -O0):
<code>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1151 <code+0x51>
mov    -0x10(%rbp),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,4),%ecx
and    $0xff,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <code+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<code>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x18,%eax
movzbl %cl,%ecx
shl    $0x10,%ecx
or     %eax,%ecx
shl    $0x8,%edx
movzwl %dx,%edx
or     %ecx,%edx
movzbl 0xc(%rdi),%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @code(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = shl i32 %2, 24
%8 = shl i32 %4, 16
%9 = and i32 %8, 16711680
%10 = or i32 %7, %9
%11 = shl i32 %6, 8
%12 = and i32 %11, 65280
%13 = or i32 %10, %12
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = and i32 %15, 255
%17 = or i32 %16, %13
ret i32 %17
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
int64_t timeval_diff(const struct timeval *new, const struct timeval *old) {
  return ((int64_t) new->tv_sec - old->tv_sec) * 1000000 +
         (new->tv_usec - old->tv_usec);
}


x86 assembly (clang, -O0):
<timeval_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0xf4240,%eax,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
sub    0x4(%rdx),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_diff>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
sub    (%rsi),%ecx
imul   $0xf4240,%ecx,%ecx
sub    0x4(%rsi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timeval_diff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timeval*, %struct.timeval** %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000
%13 = load %struct.timeval*, %struct.timeval** %3
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timeval*, %struct.timeval** %4
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = add nsw i32 %12, %19
ret i32 %20
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timeval_diff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub i32 %10, %12
%14 = add nsw i32 %13, %8
ret i32 %14
}
void nondet_generate_aux_witness_files() {}


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

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

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

LLVM IR (-O2):
define void @nondet_generate_aux_witness_files() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CODESET;
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *nl_langinfo(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "");
  printf("%s\n", nl_langinfo(CODESET));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1050 <setlocale@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <nl_langinfo@plt>
mov    %rax,%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1050 <setlocale@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <nl_langinfo@plt>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
@CODESET = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @LC_ALL
%3 = call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @CODESET
%5 = call i8* @nl_langinfo(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%s\0A\00"
@CODESET = global i32 0
define i32 @main() {
%1 = load i32, i32* @LC_ALL
%2 = tail call i32 @setlocale(i32 %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @CODESET
%4 = tail call i8* @nl_langinfo(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ tfdval;

/* Variables and functions */
int read(int, int *, int);
int libtimechange_iterate(int fd) {
  uint64_t tfdval;
  int ret;
  ret = read(fd, &tfdval, sizeof(tfdval));
  if (ret < 0)
    return ret;
  return tfdval;
}


x86 assembly (clang, -O0):
<libtimechange_iterate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1144 <libtimechange_iterate+0x34>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114a <libtimechange_iterate+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libtimechange_iterate>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
test   %eax,%eax
js     1128 <libtimechange_iterate+0x18>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @libtimechange_iterate(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @read(i32 %0, i32* %2, i32 4)
%5 = icmp slt i32 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 %4, i32 %6
ret i32 %7
}
double cdflib_fifdmax1(double a, double b) {
  if (a < b) {
    return b;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<cdflib_fifdmax1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <cdflib_fifdmax1+0x31>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <cdflib_fifdmax1+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_fifdmax1>:
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cdflib_fifdmax1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %5
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @cdflib_fifdmax1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t clamp_s12(int16_t x) {
  if (x < -0x800)
    x = -0x800;
  else if (x > 0x7f0)
    x = 0x7f0;
  return x;
}


x86 assembly (clang, -O0):
<clamp_s12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xfffff800,-0x4(%rbp)
jge    1120 <clamp_s12+0x20>
movl   $0xfffff800,-0x4(%rbp)
jmp    1139 <clamp_s12+0x39>
cmpl   $0x7f0,-0x4(%rbp)
jle    1134 <clamp_s12+0x34>
movl   $0x7f0,-0x4(%rbp)
jmp    1139 <clamp_s12+0x39>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_s12>:
cmp    $0x7f0,%edi
mov    $0x7f0,%ecx
cmovl  %edi,%ecx
cmp    $0xfffff801,%ecx
mov    $0xfffff800,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp_s12(i32 %0) {
%2 = icmp slt i32 %0, 2032
%3 = select i1 %2, i32 %0, i32 2032
%4 = icmp sgt i32 %3, -2048
%5 = select i1 %4, i32 %3, i32 -2048
ret i32 %5
}
/* Variables and functions */
long double atanhl(long double);
long double coshl(long double);
long double __attribute__((no)) cosatanl_(long double x) {
  long double atg = atanhl(x);
  return coshl(atg) + atg;
}


x86 assembly (clang, -O0):
<cosatanl_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <atanhl@plt>
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <coshl@plt>
fldt   -0x20(%rbp)
faddp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosatanl_>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fstpt  (%rsp)
call   1040 <atanhl@plt>
fld    %st(0)
fstpt  0x1c(%rsp)
fstpt  (%rsp)
call   1030 <coshl@plt>
fldt   0x1c(%rsp)
faddp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @cosatanl_(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 @atanhl(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
%7 = call x86_fp80 @coshl(x86_fp80 %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = fadd x86_fp80 %7, %8
ret x86_fp80 %9
}

LLVM IR (-O2):
define x86_fp80 @cosatanl_(x86_fp80 %0) {
%2 = tail call x86_fp80 @atanhl(x86_fp80 %0)
%3 = tail call x86_fp80 @coshl(x86_fp80 %2)
%4 = fadd x86_fp80 %2, %3
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ logdata();
int main(int ac, char *av[]) {
  logdata();
  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 <logdata@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <logdata@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 (...) @logdata()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @logdata()
ret i32 0
}
/* Type definitions */
struct mnqtt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void msg_cb(struct mnqtt *mnqtt) { fprintf(stderr, "received message\n"); }


x86 assembly (clang, -O0):
<msg_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
lea    0xed4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_cb>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.mnqtt = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"received message\0A\00"
define void @msg_cb(%struct.mnqtt* %0) {
%2 = alloca %struct.mnqtt*
store %struct.mnqtt* %0, %struct.mnqtt** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.mnqtt = type { i32 }
@stderr = global i32 0
@.str = [18 x i8] c"received message\0A\00"
define void @msg_cb(%struct.mnqtt* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ConvertAddr(char *, void **);
void DefineSelf(char *addr) {
  ConvertAddr(addr, (void **)&addr);
  if (addr[0] == 127 && addr[3] == 1)
    ;
}


x86 assembly (clang, -O0):
<DefineSelf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <ConvertAddr@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7f,%eax
jne    114f <DefineSelf+0x3f>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x1,%eax
jne    114f <DefineSelf+0x3f>
jmp    114f <DefineSelf+0x3f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DefineSelf>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
call   1030 <ConvertAddr@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @DefineSelf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @ConvertAddr(i8* %0, i8** %2)
ret void
}
int test_imm_4Dint64_lowword_reg(long long val) {
  return ((val) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Dint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x4d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_4Dint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 77
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int setBit(int bitVector, int pos) {
  bitVector |= 1 << pos;
  return bitVector;
}


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
mov    %edi,%eax
bts    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @setBit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t swapword(const int32_t in) {
  return (((in >> 24) & 0xff) << 0) | (((in >> 16) & 0xff) << 8) |
         (((in >> 8) & 0xff) << 16) | (((in >> 0) & 0xff) << 24);
}


x86 assembly (clang, -O0):
<swapword>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
shl    $0x0,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapword>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @swapword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 24
%5 = and i32 %4, 255
%6 = shl i32 %5, 0
%7 = load i32, i32* %2
%8 = ashr i32 %7, 16
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = or i32 %6, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = shl i32 %14, 16
%16 = or i32 %11, %15
%17 = load i32, i32* %2
%18 = ashr i32 %17, 0
%19 = and i32 %18, 255
%20 = shl i32 %19, 24
%21 = or i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @swapword(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int after(unsigned long seq1, unsigned long seq2) {
  return (long)(seq1 - seq2) > 0;
}


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

x86 assembly (clang, -O2):
<after>:
sub    %rsi,%rdi
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i32 @after(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 = sub i64 %5, %6
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @after(i64 %0, i64 %1) {
%3 = sub i64 %0, %1
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ equation(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number;
  printf("Enter a number: ");
  scanf("%d", &number);
  if (number == 2) {
    printf("2 is the smallest prime number\n");
  }
  equation(number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    1171 <main+0x41>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <equation@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0x2,%edi
jne    1177 <main+0x37>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
call   1060 <equation@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [32 x i8] c"2 is the smallest prime number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %2
%11 = call i32 @equation(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [31 x i8] c"2 is the smallest prime number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* %1
br label %10
10: ; preds = %7, %0
%11 = phi i32 [ %9, %7 ], [ %5, %0 ]
%12 = call i32 @equation(i32 %11)
ret i32 0
}