xunge/DecIR huggingface dataset:
/* Variables and functions */
double pow(double, int);
double ldexp(double x, int exp) { return pow(x * 2, exp); }


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xed8(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
addsd  %xmm0,%xmm0
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fmul double %5, 2.000000e+00
%7 = load i32, i32* %4
%8 = call double @pow(double %6, i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = fmul double %0, 2.000000e+00
%4 = tail call double @pow(double %3, i32 %1)
ret double %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long unsigned int getMSTime() {
  struct timeval tv;
  long unsigned int msTime = 0;
  gettimeofday(&tv, NULL);
  msTime = tv.tv_sec * 1000 + tv.tv_usec / 1000;
  return msTime;
}


x86 assembly (clang, -O0):
<getMSTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMSTime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @getMSTime() {
%1 = alloca %struct.timeval
%2 = alloca i64
store i64 0, i64* %2
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %6, %9
%11 = sext i32 %10 to i64
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @getMSTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ F();
int /*<<< orphan*/ TPRIME();
void T() {
  F();
  TPRIME();
}


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

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

LLVM IR (-O0):
define void @T() {
%1 = call i32 (...) @F()
%2 = call i32 (...) @TPRIME()
ret void
}

LLVM IR (-O2):
define void @T() {
%1 = tail call i32 (...) @F()
%2 = tail call i32 (...) @TPRIME()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xd6() {
  Assert_real((isprint(214) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1075, ("isprint should be 0 for 0xd6"));
}


x86 assembly (clang, -O0):
<t_isprint_0xd6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd6,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x433,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xd6>:
push   %rax
mov    $0xd6,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x433,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd6\00"
define void @t_isprint_0xd6() {
%1 = call i64 @isprint(i32 214)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1075, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xd6\00"
define void @t_isprint_0xd6() {
%1 = tail call i64 @isprint(i32 214)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1075, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void default_destroy(struct avfs *avfs) {}


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

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

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

LLVM IR (-O2):
%struct.avfs = type opaque
define void @default_destroy(%struct.avfs* nocapture %0) {
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      local2 = 0UL;
      while (local2 < (unsigned short)0) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] + 146565199UL) + (unsigned short)56522;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
cmp    $0x0,%eax
jge    1164 <RandomFunc+0x64>
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1153 <RandomFunc+0x53>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1135 <RandomFunc+0x35>
movzwl -0x16(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x16(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
add    $0x8bc684f,%rax
add    $0xdcca,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x505e,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
%7 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%8 = load i16*, i16** %3
%9 = getelementptr inbounds i16, i16* %8, i64 0
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 2885
%13 = trunc i32 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %7
br label %15
15: ; preds = %29, %2
%16 = load i16, i16* %7
%17 = zext i16 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %34
19: ; preds = %15
store i16 0, i16* %6
br label %20
20: ; preds = %24, %19
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i16, i16* %6
%26 = zext i16 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i16
store i16 %28, i16* %6
br label %20
29: ; preds = %20
%30 = load i16, i16* %7
%31 = zext i16 %30 to i64
%32 = add i64 %31, 2
%33 = trunc i64 %32 to i16
store i16 %33, i16* %7
br label %15
34: ; preds = %15
%35 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%36 = load i16, i16* %35
%37 = zext i16 %36 to i64
%38 = add i64 %37, 146565199
%39 = add i64 %38, 56522
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 20574
store i16 %4, i16* %1
ret void
}
void cpuid(int CPUInfo[4], int InfoType) {
  __asm__ __volatile__("cpuid"
                       : "=a"(CPUInfo[0]), "=b"(CPUInfo[1]), "=c"(CPUInfo[2]),
                         "=d"(CPUInfo[3])
                       : "a"(InfoType), "c"(0));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
xor    %ecx,%ecx
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
push   %rbx
mov    %esi,%eax
xor    %ecx,%ecx
cpuid
mov    %eax,(%rdi)
mov    %ebx,0x4(%rdi)
mov    %ecx,0x8(%rdi)
mov    %edx,0xc(%rdi)
pop    %rbx
ret

LLVM IR (-O0):
define void @cpuid(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %4
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %13, i32 0)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @cpuid(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %0
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
int zero_value(exp, filep, file_red)
register char *exp;
register struct filepointer *filep;
register struct inclist *file_red;
{
  if (cppsetup(exp, filep, file_red))
    return (16);
  else
    return (0);
}


x86 assembly (clang, -O0):
<zero_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <cppsetup@plt>
cmp    $0x0,%eax
je     114c <zero_value+0x3c>
movl   $0x10,-0x4(%rbp)
jmp    1153 <zero_value+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_value>:
push   %rax
xor    %eax,%eax
call   1030 <cppsetup@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
shl    $0x4,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.filepointer = type opaque
%struct.inclist = type opaque
define i32 @zero_value(i8* %0, %struct.filepointer* %1, %struct.inclist* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.filepointer*
%7 = alloca %struct.inclist*
store i8* %0, i8** %5
store %struct.filepointer* %1, %struct.filepointer** %6
store %struct.inclist* %2, %struct.inclist** %7
%8 = load i8*, i8** %5
%9 = load %struct.filepointer*, %struct.filepointer** %6
%10 = load %struct.inclist*, %struct.inclist** %7
%11 = call i32 (i8*, %struct.filepointer*, %struct.inclist*, ...) bitcast (i32 (...)* @cppsetup to i32 (i8*, %struct.filepointer*, %struct.inclist*, ...)*)(i8* %8, %struct.filepointer* %9, %struct.inclist* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 16, i32* %4
br label %15
14: ; preds = %3
store i32 0, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
%struct.filepointer = type opaque
%struct.inclist = type opaque
define i32 @zero_value(i8* %0, %struct.filepointer* %1, %struct.inclist* %2) {
%4 = tail call i32 (i8*, %struct.filepointer*, %struct.inclist*, ...) bitcast (i32 (...)* @cppsetup to i32 (i8*, %struct.filepointer*, %struct.inclist*, ...)*)(i8* %0, %struct.filepointer* %1, %struct.inclist* %2)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 16
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
float Ina219ShuntRawToAmps(int16_t shunt_raw, float shunt_resistor) {
  return (float)shunt_raw * 10e-6f / shunt_resistor;
}


x86 assembly (clang, -O0):
<Ina219ShuntRawToAmps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xee5(%rip),%xmm1
mulss  %xmm1,%xmm0
divss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ina219ShuntRawToAmps>:
cvtsi2ss %rdi,%xmm1
mulss  0xef3(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Ina219ShuntRawToAmps(i64 %0, float %1) {
%3 = alloca i64
%4 = alloca float
store i64 %0, i64* %3
store float %1, float* %4
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to float
%7 = fmul float %6, 0x3EE4F8B580000000
%8 = load float, float* %4
%9 = fdiv float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @Ina219ShuntRawToAmps(i64 %0, float %1) {
%3 = sitofp i64 %0 to float
%4 = fmul float %3, 0x3EE4F8B580000000
%5 = fdiv float %4, %1
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ perror(char const *);
FILE *open_or_die(const char *filename, const char *ht) {
  FILE *fp = fopen(filename, ht);
  if (fp == NULL) {
    perror(filename);
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<open_or_die>:
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   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116f <open_or_die+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_or_die>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fopen@plt>
test   %rax,%rax
je     1140 <open_or_die+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32* @open_or_die(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @perror(i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
define noalias i32* @open_or_die(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ write_double(double);
int main() {
  int i;
  double d;
  i = 42;
  d = i;
  write_double(d);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <write_double@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 42, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @write_double(double %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @write_double(double 4.200000e+01)
ret i32 0
}
int float_as_int(float val) {
  union {
    float f;
    int i;
  } u;
  u.f = val;
  return u.i;
}


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

x86 assembly (clang, -O2):
<float_as_int>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @float_as_int(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @float_as_int(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Variables and functions */
float cos(float);
float f(float x) { return 3 * x - cos(x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xeb2(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <cos@plt>
movss  0x4(%rsp),%xmm1
mulss  0xed6(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call float @cos(float %4)
%6 = fneg float %5
%7 = call float @llvm.fmuladd.f32(float 3.000000e+00, float %3, float %6)
ret float %7
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call float @cos(float %0)
%3 = fneg float %2
%4 = tail call float @llvm.fmuladd.f32(float %0, float 3.000000e+00, float %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void mypause(void) {
  fflush(stdin);
  printf("Press [Enter] to continue . . .");
  fflush(stdout);
  getchar();
}


x86 assembly (clang, -O0):
<mypause>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mypause>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@stdin = global i32 0
@.str = [32 x i8] c"Press [Enter] to continue . . .\00"
@stdout = global i32 0
define void @mypause() {
%1 = load i32, i32* @stdin
%2 = call i32 @fflush(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [32 x i8] c"Press [Enter] to continue . . .\00"
@stdout = global i32 0
define void @mypause() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @fflush(i32 %1)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @getchar()
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_push_back(struct list_head *, struct list_head *);
int /*<<< orphan*/ sys_list_del_node(struct list_head *);
void list_move_to_back(struct list_head *node, struct list_head *head) {
  sys_list_del_node(node);
  list_push_back(node, head);
}


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

x86 assembly (clang, -O2):
<list_move_to_back>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <sys_list_del_node@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_push_back@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_to_back(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @sys_list_del_node(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_push_back(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_to_back(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @sys_list_del_node(%struct.list_head* %0)
%4 = tail call i32 @list_push_back(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int const, int const);
void put_three_digits(char *buff, const int ival) {
  sprintf(buff, "%2d.%03d", ival / 1000, ival % 1000);
}


x86 assembly (clang, -O0):
<put_three_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x10(%rbp),%edx
lea    0xeb8(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_three_digits>:
movslq %esi,%rcx
imul   $0x10624dd3,%rcx,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x26,%rdx
add    %eax,%edx
imul   $0x3e8,%edx,%eax
sub    %eax,%ecx
lea    0xeca(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%2d.%03d\00"
define void @put_three_digits(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 1000
%8 = load i32, i32* %4
%9 = srem i32 %8, 1000
%10 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%2d.%03d\00"
define void @put_three_digits(i8* nocapture writeonly %0, i32 %1) {
%3 = sdiv i32 %1, 1000
%4 = srem i32 %1, 1000
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_load_tbl();
void spr_read_tbl(void *opaque, int sprn) { gen_op_load_tbl(); }


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

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

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

LLVM IR (-O2):
define void @spr_read_tbl(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @gen_op_load_tbl()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __SOCKADDR_ARG;

/* Variables and functions */
int __libc_accept4(int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                   int /*<<< orphan*/);
int accept(int fd, __SOCKADDR_ARG addrarg, socklen_t *addr_len) {
  return __libc_accept4(fd, addrarg, addr_len, 0);
}


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

x86 assembly (clang, -O2):
<accept>:
xor    %ecx,%ecx
jmp    1030 <__libc_accept4@plt>

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

LLVM IR (-O2):
define i32 @accept(i32 %0, i32 %1, i32* %2) {
%4 = tail call i32 @__libc_accept4(i32 %0, i32 %1, i32* %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_erros(int cod, char erro[]) {
  switch (cod) {
  case 1: {
    printf("Erro ao abrir arquivo %s\n", erro);
    break;
  }
  case 2: {
    printf("Erro ao escrever no arquivo %s\n", erro);
    break;
  }
  }
}


x86 assembly (clang, -O0):
<print_erros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x1,%eax
je     1144 <print_erros+0x34>
jmp    1133 <print_erros+0x23>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
je     1159 <print_erros+0x49>
jmp    1169 <print_erros+0x59>
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <print_erros+0x59>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_erros>:
cmp    $0x1,%edi
je     1126 <print_erros+0x16>
cmp    $0x2,%edi
jne    1132 <print_erros+0x22>
lea    0xef9(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xed3(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Erro ao abrir arquivo %s\0A\00"
@.str.1 = [32 x i8] c"Erro ao escrever no arquivo %s\0A\00"
define void @print_erros(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %9
]
6: ; preds = %2
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %12
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %2, %9, %6
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Erro ao abrir arquivo %s\0A\00"
@.str.1 = [32 x i8] c"Erro ao escrever no arquivo %s\0A\00"
define void @print_erros(i32 %0, i8* %1) {
switch i32 %0, label %7 [
i32 1, label %4
i32 2, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %2, %3
%5 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %2 ]
%6 = tail call i32 @printf(i8* %5, i8* %1)
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void testTortureExecute(void) {
  f(-1);
  return;
}


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

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0xffffffff,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @f(i32 -1)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @f(i32 -1)
ret void
}
void set_delay(long int delay) { return; }


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

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

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

LLVM IR (-O2):
define void @set_delay(i64 %0) {
ret void
}
int test_imm_9Eint32_mem(int *val) {
  return ((*val) & (0x9E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Eint32_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, 158
%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_9Eint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 158
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void __attribute__((regparm(2)))
Def_WRITEW(unsigned long adr, unsigned short data) {}


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

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

LLVM IR (-O0):
define void @Def_WRITEW(i64 %0, i16 zeroext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @Def_WRITEW(i64 %0, i16 zeroext %1) {
ret void
}
/* Variables and functions */
double pow(double, int);
double f2(double x) {
  double y = pow(x, 2) - 2.0;
  return y;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xecc(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
addsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @pow(double %4, i32 2)
%6 = fsub double %5, 2.000000e+00
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @pow(double %0, i32 2)
%3 = fadd double %2, -2.000000e+00
ret double %3
}
const char *cApiSystemVersion() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @cApiSystemVersion() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ main_loop(int);
int socket_connect(char *, int);
void client_start(char *ip, int port) {
  int fd_socket = socket_connect(ip, port);
  main_loop(fd_socket);
}


x86 assembly (clang, -O0):
<client_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <socket_connect@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <main_loop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_start>:
push   %rax
call   1030 <socket_connect@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <main_loop@plt>

LLVM IR (-O0):
define void @client_start(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @socket_connect(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @main_loop(i32 %9)
ret void
}

LLVM IR (-O2):
define void @client_start(i8* %0, i32 %1) {
%3 = tail call i32 @socket_connect(i8* %0, i32 %1)
%4 = tail call i32 @main_loop(i32 %3)
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int zfor_gethostbyname_ri(char const *, struct hostent *, char *, size_t,
                          struct hostent **, int *, int);
int zfor_gethostbyname_r(const char *name, struct hostent *ret, char *buf,
                         size_t buflen, struct hostent **result,
                         int *h_errnop) {
  return zfor_gethostbyname_ri(name, ret, buf, buflen, result, h_errnop, 1);
}


x86 assembly (clang, -O0):
<zfor_gethostbyname_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
movl   $0x1,(%rsp)
call   1030 <zfor_gethostbyname_ri@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfor_gethostbyname_r>:
push   %rax
movl   $0x1,(%rsp)
call   1030 <zfor_gethostbyname_ri@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @zfor_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca %struct.hostent**
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store %struct.hostent** %4, %struct.hostent*** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load %struct.hostent*, %struct.hostent** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load %struct.hostent**, %struct.hostent*** %11
%18 = load i32*, i32** %12
%19 = call i32 @zfor_gethostbyname_ri(i8* %13, %struct.hostent* %14, i8* %15, i64 %16, %struct.hostent** %17, i32* %18, i32 1)
ret i32 %19
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @zfor_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5) {
%7 = tail call i32 @zfor_gethostbyname_ri(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5, i32 1)
ret i32 %7
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_pointer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_destroy(struct wl_proxy *);
void wl_pointer_destroy(struct wl_pointer *wl_pointer) {
  wl_proxy_destroy((struct wl_proxy *)wl_pointer);
}


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

x86 assembly (clang, -O2):
<wl_pointer_destroy>:
jmp    1030 <wl_proxy_destroy@plt>

LLVM IR (-O0):
%struct.wl_pointer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_pointer_destroy(%struct.wl_pointer* %0) {
%2 = alloca %struct.wl_pointer*
store %struct.wl_pointer* %0, %struct.wl_pointer** %2
%3 = load %struct.wl_pointer*, %struct.wl_pointer** %2
%4 = bitcast %struct.wl_pointer* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_destroy(%struct.wl_proxy* %4)
ret void
}

LLVM IR (-O2):
%struct.wl_pointer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_pointer_destroy(%struct.wl_pointer* %0) {
%2 = bitcast %struct.wl_pointer* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_destroy(%struct.wl_proxy* %2)
ret void
}
void rop3_86_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_86_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)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%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_86_1_0>:
or     %esi,%edx
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_86_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* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = or i32 %27, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_86_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %4
%7 = xor i8 %1, -1
%8 = and i8 %6, %7
%9 = and i8 %5, %1
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int PMPI_Pcontrol(int);
int MPI_Pcontrol(int level) {
  ;
  return PMPI_Pcontrol(level);
}


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

x86 assembly (clang, -O2):
<MPI_Pcontrol>:
jmp    1030 <PMPI_Pcontrol@plt>

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

LLVM IR (-O2):
define i32 @MPI_Pcontrol(i32 %0) {
%2 = tail call i32 @PMPI_Pcontrol(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ merge(int, int, int);
void partition(int beg, int end) {
  int mid;
  if (beg < end) {
    mid = ((beg + end) / 2);
    partition(beg, mid);
    partition(mid + 1, end);
    merge(beg, mid, end);
  } else
    return;
}


x86 assembly (clang, -O0):
<partition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1177 <partition+0x57>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <partition@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <partition@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <merge@plt>
jmp    117c <partition+0x5c>
jmp    117c <partition+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<partition>:
cmp    %esi,%edi
jge    1160 <partition+0x40>
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1030 <partition@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1030 <partition@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @partition(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %23
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = sdiv i32 %12, 2
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = call i32 @merge(i32 %19, i32 %20, i32 %21)
br label %24
23: ; preds = %2
br label %24
24: ; preds = %23, %9
ret void
}

LLVM IR (-O2):
define void @partition(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @partition(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @partition(i32 %8, i32 %1)
%9 = tail call i32 @merge(i32 %0, i32 %7, i32 %1)
br label %4
}
/* Variables and functions */
void *memcpy(void *, void const *, size_t);
void *os_memcpy(void *s1, const void *s2, unsigned int n) {
  return memcpy(s1, s2, (size_t)n);
}


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

x86 assembly (clang, -O2):
<os_memcpy>:
mov    %edx,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @os_memcpy(i8* returned writeonly %0, i8* nocapture %1, i32 %2) {
%4 = zext i32 %2 to i64
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %4, i1 false)
ret i8* %0
}
long RB_ResetTimerA(void) {
  printf("%s \n", __func__);
  return (long)(((unsigned long)((0)) << 31) | (0));
}


x86 assembly (clang, -O0):
<RB_ResetTimerA>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"%s \0A\00"
@__func__.RB_ResetTimerA = [15 x i8] c"RB_ResetTimerA\00"
define i64 @RB_ResetTimerA() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.RB_ResetTimerA, i64 0, i64 0))
ret i64 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s \0A\00"
@__func__.RB_ResetTimerA = [15 x i8] c"RB_ResetTimerA\00"
define i64 @RB_ResetTimerA() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.RB_ResetTimerA, i64 0, i64 0))
ret i64 0
}
void gtk_widget_set_extension_events() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_set_extension_events() {
ret void
}
/* Variables and functions */
int connect_or_die();
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int snprintf(char *, int, char *, int);
void tune(int ch) {
  int fd = connect_or_die();
  char buf[32];
  int n = snprintf(buf, sizeof buf, "tune %d\n", ch);
  send(fd, buf, n, 0);
}


x86 assembly (clang, -O0):
<tune>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <connect_or_die@plt>
mov    %eax,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
lea    0xea8(%rip),%rdx
call   1050 <snprintf@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x34(%rbp),%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <connect_or_die@plt>
mov    %eax,%ebp
lea    0xeb6(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    %ebx,%ecx
call   1050 <snprintf@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"tune %d\0A\00"
define void @tune(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [32 x i8]
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 (...) @connect_or_die()
store i32 %6, i32* %3
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @snprintf(i8* %7, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @send(i32 %10, i8* %11, i32 %12, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"tune %d\0A\00"
define void @tune(i32 %0) {
%2 = alloca [32 x i8]
%3 = tail call i32 (...) @connect_or_die()
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = call i32 @send(i32 %3, i8* %4, i32 %5, i32 0)
ret void
}