xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;
typedef int /*<<< orphan*/ idtype_t;
typedef int /*<<< orphan*/ id_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __waitid(idtype_t idtype, id_t id, siginfo_t *infop, int options) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__waitid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__waitid>:
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 @__waitid(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* @ENOSYS
%10 = call i32 @__set_errno(i32 %9)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__waitid(i32 %0, i32 %1, i32* nocapture readnone %2, i32 %3) {
%5 = load i32, i32* @ENOSYS
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
const char *ccnxPortalAbout_MiniNotice(void) {
  return "Copyright (c) 2016, Xerox Corporation (Xerox)and Palo Alto Research "
         "Center (PARC)\nAll rights reserved.\n";
}


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

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

LLVM IR (-O0):
@.str = [104 x i8] c"Copyright (c) 2016, Xerox Corporation (Xerox)and Palo Alto Research Center (PARC)\0AAll rights reserved.\0A\00"
define i8* @ccnxPortalAbout_MiniNotice() {
ret i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [104 x i8] c"Copyright (c) 2016, Xerox Corporation (Xerox)and Palo Alto Research Center (PARC)\0AAll rights reserved.\0A\00"
define i8* @ccnxPortalAbout_MiniNotice() {
ret i8* getelementptr inbounds ([104 x i8], [104 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void uninivar_strcat(void) {
  char *deststr;
  char *srcstr;
  (void)strcat(deststr, srcstr);
}


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

x86 assembly (clang, -O2):
<uninivar_strcat>:
jmp    1030 <strcat@plt>

LLVM IR (-O0):
define void @uninivar_strcat() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcat(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_strcat() {
%1 = tail call i32 @strcat(i8* undef, i8* undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int GLfloat;

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gluPerspective(double, int, double, double);
void skaliraj(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(30.0, (GLfloat)w / (GLfloat)h, 1.0, 30.0);
}


x86 assembly (clang, -O0):
<skaliraj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%edi
movsd  0xe7d(%rip),%xmm2
movsd  0xe7d(%rip),%xmm1
movaps %xmm2,%xmm0
call   1040 <gluPerspective@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skaliraj>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
mov    %ebp,%eax
cltd
idiv   %ebx
movsd  0xe8a(%rip),%xmm1
movsd  0xe8a(%rip),%xmm0
mov    %eax,%edi
movaps %xmm0,%xmm2
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gluPerspective@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @skaliraj(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sdiv i32 %11, %12
%14 = call i32 @gluPerspective(double 3.000000e+01, i32 %13, double 1.000000e+00, double 3.000000e+01)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @skaliraj(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = sdiv i32 %0, %1
%8 = tail call i32 @gluPerspective(double 3.000000e+01, i32 %7, double 1.000000e+00, double 3.000000e+01)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Enc(int, int);
int /*<<< orphan*/ ObjWriteByte(int /*<<< orphan*/);
void GHOFEncode(int n) { ObjWriteByte((n < 0) ? Enc(-n, 0x40) : Enc(n, 0)); }


x86 assembly (clang, -O0):
<GHOFEncode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    114c <GHOFEncode+0x2c>
xor    %edi,%edi
sub    -0x4(%rbp),%edi
mov    $0x40,%esi
call   1040 <Enc@plt>
mov    %eax,-0x8(%rbp)
jmp    1159 <GHOFEncode+0x39>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <Enc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ObjWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GHOFEncode>:
push   %rax
test   %edi,%edi
js     1129 <GHOFEncode+0x9>
xor    %esi,%esi
jmp    1130 <GHOFEncode+0x10>
neg    %edi
mov    $0x40,%esi
call   1040 <Enc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <ObjWriteByte@plt>

LLVM IR (-O0):
define void @GHOFEncode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
%8 = call i32 @Enc(i32 %7, i32 64)
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @Enc(i32 %10, i32 0)
br label %12
12: ; preds = %9, %5
%13 = phi i32 [ %8, %5 ], [ %11, %9 ]
%14 = call i32 @ObjWriteByte(i32 %13)
ret void
}

LLVM IR (-O2):
define void @GHOFEncode(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = sub nsw i32 0, %0
%5 = tail call i32 @Enc(i32 %4, i32 64)
br label %8
6: ; preds = %1
%7 = tail call i32 @Enc(i32 %0, i32 0)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %5, %3 ], [ %7, %6 ]
%10 = tail call i32 @ObjWriteByte(i32 %9)
ret void
}
void foo531() {}


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

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

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

LLVM IR (-O2):
define void @foo531() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ errno;
scalar_t__ fread(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
int /*<<< orphan*/ read_error();
uint32_t read_long(FILE *in) {
  uint32_t l;
  errno = 0;
  if (fread(&l, sizeof(uint32_t), 1, in) <= 0)
    read_error();
  return ntohl(l);
}


x86 assembly (clang, -O0):
<read_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x0,%rax
jg     1172 <read_long+0x42>
mov    $0x0,%al
call   1040 <read_error@plt>
mov    -0xc(%rbp),%edi
call   1050 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_long>:
push   %rax
mov    %rdi,%rcx
mov    0x2ea5(%rip),%rax
movq   $0x0,(%rax)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
test   %rax,%rax
jg     1162 <read_long+0x32>
xor    %eax,%eax
call   1040 <read_error@plt>
mov    0x4(%rsp),%edi
pop    %rax
jmp    1050 <ntohl@plt>

LLVM IR (-O0):
@errno = global i64 0
define i32 @read_long(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i64 0, i64* @errno
%4 = load i32*, i32** %2
%5 = call i64 @fread(i32* %3, i32 4, i32 1, i32* %4)
%6 = icmp sle i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @read_error()
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
%11 = call i32 @ntohl(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @read_long(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i64 0, i64* @errno
%4 = call i64 @fread(i32* %2, i32 4, i32 1, i32* %0)
%5 = icmp slt i64 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @read_error()
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
%10 = tail call i32 @ntohl(i32 %9)
ret i32 %10
}
int getByte(int x, int n) {
  int shifted_word = x >> (n << 3);
  int result_byte = shifted_word & 0x000000FF;
  return result_byte;
}


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

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

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

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
void __SLIC_fun_local_irq_disable_return(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_local_irq_disable_return() {
ret void
}
/* Variables and functions */
float __ulong2fs(unsigned char);
float __uchar2fs(unsigned char uc) { return __ulong2fs(uc); }


x86 assembly (clang, -O0):
<__uchar2fs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__ulong2fs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__uchar2fs>:
jmp    1030 <__ulong2fs@plt>

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

LLVM IR (-O2):
define float @__uchar2fs(i8 zeroext %0) {
%2 = tail call float @__ulong2fs(i8 zeroext %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void die(int check, char *message) {
  if (check) {
    printf("%s\n", message);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1153 <die+0x33>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die>:
test   %edi,%edi
jne    1125 <die+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @die(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @die(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_error(char *);
scalar_t__ malloc(unsigned int);
char *cvector(int nl, int nh) {
  char *v;
  v = (char *)malloc((unsigned)(nh - nl + 1) * sizeof(char));
  if (!v)
    dump_error("allocation failure in cvector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<cvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <cvector+0x3f>
lea    0xea6(%rip),%rdi
call   1030 <dump_error@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <cvector+0x23>
lea    0xec2(%rip),%rdi
call   1030 <dump_error@plt>
movslq %ebp,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in cvector()\00"
define i8* @cvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp ne i8* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @dump_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load i8*, i8** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i8, i8* %20, i64 %23
ret i8* %24
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in cvector()\00"
define i8* @cvector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i64 @malloc(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @dump_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = inttoptr i64 %5 to i8*
%11 = sext i32 %0 to i64
%12 = sub nsw i64 0, %11
%13 = getelementptr inbounds i8, i8* %10, i64 %12
ret i8* %13
}
unsigned fibonacci(unsigned n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 1;
  } else {
    return fibonacci(n - 1) + fibonacci(n - 2);
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fibonacci+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fibonacci+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fibonacci+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fibonacci+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fibonacci@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fibonacci+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibonacci(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, -1
%7 = tail call i32 @fibonacci(i32 %6)
%8 = add i32 %4, -2
%9 = add i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set_value(int, int /*<<< orphan*/);
void module_speaker_stop(void) { gpio_set_value(23, 0); }


x86 assembly (clang, -O0):
<module_speaker_stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
xor    %esi,%esi
call   1030 <gpio_set_value@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_speaker_stop>:
mov    $0x17,%edi
xor    %esi,%esi
jmp    1030 <gpio_set_value@plt>

LLVM IR (-O0):
define void @module_speaker_stop() {
%1 = call i32 @gpio_set_value(i32 23, i32 0)
ret void
}

LLVM IR (-O2):
define void @module_speaker_stop() {
%1 = tail call i32 @gpio_set_value(i32 23, i32 0)
ret void
}
int MinInt(const int x, const int y) {
  return y + ((x - y) & ((x - y) >> (sizeof(int) * 8 - 1)));
}


x86 assembly (clang, -O0):
<MinInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
sar    $0x1f,%edx
and    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MinInt>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MinInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = ashr i32 %11, 31
%13 = and i32 %8, %12
%14 = add nsw i32 %5, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @MinInt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void copy_subtree_addr(uint32_t out[8], const uint32_t in[8]) {
  out[0] = in[0];
  out[1] = in[1];
  out[2] = in[2];
}


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

x86 assembly (clang, -O2):
<copy_subtree_addr>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    0x8(%rsi),%eax
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @copy_subtree_addr(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @copy_subtree_addr(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %1, i64 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
float log2f(float const);
void glmLog23f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = log2f(x[i]);
}


x86 assembly (clang, -O0):
<glmLog23f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmLog23f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <log2f@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmLog23f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmLog23f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <log2f@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <log2f@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <log2f@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmLog23f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @log2f(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmLog23f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @log2f(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @log2f(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @log2f(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int *ShareMallocM1i(int size) {
  int *s = NULL;
  if ((s = (int *)calloc(size, sizeof(int))) == NULL) {
    printf("int * malloc error!\n");
    exit(1);
  }
  return s;
}


x86 assembly (clang, -O0):
<ShareMallocM1i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1174 <ShareMallocM1i+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShareMallocM1i>:
push   %rax
mov    $0x4,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     1142 <ShareMallocM1i+0x12>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"int * malloc error!\0A\00"
define i32* @ShareMallocM1i(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* null, i32** %3
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@str = [20 x i8] c"int * malloc error!\00"
define i32* @ShareMallocM1i(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i32*
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ testShelter();
int main(void) {
  testShelter();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @testShelter()
ret i32 0
}
int decode(int *individuo) {
  int multiplier = 1;
  int bin = 0;
  for (int i = 3; i >= 0; --i) {
    bin += (multiplier * individuo[i]);
    multiplier *= 2;
  }
  return bin;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1153 <decode+0x53>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <decode+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    0x8(%rdi),%eax
add    %eax,%eax
add    0xc(%rdi),%eax
mov    (%rdi),%ecx
mov    0x4(%rdi),%edx
lea    (%rax,%rdx,4),%eax
lea    (%rax,%rcx,8),%eax
ret

LLVM IR (-O0):
define i32 @decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
store i32 0, i32* %4
store i32 3, i32* %5
br label %6
6: ; preds = %21, %1
%7 = load i32, i32* %5
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %24
9: ; preds = %6
%10 = load i32, i32* %3
%11 = load i32*, i32** %2
%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 = mul nsw i32 %10, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, %16
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = mul nsw i32 %19, 2
store i32 %20, i32* %3
br label %21
21: ; preds = %9
%22 = load i32, i32* %5
%23 = add nsw i32 %22, -1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @decode(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = shl nsw i32 %5, 1
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = shl nsw i32 %9, 2
%11 = add nsw i32 %10, %7
%12 = load i32, i32* %0
%13 = shl nsw i32 %12, 3
%14 = add nsw i32 %13, %11
ret i32 %14
}
int msm_dts_eagle_deinit_pre(struct audio_client *ac) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.audio_client = type opaque
define i32 @msm_dts_eagle_deinit_pre(%struct.audio_client* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void byte_copy(void *out, size_t len, const void *in) { memcpy(out, in, len); }


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

x86 assembly (clang, -O2):
<byte_copy>:
mov    %rsi,%rax
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @byte_copy(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                           int, int);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void onReshape(int width, int height) {
  glViewport(0, 0, width, height);
  glMatrixMode(GL_PROJECTION);
  glOrtho(0, width, height, 0, -1, 1);
}


x86 assembly (clang, -O0):
<onReshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1050 <glViewport@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
mov    $0x1,%r9d
mov    %ecx,%edi
call   1040 <glOrtho@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onReshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1050 <glViewport@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %edi,%edi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
mov    $0x1,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @onReshape(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @glOrtho(i32 0, i32 %10, i32 %11, i32 0, i32 -1, i32 1)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @onReshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 @glOrtho(i32 0, i32 %0, i32 %1, i32 0, i32 -1, i32 1)
ret void
}
/* Variables and functions */
int yaffs_lremovexattr_reldir(int /*<<< orphan*/, char const *, char const *);
int yaffs_lremovexattr(const char *path, const char *name) {
  return yaffs_lremovexattr_reldir((0), path, name);
}


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

x86 assembly (clang, -O2):
<yaffs_lremovexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <yaffs_lremovexattr_reldir@plt>

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

LLVM IR (-O2):
define i32 @yaffs_lremovexattr(i8* %0, i8* %1) {
%3 = tail call i32 @yaffs_lremovexattr_reldir(i32 0, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
unsigned char _apply_timezone(int *, int *, int, int /*<<< orphan*/);
unsigned char apply_timezone(int *time, int *date, int tz) {
  return _apply_timezone(time, date, tz, 0);
}


x86 assembly (clang, -O0):
<apply_timezone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <_apply_timezone@plt>
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @apply_timezone(i32* %0, i32* %1, i32 %2) {
%4 = tail call zeroext i8 @_apply_timezone(i32* %0, i32* %1, i32 %2, i32 0)
ret i8 %4
}
unsigned long long int
unsignedlonglongint_ignoring_signedlongint(unsigned long long int x,
                                           signed long int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ oled_send_start_byte(int);
void oled_send_data(void) { oled_send_start_byte(1); }


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

x86 assembly (clang, -O2):
<oled_send_data>:
mov    $0x1,%edi
jmp    1030 <oled_send_start_byte@plt>

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

LLVM IR (-O2):
define void @oled_send_data() {
%1 = tail call i32 @oled_send_start_byte(i32 1)
ret void
}
int PARENT(int i) {
  if (i % 2 == 0)
    return i / 2 - 1;
  else
    return i / 2;
}


x86 assembly (clang, -O0):
<PARENT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1131 <PARENT+0x31>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <PARENT+0x3f>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PARENT>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
mov    %edi,%ecx
and    $0x1,%ecx
sar    %eax
add    %ecx,%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @PARENT(i32 %0) {
%2 = and i32 %0, 1
%3 = sdiv i32 %0, 2
%4 = add nsw i32 %2, -1
%5 = add nsw i32 %3, %4
ret i32 %5
}
int a_twist_u_on_eflip(eflip)
int eflip;
{
  int temp_arr[12];
  a_eflip_unpack(eflip, temp_arr);
  four_cycle(temp_arr, 1, 2, 3, 0);
  return a_eflip_pack(temp_arr);
}


x86 assembly (clang, -O0):
<a_twist_u_on_eflip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1030 <a_eflip_unpack@plt>
lea    -0x40(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
mov    $0x0,%al
call   1040 <four_cycle@plt>
lea    -0x40(%rbp),%rdi
mov    $0x0,%al
call   1050 <a_eflip_pack@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_twist_u_on_eflip>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <a_eflip_unpack@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
xor    %r8d,%r8d
xor    %eax,%eax
call   1040 <four_cycle@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <a_eflip_pack@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @a_twist_u_on_eflip(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%6 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eflip_unpack to i32 (i32, i32*, ...)*)(i32 %4, i32* %5)
%7 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%8 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %7, i32 1, i32 2, i32 3, i32 0)
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eflip_pack to i32 (i32*, ...)*)(i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @a_twist_u_on_eflip(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%5 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @a_eflip_unpack to i32 (i32, i32*, ...)*)(i32 %0, i32* %4)
%6 = call i32 (i32*, i32, i32, i32, i32, ...) bitcast (i32 (...)* @four_cycle to i32 (i32*, i32, i32, i32, i32, ...)*)(i32* %4, i32 1, i32 2, i32 3, i32 0)
%7 = call i32 (i32*, ...) bitcast (i32 (...)* @a_eflip_pack to i32 (i32*, ...)*)(i32* %4)
ret i32 %7
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
void getchar6() {
  int c;
  while ((c = getchar()) != -1)
    putchar(c);
}


x86 assembly (clang, -O0):
<getchar6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
je     1148 <getchar6+0x28>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <getchar6+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar6>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xffffffff,%eax
je     1145 <getchar6+0x25>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1130 <getchar6+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @getchar6() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i32 %4)
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
void do_stuff() {
  int i, j;
  double a, b = 1.2, c = 2.1;
  for (i = 1; i < 10000; i++) {
    if ((i % 12) == 0)
      i += 2;
    for (j = 0; j < 100000; j++) {
      a += b;
      b += 0.2;
      c = a * 0.1;
    }
  }
}


x86 assembly (clang, -O0):
<do_stuff>:
push   %rbp
mov    %rsp,%rbp
movsd  0xefc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xee7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    11b7 <do_stuff+0xb7>
mov    -0x4(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <do_stuff+0x4f>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    11a4 <do_stuff+0xa4>
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xe9e(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe84(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1156 <do_stuff+0x56>
jmp    11a9 <do_stuff+0xa9>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <do_stuff+0x25>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_stuff() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double 1.200000e+00, double* %4
store double 2.100000e+00, double* %5
store i32 1, i32* %1
br label %6
6: ; preds = %32, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 10000
br i1 %8, label %9, label %35
9: ; preds = %6
%10 = load i32, i32* %1
%11 = srem i32 %10, 12
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 2
store i32 %15, i32* %1
br label %16
16: ; preds = %13, %9
store i32 0, i32* %2
br label %17
17: ; preds = %28, %16
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 100000
br i1 %19, label %20, label %31
20: ; preds = %17
%21 = load double, double* %4
%22 = load double, double* %3
%23 = fadd double %22, %21
store double %23, double* %3
%24 = load double, double* %4
%25 = fadd double %24, 2.000000e-01
store double %25, double* %4
%26 = load double, double* %3
%27 = fmul double %26, 1.000000e-01
store double %27, double* %5
br label %28
28: ; preds = %20
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %17
31: ; preds = %17
br label %32
32: ; preds = %31
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
br label %6
35: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @do_stuff() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ float_to_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ tag_bignum(int /*<<< orphan*/);
void primitive_float_to_bignum_impl(void) {
  drepl(tag_bignum(float_to_bignum(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_float_to_bignum_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <float_to_bignum@plt>
mov    %eax,%edi
call   1060 <tag_bignum@plt>
mov    %eax,%edi
call   1050 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_to_bignum_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <float_to_bignum@plt>
mov    %eax,%edi
call   1060 <tag_bignum@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <drepl@plt>

LLVM IR (-O0):
define void @primitive_float_to_bignum_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @float_to_bignum(i32 %1)
%3 = call i32 @tag_bignum(i32 %2)
%4 = call i32 @drepl(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_float_to_bignum_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @float_to_bignum(i32 %1)
%3 = tail call i32 @tag_bignum(i32 %2)
%4 = tail call i32 @drepl(i32 %3)
ret void
}
void test9_bar(void) {}


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

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

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

LLVM IR (-O2):
define void @test9_bar() {
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *str = malloc(32);
  printf("Malloc'd buffer at: 0x%p\r\n", str);
  str[31] = '\0';
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
movb   $0x0,0x1f(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Malloc'd buffer at: 0x%p\0D\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 32)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 31
store i8 0, i8* %7
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Malloc'd buffer at: 0x%p\0D\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = getelementptr inbounds i8, i8* %1, i64 31
store i8 0, i8* %3
ret i32 0
}