xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Tn(uint64_t n) { return (n * (n + 1)) / 2; }


x86 assembly (clang, -O0):
<Tn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tn>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @Tn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @Tn(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ getargs(int, char **);
int main(int argc, char **argv) {
  getargs(argc, argv);
  while (1)
    ;
  return (EXIT_SUCCESS);
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getargs@plt>
jmp    1132 <main+0x22>

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

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @getargs(i32 %6, i8** %7)
br label %9
9: ; preds = %2, %9
br label %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @getargs(i32 %0, i8** %1)
br label %4
4: ; preds = %2, %4
br label %4
}
/* Type definitions */
typedef int mqd_t;

/* Variables and functions */
int /*<<< orphan*/ mq_close(int);
int /*<<< orphan*/ printf(char *, int);
void serverDown(mqd_t svrHndl) {
  printf("Bringing down server with mqd_t %d.\n", svrHndl);
  mq_close(svrHndl);
}


x86 assembly (clang, -O0):
<serverDown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <mq_close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serverDown>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <mq_close@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Bringing down server with mqd_t %d.\0A\00"
define void @serverDown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @mq_close(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Bringing down server with mqd_t %d.\0A\00"
define void @serverDown(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @mq_close(i32 %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int __VERIFIER_nondet_int() {
  int initialValue;
  int byteOffset = 0;
  uint8_t *initialValueAsByte = (uint8_t *)&initialValue;
  for (; byteOffset < sizeof(int); ++byteOffset) {
    initialValueAsByte[byteOffset] = 0;
  }
  return initialValue;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_int>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    113f <__VERIFIER_nondet_int+0x3f>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1113 <__VERIFIER_nondet_int+0x13>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_int() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ glPopAttrib();
int /*<<< orphan*/ printf(char *, ...);
void trace_glPopAttrib(void) {
  printf("%20s(", "glPopAttrib");
  printf(");\n");
  glPopAttrib();
}


x86 assembly (clang, -O0):
<trace_glPopAttrib>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <glPopAttrib@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_glPopAttrib>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glPopAttrib@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [12 x i8] c"glPopAttrib\00"
@.str.2 = [4 x i8] c");\0A\00"
define void @trace_glPopAttrib() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (...) @glPopAttrib()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%20s(\00"
@.str.1 = [12 x i8] c"glPopAttrib\00"
@str = [3 x i8] c");\00"
define void @trace_glPopAttrib() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @glPopAttrib()
ret void
}
/* Variables and functions */
void *memcpy_using_uint64_impl(void *, void const *, size_t);
void *memcpy(void *dst, const void *src, size_t n) {
  return memcpy_using_uint64_impl(dst, src, n);
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <memcpy_using_uint64_impl@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @memcpy_using_uint64_impl(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
int svp_is_in_range(unsigned long pfn) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @svp_is_in_range(i64 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TapeImage_Init();
void Cassette_Init(void) { TapeImage_Init(); }


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

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

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

LLVM IR (-O2):
define void @Cassette_Init() {
%1 = tail call i32 (...) @TapeImage_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BlinkNoTimerTaskC__Leds__led0On();
int /*<<< orphan*/ BlinkNoTimerTaskC__Leds__led1On();
int /*<<< orphan*/ BlinkNoTimerTaskC__Leds__led2On();
int /*<<< orphan*/ BlinkNoTimerTaskC__delay__postTask();
void BlinkNoTimerTaskC__Boot__booted(void) {
  BlinkNoTimerTaskC__Leds__led0On();
  BlinkNoTimerTaskC__Leds__led1On();
  BlinkNoTimerTaskC__Leds__led2On();
  BlinkNoTimerTaskC__delay__postTask();
}


x86 assembly (clang, -O0):
<BlinkNoTimerTaskC__Boot__booted>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <BlinkNoTimerTaskC__Leds__led0On@plt>
mov    $0x0,%al
call   1050 <BlinkNoTimerTaskC__Leds__led1On@plt>
mov    $0x0,%al
call   1030 <BlinkNoTimerTaskC__Leds__led2On@plt>
mov    $0x0,%al
call   1060 <BlinkNoTimerTaskC__delay__postTask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BlinkNoTimerTaskC__Boot__booted>:
push   %rax
xor    %eax,%eax
call   1040 <BlinkNoTimerTaskC__Leds__led0On@plt>
xor    %eax,%eax
call   1050 <BlinkNoTimerTaskC__Leds__led1On@plt>
xor    %eax,%eax
call   1030 <BlinkNoTimerTaskC__Leds__led2On@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <BlinkNoTimerTaskC__delay__postTask@plt>

LLVM IR (-O0):
define void @BlinkNoTimerTaskC__Boot__booted() {
%1 = call i32 (...) @BlinkNoTimerTaskC__Leds__led0On()
%2 = call i32 (...) @BlinkNoTimerTaskC__Leds__led1On()
%3 = call i32 (...) @BlinkNoTimerTaskC__Leds__led2On()
%4 = call i32 (...) @BlinkNoTimerTaskC__delay__postTask()
ret void
}

LLVM IR (-O2):
define void @BlinkNoTimerTaskC__Boot__booted() {
%1 = tail call i32 (...) @BlinkNoTimerTaskC__Leds__led0On()
%2 = tail call i32 (...) @BlinkNoTimerTaskC__Leds__led1On()
%3 = tail call i32 (...) @BlinkNoTimerTaskC__Leds__led2On()
%4 = tail call i32 (...) @BlinkNoTimerTaskC__delay__postTask()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void printTime(double time) {
  int hh, mm, ss;
  int delta;
  delta = (int)(time + 0.5);
  ss = delta % 60;
  delta /= 60;
  hh = delta / 60;
  mm = delta % 60;
  printf("%02d:%02d:%02d", hh, mm, ss);
}


x86 assembly (clang, -O0):
<printTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTime>:
addsd  0xee8(%rip),%xmm0
cvttsd2si %xmm0,%eax
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x5,%eax
add    %edx,%eax
imul   $0x3c,%eax,%edx
imul   $0xffffffff91a2b3c5,%rcx,%rsi
shr    $0x20,%rsi
add    %ecx,%esi
sub    %edx,%ecx
mov    %esi,%edx
shr    $0x1f,%edx
sar    $0xb,%esi
add    %edx,%esi
movslq %eax,%rdx
imul   $0xffffffff88888889,%rdx,%rax
shr    $0x20,%rax
add    %edx,%eax
mov    %eax,%edi
shr    $0x1f,%edi
sar    $0x5,%eax
add    %edi,%eax
imul   $0x3c,%eax,%eax
sub    %eax,%edx
lea    0xe90(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @printTime(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store double %0, double* %2
%7 = load double, double* %2
%8 = fadd double %7, 5.000000e-01
%9 = fptosi double %8 to i32
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = srem i32 %10, 60
store i32 %11, i32* %5
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 60
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = sdiv i32 %14, 60
store i32 %15, i32* %3
%16 = load i32, i32* %6
%17 = srem i32 %16, 60
store i32 %17, i32* %4
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %19, i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%02d:%02d:%02d\00"
define void @printTime(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = fptosi double %2 to i32
%4 = srem i32 %3, 60
%5 = sdiv i32 %3, 60
%6 = sdiv i32 %3, 3600
%7 = srem i32 %5, 60
%8 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %4)
ret void
}
/* Variables and functions */
int strlen(char *str) {
  int i = 0;
  while (*str++)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float a, b;
  b = 2.0e20 + 1.0;
  printf("%f \n", 2.0e20);
  printf("%f \n", b);
  a = b - 2.0e20;
  printf("%f \n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
lea    0xed9(%rip),%rdi
movss  0xecd(%rip),%xmm0
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe9e(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef0(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
movss  0xecd(%rip),%xmm0
call   1030 <printf@plt>
movss  0xec4(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x4425AF1D80000000, float* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float 0x4425AF1D80000000)
%5 = load float, float* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load float, float* %3
%8 = fpext float %7 to double
%9 = fsub double %8, 2.000000e+20
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = load float, float* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%f \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float 0x4425AF1D80000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float 0x4425AF1D80000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float 0x428D29CF00000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printheader(char *);
void initreference(char *name) { printheader(name); }


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

x86 assembly (clang, -O2):
<initreference>:
jmp    1030 <printheader@plt>

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

LLVM IR (-O2):
define void @initreference(i8* %0) {
%2 = tail call i32 @printheader(i8* %0)
ret void
}
/* Variables and functions */
float erff(float);
float __ocl_erf_float(float src) { return erff(src); }


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

x86 assembly (clang, -O2):
<__ocl_erf_float>:
jmp    1030 <erff@plt>

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

LLVM IR (-O2):
define float @__ocl_erf_float(float %0) {
%2 = tail call float @erff(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ CG_GameMenu_f();
void CG_EscapeKey(void) { CG_GameMenu_f(); }


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

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

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

LLVM IR (-O2):
define void @CG_EscapeKey() {
%1 = tail call i32 (...) @CG_GameMenu_f()
ret void
}
/* Variables and functions */
unsigned int OVS_SAT_MUL(unsigned int, unsigned int);
unsigned int sat_mul(unsigned int x, unsigned int y) {
  return OVS_SAT_MUL(x, y);
}


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

x86 assembly (clang, -O2):
<sat_mul>:
jmp    1030 <OVS_SAT_MUL@plt>

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

LLVM IR (-O2):
define i32 @sat_mul(i32 %0, i32 %1) {
%3 = tail call i32 @OVS_SAT_MUL(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ stat_ev_ctx_push_fmt_(char const *, char *, char const *);
void stat_ev_ctx_push_str_(const char *name, const char *str) {
  stat_ev_ctx_push_fmt_(name, "%s", str);
}


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

x86 assembly (clang, -O2):
<stat_ev_ctx_push_str_>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <stat_ev_ctx_push_fmt_@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @stat_ev_ctx_push_str_(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @stat_ev_ctx_push_fmt_(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @stat_ev_ctx_push_str_(i8* %0, i8* %1) {
%3 = tail call i32 @stat_ev_ctx_push_fmt_(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, size_t);
void uninivar_strncat(void) {
  char *ct;
  char *s;
  size_t n;
  (void)strncat(ct, s, n);
}


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

x86 assembly (clang, -O2):
<uninivar_strncat>:
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define void @uninivar_strncat() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i64
%4 = load i8*, i8** %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = call i32 @strncat(i8* %4, i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @uninivar_strncat() {
%1 = tail call i32 @strncat(i8* undef, i8* undef, i64 undef)
ret void
}
void destory_pb_env() {}


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

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

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

LLVM IR (-O2):
define void @destory_pb_env() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setU();
__attribute__((constructor)) void myInit() { setU(); }


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

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = call i32 (...) @setU()
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @myInit, i8* null }]
define void @myInit() {
%1 = tail call i32 (...) @setU()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ string_test_cpu(int, int);
int main(int argc, char **argv) {
  size_t memory = 512 * 1024 * 1024;
  printf("==============================\n");
  string_test_cpu(10000, 0);
  string_test_cpu(500000, 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x20000000,-0x18(%rbp)
20
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2710,%edi
xor    %esi,%esi
call   1030 <string_test_cpu@plt>
mov    $0x7a120,%edi
mov    $0x1,%esi
call   1030 <string_test_cpu@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2710,%edi
xor    %esi,%esi
call   1040 <string_test_cpu@plt>
mov    $0x7a120,%edi
mov    $0x1,%esi
call   1040 <string_test_cpu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"==============================\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 536870912, i64* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @string_test_cpu(i32 10000, i32 0)
%8 = call i32 @string_test_cpu(i32 500000, i32 1)
ret i32 0
}

LLVM IR (-O2):
@str = [31 x i8] c"==============================\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @string_test_cpu(i32 10000, i32 0)
%5 = tail call i32 @string_test_cpu(i32 500000, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int fn1bis() { foo(7); }


x86 assembly (clang, -O0):
<fn1bis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1bis() {
%1 = alloca i32
%2 = call i32 @foo(i32 7)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @fn1bis() {
%1 = tail call i32 @foo(i32 7)
ret i32 undef
}
int test_imm_92uint8_reg(unsigned char val) {
  return ((val) & (0x92 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_92uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x92,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_92uint8_reg>:
test   $0x92,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_92uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 146
%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_92uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -110
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *newptr;
  if ((newptr = realloc(ptr, size)) == NULL)
    err(1, "realloc()");
  return (newptr);
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115c <xrealloc+0x3c>
mov    $0x1,%edi
lea    0xea9(%rip),%rsi
call   1030 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"realloc()\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int getByte(int x, int n) {
  n = n << 3;
  x = x >> n;
  x = x & 0xff;
  return x;
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getByte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 3
store i32 %6, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = ashr i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 255
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int lower(char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%c\n", lower('H'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x48,%edi
call   1040 <lower@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x48,%edi
call   1040 <lower@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @lower(i8 signext 72)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @lower(i8 signext 72)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
float a(float x) { return x * x; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @a(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int null_media_type_id(uint8_t id) { return (0x70); }


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

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

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

LLVM IR (-O2):
define i32 @null_media_type_id(i32 %0) {
ret i32 112
}
void rop3_18_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_18_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_18_1_0>:
mov    (%rdi),%al
xor    %al,%dl
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_18_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = xor i8 %1, -1
%7 = and i8 %5, %6
%8 = and i8 %4, %1
%9 = or i8 %7, %8
store i8 %9, i8* %0
ret void
}
unsigned xrop3_202_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;
  unsigned stk3;
  stk3 = S ^ D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_202_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    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%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_202_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %eax,%edx
xor    $0xff,%edx
and    %ecx,%edx
xor    $0xff,%edx
not    %eax
and    %edx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_202_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, 255
%8 = and i32 %6, %7
%9 = xor i32 %8, 255
%10 = xor i32 %4, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int errno;
int getpeername(int, struct sockaddr *, int /*<<< orphan*/ *);
int os_getpeername(int s, struct sockaddr *name, int *namelen) {
  int retval;
  retval = getpeername(s, name, (socklen_t *)namelen);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_getpeername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <getpeername@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    114e <os_getpeername+0x3e>
xor    %eax,%eax
mov    0x2e97(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_getpeername>:
push   %rax
call   1030 <getpeername@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_getpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32*, i32** %6
%11 = call i32 @getpeername(i32 %8, %struct.sockaddr* %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @errno
%16 = sub nsw i32 0, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %14, %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@errno = global i32 0
define i32 @os_getpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @getpeername(i32 %0, %struct.sockaddr* %1, i32* %2)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int mpiexec_usage(const char *str) {
  fprintf(stderr, "Usage: %s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<mpiexec_usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Usage: %s\0A\00"
define i32 @mpiexec_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
int is_tab(char c) { return c == '\t'; }


x86 assembly (clang, -O0):
<is_tab>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_tab>:
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_tab(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 9
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_tab(i8 signext %0) {
%2 = icmp eq i8 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Here_CP();
int /*<<< orphan*/ Pl_Jump(char *);
int /*<<< orphan*/ Prep_CP();
void Pl_Call(char *label) {
  Prep_CP();
  Pl_Jump(label);
  Here_CP();
}


x86 assembly (clang, -O0):
<Pl_Call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <Prep_CP@plt>
mov    -0x8(%rbp),%rdi
call   1030 <Pl_Jump@plt>
mov    $0x0,%al
call   1040 <Here_CP@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pl_Call>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <Prep_CP@plt>
mov    %rbx,%rdi
call   1030 <Pl_Jump@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <Here_CP@plt>

LLVM IR (-O0):
define void @Pl_Call(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @Prep_CP()
%4 = load i8*, i8** %2
%5 = call i32 @Pl_Jump(i8* %4)
%6 = call i32 (...) @Here_CP()
ret void
}

LLVM IR (-O2):
define void @Pl_Call(i8* %0) {
%2 = tail call i32 (...) @Prep_CP()
%3 = tail call i32 @Pl_Jump(i8* %0)
%4 = tail call i32 (...) @Here_CP()
ret void
}
long long int longlongint_ignoring_signedlongint(long long int x,
                                                 signed long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longlongint_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
void fz(int *y) {
  char x;
  asm(""
      : "=@cc"
        "z"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fz+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fz>:
jne    1103 <fz+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fz(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@ccz},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fz(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@ccz},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ finish();
int /*<<< orphan*/ najeResolveReferences();
int /*<<< orphan*/ najeSync();
int /*<<< orphan*/ najeWriteMap();
int /*<<< orphan*/ prepare();
int /*<<< orphan*/ process_file(char *);
int /*<<< orphan*/ save();
int32_t main(int argc, char **argv) {
  prepare();
  process_file(argv[1]);
  najeSync();
  najeResolveReferences();
  najeSync();
  finish();
  save();
  najeWriteMap();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <prepare@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <process_file@plt>
mov    $0x0,%al
call   1090 <najeSync@plt>
mov    $0x0,%al
call   1080 <najeResolveReferences@plt>
mov    $0x0,%al
call   1090 <najeSync@plt>
mov    $0x0,%al
call   1030 <finish@plt>
mov    $0x0,%al
call   1050 <save@plt>
mov    $0x0,%al
call   1060 <najeWriteMap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1070 <prepare@plt>
mov    0x8(%rbx),%rdi
call   1040 <process_file@plt>
xor    %eax,%eax
call   1090 <najeSync@plt>
xor    %eax,%eax
call   1080 <najeResolveReferences@plt>
xor    %eax,%eax
call   1090 <najeSync@plt>
xor    %eax,%eax
call   1030 <finish@plt>
xor    %eax,%eax
call   1050 <save@plt>
xor    %eax,%eax
call   1060 <najeWriteMap@plt>
xor    %eax,%eax
pop    %rbx
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 (...) @prepare()
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @process_file(i8* %9)
%11 = call i32 (...) @najeSync()
%12 = call i32 (...) @najeResolveReferences()
%13 = call i32 (...) @najeSync()
%14 = call i32 (...) @finish()
%15 = call i32 (...) @save()
%16 = call i32 (...) @najeWriteMap()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @prepare()
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @process_file(i8* %5)
%7 = tail call i32 (...) @najeSync()
%8 = tail call i32 (...) @najeResolveReferences()
%9 = tail call i32 (...) @najeSync()
%10 = tail call i32 (...) @finish()
%11 = tail call i32 (...) @save()
%12 = tail call i32 (...) @najeWriteMap()
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t get_displacement(uint64_t capacity, uint64_t slot, uint64_t hash) {
  uint64_t wanted_slot = hash % capacity;
  return (capacity + (slot - wanted_slot)) % capacity;
}


x86 assembly (clang, -O0):
<get_displacement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
add    %ecx,%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_displacement>:
mov    %edx,%eax
cltd
idiv   %edi
lea    (%rsi,%rdi,1),%eax
sub    %edx,%eax
cltd
idiv   %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_displacement(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = add nsw i32 %11, %14
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @get_displacement(i32 %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %0
%5 = add i32 %1, %0
%6 = sub i32 %5, %4
%7 = srem i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void HandleMainMenu(int whichone) {
  switch (whichone) {
  case 9:
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<HandleMainMenu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x9,%eax
jne    1133 <HandleMainMenu+0x23>
jmp    112c <HandleMainMenu+0x1c>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleMainMenu>:
cmp    $0x9,%edi
je     1116 <HandleMainMenu+0x6>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @HandleMainMenu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 9, label %4
]
4: ; preds = %1
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %1
ret void
}

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