xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
long ftell(int /*<<< orphan*/ *);
int fget(char *buf, int buf_sz, FILE *f) {
  long p0 = ftell(f);
  return (!fgets(buf, buf_sz, f)) ? 0 : ftell(f) - p0;
}


x86 assembly (clang, -O0):
<fget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%eax
jne    1164 <fget+0x44>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    1175 <fget+0x55>
mov    -0x18(%rbp),%rdi
call   1040 <ftell@plt>
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
test   %eax,%eax
je     115a <fget+0x3a>
mov    %rbx,%rdi
call   1040 <ftell@plt>
sub    %r14d,%eax
jmp    115c <fget+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fget(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = call i64 @ftell(i32* %8)
store i64 %9, i64* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32*, i32** %6
%13 = call i32 @fgets(i8* %10, i32 %11, i32* %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %3
br label %21
16: ; preds = %3
%17 = load i32*, i32** %6
%18 = call i64 @ftell(i32* %17)
%19 = load i64, i64* %7
%20 = sub nsw i64 %18, %19
br label %21
21: ; preds = %16, %15
%22 = phi i64 [ 0, %15 ], [ %20, %16 ]
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @fget(i8* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i64 @ftell(i32* %2)
%5 = tail call i32 @fgets(i8* %0, i32 %1, i32* %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = tail call i64 @ftell(i32* %2)
%9 = sub nsw i64 %8, %4
%10 = trunc i64 %9 to i32
br label %11
11: ; preds = %3, %7
%12 = phi i32 [ %10, %7 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i;
  int a = 0;
  int b = 10;
  int c = 0;
  for (i = 0; i < 5; i++) {
    a = b * 4;
    c = a * b;
  }
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1166 <main+0x56>
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <main+0x2b>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 400)
ret i32 0
}
int get_desired_workers(int desired_workers) { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @get_desired_workers(i32 %0) {
ret i32 4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ xoroshiro128plus_next();
uint64_t c_random() { return xoroshiro128plus_next(); }


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

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

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

LLVM IR (-O2):
define i32 @c_random() {
%1 = tail call i32 (...) @xoroshiro128plus_next()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ eFree(char *);
char *popString();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
void basShell() {
  char *string;
  string = popString();
  system(string);
  eFree(string);
  pushNumber(0);
}


x86 assembly (clang, -O0):
<basShell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <system@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eFree@plt>
xor    %edi,%edi
call   1060 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basShell>:
push   %rbx
xor    %eax,%eax
call   1050 <popString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
call   1030 <eFree@plt>
xor    %edi,%edi
pop    %rbx
jmp    1060 <pushNumber@plt>

LLVM IR (-O0):
define void @basShell() {
%1 = alloca i8*
%2 = call i8* (...) @popString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @system(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @eFree(i8* %5)
%7 = call i32 @pushNumber(i32 0)
ret void
}

LLVM IR (-O2):
define void @basShell() {
%1 = tail call i8* (...) @popString()
%2 = tail call i32 @system(i8* %1)
%3 = tail call i32 @eFree(i8* %1)
%4 = tail call i32 @pushNumber(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void f2(int size) {
  char src[10];
  memset(src, 0, size);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x18,%rsp
mov    %edi,%edx
lea    0xe(%rsp),%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @memset(i8* %4, i32 0, i32 %5)
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 %0)
ret void
}
int recursiveGx(int n) {
  if (n == 0)
    return 0;
  else if (n == 1)
    return 1;
  else if (n == 2)
    return 2;
  else
    return (recursiveGx(n - 1) + recursiveGx(n - 2) + recursiveGx(n - 3));
}


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

x86 assembly (clang, -O2):
<recursiveGx>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %r14d,%r14d
cmp    $0x3,%ebx
jb     1142 <recursiveGx+0x32>
xchg   %ax,%ax
lea    -0x1(%rbx),%edi
call   1030 <recursiveGx@plt>
mov    %eax,%ebp
lea    -0x2(%rbx),%edi
call   1030 <recursiveGx@plt>
add    %r14d,%ebp
add    %eax,%ebp
add    $0xfffffffd,%ebx
mov    %ebp,%r14d
cmp    $0x3,%ebx
jae    1120 <recursiveGx+0x10>
add    %r14d,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @recursiveGx(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %13, %6 ]
%4 = phi i32 [ %0, %1 ], [ %11, %6 ]
%5 = icmp ult i32 %4, 3
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @recursiveGx(i32 %7)
%9 = add nsw i32 %4, -2
%10 = tail call i32 @recursiveGx(i32 %9)
%11 = add nsw i32 %4, -3
%12 = add i32 %8, %3
%13 = add i32 %12, %10
br label %2
14: ; preds = %2
%15 = add nsw i32 %4, %3
ret i32 %15
}
void gtk_entry_get_width_chars() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_get_width_chars() {
ret void
}
unsigned long int
unsignedlongint_ignoring_unsignedshortint(unsigned long int x,
                                          unsigned short int y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_unsignedshortint(i64 returned %0, i16 zeroext %1) {
ret i64 %0
}
int isspace(int c) {
  switch (c) {
  case ' ':
  case '\f':
  case '\n':
  case '\r':
  case '\t':
  case '\v':
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff7,%eax
sub    $0x5,%eax
jb     112f <isspace+0x2f>
jmp    111e <isspace+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    113b <isspace+0x3b>
jmp    112f <isspace+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1142 <isspace+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
lea    -0x9(%rdi),%ecx
cmp    $0x5,%ecx
jae    110e <isspace+0xe>
ret
cmp    $0x20,%edi
je     110d <isspace+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 12, label %3
i32 10, label %3
i32 13, label %3
i32 9, label %3
i32 11, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
struct strbuf **strbuf_split_max(struct strbuf const *, int,
                                 int /*<<< orphan*/);
struct strbuf **strbuf_split(const struct strbuf *sb, int terminator) {
  return strbuf_split_max(sb, terminator, 0);
}


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

x86 assembly (clang, -O2):
<strbuf_split>:
xor    %edx,%edx
jmp    1030 <strbuf_split_max@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define %struct.strbuf** @strbuf_split(%struct.strbuf* %0, i32 %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i32
store %struct.strbuf* %0, %struct.strbuf** %3
store i32 %1, i32* %4
%5 = load %struct.strbuf*, %struct.strbuf** %3
%6 = load i32, i32* %4
%7 = call %struct.strbuf** @strbuf_split_max(%struct.strbuf* %5, i32 %6, i32 0)
ret %struct.strbuf** %7
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define %struct.strbuf** @strbuf_split(%struct.strbuf* %0, i32 %1) {
%3 = tail call %struct.strbuf** @strbuf_split_max(%struct.strbuf* %0, i32 %1, i32 0)
ret %struct.strbuf** %3
}
void avformat_get_riff_video_tags() {}


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

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

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

LLVM IR (-O2):
define void @avformat_get_riff_video_tags() {
ret void
}
void dbgbi_output(int output_type, void *param) {
  (void)output_type;
  (void)param;
}


x86 assembly (clang, -O0):
<dbgbi_output>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @dbgbi_output(i32 %0, i8* nocapture %1) {
ret void
}
int test_imm_9Duint8_reg(unsigned char val) {
  return ((val) & (0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Duint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_9Duint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 157
%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_9Duint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -99
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_C4uint8_mem(unsigned char *val) {
  return ((*val) & (-0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4uint8_mem>:
testb  $0x3c,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 60
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
float fabs(float n) {
  if (n < 0)
    return -n;
  return n;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <fabs+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <fabs+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ strncpy(int *, int *, int);
void strncpy_bad4() {
  int src[1];
  int buff[1];
  int *dst = &buff[0];
  strncpy(dst, src, sizeof(dst));
}


x86 assembly (clang, -O0):
<strncpy_bad4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_bad4>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @strncpy_bad4() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = alloca i32*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @strncpy_bad4() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 8)
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert(struct genlist *, void *, int);
void genlist_append(struct genlist *pgenlist, void *data) {
  genlist_insert(pgenlist, data, -1);
}


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

x86 assembly (clang, -O2):
<genlist_append>:
mov    $0xffffffff,%edx
jmp    1030 <genlist_insert@plt>

LLVM IR (-O0):
%struct.genlist = type { i32 }
define void @genlist_append(%struct.genlist* %0, i8* %1) {
%3 = alloca %struct.genlist*
%4 = alloca i8*
store %struct.genlist* %0, %struct.genlist** %3
store i8* %1, i8** %4
%5 = load %struct.genlist*, %struct.genlist** %3
%6 = load i8*, i8** %4
%7 = call i32 @genlist_insert(%struct.genlist* %5, i8* %6, i32 -1)
ret void
}

LLVM IR (-O2):
%struct.genlist = type { i32 }
define void @genlist_append(%struct.genlist* %0, i8* %1) {
%3 = tail call i32 @genlist_insert(%struct.genlist* %0, i8* %1, i32 -1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t rfc4175_get_line_continuation(const uint8_t *buf) {
  return buf[4] >> 7;
}


x86 assembly (clang, -O0):
<rfc4175_get_line_continuation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
sar    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_get_line_continuation>:
mov    0x10(%rdi),%eax
sar    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @rfc4175_get_line_continuation(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 7
ret i32 %6
}

LLVM IR (-O2):
define i32 @rfc4175_get_line_continuation(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = ashr i32 %3, 7
ret i32 %4
}
void initialise_signals() {}


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

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

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

LLVM IR (-O2):
define void @initialise_signals() {
ret void
}
/* Variables and functions */
double arrondi_echelle(double);
double length_phys_log(double);
double calc_echelle(int larg) {
  double log_val, phys_val;
  phys_val = larg / 10;
  log_val = length_phys_log(phys_val);
  log_val = arrondi_echelle(log_val);
  return log_val;
}


x86 assembly (clang, -O0):
<calc_echelle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <length_phys_log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <arrondi_echelle@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_echelle>:
push   %rax
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1040 <length_phys_log@plt>
pop    %rax
jmp    1030 <arrondi_echelle@plt>

LLVM IR (-O0):
define double @calc_echelle(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
%7 = sitofp i32 %6 to double
store double %7, double* %4
%8 = load double, double* %4
%9 = call double @length_phys_log(double %8)
store double %9, double* %3
%10 = load double, double* %3
%11 = call double @arrondi_echelle(double %10)
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @calc_echelle(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = sitofp i32 %2 to double
%4 = tail call double @length_phys_log(double %3)
%5 = tail call double @arrondi_echelle(double %4)
ret double %5
}
/* Variables and functions */
int unlink(char const *);
int semaphore_unlink(const char *pathname) { return unlink(pathname); }


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

x86 assembly (clang, -O2):
<semaphore_unlink>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define i32 @semaphore_unlink(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret i32 %2
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int set_PWM_dutycycle(int pi, unsigned user_gpio, unsigned dutycycle) {
  return pigpio_command(pi, 5, user_gpio, dutycycle, 1);
}


x86 assembly (clang, -O0):
<set_PWM_dutycycle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x5,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PWM_dutycycle>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x5,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

LLVM IR (-O0):
define i32 @set_PWM_dutycycle(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 @pigpio_command(i32 %7, i32 5, i32 %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @set_PWM_dutycycle(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 5, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  char *s = "texto";
  printf("%s\n", s);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xeef(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"texto\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
void kernel_evlog_dump(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ crc32_iscsi_base(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
uint32_t crc32_iscsi_base_wrap(uint32_t seed, uint8_t *buf, uint64_t len) {
  return crc32_iscsi_base(buf, len, seed);
}


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

x86 assembly (clang, -O2):
<crc32_iscsi_base_wrap>:
mov    %edi,%eax
mov    %rsi,%rdi
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <crc32_iscsi_base@plt>

LLVM IR (-O0):
define i32 @crc32_iscsi_base_wrap(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** %5
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = call i32 @crc32_iscsi_base(i32* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @crc32_iscsi_base_wrap(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @crc32_iscsi_base(i32* %1, i32 %2, i32 %0)
ret i32 %4
}
/* Variables and functions */
int vec_splice(void *, int /*<<< orphan*/, void const *, size_t, size_t);
int /*<<< orphan*/ vec_truncat(void *, int /*<<< orphan*/, size_t);
int vec_transfer(void *destp, void const *data, size_t len, size_t size) {
  vec_truncat(destp, 0, size);
  return vec_splice(destp, 0, data, len, size);
}


x86 assembly (clang, -O0):
<vec_transfer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1040 <vec_truncat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
xor    %esi,%esi
call   1030 <vec_splice@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_transfer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %esi,%esi
mov    %rcx,%rdx
call   1040 <vec_truncat@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r12,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <vec_splice@plt>

LLVM IR (-O0):
define i32 @vec_transfer(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %8
%11 = call i32 @vec_truncat(i8* %9, i32 0, i64 %10)
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = call i32 @vec_splice(i8* %12, i32 0, i8* %13, i64 %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @vec_transfer(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = tail call i32 @vec_truncat(i8* %0, i32 0, i64 %3)
%6 = tail call i32 @vec_splice(i8* %0, i32 0, i8* %1, i64 %2, i64 %3)
ret i32 %6
}
/* Variables and functions */
double eccentric_anomaly_at_mean_anomaly(double, double);
double true_anomaly_at_eccentric_anomaly(double, double);
double true_anomaly_at_mean_anomaly(double e, double M) {
  double E = eccentric_anomaly_at_mean_anomaly(e, M);
  return true_anomaly_at_eccentric_anomaly(e, E);
}


x86 assembly (clang, -O0):
<true_anomaly_at_mean_anomaly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <eccentric_anomaly_at_mean_anomaly@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <true_anomaly_at_eccentric_anomaly@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<true_anomaly_at_mean_anomaly>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <eccentric_anomaly_at_mean_anomaly@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <true_anomaly_at_eccentric_anomaly@plt>

LLVM IR (-O0):
define double @true_anomaly_at_mean_anomaly(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @eccentric_anomaly_at_mean_anomaly(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %3
%10 = load double, double* %5
%11 = call double @true_anomaly_at_eccentric_anomaly(double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @true_anomaly_at_mean_anomaly(double %0, double %1) {
%3 = tail call double @eccentric_anomaly_at_mean_anomaly(double %0, double %1)
%4 = tail call double @true_anomaly_at_eccentric_anomaly(double %0, double %3)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(size_t, size_t);
void *ecalloc(size_t nmemb, size_t size) {
  void *p;
  p = calloc(nmemb, size);
  if (p == NULL)
    abort();
  return p;
}


x86 assembly (clang, -O0):
<ecalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <ecalloc+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecalloc>:
push   %rax
call   1040 <calloc@plt>
test   %rax,%rax
je     112d <ecalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @ecalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @ecalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
double ror(double, int);
double dblRor(double a, int b) { return ror(a, b); }


x86 assembly (clang, -O0):
<dblRor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <ror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblRor>:
jmp    1030 <ror@plt>

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

LLVM IR (-O2):
define double @dblRor(double %0, i32 %1) {
%3 = tail call double @ror(double %0, i32 %1)
ret double %3
}
void foo309(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo309(i32 %0) {
ret void
}
/* Variables and functions */
int f317(int *);
int f318(int *p) { return f317(p); }


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

x86 assembly (clang, -O2):
<f318>:
jmp    1030 <f317@plt>

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

LLVM IR (-O2):
define i32 @f318(i32* %0) {
%2 = tail call i32 @f317(i32* %0)
ret i32 %2
}
void strip_crlf(char *line) { return; }


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

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

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

LLVM IR (-O2):
define void @strip_crlf(i8* nocapture %0) {
ret void
}
int test4(int f) { return ~f == 5; }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
xor    %eax,%eax
cmp    $0xfffffffa,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = icmp eq i32 %0, -6
%3 = zext i1 %2 to i32
ret i32 %3
}
double ldot_product(double *v1, double *v2) {
  return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]);
}


x86 assembly (clang, -O0):
<ldot_product>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldot_product>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ldot_product(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @ldot_product(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
void pthread_exit(void *);
void ithread_exit(void *val_ptr) { return pthread_exit(val_ptr); }


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

x86 assembly (clang, -O2):
<ithread_exit>:
jmp    1030 <pthread_exit@plt>

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

LLVM IR (-O2):
define void @ithread_exit(i8* %0) {
tail call void @pthread_exit(i8* %0)
ret void
}
int test_imm_C5uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xC5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_C5uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 197
%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_C5uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 12910592
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int utimes(char const *, struct timeval const *);
__attribute__((__weak__, __always___)) int
softboundmpx_utimes(const char *filename, const struct timeval times[2]) {
  return utimes(filename, times);
}


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

x86 assembly (clang, -O2):
<softboundmpx_utimes>:
jmp    1030 <utimes@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define weak i32 @softboundmpx_utimes(i8* %0, %struct.timeval* %1) {
%3 = alloca i8*
%4 = alloca %struct.timeval*
store i8* %0, i8** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load i8*, i8** %3
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = call i32 @utimes(i8* %5, %struct.timeval* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define weak i32 @softboundmpx_utimes(i8* %0, %struct.timeval* %1) {
%3 = tail call i32 @utimes(i8* %0, %struct.timeval* %1)
ret i32 %3
}
/* Variables and functions */
int rename(char const *, char const *);
int _rename(const char *from, const char *to) { return rename(from, to); }


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

x86 assembly (clang, -O2):
<_rename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
int decrypt_byte(unsigned long keys[3]) {
  unsigned temp;
  temp = ((unsigned)keys[2] & 0xffff) | 2;
  return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<decrypt_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
and    $0xffff,%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0x1,%ecx
imul   %ecx,%eax
shr    $0x8,%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt_byte>:
mov    $0xfffd,%eax
and    0x10(%rdi),%eax
lea    0x2(%rax),%ecx
xor    $0x3,%eax
imul   %ecx,%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @decrypt_byte(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 2
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = and i32 %7, 65535
%9 = or i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = xor i32 %11, 1
%13 = mul i32 %10, %12
%14 = lshr i32 %13, 8
%15 = and i32 %14, 255
ret i32 %15
}

LLVM IR (-O2):
define i32 @decrypt_byte(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = and i32 %4, 65533
%6 = or i32 %5, 2
%7 = xor i32 %5, 3
%8 = mul nuw i32 %6, %7
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
ret i32 %10
}
/* Variables and functions */
double log(int);
double math_atanh(double x) { return 0.5 * log((1 + x) / (1 - x)); }


x86 assembly (clang, -O0):
<math_atanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_atanh>:
push   %rax
movsd  0xee7(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <log@plt>
mulsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @math_atanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fsub double 1.000000e+00, %5
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
%9 = call double @log(i32 %8)
%10 = fmul double 5.000000e-01, %9
ret double %10
}

LLVM IR (-O2):
define double @math_atanh(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fsub double 1.000000e+00, %0
%4 = fdiv double %2, %3
%5 = fptosi double %4 to i32
%6 = tail call double @log(i32 %5)
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Type definitions */
struct gonc_linked_list {
  int dummy;
};
struct gonc_entry {
  int dummy;
};

/* Variables and functions */
int gonc_linked_list_insert(struct gonc_linked_list *, int /*<<< orphan*/,
                            struct gonc_entry *);
int gonc_linked_list_prepend(struct gonc_linked_list *linked_list,
                             struct gonc_entry *entry) {
  return gonc_linked_list_insert(linked_list, 0, entry);
}


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

x86 assembly (clang, -O2):
<gonc_linked_list_prepend>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <gonc_linked_list_insert@plt>

LLVM IR (-O0):
%struct.gonc_linked_list = type { i32 }
%struct.gonc_entry = type { i32 }
define i32 @gonc_linked_list_prepend(%struct.gonc_linked_list* %0, %struct.gonc_entry* %1) {
%3 = alloca %struct.gonc_linked_list*
%4 = alloca %struct.gonc_entry*
store %struct.gonc_linked_list* %0, %struct.gonc_linked_list** %3
store %struct.gonc_entry* %1, %struct.gonc_entry** %4
%5 = load %struct.gonc_linked_list*, %struct.gonc_linked_list** %3
%6 = load %struct.gonc_entry*, %struct.gonc_entry** %4
%7 = call i32 @gonc_linked_list_insert(%struct.gonc_linked_list* %5, i32 0, %struct.gonc_entry* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.gonc_linked_list = type { i32 }
%struct.gonc_entry = type { i32 }
define i32 @gonc_linked_list_prepend(%struct.gonc_linked_list* %0, %struct.gonc_entry* %1) {
%3 = tail call i32 @gonc_linked_list_insert(%struct.gonc_linked_list* %0, i32 0, %struct.gonc_entry* %1)
ret i32 %3
}