xunge/DecIR huggingface dataset:
void vector_add3(double a[3], double b[3], double m[3]) {
  for (int i = 0; i < 3; ++i) {
    m[i] = a[i] + b[i];
  }
}


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

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

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

LLVM IR (-O2):
define void @vector_add3(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fadd double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fadd double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ str;

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *format_timestamp(time_t timestamp) {
  static char str[32];
  struct tm *ptm = localtime(&timestamp);
  strftime(str, sizeof(str), "%b %d, %Y at %H:%M", ptm);
  return str;
}


x86 assembly (clang, -O0):
<format_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2efd(%rip),%rdi
mov    $0x20,%esi
lea    0xeb1(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_timestamp>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2f06(%rip),%rbx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@format_timestamp.str = internal global [32 x i8] zeroinitializer
@.str = [19 x i8] c"%b %d, %Y at %H:%M\00"
define i8* @format_timestamp(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store i32 %0, i32* %2
%4 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %4, %struct.tm** %3
%5 = load %struct.tm*, %struct.tm** %3
%6 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @format_timestamp.str, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @format_timestamp.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@format_timestamp.str = internal global [32 x i8] zeroinitializer
@.str = [19 x i8] c"%b %d, %Y at %H:%M\00"
define i8* @format_timestamp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call %struct.tm* @localtime(i32* %2)
%4 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @format_timestamp.str, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @format_timestamp.str, i64 0, i64 0)
}
void kol_paint_end() { asm("int $0x40" ::"a"(12), "b"(2)); }


x86 assembly (clang, -O0):
<kol_paint_end>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_paint_end>:
push   %rbx
mov    $0xc,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_paint_end() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 12, i32 2)
ret void
}
int is_fileHidden(char *suspect) {
  if (suspect[0] == '.')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_fileHidden>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1124 <is_fileHidden+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <is_fileHidden+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_fileHidden>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_fileHidden(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 46
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_fileHidden(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
%4 = zext i1 %3 to i32
ret i32 %4
}
int reverse_order(int a, int b) { return b - a > 0; }


x86 assembly (clang, -O0):
<reverse_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_order>:
xor    %eax,%eax
cmp    %edi,%esi
setg   %al
ret

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

LLVM IR (-O2):
define i32 @reverse_order(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int TE3D_Console_SetPosition(int /*<<< orphan*/, int /*<<< orphan*/);
int TE3D_Console_ResetPosition() { return TE3D_Console_SetPosition(0, 0); }


x86 assembly (clang, -O0):
<TE3D_Console_ResetPosition>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <TE3D_Console_SetPosition@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TE3D_Console_ResetPosition>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <TE3D_Console_SetPosition@plt>

LLVM IR (-O0):
define i32 @TE3D_Console_ResetPosition() {
%1 = call i32 @TE3D_Console_SetPosition(i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @TE3D_Console_ResetPosition() {
%1 = tail call i32 @TE3D_Console_SetPosition(i32 0, i32 0)
ret i32 %1
}
int wg_log_umask(void *db, int cmask) {
  int prev = 0;
  return prev;
}


x86 assembly (clang, -O0):
<wg_log_umask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @wg_log_umask(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
void fvpp(void **v) {}


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

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

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

LLVM IR (-O2):
define void @fvpp(i8** nocapture %0) {
ret void
}
void main(void) {
  int x = 0;
  for (;; ++x) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1110 <main+0x10>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>

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

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

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *talloc_named_const(void const *, size_t, char const *);
void *_talloc_memdup(const void *t, const void *p, size_t size,
                     const char *name) {
  void *newp = talloc_named_const(t, size, name);
  if (newp) {
    memcpy(newp, p, size);
  }
  return newp;
}


x86 assembly (clang, -O0):
<_talloc_memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <talloc_named_const@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1169 <_talloc_memdup+0x49>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_talloc_memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdx,%rsi
mov    %rcx,%rdx
call   1030 <talloc_named_const@plt>
mov    %rax,%rbx
test   %rax,%rax
je     114c <_talloc_memdup+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @_talloc_memdup(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = tail call i8* @talloc_named_const(i8* %0, i64 %2, i8* %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @memcpy(i8* %5, i8* %1, i64 %2)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
void test_wide(void) {}


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

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

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

LLVM IR (-O2):
define void @test_wide() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
void locAsIntegerCasts(void *p) {
  int x = (int)p;
  clang_analyzer_eval(++x < 10);
}


x86 assembly (clang, -O0):
<locAsIntegerCasts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<locAsIntegerCasts>:
xor    %eax,%eax
cmp    $0x9,%edi
setl   %al
mov    %eax,%edi
jmp    1030 <clang_analyzer_eval@plt>

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

LLVM IR (-O2):
define void @locAsIntegerCasts(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp slt i32 %3, 9
%5 = zext i1 %4 to i32
%6 = tail call i32 @clang_analyzer_eval(i32 %5)
ret void
}
double doubleMultiply(double a, double b) { return a * b; }


x86 assembly (clang, -O0):
<doubleMultiply>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleMultiply>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @doubleMultiply(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @doubleMultiply(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int doerror(char *, int);
int IndexError(char *fnName) { return doerror(fnName, -3); }


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

x86 assembly (clang, -O2):
<IndexError>:
mov    $0xfffffffd,%esi
jmp    1030 <doerror@plt>

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

LLVM IR (-O2):
define i32 @IndexError(i8* %0) {
%2 = tail call i32 @doerror(i8* %0, i32 -3)
ret i32 %2
}
/* Type definitions */
struct iovec {
  size_t iov_len;
  void *iov_base;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct iovec *, int, int);
struct iovec __evConsIovec(void *buf, size_t cnt) {
  struct iovec ret;
  memset(&ret, 0xf5, sizeof ret);
  ret.iov_base = buf;
  ret.iov_len = cnt;
  return (ret);
}


x86 assembly (clang, -O0):
<__evConsIovec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0xf5,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__evConsIovec>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x8(%rsp),%rdi
mov    $0xf5,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.iovec = type { i64, i8* }
define { i64, i8* } @__evConsIovec(i8* %0, i64 %1) {
%3 = alloca %struct.iovec
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = call i32 @memset(%struct.iovec* %3, i32 245, i32 16)
%7 = load i8*, i8** %4
%8 = getelementptr inbounds %struct.iovec, %struct.iovec* %3, i32 0, i32 1
store i8* %7, i8** %8
%9 = load i64, i64* %5
%10 = getelementptr inbounds %struct.iovec, %struct.iovec* %3, i32 0, i32 0
store i64 %9, i64* %10
%11 = bitcast %struct.iovec* %3 to { i64, i8* }*
%12 = load { i64, i8* }, { i64, i8* }* %11
ret { i64, i8* } %12
}

LLVM IR (-O2):
%struct.iovec = type { i64, i8* }
define { i64, i8* } @__evConsIovec(i8* %0, i64 %1) {
%3 = alloca %struct.iovec
%4 = call i32 @memset(%struct.iovec* %3, i32 245, i32 16)
%5 = insertvalue { i64, i8* } poison, i64 %1, 0
%6 = insertvalue { i64, i8* } %5, i8* %0, 1
ret { i64, i8* } %6
}
int test_imm_85uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x85 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_85uint64_highword_mem>:
testb  $0x85,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 571230650368
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ puts(char *);
char *str_rev(char *, char *);
int main() {
  char s[110], str[110], *p;
  gets(s);
  p = str_rev(str, s);
  puts(p);
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
call   1050 <gets@plt>
lea    -0xf0(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <str_rev@plt>
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rdi
call   1040 <puts@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <str_rev@plt>
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [110 x i8]
%3 = alloca [110 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = getelementptr inbounds [110 x i8], [110 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [110 x i8], [110 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [110 x i8], [110 x i8]* %2, i64 0, i64 0
%9 = call i8* @str_rev(i8* %7, i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @puts(i8* %10)
%12 = getelementptr inbounds [110 x i8], [110 x i8]* %3, i64 0, i64 0
%13 = call i32 @puts(i8* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [110 x i8]
%2 = alloca [110 x i8]
%3 = getelementptr inbounds [110 x i8], [110 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [110 x i8], [110 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
%6 = call i8* @str_rev(i8* %4, i8* %3)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
%8 = call i32 @puts(i8* %4)
ret i32 0
}
void XDefaultVisualOfScreen() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ buffer_destroy(struct buffer *);
int /*<<< orphan*/ free(struct buffer *);
void buffer_delete(struct buffer *__restrict buf) {
  buffer_destroy(buf);
  free(buf);
}


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

x86 assembly (clang, -O2):
<buffer_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <buffer_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_delete(%struct.buffer* noalias %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = call i32 @buffer_destroy(%struct.buffer* %3)
%5 = load %struct.buffer*, %struct.buffer** %2
%6 = call i32 @free(%struct.buffer* %5)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_delete(%struct.buffer* noalias %0) {
%2 = tail call i32 @buffer_destroy(%struct.buffer* %0)
%3 = tail call i32 @free(%struct.buffer* %0)
ret void
}
void update_key(void **heap, int index, int new_val) {
  if (new_val < *(int *)heap[index])
    *(int *)heap[index] = new_val;
}


x86 assembly (clang, -O0):
<update_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
mov    (%rcx,%rdx,8),%rcx
cmp    (%rcx),%eax
jge    1136 <update_key+0x36>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_key>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
cmp    %edx,(%rax)
jle    110d <update_key+0xd>
mov    %edx,(%rax)
ret

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

LLVM IR (-O2):
define void @update_key(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = bitcast i8** %5 to i32**
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, %2
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 %2, i32* %7
br label %11
11: ; preds = %10, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ printf(char *);
void *alloc(size_t size) {
  void *new_mem;
  new_mem = malloc(size);
  if (new_mem == NULL) {
    printf("Out of memory!\en");
    exit(1);
  }
  return new_mem;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <alloc+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <alloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Out of memory!\1Bn\00"
define i8* @alloc(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 eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"Out of memory!\1Bn\00"
define noalias i8* @alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
const char *hocr_get_version_string() { return "0.12"; }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"0.12\00"
define i8* @hocr_get_version_string() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void outportb(unsigned short int port, unsigned char value) {
  asm volatile("outb %b0,%w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outportb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_open(char *, int);
int /*<<< orphan*/ my_fdputchar(char, int);
int /*<<< orphan*/ my_fdputstr(char *, int);
void error_cmd(char *cmd, int fd, int type) {
  if (type != -2) {
    my_fdputstr(cmd, fd);
    my_fdputstr(": command not found", fd);
    my_fdputchar('\n', fd);
  } else if (type == -2)
    error_open(cmd, 2);
}


x86 assembly (clang, -O0):
<error_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xfffffffe,-0x10(%rbp)
je     1179 <error_cmd+0x49>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <my_fdputstr@plt>
mov    -0xc(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <my_fdputstr@plt>
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1050 <my_fdputchar@plt>
jmp    1196 <error_cmd+0x66>
cmpl   $0xfffffffe,-0x10(%rbp)
jne    1191 <error_cmd+0x61>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <error_open@plt>
jmp    1196 <error_cmd+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_cmd>:
cmp    $0xfffffffe,%edx
jne    113f <error_cmd+0xf>
mov    $0x2,%esi
jmp    1040 <error_open@plt>
push   %rbx
mov    %esi,%ebx
call   1030 <my_fdputstr@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
call   1030 <my_fdputstr@plt>
mov    $0xa,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1050 <my_fdputchar@plt>

LLVM IR (-O0):
@.str = [20 x i8] c": command not found\00"
define void @error_cmd(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, -2
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @my_fdputstr(i8* %10, i32 %11)
%13 = load i32, i32* %5
%14 = call i32 @my_fdputstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @my_fdputchar(i8 signext 10, i32 %15)
br label %24
17: ; preds = %3
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, -2
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i8*, i8** %4
%22 = call i32 @error_open(i8* %21, i32 2)
br label %23
23: ; preds = %20, %17
br label %24
24: ; preds = %23, %9
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c": command not found\00"
define void @error_cmd(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, -2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 @my_fdputstr(i8* %0, i32 %1)
%7 = tail call i32 @my_fdputstr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = tail call i32 @my_fdputchar(i8 signext 10, i32 %1)
br label %11
9: ; preds = %3
%10 = tail call i32 @error_open(i8* %0, i32 2)
br label %11
11: ; preds = %9, %5
ret void
}
signed long int read(signed int __fd, void *__buf, unsigned long int __nbytes) {
  signed long int return_value___read_chk$1;
  signed long int return_value___read_chk_warn$2;
  signed long int return_value___read_alias$3;
  return_value___read_alias$3 = __read_alias(__fd, __buf, __nbytes);
  return return_value___read_alias$3;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <__read_alias@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @__read_alias to i32 (i32, i8*, i64, ...)*)(i32 %10, i8* %11, i64 %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @__read_alias to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %1, i64 %2)
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, unsigned int,
                      int /*<<< orphan*/);
unsigned int fb_sync_read(unsigned int offset, void *buffer,
                          unsigned int length) {
  return sys_call(0x11, offset, (unsigned int)buffer, length, 0);
}


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

x86 assembly (clang, -O2):
<fb_sync_read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x11,%edi
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @fb_sync_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i32, i32* %6
%11 = call i32 @sys_call(i32 17, i32 %7, i32 %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fb_sync_read(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @sys_call(i32 17, i32 %0, i32 %5, i32 %2, i32 0)
ret i32 %6
}
unsigned short int f85(unsigned short int x, unsigned int y) {
  return (x << (8 * 2 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f85>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f85>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f85(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 16, %7
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = add nsw i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f85(i16 zeroext %0, i32 %1) {
%3 = zext i16 %0 to i32
%4 = sub i32 16, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i16
ret i16 %8
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_103(void) {
  if (*(uint32_t *)0x10000130ul == 0x8ul) {
    if (*(uint32_t *)0x10000134ul == 0x0ul) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_103>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1139 <errata_103+0x39>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_103+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1140 <errata_103+0x40>
jmp    1139 <errata_103+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_103>:
cmpl   $0x8,0x10000130
08
jne    1114 <errata_103+0x14>
cmpl   $0x0,0x10000134
je     1117 <errata_103+0x17>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @errata_103() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ exp(double);
double pow(scalar_t__, double);
double g(double x) { return pow((1 + exp(-x)), -1.0); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %rax,%rdi
add    $0x1,%rdi
movsd  0xea3(%rip),%xmm0
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
xorps  0xed8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%rdi
movsd  0xed7(%rip),%xmm0
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i64 @exp(double %4)
%6 = add nsw i64 1, %5
%7 = call double @pow(i64 %6, double -1.000000e+00)
ret double %7
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = fneg double %0
%3 = tail call i64 @exp(double %2)
%4 = add nsw i64 %3, 1
%5 = tail call double @pow(i64 %4, double -1.000000e+00)
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
scalar_t__ strlen(char *);
void dump_string(char *s) {
  if ((s == NULL) || (strlen(s) == 0))
    fprintf(stdout, "(null)\n");
  else
    fprintf(stdout, ">>%s<<\n", s);
}


x86 assembly (clang, -O0):
<dump_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114a <dump_string+0x2a>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1166 <dump_string+0x46>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1181 <dump_string+0x61>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_string>:
test   %rdi,%rdi
je     1134 <dump_string+0x24>
mov    %rdi,%rdx
cmpb   $0x0,(%rdi)
je     1134 <dump_string+0x24>
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
lea    0xedb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [8 x i8] c"(null)\0A\00"
@.str.1 = [8 x i8] c">>%s<<\0A\00"
define void @dump_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5, %1
%10 = load i32, i32* @stdout
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %16
12: ; preds = %5
%13 = load i32, i32* @stdout
%14 = load i8*, i8** %2
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [8 x i8] c"(null)\0A\00"
@.str.1 = [8 x i8] c">>%s<<\0A\00"
define void @dump_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3, %1
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
9: ; preds = %3
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %9, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Show_library(int /*<<< orphan*/);
int /*<<< orphan*/ triList(int);
void IF_show_libdev(void) { Show_library(triList(16)); }


x86 assembly (clang, -O0):
<IF_show_libdev>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1040 <triList@plt>
mov    %eax,%edi
call   1030 <Show_library@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IF_show_libdev>:
push   %rax
mov    $0x10,%edi
call   1040 <triList@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <Show_library@plt>

LLVM IR (-O0):
define void @IF_show_libdev() {
%1 = call i32 @triList(i32 16)
%2 = call i32 @Show_library(i32 %1)
ret void
}

LLVM IR (-O2):
define void @IF_show_libdev() {
%1 = tail call i32 @triList(i32 16)
%2 = tail call i32 @Show_library(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double random();
void Gen_matrix(double A[], int n) {
  int j;
  for (j = 0; j < n; j++)
    A[j] = random() / ((double)RAND_MAX);
}


x86 assembly (clang, -O0):
<Gen_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <Gen_matrix+0x54>
mov    $0x0,%al
call   1030 <random@plt>
mov    0x2ea8(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <Gen_matrix+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Gen_matrix>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1152 <Gen_matrix+0x42>
mov    %rdi,%r14
mov    %esi,%r12d
mov    0x2ebf(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <random@plt>
xorps  %xmm1,%xmm1
cvtsi2sdq (%r15),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <Gen_matrix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define void @Gen_matrix(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = call double (...) @random()
%12 = load i64, i64* @RAND_MAX
%13 = sitofp i64 %12 to double
%14 = fdiv double %11, %13
%15 = load double*, double** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
store double %14, double* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define void @Gen_matrix(double* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call double (...) @random()
%9 = load i64, i64* @RAND_MAX
%10 = sitofp i64 %9 to double
%11 = fdiv double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 %7
store double %11, double* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ size;

/* Variables and functions */
int /*<<< orphan*/ memcpy(long *, unsigned char const *, int);
long unpackValueLong(unsigned char const **data) {
  long size;
  memcpy(&size, *data, sizeof(size));
  *data += sizeof(size);
  return size;
}


x86 assembly (clang, -O0):
<unpackValueLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    -0x10(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpackValueLong>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rsi
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
addq   $0x8,(%rbx)
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @unpackValueLong(i8** nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i8*, i8** %0
%5 = call i32 @memcpy(i64* %2, i8* %4, i32 8)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 8
store i8* %7, i8** %0
%8 = load i64, i64* %2
ret i64 %8
}
/* Variables and functions */
int _stricoll(char const *, char const *);
int stricoll(const char *s1, const char *s2) { return _stricoll(s1, s2); }


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

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

LLVM IR (-O0):
define i32 @stricoll(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** %4
%7 = call i32 @_stricoll(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @stricoll(i8* %0, i8* %1) {
%3 = tail call i32 @_stricoll(i8* %0, i8* %1)
ret i32 %3
}
void b43_leds_unregister(struct b43_wl *wl) {}


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

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

LLVM IR (-O0):
%struct.b43_wl = type opaque
define void @b43_leds_unregister(%struct.b43_wl* %0) {
%2 = alloca %struct.b43_wl*
store %struct.b43_wl* %0, %struct.b43_wl** %2
ret void
}

LLVM IR (-O2):
%struct.b43_wl = type opaque
define void @b43_leds_unregister(%struct.b43_wl* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, int);
void sigquit_handler(int signum) { error("SIGQUIT received\n", 23); }


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

x86 assembly (clang, -O2):
<sigquit_handler>:
lea    0xee9(%rip),%rdi
mov    $0x17,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"SIGQUIT received\0A\00"
define void @sigquit_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 23)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"SIGQUIT received\0A\00"
define void @sigquit_handler(i32 %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 23)
ret void
}
void dump_dpb() {}


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

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

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

LLVM IR (-O2):
define void @dump_dpb() {
ret void
}
/* Variables and functions */
unsigned int gettick_real();
unsigned int gettick(void) { return gettick_real(); }


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

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

LLVM IR (-O0):
define i32 @gettick() {
%1 = call i32 (...) @gettick_real()
ret i32 %1
}

LLVM IR (-O2):
define i32 @gettick() {
%1 = tail call i32 (...) @gettick_real()
ret i32 %1
}
void test_two(int x, int y) {
#pragma omp parallel for
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}