xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ *strchr(char const *, char);
char *oclocate(char *p, const char *charlist) {
  for (; *p; p++) {
    if (strchr(charlist, *p) != NULL)
      return p;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<oclocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <oclocate+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     1154 <oclocate+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1172 <oclocate+0x62>
jmp    1159 <oclocate+0x49>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <oclocate+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oclocate>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <oclocate+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113e <oclocate+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <oclocate+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @oclocate(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i32* @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int INT_MAX;
int rand();
void main(void) {
  while (1) {
    int n = rand();
    while (n < INT_MAX) {
      n += 1;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%eax
jge    1142 <main+0x32>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <main+0x12>
jmp    1118 <main+0x8>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @main() {
%1 = alloca i32
br label %2
2: ; preds = %0, %11
%3 = call i32 (...) @rand()
store i32 %3, i32* %1
br label %4
4: ; preds = %8, %2
%5 = load i32, i32* %1
%6 = load i32, i32* @INT_MAX
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %4
11: ; preds = %4
br label %2
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
br label %1
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char Int2Char(uint8_t parse) {
  if (0 <= parse <= 9)
    return parse + '0';
  else if (0x0A <= parse <= 0x0F)
    return parse + 'A' - 10;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Int2Char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x9,%eax
jg     1132 <Int2Char+0x32>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1164 <Int2Char+0x64>
movsbl -0x2(%rbp),%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0xf,%eax
jg     1160 <Int2Char+0x60>
movsbl -0x2(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1164 <Int2Char+0x64>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int2Char>:
lea    0x30(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @Int2Char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 0, %5
%7 = zext i1 %6 to i32
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, 48
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %27
14: ; preds = %1
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp sle i32 10, %16
%18 = zext i1 %17 to i32
%19 = icmp sle i32 %18, 15
br i1 %19, label %20, label %26
20: ; preds = %14
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 65
%24 = sub nsw i32 %23, 10
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %27
26: ; preds = %14
store i8 0, i8* %2
br label %27
27: ; preds = %26, %20, %9
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @Int2Char(i8 signext %0) {
%2 = add i8 %0, 48
ret i8 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_serial(void *_p, unsigned long _v) {
  ((XConfigureRequestEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_serial>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XConfigureRequestEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void wait() {
  asm volatile("nop\n"
               "nop\n"
               ".byte 0x7c, 0x00, 0x00, 0x7c\n");
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
nop
nop
jl     1108 <wait+0x8>
add    %bh,-0x3d(%rbp,%rbx,2)

x86 assembly (clang, -O2):
<wait>:
nop
nop
jl     1104 <wait+0x4>
.byte 0x0
jl     10ca <__do_global_dtors_aux+0x1a>

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

LLVM IR (-O2):
define void @wait() {
tail call void asm sideeffect "nop\0Anop\0A.byte 0x7c, 0x00, 0x00, 0x7c\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void test(void) {
  struct {
    int foo;
    ;
  } val;
  memset(&val, 0, sizeof(val));
}


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

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

LLVM IR (-O0):
%struct.anon = type { i32 }
define void @test() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  for (i = 0; i <= 255; i++) {
    printf("%d %c\n", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     115a <main+0x4a>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
float fff(float f0, float f1) { return f0 + f1; }


x86 assembly (clang, -O0):
<fff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fff>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fff(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t tms_open_port(char *fname) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tms_open_port(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int count = 1;
  while (count <= 5) {
    printf("%i\n", count);
    ++count;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
ret i32 0
}
unsigned long USBDevAddrGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned char *)(ulBase + 0x00000000))));
}


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

x86 assembly (clang, -O2):
<USBDevAddrGet>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i64 @USBDevAddrGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i8*
%6 = load volatile i8, i8* %5
%7 = zext i8 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @USBDevAddrGet(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = load volatile i8, i8* %2
%4 = zext i8 %3 to i64
ret i64 %4
}
void segment_merge_infos_close(struct _segment_merge_infos *_s) {}


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

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

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

LLVM IR (-O2):
%struct._segment_merge_infos = type opaque
define void @segment_merge_infos_close(%struct._segment_merge_infos* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ div10l(long long);
signed long long int div10sl(signed long long int v) {
  if (v < 0)
    return -((signed long long int)div10l(-v));
  else
    return (signed long long int)div10l(v);
}


x86 assembly (clang, -O0):
<div10sl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1145 <div10sl+0x35>
xor    %eax,%eax
mov    %eax,%edi
sub    -0x10(%rbp),%rdi
call   1030 <div10l@plt>
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <div10sl+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <div10l@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div10sl>:
test   %rdi,%rdi
js     111a <div10sl+0xa>
jmp    1030 <div10l@plt>
push   %rax
neg    %rdi
call   1030 <div10l@plt>
neg    %rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @div10sl(i64 %0) {
%2 = icmp slt i64 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sub nsw i64 0, %0
%5 = tail call i64 @div10l(i64 %4)
%6 = sub nsw i64 0, %5
br label %9
7: ; preds = %1
%8 = tail call i64 @div10l(i64 %0)
br label %9
9: ; preds = %7, %3
%10 = phi i64 [ %6, %3 ], [ %8, %7 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_CTRL_PENDING;
size_t BIO_ctrl(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/ *);
size_t BIO_ctrl_pending(BIO *bio) {
  return BIO_ctrl(bio, BIO_CTRL_PENDING, 0, NULL);
}


x86 assembly (clang, -O0):
<BIO_ctrl_pending>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <BIO_ctrl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_ctrl_pending>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <BIO_ctrl@plt>

LLVM IR (-O0):
@BIO_CTRL_PENDING = global i32 0
define i64 @BIO_ctrl_pending(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @BIO_CTRL_PENDING
%5 = call i64 @BIO_ctrl(i32* %3, i32 %4, i32 0, i32* null)
ret i64 %5
}

LLVM IR (-O2):
@BIO_CTRL_PENDING = global i32 0
define i64 @BIO_ctrl_pending(i32* %0) {
%2 = load i32, i32* @BIO_CTRL_PENDING
%3 = tail call i64 @BIO_ctrl(i32* %0, i32 %2, i32 0, i32* null)
ret i64 %3
}
void delay(unsigned int us) {
  while (us)
    us--;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111f <delay+0x1f>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1107 <delay+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add i32 %7, -1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
unsigned xrop3_21_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk1 = D | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_21_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_21_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
xor    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_21_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_21_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -256
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
void getRandomSequence(char *outSeq, int len) {
  int byte_count = 64;
  char data[64];
  FILE *fp;
  fp = fopen("/dev/urandom", "r");
  fread(outSeq, 1, len, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<getRandomSequence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x40,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x58(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x58(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fread@plt>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomSequence>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
lea    0xec5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %rax,%rcx
call   1030 <fread@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/urandom\00"
@.str.1 = [2 x i8] c"r\00"
define void @getRandomSequence(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca [64 x i8]
%7 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 64, i32* %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %7
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = load i32*, i32** %7
%12 = call i32 @fread(i8* %9, i32 1, i32 %10, i32* %11)
%13 = load i32*, i32** %7
%14 = call i32 @fclose(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/urandom\00"
@.str.1 = [2 x i8] c"r\00"
define void @getRandomSequence(i8* nocapture %0, i32 %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @fread(i8* %0, i32 1, i32 %1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool ts_get_unitstart(const uint8_t *p_ts) { return !!(p_ts[1] & 0x40); }


x86 assembly (clang, -O0):
<ts_get_unitstart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_get_unitstart>:
mov    0x4(%rdi),%eax
shr    $0x6,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ts_get_unitstart(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 64
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ts_get_unitstart(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 1
ret i32 %5
}
int fun1163() { return 1163; }


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

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

LLVM IR (-O0):
define i32 @fun1163() {
ret i32 1163
}

LLVM IR (-O2):
define i32 @fun1163() {
ret i32 1163
}
/* Variables and functions */
long atoi(char const *);
void *malloc(long);
void *memset(void *, int /*<<< orphan*/, long);
void *load_ram(const char *num) {
  long size = atoi(num);
  void *m = malloc(size);
  return memset(m, 0, size);
}


x86 assembly (clang, -O0):
<load_ram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_ram>:
push   %rax
call   1040 <atoi@plt>
mov    $0x1,%edi
mov    %rax,%rsi
call   1030 <calloc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @load_ram(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @atoi(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load i64, i64* %3
%11 = call i8* @memset(i8* %9, i32 0, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @load_ram(i8* nocapture %0) {
%2 = tail call i64 @atoi(i8* %0)
%3 = call i8* @calloc(i64 1, i64 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sci_device();
void syscall_handler_init() { sci_device(); }


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

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

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

LLVM IR (-O2):
define void @syscall_handler_init() {
%1 = tail call i32 (...) @sci_device()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool adts_get_copy(const uint8_t *p_adts) { return !!(p_adts[3] & 0x20); }


x86 assembly (clang, -O0):
<adts_get_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_get_copy>:
mov    0xc(%rdi),%eax
shr    $0x5,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @adts_get_copy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @adts_get_copy(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = lshr i32 %3, 5
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void array(int a[], int k) {
  int i;
  for (i = 0; i < k; i++) {
    printf("%c", a[i] + 96);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <array+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
add    $0x60,%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <array+0x16>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <array+0x35>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
add    $0x60,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <array+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @array(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 = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 96
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 96
%11 = tail call i32 @putchar(i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ old_foo1();
int main() {
  old_foo1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <old_foo1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @old_foo1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @old_foo1()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;
typedef int /*<<< orphan*/ FORM;
typedef int /*<<< orphan*/ FIELD;

/* Variables and functions */
int /*<<< orphan*/ del_dialog(int /*<<< orphan*/ *);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ free_field(int /*<<< orphan*/ *);
int /*<<< orphan*/ free_form(int /*<<< orphan*/ *);
int /*<<< orphan*/ unpost_form(int /*<<< orphan*/ *);
void free_req_ipvx_ports(FORM *form, FIELD *field, WINDOW *form_win,
                         WINDOW *dialog_win) {
  unpost_form(form);
  free_form(form);
  free_field(field);
  delwin(form_win);
  del_dialog(dialog_win);
}


x86 assembly (clang, -O0):
<free_req_ipvx_ports>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <unpost_form@plt>
mov    -0x8(%rbp),%rdi
call   1040 <free_form@plt>
mov    -0x10(%rbp),%rdi
call   1060 <free_field@plt>
mov    -0x18(%rbp),%rdi
call   1030 <delwin@plt>
mov    -0x20(%rbp),%rdi
call   1070 <del_dialog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_req_ipvx_ports>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
call   1050 <unpost_form@plt>
mov    %rbx,%rdi
call   1040 <free_form@plt>
mov    %r12,%rdi
call   1060 <free_field@plt>
mov    %r15,%rdi
call   1030 <delwin@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1070 <del_dialog@plt>

LLVM IR (-O0):
define void @free_req_ipvx_ports(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = call i32 @unpost_form(i32* %9)
%11 = load i32*, i32** %5
%12 = call i32 @free_form(i32* %11)
%13 = load i32*, i32** %6
%14 = call i32 @free_field(i32* %13)
%15 = load i32*, i32** %7
%16 = call i32 @delwin(i32* %15)
%17 = load i32*, i32** %8
%18 = call i32 @del_dialog(i32* %17)
ret void
}

LLVM IR (-O2):
define void @free_req_ipvx_ports(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @unpost_form(i32* %0)
%6 = tail call i32 @free_form(i32* %0)
%7 = tail call i32 @free_field(i32* %1)
%8 = tail call i32 @delwin(i32* %2)
%9 = tail call i32 @del_dialog(i32* %3)
ret void
}
int internal_aa() { return 16; }


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

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

LLVM IR (-O0):
define i32 @internal_aa() {
ret i32 16
}

LLVM IR (-O2):
define i32 @internal_aa() {
ret i32 16
}
/* Variables and functions */
int look_for_symbol(void *, char *);
int detect_opencl(void *handle) {
  return look_for_symbol(handle, "clCreateBuffer");
}


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

x86 assembly (clang, -O2):
<detect_opencl>:
lea    0xee9(%rip),%rsi
jmp    1030 <look_for_symbol@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"clCreateBuffer\00"
define i32 @detect_opencl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @look_for_symbol(i8* %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"clCreateBuffer\00"
define i32 @detect_opencl(i8* %0) {
%2 = tail call i32 @look_for_symbol(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ initClassHash();
int /*<<< orphan*/ initDllHash();
void initHashMap() {
  initDllHash();
  initClassHash();
}


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

x86 assembly (clang, -O2):
<initHashMap>:
push   %rax
xor    %eax,%eax
call   1030 <initDllHash@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <initClassHash@plt>

LLVM IR (-O0):
define void @initHashMap() {
%1 = call i32 (...) @initDllHash()
%2 = call i32 (...) @initClassHash()
ret void
}

LLVM IR (-O2):
define void @initHashMap() {
%1 = tail call i32 (...) @initDllHash()
%2 = tail call i32 (...) @initClassHash()
ret void
}
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
unsigned int open(char const *, int);
int /*<<< orphan*/ printf(char *, char const *);
unsigned int open_uart(const char *dev) {
  unsigned int fd;
  fd = open(dev, O_RDWR | O_NOCTTY);
  if (fd < 0)
    printf("%s  open Failed!\n", dev);
  else
    printf("%s open Success!\n", dev);
  return fd;
}


x86 assembly (clang, -O0):
<open_uart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jae    1169 <open_uart+0x49>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <open_uart+0x59>
mov    -0x8(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_uart>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,%ebp
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str = [18 x i8] c"%s open Failed!\0A\00"
@.str.1 = [18 x i8] c"%s open Success!\0A\00"
define i32 @open_uart(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_NOCTTY
%7 = or i32 %5, %6
%8 = call i32 @open(i8* %4, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp ult i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %17
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
@.str.1 = [18 x i8] c"%s open Success!\0A\00"
define i32 @open_uart(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_NOCTTY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *proc_usage();
void proc_showusage() { printf("usage : proc %s", proc_usage()); }


x86 assembly (clang, -O0):
<proc_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <proc_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_showusage>:
push   %rax
xor    %eax,%eax
call   1040 <proc_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"usage : proc %s\00"
define void @proc_showusage() {
%1 = tail call i8* (...) @proc_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void Profiler_InitProfiler() {}


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

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

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

LLVM IR (-O2):
define void @Profiler_InitProfiler() {
ret void
}
unsigned long XWhitePixelOfScreen() {}


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

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

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

LLVM IR (-O2):
define i64 @XWhitePixelOfScreen() {
ret i64 undef
}
int fun1341() { return 1341; }


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

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

LLVM IR (-O0):
define i32 @fun1341() {
ret i32 1341
}

LLVM IR (-O2):
define i32 @fun1341() {
ret i32 1341
}
/* Type definitions */
struct ipr_dev {
  int dummy;
};

/* Variables and functions */
struct ipr_dev *find_blk_dev(char *);
struct ipr_dev *find_gen_dev(char *);
struct ipr_dev *find_dev(char *name) {
  struct ipr_dev *dev = find_blk_dev(name);
  if (!dev)
    dev = find_gen_dev(name);
  return dev;
}


x86 assembly (clang, -O0):
<find_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_blk_dev@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <find_dev+0x31>
mov    -0x8(%rbp),%rdi
call   1040 <find_gen_dev@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_dev>:
push   %rbx
mov    %rdi,%rbx
call   1030 <find_blk_dev@plt>
test   %rax,%rax
je     1130 <find_dev+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <find_gen_dev@plt>

LLVM IR (-O0):
%struct.ipr_dev = type { i32 }
define %struct.ipr_dev* @find_dev(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.ipr_dev*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.ipr_dev* @find_blk_dev(i8* %4)
store %struct.ipr_dev* %5, %struct.ipr_dev** %3
%6 = load %struct.ipr_dev*, %struct.ipr_dev** %3
%7 = icmp ne %struct.ipr_dev* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call %struct.ipr_dev* @find_gen_dev(i8* %9)
store %struct.ipr_dev* %10, %struct.ipr_dev** %3
br label %11
11: ; preds = %8, %1
%12 = load %struct.ipr_dev*, %struct.ipr_dev** %3
ret %struct.ipr_dev* %12
}

LLVM IR (-O2):
%struct.ipr_dev = type { i32 }
define %struct.ipr_dev* @find_dev(i8* %0) {
%2 = tail call %struct.ipr_dev* @find_blk_dev(i8* %0)
%3 = icmp eq %struct.ipr_dev* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.ipr_dev* @find_gen_dev(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = phi %struct.ipr_dev* [ %2, %1 ], [ %5, %4 ]
ret %struct.ipr_dev* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void print_usage() {
  puts("-----------------------------------------------------------");
  printf("Usage: --database='file' [--cores=num] [--kernelAG=num]\n");
  puts("-----------------------------------------------------------");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"-----------------------------------------------------------\00"
@.str.1 = [57 x i8] c"Usage: --database='file' [--cores=num] [--kernelAG=num]\0A\00"
define void @print_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"-----------------------------------------------------------\00"
@str = [56 x i8] c"Usage: --database='file' [--cores=num] [--kernelAG=num]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("scala> case class Foo(name: String)");
  puts("Class foo generated");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"scala> case class Foo(name: String)\00"
@.str.1 = [20 x i8] c"Class foo generated\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"scala> case class Foo(name: String)\00"
@.str.1 = [20 x i8] c"Class foo generated\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, double);
int /*<<< orphan*/ stderr;
int print_global_performance(double total_time_elapsed, int total_size,
                             int request_size) {
  double throughput;
  throughput = (total_size) / (total_time_elapsed / 1000);
  fprintf(stderr, "%d\t%f\n", request_size, (throughput / 1024) / 1024);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<print_global_performance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xed3(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_global_performance>:
push   %rax
mov    %esi,%edx
cvtsi2sd %edi,%xmm1
divsd  0xee1(%rip),%xmm0
divsd  %xmm0,%xmm1
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
movsd  0xed4(%rip),%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
lea    0xecd(%rip),%rsi
movapd %xmm1,%xmm0
call   1030 <fprintf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%d\09%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_global_performance(double %0, i32 %1, i32 %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to double
%10 = load double, double* %4
%11 = fdiv double %10, 1.000000e+03
%12 = fdiv double %9, %11
store double %12, double* %7
%13 = load i32, i32* @stderr
%14 = load i32, i32* %6
%15 = load double, double* %7
%16 = fdiv double %15, 1.024000e+03
%17 = fdiv double %16, 1.024000e+03
%18 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %14, double %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%d\09%f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @print_global_performance(double %0, i32 %1, i32 %2) {
%4 = sitofp i32 %1 to double
%5 = fdiv double %0, 1.000000e+03
%6 = fdiv double %4, %5
%7 = load i32, i32* @stderr
%8 = fmul double %6, 0x3F50000000000000
%9 = fmul double %8, 0x3F50000000000000
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, double %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
int test_imm_20int32_mem(int *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_20int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 32
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}