xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *name) {
  printf("Warning : This program will work only on Valleyview\n"
         "Usage: %s <port> <reg> <val>\n"
         "\t port/reg/val : in 0xXXXX format\n",
         name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [116 x i8] c"Warning : This program will work only on Valleyview\0AUsage: %s <port> <reg> <val>\0A\09 port/reg/val : in 0xXXXX format\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [116 x i8] c"Warning : This program will work only on Valleyview\0AUsage: %s <port> <reg> <val>\0A\09 port/reg/val : in 0xXXXX format\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([116 x i8], [116 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int syscall(int, char const *, int /*<<< orphan*/, int /*<<< orphan*/);
int mknod(const char *path, mode_t mode, dev_t dev) {
  return syscall(14, path, mode, dev);
}


x86 assembly (clang, -O0):
<mknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0xe,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mknod>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @mknod(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @syscall(i32 14, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ enum_t;
typedef enum sizecheck { ____Placeholder_sizecheck } sizecheck;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ xdr_long(int /*<<< orphan*/ *, long *);
int /*<<< orphan*/ xdr_short(int /*<<< orphan*/ *, short *);
bool_t xdr_enum(XDR *xdrs, enum_t *ep) {
  enum sizecheck { SIZEVAL };
  if (sizeof(enum sizecheck) == 4) {
    return xdr_long(xdrs, (long *)ep);
  } else if (sizeof(enum sizecheck) == sizeof(short)) {
    return xdr_short(xdrs, (short *)ep);
  } else {
    return FALSE;
  }
}


x86 assembly (clang, -O0):
<xdr_enum>:
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 <xdr_long@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_enum>:
jmp    1030 <xdr_long@plt>

LLVM IR (-O0):
@FALSE = global i32 0
define i32 @xdr_enum(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 = bitcast i32* %6 to i64*
%8 = call i32 @xdr_long(i32* %5, i64* %7)
ret i32 %8
}

LLVM IR (-O2):
@FALSE = global i32 0
define i32 @xdr_enum(i32* %0, i32* %1) {
%3 = bitcast i32* %1 to i64*
%4 = tail call i32 @xdr_long(i32* %0, i64* %3)
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XTimeCoord;

/* Variables and functions */
unsigned long get_XTimeCoord_time(void *_p) {
  return (unsigned long)((XTimeCoord *)_p)->time;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XTimeCoord_time(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
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XTimeCoord_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void pki_init() {}


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

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

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

LLVM IR (-O2):
define void @pki_init() {
ret void
}
int DoesNotRemoveNonRedundantVariableCopy() {
  int x = 10;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @DoesNotRemoveNonRedundantVariableCopy() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @DoesNotRemoveNonRedundantVariableCopy() {
ret i32 10
}
int utp_do_selftest(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @utp_do_selftest() {
ret i32 0
}
int main() {
  ((int)sizeof(struct { int : -!!(2 + 2 == 5); }));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Out(int, int, char);
void mostrapenter(char penter) { LCD_Out(2, 1, penter); }


x86 assembly (clang, -O0):
<mostrapenter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
movsbl -0x1(%rbp),%edx
call   1030 <LCD_Out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostrapenter>:
mov    %edi,%edx
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <LCD_Out@plt>

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

LLVM IR (-O2):
define void @mostrapenter(i8 signext %0) {
%2 = tail call i32 @LCD_Out(i32 2, i32 1, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BitTest_instr(int);
void SET(void) { BitTest_instr(192); }


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

x86 assembly (clang, -O2):
<SET>:
mov    $0xc0,%edi
jmp    1030 <BitTest_instr@plt>

LLVM IR (-O0):
define void @SET() {
%1 = call i32 @BitTest_instr(i32 192)
ret void
}

LLVM IR (-O2):
define void @SET() {
%1 = tail call i32 @BitTest_instr(i32 192)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exec(char **);
int /*<<< orphan*/ updateispaused();
void togglepause() {
  char *p[3] = {"mmusicd", "pause", NULL};
  exec(p);
  updateispaused();
}


x86 assembly (clang, -O0):
<togglepause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <exec@plt>
mov    $0x0,%al
call   1030 <updateispaused@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<togglepause>:
sub    $0x18,%rsp
mov    0x2ce5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cc9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <exec@plt>
xor    %eax,%eax
call   1030 <updateispaused@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"mmusicd\00"
@.str.1 = [6 x i8] c"pause\00"
@__const.togglepause.p = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* null]
define void @togglepause() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @exec(i8** %3)
%5 = call i32 (...) @updateispaused()
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"mmusicd\00"
@.str.1 = [6 x i8] c"pause\00"
@__const.togglepause.p = [3 x i8*] [i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* null]
define void @togglepause() {
%1 = alloca [3 x i8*]
%2 = bitcast [3 x i8*]* %1 to i8*
%3 = getelementptr inbounds [3 x i8*], [3 x i8*]* %1, i64 0, i64 0
%4 = call i32 @exec(i8** %3)
%5 = call i32 (...) @updateispaused()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_complement(void) { output_line("com r1"); }


x86 assembly (clang, -O0):
<gen_complement>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <output_line@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"com r1\00"
define void @gen_complement() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"com r1\00"
define void @gen_complement() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int _xpnd4(unsigned int src1) {
  int v0 = (src1 & 0x1) ? 0x000000ff : 0x00000000;
  int v1 = (src1 & 0x2) ? 0x0000ff00 : 0x00000000;
  int v2 = (src1 & 0x4) ? 0x00ff0000 : 0x00000000;
  int v3 = (src1 & 0x8) ? 0xff000000 : 0x00000000;
  int r = v0 | v1 | v2 | v3;
  return r;
}


x86 assembly (clang, -O0):
<_xpnd4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0xff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
and    $0x2,%edx
xor    %eax,%eax
mov    $0xff00,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edx
and    $0x4,%edx
xor    %eax,%eax
mov    $0xff0000,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8,%edx
xor    %eax,%eax
mov    $0xff000000,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xpnd4>:
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xeef(%rip),%xmm1
pand   %xmm1,%xmm0
pcmpeqd %xmm1,%xmm0
pand   0xeef(%rip),%xmm0
pshufd $0xee,%xmm0,%xmm1
por    %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
por    %xmm1,%xmm0
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @_xpnd4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 255, i32 0
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = and i32 %13, 2
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 65280, i32 0
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = and i32 %18, 4
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 16711680, i32 0
store i32 %22, i32* %5
%23 = load i32, i32* %2
%24 = and i32 %23, 8
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 -16777216, i32 0
store i32 %27, i32* %6
%28 = load i32, i32* %3
%29 = load i32, i32* %4
%30 = or i32 %28, %29
%31 = load i32, i32* %5
%32 = or i32 %30, %31
%33 = load i32, i32* %6
%34 = or i32 %32, %33
store i32 %34, i32* %7
%35 = load i32, i32* %7
ret i32 %35
}

LLVM IR (-O2):
define i32 @_xpnd4(i32 %0) {
%2 = insertelement <4 x i32> poison, i32 %0, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = and <4 x i32> %3, <i32 1, i32 2, i32 4, i32 8>
%5 = icmp eq <4 x i32> %4, zeroinitializer
%6 = select <4 x i1> %5, <4 x i32> zeroinitializer, <4 x i32> <i32 255, i32 65280, i32 16711680, i32 -16777216>
%7 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %6)
ret i32 %7
}
unsigned short RdFwVr(void) {
  unsigned short UsVerVal;
  UsVerVal = (unsigned short)((0x06 << 8) | 0x03);
  return UsVerVal;
}


x86 assembly (clang, -O0):
<RdFwVr>:
push   %rbp
mov    %rsp,%rbp
movw   $0x603,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RdFwVr>:
mov    $0x603,%ax
ret

LLVM IR (-O0):
define zeroext i16 @RdFwVr() {
%1 = alloca i16
store i16 1539, i16* %1
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @RdFwVr() {
ret i16 1539
}
int clamp(int value, long low, long high) {
  if (value > high)
    return high;
  if (value < low)
    return low;
  return value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movslq -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1129 <clamp+0x29>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1149 <clamp+0x49>
movslq -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1143 <clamp+0x43>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1149 <clamp+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
movslq %edi,%rcx
cmp    %rsi,%rcx
cmovge %ecx,%esi
mov    %rdx,%rax
cmp    %rdx,%rcx
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i64 %1, i64 %2) {
%4 = sext i32 %0 to i64
%5 = icmp sgt i64 %4, %2
%6 = trunc i64 %2 to i32
%7 = icmp slt i64 %4, %1
%8 = trunc i64 %1 to i32
%9 = select i1 %7, i32 %8, i32 %0
%10 = select i1 %5, i32 %6, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ output_w32(int);
void emit_fnegd(int s, int d) {
  assert(s == 31);
  assert(d == 31);
  assem_debug("fnegd d%d,d%d", d, s);
  output_w32(0x1e614000 | s << 5 | d);
}


x86 assembly (clang, -O0):
<emit_fnegd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1f,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xe93(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x4(%rbp),%edi
shl    $0x5,%edi
or     $0x1e614000,%edi
or     -0x8(%rbp),%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fnegd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x1f,%ebx
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x1f,%ebp
sete   %dil
call   1050 <assert@plt>
lea    0xea6(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <assem_debug@plt>
shl    $0x5,%ebx
or     %ebp,%ebx
or     $0x1e614000,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fnegd d%d,d%d\00"
define void @emit_fnegd(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 = icmp eq i32 %5, 31
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 31
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %3
%17 = shl i32 %16, 5
%18 = or i32 509689856, %17
%19 = load i32, i32* %4
%20 = or i32 %18, %19
%21 = call i32 @output_w32(i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fnegd d%d,d%d\00"
define void @emit_fnegd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 31
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i32 %1, 31
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @assem_debug(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%10 = shl i32 %0, 5
%11 = or i32 %10, %1
%12 = or i32 %11, 509689856
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
unsigned int f25(unsigned int x, int y) {
  return (x >> (8 * sizeof(unsigned int) - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f25>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
movslq -0x8(%rbp),%rdx
mov    $0x20,%ecx
sub    %rdx,%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f25>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f25(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 = sext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
%10 = lshr i32 %5, %9
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = shl i32 %11, %12
%14 = xor i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f25(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = lshr i32 %0, %3
%5 = shl i32 %0, %1
%6 = xor i32 %4, %5
ret i32 %6
}
void board_gpio_init(const struct mxt_platform_data *pdata) {}


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

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

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

LLVM IR (-O2):
%struct.mxt_platform_data = type opaque
define void @board_gpio_init(%struct.mxt_platform_data* nocapture %0) {
ret void
}
char kbhit(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @kbhit() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @kbhit() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ s2diskxy(float, float, float, float, float);
void s2diskxy_(float *px, float *py, float *pz, float *r1, float *r2) {
  s2diskxy(*px, *py, *pz, *r1, *r2);
}


x86 assembly (clang, -O0):
<s2diskxy_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm3
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm4
call   1030 <s2diskxy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2diskxy_>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  (%rdx),%xmm2
movss  (%rcx),%xmm3
movss  (%r8),%xmm4
jmp    1030 <s2diskxy@plt>

LLVM IR (-O0):
define void @s2diskxy_(float* %0, float* %1, float* %2, float* %3, float* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
store float* %0, float** %6
store float* %1, float** %7
store float* %2, float** %8
store float* %3, float** %9
store float* %4, float** %10
%11 = load float*, float** %6
%12 = load float, float* %11
%13 = load float*, float** %7
%14 = load float, float* %13
%15 = load float*, float** %8
%16 = load float, float* %15
%17 = load float*, float** %9
%18 = load float, float* %17
%19 = load float*, float** %10
%20 = load float, float* %19
%21 = call i32 @s2diskxy(float %12, float %14, float %16, float %18, float %20)
ret void
}

LLVM IR (-O2):
define void @s2diskxy_(float* nocapture %0, float* nocapture %1, float* nocapture %2, float* nocapture %3, float* nocapture %4) {
%6 = load float, float* %0
%7 = load float, float* %1
%8 = load float, float* %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = tail call i32 @s2diskxy(float %6, float %7, float %8, float %9, float %10)
ret void
}
char *rand4lvl(void) { return "4th Level Spell"; }


x86 assembly (clang, -O0):
<rand4lvl>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand4lvl>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"4th Level Spell\00"
define i8* @rand4lvl() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"4th Level Spell\00"
define i8* @rand4lvl() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ UnitTest_report();
int /*<<< orphan*/ testInt16();
int main(int argc, char **argv) {
  testInt16();
  UnitTest_report();
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testInt16()
%4 = tail call i32 (...) @UnitTest_report()
ret i32 0
}
int ft_isspace(int c) {
  if (c == ' ' || c == '\t' || c == '\n')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     1125 <ft_isspace+0x25>
cmpl   $0x9,-0x8(%rbp)
je     1125 <ft_isspace+0x25>
cmpl   $0xa,-0x8(%rbp)
jne    1131 <ft_isspace+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <ft_isspace+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isspace>:
cmp    $0x20,%edi
ja     111d <ft_isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <ft_isspace+0x1d>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ checker3(int **);
int /*<<< orphan*/ printf(char *, int);
void calleeChecks3() {
  int *p = NULL;
  checker3(&p);
  printf("%d\n", *p);
}


x86 assembly (clang, -O0):
<calleeChecks3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <checker3@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calleeChecks3>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <checker3@plt>
mov    (%rsp),%rax
mov    (%rax),%esi
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @calleeChecks3() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32 @checker3(i32** %1)
%3 = load i32*, i32** %1
%4 = load i32, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @calleeChecks3() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i32 @checker3(i32** %1)
%4 = load i32*, i32** %1
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, int /*<<< orphan*/ *, int);
void writel(unsigned char *buf, size_t offset, uint32_t value, bool le32) {
  if (!le32)
    value = htonl(value);
  memcpy(buf + offset, &value, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    114b <writel+0x2b>
mov    -0x14(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
test   %ecx,%ecx
jne    1137 <writel+0x17>
mov    %edx,%edi
call   1030 <htonl@plt>
mov    %eax,%edx
mov    %edx,0x4(%rsp)
add    %r14,%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @writel(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = load i32, i32* %7
%13 = call i32 @htonl(i32 %12)
store i32 %13, i32* %7
br label %14
14: ; preds = %11, %4
%15 = load i8*, i8** %5
%16 = load i64, i64* %6
%17 = getelementptr inbounds i8, i8* %15, i64 %16
%18 = call i32 @memcpy(i8* %17, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @writel(i8* %0, i64 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = icmp eq i32 %3, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @htonl(i32 %2)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %2, %4 ]
store i32 %10, i32* %5
%11 = getelementptr inbounds i8, i8* %0, i64 %1
%12 = call i32 @memcpy(i8* %11, i32* %5, i32 4)
ret void
}
void ASN1_item_i2d_bio(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_item_i2d_bio() {
ret void
}
/* Variables and functions */
void CG_RunMenuScript(char **args) {}


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

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

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

LLVM IR (-O2):
define void @CG_RunMenuScript(i8** nocapture %0) {
ret void
}
int cfe_strlen(char *name) {
  int count = 0;
  while (*name) {
    count++;
    name++;
  }
  return count;
}


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

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

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

LLVM IR (-O2):
define i32 @cfe_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
int is_symbol_char(int c) {
  return (!isspace(c)) && (c != '(') && (c != ')') && (c != ';');
}


x86 assembly (clang, -O0):
<is_symbol_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    115b <is_symbol_char+0x4b>
xor    %eax,%eax
cmpl   $0x28,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115b <is_symbol_char+0x4b>
xor    %eax,%eax
cmpl   $0x29,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115b <is_symbol_char+0x4b>
cmpl   $0x3b,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_symbol_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isspace@plt>
test   %eax,%eax
sete   %al
mov    %ebx,%ecx
and    $0xfffffffe,%ecx
cmp    $0x28,%ecx
setne  %cl
and    %al,%cl
cmp    $0x3b,%ebx
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_symbol_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isspace(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 40
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 41
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 59
br label %15
15: ; preds = %12, %9, %6, %1
%16 = phi i1 [ false, %9 ], [ false, %6 ], [ false, %1 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_symbol_char(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, -2
%5 = icmp ne i32 %4, 40
%6 = and i1 %5, %3
%7 = icmp ne i32 %0, 59
%8 = and i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int pow(double, int);
double g(double x) { return ((pow(x, 2) + 6) / 5); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x6,%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x6,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @g(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 2)
%5 = add nsw i32 %4, 6
%6 = sdiv i32 %5, 5
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @g(double %0) {
%2 = tail call i32 @pow(double %0, i32 2)
%3 = add nsw i32 %2, 6
%4 = sdiv i32 %3, 5
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
struct queue_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct queue_node *);
void queue_node_free(struct queue_node *node) {
  if (node != NULL)
    free(node);
}


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

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

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

LLVM IR (-O2):
%struct.queue_node = type { i32 }
define void @queue_node_free(%struct.queue_node* %0) {
%2 = icmp eq %struct.queue_node* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.queue_node* %0)
br label %5
5: ; preds = %3, %1
ret void
}
char *maceof(char *arg) {
  *arg = 26;
  arg[1] = 0;
  return (arg);
}


x86 assembly (clang, -O0):
<maceof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x1a,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maceof>:
mov    %rdi,%rax
movw   $0x1a,(%rdi)
ret

LLVM IR (-O0):
define i8* @maceof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 26, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %5
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define i8* @maceof(i8* returned writeonly %0) {
store i8 26, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %2
ret i8* %0
}
void foo(int *param) {
  *param = *param + 1;
  return;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRD1_set(void) { return U_WMRCORENONE_set("U_WMRD1"); }


x86 assembly (clang, -O0):
<U_WMRD1_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD1\00"
define i8* @U_WMRD1_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD1\00"
define i8* @U_WMRD1_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ irq_enable();
int /*<<< orphan*/ irq_gates();
int /*<<< orphan*/ pic_disable();
int /*<<< orphan*/ pic_remap();
void pic_init() {
  pic_remap();
  pic_disable();
  irq_gates();
  irq_enable();
}


x86 assembly (clang, -O0):
<pic_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pic_remap@plt>
mov    $0x0,%al
call   1060 <pic_disable@plt>
mov    $0x0,%al
call   1050 <irq_gates@plt>
mov    $0x0,%al
call   1030 <irq_enable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_init>:
push   %rax
xor    %eax,%eax
call   1040 <pic_remap@plt>
xor    %eax,%eax
call   1060 <pic_disable@plt>
xor    %eax,%eax
call   1050 <irq_gates@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <irq_enable@plt>

LLVM IR (-O0):
define void @pic_init() {
%1 = call i32 (...) @pic_remap()
%2 = call i32 (...) @pic_disable()
%3 = call i32 (...) @irq_gates()
%4 = call i32 (...) @irq_enable()
ret void
}

LLVM IR (-O2):
define void @pic_init() {
%1 = tail call i32 (...) @pic_remap()
%2 = tail call i32 (...) @pic_disable()
%3 = tail call i32 (...) @irq_gates()
%4 = tail call i32 (...) @irq_enable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pid_file_remove() {
  printf("NOT IMPLEMENTED:"
         "pa_pid_file_remove"
         "\n");
}


x86 assembly (clang, -O0):
<pa_pid_file_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_pid_file_remove\0A\00"
define i32 @pa_pid_file_remove() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_pid_file_remove\00"
define i32 @pa_pid_file_remove() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
size_t strlen(char const *);
size_t wsock_str_len(const char *s) { return s ? strlen(s) : 0; }


x86 assembly (clang, -O0):
<wsock_str_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1139 <wsock_str_len+0x29>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
jmp    1144 <wsock_str_len+0x34>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1144 <wsock_str_len+0x34>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @wsock_str_len(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 i64 @strlen(i8* %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @wsock_str_len(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int c, nl;
  nl = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      ++nl;
    }
  }
  printf("%d\n", nl);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1167 <main+0x47>
cmpl   $0xa,-0x8(%rbp)
jne    1162 <main+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%eax
je     1156 <main+0x36>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%eax
sete   %cl
add    %ecx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
jne    1140 <main+0x20>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %10, %4 ], [ %1, %0 ]
%6 = phi i32 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i32 %5, 10
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %6, %8
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i32 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}
int substraction(int a, int b) { return a - b; }


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

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

LLVM IR (-O0):
define i32 @substraction(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 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @substraction(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
int test_imm_48int64_lowword_reg(long long val) {
  return ((val) & (0x48 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_48int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 72
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void tarea_dos() { sleep(4); }


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

x86 assembly (clang, -O2):
<tarea_dos>:
mov    $0x4,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @tarea_dos() {
%1 = call i32 @sleep(i32 4)
ret void
}

LLVM IR (-O2):
define void @tarea_dos() {
%1 = tail call i32 @sleep(i32 4)
ret void
}
/* Variables and functions */
char *getlogin();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("your login name is: '%s'\n", getlogin());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"your login name is: '%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i8* (...) @getlogin()
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"your login name is: '%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @getlogin()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int compress_none(const unsigned char *old, __u32 old_size, unsigned char *new,
                  __u32 new_size) {
  return -1;
}


x86 assembly (clang, -O0):
<compress_none>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compress_none(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @compress_none(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
extern void safe_free(void *ptr, const char *modulename, const char *funcname,
                      unsigned long lineno) {
  free(ptr);
}


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

x86 assembly (clang, -O2):
<safe_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @safe_free(i8* nocapture %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = tail call i32 @free(i8* %0)
ret void
}