xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ EWOULDBLOCK;
scalar_t__ errno;
int slp_noblockcheck(void) {
  if (errno != EWOULDBLOCK)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<slp_noblockcheck>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%rax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%rax
je     112a <slp_noblockcheck+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1131 <slp_noblockcheck+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slp_noblockcheck>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
mov    0x2ec7(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
setne  %al
neg    %eax
ret

LLVM IR (-O0):
@errno = global i64 0
@EWOULDBLOCK = global i64 0
define i32 @slp_noblockcheck() {
%1 = alloca i32
%2 = load i64, i64* @errno
%3 = load i64, i64* @EWOULDBLOCK
%4 = icmp ne i64 %2, %3
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@errno = global i64 0
@EWOULDBLOCK = global i64 0
define i32 @slp_noblockcheck() {
%1 = load i64, i64* @errno
%2 = load i64, i64* @EWOULDBLOCK
%3 = icmp ne i64 %1, %2
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ thr1(int /*<<< orphan*/);
int /*<<< orphan*/ thr2(int /*<<< orphan*/);
int /*<<< orphan*/ thr3(int /*<<< orphan*/);
int /*<<< orphan*/ thr4(int /*<<< orphan*/);
int main() {
__CPROVER_ASYNC_0:
  thr1(0);
__CPROVER_ASYNC_1:
  thr2(0);
__CPROVER_ASYNC_2:
  thr3(0);
__CPROVER_ASYNC_3:
  thr4(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
jmp    1149 <main+0x9>
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1060 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <thr1@plt>
xor    %edi,%edi
call   1050 <thr2@plt>
xor    %edi,%edi
call   1060 <thr3@plt>
xor    %edi,%edi
call   1040 <thr4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
br label %1
1: ; preds = %0
%2 = call i32 @thr1(i32 0)
br label %3
3: ; preds = %1
%4 = call i32 @thr2(i32 0)
br label %5
5: ; preds = %3
%6 = call i32 @thr3(i32 0)
br label %7
7: ; preds = %5
%8 = call i32 @thr4(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @thr1(i32 0)
%2 = tail call i32 @thr2(i32 0)
%3 = tail call i32 @thr3(i32 0)
%4 = tail call i32 @thr4(i32 0)
ret i32 0
}
/* Variables and functions */
int f416(int *);
int f417(int *p) { return f416(p); }


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

x86 assembly (clang, -O2):
<f417>:
jmp    1030 <f416@plt>

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

LLVM IR (-O2):
define i32 @f417(i32* %0) {
%2 = tail call i32 @f416(i32* %0)
ret i32 %2
}
int main() {
  int s = 0;
  int i = 0;
  while (i <= 5) {
    s = s + i;
    i++;
  }
  return i + s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jg     113a <main+0x3a>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 21
}
char stackBased2() {
  char buf[2];
  buf[1] = 'a';
  return buf[0];
}


x86 assembly (clang, -O0):
<stackBased2>:
push   %rbp
mov    %rsp,%rbp
movb   $0x61,-0x1(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @stackBased2() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 97, i8* %2
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%4 = load i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @stackBased2() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ runStateMachine(int, char **);
int main(int argc, char *argv[]) {
  runStateMachine(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <runStateMachine@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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* %4
%7 = load i8**, i8*** %5
%8 = call i32 @runStateMachine(i32 %6, i8** %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @runStateMachine(i32 %0, i8** %1)
ret i32 0
}
/* Type definitions */
typedef int FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
*abrir(char *fichero) {
  FILE *pf;
  if ((pf = fopen(fichero, "r")) == NULL) {
    printf("El fichero %s no puede abrirse.\n", fichero);
    exit(2);
  }
  return pf;
}


x86 assembly (clang, -O0):
<abrir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1174 <abrir+0x44>
mov    -0x8(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abrir>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <abrir+0x17>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [33 x i8] c"El fichero %s no puede abrirse.\0A\00"
define i32* @abrir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 2)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [33 x i8] c"El fichero %s no puede abrirse.\0A\00"
define noalias i32* @abrir(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
char toupper(char);
char __exit(void) {
  char op;
  printf("You want to finish de program? Y/N\n>>");
  __fpurge(stdin);
  op = getchar();
  return toupper(op);
}


x86 assembly (clang, -O0):
<__exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <__fpurge@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__exit>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <__fpurge@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
movsbl %al,%edi
pop    %rax
jmp    1030 <toupper@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"You want to finish de program? Y/N\0A>>\00"
@stdin = global i32 0
define signext i8 @__exit() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdin
%4 = call i32 @__fpurge(i32 %3)
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = call signext i8 @toupper(i8 signext %6)
ret i8 %7
}

LLVM IR (-O2):
@.str = [38 x i8] c"You want to finish de program? Y/N\0A>>\00"
@stdin = global i32 0
define signext i8 @__exit() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdin
%3 = tail call i32 @__fpurge(i32 %2)
%4 = tail call signext i8 (...) @getchar()
%5 = tail call signext i8 @toupper(i8 signext %4)
ret i8 %5
}
void foo_2_1_2_1_1_1_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_1_1_2_2_1() {
ret void
}
int togglebit(int num, int i) { return num ^= (1 << i); }


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

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

LLVM IR (-O0):
define i32 @togglebit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i32, i32* %3
%8 = xor i32 %7, %6
store i32 %8, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @togglebit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
unsigned char *sha1_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_sha1(unsigned char *out, const unsigned char *in,
                                size_t in_len) {
  return sha1_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_sha1>:
jmp    1030 <sha1_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_sha1(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sha1_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("\nUsage: mem_copy -a <address> -n <bytes>\n"
         "  -h            Help (this message)\n"
         "  -a <address>  Hex address of start of memory\n"
         "  -n <bytes>    Number of bytes to copy\n"
         "  -f <name>     Filename\n\n");
}


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

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

LLVM IR (-O0):
@.str = [191 x i8] c"\0AUsage: mem_copy -a <address> -n <bytes>\0A -h Help (this message)\0A -a <address> Hex address of start of memory\0A -n <bytes> Number of bytes to copy\0A -f <name> Filename\0A\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([191 x i8], [191 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [190 x i8] c"\0AUsage: mem_copy -a <address> -n <bytes>\0A -h Help (this message)\0A -a <address> Hex address of start of memory\0A -n <bytes> Number of bytes to copy\0A -f <name> Filename\0A\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([190 x i8], [190 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void double_destroy(void *to_delete) { free(to_delete); }


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

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

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

LLVM IR (-O2):
define void @double_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int main() {
  long double d;
  char s[sizeof d];
  __builtin_memcpy(&d, "AAAAAAAAAAAAAAA", sizeof d);
  __builtin_memcpy(&s, &d, sizeof s);
  if (__builtin_strncmp(s, "AAAAAAAAAAAAAAA", sizeof s) != 0)
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea0(%rip),%rsi
mov    $0x10,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
je     1178 <main+0x58>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"AAAAAAAAAAAAAAA\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca x86_fp80
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast x86_fp80* %2 to i8*
%5 = bitcast [16 x i8]* %3 to i8*
%6 = bitcast x86_fp80* %2 to i8*
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 16)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %0
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int uint16_t;

/* Variables and functions */
int read86(scalar_t__);
uint16_t readw86(uint32_t addr32) {
  return ((uint16_t)read86(addr32) | (uint16_t)(read86(addr32 + 1) << 8));
}


x86 assembly (clang, -O0):
<readw86>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read86@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <read86@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw86>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <read86@plt>
mov    %eax,%ebp
add    $0x1,%rbx
mov    %rbx,%rdi
call   1030 <read86@plt>
shl    $0x8,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readw86(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @read86(i64 %3)
%5 = load i64, i64* %2
%6 = add nsw i64 %5, 1
%7 = call i32 @read86(i64 %6)
%8 = shl i32 %7, 8
%9 = or i32 %4, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @readw86(i64 %0) {
%2 = tail call i32 @read86(i64 %0)
%3 = add nsw i64 %0, 1
%4 = tail call i32 @read86(i64 %3)
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
ret i32 %6
}
unsigned long long int isPowerOfTwo(unsigned long long int n) {
  return n && (!(n & (n - 1)));
}


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <isPowerOfTwo+0x33>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %rdi,%rdi
je     1112 <isPowerOfTwo+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @isPowerOfTwo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = sub i64 %7, 1
%9 = and i64 %6, %8
%10 = icmp ne i64 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @isPowerOfTwo(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i64
br label %7
7: ; preds = %3, %1
%8 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ func();
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from prog2.c\n");
  func();
  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)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from prog2.c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @func()
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello from prog2.c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @func()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int _m_to_int(int /*<<< orphan*/);
int test_m_to_int(__m64 a) { return _m_to_int(a); }


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

x86 assembly (clang, -O2):
<test_m_to_int>:
jmp    1030 <_m_to_int@plt>

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

LLVM IR (-O2):
define i32 @test_m_to_int(i32 %0) {
%2 = tail call i32 @_m_to_int(i32 %0)
ret i32 %2
}
int test_imm_0Aint64_midword_reg(long long val) {
  return ((val >> 16) & (0x0A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_0Aint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 10
%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_0Aint64_midword_reg(i64 %0) {
%2 = and i64 %0, 655360
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int min(int x, int y) {
  if (x > y)
    return y;
  else
    return x;
}


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
double CSPL_Special_Erf1(double const);
double const sqrt(int);
double CSPL_Stats_Normal_CDFfn(const double x, const double mean,
                               const double stddev) {
  return (0.5 * (1.0 + CSPL_Special_Erf1((x - mean) / (stddev * sqrt(2)))));
}


x86 assembly (clang, -O0):
<CSPL_Stats_Normal_CDFfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    $0x2,%edi
call   1040 <sqrt@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1030 <CSPL_Special_Erf1@plt>
movsd  0xe8c(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe78(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSPL_Stats_Normal_CDFfn>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <sqrt@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <CSPL_Special_Erf1@plt>
addsd  0xea1(%rip),%xmm0
mulsd  0xea1(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @CSPL_Stats_Normal_CDFfn(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = call double @sqrt(i32 2)
%12 = fmul double %10, %11
%13 = fdiv double %9, %12
%14 = call double @CSPL_Special_Erf1(double %13)
%15 = fadd double 1.000000e+00, %14
%16 = fmul double 5.000000e-01, %15
ret double %16
}

LLVM IR (-O2):
define double @CSPL_Stats_Normal_CDFfn(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = tail call double @sqrt(i32 2)
%6 = fmul double %5, %2
%7 = fdiv double %4, %6
%8 = tail call double @CSPL_Special_Erf1(double %7)
%9 = fadd double %8, 1.000000e+00
%10 = fmul double %9, 5.000000e-01
ret double %10
}
int test_imm_15int64_highword_reg(long long val) {
  return ((val >> 32) & (0x15 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_15int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 21
%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_15int64_highword_reg(i64 %0) {
%2 = and i64 %0, 90194313216
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double strtod(char const *, int /*<<< orphan*/);
double atof(const char *nptr) { return strtod(nptr, 0); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

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

LLVM IR (-O2):
define double @atof(i8* %0) {
%2 = tail call double @strtod(i8* %0, i32 0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
void test_do_sleep(int argc, char *argv[]) {
  assert(argc == 2);
  sleep(atoi(argv[1]));
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<test_do_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1060 <sleep@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<test_do_sleep>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
cmp    $0x2,%edi
sete   %al
mov    %eax,%edi
call   1030 <assert@plt>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1060 <sleep@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @test_do_sleep(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 2
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8**, i8*** %4
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
%13 = call i32 @sleep(i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @test_do_sleep(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @sleep(i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
%11 = tail call i32 @exit(i32 %10)
unreachable
}
void finish_address_gen(struct entrypoint *ep, struct access_data *ad) {}


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

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

LLVM IR (-O0):
%struct.entrypoint = type opaque
%struct.access_data = type opaque
define void @finish_address_gen(%struct.entrypoint* %0, %struct.access_data* %1) {
%3 = alloca %struct.entrypoint*
%4 = alloca %struct.access_data*
store %struct.entrypoint* %0, %struct.entrypoint** %3
store %struct.access_data* %1, %struct.access_data** %4
ret void
}

LLVM IR (-O2):
%struct.entrypoint = type opaque
%struct.access_data = type opaque
define void @finish_address_gen(%struct.entrypoint* nocapture %0, %struct.access_data* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ panic(char *);
void usage(void) { panic("fweep [-t] [-p] [-q] storyfile\n"); }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"fweep [-t] [-p] [-q] storyfile\0A\00"
define void @usage() {
%1 = call i32 @panic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"fweep [-t] [-p] [-q] storyfile\0A\00"
define void @usage() {
%1 = tail call i32 @panic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float cbrtf(float);
float __ocl_cbrt_float(float src) { return cbrtf(src); }


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

x86 assembly (clang, -O2):
<__ocl_cbrt_float>:
jmp    1030 <cbrtf@plt>

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

LLVM IR (-O2):
define float @__ocl_cbrt_float(float %0) {
%2 = tail call float @cbrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
int main(void) {
  char *elements;
  char *order;
  char *algo;
  int i;
  fprintf(stdout, "%s", "----SORTING ALGORITHMS----\n");
  fprintf(stdout, "%s", "Enter the number of elements: ");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
lea    0xecd(%rip),%rdx
call   1030 <fprintf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
lea    0xecd(%rip),%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%r14
lea    0xed8(%rip),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee3(%rip),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [28 x i8] c"----SORTING ALGORITHMS----\0A\00"
@.str.2 = [31 x i8] c"Enter the number of elements: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
%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 ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stdout
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 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 = [28 x i8] c"----SORTING ALGORITHMS----\0A\00"
@.str.2 = [31 x i8] c"Enter the number of elements: \00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%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 ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void dioctrl_print_version() {
  printf("\n %s version %s\n", "dioctrl", "0.1");
  printf("Written by %s\n", "Michael Wouters");
  printf("This ain't no stinkin' Perl script!\n");
}


x86 assembly (clang, -O0):
<dioctrl_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeef(%rip),%rsi
lea    0xef0(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dioctrl_print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee2(%rip),%rsi
lea    0xee3(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\0A %s version %s\0A\00"
@.str.1 = [8 x i8] c"dioctrl\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [15 x i8] c"Written by %s\0A\00"
@.str.4 = [16 x i8] c"Michael Wouters\00"
@.str.5 = [37 x i8] c"This ain't no stinkin' Perl script!\0A\00"
define void @dioctrl_print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0A %s version %s\0A\00"
@.str.1 = [8 x i8] c"dioctrl\00"
@.str.2 = [4 x i8] c"0.1\00"
@.str.3 = [15 x i8] c"Written by %s\0A\00"
@.str.4 = [16 x i8] c"Michael Wouters\00"
@str = [36 x i8] c"This ain't no stinkin' Perl script!\00"
define void @dioctrl_print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
int callback(void *unused, int argc, char **argv, char **col_name) { return 0; }


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @callback(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8** nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quantum_objcode_stop();
int /*<<< orphan*/ quantum_objcode_write(int /*<<< orphan*/);
void quantum_objcode_exit(char *file) {
  quantum_objcode_write(0);
  quantum_objcode_stop();
}


x86 assembly (clang, -O0):
<quantum_objcode_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <quantum_objcode_write@plt>
mov    $0x0,%al
call   1040 <quantum_objcode_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_objcode_exit>:
push   %rax
xor    %edi,%edi
call   1030 <quantum_objcode_write@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <quantum_objcode_stop@plt>

LLVM IR (-O0):
define void @quantum_objcode_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @quantum_objcode_write(i32 0)
%4 = call i32 (...) @quantum_objcode_stop()
ret void
}

LLVM IR (-O2):
define void @quantum_objcode_exit(i8* nocapture readnone %0) {
%2 = tail call i32 @quantum_objcode_write(i32 0)
%3 = tail call i32 (...) @quantum_objcode_stop()
ret void
}
int _checkfill(char *buf, unsigned char fill, int size) {
  while (size-- > 0)
    if (buf[size] != fill)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<_checkfill>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
jle    114e <_checkfill+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movzbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
je     1149 <_checkfill+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1155 <_checkfill+0x55>
jmp    1111 <_checkfill+0x11>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_checkfill>:
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1124 <_checkfill+0x24>
movsbl -0x1(%rdi,%rax,1),%ecx
add    $0xffffffffffffffff,%rax
cmp    %esi,%ecx
je     1110 <_checkfill+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_checkfill(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = zext i8 %1 to i32
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %11, %3
%7 = phi i64 [ %8, %11 ], [ %5, %3 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %7 to i32
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %0, i64 %8
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, %4
br i1 %15, label %6, label %16
16: ; preds = %6, %11
%17 = phi i32 [ 0, %11 ], [ 1, %6 ]
ret i32 %17
}
/* Type definitions */
struct cirbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __cirbuf_del_tail(struct cirbuf *);
void cirbuf_del_tail(struct cirbuf *cbuf) { __cirbuf_del_tail(cbuf); }


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

x86 assembly (clang, -O2):
<cirbuf_del_tail>:
jmp    1030 <__cirbuf_del_tail@plt>

LLVM IR (-O0):
%struct.cirbuf = type { i32 }
define void @cirbuf_del_tail(%struct.cirbuf* %0) {
%2 = alloca %struct.cirbuf*
store %struct.cirbuf* %0, %struct.cirbuf** %2
%3 = load %struct.cirbuf*, %struct.cirbuf** %2
%4 = call i32 @__cirbuf_del_tail(%struct.cirbuf* %3)
ret void
}

LLVM IR (-O2):
%struct.cirbuf = type { i32 }
define void @cirbuf_del_tail(%struct.cirbuf* %0) {
%2 = tail call i32 @__cirbuf_del_tail(%struct.cirbuf* %0)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ elevar_e(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char **argv) {
  int valor;
  printf("Introdueix el valor: ");
  scanf("%d", &valor);
  printf("\nResultat: %lf\n\n", elevar_e(valor));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1050 <elevar_e@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <elevar_e@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Introdueix el valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0AResultat: %lf\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @elevar_e(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [22 x i8] c"Introdueix el valor: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0AResultat: %lf\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @elevar_e(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ bug(int, int);
void testTortureExecute(void) {
  bug(5, 10);
  return;
}


x86 assembly (clang, -O0):
<testTortureExecute>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0xa,%esi
call   1030 <bug@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTortureExecute>:
mov    $0x5,%edi
mov    $0xa,%esi
jmp    1030 <bug@plt>

LLVM IR (-O0):
define void @testTortureExecute() {
%1 = call i32 @bug(i32 5, i32 10)
ret void
}

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @bug(i32 5, i32 10)
ret void
}
int test_imm_24uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x24 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_24uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 36
%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_24uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 154618822656
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_global_timer();
void test_timer() { test_global_timer(); }


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

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

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

LLVM IR (-O2):
define void @test_timer() {
%1 = tail call i32 (...) @test_global_timer()
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void FlashIntClear(uint32_t ui32IntFlags) {
  (*((volatile unsigned long *)(0x400FD014))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<FlashIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fd014,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashIntClear>:
mov    %rdi,0x400fd014
40
ret

LLVM IR (-O0):
define void @FlashIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074778132 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074778132 to i64*)
ret void
}