xunge/DecIR huggingface dataset:
int __attribute__((noclone, no)) int_value(void) {
  extern int rand();
  return rand();
}


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

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

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

LLVM IR (-O2):
define i32 @int_value() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void illparams(const char *funcname) {
  fprintf(stderr, "%s: illegal Parameters\n", funcname);
}


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

x86 assembly (clang, -O2):
<illparams>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"%s: illegal Parameters\0A\00"
define void @illparams(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"%s: illegal Parameters\0A\00"
define void @illparams(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct fi_provider {
  int dummy;
};

/* Variables and functions */
int fi_param_get(struct fi_provider *, char const *, char **);
int fi_param_get_str(struct fi_provider *provider, const char *param_name,
                     char **value) {
  return fi_param_get(provider, param_name, value);
}


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

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

LLVM IR (-O0):
%struct.fi_provider = type { i32 }
define i32 @fi_param_get_str(%struct.fi_provider* %0, i8* %1, i8** %2) {
%4 = alloca %struct.fi_provider*
%5 = alloca i8*
%6 = alloca i8**
store %struct.fi_provider* %0, %struct.fi_provider** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load %struct.fi_provider*, %struct.fi_provider** %4
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = call i32 @fi_param_get(%struct.fi_provider* %7, i8* %8, i8** %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.fi_provider = type { i32 }
define i32 @fi_param_get_str(%struct.fi_provider* %0, i8* %1, i8** %2) {
%4 = tail call i32 @fi_param_get(%struct.fi_provider* %0, i8* %1, i8** %2)
ret i32 %4
}
int rangeBitwiseAnd0(int m, int n) {
  int count = 0;
  while (m != n) {
    m >>= 1;
    n >>= 1;
    count++;
  }
  return m << count;
}


x86 assembly (clang, -O0):
<rangeBitwiseAnd0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113d <rangeBitwiseAnd0+0x3d>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <rangeBitwiseAnd0+0x11>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeBitwiseAnd0>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    %esi,%edi
je     111b <rangeBitwiseAnd0+0x1b>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
sar    %eax
sar    %esi
add    $0x1,%ecx
cmp    %esi,%eax
jne    1110 <rangeBitwiseAnd0+0x10>
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @rangeBitwiseAnd0(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %9, %4 ], [ %1, %2 ]
%7 = phi i32 [ %8, %4 ], [ %0, %2 ]
%8 = ashr i32 %7, 1
%9 = ashr i32 %6, 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %8, %9
br i1 %11, label %12, label %4
12: ; preds = %4, %2
%13 = phi i32 [ %0, %2 ], [ %8, %4 ]
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
%15 = shl i32 %13, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, unsigned int *);
main() {
  unsigned int age;
  long totBeats = 0;
  printf("Please input your age:\n");
  scanf("%d", &age);
  totBeats = (long)(age * 365 * 24 * 60 * 75);
  printf("Your heart has beat about %lu times in your lifetime!", totBeats);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x16d,-0x4(%rbp),%eax
imul   $0x18,%eax,%eax
imul   $0x3c,%eax,%eax
imul   $0x4b,%eax,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf01(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
imul   $0x2598060,0x4(%rsp),%esi
02
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Please input your age:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [54 x i8] c"Your heart has beat about %lu times in your lifetime!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i64 0, i64* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul i32 %5, 365
%7 = mul i32 %6, 24
%8 = mul i32 %7, 60
%9 = mul i32 %8, 75
%10 = zext i32 %9 to i64
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i64 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [54 x i8] c"Your heart has beat about %lu times in your lifetime!\00"
@str = [23 x i8] c"Please input your age:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = mul i32 %5, 39420000
%7 = zext i32 %6 to i64
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i64 %7)
ret i32 0
}
int f5(float x) { return x == __builtin_inf(); }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @f5(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fcmp oeq double %4, 0x7FF0000000000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f5(float %0) {
%2 = fcmp oeq float %0, 0x7FF0000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
int quicktime_quantize32(int number) {
  if (number && (number % 32)) {
    number += 32 - (number % 32);
  }
  return number;
}


x86 assembly (clang, -O0):
<quicktime_quantize32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113d <quicktime_quantize32+0x3d>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113d <quicktime_quantize32+0x3d>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    $0x20,%eax
sub    %edx,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicktime_quantize32>:
test   %edi,%edi
je     111d <quicktime_quantize32+0x1d>
mov    %edi,%eax
lea    0x1f(%rax),%edx
test   %edi,%edi
cmovns %edi,%edx
and    $0xffffffe0,%edx
mov    %edi,%ecx
sub    %edx,%ecx
je     111c <quicktime_quantize32+0x1c>
sub    %ecx,%eax
add    $0x20,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @quicktime_quantize32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i32, i32* %2
%7 = srem i32 %6, 32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %2
%11 = srem i32 %10, 32
%12 = sub nsw i32 32, %11
%13 = load i32, i32* %2
%14 = add nsw i32 %13, %12
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %5, %1
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @quicktime_quantize32(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = srem i32 %0, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = add i32 %0, 32
%8 = sub i32 %7, %4
br label %9
9: ; preds = %6, %3, %1
%10 = phi i32 [ %8, %6 ], [ %0, %3 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void pline(int line, int *linep, int *col, int list) {
  if (list)
    return;
  while (*linep < line) {
    putchar('\n');
    (*linep)++;
  }
  *col = 0;
}


x86 assembly (clang, -O0):
<pline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1135 <pline+0x25>
jmp    116d <pline+0x5d>
jmp    113a <pline+0x2a>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jge    1163 <pline+0x53>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    113a <pline+0x2a>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pline>:
test   %ecx,%ecx
je     1115 <pline+0x5>
ret
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    %edi,(%rsi)
jge    1145 <pline+0x35>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    (%rbx),%eax
add    $0x1,%eax
mov    %eax,(%rbx)
cmp    %ebp,%eax
jl     1130 <pline+0x20>
movl   $0x0,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @pline(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* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
br label %25
12: ; preds = %4
br label %13
13: ; preds = %18, %12
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %13
%19 = call i32 @putchar(i8 signext 10)
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = add nsw i32 %21, 1
store i32 %22, i32* %20
br label %13
23: ; preds = %13
%24 = load i32*, i32** %7
store i32 0, i32* %24
br label %25
25: ; preds = %23, %11
ret void
}

LLVM IR (-O2):
define void @pline(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, %0
br i1 %8, label %9, label %14
9: ; preds = %6, %9
%10 = tail call i32 @putchar(i8 signext 10)
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
%13 = icmp slt i32 %12, %0
br i1 %13, label %9, label %14
14: ; preds = %9, %6
store i32 0, i32* %2
br label %15
15: ; preds = %4, %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(
      stderr,
      "Usage: input file is standard input, output file is standard output.\n"
      "Arguments:\n"
      "  --help        Display this information"
      "\n"
      "  --linear      Set assembly mode to linear"
      "\n"
      "  --woven       Set assembly mode to woven"
      "\n"
      "  --transposed  Set assembly mode to transposed"
      "\n"
      "  --flipped     Set assembly mode to flipped"
      "\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [302 x i8] c"Usage: input file is standard input, output file is standard output.\0AArguments:\0A --help Display this information\0A --linear Set assembly mode to linear\0A --woven Set assembly mode to woven\0A --transposed Set assembly mode to transposed\0A --flipped Set assembly mode to flipped\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([302 x i8], [302 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [302 x i8] c"Usage: input file is standard input, output file is standard output.\0AArguments:\0A --help Display this information\0A --linear Set assembly mode to linear\0A --woven Set assembly mode to woven\0A --transposed Set assembly mode to transposed\0A --flipped Set assembly mode to flipped\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([302 x i8], [302 x i8]* @.str, i64 0, i64 0))
ret void
}
int if_else(n1, n2, n3, mid) {
  if (n2 > n3) {
    if (n1 > n3) {
      mid = n1;
      return (mid);
    } else {
      mid = n3;
      return (mid);
    }
  } else {
    mid = n2;
    return (mid);
  }
}


x86 assembly (clang, -O0):
<if_else>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    114a <if_else+0x4a>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1139 <if_else+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <if_else+0x56>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <if_else+0x56>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_else>:
mov    %edi,%eax
cmp    %edx,%edi
cmovle %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @if_else(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %2
%6 = icmp sgt i32 %0, %2
%7 = select i1 %6, i32 %0, i32 %2
%8 = select i1 %5, i32 %7, i32 %1
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlock_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int pthread_rwlock_destroy(int /*<<< orphan*/ *);
int my_pthread_rwlock_destroy(pthread_rwlock_t *__rwlock) {
  int ret;
  pthread_rwlock_t *realrwlock = (pthread_rwlock_t *)*(int *)__rwlock;
  ret = pthread_rwlock_destroy(realrwlock);
  free(realrwlock);
  return ret;
}


x86 assembly (clang, -O0):
<my_pthread_rwlock_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_rwlock_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_rwlock_destroy>:
push   %rbp
push   %rbx
push   %rax
movslq (%rdi),%rbx
mov    %rbx,%rdi
call   1040 <pthread_rwlock_destroy@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_pthread_rwlock_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_rwlock_destroy(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @free(i32* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_pthread_rwlock_destroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @pthread_rwlock_destroy(i32* %4)
%6 = tail call i32 @free(i32* %4)
ret i32 %5
}
void Draco9210SetCS() {}


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

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

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

LLVM IR (-O2):
define void @Draco9210SetCS() {
ret void
}
const char *db_drop_entities_table_sql(void) {
  static const char *query = "DROP TABLE entities";
  return query;
}


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

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

LLVM IR (-O0):
@db_drop_entities_table_sql.query = internal global i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0)
@.str = [20 x i8] c"DROP TABLE entities\00"
define i8* @db_drop_entities_table_sql() {
%1 = load i8*, i8** @db_drop_entities_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [20 x i8] c"DROP TABLE entities\00"
define i8* @db_drop_entities_table_sql() {
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int x;
typedef int __m128i;

/* Variables and functions */
__m128i _mm_G(__m128i x, __m128i y, __m128i z) {
  return (((x) & (y)) | (~(x) & (z)));
}


x86 assembly (clang, -O0):
<_mm_G>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_G>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_mm_G(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @_mm_G(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
double _get_float(const char *data, size_t pos) {
  float *buf = (float *)data;
  return ((double)buf[pos]);
}


x86 assembly (clang, -O0):
<_get_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_float>:
movss  (%rdi,%rsi,4),%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_get_float(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca float*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to float*
store float* %7, float** %5
%8 = load float*, float** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds float, float* %8, i64 %9
%11 = load float, float* %10
%12 = fpext float %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_get_float(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to float*
%4 = getelementptr inbounds float, float* %3, i64 %1
%5 = load float, float* %4
%6 = fpext float %5 to double
ret double %6
}
/* Type definitions */
struct utsname {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ uname(struct utsname *);
int main(int argc, char **argv) {
  struct utsname unameData;
  uname(&unameData);
  printf("The quick brown fox jumps over the lazy dog");
  return 42;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1040 <uname@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <uname@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
@.str = [44 x i8] c"The quick brown fox jumps over the lazy dog\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utsname
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @uname(%struct.utsname* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 42
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
@.str = [44 x i8] c"The quick brown fox jumps over the lazy dog\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 42
}
/* Variables and functions */
double cos(double);
double get_search_radius(void) {
  double search_radius;
  extern double remap_search_radius;
  search_radius = remap_search_radius;
  if (search_radius < 0.)
    search_radius = 0.;
  if (search_radius > 180.)
    search_radius = 180.;
  search_radius = cos(search_radius * (3.14159265358979323846 / 180.));
  return (search_radius);
}


x86 assembly (clang, -O0):
<get_search_radius>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113e <get_search_radius+0x2e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1162 <get_search_radius+0x52>
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe9e(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_search_radius>:
mov    0x2ec9(%rip),%rax
xorpd  %xmm1,%xmm1
maxsd  (%rax),%xmm1
movsd  0xed9(%rip),%xmm0
minsd  %xmm1,%xmm0
mulsd  0xed5(%rip),%xmm0
jmp    1030 <cos@plt>

LLVM IR (-O0):
@remap_search_radius = external global double
define double @get_search_radius() {
%1 = alloca double
%2 = load double, double* @remap_search_radius
store double %2, double* %1
%3 = load double, double* %1
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %0
store double 0.000000e+00, double* %1
br label %6
6: ; preds = %5, %0
%7 = load double, double* %1
%8 = fcmp ogt double %7, 1.800000e+02
br i1 %8, label %9, label %10
9: ; preds = %6
store double 1.800000e+02, double* %1
br label %10
10: ; preds = %9, %6
%11 = load double, double* %1
%12 = fmul double %11, 0x3F91DF46A2529D39
%13 = call double @cos(double %12)
store double %13, double* %1
%14 = load double, double* %1
ret double %14
}

LLVM IR (-O2):
@remap_search_radius = external global double
define double @get_search_radius() {
%1 = load double, double* @remap_search_radius
%2 = fcmp olt double %1, 0.000000e+00
%3 = select i1 %2, double 0.000000e+00, double %1
%4 = fcmp ogt double %3, 1.800000e+02
%5 = select i1 %4, double 1.800000e+02, double %3
%6 = fmul double %5, 0x3F91DF46A2529D39
%7 = tail call double @cos(double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ gen_big_unrolled();
int /*<<< orphan*/ gen_small_unrolled();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("/* Unrolled C_256 */\n");
  gen_small_unrolled();
  printf("\n");
  printf("/* Unrolled C_512 */\n");
  gen_big_unrolled();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <gen_small_unrolled@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <gen_big_unrolled@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <gen_small_unrolled@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <gen_big_unrolled@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/* Unrolled C_256 */\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [22 x i8] c"/* Unrolled C_512 */\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @gen_small_unrolled()
%4 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 (...) @gen_big_unrolled()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"/* Unrolled C_256 */\00"
@str.3 = [21 x i8] c"/* Unrolled C_512 */\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @gen_small_unrolled()
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 (...) @gen_big_unrolled()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int glfloat_to_int(GLfloat f) {
  int i = 0;
  GLfloat *fp;
  int *ip;
  fp = &f;
  ip = &i;
  *ip = *((int *)fp);
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @glfloat_to_int(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
unsigned long gcd(unsigned long, unsigned long);
unsigned long lcm(unsigned long a, unsigned long b) {
  if (a && b)
    return (a * b) / gcd(a, b);
  else if (b)
    return b;
  return a;
}


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <lcm+0x55>
cmpq   $0x0,-0x18(%rbp)
je     1165 <lcm+0x55>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    118a <lcm+0x7a>
cmpq   $0x0,-0x18(%rbp)
je     117d <lcm+0x6d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    118a <lcm+0x7a>
jmp    1182 <lcm+0x72>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
test   %rdi,%rdi
je     1140 <lcm+0x30>
test   %rsi,%rsi
je     1140 <lcm+0x30>
mov    %rsi,%rbx
imul   %rdi,%rbx
call   1030 <gcd@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1149 <lcm+0x39>
mov    %rbx,%rax
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
jmp    1151 <lcm+0x41>
test   %rsi,%rsi
cmovne %rsi,%rdi
jmp    1151 <lcm+0x41>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
mov    %rdi,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @lcm(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 0
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = mul i64 %1, %0
%8 = tail call i64 @gcd(i64 %0, i64 %1)
%9 = udiv i64 %7, %8
br label %12
10: ; preds = %2
%11 = select i1 %4, i64 %1, i64 %0
br label %12
12: ; preds = %10, %6
%13 = phi i64 [ %9, %6 ], [ %11, %10 ]
ret i64 %13
}
unsigned int call_seek(unsigned int descriptor, unsigned int offset) {
  return 0;
}


x86 assembly (clang, -O0):
<call_seek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @call_seek(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int execle(const char *path, const char *arg, ...) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "execle");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<execle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
lea    0xee5(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execle>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execle\00"
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @assert(i32 0)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [7 x i8] c"execle\00"
define i32 @execle(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @assert(i32 0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ make_words(char **, int);
int main(int argc, char *argv[]) {
  make_words(argv + 1, argc - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <make_words@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x8(%rsi),%rax
lea    -0x1(%rdi),%esi
mov    %rax,%rdi
call   1030 <make_words@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @make_words(i8** %3, i32 %4)
ret i32 0
}
int Int_copy(int *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @Int_copy(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int find(int, int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int list[] = {1, 3, 4, 6, 9, 24, 55, 66, 232, 433, 559, 856};
  int count = (sizeof list) / sizeof(int);
  int j = find(55, list, 0, count - 1);
  printf("%d\t", j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
movl   $0xc,-0x34(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x37,%edi
xor    %edx,%edx
call   1050 <find@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x37,%edi
xor    %edx,%edx
mov    $0xb,%ecx
call   1040 <find@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.list = [12 x i32] [i32 1, i32 3, i32 4, i32 6, i32 9, i32 24, i32 55, i32 66, i32 232, i32 433, i32 559, i32 856]
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca [12 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [12 x i32]* %1 to i8*
store i32 12, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @find(i32 55, i32* %5, i32 0, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.list = [12 x i32] [i32 1, i32 3, i32 4, i32 6, i32 9, i32 24, i32 55, i32 66, i32 232, i32 433, i32 559, i32 856]
@.str = [4 x i8] c"%d\09\00"
define i32 @main() {
%1 = alloca [12 x i32]
%2 = bitcast [12 x i32]* %1 to i8*
%3 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%4 = call i32 @find(i32 55, i32* %3, i32 0, i32 11)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ranged_random_mult(scalar_t__);
void loop_mult_linear(size_t count, uint32_t range, uint32_t *output) {
  for (size_t i = 0; i < count; i++) {
    *output++ = ranged_random_mult(range + i);
  }
}


x86 assembly (clang, -O0):
<loop_mult_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116d <loop_mult_linear+0x5d>
mov    -0x10(%rbp),%rdi
add    -0x20(%rbp),%rdi
call   1030 <ranged_random_mult@plt>
movslq %eax,%rcx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x8,%rdx
mov    %rdx,-0x18(%rbp)
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <loop_mult_linear+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop_mult_linear>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     1148 <loop_mult_linear+0x38>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rdi
call   1030 <ranged_random_mult@plt>
cltq
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <loop_mult_linear+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @loop_mult_linear(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = icmp eq i64 %0, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %13, %6 ], [ 0, %3 ]
%8 = phi i64* [ %12, %6 ], [ %2, %3 ]
%9 = add i64 %7, %1
%10 = tail call i32 @ranged_random_mult(i64 %9)
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %8, i64 1
store i64 %11, i64* %8
%13 = add nuw i64 %7, 1
%14 = icmp eq i64 %13, %0
br i1 %14, label %5, label %6
}
/* Variables and functions */
int fpcompare(double, double, int /*<<< orphan*/, int);
int isgreaterequal(double x, double y) { return fpcompare(x, y, 0, 0x4000); }


x86 assembly (clang, -O0):
<isgreaterequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %edi,%edi
mov    $0x4000,%esi
call   1030 <fpcompare@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgreaterequal>:
xor    %edi,%edi
mov    $0x4000,%esi
jmp    1030 <fpcompare@plt>

LLVM IR (-O0):
define i32 @isgreaterequal(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 = call i32 @fpcompare(double %5, double %6, i32 0, i32 16384)
ret i32 %7
}

LLVM IR (-O2):
define i32 @isgreaterequal(double %0, double %1) {
%3 = tail call i32 @fpcompare(double %0, double %1, i32 0, i32 16384)
ret i32 %3
}
int sysapi_get_csvcols(char *csvline) {
  int count = 1;
  char *line = csvline;
  while (*line != '\0') {
    if (*line == ',')
      count++;
    line++;
  }
  return count;
}


x86 assembly (clang, -O0):
<sysapi_get_csvcols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <sysapi_get_csvcols+0x51>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1140 <sysapi_get_csvcols+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <sysapi_get_csvcols+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysapi_get_csvcols>:
mov    $0x1,%eax
jmp    1117 <sysapi_get_csvcols+0x17>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x2c,%cl
je     1110 <sysapi_get_csvcols+0x10>
test   %cl,%cl
jne    1113 <sysapi_get_csvcols+0x13>
ret

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

LLVM IR (-O2):
define i32 @sysapi_get_csvcols(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i32 [ 1, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %11
i8 44, label %6
]
6: ; preds = %2
%7 = add nsw i32 %3, 1
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %3, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
ret i32 %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void sig_chld() {
  pid_t pid;
  while ((pid = waitpid(-1, NULL, WNOHANG)) > 0) {
    printf("Child %d terminated\n", pid);
  }
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <waitpid@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jle    115f <sig_chld+0x3f>
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1128 <sig_chld+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%r14
mov    (%r14),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    116d <sig_chld+0x4d>
lea    0xebb(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r14),%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1150 <sig_chld+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [21 x i8] c"Child %d terminated\0A\00"
define void @sig_chld() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* @WNOHANG
%4 = call i32 @waitpid(i32 -1, i32* null, i32 %3)
store i32 %4, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [21 x i8] c"Child %d terminated\0A\00"
define void @sig_chld() {
%1 = load i32, i32* @WNOHANG
%2 = tail call i32 @waitpid(i32 -1, i32* null, i32 %1)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %2, %0 ]
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @WNOHANG
%8 = tail call i32 @waitpid(i32 -1, i32* null, i32 %7)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char **tzname;
int dummyfcn(void) {
  printf("%s\n", tzname[0]);
  return 0;
}


x86 assembly (clang, -O0):
<dummyfcn>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummyfcn>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@tzname = global i8** null
define i32 @dummyfcn() {
%1 = load i8**, i8*** @tzname
%2 = getelementptr inbounds i8*, i8** %1, i64 0
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@tzname = global i8** null
define i32 @dummyfcn() {
%1 = load i8**, i8*** @tzname
%2 = load i8*, i8** %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int sorted_chars(char a, char b) { return a - b; }


x86 assembly (clang, -O0):
<sorted_chars>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sorted_chars(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sorted_chars(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = sub nsw i32 %3, %4
ret i32 %5
}
int func1(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 0
}