xunge/DecIR huggingface dataset:
int test_if(int x) {
  if (x <= 0) {
    if (x <= 2) {
      return x + 1;
    }
    return x;
  } else {
    return x - 4;
  }
}


x86 assembly (clang, -O0):
<test_if>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1134 <test_if+0x34>
cmpl   $0x2,-0x8(%rbp)
jg     1129 <test_if+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <test_if+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <test_if+0x3d>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_if>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
lea    (%rax,%rax,4),%eax
add    %edi,%eax
add    $0xfffffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @test_if(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i32 1, i32 -4
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ wdctl_command(int);
void wdctl_del_trusted_pan_domains(void) { wdctl_command(29); }


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

x86 assembly (clang, -O2):
<wdctl_del_trusted_pan_domains>:
mov    $0x1d,%edi
jmp    1030 <wdctl_command@plt>

LLVM IR (-O0):
define void @wdctl_del_trusted_pan_domains() {
%1 = call i32 @wdctl_command(i32 29)
ret void
}

LLVM IR (-O2):
define void @wdctl_del_trusted_pan_domains() {
%1 = tail call i32 @wdctl_command(i32 29)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main(void) {
  char s[] = "ABCDE", *p = s + 5;
  printf("%d", p[-1] - *(p - 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl -0x4(%rcx),%ecx
sub    %ecx,%eax
lea    0xeae(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"ABCDE\00"
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [6 x i8]* %2 to i8*
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds i8, i8* %5, i64 5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 -4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %10, %14
%16 = trunc i32 %15 to i8
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext 3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ clientSend();
int /*<<< orphan*/ serverDown(int /*<<< orphan*/);
int /*<<< orphan*/ serverReceive(int /*<<< orphan*/);
int /*<<< orphan*/ serverUp();
int main(void) {
  mqd_t svrHndl;
  svrHndl = serverUp();
  clientSend();
  serverReceive(svrHndl);
  serverDown(svrHndl);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <serverUp@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <clientSend@plt>
mov    -0x8(%rbp),%edi
call   1030 <serverReceive@plt>
mov    -0x8(%rbp),%edi
call   1060 <serverDown@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <serverUp@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <clientSend@plt>
mov    %ebx,%edi
call   1030 <serverReceive@plt>
mov    %ebx,%edi
call   1060 <serverDown@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @serverUp()
store i32 %3, i32* %2
%4 = call i32 (...) @clientSend()
%5 = load i32, i32* %2
%6 = call i32 @serverReceive(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @serverDown(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @serverUp()
%2 = tail call i32 (...) @clientSend()
%3 = tail call i32 @serverReceive(i32 %1)
%4 = tail call i32 @serverDown(i32 %1)
ret i32 0
}
/* Variables and functions */
double lgamma(double const);
double entropy(const double s) {
  if (s < 1e-7)
    return 0.0;
  else
    return lgamma(s);
}


x86 assembly (clang, -O0):
<entropy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <entropy+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <entropy+0x3c>
movsd  -0x10(%rbp),%xmm0
call   1030 <lgamma@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entropy>:
movsd  0xee8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1123 <entropy+0x13>
xorpd  %xmm0,%xmm0
ret
jmp    1030 <lgamma@plt>

LLVM IR (-O0):
define double @entropy(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0x3E7AD7F29ABCAF48
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
7: ; preds = %1
%8 = load double, double* %3
%9 = call double @lgamma(double %8)
store double %9, double* %2
br label %10
10: ; preds = %7, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @entropy(double %0) {
%2 = fcmp olt double %0, 0x3E7AD7F29ABCAF48
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call double @lgamma(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
__attribute__((no, noclone)) unsigned short foo7(unsigned short arg) {
  unsigned short ret = 1;
  if (arg + 1 < ((!1) ? -(1L << (sizeof(short) * 8 - 1)) : 0) + 1 ||
      arg + 1 > ((!1) ? ((1L << (sizeof(short) * 8 - 1)) - 1)
                      : ((1L << (sizeof(short) * 8)) - 1)) -
                    1)
    return ret;
  arg = arg + 1;
  ret = (unsigned char)arg;
  return arg;
}


x86 assembly (clang, -O0):
<foo7>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0x1,%rax
jl     1139 <foo7+0x39>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmp    $0xfffe,%rax
jle    1146 <foo7+0x46>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1164 <foo7+0x64>
movzwl -0x4(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x4(%rbp)
mov    -0x4(%rbp),%ax
movzbl %al,%eax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo7>:
lea    0x1(%rdi),%ecx
cmp    $0xfffe,%di
mov    $0x1,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @foo7(i16 zeroext %0) {
%2 = add i16 %0, 1
%3 = icmp ugt i16 %0, -3
%4 = select i1 %3, i16 1, i16 %2
ret i16 %4
}
char toLower(char c) {
  if (c >= 65 && c <= 90) {
    return c + 32;
  }
  return c;
}


x86 assembly (clang, -O0):
<toLower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <toLower+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <toLower+0x33>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <toLower+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLower>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @toLower(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @toLower(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, 32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_string(char *);
int main() {
  char t[] = "Hello world!";
  print_string(t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x21646c726f7720,%rax
mov    %rax,0xd(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <print_string@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.t = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
store i32 0, i32* %1
%3 = bitcast [13 x i8]* %2 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 @print_string(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.t = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @print_string(i8* %2)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ y;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
int get_XKeyEvent_y(void *_p) { return (int)((XKeyEvent *)_p)->y; }


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

x86 assembly (clang, -O2):
<get_XKeyEvent_y>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_XKeyEvent_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void waitEmpty(void) {}


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

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

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

LLVM IR (-O2):
define void @waitEmpty() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;
typedef int /*<<< orphan*/ __CONST_SOCKADDR_ARG;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __connect(int fd, __CONST_SOCKADDR_ARG addr, socklen_t len) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__connect>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__connect(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* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__connect(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *offtime_u(int /*<<< orphan*/ const, int /*<<< orphan*/, struct tm *);
int /*<<< orphan*/ timezone;
int /*<<< orphan*/ tzset();
struct tm *_localtime_r(const time_t *timep, struct tm *p_tm) {
  struct tm *rt;
  tzset();
  rt = offtime_u(*timep, -timezone, p_tm);
  return (rt);
}


x86 assembly (clang, -O0):
<_localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <tzset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    0x2e9a(%rip),%rax
sub    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <offtime_u@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_localtime_r>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <tzset@plt>
mov    (%rbx),%edi
mov    0x2ea4(%rip),%rax
sub    (%rax),%ebp
mov    %ebp,%esi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <offtime_u@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@timezone = global i32 0
define %struct.tm* @_localtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca i32*
%4 = alloca %struct.tm*
%5 = alloca %struct.tm*
store i32* %0, i32** %3
store %struct.tm* %1, %struct.tm** %4
%6 = call i32 (...) @tzset()
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i32, i32* @timezone
%10 = sub nsw i32 0, %9
%11 = load %struct.tm*, %struct.tm** %4
%12 = call %struct.tm* @offtime_u(i32 %8, i32 %10, %struct.tm* %11)
store %struct.tm* %12, %struct.tm** %5
%13 = load %struct.tm*, %struct.tm** %5
ret %struct.tm* %13
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@timezone = global i32 0
define %struct.tm* @_localtime_r(i32* nocapture %0, %struct.tm* %1) {
%3 = tail call i32 (...) @tzset()
%4 = load i32, i32* %0
%5 = load i32, i32* @timezone
%6 = sub nsw i32 0, %5
%7 = tail call %struct.tm* @offtime_u(i32 %4, i32 %6, %struct.tm* %1)
ret %struct.tm* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[] = {1, 2, 3, 8, 5};
  int *arptr = arr;
  int b = 3;
  printf("%d\n", arptr[b]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x3,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 1, i32 2, i32 3, i32 8, i32 5]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca i32*
%3 = alloca i32
%4 = bitcast [5 x i32]* %1 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32* %5, i32** %2
store i32 3, i32* %3
%6 = load i32*, i32** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int moreprolog(char *);
int /*<<< orphan*/ readpages();
int /*<<< orphan*/ trailer();
int /*<<< orphan*/ writepages();
reverse() {
  if (moreprolog("%%EndProlog\n") == 1) {
    readpages();
    writepages();
    trailer();
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <moreprolog@plt>
cmp    $0x1,%eax
jne    1172 <reverse+0x32>
mov    $0x0,%al
call   1030 <readpages@plt>
mov    $0x0,%al
call   1050 <writepages@plt>
mov    $0x0,%al
call   1060 <trailer@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <moreprolog@plt>
cmp    $0x1,%eax
jne    1167 <reverse+0x27>
xor    %eax,%eax
call   1030 <readpages@plt>
xor    %eax,%eax
call   1050 <writepages@plt>
xor    %eax,%eax
call   1060 <trailer@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%%EndProlog\0A\00"
define i32 @reverse() {
%1 = alloca i32
%2 = call i32 @moreprolog(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 (...) @readpages()
%6 = call i32 (...) @writepages()
%7 = call i32 (...) @trailer()
br label %8
8: ; preds = %4, %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"%%EndProlog\0A\00"
define i32 @reverse() {
%1 = tail call i32 @moreprolog(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @readpages()
%5 = tail call i32 (...) @writepages()
%6 = tail call i32 (...) @trailer()
br label %7
7: ; preds = %3, %0
ret i32 undef
}
__attribute__((no, noclone)) long long int foo(long long int x,
                                               long long int y) {
  if (((int)x | (int)y) != 0)
    return 6;
  return x + y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
or     %ecx,%eax
cmp    $0x0,%eax
je     112c <foo+0x2c>
movq   $0x6,-0x8(%rbp)
jmp    1138 <foo+0x38>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    (%rsi,%rdi,1),%rcx
or     %edi,%esi
mov    $0x6,%eax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1) {
%3 = or i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = add nsw i64 %1, %0
%7 = select i1 %5, i64 %6, i64 6
ret i64 %7
}
void __attribute__((no)) jumped(void) { asm volatile(""); }


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

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

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

LLVM IR (-O2):
define void @jumped() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef unsigned int uint32_t;
typedef int /*<<< orphan*/ key;

/* Variables and functions */
uint32_t FNV_hash32(uint32_t key) {
  uint8_t i, *bytes = (uint8_t *)(&key);
  uint32_t hash = 2166136261U;
  for (i = 0; i < sizeof(key); i++) {
    hash = (16777619U * hash) ^ bytes[i];
  }
  return hash;
}


x86 assembly (clang, -O0):
<FNV_hash32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x811c9dc5,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    114e <FNV_hash32+0x4e>
imul   $0x1000193,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x8(%rbp),%rdx
xor    (%rcx,%rdx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <FNV_hash32+0x1d>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FNV_hash32>:
mov    %edi,%eax
xor    $0x50c5d1f,%eax
imul   $0x1000193,%eax,%eax
xor    %edi,%eax
imul   $0x1000193,%eax,%eax
xor    %edi,%eax
imul   $0x1000193,%eax,%eax
xor    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @FNV_hash32(i32 %0) {
%2 = xor i32 %0, 84696351
%3 = mul i32 %2, 16777619
%4 = xor i32 %3, %0
%5 = mul i32 %4, 16777619
%6 = xor i32 %5, %0
%7 = mul i32 %6, 16777619
%8 = xor i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void OS_free(void *p_memory) {
  if (p_memory)
    free(p_memory);
}


x86 assembly (clang, -O0):
<OS_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <OS_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_free>:
test   %rdi,%rdi
je     111a <OS_free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @OS_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int __test() {
  int x = 3;
  short y = 1337;
  int z = ((x) + (y));
  return z;
}


x86 assembly (clang, -O0):
<__test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
movw   $0x539,-0x6(%rbp)
mov    -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__test() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
store i32 3, i32* %1
store i16 1337, i16* %2
%4 = load i32, i32* %1
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = add nsw i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 1340
}
/* Type definitions */
typedef int /*<<< orphan*/ BASIC_CONSTRAINTS;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ BASIC_CONSTRAINTS_it;
int i2d_BASIC_CONSTRAINTS(BASIC_CONSTRAINTS *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &BASIC_CONSTRAINTS_it);
}


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

x86 assembly (clang, -O2):
<i2d_BASIC_CONSTRAINTS>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@BASIC_CONSTRAINTS_it = global i32 0
define i32 @i2d_BASIC_CONSTRAINTS(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 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @BASIC_CONSTRAINTS_it)
ret i32 %7
}

LLVM IR (-O2):
@BASIC_CONSTRAINTS_it = global i32 0
define i32 @i2d_BASIC_CONSTRAINTS(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @BASIC_CONSTRAINTS_it)
ret i32 %3
}
/* Variables and functions */
int getNext(bool *taken, int length) {
  int i = 0;
  while (i < length) {
    if (!taken[i])
      break;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<getNext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1143 <getNext+0x43>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1135 <getNext+0x35>
jmp    1143 <getNext+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <getNext+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNext>:
test   %esi,%esi
jle    1122 <getNext+0x22>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rdi,%rax,4)
je     1121 <getNext+0x21>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <getNext+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getNext(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %12, %11 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %16, label %6
14: ; preds = %6
%15 = trunc i64 %7 to i32
br label %16
16: ; preds = %11, %14, %2
%17 = phi i32 [ 0, %2 ], [ %15, %14 ], [ %1, %11 ]
ret i32 %17
}
int abs(int number) { return number >= 0 ? number : -number; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_int_xor_to_all(int *target, int *source, int nreduce,
                                 int PE_start, int logPE_stride, int PE_size,
                                 int *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_int_xor_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmem_int_xor_to_all>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_int_xor_to_all(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6, i64* %7) {
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i64*
store i32* %0, i32** %9
store i32* %1, i32** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32* %6, i32** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_int_xor_to_all(i32* nocapture readnone %0, i32* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ u_int;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ bswap_32(int /*<<< orphan*/);
u_int get4bytes(u_char *buf) { return bswap_32(*((u_int32_t *)buf)); }


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

x86 assembly (clang, -O2):
<get4bytes>:
mov    (%rdi),%edi
jmp    1030 <bswap_32@plt>

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

LLVM IR (-O2):
define i32 @get4bytes(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @bswap_32(i32 %2)
ret i32 %3
}
void LZ4IO_writeLE32(void *p, unsigned value32) {
  unsigned char *const dstPtr = (unsigned char *)p;
  dstPtr[0] = (unsigned char)value32;
  dstPtr[1] = (unsigned char)(value32 >> 8);
  dstPtr[2] = (unsigned char)(value32 >> 16);
  dstPtr[3] = (unsigned char)(value32 >> 24);
}


x86 assembly (clang, -O0):
<LZ4IO_writeLE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4IO_writeLE32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @LZ4IO_writeLE32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %4
%17 = lshr i32 %16, 16
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 2
store i8 %18, i8* %20
%21 = load i32, i32* %4
%22 = lshr i32 %21, 24
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i64 3
store i8 %23, i8* %25
ret void
}

LLVM IR (-O2):
define void @LZ4IO_writeLE32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage_exit() {
  printf("Usage: starting_search_point [OPTION]\nSearch for files in a "
         "directory hierachy whose filenames contain a given "
         "string.\n\nOptions:\n  -s <SearchingString>          The substring "
         "for searching filenames.\n  -r <NewString>                The string "
         "to replace with SearchingString.\n  -as <AdvancedSearchingString> "
         "Regard the symbol \'?\' in AdvancedSearchingString                   "
         "             as all alphabet while searching\n  -b                   "
         "         The searching is not case-sensitive.\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [490 x i8] c"Usage: starting_search_point [OPTION]\0ASearch for files in a directory hierachy whose filenames contain a given string.\0A\0AOptions:\0A -s <SearchingString> The substring for searching filenames.\0A -r <NewString> The string to replace with SearchingString.\0A -as <AdvancedSearchingString> Regard the symbol '?' in AdvancedSearchingString as all alphabet while searching\0A -b The searching is not case-sensitive.\0A\00"
define void @usage_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [489 x i8] c"Usage: starting_search_point [OPTION]\0ASearch for files in a directory hierachy whose filenames contain a given string.\0A\0AOptions:\0A -s <SearchingString> The substring for searching filenames.\0A -r <NewString> The string to replace with SearchingString.\0A -as <AdvancedSearchingString> Regard the symbol '?' in AdvancedSearchingString as all alphabet while searching\0A -b The searching is not case-sensitive.\00"
define void @usage_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([489 x i8], [489 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
void print_info() {
  puts("BUILD DATE = Sun  6 Jul 23:12:51 BST 2014");
  puts("BUILD INFO = DPRODUCTION,D__HASKELL98__");
  puts("COMPILER   = ghc -cpp -package ghc-7.6.3 -package base -hide-package "
       "haskell98 -cpp -H30M  -dshow-passes  -fwarn-incomplete-patterns "
       "-fwarn-unused-binds -DPRODUCTION -D__HASKELL98__  ");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_info>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"BUILD DATE = Sun 6 Jul 23:12:51 BST 2014\00"
@.str.1 = [40 x i8] c"BUILD INFO = DPRODUCTION,D__HASKELL98__\00"
@.str.2 = [184 x i8] c"COMPILER = ghc -cpp -package ghc-7.6.3 -package base -hide-package haskell98 -cpp -H30M -dshow-passes -fwarn-incomplete-patterns -fwarn-unused-binds -DPRODUCTION -D__HASKELL98__ \00"
@stdout = global i32 0
define void @print_info() {
%1 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([184 x i8], [184 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"BUILD DATE = Sun 6 Jul 23:12:51 BST 2014\00"
@.str.1 = [40 x i8] c"BUILD INFO = DPRODUCTION,D__HASKELL98__\00"
@.str.2 = [184 x i8] c"COMPILER = ghc -cpp -package ghc-7.6.3 -package base -hide-package haskell98 -cpp -H30M -dshow-passes -fwarn-incomplete-patterns -fwarn-unused-binds -DPRODUCTION -D__HASKELL98__ \00"
@stdout = global i32 0
define void @print_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
long long va_longlong(__builtin_va_list l) {
  return __builtin_va_arg(l, long long);
}


x86 assembly (clang, -O0):
<va_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x28,%eax
ja     113a <va_longlong+0x3a>
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%edx
movslq %edx,%rax
add    0x10(%rcx),%rax
add    $0x8,%edx
mov    %edx,(%rcx)
mov    %rax,-0x20(%rbp)
jmp    1151 <va_longlong+0x51>
mov    -0x18(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<va_longlong>:
mov    (%rdi),%ecx
cmp    $0x28,%rcx
ja     1118 <va_longlong+0x18>
mov    %rcx,%rax
add    0x10(%rdi),%rax
add    $0x8,%ecx
mov    %ecx,(%rdi)
mov    (%rax),%rax
ret
mov    0x8(%rdi),%rax
lea    0x8(%rax),%rcx
mov    %rcx,0x8(%rdi)
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i64 @va_longlong(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
%3 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%4 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = icmp ule i32 %5, 40
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 3
%9 = load i8*, i8** %8
%10 = getelementptr i8, i8* %9, i32 %5
%11 = bitcast i8* %10 to i64*
%12 = add i32 %5, 8
store i32 %12, i32* %4
br label %18
13: ; preds = %1
%14 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 2
%15 = load i8*, i8** %14
%16 = bitcast i8* %15 to i64*
%17 = getelementptr i8, i8* %15, i32 8
store i8* %17, i8** %14
br label %18
18: ; preds = %13, %7
%19 = phi i64* [ %11, %7 ], [ %16, %13 ]
%20 = load i64, i64* %19
ret i64 %20
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i64 @va_longlong(%struct.__va_list_tag* nocapture %0) {
%2 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 41
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 3
%7 = load i8*, i8** %6
%8 = zext i32 %3 to i64
%9 = getelementptr i8, i8* %7, i64 %8
%10 = add nuw nsw i32 %3, 8
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 2
%13 = load i8*, i8** %12
%14 = getelementptr i8, i8* %13, i64 8
store i8* %14, i8** %12
br label %15
15: ; preds = %11, %5
%16 = phi i8* [ %9, %5 ], [ %13, %11 ]
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
ret i64 %18
}
/* Variables and functions */
int atan(int);
void sfc2PI(double *cnst) { *cnst = 8 * atan(1); }


x86 assembly (clang, -O0):
<sfc2PI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x3,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfc2PI>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <atan@plt>
shl    $0x3,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @sfc2PI(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call i32 @atan(i32 1)
%4 = mul nsw i32 8, %3
%5 = sitofp i32 %4 to double
%6 = load double*, double** %2
store double %5, double* %6
ret void
}

LLVM IR (-O2):
define void @sfc2PI(double* nocapture writeonly %0) {
%2 = tail call i32 @atan(i32 1)
%3 = shl nsw i32 %2, 3
%4 = sitofp i32 %3 to double
store double %4, double* %0
ret void
}
int ia_start_record(struct iarchive *ia, const char *tag) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iarchive = type opaque
define i32 @ia_start_record(%struct.iarchive* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glLightModeliv(unsigned int, int *);
void LightModeliv(unsigned int p, int v[4]) { glLightModeliv(p, v); }


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

x86 assembly (clang, -O2):
<LightModeliv>:
jmp    1030 <glLightModeliv@plt>

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

LLVM IR (-O2):
define void @LightModeliv(i32 %0, i32* %1) {
%3 = tail call i32 @glLightModeliv(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int /*<<< orphan*/ printf(char *);
int BNCArbitrary() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(24);
  printf("Expand this section to use for short beam release mode ?\n");
  return (stat);
}


x86 assembly (clang, -O0):
<BNCArbitrary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x18,%edi
call   1040 <BNCIO@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCArbitrary>:
push   %rax
mov    $0x18,%edi
call   1040 <BNCIO@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Expand this section to use for short beam release mode ?\0A\00"
define i32 @BNCArbitrary() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 24)
%6 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@str = [57 x i8] c"Expand this section to use for short beam release mode ?\00"
define i32 @BNCArbitrary() {
%1 = tail call i32 @BNCIO(i32 24)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void gpio_close_fd(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<gpio_close_fd>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @gpio_close_fd(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}