xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int read(int, char *, int);
int str_to_long(char *);
ssize_t get_record_len(int fd) {
  static char buff[6 + 1];
  ssize_t num_read;
  num_read = read(fd, buff, 6);
  if (num_read == 6)
    return str_to_long(buff);
  else
    return num_read;
}


x86 assembly (clang, -O0):
<get_record_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0x2efc(%rip),%rsi
mov    $0x6,%edx
call   1040 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jne    1160 <get_record_len+0x40>
lea    0x2ede(%rip),%rdi
call   1030 <str_to_long@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <get_record_len+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_record_len>:
push   %rax
lea    0x2f09(%rip),%rsi
mov    $0x6,%edx
call   1040 <read@plt>
cmp    $0x6,%eax
jne    1144 <get_record_len+0x24>
lea    0x2ef3(%rip),%rdi
pop    %rax
jmp    1030 <str_to_long@plt>
pop    %rcx
ret

LLVM IR (-O0):
@get_record_len.buff = internal global [7 x i8] zeroinitializer
define i32 @get_record_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @read(i32 %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @get_record_len.buff, i64 0, i64 0), i32 6)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 6
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @str_to_long(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @get_record_len.buff, i64 0, i64 0))
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@get_record_len.buff = internal global [7 x i8] zeroinitializer
define i32 @get_record_len(i32 %0) {
%2 = tail call i32 @read(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @get_record_len.buff, i64 0, i64 0), i32 6)
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @str_to_long(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @get_record_len.buff, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
unsigned int get_temporal_sector_addr(int size) {
  return 0x0801fc00;
  return 0x0807f800;
  return 0x0803f800;
  (void)size;
}


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

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

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

LLVM IR (-O2):
define i32 @get_temporal_sector_addr(i32 %0) {
ret i32 134347776
}
/* Variables and functions */
int utf8_wctomb(char *, int);
int wctomb_utf8(void *map, char *s, int wc) { return utf8_wctomb(s, wc); }


x86 assembly (clang, -O0):
<wctomb_utf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <utf8_wctomb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wctomb_utf8>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <utf8_wctomb@plt>

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

LLVM IR (-O2):
define i32 @wctomb_utf8(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 @utf8_wctomb(i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fini_window();
void alectrona_finish(void) { fini_window(); }


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

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

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

LLVM IR (-O2):
define void @alectrona_finish() {
%1 = tail call i32 (...) @fini_window()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __syscall(int);
pid_t getpid(void) { return __syscall(20); }


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

x86 assembly (clang, -O2):
<getpid>:
mov    $0x14,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 @__syscall(i32 20)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 @__syscall(i32 20)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raint512() {
  printf("\nChanging Read Ahead Cache size for Internal sdcard to 512kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 512 > /sys/block/mmcblk0/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raint512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xee9(%rip),%rsi
lea    0xef7(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raint512>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 512kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 512 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
define void @raint512() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 512 > /sys/block/mmcblk0/queue/read_ahead_kb'\00"
@str = [61 x i8] c"\0AChanging Read Ahead Cache size for Internal sdcard to 512kb\00"
define void @raint512() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
intptr_t endian_fix32(intptr_t);
intptr_t endian_fix64(intptr_t);
intptr_t endian_fix(intptr_t x) {
  return sizeof(long) == 8 ? endian_fix64(x) : endian_fix32(x);
}


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

x86 assembly (clang, -O2):
<endian_fix>:
jmp    1030 <endian_fix64@plt>

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

LLVM IR (-O2):
define i64 @endian_fix(i64 %0) {
%2 = tail call i64 @endian_fix64(i64 %0)
ret i64 %2
}
int max(int n1, int n2) { return n1 >= n2 ? n1 : n2; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int index_of(bitset)
int bitset;
{
  int j = 0;
  bitset &= (-bitset);
  for (;;) {
    bitset >>= 1;
    if (bitset == 0)
      return j;
    ++j;
  }
}


x86 assembly (clang, -O0):
<index_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <index_of+0x31>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <index_of+0x19>

x86 assembly (clang, -O2):
<index_of>:
mov    %edi,%ecx
neg    %ecx
and    %edi,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jb     112c <index_of+0x2c>
xor    %eax,%eax
mov    %ecx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sar    %edx
add    $0x1,%eax
cmp    $0x4,%ecx
mov    %edx,%ecx
jae    1120 <index_of+0x20>
ret

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

LLVM IR (-O2):
define i32 @index_of(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %7, %1
%6 = phi i32 [ 0, %1 ], [ %11, %7 ]
ret i32 %6
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ 0, %1 ]
%9 = phi i32 [ %10, %7 ], [ %3, %1 ]
%10 = ashr i32 %9, 1
%11 = add nuw nsw i32 %8, 1
%12 = icmp ult i32 %9, 4
br i1 %12, label %5, label %7
}
int iscntrl(int c) { return c <= 0x1F || c == 0x7F; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1120 <iscntrl+0x20>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setl   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 31
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 127
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp slt i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ calloc(int, int);
void test1(char *value) { value = (char *)calloc(10, 1); }


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

x86 assembly (clang, -O2):
<test1>:
mov    $0xa,%edi
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define void @test1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @calloc(i32 10, i32 1)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
ret void
}

LLVM IR (-O2):
define void @test1(i8* nocapture readnone %0) {
%2 = tail call i64 @calloc(i32 10, i32 1)
ret void
}
/* Variables and functions */
int bar3();
int foobar3() { return bar3(); }


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

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

LLVM IR (-O0):
define i32 @foobar3() {
%1 = call i32 (...) @bar3()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foobar3() {
%1 = tail call i32 (...) @bar3()
ret i32 %1
}
/* Variables and functions */
int rpathx_value();
int main() { return !(rpathx_value() == 5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rpathx_value@plt>
cmp    $0x5,%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <rpathx_value@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @rpathx_value()
%3 = icmp eq i32 %2, 5
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @rpathx_value()
%2 = icmp ne i32 %1, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct perf_event_attr {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_perf_event_open;
int syscall(int /*<<< orphan*/, struct perf_event_attr *, int /*<<< orphan*/,
            int, int, unsigned long);
int perf_event_open(struct perf_event_attr *attr, pid_t pid, int cpu,
                    int group_fd, unsigned long flags) {
  return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags);
}


x86 assembly (clang, -O0):
<perf_event_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_event_open>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = alloca %struct.perf_event_attr*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store %struct.perf_event_attr* %0, %struct.perf_event_attr** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i64 %4, i64* %10
%11 = load i32, i32* @__NR_perf_event_open
%12 = load %struct.perf_event_attr*, %struct.perf_event_attr** %6
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i64, i64* %10
%17 = call i32 @syscall(i32 %11, %struct.perf_event_attr* %12, i32 %13, i32 %14, i32 %15, i64 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.perf_event_attr = type { i32 }
@__NR_perf_event_open = global i32 0
define i32 @perf_event_open(%struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4) {
%6 = load i32, i32* @__NR_perf_event_open
%7 = tail call i32 @syscall(i32 %6, %struct.perf_event_attr* %0, i32 %1, i32 %2, i32 %3, i64 %4)
ret i32 %7
}
double special(y, gx)
double y, gx;
{
  double a = 0.0;
  double b;
  if (gx == 0.0)
    return (1.0);
  b = gx * gx;
  a = (y - 1.0 - gx - .5 * b) / b;
  return (a);
}


x86 assembly (clang, -O0):
<special>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1140 <special+0x40>
jp     1140 <special+0x40>
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118e <special+0x8e>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xeac(%rip),%xmm0
subsd  %xmm0,%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xe8e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<special>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jne    1115 <special+0x15>
jp     1115 <special+0x15>
movsd  0xeec(%rip),%xmm0
ret
addsd  0xeeb(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm1
movsd  0xee3(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @special(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double 0.000000e+00, double* %6
%8 = load double, double* %5
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %2
store double 1.000000e+00, double* %3
br label %24
11: ; preds = %2
%12 = load double, double* %5
%13 = load double, double* %5
%14 = fmul double %12, %13
store double %14, double* %7
%15 = load double, double* %4
%16 = fsub double %15, 1.000000e+00
%17 = load double, double* %5
%18 = fsub double %16, %17
%19 = load double, double* %7
%20 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %19, double %18)
%21 = load double, double* %7
%22 = fdiv double %20, %21
store double %22, double* %6
%23 = load double, double* %6
store double %23, double* %3
br label %24
24: ; preds = %11, %10
%25 = load double, double* %3
ret double %25
}

LLVM IR (-O2):
define double @special(double %0, double %1) {
%3 = fcmp oeq double %1, 0.000000e+00
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = fmul double %1, %1
%6 = fadd double %0, -1.000000e+00
%7 = fsub double %6, %1
%8 = tail call double @llvm.fmuladd.f64(double %5, double -5.000000e-01, double %7)
%9 = fdiv double %8, %5
br label %10
10: ; preds = %2, %4
%11 = phi double [ %9, %4 ], [ 1.000000e+00, %2 ]
ret double %11
}
int chealpix_order2nside(int order) { return 1 << order; }


x86 assembly (clang, -O0):
<chealpix_order2nside>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chealpix_order2nside>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @chealpix_order2nside(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void free_u8(uint8_t *val) {}


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

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

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

LLVM IR (-O2):
define void @free_u8(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c;
  c = getchar();
  while (c != EOF) {
    putchar(c);
    c = getchar();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     1162 <main+0x42>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1139 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
void IsTraced() {}


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

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

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

LLVM IR (-O2):
define void @IsTraced() {
ret void
}
int sfun_buildinfo_src_module_func(int i) { return i * 2; }


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

x86 assembly (clang, -O2):
<sfun_buildinfo_src_module_func>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @sfun_buildinfo_src_module_func(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
char *readSeq(int, char const *, long const, short const, long *, short *,
              short *, char *);
char *listSeqs(const char *filename_, const long skiplines_,
               const short format_, short *nseq_, short *error_) {
  char seqid[256];
  long seqlen;
  return readSeq(-1, filename_, skiplines_, format_, &seqlen, nseq_, error_,
                 seqid);
}


x86 assembly (clang, -O0):
<listSeqs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x12(%rbp),%cx
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%r10
lea    -0x130(%rbp),%rax
mov    $0xffffffff,%edi
lea    -0x138(%rbp),%r8
movswl %cx,%ecx
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <readSeq@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listSeqs>:
sub    $0x118,%rsp
mov    %r8,%rax
mov    %rcx,%r9
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x10(%rsp),%r10
lea    0x8(%rsp),%r8
mov    $0xffffffff,%edi
push   %r10
push   %rax
call   1030 <readSeq@plt>
add    $0x128,%rsp
ret

LLVM IR (-O0):
define i8* @listSeqs(i8* %0, i64 %1, i16 signext %2, i16* %3, i16* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i16
%9 = alloca i16*
%10 = alloca i16*
%11 = alloca [256 x i8]
%12 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i16 %2, i16* %8
store i16* %3, i16** %9
store i16* %4, i16** %10
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i16, i16* %8
%16 = load i16*, i16** %9
%17 = load i16*, i16** %10
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%19 = call i8* @readSeq(i32 -1, i8* %13, i64 %14, i16 signext %15, i64* %12, i16* %16, i16* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @listSeqs(i8* %0, i64 %1, i16 signext %2, i16* %3, i16* %4) {
%6 = alloca [256 x i8]
%7 = alloca i64
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%9 = bitcast i64* %7 to i8*
%10 = call i8* @readSeq(i32 -1, i8* %0, i64 %1, i16 signext %2, i64* %7, i16* %3, i16* %4, i8* %8)
ret i8* %10
}
void single_exit() { ("single_exit"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"single_exit\00"
define void @single_exit() {
ret void
}

LLVM IR (-O2):
define void @single_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vrp_keep();
void f2(int s, int b) {
  if (s > 1)
    s = 1;
  b = (b & 1) + 1;
  b = s << b;
  if (b == -2)
    vrp_keep();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    112f <f2+0x1f>
movl   $0x1,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jne    1157 <f2+0x47>
mov    $0x0,%al
call   1030 <vrp_keep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
test   %edi,%edi
mov    $0x1,%eax
cmovle %edi,%eax
and    $0x1,%sil
lea    0x1(%rsi),%ecx
shl    %cl,%eax
cmp    $0xfffffffe,%eax
jne    112f <f2+0x1f>
xor    %eax,%eax
jmp    1030 <vrp_keep@plt>
ret

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

LLVM IR (-O2):
define void @f2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 %0, i32 1
%5 = and i32 %1, 1
%6 = add nuw nsw i32 %5, 1
%7 = shl i32 %4, %6
%8 = icmp eq i32 %7, -2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (...) @vrp_keep()
br label %11
11: ; preds = %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ D_Trace(char *);
int /*<<< orphan*/ D_Tracenl(char *);
int /*<<< orphan*/ runCommand(char *);
void runCommandT(char *com) {
  D_Trace("$");
  D_Tracenl(com);
  runCommand(com);
}


x86 assembly (clang, -O0):
<runCommandT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <D_Trace@plt>
mov    -0x8(%rbp),%rdi
call   1030 <D_Tracenl@plt>
mov    -0x8(%rbp),%rdi
call   1040 <runCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runCommandT>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1050 <D_Trace@plt>
mov    %rbx,%rdi
call   1030 <D_Tracenl@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <runCommand@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"$\00"
define void @runCommandT(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @D_Trace(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @D_Tracenl(i8* %4)
%6 = load i8*, i8** %2
%7 = call i32 @runCommand(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"$\00"
define void @runCommandT(i8* %0) {
%2 = tail call i32 @D_Trace(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @D_Tracenl(i8* %0)
%4 = tail call i32 @runCommand(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int include_test() {
  printf("OK");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"OK\00"
define i32 @include_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"OK\00"
define i32 @include_test() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
unsigned int _pdep_u32(unsigned int, unsigned int);
unsigned int test_pdep_u32(unsigned int __X, unsigned int __Y) {
  return _pdep_u32(__X, __Y);
}


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

x86 assembly (clang, -O2):
<test_pdep_u32>:
jmp    1030 <_pdep_u32@plt>

LLVM IR (-O0):
define i32 @test_pdep_u32(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 @_pdep_u32(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_pdep_u32(i32 %0, i32 %1) {
%3 = tail call i32 @_pdep_u32(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int feof(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int slave_dismissed() { return feof(stdin); }


x86 assembly (clang, -O0):
<slave_dismissed>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <feof@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<slave_dismissed>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <feof@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @slave_dismissed() {
%1 = load i32, i32* @stdin
%2 = call i32 @feof(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @slave_dismissed() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @feof(i32 %1)
ret i32 %2
}
void ff_hevc_put_hevc_bi_w_epel_hv12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv12_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tr_treedist_usage() {
  fprintf(stderr, "Usage: treebest treedist <tree1> <tree2>\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<tr_treedist_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: treebest treedist <tree1> <tree2>\0A\00"
define i32 @tr_treedist_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Usage: treebest treedist <tree1> <tree2>\0A\00"
define i32 @tr_treedist_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  fprintf(stdout, "%s", "some output on stdout\n");
  fprintf(stderr, "%s", "some output on stderr\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xeae(%rip),%rsi
lea    0xec1(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rbx
lea    0xedb(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rdx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [23 x i8] c"some output on stdout\0A\00"
@stderr = global i32 0
@.str.2 = [23 x i8] c"some output on stderr\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [23 x i8] c"some output on stdout\0A\00"
@stderr = global i32 0
@.str.2 = [23 x i8] c"some output on stderr\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void pio_init(void) {}


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

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

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

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

/* Variables and functions */
void Encrypt(uint8_t *block, uint8_t *roundKeys) {}


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

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

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

LLVM IR (-O2):
define void @Encrypt(i32* nocapture %0, i32* nocapture %1) {
ret void
}
/* Variables and functions */
size_t base64_decoded_size(size_t size) {
  if (size % 4) {
    return 0;
  }
  return (size / 4) * 3;
}


x86 assembly (clang, -O0):
<base64_decoded_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%rax
cmp    $0x0,%rax
je     1127 <base64_decoded_size+0x27>
movq   $0x0,-0x8(%rbp)
jmp    1137 <base64_decoded_size+0x37>
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
imul   $0x3,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decoded_size>:
mov    %rdi,%rcx
shr    $0x2,%rcx
xor    %eax,%eax
test   $0x3,%dil
lea    (%rcx,%rcx,2),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @base64_decoded_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = urem i64 %4, 4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i64 0, i64* %2
br label %12
8: ; preds = %1
%9 = load i64, i64* %3
%10 = udiv i64 %9, 4
%11 = mul i64 %10, 3
store i64 %11, i64* %2
br label %12
12: ; preds = %8, %7
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
define i64 @base64_decoded_size(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = lshr i64 %0, 2
%5 = mul nuw i64 %4, 3
%6 = select i1 %3, i64 %5, i64 0
ret i64 %6
}
/* Variables and functions */
scalar_t__ INT_MIN;
unsigned int test5u(unsigned int x) {
  return (x - (unsigned int)INT_MIN) ^ 0x1234;
}


x86 assembly (clang, -O0):
<test5u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%rcx
sub    %ecx,%eax
xor    $0x1234,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5u>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
sub    (%rcx),%eax
xor    $0x1234,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
define i32 @test5u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i64, i64* @INT_MIN
%5 = trunc i64 %4 to i32
%6 = sub i32 %3, %5
%7 = xor i32 %6, 4660
ret i32 %7
}

LLVM IR (-O2):
@INT_MIN = global i64 0
define i32 @test5u(i32 %0) {
%2 = load i64, i64* @INT_MIN
%3 = trunc i64 %2 to i32
%4 = sub i32 %0, %3
%5 = xor i32 %4, 4660
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int get_socket() {
  int sock;
  if ((sock = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
    return -1;
  }
  return sock;
}


x86 assembly (clang, -O0):
<get_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1149 <get_socket+0x39>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <get_socket+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socket>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @get_socket() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %10
8: ; preds = %0
%9 = load i32, i32* %2
store i32 %9, i32* %1
br label %10
10: ; preds = %8, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @get_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp sgt i32 %3, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
int test_004(int a, int b, int c) { return c - ((a & b) != 0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
cmp    $0x0,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edx,%eax
and    %esi,%edi
cmp    $0x1,%edi
adc    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @test_004(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* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = and i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = sub nsw i32 %7, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @test_004(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = icmp ne i32 %4, 0
%6 = sext i1 %5 to i32
%7 = add i32 %6, %2
ret i32 %7
}
int get_num_digits(int num) {
  int num_digits;
  num_digits = 0;
  while (num) {
    ++num_digits;
    num /= 10;
  }
  return (num_digits);
}


x86 assembly (clang, -O0):
<get_num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1134 <get_num_digits+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <get_num_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_digits>:
xor    %eax,%eax
test   %edi,%edi
je     1132 <get_num_digits+0x32>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <get_num_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_num_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = sdiv i32 %5, 10
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_storer_ps(float *, int /*<<< orphan*/);
void test_mm_storer_ps(float *x, __m128 y) { _mm_storer_ps(x, y); }


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

x86 assembly (clang, -O2):
<test_mm_storer_ps>:
jmp    1030 <_mm_storer_ps@plt>

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

LLVM IR (-O2):
define void @test_mm_storer_ps(float* %0, i32 %1) {
%3 = tail call i32 @_mm_storer_ps(float* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int errno;
int getgroups(int, int /*<<< orphan*/ *);
int __sulong_posix_getgroups(int gidsetsize, gid_t grouplist[]) {
  {
    int native_errno = errno;
    int result = getgroups(gidsetsize, grouplist);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_getgroups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getgroups@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    1154 <__sulong_posix_getgroups+0x44>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
mov    0x2e82(%rip),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_getgroups>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <getgroups@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @__sulong_posix_getgroups(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* @errno
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = call i32 @getgroups(i32 %8, i32* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32, i32* @errno
%15 = sub nsw i32 0, %14
%16 = sext i32 %15 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %5
store i32 %19, i32* @errno
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_getgroups(i32 %0, i32* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @getgroups(i32 %0, i32* %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
double pdf_Discrete(long n, double *p, double tot, long x) {
  return p[x] / tot;
}


x86 assembly (clang, -O0):
<pdf_Discrete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdf_Discrete>:
movsd  (%rsi,%rdx,8),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pdf_Discrete(i64 %0, double* %1, double %2, i64 %3) {
%5 = alloca i64
%6 = alloca double*
%7 = alloca double
%8 = alloca i64
store i64 %0, i64* %5
store double* %1, double** %6
store double %2, double* %7
store i64 %3, i64* %8
%9 = load double*, double** %6
%10 = load i64, i64* %8
%11 = getelementptr inbounds double, double* %9, i64 %10
%12 = load double, double* %11
%13 = load double, double* %7
%14 = fdiv double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @pdf_Discrete(i64 %0, double* nocapture %1, double %2, i64 %3) {
%5 = getelementptr inbounds double, double* %1, i64 %3
%6 = load double, double* %5
%7 = fdiv double %6, %2
ret double %7
}
int tegra_throttle_debug_init(struct dentry *cpu_tegra_debugfs_root) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
define i32 @tegra_throttle_debug_init(%struct.dentry* nocapture readnone %0) {
ret i32 0
}