xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ LrsReceive(char *, char *, char *);
int /*<<< orphan*/ LrsSend(char *, char *, char *);
Action() {
  LrsSend("socket0", "buf0", "0");
  LrsReceive("socket0", "buf1", "0");
  return 0;
}


x86 assembly (clang, -O0):
<Action>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed6(%rip),%rsi
lea    0xed2(%rip),%rdx
call   1030 <LrsSend@plt>
lea    0xebb(%rip),%rdi
lea    0xec1(%rip),%rsi
lea    0xeb8(%rip),%rdx
call   1040 <LrsReceive@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Action>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed6(%rip),%rsi
lea    0xed2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <LrsSend@plt>
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1040 <LrsReceive@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"socket0\00"
@.str.1 = [5 x i8] c"buf0\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [5 x i8] c"buf1\00"
define i32 @Action() {
%1 = call i32 @LrsSend(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 @LrsReceive(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"socket0\00"
@.str.1 = [5 x i8] c"buf0\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [5 x i8] c"buf1\00"
define i32 @Action() {
%1 = tail call i32 @LrsSend(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @LrsReceive(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void aeron_net_init() {}


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

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

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

LLVM IR (-O2):
define void @aeron_net_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr,
          "usage: %s <size> <requests> <measurements> <hit probability> "
          "<threads>\n",
          __progname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"usage: %s <size> <requests> <measurements> <hit probability> <threads>\0A\00"
@__progname = external global i8*
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"usage: %s <size> <requests> <measurements> <hit probability> <threads>\0A\00"
@__progname = external global i8*
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(unsigned int, unsigned int *, unsigned int *,
                         unsigned int *, unsigned int *);
__attribute__((always_)) unsigned int cpuid_edx(unsigned int op) {
  unsigned int eax, ebx, ecx, edx;
  cpuid(op, &eax, &ebx, &ecx, &edx);
  return edx;
}


x86 assembly (clang, -O0):
<cpuid_edx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_edx>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @cpuid_edx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = call i32 @cpuid(i32 %0, i32* %2, i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %5
ret i32 %11
}
/* Variables and functions */
int compareVersion(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char v1[] = "1";
  char v2[] = "1.1";
  printf("%d\n", compareVersion(v1, v2));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xec0(%rip),%eax
mov    %eax,-0xa(%rbp)
lea    -0x6(%rbp),%rdi
lea    -0xa(%rbp),%rsi
call   1030 <compareVersion@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x31,0x2(%rsp)
movl   $0x312e31,0x4(%rsp)
lea    0x2(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <compareVersion@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.v1 = [2 x i8] c"1\00"
@__const.main.v2 = [4 x i8] c"1.1\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = alloca [4 x i8]
store i32 0, i32* %1
%4 = bitcast [2 x i8]* %2 to i8*
%5 = bitcast [4 x i8]* %3 to i8*
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%8 = call i32 @compareVersion(i8* %6, i8* %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() {
%1 = alloca i16
%2 = alloca i32
%3 = bitcast i16* %1 to i8*
store i16 49, i16* %1
%4 = bitcast i32* %2 to i8*
store i32 3223089, i32* %2
%5 = call i32 @compareVersion(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
char wrap(char f) { return f; }


x86 assembly (clang, -O0):
<wrap>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @wrap(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @wrap(i8 returned signext %0) {
ret i8 %0
}
unsigned char answer_7(unsigned char arg0, int arg1) { return 0; }


x86 assembly (clang, -O0):
<answer_7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @answer_7(i8 zeroext %0, i32 %1) {
ret i8 0
}
int f(n) {
  switch (n) {
  case 1:
  case 2:
    return n;
  default:
    return 4 * f(n - 1) - 3 * f(n - 2);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x1,%eax
ja     113a <f+0x2a>
jmp    112f <f+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <f+0x53>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
cmp    $0x1,%edi
jbe    1138 <f+0x28>
call   1030 <f@plt>
mov    %eax,%ebp
shl    $0x2,%ebp
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <f@plt>
lea    (%rax,%rax,2),%eax
sub    %eax,%ebp
mov    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %5
]
5: ; preds = %1, %1
%6 = load i32, i32* %3
store i32 %6, i32* %2
br label %17
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @f(i32 %9)
%11 = mul nsw i32 4, %10
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 2
%14 = call i32 @f(i32 %13)
%15 = mul nsw i32 3, %14
%16 = sub nsw i32 %11, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %7, %5
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %1, %6
%5 = phi i32 [ %12, %6 ], [ %0, %1 ]
ret i32 %5
6: ; preds = %1
%7 = tail call i32 @f(i32 %2)
%8 = shl nsw i32 %7, 2
%9 = add nsw i32 %0, -2
%10 = tail call i32 @f(i32 %9)
%11 = mul i32 %10, -3
%12 = add i32 %11, %8
br label %4
}
void RTLinuxSysFsReadFile(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLinuxSysFsReadFile() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void usage(void) {
  printf("USAGE:\n"
         "  klogconsole [-l console_loglevel ] [ -r console ]\n\n"
         "  console_loglevel  0..7 (kernel may dissallow values <5)\n"
         "  console           0..%i console to which printk() dups messages\n"
         "                     (0 = current console)\n",
         24);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [228 x i8] c"USAGE:\0A klogconsole [-l console_loglevel ] [ -r console ]\0A\0A console_loglevel 0..7 (kernel may dissallow values <5)\0A console 0..%i console to which printk() dups messages\0A (0 = current console)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([228 x i8], [228 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [228 x i8] c"USAGE:\0A klogconsole [-l console_loglevel ] [ -r console ]\0A\0A console_loglevel 0..7 (kernel may dissallow values <5)\0A console 0..%i console to which printk() dups messages\0A (0 = current console)\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([228 x i8], [228 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void nmstermio_beep(void) {
  printf("\a");
  ;
}


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

x86 assembly (clang, -O2):
<nmstermio_beep>:
mov    $0x7,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
define void @nmstermio_beep() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @nmstermio_beep() {
%1 = tail call i32 @putchar(i32 7)
ret void
}
/* Variables and functions */
double exp(double);
double zv_to_E(double zv, int db_size) {
  double e;
  e = exp(-1.282554983 * zv - .577216);
  return (double)db_size * (e > .01 ? 1.0 - exp(-e) : e);
}


x86 assembly (clang, -O0):
<zv_to_E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed7(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a2 <zv_to_E+0x92>
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe84(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    11ac <zv_to_E+0x9c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zv_to_E>:
push   %rbx
mov    %edi,%ebx
mulsd  0xee5(%rip),%xmm0
addsd  0xee5(%rip),%xmm0
call   1030 <exp@plt>
ucomisd 0xee0(%rip),%xmm0
jbe    1157 <zv_to_E+0x47>
movapd 0xee6(%rip),%xmm1
xorpd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
subsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @zv_to_E(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%6 = load double, double* %3
%7 = call double @llvm.fmuladd.f64(double 0xBFF485585FB4E8CD, double %6, double -5.772160e-01)
%8 = call double @exp(double %7)
store double %8, double* %5
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
%11 = load double, double* %5
%12 = fcmp ogt double %11, 1.000000e-02
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load double, double* %5
%15 = fneg double %14
%16 = call double @exp(double %15)
%17 = fsub double 1.000000e+00, %16
br label %20
18: ; preds = %2
%19 = load double, double* %5
br label %20
20: ; preds = %18, %13
%21 = phi double [ %17, %13 ], [ %19, %18 ]
%22 = fmul double %10, %21
ret double %22
}

LLVM IR (-O2):
define double @zv_to_E(double %0, i32 %1) {
%3 = tail call double @llvm.fmuladd.f64(double %0, double 0xBFF485585FB4E8CD, double -5.772160e-01)
%4 = tail call double @exp(double %3)
%5 = fcmp ogt double %4, 1.000000e-02
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = fneg double %4
%8 = tail call double @exp(double %7)
%9 = fsub double 1.000000e+00, %8
br label %10
10: ; preds = %2, %6
%11 = phi double [ %9, %6 ], [ %4, %2 ]
%12 = sitofp i32 %1 to double
%13 = fmul double %11, %12
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exit_tracker(int sig) { exit(0); }


x86 assembly (clang, -O0):
<exit_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @exit_tracker(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit_tracker(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
void osfinit(void) {}


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

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

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

LLVM IR (-O2):
define void @osfinit() {
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=aml-meson-m400-2 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Sat "
         "Jan 26 09:10:02 CET 2013 BUILD=RELEASE CPU= USING_UMP=1 "
         "USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 "
         "KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c "
         "platform/meson_platform/mali_fix.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=";
}


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

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

LLVM IR (-O0):
@.str = [464 x i8] c"malidrv: CONFIG=aml-meson-m400-2 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Sat Jan 26 09:10:02 CET 2013 BUILD=RELEASE CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c platform/meson_platform/mali_fix.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([464 x i8], [464 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [464 x i8] c"malidrv: CONFIG=aml-meson-m400-2 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Sat Jan 26 09:10:02 CET 2013 BUILD=RELEASE CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/meson_platform/mali_platform.c platform/meson_platform/mali_fix.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([464 x i8], [464 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef short uint32_t;

/* Variables and functions */
uint32_t ROTL(uint32_t x, short n, short bitAmount) {
  return (x << n) | (x >> (bitAmount - n));
}


x86 assembly (clang, -O0):
<ROTL>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
shl    %cl,%eax
movswl -0x2(%rbp),%edx
movswl -0x6(%rbp),%ecx
movswl -0x4(%rbp),%esi
sub    %esi,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROTL>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
sub    %esi,%edx
mov    %edx,%ecx
sar    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define signext i16 @ROTL(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = shl i32 %8, %10
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = load i16, i16* %6
%15 = sext i16 %14 to i32
%16 = load i16, i16* %5
%17 = sext i16 %16 to i32
%18 = sub nsw i32 %15, %17
%19 = ashr i32 %13, %18
%20 = or i32 %11, %19
%21 = trunc i32 %20 to i16
ret i16 %21
}

LLVM IR (-O2):
define signext i16 @ROTL(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = sext i16 %0 to i32
%5 = sext i16 %1 to i32
%6 = shl i32 %4, %5
%7 = sext i16 %2 to i32
%8 = sub nsw i32 %7, %5
%9 = ashr i32 %4, %8
%10 = or i32 %9, %6
%11 = trunc i32 %10 to i16
ret i16 %11
}
/* Type definitions */
struct Eli {
  int dummy;
};

/* Variables and functions */
struct Eli *eli_init(int, char const **);
int /*<<< orphan*/ eli_run(struct Eli *);
int /*<<< orphan*/ eli_term(struct Eli *);
int main(int argc, const char *argv[]) {
  struct Eli *eli = eli_init(argc, argv);
  eli_run(eli);
  eli_term(eli);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <eli_init@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <eli_run@plt>
mov    -0x18(%rbp),%rdi
call   1030 <eli_term@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <eli_init@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <eli_run@plt>
mov    %rbx,%rdi
call   1030 <eli_term@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Eli = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Eli*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call %struct.Eli* @eli_init(i32 %7, i8** %8)
store %struct.Eli* %9, %struct.Eli** %6
%10 = load %struct.Eli*, %struct.Eli** %6
%11 = call i32 @eli_run(%struct.Eli* %10)
%12 = load %struct.Eli*, %struct.Eli** %6
%13 = call i32 @eli_term(%struct.Eli* %12)
ret i32 0
}

LLVM IR (-O2):
%struct.Eli = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = tail call %struct.Eli* @eli_init(i32 %0, i8** %1)
%4 = tail call i32 @eli_run(%struct.Eli* %3)
%5 = tail call i32 @eli_term(%struct.Eli* %3)
ret i32 0
}
void av_aes_ctr_crypt() {}


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

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

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

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

/* Variables and functions */
int wpa_ctrl_attach_helper(struct wpa_ctrl *, int /*<<< orphan*/);
int wpa_ctrl_detach(struct wpa_ctrl *ctrl) {
  return wpa_ctrl_attach_helper(ctrl, 0);
}


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

x86 assembly (clang, -O2):
<wpa_ctrl_detach>:
xor    %esi,%esi
jmp    1030 <wpa_ctrl_attach_helper@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
define i32 @wpa_ctrl_detach(%struct.wpa_ctrl* %0) {
%2 = alloca %struct.wpa_ctrl*
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %2
%3 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %2
%4 = call i32 @wpa_ctrl_attach_helper(%struct.wpa_ctrl* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
define i32 @wpa_ctrl_detach(%struct.wpa_ctrl* %0) {
%2 = tail call i32 @wpa_ctrl_attach_helper(%struct.wpa_ctrl* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
bool InitWindowsSocket() { return true; }


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

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

LLVM IR (-O0):
define i32 @InitWindowsSocket() {
ret i32 1
}

LLVM IR (-O2):
define i32 @InitWindowsSocket() {
ret i32 1
}
unsigned packCharacters(char a, char b, char c, char d) {
  unsigned result = a;
  result <<= 8;
  result |= b;
  result <<= 8;
  result |= c;
  result <<= 8;
  return result |= d;
}


x86 assembly (clang, -O0):
<packCharacters>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x3(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<packCharacters>:
mov    %esi,%eax
shl    $0x10,%edi
shl    $0x8,%eax
or     %edi,%eax
or     %edx,%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @packCharacters(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = shl i32 %12, 8
store i32 %13, i32* %9
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = load i32, i32* %9
%17 = or i32 %16, %15
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = shl i32 %18, 8
store i32 %19, i32* %9
%20 = load i8, i8* %7
%21 = sext i8 %20 to i32
%22 = load i32, i32* %9
%23 = or i32 %22, %21
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = shl i32 %24, 8
store i32 %25, i32* %9
%26 = load i8, i8* %8
%27 = sext i8 %26 to i32
%28 = load i32, i32* %9
%29 = or i32 %28, %27
store i32 %29, i32* %9
ret i32 %29
}

LLVM IR (-O2):
define i32 @packCharacters(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = sext i8 %0 to i32
%6 = sext i8 %1 to i32
%7 = shl nsw i32 %5, 16
%8 = shl nsw i32 %6, 8
%9 = or i32 %8, %7
%10 = sext i8 %2 to i32
%11 = or i32 %9, %10
%12 = shl nsw i32 %11, 8
%13 = sext i8 %3 to i32
%14 = or i32 %12, %13
ret i32 %14
}
/* Variables and functions */
int bar_built_value(int);
int main(int argc, char *argv[]) {
  return bar_built_value(10) - (42 + 1969 + 10);
}


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    $0xa,%edi
call   1030 <bar_built_value@plt>
sub    $0x7e5,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <bar_built_value@plt>
add    $0xfffff81b,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bar_built_value(i32 10)
%4 = add nsw i32 %3, -2021
ret i32 %4
}
/* Variables and functions */
int do_system_call(int, unsigned int, unsigned int, unsigned int,
                   int /*<<< orphan*/, int /*<<< orphan*/);
int _write(int fd, const void *buf, int s) {
  register int res;
  res = do_system_call(4, (unsigned)fd, (unsigned)buf, (unsigned)s, 0, 0);
  return res;
}


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

x86 assembly (clang, -O2):
<_write>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x4,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <do_system_call@plt>

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @do_system_call(i32 4, i32 %0, i32 %5, i32 %2, i32 0, i32 0)
ret i32 %6
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ show_file_info(char *, struct stat *);
int stat(char *, struct stat *);
void dostat(char *file) {
  struct stat info;
  if ((stat(file, &info) == -1))
    perror(file);
  else {
    show_file_info(file, &info);
  }
}


x86 assembly (clang, -O0):
<dostat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
jne    1160 <dostat+0x30>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
jmp    116d <dostat+0x3d>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <show_file_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dostat>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     115a <dostat+0x2a>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <show_file_info@plt>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @dostat(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
br label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @show_file_info(i8* %11, %struct.stat* %3)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @dostat(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @perror(i8* %0)
br label %10
8: ; preds = %1
%9 = call i32 @show_file_info(i8* %0, %struct.stat* %2)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ g(int, int /*<<< orphan*/);
int main(void) {
  if (!g(1, 0))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <g@plt>
cmp    $0x0,%eax
jne    114b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1040 <g@plt>
test   %eax,%eax
je     1135 <main+0x15>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(i32 1, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
void EVP_VerifyFinal(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_VerifyFinal() {
ret void
}
reg0imm1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (r0 <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0imm1>:
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)
cmpl   $0x21,-0x8(%rbp)
ja     112e <reg0imm1+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1135 <reg0imm1+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0imm1>:
xor    %eax,%eax
cmp    $0x22,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @reg0imm1(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* %8
%15 = icmp ule i32 %14, 33
br i1 %15, label %16, label %17
16: ; preds = %6
store i32 1, i32* %7
br label %18
17: ; preds = %6
store i32 0, i32* %7
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @reg0imm1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = icmp ult i32 %0, 34
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_NODELAY;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int set_nagle(int csock, int disabled) {
  return setsockopt(csock, IPPROTO_TCP, TCP_NODELAY, (char *)&disabled,
                    sizeof(int));
}


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

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

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @set_nagle(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* @IPPROTO_TCP
%7 = load i32, i32* @TCP_NODELAY
%8 = bitcast i32* %4 to i8*
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_NODELAY = global i32 0
define i32 @set_nagle(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_NODELAY
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
ret i32 %7
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int /*<<< orphan*/ unix_error(char *);
int Select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
           struct timeval *timeout) {
  int rc;
  if ((rc = select(n, readfds, writefds, exceptfds, timeout)) < 0)
    unix_error("Select error");
  return rc;
}


x86 assembly (clang, -O0):
<Select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <select@plt>
mov    %eax,-0x2c(%rbp)
cmp    $0x0,%eax
jge    116b <Select+0x4b>
lea    0xe9a(%rip),%rdi
call   1040 <unix_error@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Select>:
push   %rbx
call   1030 <select@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Select+0x18>
lea    0xecd(%rip),%rdi
call   1040 <unix_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"Select error\00"
define i32 @Select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
%11 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = load i32*, i32** %9
%16 = load %struct.timeval*, %struct.timeval** %10
%17 = call i32 @select(i32 %12, i32* %13, i32* %14, i32* %15, %struct.timeval* %16)
store i32 %17, i32* %11
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %5
%20 = call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19, %5
%22 = load i32, i32* %11
ret i32 %22
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"Select error\00"
define i32 @Select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = tail call i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @unix_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ idcchar(char *);
void testConstantOffset(char *value) {
  char *cursor = value + 5;
  idcchar(cursor);
  if (*cursor) {
    cursor++;
  }
}


x86 assembly (clang, -O0):
<testConstantOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <idcchar@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <testConstantOffset+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testConstantOffset>:
add    $0x5,%rdi
jmp    1030 <idcchar@plt>

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

LLVM IR (-O2):
define void @testConstantOffset(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = tail call i32 @idcchar(i8* %2)
ret void
}
void rt2x00rfkill_register(struct rt2x00_dev *rt2x00dev) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
%struct.rt2x00_dev = type opaque
define void @rt2x00rfkill_register(%struct.rt2x00_dev* nocapture %0) {
ret void
}
char *langDbgRegsCpu() { return "CPU Registers"; }


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"CPU Registers\00"
define i8* @langDbgRegsCpu() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
int compare_double(const void *p1, const void *p2) {
  double t1 = *(double *)p1;
  double t2 = *(double *)p2;
  return t1 < t2 ? -1 : (t1 > t2 ? 1 : 0);
}


x86 assembly (clang, -O0):
<compare_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1147 <compare_double+0x47>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1162 <compare_double+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_double>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_double(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca double
%6 = alloca double
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
store double %9, double* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
store double %12, double* %6
%13 = load double, double* %5
%14 = load double, double* %6
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load double, double* %5
%19 = load double, double* %6
%20 = fcmp ogt double %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @compare_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRAD_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRAD_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRAD_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double urn(void) { return ((double)rand()) / RAND_MAX; }


x86 assembly (clang, -O0):
<urn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<urn>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @urn() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @urn() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
void can_set_gmlan(int bus) {}


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

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

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

LLVM IR (-O2):
define void @can_set_gmlan(i32 %0) {
ret void
}
void disable_kernel_altivec(void) {}


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

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

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

LLVM IR (-O2):
define void @disable_kernel_altivec() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ killAll();
int /*<<< orphan*/ log_term();
int /*<<< orphan*/ log_write(char *, char *, int /*<<< orphan*/ *);
void cleanAndExit(int status) {
  log_write("Main parent", "Killing running processes.", NULL);
  killAll();
  log_write("Main parent", "Terminating log and exiting.", NULL);
  log_term();
  exit(status);
}


x86 assembly (clang, -O0):
<cleanAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
lea    0xeb3(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <log_write@plt>
mov    $0x0,%al
call   1040 <killAll@plt>
lea    0xe90(%rip),%rdi
lea    0xeb0(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <log_write@plt>
mov    $0x0,%al
call   1030 <log_term@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<cleanAndExit>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xeb3(%rip),%r14
lea    0xeb8(%rip),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1050 <log_write@plt>
xor    %eax,%eax
call   1040 <killAll@plt>
lea    0xebb(%rip),%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1050 <log_write@plt>
xor    %eax,%eax
call   1030 <log_term@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Main parent\00"
@.str.1 = [27 x i8] c"Killing running processes.\00"
@.str.2 = [29 x i8] c"Terminating log and exiting.\00"
define void @cleanAndExit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @log_write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* null)
%4 = call i32 (...) @killAll()
%5 = call i32 @log_write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32* null)
%6 = call i32 (...) @log_term()
%7 = load i32, i32* %2
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"Main parent\00"
@.str.1 = [27 x i8] c"Killing running processes.\00"
@.str.2 = [29 x i8] c"Terminating log and exiting.\00"
define void @cleanAndExit(i32 %0) {
%2 = tail call i32 @log_write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = tail call i32 (...) @killAll()
%4 = tail call i32 @log_write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32* null)
%5 = tail call i32 (...) @log_term()
%6 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void auto_terminate() { exit(2); }


x86 assembly (clang, -O0):
<auto_terminate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<auto_terminate>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @auto_terminate() {
%1 = tail call i32 @exit(i32 2)
unreachable
}