xunge/DecIR huggingface dataset:
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ le(int, int);
int main() {
  int x = __VERIFIER_nondet_int();
  if (x < 0)
    return 0;
  int y = __VERIFIER_nondet_int();
  if (y < 0)
    return 0;
  int z = __VERIFIER_nondet_int();
  le(x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    114f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1184 <main+0x64>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    116f <main+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1184 <main+0x64>
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <le@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     114d <main+0x2d>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     114d <main+0x2d>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <le@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp slt i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @__VERIFIER_nondet_int()
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = tail call i32 @le(i32 %1, i32 %4)
br label %9
9: ; preds = %6, %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ example_rand();
int /*<<< orphan*/ example_replace();
int /*<<< orphan*/ example_search();
int main(int argc, const char *argv[]) {
  example_search();
  example_rand();
  example_replace();
  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    $0x0,%al
call   1050 <example_search@plt>
mov    $0x0,%al
call   1030 <example_rand@plt>
mov    $0x0,%al
call   1040 <example_replace@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <example_search@plt>
xor    %eax,%eax
call   1030 <example_rand@plt>
xor    %eax,%eax
call   1040 <example_replace@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 = call i32 (...) @example_search()
%7 = call i32 (...) @example_rand()
%8 = call i32 (...) @example_replace()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @example_search()
%4 = tail call i32 (...) @example_rand()
%5 = tail call i32 (...) @example_replace()
ret i32 0
}
/* Variables and functions */
int myfunc(int myval, bool cond) {
  int retval;
  if (cond)
    retval = 1;
  else
    retval = 0;
  return retval;
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1120 <myfunc+0x20>
movl   $0x1,-0xc(%rbp)
jmp    1127 <myfunc+0x27>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunc>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @myfunc(i32 %0, i32 %1) {
%3 = icmp ne i32 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: wordreduce [-kbprog/-diff1/-diff2/-diff1c] [-mrl "
                  "maxreducelen] [-e]\n");
  fprintf(stderr, "\t[-cos] groupname [cosname] [-f filename]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xf03(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Usage: wordreduce [-kbprog/-diff1/-diff2/-diff1c] [-mrl maxreducelen] [-e]\0A\00"
@.str.1 = [43 x i8] c"\09[-cos] groupname [cosname] [-f filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Usage: wordreduce [-kbprog/-diff1/-diff2/-diff1c] [-mrl maxreducelen] [-e]\0A\00"
@.str.1 = [43 x i8] c"\09[-cos] groupname [cosname] [-f filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strstr(char *, char *);
int check_exit(char *command) {
  char *exitloc;
  exitloc = strstr(command, "exit");
  if (exitloc == command) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    114a <check_exit+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <check_exit+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_exit>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"exit\00"
define i32 @check_exit(i8* nocapture %0) {
%2 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
char dec_hex(unsigned len, unsigned rem) {
  char hex;
  if (len != 0) {
    switch (rem) {
    case 10:
      hex = 'A';
      break;
    case 11:
      hex = 'B';
      break;
    case 12:
      hex = 'C';
      break;
    case 13:
      hex = 'D';
      break;
    case 14:
      hex = 'E';
      break;
    case 15:
      hex = 'F';
      break;
    default:
      hex = rem + '0';
      break;
    }
  }
  return hex;
}


x86 assembly (clang, -O0):
<dec_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1181 <dec_hex+0x81>
mov    -0x8(%rbp),%eax
add    $0xfffffff6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1173 <dec_hex+0x73>
mov    -0x18(%rbp),%rax
lea    0xecc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x41,-0x9(%rbp)
jmp    117c <dec_hex+0x7c>
movb   $0x42,-0x9(%rbp)
jmp    117c <dec_hex+0x7c>
movb   $0x43,-0x9(%rbp)
jmp    117c <dec_hex+0x7c>
movb   $0x44,-0x9(%rbp)
jmp    117c <dec_hex+0x7c>
movb   $0x45,-0x9(%rbp)
jmp    117c <dec_hex+0x7c>
movb   $0x46,-0x9(%rbp)
jmp    117c <dec_hex+0x7c>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x9(%rbp)
jmp    1181 <dec_hex+0x81>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_hex>:
test   %edi,%edi
je     1114 <dec_hex+0x14>
mov    %esi,%eax
lea    -0xa(%rax),%ecx
cmp    $0x6,%ecx
jae    1115 <dec_hex+0x15>
add    $0x41,%cl
mov    %ecx,%eax
ret
ret
add    $0x30,%al
ret

LLVM IR (-O0):
define signext i8 @dec_hex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = load i32, i32* %4
switch i32 %9, label %16 [
i32 10, label %10
i32 11, label %11
i32 12, label %12
i32 13, label %13
i32 14, label %14
i32 15, label %15
]
10: ; preds = %8
store i8 65, i8* %5
br label %20
11: ; preds = %8
store i8 66, i8* %5
br label %20
12: ; preds = %8
store i8 67, i8* %5
br label %20
13: ; preds = %8
store i8 68, i8* %5
br label %20
14: ; preds = %8
store i8 69, i8* %5
br label %20
15: ; preds = %8
store i8 70, i8* %5
br label %20
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add i32 %17, 48
%19 = trunc i32 %18 to i8
store i8 %19, i8* %5
br label %20
20: ; preds = %16, %15, %14, %13, %12, %11, %10
br label %21
21: ; preds = %20, %2
%22 = load i8, i8* %5
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @dec_hex(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = add i32 %1, -10
%6 = icmp ult i32 %5, 6
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = trunc i32 %1 to i8
%9 = add i8 %8, 48
br label %13
10: ; preds = %4
%11 = trunc i32 %5 to i8
%12 = add i8 %11, 65
br label %13
13: ; preds = %10, %7, %2
%14 = phi i8 [ %9, %7 ], [ undef, %2 ], [ %12, %10 ]
ret i8 %14
}
int main(int argc, char **argv) {
  char *buf[16];
  itoa(buf, 123456);
  printf("v=%s\n", buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x1e240,%esi
mov    $0x0,%al
call   1040 <itoa@plt>
lea    -0x90(%rbp),%rsi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1e240,%esi
xor    %eax,%eax
call   1040 <itoa@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"v=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [16 x i8*]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [16 x i8*], [16 x i8*]* %5, i64 0, i64 0
%7 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @itoa to i32 (i8**, i32, ...)*)(i8** %6, i32 123456)
%8 = getelementptr inbounds [16 x i8*], [16 x i8*]* %5, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"v=%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8*]
%4 = bitcast [16 x i8*]* %3 to i8*
%5 = getelementptr inbounds [16 x i8*], [16 x i8*]* %3, i64 0, i64 0
%6 = call i32 (i8**, i32, ...) bitcast (i32 (...)* @itoa to i32 (i8**, i32, ...)*)(i8** %5, i32 123456)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5)
ret i32 0
}
int fun355() { return 355; }


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

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

LLVM IR (-O0):
define i32 @fun355() {
ret i32 355
}

LLVM IR (-O2):
define i32 @fun355() {
ret i32 355
}
unsigned int branch_opcode(unsigned int instr) { return (instr >> 26) & 0x3F; }


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

x86 assembly (clang, -O2):
<branch_opcode>:
mov    %edi,%eax
shr    $0x1a,%eax
ret

LLVM IR (-O0):
define i32 @branch_opcode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 26
%5 = and i32 %4, 63
ret i32 %5
}

LLVM IR (-O2):
define i32 @branch_opcode(i32 %0) {
%2 = lshr i32 %0, 26
ret i32 %2
}
/* Variables and functions */
int arg_array_ptr(int, int **);
int use_arg_array_ptr(int i, int *j[]) { return arg_array_ptr(i, j); }


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

x86 assembly (clang, -O2):
<use_arg_array_ptr>:
jmp    1030 <arg_array_ptr@plt>

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

LLVM IR (-O2):
define i32 @use_arg_array_ptr(i32 %0, i32** %1) {
%3 = tail call i32 @arg_array_ptr(i32 %0, i32** %1)
ret i32 %3
}
int test_imm_F2int8_mem(signed char *val) {
  return ((*val) & (-0xF2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F2int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff0e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F2int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -242
%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_F2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -242
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ fqcmd;

/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
char *strchr(char *, char);
char *_cmd(char *cmdline) {
  static char fqcmd[1024];
  char *p;
  snprintf(fqcmd, sizeof(fqcmd), "%s", cmdline);
  if ((p = strchr(fqcmd, ' ')))
    *p = '\0';
  return basename(fqcmd);
}


x86 assembly (clang, -O0):
<_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0x2f09(%rip),%rdi
mov    $0x400,%esi
lea    0xead(%rip),%rdx
call   1040 <snprintf@plt>
lea    0x2ef1(%rip),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     117e <_cmd+0x4e>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2ecb(%rip),%rdi
call   1050 <basename@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cmd>:
push   %rbx
mov    %rdi,%rcx
lea    0x2f15(%rip),%rbx
lea    0xebe(%rip),%rdx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1164 <_cmd+0x34>
movb   $0x0,(%rax)
lea    0x2ee5(%rip),%rdi
pop    %rbx
jmp    1050 <basename@plt>

LLVM IR (-O0):
@_cmd.fqcmd = internal global [1024 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i8* @_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @snprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_cmd.fqcmd, i64 0, i64 0), i32 1024, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i8* @strchr(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_cmd.fqcmd, i64 0, i64 0), i8 signext 32)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
%11 = call i8* @basename(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_cmd.fqcmd, i64 0, i64 0))
ret i8* %11
}

LLVM IR (-O2):
@_cmd.fqcmd = internal global [1024 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i8* @_cmd(i8* %0) {
%2 = tail call i32 @snprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_cmd.fqcmd, i64 0, i64 0), i32 1024, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @_cmd.fqcmd, i64 0, i64 0), i8 signext 32)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %6
6: ; preds = %5, %1
%7 = tail call i8* @basename(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @_cmd.fqcmd, i64 0, i64 0))
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _mm_comieq_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_load_ss(float *);
int determ_eq_float(uint32_t a, uint32_t b) {
  return !!_mm_comieq_ss(_mm_load_ss((float *)&a), _mm_load_ss((float *)&b));
}


x86 assembly (clang, -O0):
<determ_eq_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <_mm_load_ss@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_comieq_ss@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<determ_eq_float>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %eax,%ebx
lea    0x8(%rsp),%rdi
call   1040 <_mm_load_ss@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <_mm_comieq_ss@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @determ_eq_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = bitcast i32* %3 to float*
%6 = call i32 @_mm_load_ss(float* %5)
%7 = bitcast i32* %4 to float*
%8 = call i32 @_mm_load_ss(float* %7)
%9 = call i32 @_mm_comieq_ss(i32 %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @determ_eq_float(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = bitcast i32* %3 to float*
%6 = call i32 @_mm_load_ss(float* %5)
%7 = bitcast i32* %4 to float*
%8 = call i32 @_mm_load_ss(float* %7)
%9 = call i32 @_mm_comieq_ss(i32 %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"skip: Skipping userfaultfd test (missing __NR_userfaultfd)\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [59 x i8] c"skip: Skipping userfaultfd test (missing __NR_userfaultfd)\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int main(int argc, char *argv[]) {
  int a = 100;
  printf("%d\n", a);
  __asm__("xorl	%1, %1\n" : "=r"(a) : "r"(a));
  printf("%d\n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xee6(%rip),%rbx
mov    $0x64,%ebp
mov    %rbx,%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 100, i32* %5
%6 = load i32, i32* %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %5
%9 = call i32 asm "xorl\09$1, $1\0A", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 100)
%4 = tail call i32 asm "xorl\09$1, $1\0A", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 100)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void usage(char *bin) {
  fprintf(stdout,
          "USAGE: %s -slc  (option defaults in parens)\n"
          "\t-s blocksize  Blocksize (bytes) for single crypto op (4096)\n"
          "\t-l num blocks Number of blocks to encrypt (100)\n"
          "\t-c cache size L2 cache size in KB (0)\n",
          bin);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [194 x i8] c"USAGE: %s -slc (option defaults in parens)\0A\09-s blocksize Blocksize (bytes) for single crypto op (4096)\0A\09-l num blocks Number of blocks to encrypt (100)\0A\09-c cache size L2 cache size in KB (0)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [194 x i8] c"USAGE: %s -slc (option defaults in parens)\0A\09-s blocksize Blocksize (bytes) for single crypto op (4096)\0A\09-l num blocks Number of blocks to encrypt (100)\0A\09-c cache size L2 cache size in KB (0)\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void strtcpy(to, from, len) char *to, *from;
int len;
{
  (void)strncpy(to, from, (int)len);
  to[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<strtcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %edx,%rbx
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @strtcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = call i8* @strncpy(i8* %7, i8* %8, i64 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
ret void
}

LLVM IR (-O2):
define void @strtcpy(i8* %0, i8* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = tail call i8* @strncpy(i8* dereferenceable(1) %0, i8* %1, i64 %4)
%6 = add nsw i32 %2, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
ret void
}
void gtk_get_current_event() {}


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

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

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

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

/* Variables and functions */
int32_t aeron_logbuffer_compute_term_offset_from_position(
    int64_t position, size_t position_bits_to_shift) {
  int64_t mask = (1u << position_bits_to_shift) - 1;
  return (int32_t)(position & mask);
}


x86 assembly (clang, -O0):
<aeron_logbuffer_compute_term_offset_from_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_logbuffer_compute_term_offset_from_position>:
mov    %rsi,%rcx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @aeron_logbuffer_compute_term_offset_from_position(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = sub i32 %8, 1
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = and i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @aeron_logbuffer_compute_term_offset_from_position(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
%6 = and i32 %5, %0
ret i32 %6
}
/* Variables and functions */
scalar_t__ get_sec(int /*<<< orphan*/);
float fget_secv(void) { return (float)get_sec(0); }


x86 assembly (clang, -O0):
<fget_secv>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <get_sec@plt>
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fget_secv>:
push   %rax
xor    %edi,%edi
call   1030 <get_sec@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fget_secv() {
%1 = call i64 @get_sec(i32 0)
%2 = sitofp i64 %1 to float
ret float %2
}

LLVM IR (-O2):
define float @fget_secv() {
%1 = tail call i64 @get_sec(i32 0)
%2 = sitofp i64 %1 to float
ret float %2
}
char const *pubnub_uname(void) {
  return "Microchip.Harmony"
         "%2F"
         "3.1.0";
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Microchip.Harmony%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [26 x i8] c"Microchip.Harmony%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ analyze_hand();
int /*<<< orphan*/ read_cards();
int main(void) {
  while (1) {
    read_cards();
    analyze_hand();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <read_cards@plt>
mov    $0x0,%al
call   1040 <analyze_hand@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_cards@plt>
xor    %eax,%eax
call   1040 <analyze_hand@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @read_cards()
%4 = call i32 (...) @analyze_hand()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @read_cards()
%3 = tail call i32 (...) @analyze_hand()
br label %1
}
/* Type definitions */
struct b6_sref {
  int dummy;
};
struct b6_deque {
  int dummy;
};

/* Variables and functions */
struct b6_sref *b6_deque_add_after(struct b6_deque *, int /*<<< orphan*/,
                                   struct b6_sref *);
int /*<<< orphan*/ b6_deque_last(struct b6_deque *);
struct b6_sref *b6_deque_add_last(struct b6_deque *deque,
                                  struct b6_sref *sref) {
  return b6_deque_add_after(deque, b6_deque_last(deque), sref);
}


x86 assembly (clang, -O0):
<b6_deque_add_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <b6_deque_last@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1030 <b6_deque_add_after@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b6_deque_add_last>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <b6_deque_last@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <b6_deque_add_after@plt>

LLVM IR (-O0):
%struct.b6_deque = type { i32 }
%struct.b6_sref = type { i32 }
define %struct.b6_sref* @b6_deque_add_last(%struct.b6_deque* %0, %struct.b6_sref* %1) {
%3 = alloca %struct.b6_deque*
%4 = alloca %struct.b6_sref*
store %struct.b6_deque* %0, %struct.b6_deque** %3
store %struct.b6_sref* %1, %struct.b6_sref** %4
%5 = load %struct.b6_deque*, %struct.b6_deque** %3
%6 = load %struct.b6_deque*, %struct.b6_deque** %3
%7 = call i32 @b6_deque_last(%struct.b6_deque* %6)
%8 = load %struct.b6_sref*, %struct.b6_sref** %4
%9 = call %struct.b6_sref* @b6_deque_add_after(%struct.b6_deque* %5, i32 %7, %struct.b6_sref* %8)
ret %struct.b6_sref* %9
}

LLVM IR (-O2):
%struct.b6_deque = type { i32 }
%struct.b6_sref = type { i32 }
define %struct.b6_sref* @b6_deque_add_last(%struct.b6_deque* %0, %struct.b6_sref* %1) {
%3 = tail call i32 @b6_deque_last(%struct.b6_deque* %0)
%4 = tail call %struct.b6_sref* @b6_deque_add_after(%struct.b6_deque* %0, i32 %3, %struct.b6_sref* %1)
ret %struct.b6_sref* %4
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
char good_strncmp(char *str) {
  if (strncmp(str, "http", 4) == 0)
    return str[4];
}


x86 assembly (clang, -O0):
<good_strncmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1145 <good_strncmp+0x35>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good_strncmp>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
test   %rcx,%rcx
je     112f <good_strncmp+0x1f>
pop    %rbx
ret
mov    0x4(%rbx),%al
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"http\00"
define signext i8 @good_strncmp(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = load i8, i8* %5
br label %7
7: ; preds = %4, %1
%8 = phi i8 [ %6, %4 ], [ undef, %1 ]
ret i8 %8
}
/* Variables and functions */
void *Func_memset_nodrain(void *, int, size_t);
void *pmem_memset_nodrain(void *pmemdest, int c, size_t len) {
  return Func_memset_nodrain(pmemdest, c, len);
}


x86 assembly (clang, -O0):
<pmem_memset_nodrain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <Func_memset_nodrain@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmem_memset_nodrain>:
jmp    1030 <Func_memset_nodrain@plt>

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

LLVM IR (-O2):
define i8* @pmem_memset_nodrain(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @Func_memset_nodrain(i8* %0, i32 %1, i64 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ eventfd_t;

/* Variables and functions */
int read(int, int /*<<< orphan*/ *, int);
int eventfd_read(int fd, eventfd_t *value) {
  return (sizeof(*value) == read(fd, value, sizeof(*value))) ? 0 : -1;
}


x86 assembly (clang, -O0):
<eventfd_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
movslq %eax,%rsi
mov    $0x4,%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eventfd_read>:
push   %rax
mov    $0x4,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @eventfd_read(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = load i32*, i32** %4
%7 = call i32 @read(i32 %5, i32* %6, i32 4)
%8 = sext i32 %7 to i64
%9 = icmp eq i64 4, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @eventfd_read(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i32* %1, i32 4)
%4 = icmp ne i32 %3, 4
%5 = sext i1 %4 to i32
ret i32 %5
}
int dgeqp3(int M, int N, double *A, int LDA, int *JPVT, double *TAU,
           double *WORK, int LWORK, int *INFO) {
  extern int dgeqp3_(int *M, int *N, double *A, int *LDA, int *JPVT,
                     double *TAU, double *WORK, int *LWORK, int *INFO);
  return dgeqp3_(&M, &N, A, &LDA, JPVT, TAU, WORK, &LWORK, INFO);
}


x86 assembly (clang, -O0):
<dgeqp3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%r11
mov    0x20(%rbp),%rax
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    0x18(%rbp),%r10
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <dgeqp3_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgeqp3>:
sub    $0x18,%rsp
mov    0x20(%rsp),%r10
mov    0x30(%rsp),%r11
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
sub    $0x8,%rsp
lea    0x30(%rsp),%rax
lea    0x1c(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x14(%rsp),%rcx
push   %r11
push   %rax
push   %r10
call   1030 <dgeqp3_@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define i32 @dgeqp3(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, double* %6, i32 %7, i32* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32*
store i32 %0, i32* %10
store i32 %1, i32* %11
store double* %2, double** %12
store i32 %3, i32* %13
store i32* %4, i32** %14
store double* %5, double** %15
store double* %6, double** %16
store i32 %7, i32* %17
store i32* %8, i32** %18
%19 = load double*, double** %12
%20 = load i32*, i32** %14
%21 = load double*, double** %15
%22 = load double*, double** %16
%23 = load i32*, i32** %18
%24 = call i32 @dgeqp3_(i32* %10, i32* %11, double* %19, i32* %13, i32* %20, double* %21, double* %22, i32* %17, i32* %23)
ret i32 %24
}

LLVM IR (-O2):
define i32 @dgeqp3(i32 %0, i32 %1, double* %2, i32 %3, i32* %4, double* %5, double* %6, i32 %7, i32* %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %3, i32* %12
store i32 %7, i32* %13
%14 = call i32 @dgeqp3_(i32* %10, i32* %11, double* %2, i32* %12, i32* %4, double* %5, double* %6, i32* %13, i32* %8)
ret i32 %14
}
void exchange(int *a, int i, int j) {
  int tmp = a[i];
  a[i] = a[j];
  a[j] = tmp;
}


x86 assembly (clang, -O0):
<exchange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @exchange(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool SSIBusy(uint32_t ui32Base) {
  ;
  return (((*((volatile unsigned long *)(ui32Base + 0x0000000C))) & 0x00000010)
              ? 1
              : 0);
}


x86 assembly (clang, -O0):
<SSIBusy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%rdx
and    $0x10,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIBusy>:
mov    0xc(%rdi),%rax
shr    $0x4,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @SSIBusy(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 12
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 16
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
ret i32 %10
}

LLVM IR (-O2):
define i32 @SSIBusy(i64 %0) {
%2 = add nsw i64 %0, 12
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = lshr i32 %5, 4
%7 = and i32 %6, 1
ret i32 %7
}
/* Variables and functions */
int strlen(const char *str) {
  int i = 0;
  for (; str[i] != 0; i = i + 1)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlen+0x37>
jmp    1129 <strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
unsigned xrop3_82_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S & D;
  stk2 = T | stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_82_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_82_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_82_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = and i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = or i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
ret i32 %32
}

LLVM IR (-O2):
define i32 @xrop3_82_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = mul nuw nsw i32 %4, 257
%6 = or i32 %5, %3
%7 = xor i32 %6, 255
ret i32 %7
}
void FaultISR(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<FaultISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <FaultISR+0x9>
jmp    1109 <FaultISR+0x9>

x86 assembly (clang, -O2):
<FaultISR>:
jmp    1100 <FaultISR>

LLVM IR (-O0):
define void @FaultISR() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @FaultISR() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(unsigned int);
void print_uint_helper(unsigned int u) {
  if (u != 0) {
    print_uint_helper(u / 10);
    putchar('0' + u % 10);
  }
}


x86 assembly (clang, -O0):
<print_uint_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     115e <print_uint_helper+0x3e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1040 <print_uint_helper@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%edi
add    $0x30,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_uint_helper>:
test   %edi,%edi
je     1156 <print_uint_helper+0x36>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %edi,%eax
mov    $0xcccccccd,%ebx
imul   %rax,%rbx
shr    $0x23,%rbx
mov    %ebx,%edi
call   1040 <print_uint_helper@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ebp
or     $0x30,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>
ret

LLVM IR (-O0):
define void @print_uint_helper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = udiv i32 %6, 10
%8 = load i32, i32* %2
%9 = urem i32 %8, 10
%10 = add i32 48, %9
%11 = call i32 @putchar(i32 %10)
br label %12
12: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @print_uint_helper(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = udiv i32 %0, 10
tail call void @print_uint_helper(i32 %5)
%6 = urem i32 %0, 10
%7 = or i32 %6, 48
%8 = tail call i32 @putchar(i32 %7)
br label %3
}