xunge/DecIR huggingface dataset:
/* Type definitions */
struct winsize {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int errno_non_zero();
scalar_t__ ioctl(int, int /*<<< orphan*/, struct winsize *);
int get_window_size(int fd, struct winsize *size) {
  if (ioctl(fd, TIOCGWINSZ, size) < 0) {
    return errno_non_zero();
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_window_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    115d <get_window_size+0x3d>
mov    $0x0,%al
call   1040 <errno_non_zero@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <get_window_size+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_window_size>:
push   %rax
mov    %rsi,%rdx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
test   %rax,%rax
js     113b <get_window_size+0x1b>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1040 <errno_non_zero@plt>

LLVM IR (-O0):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @get_window_size(i32 %0, %struct.winsize* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.winsize*
store i32 %0, i32* %4
store %struct.winsize* %1, %struct.winsize** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @TIOCGWINSZ
%8 = load %struct.winsize*, %struct.winsize** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, %struct.winsize* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @errno_non_zero()
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@TIOCGWINSZ = global i32 0
define i32 @get_window_size(i32 %0, %struct.winsize* %1) {
%3 = load i32, i32* @TIOCGWINSZ
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.winsize* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @errno_non_zero()
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 0, %2 ]
ret i32 %9
}
void CFGMR3InsertBytes(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3InsertBytes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OVS_PREFETCH(char const *);
void ovs_prefetch_range(const void *start, size_t size) {
  const char *addr = (const char *)start;
  size_t ofs;
  for (ofs = 0; ofs < size; ofs += 64) {
    OVS_PREFETCH(addr + ofs);
  }
}


x86 assembly (clang, -O0):
<ovs_prefetch_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115c <ovs_prefetch_range+0x4c>
mov    -0x18(%rbp),%rdi
add    -0x20(%rbp),%rdi
call   1030 <OVS_PREFETCH@plt>
mov    -0x20(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <ovs_prefetch_range+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ovs_prefetch_range>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <ovs_prefetch_range+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    (%r14,%rbx,1),%rdi
call   1030 <OVS_PREFETCH@plt>
add    $0x40,%rbx
cmp    %r15,%rbx
jb     1130 <ovs_prefetch_range+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ovs_prefetch_range(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %8, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @OVS_PREFETCH(i8* %6)
%8 = add i64 %5, 64
%9 = icmp ult i64 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
int vaccess(mode, rw)
register unsigned mode, rw;
{
  if (mode & (rw << 1))
    return (1);
  if (mode & (rw << 03))
    return (1);
  return ((mode & (rw << 05)) && getuid() == 0);
}


x86 assembly (clang, -O0):
<vaccess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113e <vaccess+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1192 <vaccess+0x82>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     115e <vaccess+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1192 <vaccess+0x82>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
and    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1187 <vaccess+0x77>
mov    $0x0,%al
call   1030 <getuid@plt>
cmp    $0x0,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vaccess>:
lea    (%rsi,%rsi,1),%ecx
mov    $0x1,%eax
test   %edi,%ecx
je     111d <vaccess+0xd>
ret
lea    0x0(,%rsi,8),%ecx
test   %edi,%ecx
jne    111c <vaccess+0xc>
shl    $0x5,%esi
test   %edi,%esi
je     1145 <vaccess+0x35>
push   %rax
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vaccess(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = shl i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %31
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = shl i32 %14, 3
%16 = and i32 %13, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 1, i32* %3
br label %31
19: ; preds = %12
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = shl i32 %21, 5
%23 = and i32 %20, %22
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = call i32 (...) @getuid()
%27 = icmp eq i32 %26, 0
br label %28
28: ; preds = %25, %19
%29 = phi i1 [ false, %19 ], [ %27, %25 ]
%30 = zext i1 %29 to i32
store i32 %30, i32* %3
br label %31
31: ; preds = %28, %18, %11
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @vaccess(i32 %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = and i32 %3, %0
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %18
6: ; preds = %2
%7 = shl i32 %1, 3
%8 = and i32 %7, %0
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = shl i32 %1, 5
%12 = and i32 %11, %0
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = tail call i32 (...) @getuid()
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %10, %14, %6, %2
%19 = phi i32 [ 1, %2 ], [ 1, %6 ], [ 0, %10 ], [ %17, %14 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ NewOption(scalar_t__, unsigned long);
void OptDateTime(unsigned long DateTime) { NewOption((0x40 + 0), DateTime); }


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

x86 assembly (clang, -O2):
<OptDateTime>:
mov    %rdi,%rsi
mov    $0x40,%edi
jmp    1030 <NewOption@plt>

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

LLVM IR (-O2):
define void @OptDateTime(i64 %0) {
%2 = tail call i32 @NewOption(i64 64, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bson_fatal_msg(int, char *);
void *bson_malloc_func(int);
void *bson_malloc(int size) {
  void *p;
  p = bson_malloc_func(size);
  bson_fatal_msg(!!p, "malloc() failed");
  return p;
}


x86 assembly (clang, -O0):
<bson_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bson_malloc_func@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
lea    0xeb1(%rip),%rsi
call   1040 <bson_fatal_msg@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_malloc>:
push   %rbx
call   1030 <bson_malloc_func@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
lea    0xec7(%rip),%rsi
call   1040 <bson_fatal_msg@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"malloc() failed\00"
define i8* @bson_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @bson_malloc_func(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @bson_fatal_msg(i32 %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"malloc() failed\00"
define i8* @bson_malloc(i32 %0) {
%2 = tail call i8* @bson_malloc_func(i32 %0)
%3 = icmp ne i8* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @bson_fatal_msg(i32 %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int cairo_code_draw_envTitleLabel_get_height() { return 19; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envTitleLabel_get_height() {
ret i32 19
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envTitleLabel_get_height() {
ret i32 19
}
/* Variables and functions */
int /*<<< orphan*/ specify_any_Gx(int);
int specify_G2(const char *the_title) {
  specify_any_Gx(2);
  return 0;
}


x86 assembly (clang, -O0):
<specify_G2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <specify_any_Gx@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<specify_G2>:
push   %rax
mov    $0x2,%edi
call   1030 <specify_any_Gx@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @specify_G2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @specify_any_Gx(i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @specify_G2(i8* nocapture readnone %0) {
%2 = tail call i32 @specify_any_Gx(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() { fprintf(stderr, "usage: packer <firmware>\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"usage: packer <firmware>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"usage: packer <firmware>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}
int pow2gt(int x) {
  --x;
  x |= x >> 1;
  x |= x >> 2;
  x |= x >> 4;
  x |= x >> 8;
  x |= x >> 16;
  return x + 1;
}


x86 assembly (clang, -O0):
<pow2gt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2gt>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @pow2gt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
ret i32 %26
}

LLVM IR (-O2):
define i32 @pow2gt(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
/* Variables and functions */
float ceil(float);
float call_ceilf(float x) { return ceil((float)x); }


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

x86 assembly (clang, -O2):
<call_ceilf>:
jmp    1030 <ceilf@plt>

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

LLVM IR (-O2):
define float @call_ceilf(float %0) {
%2 = tail call float @llvm.ceil.f32(float %0)
ret float %2
}
writesector(buffer, sectornummer) char *buffer;
unsigned int sectornummer;
{ common(buffer, sectornummer, 3); }


x86 assembly (clang, -O0):
<writesector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1030 <common@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writesector>:
mov    $0x3,%edx
xor    %eax,%eax
jmp    1030 <common@plt>

LLVM IR (-O0):
define i32 @writesector(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %6, i32 %7, i32 3)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @writesector(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @common to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 3)
ret i32 undef
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
int translength() {
  int L;
  float u;
  u = (float)rand() / RAND_MAX;
  L = 5 + 25 * u;
  return L;
}


x86 assembly (clang, -O0):
<translength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ebd(%rip),%rax
divss  (%rax),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xebf(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb7(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<translength>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ec4(%rip),%rax
divss  (%rax),%xmm0
mulss  0xed0(%rip),%xmm0
addss  0xecc(%rip),%xmm0
cvttss2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define i32 @translength() {
%1 = alloca i32
%2 = alloca float
%3 = call i64 (...) @rand()
%4 = sitofp i64 %3 to float
%5 = load float, float* @RAND_MAX
%6 = fdiv float %4, %5
store float %6, float* %2
%7 = load float, float* %2
%8 = call float @llvm.fmuladd.f32(float 2.500000e+01, float %7, float 5.000000e+00)
%9 = fptosi float %8 to i32
store i32 %9, i32* %1
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define i32 @translength() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
%3 = load float, float* @RAND_MAX
%4 = fdiv float %2, %3
%5 = tail call float @llvm.fmuladd.f32(float %4, float 2.500000e+01, float 5.000000e+00)
%6 = fptosi float %5 to i32
ret i32 %6
}
int test_imm_8Aint16_reg(short val) {
  return ((val) & (-0x8A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Aint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff76,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Aint16_reg>:
test   $0xff76,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Aint16_reg(i16 signext %0) {
%2 = and i16 %0, -138
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float sqrtf(float);
float vec2_length(float *a) {
  float x = a[0], y = a[1];
  return sqrtf(x * x + y * y);
}


x86 assembly (clang, -O0):
<vec2_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_length>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1132 <vec2_length+0x22>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @vec2_length(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
store float* %0, float** %2
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
store float %7, float* %3
%8 = load float*, float** %2
%9 = getelementptr inbounds float, float* %8, i64 1
%10 = load float, float* %9
store float %10, float* %4
%11 = load float, float* %3
%12 = load float, float* %3
%13 = load float, float* %4
%14 = load float, float* %4
%15 = fmul float %13, %14
%16 = call float @llvm.fmuladd.f32(float %11, float %12, float %15)
%17 = call float @sqrtf(float %16)
ret float %17
}

LLVM IR (-O2):
define float @vec2_length(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call float @sqrtf(float %6)
ret float %7
}
int RECOIL_GetZxColor(int c) {
  return (c >> 1 & 1) * 16711680 | (c >> 2 & 1) * 65280 | (c & 1) * 255;
}


x86 assembly (clang, -O0):
<RECOIL_GetZxColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x1,%eax
imul   $0xff0000,%eax,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x1,%ecx
imul   $0xff00,%ecx,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
imul   $0xff,%ecx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RECOIL_GetZxColor>:
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
imul   $0xff0000,%eax,%eax
mov    %edi,%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
imul   $0xff00,%ecx,%ecx
or     %eax,%ecx
and    $0x1,%edi
mov    %edi,%eax
shl    $0x8,%eax
sub    %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @RECOIL_GetZxColor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = and i32 %4, 1
%6 = mul nsw i32 %5, 16711680
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = and i32 %8, 1
%10 = mul nsw i32 %9, 65280
%11 = or i32 %6, %10
%12 = load i32, i32* %2
%13 = and i32 %12, 1
%14 = mul nsw i32 %13, 255
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @RECOIL_GetZxColor(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1
%4 = mul nuw nsw i32 %3, 16711680
%5 = lshr i32 %0, 2
%6 = and i32 %5, 1
%7 = mul nuw nsw i32 %6, 65280
%8 = or i32 %4, %7
%9 = and i32 %0, 1
%10 = mul nuw nsw i32 %9, 255
%11 = or i32 %8, %10
ret i32 %11
}
float ran1(long *idum) {}


x86 assembly (clang, -O0):
<ran1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @ran1(i64* %0) {
%2 = alloca float
%3 = alloca i64*
store i64* %0, i64** %3
%4 = load float, float* %2
ret float %4
}

LLVM IR (-O2):
define float @ran1(i64* nocapture readnone %0) {
ret float undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main() {
  int r = sum(1, 3);
  printf("Result is %d \n", r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"Result is %d \0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AUDIO_IO_DeInit();
void cs43l22_DeInit(void) { AUDIO_IO_DeInit(); }


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

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

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

LLVM IR (-O2):
define void @cs43l22_DeInit() {
%1 = tail call i32 (...) @AUDIO_IO_DeInit()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t detexPixel32GetR16(uint32_t pixel) {
  return pixel & 0x0000FFFF;
}


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

x86 assembly (clang, -O2):
<detexPixel32GetR16>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @detexPixel32GetR16(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
int findIndex(int *, int, int, int);
int findMaxIndex(int *arr, int first, int last) {
  return findIndex(arr, first, last, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @findMaxIndex(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @findIndex(i32* %0, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t j64_true_encode(char *buf, size_t len) {
  len = ((len) < (4) ? (len) : (4));
  memcpy(buf, "true", len);
  return len;
}


x86 assembly (clang, -O0):
<j64_true_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x4,-0x10(%rbp)
jae    1138 <j64_true_encode+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_true_encode+0x36>
mov    $0x4,%eax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_true_encode+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j64_true_encode>:
push   %rbx
cmp    $0x4,%rsi
mov    $0x4,%ebx
cmovb  %rsi,%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
define i64 @j64_true_encode(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ult i64 %5, 4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %4
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i64 [ %8, %7 ], [ 4, %9 ]
store i64 %11, i64* %4
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %4
ret i64 %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
define i64 @j64_true_encode(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 4
%4 = select i1 %3, i64 %1, i64 4
%5 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ p;

/* Variables and functions */
int /*<<< orphan*/ compare(int, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p;
  p = (int *)malloc(128);
  printf("%d\n", sizeof(p));
  free(p);
  compare(1, 1);
  compare(1, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1060 <compare@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <compare@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x80,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1060 <compare@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1060 <compare@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 128)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%4 = tail call i32 @free(i32* %2)
%5 = tail call i32 @compare(i32 1, i32 1)
%6 = tail call i32 @compare(i32 1, i32 2)
ret i32 0
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct dirent *, size_t);
int __getdents(int fd, struct dirent *buf, size_t len) {
  return syscall(141, fd, buf, len);
}


x86 assembly (clang, -O0):
<__getdents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x8d,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__getdents>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x8d,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @__getdents(i32 %0, %struct.dirent* %1, i64 %2) {
%4 = tail call i32 @syscall(i32 141, i32 %0, %struct.dirent* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int esc_handler(char **save) {
  write_instr(0x00);
  write_imm(0x29);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<esc_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x29,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<esc_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x29,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @esc_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 41)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @esc_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 41)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Type definitions */
struct inode {
  int dummy;
};
struct dentry {
  int dummy;
};

/* Variables and functions */
int create_dentry(struct dentry *, char const *, struct inode *);
int dentry_link(struct dentry *dentry, const char *path, struct inode *inode) {
  return create_dentry(dentry, path, inode);
}


x86 assembly (clang, -O0):
<dentry_link>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <create_dentry@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dentry_link>:
jmp    1030 <create_dentry@plt>

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

LLVM IR (-O2):
%struct.dentry = type { i32 }
%struct.inode = type { i32 }
define i32 @dentry_link(%struct.dentry* %0, i8* %1, %struct.inode* %2) {
%4 = tail call i32 @create_dentry(%struct.dentry* %0, i8* %1, %struct.inode* %2)
ret i32 %4
}
/* Variables and functions */
scalar_t__ WIFEXITED(int);
scalar_t__ WIFSTOPPED(int);
int /*<<< orphan*/ wait(int *);
int wait_common(void) {
  int wait_status;
  wait(&wait_status);
  if (WIFEXITED(wait_status)) {
    return 0;
  } else if (WIFSTOPPED(wait_status)) {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<wait_common>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1050 <wait@plt>
mov    -0x8(%rbp),%edi
call   1040 <WIFEXITED@plt>
cmp    $0x0,%rax
je     115f <wait_common+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1189 <wait_common+0x59>
mov    -0x8(%rbp),%edi
call   1030 <WIFSTOPPED@plt>
cmp    $0x0,%rax
je     117d <wait_common+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1189 <wait_common+0x59>
jmp    1182 <wait_common+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_common>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <wait@plt>
mov    0x4(%rsp),%edi
call   1040 <WIFEXITED@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1150 <wait_common+0x20>
pop    %rcx
ret
mov    0x4(%rsp),%edi
call   1030 <WIFSTOPPED@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @wait_common() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @wait(i32* %2)
%4 = load i32, i32* %2
%5 = call i64 @WIFEXITED(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 0, i32* %1
br label %15
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i64 @WIFSTOPPED(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %1
br label %15
13: ; preds = %8
br label %14
14: ; preds = %13
store i32 -1, i32* %1
br label %15
15: ; preds = %14, %12, %7
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @wait_common() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @wait(i32* %1)
%4 = load i32, i32* %1
%5 = call i64 @WIFEXITED(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = load i32, i32* %1
%9 = call i64 @WIFSTOPPED(i32 %8)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i32 -1, i32 1
br label %12
12: ; preds = %7, %0
%13 = phi i32 [ 0, %0 ], [ %11, %7 ]
ret i32 %13
}
int test_imm_1Auint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x1A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Auint64_highword_reg>:
movabs $0x1a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Auint64_highword_reg(i64 %0) {
%2 = and i64 %0, 111669149696
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fftw_factor(int n) {
  int r;
  if ((n & 1) == 0)
    return 2;
  for (r = 3; r * r <= n; r += 2)
    if (n % r == 0)
      return r;
  return n;
}


x86 assembly (clang, -O0):
<fftw_factor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1122 <fftw_factor+0x22>
movl   $0x2,-0x4(%rbp)
jmp    116d <fftw_factor+0x6d>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1167 <fftw_factor+0x67>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1154 <fftw_factor+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116d <fftw_factor+0x6d>
jmp    1159 <fftw_factor+0x59>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <fftw_factor+0x29>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftw_factor>:
mov    $0x2,%ecx
test   $0x1,%dil
je     1137 <fftw_factor+0x37>
cmp    $0x9,%edi
jl     1135 <fftw_factor+0x35>
mov    $0x3,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1137 <fftw_factor+0x37>
add    $0x2,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jle    1120 <fftw_factor+0x20>
mov    %edi,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fftw_factor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 2, i32* %2
br label %29
9: ; preds = %1
store i32 3, i32* %4
br label %10
10: ; preds = %24, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %3
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %27
16: ; preds = %10
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = srem i32 %17, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %29
23: ; preds = %16
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 2
store i32 %26, i32* %4
br label %10
27: ; preds = %10
%28 = load i32, i32* %3
store i32 %28, i32* %2
br label %29
29: ; preds = %27, %21, %8
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @fftw_factor(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = icmp slt i32 %0, 9
br i1 %5, label %14, label %6
6: ; preds = %4, %10
%7 = phi i32 [ %11, %10 ], [ 3, %4 ]
%8 = srem i32 %0, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = add nuw nsw i32 %7, 2
%12 = mul nsw i32 %11, %11
%13 = icmp sgt i32 %12, %0
br i1 %13, label %14, label %6
14: ; preds = %6, %10, %4, %1
%15 = phi i32 [ 2, %1 ], [ %0, %4 ], [ %7, %6 ], [ %0, %10 ]
ret i32 %15
}
printf(fmt, args) char *fmt;
{
  int putc();
  _doprnt(fmt, &args, putc, 0);
  return (1);
}


x86 assembly (clang, -O0):
<printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    0x2eb2(%rip),%rdx
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <_doprnt@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ec4(%rip),%rdx
lea    0x4(%rsp),%rsi
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <_doprnt@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @printf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i32*, i32 (...)*, i32, ...) bitcast (i32 (...)* @_doprnt to i32 (i8*, i32*, i32 (...)*, i32, ...)*)(i8* %5, i32* %4, i32 (...)* @putc, i32 0)
ret i32 1
}

LLVM IR (-O2):
define i32 @printf(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 (i8*, i32*, i32 (...)*, i32, ...) bitcast (i32 (...)* @_doprnt to i32 (i8*, i32*, i32 (...)*, i32, ...)*)(i8* %0, i32* %3, i32 (...)* @putc, i32 0)
ret i32 1
}
void kspd_notify(struct kspd_notifications *notify) {}


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

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

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

LLVM IR (-O2):
%struct.kspd_notifications = type opaque
define void @kspd_notify(%struct.kspd_notifications* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void open_file2read_(char *fname, int *fd) {
  *fd = open(fname, O_RDONLY, 0);
  if (*fd == -1) {
    fprintf(stderr, "ERROR: file %s cannot be opened!\n", fname);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<open_file2read_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <open@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    118c <open_file2read_+0x5c>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file2read_>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <open@plt>
mov    %eax,(%rbx)
cmp    $0xffffffff,%eax
je     1159 <open_file2read_+0x29>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
mov    %r14,%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [34 x i8] c"ERROR: file %s cannot be opened!\0A\00"
define void @open_file2read_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6, i32 0)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 -1)
unreachable
17: ; preds = %2
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@stderr = global i32 0
@.str = [34 x i8] c"ERROR: file %s cannot be opened!\0A\00"
define void @open_file2read_(i8* %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* %0, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_retrieve_standard_term(int i, int j, int n, int *exp, double *c) {
  int a[3], fail;
  a[0] = n;
  a[1] = i;
  a[2] = j;
  fail = _ada_use_c2phc4c(25, a, exp, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_retrieve_standard_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x19,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_retrieve_standard_term>:
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %esi,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x19,%edi
mov    %rcx,%rdx
mov    %r8,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_retrieve_standard_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double*
%11 = alloca [3 x i32]
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store double* %4, double** %10
%13 = load i32, i32* %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
store i32 %15, i32* %16
%17 = load i32, i32* %7
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%20 = load i32*, i32** %9
%21 = load double*, double** %10
%22 = call i32 @_ada_use_c2phc4c(i32 25, i32* %19, i32* %20, double* %21, i32 0)
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
define i32 @syscon_retrieve_standard_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %2, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %1, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 25, i32* %8, i32* %3, double* %4, i32 0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int darisa[4] __attribute__((aligned(16)));
  int *stephanie = (int *)darisa;
  if ((unsigned long)stephanie % 16 != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
je     1140 <main+0x30>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i64
%7 = urem i64 %6, 16
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}