xunge/DecIR huggingface dataset:
int f(int n) { return +n; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(unsigned long);
int /*<<< orphan*/ printf(char *, int, unsigned long);
__attribute__((__noreturn__)) void exitfunc3(int status, void *arg) {
  printf("Executing exitfunc"
         "3"
         " (status=%d, arg=%lu)\n",
         status, (unsigned long)arg);
  exit((unsigned long)arg);
}


x86 assembly (clang, -O0):
<exitfunc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc3>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Executing exitfunc3 (status=%d, arg=%lu)\0A\00"
define void @exitfunc3(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
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %5, i64 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @exit(i64 %10)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"Executing exitfunc3 (status=%d, arg=%lu)\0A\00"
define void @exitfunc3(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = tail call i32 @exit(i64 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_LED(unsigned short led, unsigned short power_color,
                unsigned short power_intensity) {
  char data[] = {139, led, power_color, power_intensity};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_LED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movb   $0x8b,-0xa(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%ax
mov    %al,-0x8(%rbp)
mov    -0x6(%rbp),%ax
mov    %al,-0x7(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_LED>:
push   %rax
movb   $0x8b,0x4(%rsp)
mov    %dil,0x5(%rsp)
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_LED(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca [4 x i8]
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
store i8 -117, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i16, i16* %4
%11 = trunc i16 %10 to i8
store i8 %11, i8* %9
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = load i16, i16* %5
%14 = trunc i16 %13 to i8
store i8 %14, i8* %12
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = load i16, i16* %6
%17 = trunc i16 %16 to i8
store i8 %17, i8* %15
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%19 = call i32 @SerialWriteString(i8* %18)
ret void
}

LLVM IR (-O2):
define void @iRobot_LED(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 -117, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%7 = trunc i16 %0 to i8
store i8 %7, i8* %6
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%9 = trunc i16 %1 to i8
store i8 %9, i8* %8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%11 = trunc i16 %2 to i8
store i8 %11, i8* %10
%12 = call i32 @SerialWriteString(i8* %5)
ret void
}
/* Variables and functions */
double M_PI;
double deg2rad(double degrees) {
  double radval;
  radval = degrees * M_PI / 180.0;
  return (radval);
}


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ed3(%rip),%rax
mulsd  (%rax),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = load double, double* @M_PI
%6 = fmul double %4, %5
%7 = fdiv double %6, 1.800000e+02
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
void sgx_debug_load_state_add_element() {}


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

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

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

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


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

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

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

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


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

x86 assembly (clang, -O2):
<nhan>:
imul   %esi,%edi
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @nhan(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 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @nhan(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ ArrayFunction(int *);
int main(int argc, char *argv[]) {
  int var = 1337;
  ArrayFunction(&var);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x539,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ArrayFunction@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1337, i32* %3
%5 = call i32 @ArrayFunction(i32* %3)
ret i32 0
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ vectorio(int, struct iovec const *, int, int);
ssize_t readv(int fildes, const struct iovec *iov, int iovcnt) {
  return vectorio(fildes, iov, iovcnt, 1);
}


x86 assembly (clang, -O0):
<readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <vectorio@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readv>:
mov    $0x1,%ecx
jmp    1030 <vectorio@plt>

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

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = tail call i32 @vectorio(i32 %0, %struct.iovec* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FirmwareIAPObjHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FirmwareIAPObjRequestUpdate() {
  UAVObjRequestUpdate(FirmwareIAPObjHandle());
}


x86 assembly (clang, -O0):
<FirmwareIAPObjRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FirmwareIAPObjHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FirmwareIAPObjRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <FirmwareIAPObjHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @FirmwareIAPObjRequestUpdate() {
%1 = call i32 (...) @FirmwareIAPObjHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FirmwareIAPObjRequestUpdate() {
%1 = tail call i32 (...) @FirmwareIAPObjHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int another() {
  int i = 1;
  sizeof(char[i++]);
  return i;
}


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

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

LLVM IR (-O0):
define i32 @another() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = zext i32 %2 to i64
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @another() {
ret i32 2
}
__attribute__((always_)) unsigned int fn4(unsigned short x) {
  unsigned len = x;
  if (len == ((1 << 16) - 1))
    return 1 << 16;
  return len;
}


x86 assembly (clang, -O0):
<fn4>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xffff,-0xc(%rbp)
jne    112b <fn4+0x2b>
movl   $0x10000,-0x4(%rbp)
jmp    1131 <fn4+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn4>:
cmp    $0xffff,%di
mov    $0x10000,%eax
cmovne %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn4(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 65535
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 65536, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @fn4(i16 zeroext %0) {
%2 = icmp eq i16 %0, -1
%3 = zext i16 %0 to i32
%4 = select i1 %2, i32 65536, i32 %3
ret i32 %4
}
void thread_table(void) {}


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

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

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

LLVM IR (-O2):
define void @thread_table() {
ret void
}
void _M2_world_finish(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @_M2_world_finish(i32 %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t icl_xz_windowSize(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @icl_xz_windowSize() {
ret i32 -1
}
int fun_pp_in_so(int **x, int **y) { return 20 + **x + **y; }


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

x86 assembly (clang, -O2):
<fun_pp_in_so>:
mov    (%rdi),%rax
mov    (%rax),%eax
mov    (%rsi),%rcx
mov    (%rcx),%ecx
add    %ecx,%eax
add    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @fun_pp_in_so(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** %5
%7 = load i32, i32* %6
%8 = add nsw i32 20, %7
%9 = load i32**, i32*** %4
%10 = load i32*, i32** %9
%11 = load i32, i32* %10
%12 = add nsw i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @fun_pp_in_so(i32** nocapture %0, i32** nocapture %1) {
%3 = load i32*, i32** %0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 20
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void printTitle() {
  fprintf(stderr, "Multi-threaded Distance Generator ");
  fprintf(stderr, "(C) 2015-2016 LRR-TUM v%s\n", "0.2");
}


x86 assembly (clang, -O0):
<printTitle>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xee8(%rip),%rsi
lea    0xefc(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTitle>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef2(%rip),%rsi
lea    0xf06(%rip),%rdx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Multi-threaded Distance Generator \00"
@.str.1 = [27 x i8] c"(C) 2015-2016 LRR-TUM v%s\0A\00"
@.str.2 = [4 x i8] c"0.2\00"
define void @printTitle() {
%1 = load i32, i32* @stderr
%2 = call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Multi-threaded Distance Generator \00"
@.str.1 = [27 x i8] c"(C) 2015-2016 LRR-TUM v%s\0A\00"
@.str.2 = [4 x i8] c"0.2\00"
define void @printTitle() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__40__IO__makeInput();
void Msp430Adc12ImplP__Port60__makeInput(void) {
  HplMsp430GeneralIOP__40__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port60__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__40__IO__makeInput()
ret void
}
int notifier_with_return_list_notify() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @notifier_with_return_list_notify() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, ...);
void block(int fd) {
  int f;
  if ((f = fcntl(fd, F_GETFL)) < 0)
    return;
  f &= ~O_NONBLOCK;
  fcntl(fd, F_SETFL, f);
}


x86 assembly (clang, -O0):
<block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    113f <block+0x2f>
jmp    1167 <block+0x57>
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1149 <block+0x39>
mov    0x2eba(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 (i32, i32, ...) @fcntl(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %18
9: ; preds = %1
%10 = load i32, i32* @O_NONBLOCK
%11 = xor i32 %10, -1
%12 = load i32, i32* %3
%13 = and i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* @F_SETFL
%16 = load i32, i32* %3
%17 = call i32 (i32, i32, ...) @fcntl(i32 %14, i32 %15, i32 %16)
br label %18
18: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
@F_SETFL = global i32 0
define void @block(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %2)
%4 = icmp slt i32 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @O_NONBLOCK
%7 = xor i32 %6, -1
%8 = and i32 %3, %7
%9 = load i32, i32* @F_SETFL
%10 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %9, i32 %8)
br label %11
11: ; preds = %1, %5
ret void
}
int dbg_debugfs_exit_fs(struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_debugfs_exit_fs(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int a = 2;
  int b = 1;
  __VERIFIER_assert(a < b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
%8 = call i32 @__VERIFIER_assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, short, short, short);
int main() {
  short x = 100u;
  printf("dec = %d; octal = %o; hex = %x\n", x, x, x);
  printf("dec = %#d; octal = %#o; hex = %#x\n", x, x, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x64,-0x6(%rbp)
mov    -0x6(%rbp),%cx
mov    -0x6(%rbp),%ax
lea    0xecc(%rip),%rdi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x6(%rbp),%ecx
call   1030 <printf@plt>
mov    -0x6(%rbp),%cx
mov    -0x6(%rbp),%ax
lea    0xece(%rip),%rdi
movswl %cx,%esi
movswl %ax,%edx
movswl -0x6(%rbp),%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [35 x i8] c"dec = %#d; octal = %#o; hex = %#x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
store i32 0, i32* %1
store i16 100, i16* %2
%3 = load i16, i16* %2
%4 = load i16, i16* %2
%5 = load i16, i16* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 signext %3, i16 signext %4, i16 signext %5)
%7 = load i16, i16* %2
%8 = load i16, i16* %2
%9 = load i16, i16* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i16 signext %7, i16 signext %8, i16 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"dec = %d; octal = %o; hex = %x\0A\00"
@.str.1 = [35 x i8] c"dec = %#d; octal = %#o; hex = %#x\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 signext 100, i16 signext 100, i16 signext 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i16 signext 100, i16 signext 100, i16 signext 100)
ret i32 0
}
void g_value_get_double() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_double() {
ret void
}
int do_383() { return 383; }


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

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

LLVM IR (-O0):
define i32 @do_383() {
ret i32 383
}

LLVM IR (-O2):
define i32 @do_383() {
ret i32 383
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("************\n");
  printf("name\tname\n");
  printf("%8s\n", "name");
  printf("%-8s\n", "name");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
lea    0xed6(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"************\0A\00"
@.str.1 = [11 x i8] c"name\09name\0A\00"
@.str.2 = [5 x i8] c"%8s\0A\00"
@.str.3 = [5 x i8] c"name\00"
@.str.4 = [6 x i8] c"%-8s\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c"%8s\0A\00"
@.str.3 = [5 x i8] c"name\00"
@.str.4 = [6 x i8] c"%-8s\0A\00"
@str = [13 x i8] c"************\00"
@str.5 = [10 x i8] c"name\09name\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ countSort(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char arr[] = "geeksforgeeks";
  countSort(arr);
  printf("Sorted character array is %sn", arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rdi
call   1030 <countSort@plt>
lea    -0x12(%rbp),%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x736b656567726f,%rax
mov    %rax,0x6(%rsp)
movabs $0x726f66736b656567,%rax
66 6f 72
mov    %rax,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <countSort@plt>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [14 x i8] c"geeksforgeeks\00"
@.str = [30 x i8] c"Sorted character array is %sn\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
store i32 0, i32* %1
%3 = bitcast [14 x i8]* %2 to i8*
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 @countSort(i8* %4)
%6 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [14 x i8] c"geeksforgeeks\00"
@.str = [30 x i8] c"Sorted character array is %sn\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @countSort(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void __syslog_chk(int pri, int flag, const char *fmt, ...) {}


x86 assembly (clang, -O0):
<__syslog_chk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__syslog_chk(i32 %0, i32 %1, i8* %2, ...) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @__syslog_chk(i32 %0, i32 %1, i8* nocapture %2, ...) {
ret void
}
__attribute__((always_)) int mpol_set_shared_policy(struct shared_policy *info,
                                                    struct vm_area_struct *vma,
                                                    struct mempolicy *new) {
  return -22;
}


x86 assembly (clang, -O0):
<mpol_set_shared_policy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffea,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.shared_policy = type opaque
%struct.vm_area_struct = type opaque
%struct.mempolicy = type opaque
define i32 @mpol_set_shared_policy(%struct.shared_policy* %0, %struct.vm_area_struct* %1, %struct.mempolicy* %2) {
%4 = alloca %struct.shared_policy*
%5 = alloca %struct.vm_area_struct*
%6 = alloca %struct.mempolicy*
store %struct.shared_policy* %0, %struct.shared_policy** %4
store %struct.vm_area_struct* %1, %struct.vm_area_struct** %5
store %struct.mempolicy* %2, %struct.mempolicy** %6
ret i32 -22
}

LLVM IR (-O2):
%struct.shared_policy = type opaque
%struct.vm_area_struct = type opaque
%struct.mempolicy = type opaque
define i32 @mpol_set_shared_policy(%struct.shared_policy* nocapture readnone %0, %struct.vm_area_struct* nocapture readnone %1, %struct.mempolicy* nocapture readnone %2) {
ret i32 -22
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void _local_free(void *ptr) { free(*(void **)ptr); }


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

x86 assembly (clang, -O2):
<_local_free>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @_local_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @_local_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
scalar_t__ strlen(char const *);
char *xmemdup(char const *, scalar_t__);
char *xstrdup(const char *s) {
  if (!s)
    return NULL;
  return xmemdup(s, strlen(s) + 1);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1169 <xstrdup+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <xmemdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
test   %rdi,%rdi
je     113b <xstrdup+0x1b>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <xmemdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @xmemdup(i8* %0, i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %8
}
int is_line(char character) {
  int temp_ascii = (int)character;
  if (temp_ascii == 10) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_line>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    1127 <is_line+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <is_line+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_line(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_line(i8 signext %0) {
%2 = icmp eq i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
double f4_sum_cb_long(long (*cb)()) {
  long v = cb();
  return ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_cb_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_cb_long>:
push   %rax
xor    %eax,%eax
call   *%rdi
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_sum_cb_long(i64 (...)* %0) {
%2 = alloca i64 (...)*
%3 = alloca i64
store i64 (...)* %0, i64 (...)** %2
%4 = load i64 (...)*, i64 (...)** %2
%5 = call i64 (...) %4()
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @f4_sum_cb_long(i64 (...)* nocapture %0) {
%2 = tail call i64 (...) %0()
%3 = sitofp i64 %2 to double
ret double %3
}
lt(a, b) { return a < b; }


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @lt(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int dns_opt_cmp(const struct dns_opt *a, const struct dns_opt *b) { return 0; }


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

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

LLVM IR (-O0):
%struct.dns_opt = type opaque
define i32 @dns_opt_cmp(%struct.dns_opt* %0, %struct.dns_opt* %1) {
%3 = alloca %struct.dns_opt*
%4 = alloca %struct.dns_opt*
store %struct.dns_opt* %0, %struct.dns_opt** %3
store %struct.dns_opt* %1, %struct.dns_opt** %4
ret i32 0
}

LLVM IR (-O2):
%struct.dns_opt = type opaque
define i32 @dns_opt_cmp(%struct.dns_opt* nocapture readnone %0, %struct.dns_opt* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(double *);
int /*<<< orphan*/ gravityOnMoon(double);
int /*<<< orphan*/ printf(char *);
int main() {
  double weightOnErth;
  printf("What's your weight on the Earth? ");
  checkInput(&weightOnErth);
  gravityOnMoon(weightOnErth);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1040 <checkInput@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <gravityOnMoon@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rdi
call   1040 <checkInput@plt>
movsd  (%rsp),%xmm0
call   1050 <gravityOnMoon@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"What's your weight on the Earth? \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(double* %2)
%5 = load double, double* %2
%6 = call i32 @gravityOnMoon(double %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [34 x i8] c"What's your weight on the Earth? \00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @checkInput(double* %1)
%5 = load double, double* %1
%6 = call i32 @gravityOnMoon(double %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Type definitions */
struct Position {
  int dummy;
};
struct Jelly {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_proximity_to_list(struct Jelly *, struct Position *);
void proximity_sensed(struct Jelly *jelly, struct Position *position) {
  add_proximity_to_list(jelly, position);
}


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

x86 assembly (clang, -O2):
<proximity_sensed>:
jmp    1030 <add_proximity_to_list@plt>

LLVM IR (-O0):
%struct.Jelly = type { i32 }
%struct.Position = type { i32 }
define void @proximity_sensed(%struct.Jelly* %0, %struct.Position* %1) {
%3 = alloca %struct.Jelly*
%4 = alloca %struct.Position*
store %struct.Jelly* %0, %struct.Jelly** %3
store %struct.Position* %1, %struct.Position** %4
%5 = load %struct.Jelly*, %struct.Jelly** %3
%6 = load %struct.Position*, %struct.Position** %4
%7 = call i32 @add_proximity_to_list(%struct.Jelly* %5, %struct.Position* %6)
ret void
}

LLVM IR (-O2):
%struct.Jelly = type { i32 }
%struct.Position = type { i32 }
define void @proximity_sensed(%struct.Jelly* %0, %struct.Position* %1) {
%3 = tail call i32 @add_proximity_to_list(%struct.Jelly* %0, %struct.Position* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int main() {
  char *s = "123";
  free(s);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define i32 @main() {
%1 = tail call i32 @free(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned long SysCtlPWMClockGet(void) {
  ;
  if (!((*((volatile unsigned long *)(0x400FE060))) & 0x00100000)) {
    return (0x00000000);
  } else {
    return ((*((volatile unsigned long *)(0x400FE060))) &
            (0x00100000 | 0x000E0000));
  }
}


x86 assembly (clang, -O0):
<SysCtlPWMClockGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe060,%eax
mov    (%rax),%rax
and    $0x100000,%rax
cmp    $0x0,%rax
jne    1129 <SysCtlPWMClockGet+0x29>
movq   $0x0,-0x8(%rbp)
jmp    113b <SysCtlPWMClockGet+0x3b>
mov    $0x400fe060,%eax
mov    (%rax),%rax
and    $0x1e0000,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPWMClockGet>:
testq  $0x100000,0x400fe060
jne    1111 <SysCtlPWMClockGet+0x11>
xor    %eax,%eax
ret
mov    0x400fe060,%rax
40
and    $0x1e0000,%eax
ret

LLVM IR (-O0):
define i64 @SysCtlPWMClockGet() {
%1 = alloca i64
%2 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%3 = and i64 %2, 1048576
%4 = icmp ne i64 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i64 0, i64* %1
br label %9
6: ; preds = %0
%7 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%8 = and i64 %7, 1966080
store i64 %8, i64* %1
br label %9
9: ; preds = %6, %5
%10 = load i64, i64* %1
ret i64 %10
}

LLVM IR (-O2):
define i64 @SysCtlPWMClockGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%2 = and i64 %1, 1048576
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%6 = and i64 %5, 1966080
br label %7
7: ; preds = %0, %4
%8 = phi i64 [ %6, %4 ], [ 0, %0 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  scanf("%i", &x);
  printf("You entered the value %i\n", x);
  printf("Address %x\n", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [26 x i8] c"You entered the value %i\0A\00"
@.str.2 = [12 x i8] c"Address %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [26 x i8] c"You entered the value %i\0A\00"
@.str.2 = [12 x i8] c"Address %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct surface {
  int dummy;
};

/* Variables and functions */
struct surface *combine_densities(struct surface *, struct surface *, double);
struct surface *subtract_densities(struct surface *den1, struct surface *den2) {
  struct surface *den;
  den = combine_densities(den1, den2, (double)(-1.0));
  return (den);
}


x86 assembly (clang, -O0):
<subtract_densities>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movsd  0xed0(%rip),%xmm0
call   1030 <combine_densities@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subtract_densities>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <combine_densities@plt>

LLVM IR (-O0):
%struct.surface = type { i32 }
define %struct.surface* @subtract_densities(%struct.surface* %0, %struct.surface* %1) {
%3 = alloca %struct.surface*
%4 = alloca %struct.surface*
%5 = alloca %struct.surface*
store %struct.surface* %0, %struct.surface** %3
store %struct.surface* %1, %struct.surface** %4
%6 = load %struct.surface*, %struct.surface** %3
%7 = load %struct.surface*, %struct.surface** %4
%8 = call %struct.surface* @combine_densities(%struct.surface* %6, %struct.surface* %7, double -1.000000e+00)
store %struct.surface* %8, %struct.surface** %5
%9 = load %struct.surface*, %struct.surface** %5
ret %struct.surface* %9
}

LLVM IR (-O2):
%struct.surface = type { i32 }
define %struct.surface* @subtract_densities(%struct.surface* %0, %struct.surface* %1) {
%3 = tail call %struct.surface* @combine_densities(%struct.surface* %0, %struct.surface* %1, double -1.000000e+00)
ret %struct.surface* %3
}