xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, int, int);
void usage(char *name) {
  printf(
      "\nUsage: %s [-dns]\n\n"
      "Options:\n\n"
      "  -h"
      "\t\tShow this help\n"
      "  -d"
      "\t\tAllow duplicated values in the same recovery key (default=no)\n"
      "  -n"
      "\t\tGenerate this number of wordlist (default=%d, max=%d)\n"
      "  -p"
      "\t\tMax number of password for each wordlist (default=%d, max=%d)\n"
      "  -s"
      "\t\tGenerate starting from this recovery password (default with no "
      "duplicates=000000-000011-000022-000033-000044-000055-000066-000077)\n",
      name, 100, 100000, 5000000, 300000000);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x64,%edx
mov    $0x186a0,%ecx
mov    $0x4c4b40,%r8d
mov    $0x11e1a300,%r9d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
mov    $0x64,%edx
mov    $0x186a0,%ecx
mov    $0x4c4b40,%r8d
mov    $0x11e1a300,%r9d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [384 x i8] c"\0AUsage: %s [-dns]\0A\0AOptions:\0A\0A -h\09\09Show this help\0A -d\09\09Allow duplicated values in the same recovery key (default=no)\0A -n\09\09Generate this number of wordlist (default=%d, max=%d)\0A -p\09\09Max number of password for each wordlist (default=%d, max=%d)\0A -s\09\09Generate starting from this recovery password (default with no duplicates=000000-000011-000022-000033-000044-000055-000066-000077)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([384 x i8], [384 x i8]* @.str, i64 0, i64 0), i8* %3, i32 100, i32 100000, i32 5000000, i32 300000000)
ret void
}

LLVM IR (-O2):
@.str = [384 x i8] c"\0AUsage: %s [-dns]\0A\0AOptions:\0A\0A -h\09\09Show this help\0A -d\09\09Allow duplicated values in the same recovery key (default=no)\0A -n\09\09Generate this number of wordlist (default=%d, max=%d)\0A -p\09\09Max number of password for each wordlist (default=%d, max=%d)\0A -s\09\09Generate starting from this recovery password (default with no duplicates=000000-000011-000022-000033-000044-000055-000066-000077)\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([384 x i8], [384 x i8]* @.str, i64 0, i64 0), i8* %0, i32 100, i32 100000, i32 5000000, i32 300000000)
ret void
}
int hash_set_guard(int hash) {
  hash ^= (hash >> 20) ^ (hash >> 12);
  return hash ^ (hash >> 7) ^ (hash >> 4);
}


x86 assembly (clang, -O0):
<hash_set_guard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x14,%eax
mov    -0x4(%rbp),%ecx
sar    $0xc,%ecx
xor    %ecx,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x7,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_set_guard>:
mov    %edi,%eax
sar    $0xc,%eax
xor    %edi,%eax
sar    $0x14,%edi
xor    %edi,%eax
mov    %eax,%ecx
sar    $0x7,%ecx
xor    %eax,%ecx
sar    $0x4,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash_set_guard(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 20
%5 = load i32, i32* %2
%6 = ashr i32 %5, 12
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = xor i32 %8, %7
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 7
%13 = xor i32 %10, %12
%14 = load i32, i32* %2
%15 = ashr i32 %14, 4
%16 = xor i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @hash_set_guard(i32 %0) {
%2 = ashr i32 %0, 20
%3 = ashr i32 %0, 12
%4 = xor i32 %3, %0
%5 = xor i32 %4, %2
%6 = ashr i32 %5, 7
%7 = xor i32 %6, %5
%8 = ashr i32 %5, 4
%9 = xor i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanfTTY();
int /*<<< orphan*/ system(char *);
void main(void) {
  int test;
  test = scanfTTY();
  printf("%i", test);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <scanfTTY@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
call   1030 <system@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <scanfTTY@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [6 x i8] c"pause\00"
define void @main() {
%1 = tail call i32 (...) @scanfTTY()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void free_perf(void) {}


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

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

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

LLVM IR (-O2):
define void @free_perf() {
ret void
}
/* Type definitions */
struct dlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_DLIST_HEAD(struct dlist_node *);
int /*<<< orphan*/ __dlist_del_entry(struct dlist_node *);
void dlist_del_init(struct dlist_node *entry) {
  __dlist_del_entry(entry);
  INIT_DLIST_HEAD(entry);
}


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

x86 assembly (clang, -O2):
<dlist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__dlist_del_entry@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <INIT_DLIST_HEAD@plt>

LLVM IR (-O0):
%struct.dlist_node = type { i32 }
define void @dlist_del_init(%struct.dlist_node* %0) {
%2 = alloca %struct.dlist_node*
store %struct.dlist_node* %0, %struct.dlist_node** %2
%3 = load %struct.dlist_node*, %struct.dlist_node** %2
%4 = call i32 @__dlist_del_entry(%struct.dlist_node* %3)
%5 = load %struct.dlist_node*, %struct.dlist_node** %2
%6 = call i32 @INIT_DLIST_HEAD(%struct.dlist_node* %5)
ret void
}

LLVM IR (-O2):
%struct.dlist_node = type { i32 }
define void @dlist_del_init(%struct.dlist_node* %0) {
%2 = tail call i32 @__dlist_del_entry(%struct.dlist_node* %0)
%3 = tail call i32 @INIT_DLIST_HEAD(%struct.dlist_node* %0)
ret void
}
int dwt_getgain(int orient) {
  if (orient == 0) {
    return 0;
  }
  if (orient == 1 || orient == 2) {
    return 1;
  }
  return 2;
}


x86 assembly (clang, -O0):
<dwt_getgain>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <dwt_getgain+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <dwt_getgain+0x44>
cmpl   $0x1,-0x8(%rbp)
je     1131 <dwt_getgain+0x31>
cmpl   $0x2,-0x8(%rbp)
jne    113d <dwt_getgain+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1144 <dwt_getgain+0x44>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dwt_getgain>:
lea    -0x1(%rdi),%eax
cmp    $0x2,%eax
mov    $0x2,%ecx
sbb    $0x0,%ecx
xor    %eax,%eax
cmp    $0x1,%edi
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @dwt_getgain(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 2
%5 = select i1 %4, i32 1, i32 2
%6 = select i1 %2, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ chars_to_lower(char);
bool chars_equals_ignore_case(char c1, char c2) {
  return chars_to_lower(c1) == chars_to_lower(c2);
}


x86 assembly (clang, -O0):
<chars_equals_ignore_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <chars_to_lower@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <chars_to_lower@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_equals_ignore_case>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <chars_to_lower@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <chars_to_lower@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @chars_equals_ignore_case(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @chars_to_lower(i8 signext %0)
%4 = tail call i64 @chars_to_lower(i8 signext %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void test_05(short tab[], int index, int val) { tab[index + 1] = (short)val; }


x86 assembly (clang, -O0):
<test_05>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %ax,%dx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %dx,(%rax,%rcx,2)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_05>:
movslq %esi,%rax
mov    %dx,0x2(%rdi,%rax,2)
ret

LLVM IR (-O0):
define void @test_05(i16* %0, i32 %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i32
%6 = alloca i32
store i16* %0, i16** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = trunc i32 %7 to i16
%9 = load i16*, i16** %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i16, i16* %9, i64 %12
store i16 %8, i16* %13
ret void
}

LLVM IR (-O2):
define void @test_05(i16* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i16
%5 = add nsw i32 %1, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i16, i16* %0, i64 %6
store i16 %4, i16* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1;
  while (i <= 128) {
    printf("%d ", i);
    i *= 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jg     1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 16)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 32)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 64)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 128)
ret i32 0
}
/* Variables and functions */
size_t offset_align(void *const mem, const size_t stride) {
  uintptr_t offset = (uintptr_t)mem % stride;
  if (offset == 0) {
    return (size_t)0;
  } else {
    return (stride - (size_t)offset);
  }
}


x86 assembly (clang, -O0):
<offset_align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1134 <offset_align+0x34>
movq   $0x0,-0x8(%rbp)
jmp    1140 <offset_align+0x40>
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset_align>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <offset_align+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <offset_align+0x1a>
xor    %edx,%edx
div    %esi
sub    %rdx,%rsi
test   %rdx,%rdx
cmove  %rdx,%rsi
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @offset_align(i8* %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i64, i64* %5
%10 = urem i64 %8, %9
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i64 0, i64* %3
br label %18
14: ; preds = %2
%15 = load i64, i64* %5
%16 = load i64, i64* %6
%17 = sub i64 %15, %16
store i64 %17, i64* %3
br label %18
18: ; preds = %14, %13
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @offset_align(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = urem i64 %3, %1
%5 = icmp eq i64 %4, 0
%6 = sub i64 %1, %4
%7 = select i1 %5, i64 0, i64 %6
ret i64 %7
}
double m3dSmoothStepd(const double edge1, const double edge2, const double x) {
  double t;
  t = (x - edge1) / (edge2 - edge1);
  if (t > 1.0)
    t = 1.0;
  if (t < 0.0)
    t = 0.0f;
  return t * t * (3.0 - 2.0 * t);
}


x86 assembly (clang, -O0):
<m3dSmoothStepd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1154 <m3dSmoothStepd+0x54>
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    116a <m3dSmoothStepd+0x6a>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
addsd  %xmm2,%xmm2
movsd  0xe83(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m3dSmoothStepd>:
subsd  %xmm0,%xmm2
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm2
movsd  0xeec(%rip),%xmm0
minsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
maxsd  %xmm0,%xmm1
movapd %xmm1,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm1,%xmm1
movsd  0xed4(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @m3dSmoothStepd(double %0, double %1, double %2) {
%4 = fsub double %2, %0
%5 = fsub double %1, %0
%6 = fdiv double %4, %5
%7 = fcmp ogt double %6, 1.000000e+00
%8 = select i1 %7, double 1.000000e+00, double %6
%9 = fcmp olt double %8, 0.000000e+00
%10 = select i1 %9, double 0.000000e+00, double %8
%11 = fmul double %10, %10
%12 = tail call double @llvm.fmuladd.f64(double %10, double -2.000000e+00, double 3.000000e+00)
%13 = fmul double %11, %12
ret double %13
}
/* Variables and functions */
char __VERIFIER_nondet_S8();
char nxt_motor_get_count(unsigned char port) {
  char tmp;
  {
    tmp = __VERIFIER_nondet_S8();
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<nxt_motor_get_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_S8@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @nxt_motor_get_count(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = call signext i8 (...) @__VERIFIER_nondet_S8()
store i8 %4, i8* %3
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @nxt_motor_get_count(i8 zeroext %0) {
%2 = tail call signext i8 (...) @__VERIFIER_nondet_S8()
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void on_header_done(void *p) { printf("%p:HEADER DONE!\n", p); }


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

x86 assembly (clang, -O2):
<on_header_done>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%p:HEADER DONE!\0A\00"
define void @on_header_done(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%p:HEADER DONE!\0A\00"
define void @on_header_done(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 0) * sizeof(double)));
  if (!v)
    nrerror("allocation failure in dvector()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <dvector+0x44>
lea    0xea1(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x8(,%rsi,8),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <dvector+0x2b>
lea    0xeba(%rip),%rdi
call   1030 <nrerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 0
ret double* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 8
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
ret double* %13
}
/* Variables and functions */
int /*<<< orphan*/ xxx(int);
int main(int x) {
  for (x = 1; x > 1; x++) {
    xxx(2);
    xxx(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x45>
mov    $0x2,%edi
call   1030 <xxx@plt>
mov    $0x1,%edi
call   1030 <xxx@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
store i32 1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = call i32 @xxx(i32 2)
%9 = call i32 @xxx(i32 1)
br label %10
10: ; preds = %7
%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* %2
ret i32 %14
}

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

/* Variables and functions */
uint32_t endswap32(uint32_t x) {
  uint32_t ret = (((x & 0xFF) << 24) | ((x & 0xFF00) << 8) |
                  ((x & 0xFF0000) >> 8) | ((x & 0xFF000000) >> 24));
  return ret;
}


x86 assembly (clang, -O0):
<endswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswap32>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @endswap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = shl i32 %5, 24
%7 = load i32, i32* %2
%8 = and i32 %7, 65280
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 16711680
%13 = ashr i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, -16777216
%17 = lshr i32 %16, 24
%18 = or i32 %14, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @endswap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int test_imm_19uint8_reg(unsigned char val) {
  return ((val) & (0x19 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_19uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 25
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void nseel_asm_equal_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_equal_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int writeString(char *, unsigned char *);
int direction(unsigned char n, unsigned char *d) {
  char f[34];
  sprintf(f, "/sys/class/gpio/gpio%d/direction", n);
  return writeString(f, d);
}


x86 assembly (clang, -O0):
<direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec3(%rip),%rsi
movzbl -0x1(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <writeString@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direction>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <writeString@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"/sys/class/gpio/gpio%d/direction\00"
define i32 @direction(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca [34 x i8]
store i8 %0, i8* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [34 x i8], [34 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %7)
%9 = getelementptr inbounds [34 x i8], [34 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @writeString(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [33 x i8] c"/sys/class/gpio/gpio%d/direction\00"
define i32 @direction(i8 zeroext %0, i8* %1) {
%3 = alloca [34 x i8]
%4 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%6 = call i32 @writeString(i8* %4, i8* %1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef scalar_t__ __ptr_t;

/* Variables and functions */
int /*<<< orphan*/ __socketcall(int, unsigned long *);
ssize_t __libc_recv(int sockfd, __ptr_t buffer, size_t len, int flags) {
  unsigned long args[4];
  args[0] = sockfd;
  args[1] = (unsigned long)buffer;
  args[2] = len;
  args[3] = flags;
  return (__socketcall(10, args));
}


x86 assembly (clang, -O0):
<__libc_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
movslq -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x40(%rbp),%rsi
mov    $0xa,%edi
call   1030 <__socketcall@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_recv>:
sub    $0x28,%rsp
movslq %edi,%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
movslq %ecx,%rax
mov    %rax,0x18(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1030 <__socketcall@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @__libc_recv(i32 %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca [4 x i64]
%6 = bitcast [4 x i64]* %5 to i8*
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 0
store i64 %7, i64* %8
%9 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 1
store i64 %1, i64* %9
%10 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 2
store i64 %2, i64* %10
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds [4 x i64], [4 x i64]* %5, i64 0, i64 3
store i64 %11, i64* %12
%13 = call i32 @__socketcall(i32 10, i64* %8)
ret i32 %13
}
void CRYPTO_cleanup_all_ex_data(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_cleanup_all_ex_data() {
ret void
}
const char *getDir(const int argc, const char **argv) {
  int i;
  for (i = 1; i < argc; i++) {
    if (argv[i][0] == '-')
      continue;
    else
      return argv[i];
  }
  return ".";
}


x86 assembly (clang, -O0):
<getDir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <getDir+0x5e>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    113b <getDir+0x3b>
jmp    1150 <getDir+0x50>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <getDir+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1112 <getDir+0x12>
lea    0xe9b(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDir>:
lea    0xef9(%rip),%rcx
cmp    $0x2,%edi
jl     1132 <getDir+0x32>
mov    %edi,%edx
mov    $0x1,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rsi,%rdi,8),%rax
cmpb   $0x2d,(%rax)
jne    1135 <getDir+0x35>
add    $0x1,%rdi
cmp    %rdi,%rdx
jne    1120 <getDir+0x20>
mov    %rcx,%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i8* @getDir(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %28, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %31
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 45
br i1 %20, label %21, label %22
21: ; preds = %11
br label %28
22: ; preds = %11
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
store i8* %27, i8** %3
br label %32
28: ; preds = %21
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
br label %32
32: ; preds = %31, %22
%33 = load i8*, i8** %3
ret i8* %33
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @getDir(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %14, %5
br i1 %7, label %15, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 1, %4 ], [ %14, %6 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 45
%14 = add nuw nsw i64 %9, 1
br i1 %13, label %6, label %15
15: ; preds = %8, %6, %2
%16 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %6 ], [ %11, %8 ]
ret i8* %16
}
/* Variables and functions */
bool is_comment_initiator(int c) {
  if (c == '#') {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_comment_initiator>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x23,-0x8(%rbp)
jne    111d <is_comment_initiator+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <is_comment_initiator+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_comment_initiator(i32 %0) {
%2 = icmp eq i32 %0, 35
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ f();
int main(void) {
  (int)f();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @f()
%3 = trunc i64 %2 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, int);
double evaluate_wStack(char *);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *evaluate_asString(char *postfix) {
  double x = evaluate_wStack(postfix);
  char *str = (char *)calloc(2048, sizeof(char));
  sprintf(str, "%.4lf", x);
  return str;
}


x86 assembly (clang, -O0):
<evaluate_asString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <evaluate_wStack@plt>
movsd  %xmm0,-0x10(%rbp)
mov    $0x800,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
lea    0xe93(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluate_asString>:
push   %rbx
sub    $0x10,%rsp
call   1040 <evaluate_wStack@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x800,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rsi
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%.4lf\00"
define i8* @evaluate_asString(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double @evaluate_wStack(i8* %5)
store double %6, double* %3
%7 = call i64 @calloc(i32 2048, i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = load double, double* %3
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.4lf\00"
define i8* @evaluate_asString(i8* %0) {
%2 = tail call double @evaluate_wStack(i8* %0)
%3 = tail call i64 @calloc(i32 2048, i32 1)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %2)
ret i8* %4
}
/* Variables and functions */
int ljoy_sm_Wait(int /*<<< orphan*/);
int ljoy_sm_Poll() { return (ljoy_sm_Wait(0)); }


x86 assembly (clang, -O0):
<ljoy_sm_Poll>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ljoy_sm_Wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ljoy_sm_Poll>:
xor    %edi,%edi
jmp    1030 <ljoy_sm_Wait@plt>

LLVM IR (-O0):
define i32 @ljoy_sm_Poll() {
%1 = call i32 @ljoy_sm_Wait(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @ljoy_sm_Poll() {
%1 = tail call i32 @ljoy_sm_Wait(i32 0)
ret i32 %1
}
void exit_robust_list(struct task_struct *curr) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @exit_robust_list(%struct.task_struct* nocapture %0) {
ret void
}
void vnum_test3(int *data) {
  int n;
  int j = data[1] * data[3];
  int i = data[3];
  int m = data[1];
  int k = data[2];
  data[k] = 2;
  n = m * i;
  data[0] = n - j;
}


x86 assembly (clang, -O0):
<vnum_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0xc(%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnum_test3>:
movslq 0x8(%rdi),%rax
movl   $0x2,(%rdi,%rax,4)
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @vnum_test3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %12
%14 = mul nsw i32 %10, %13
store i32 %14, i32* %4
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
store i32 %17, i32* %5
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
store i32 %20, i32* %6
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
store i32 %23, i32* %7
%24 = load i32*, i32** %2
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
store i32 2, i32* %27
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = mul nsw i32 %28, %29
store i32 %30, i32* %3
%31 = load i32, i32* %3
%32 = load i32, i32* %4
%33 = sub nsw i32 %31, %32
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @vnum_test3(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
store i32 2, i32* %5
store i32 0, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __v2si;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ia32_storelv4si(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
void __attribute__((__always___, __nodebug__))
_mm_storel_epi64(__m128i *p, __m128i a) {
  __builtin_ia32_storelv4si((__v2si *)p, a);
}


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

x86 assembly (clang, -O2):
<_mm_storel_epi64>:
jmp    1030 <__builtin_ia32_storelv4si@plt>

LLVM IR (-O0):
define void @_mm_storel_epi64(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 @__builtin_ia32_storelv4si(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @_mm_storel_epi64(i32* %0, i32 %1) {
%3 = tail call i32 @__builtin_ia32_storelv4si(i32* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
char icharplus(char x, char y) {
  x += 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<icharplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x18,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
jne    1141 <icharplus+0x31>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icharplus>:
push   %rbx
mov    %edi,%ebx
add    $0x18,%bl
jne    111f <icharplus+0xf>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @icharplus(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = icmp ne i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @foo(i8* null)
br label %13
13: ; preds = %11, %2
%14 = load i8, i8* %3
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @icharplus(i8 signext %0, i8 signext %1) {
%3 = add i8 %0, 24
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i8 %3
}
__attribute__((spontaneous, parameterized_attribute(1))) void f() {}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int validate_author_name(const char *name) {
  if (name == NULL) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<validate_author_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <validate_author_name+0x1f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1126 <validate_author_name+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_author_name>:
cmp    $0x1,%rdi
sbb    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @validate_author_name(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = sext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint64_t time_usec(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return (uint64_t)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<time_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rax
imul   $0xf4240,%eax,%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @time_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @time_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void kfree(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<kfree>:
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):
<kfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @kfree(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 @kfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}