xunge/DecIR huggingface dataset:
/* Variables and functions */
double lgamma(double);
double betaln(double r, double s) {
  double result;
  result = lgamma(r) + lgamma(s) - lgamma(r + s);
  return result;
}


x86 assembly (clang, -O0):
<betaln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <lgamma@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<betaln>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <lgamma@plt>
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <lgamma@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <lgamma@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @betaln(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = call double @lgamma(double %6)
%8 = load double, double* %4
%9 = call double @lgamma(double %8)
%10 = fadd double %7, %9
%11 = load double, double* %3
%12 = load double, double* %4
%13 = fadd double %11, %12
%14 = call double @lgamma(double %13)
%15 = fsub double %10, %14
store double %15, double* %5
%16 = load double, double* %5
ret double %16
}

LLVM IR (-O2):
define double @betaln(double %0, double %1) {
%3 = tail call double @lgamma(double %0)
%4 = tail call double @lgamma(double %1)
%5 = fadd double %3, %4
%6 = fadd double %0, %1
%7 = tail call double @lgamma(double %6)
%8 = fsub double %5, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ entab(char *);
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0) {
    entab(line);
    printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1183 <main+0x53>
lea    -0x3f0(%rbp),%rdi
call   1050 <entab@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1184 <main+0x54>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1050 <entab@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @entab(i8* %9)
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %4
13: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @entab(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint8_t u64_b6(uint64_t value) {
  return (uint8_t)((value & 0x00FF000000000000) >> 48);
}


x86 assembly (clang, -O0):
<u64_b6>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff000000000000,%rcx
and    %rcx,%rax
sar    $0x30,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u64_b6>:
movslq %edi,%rax
shr    $0x30,%rax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @u64_b6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 71776119061217280
%6 = ashr i64 %5, 48
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @u64_b6(i32 %0) {
%2 = sext i32 %0 to i64
%3 = lshr i64 %2, 48
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kore_cli_usage(int);
void cli_help(int argc, char **argv) { kore_cli_usage(1); }


x86 assembly (clang, -O0):
<cli_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <kore_cli_usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_help>:
mov    $0x1,%edi
jmp    1030 <kore_cli_usage@plt>

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

LLVM IR (-O2):
define void @cli_help(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @kore_cli_usage(i32 1)
ret void
}
int isBreak(int c) {
  switch (c) {
  case ';':
  case '(':
  case ')':
  case '\'':
  case ',':
  case '\t':
  case '\n':
  case '\v':
  case '\f':
  case '\r':
  case ' ':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isBreak>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     1165 <isBreak+0x65>
jmp    111e <isBreak+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     1165 <isBreak+0x65>
jmp    112f <isBreak+0x2f>
mov    -0xc(%rbp),%eax
add    $0xffffffd9,%eax
sub    $0x3,%eax
jb     1165 <isBreak+0x65>
jmp    1143 <isBreak+0x43>
mov    -0xc(%rbp),%eax
sub    $0x2c,%eax
je     1165 <isBreak+0x65>
jmp    1154 <isBreak+0x54>
mov    -0xc(%rbp),%eax
sub    $0x3b,%eax
jne    1171 <isBreak+0x71>
jmp    1165 <isBreak+0x65>
movl   $0x1,-0x4(%rbp)
jmp    1178 <isBreak+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBreak>:
cmp    $0x3b,%edi
ja     111d <isBreak+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x800138100003e00,%rdx
bt     %rcx,%rdx
jae    111d <isBreak+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isBreak(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 59, label %5
i32 40, label %5
i32 41, label %5
i32 39, label %5
i32 44, label %5
i32 9, label %5
i32 10, label %5
i32 11, label %5
i32 12, label %5
i32 13, label %5
i32 32, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @isBreak(i32 %0) {
switch i32 %0, label %2 [
i32 59, label %3
i32 40, label %3
i32 41, label %3
i32 39, label %3
i32 44, label %3
i32 9, label %3
i32 10, label %3
i32 11, label %3
i32 12, label %3
i32 13, label %3
i32 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
char *strncat(char *restrict __dest, const char *restrict __src,
              unsigned long int __len) {
  char *return_value___builtin___strncat_chk$1;
  return_value___builtin___strncat_chk$1 = __builtin___strncat_chk(
      __dest, __src, (unsigned int)__len, 18446744073709551615ul);
  return return_value___builtin___strncat_chk$1;
}


x86 assembly (clang, -O0):
<strncat>:
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),%rax
mov    %eax,%eax
mov    %eax,%edx
mov    $0xffffffffffffffff,%rcx
call   1030 <__strncat_chk@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @strncat(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = trunc i64 %10 to i32
%12 = zext i32 %11 to i64
%13 = call i8* @__strncat_chk(i8* %8, i8* %9, i64 %12, i64 -1)
store i8* %13, i8** %7
%14 = load i8*, i8** %7
ret i8* %14
}

LLVM IR (-O2):
define i8* @strncat(i8* noalias readnone returned %0, i8* noalias nocapture %1, i64 %2) {
ret i8* %0
}
/* Variables and functions */
float tan(float);
float func(float x) { return tan(x); }


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

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

LLVM IR (-O0):
define float @func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @tan(float %3)
ret float %4
}

LLVM IR (-O2):
define float @func(float %0) {
%2 = tail call float @tan(float %0)
ret float %2
}
void test_ar_2_ULONG(void *d, unsigned long n) {
  if ((0x7fffffffffffffffL * 2LU + 1) - 2 <= n &&
      n <= (0x7fffffffffffffffL * 2LU + 1) - 1)
    n = (0x7fffffffffffffffL * 2LU + 1) - 3;
  __builtin_memset(d, 0, n);
}


x86 assembly (clang, -O0):
<test_ar_2_ULONG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xfffffffffffffffd,%rax
cmp    -0x10(%rbp),%rax
ja     1144 <test_ar_2_ULONG+0x34>
cmpq   $0xfffffffffffffffe,-0x10(%rbp)
ja     1144 <test_ar_2_ULONG+0x34>
movq   $0xfffffffffffffffc,-0x10(%rbp)
ff
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ar_2_ULONG>:
lea    0x3(%rsi),%rax
cmp    $0x2,%rax
mov    $0xfffffffffffffffc,%rdx
cmovae %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @test_ar_2_ULONG(i8* nocapture writeonly %0, i64 %1) {
%3 = add i64 %1, 3
%4 = icmp ult i64 %3, 2
%5 = select i1 %4, i64 -4, i64 %1
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %5, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fprintf(stderr,
          "Usage: epochal [-sg] [-y|-Y yyyy] -f input-format [-o output-fmt] "
          "[file|-]\n"
          "  Pass data in via standard input. See strftime(3) for formats.\n");
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [140 x i8] c"Usage: epochal [-sg] [-y|-Y yyyy] -f input-format [-o output-fmt] [file|-]\0A Pass data in via standard input. See strftime(3) for formats.\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [140 x i8] c"Usage: epochal [-sg] [-y|-Y yyyy] -f input-format [-o output-fmt] [file|-]\0A Pass data in via standard input. See strftime(3) for formats.\0A\00"
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sqrOfSum(int);
int sumOfSqr(int);
int main(int argc, char const *argv[]) {
  printf("%d\n", sqrOfSum(100) - sumOfSqr(100));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1040 <sqrOfSum@plt>
mov    %eax,-0x14(%rbp)
mov    $0x64,%edi
call   1050 <sumOfSqr@plt>
mov    -0x14(%rbp),%esi
sub    %eax,%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1040 <sqrOfSum@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1050 <sumOfSqr@plt>
sub    %eax,%ebx
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @sqrOfSum(i32 100)
%7 = call i32 @sumOfSqr(i32 100)
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sqrOfSum(i32 100)
%4 = tail call i32 @sumOfSqr(i32 100)
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
void ff_hevc_put_hevc_pel_pixels12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels12_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Wow! So useful!\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [17 x i8] c"Wow! So useful!\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Wow! So useful!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ malloc_usable_size(char *);
int /*<<< orphan*/ memset(char *, char, int /*<<< orphan*/);
void wipe_buffer(char *buf) { memset(buf, '\0', malloc_usable_size(buf)); }


x86 assembly (clang, -O0):
<wipe_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc_usable_size@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wipe_buffer>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc_usable_size@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @wipe_buffer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @malloc_usable_size(i8* %4)
%6 = call i32 @memset(i8* %3, i8 signext 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @wipe_buffer(i8* %0) {
%2 = tail call i32 @malloc_usable_size(i8* %0)
%3 = tail call i32 @memset(i8* %0, i8 signext 0, i32 %2)
ret void
}
/* Variables and functions */
int norx_verify_tag(const unsigned char *tag1, const unsigned char *tag2) {
  unsigned acc = 0;
  size_t i;
  for (i = 0; i < ((((8 * 4)) + 7) / 8); ++i)
    acc |= tag1[i] ^ tag2[i];
  return (((acc - 1) >> 8) & 1) - 1;
}


x86 assembly (clang, -O0):
<norx_verify_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x4,-0x20(%rbp)
jae    1157 <norx_verify_tag+0x57>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111b <norx_verify_tag+0x1b>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
shr    $0x8,%eax
and    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<norx_verify_tag>:
mov    (%rsi),%eax
xor    (%rdi),%eax
movd   %eax,%xmm0
movdqa %xmm0,%xmm1
psrld  $0x10,%xmm1
por    %xmm0,%xmm1
movdqa %xmm1,%xmm0
psrlw  $0x8,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%eax
movzbl %al,%eax
add    $0xffffffff,%eax
shr    $0x8,%eax
and    $0x1,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @norx_verify_tag(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
store i64 0, i64* %6
br label %7
7: ; preds = %24, %2
%8 = load i64, i64* %6
%9 = icmp ult i64 %8, 4
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i8*, i8** %3
%12 = load i64, i64* %6
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %4
%17 = load i64, i64* %6
%18 = getelementptr inbounds i8, i8* %16, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %15, %20
%22 = load i32, i32* %5
%23 = or i32 %22, %21
store i32 %23, i32* %5
br label %24
24: ; preds = %10
%25 = load i64, i64* %6
%26 = add i64 %25, 1
store i64 %26, i64* %6
br label %7
27: ; preds = %7
%28 = load i32, i32* %5
%29 = sub i32 %28, 1
%30 = lshr i32 %29, 8
%31 = and i32 %30, 1
%32 = sub i32 %31, 1
ret i32 %32
}

LLVM IR (-O2):
define i32 @norx_verify_tag(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to <4 x i8>*
%4 = load <4 x i8>, <4 x i8>* %3
%5 = bitcast i8* %1 to <4 x i8>*
%6 = load <4 x i8>, <4 x i8>* %5
%7 = xor <4 x i8> %6, %4
%8 = call i8 @llvm.vector.reduce.or.v4i8(<4 x i8> %7)
%9 = zext i8 %8 to i32
%10 = add nuw nsw i32 %9, 511
%11 = lshr i32 %10, 8
%12 = and i32 %11, 1
%13 = add nsw i32 %12, -1
ret i32 %13
}
adr0adrx1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*((int *)10000000)) = (((int *)11111111)[x1]); }


x86 assembly (clang, -O0):
<adr0adrx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,4),%ecx
mov    $0x989680,%eax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adrx1_set>:
movslq %ecx,%rax
mov    0xa98ac7(,%rax,4),%eax
mov    %eax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %11
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %15
%17 = load i32, i32* %16
store i32 %17, i32* inttoptr (i64 10000000 to i32*)
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @adr0adrx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* inttoptr (i64 10000000 to i32*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Pl_Create_Choice_Point0(int /*<<< orphan*/ *);
void Pl_Defeasible_Open() { Pl_Create_Choice_Point0(NULL); }


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

x86 assembly (clang, -O2):
<Pl_Defeasible_Open>:
xor    %edi,%edi
jmp    1030 <Pl_Create_Choice_Point0@plt>

LLVM IR (-O0):
define void @Pl_Defeasible_Open() {
%1 = call i32 @Pl_Create_Choice_Point0(i32* null)
ret void
}

LLVM IR (-O2):
define void @Pl_Defeasible_Open() {
%1 = tail call i32 @Pl_Create_Choice_Point0(i32* null)
ret void
}
/* Variables and functions */
char const *out_get_errormsg();
const char *pmem_errormsg(void) { return out_get_errormsg(); }


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

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

LLVM IR (-O0):
define i8* @pmem_errormsg() {
%1 = call i8* (...) @out_get_errormsg()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pmem_errormsg() {
%1 = tail call i8* (...) @out_get_errormsg()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ TimerBaseValid(unsigned long);
void TimerIntDisable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(TimerBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000018))) &= ~(ulIntFlags);
}


x86 assembly (clang, -O0):
<TimerIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x18(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerIntDisable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <TimerBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x18(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerIntDisable(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 = call i32 @TimerBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = add i64 %10, 24
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @TimerIntDisable(i64 %0, i64 %1) {
%3 = tail call i32 @TimerBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = xor i64 %1, -1
%6 = add i64 %0, 24
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int LOCK_EX;
int LOCK_NB;
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
scalar_t__ flock(int /*<<< orphan*/, int);
int ftrylockfile(FILE *filehandle) {
  return flock(fileno(filehandle), LOCK_EX | LOCK_NB) == 0;
}


x86 assembly (clang, -O0):
<ftrylockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    0x2e89(%rip),%rax
or     (%rax),%esi
call   1040 <flock@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftrylockfile>:
push   %rax
call   1030 <fileno@plt>
mov    0x2ebb(%rip),%rcx
mov    0x2e9c(%rip),%rdx
mov    (%rdx),%esi
or     (%rcx),%esi
mov    %eax,%edi
call   1040 <flock@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
define i32 @ftrylockfile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fileno(i32* %3)
%5 = load i32, i32* @LOCK_EX
%6 = load i32, i32* @LOCK_NB
%7 = or i32 %5, %6
%8 = call i64 @flock(i32 %4, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
define i32 @ftrylockfile(i32* nocapture %0) {
%2 = tail call i32 @fileno(i32* %0)
%3 = load i32, i32* @LOCK_EX
%4 = load i32, i32* @LOCK_NB
%5 = or i32 %4, %3
%6 = tail call i64 @flock(i32 %2, i32 %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}
double add3(double *a, double *b, double fact) {
  double c;
  c = *a + *b + fact;
  return c;
}


x86 assembly (clang, -O0):
<add3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add3>:
movsd  (%rdi),%xmm1
addsd  (%rsi),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @add3(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = load double, double* %10
%12 = fadd double %9, %11
%13 = load double, double* %6
%14 = fadd double %12, %13
store double %14, double* %7
%15 = load double, double* %7
ret double %15
}

LLVM IR (-O2):
define double @add3(double* nocapture %0, double* nocapture %1, double %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fadd double %4, %5
%7 = fadd double %6, %2
ret double %7
}
/* Variables and functions */
char *ltoa_wp(long, char *, int, int /*<<< orphan*/, char);
char *ltoa(long val, char *buffer, int base) {
  return ltoa_wp(val, buffer, base, 0, ' ');
}


x86 assembly (clang, -O0):
<ltoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
mov    $0x20,%r8d
call   1030 <ltoa_wp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltoa>:
xor    %ecx,%ecx
mov    $0x20,%r8d
jmp    1030 <ltoa_wp@plt>

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

LLVM IR (-O2):
define i8* @ltoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @ltoa_wp(i64 %0, i8* %1, i32 %2, i32 0, i8 signext 32)
ret i8* %4
}
void foo461() {}


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

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

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

LLVM IR (-O2):
define void @foo461() {
ret void
}
int test_imm_21int8_mem(signed char *val) {
  return ((*val) & (0x21 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_21int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x21,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_21int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 33
%7 = icmp ne i32 %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_21int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 33
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_dec_l(void) { op_write1(0x2d); }


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

x86 assembly (clang, -O2):
<op_enc_dec_l>:
mov    $0x2d,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_dec_l() {
%1 = call i32 @op_write1(i32 45)
ret void
}

LLVM IR (-O2):
define void @op_enc_dec_l() {
%1 = tail call i32 @op_write1(i32 45)
ret void
}
vdpixl() {}


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

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

LLVM IR (-O0):
define i32 @vdpixl() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @vdpixl() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Bar(int, int, int, int);
void Foo(int a, int b, int c, int d) { Bar(a, b, c, d); }


x86 assembly (clang, -O0):
<Foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <Bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @Bar(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @Bar(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ipbus_detect_packet_header(uint32_t headerword) {
  uint32_t msnibble = headerword & 0xf0000000;
  uint32_t lsnibble = headerword & 0xf0;
  if (lsnibble == 0x20 && msnibble == 0xf0000000) {
    return 2;
  } else if (lsnibble != 0xf0 || msnibble != 0x20000000) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ipbus_detect_packet_header>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x20,-0x10(%rbp)
jne    1140 <ipbus_detect_packet_header+0x40>
cmpl   $0xf0000000,-0xc(%rbp)
jne    1140 <ipbus_detect_packet_header+0x40>
movl   $0x2,-0x4(%rbp)
jmp    1172 <ipbus_detect_packet_header+0x72>
cmpl   $0xf0,-0x10(%rbp)
jne    115a <ipbus_detect_packet_header+0x5a>
cmpl   $0x20000000,-0xc(%rbp)
je     1166 <ipbus_detect_packet_header+0x66>
movl   $0x0,-0x4(%rbp)
jmp    1172 <ipbus_detect_packet_header+0x72>
jmp    116b <ipbus_detect_packet_header+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipbus_detect_packet_header>:
mov    %edi,%eax
and    $0xf0,%eax
mov    %edi,%ecx
and    $0xf00000f0,%ecx
xor    %edx,%edx
cmp    $0x200000f0,%ecx
sete   %dl
cmp    $0x20,%eax
mov    $0x2,%eax
cmovne %edx,%eax
cmp    $0xf0000000,%edi
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @ipbus_detect_packet_header(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 = and i32 %6, -268435456
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = and i32 %8, 240
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 32
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, -268435456
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 2, i32* %2
br label %25
16: ; preds = %12, %1
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 240
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 536870912
br i1 %21, label %22, label %23
22: ; preds = %19, %16
store i32 0, i32* %2
br label %25
23: ; preds = %19
br label %24
24: ; preds = %23
store i32 1, i32* %2
br label %25
25: ; preds = %24, %22, %15
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @ipbus_detect_packet_header(i32 %0) {
%2 = and i32 %0, 240
%3 = icmp eq i32 %2, 32
%4 = icmp ugt i32 %0, -268435457
%5 = and i1 %4, %3
%6 = and i32 %0, -268435216
%7 = icmp eq i32 %6, 536871152
%8 = zext i1 %7 to i32
%9 = select i1 %5, i32 2, i32 %8
ret i32 %9
}
void destroy_rcu_head_on_stack(struct rcu_head *head) {}


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

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

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

LLVM IR (-O2):
%struct.rcu_head = type opaque
define void @destroy_rcu_head_on_stack(%struct.rcu_head* nocapture %0) {
ret void
}
double eval_horn_quart_deriv(const double *c, const double x) {
  return (2.0 * (2.0 * x * x + c[2]) * x + c[1]);
}


x86 assembly (clang, -O0):
<eval_horn_quart_deriv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  0xeeb(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xec8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_horn_quart_deriv>:
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  0x10(%rdi),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
addsd  0x8(%rdi),%xmm0
ret

LLVM IR (-O0):
define double @eval_horn_quart_deriv(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fmul double 2.000000e+00, %5
%7 = load double, double* %4
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 2
%10 = load double, double* %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
%12 = fmul double 2.000000e+00, %11
%13 = load double, double* %4
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = call double @llvm.fmuladd.f64(double %12, double %13, double %16)
ret double %17
}

LLVM IR (-O2):
define double @eval_horn_quart_deriv(double* nocapture %0, double %1) {
%3 = fmul double %1, 2.000000e+00
%4 = getelementptr inbounds double, double* %0, i64 2
%5 = load double, double* %4
%6 = tail call double @llvm.fmuladd.f64(double %3, double %1, double %5)
%7 = fmul double %6, 2.000000e+00
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %9)
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ asin(double);
int /*<<< orphan*/ asinf(float);
int /*<<< orphan*/ asinl(long double);
void uninitvar_asin(void) {
  float f;
  (void)asinf(f);
  double d;
  (void)asin(d);
  long double ld;
  (void)asinl(ld);
}


x86 assembly (clang, -O0):
<uninitvar_asin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1050 <asinf@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <asin@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <asinl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_asin>:
sub    $0x18,%rsp
call   1050 <asinf@plt>
call   1030 <asin@plt>
call   1040 <asinl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_asin() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @asinf(float %4)
%6 = load double, double* %2
%7 = call i32 @asin(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @asinl(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_asin() {
%1 = tail call i32 @asinf(float undef)
%2 = tail call i32 @asin(double undef)
%3 = tail call i32 @asinl(x86_fp80 undef)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t sublp4095(uint64_t x) { return x - 4095; }


x86 assembly (clang, -O0):
<sublp4095>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0xfff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sublp4095>:
lea    -0xfff(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @sublp4095(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 4095
ret i64 %4
}

LLVM IR (-O2):
define i64 @sublp4095(i64 %0) {
%2 = add nsw i64 %0, -4095
ret i64 %2
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char const *, int);
void imv_ipc_path(char *buf, size_t len, int pid) {
  const char *base = getenv("XDG_RUNTIME_DIR");
  if (!base) {
    base = "/tmp";
  }
  snprintf(buf, len, "%s/imv-%d.sock", base, pid);
}


x86 assembly (clang, -O0):
<imv_ipc_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <imv_ipc_path+0x39>
lea    0xebb(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea5(%rip),%rdx
call   1040 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imv_ipc_path>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0xecc(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xecd(%rip),%rcx
cmovne %rax,%rcx
lea    0xec7(%rip),%rdx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <snprintf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"XDG_RUNTIME_DIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [15 x i8] c"%s/imv-%d.sock\00"
define void @imv_ipc_path(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%8 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %7
%9 = load i8*, i8** %7
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %7
br label %12
12: ; preds = %11, %3
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = load i8*, i8** %7
%16 = load i32, i32* %6
%17 = call i32 @snprintf(i8* %13, i64 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"XDG_RUNTIME_DIR\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [15 x i8] c"%s/imv-%d.sock\00"
define void @imv_ipc_path(i8* %0, i64 %1, i32 %2) {
%4 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %4
%7 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 %2)
ret void
}
void putle32(unsigned char *p, unsigned int n) {
  p[0] = n;
  p[1] = n >> 8;
  p[2] = n >> 16;
  p[3] = n >> 24;
}


x86 assembly (clang, -O0):
<putle32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putle32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @putle32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %11, i8* %13
%14 = load i32, i32* %4
%15 = lshr i32 %14, 16
%16 = trunc i32 %15 to i8
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 2
store i8 %16, i8* %18
%19 = load i32, i32* %4
%20 = lshr i32 %19, 24
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 3
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @putle32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("foo\a");
  printf("bar\b");
  printf("baz\z");
  printf("hello, world\t");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
lea    0xec5(%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 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"foo\07\00"
@.str.1 = [5 x i8] c"bar\08\00"
@.str.2 = [5 x i8] c"bazz\00"
@.str.3 = [14 x i8] c"hello, world\09\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"foo\07\00"
@.str.1 = [5 x i8] c"bar\08\00"
@.str.2 = [5 x i8] c"bazz\00"
@.str.3 = [14 x i8] c"hello, world\09\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
int /*<<< orphan*/ namco_setParams50XX(int /*<<< orphan*/, int /*<<< orphan*/);
void namco_setParams50XX_SetN163(uint16_t addr, uint8_t val) {
  namcoSetN163(addr);
  namco_setParams50XX(addr, val);
}


x86 assembly (clang, -O0):
<namco_setParams50XX_SetN163>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <namcoSetN163@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <namco_setParams50XX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<namco_setParams50XX_SetN163>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <namcoSetN163@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <namco_setParams50XX@plt>

LLVM IR (-O0):
define void @namco_setParams50XX_SetN163(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 = call i32 @namcoSetN163(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @namco_setParams50XX(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @namco_setParams50XX_SetN163(i32 %0, i32 %1) {
%3 = tail call i32 @namcoSetN163(i32 %0)
%4 = tail call i32 @namco_setParams50XX(i32 %0, i32 %1)
ret void
}
void ext_exp2exp_eol() {}


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

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

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

LLVM IR (-O2):
define void @ext_exp2exp_eol() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_comigt_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_comigt_ss(__m128 A, __m128 B) { return _mm_comigt_ss(A, B); }


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

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

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

LLVM IR (-O2):
define i32 @test_mm_comigt_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_comigt_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void __attribute__((noreturnx)) do_exit(void) { exit(0); }


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<do_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @do_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @do_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f7();
void f6() { f7(); }


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

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

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

LLVM IR (-O2):
define void @f6() {
%1 = tail call i32 (...) @f7()
ret void
}