xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void apply(const void *key, void **value) {
  printf("key: %s\tvalue: %s\n", (const char *)key, (const char *)*value);
}


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

x86 assembly (clang, -O2):
<apply>:
mov    %rdi,%rax
mov    (%rsi),%rdx
lea    0xee3(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"key: %s\09value: %s\0A\00"
define void @apply(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"key: %s\09value: %s\0A\00"
define void @apply(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
ret void
}
int f(int n) { return n; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
char *getenv(char *);
char *gxgsym(char *ch) { return (getenv(ch)); }


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

x86 assembly (clang, -O2):
<gxgsym>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @gxgsym(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
int is_lowercase(char c) { return (((c >= 'a') && (c <= 'z')) ? 1 : 0); }


x86 assembly (clang, -O0):
<is_lowercase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_lowercase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_lowercase>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_lowercase(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_lowercase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int _char_in(int c, const char *delim) {
  for (; *delim != '\0'; delim++) {
    if (c == *delim)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_char_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114f <_char_in+0x4f>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1139 <_char_in+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1156 <_char_in+0x56>
jmp    113e <_char_in+0x3e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <_char_in+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_char_in>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1122 <_char_in+0x22>
add    $0x1,%rsi
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %edi,%ecx
je     1123 <_char_in+0x23>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <_char_in+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @_char_in(i32 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %8
5: ; preds = %8
%6 = load i8, i8* %13
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %13, %5 ], [ %1, %2 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %11, %0
%13 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %12, label %14, label %5
14: ; preds = %8, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ chdir(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void changedir(char *dir) {
  if (chdir(dir) < 0) {
    perror(dir);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<changedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    1162 <changedir+0x32>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changedir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <chdir@plt>
test   %rax,%rax
js     1140 <changedir+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @changedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @chdir(i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @perror(i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @changedir(i8* %0) {
%2 = tail call i64 @chdir(i8* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
int main() {
  int a = 0x1301;
  if (a & 0x100) {
    return 1;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1301,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x100,%eax
cmp    $0x0,%eax
je     112f <main+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <main+0x36>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ gpio_clear(int);
int /*<<< orphan*/ gpio_direction(int, int);
int /*<<< orphan*/ gpio_set(int);
void DC(unsigned int status) {
  gpio_direction(44, 251);
  if (status)
    gpio_set(44);
  else
    gpio_clear(44);
}


x86 assembly (clang, -O0):
<DC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2c,%edi
mov    $0xfb,%esi
call   1040 <gpio_direction@plt>
cmpl   $0x0,-0x4(%rbp)
je     1163 <DC+0x33>
mov    $0x2c,%edi
call   1050 <gpio_set@plt>
jmp    116d <DC+0x3d>
mov    $0x2c,%edi
call   1030 <gpio_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DC>:
push   %rbx
mov    %edi,%ebx
mov    $0x2c,%edi
mov    $0xfb,%esi
call   1040 <gpio_direction@plt>
mov    $0x2c,%edi
test   %ebx,%ebx
je     1151 <DC+0x21>
pop    %rbx
jmp    1050 <gpio_set@plt>
pop    %rbx
jmp    1030 <gpio_clear@plt>

LLVM IR (-O0):
define void @DC(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @gpio_direction(i32 44, i32 251)
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @gpio_set(i32 44)
br label %10
8: ; preds = %1
%9 = call i32 @gpio_clear(i32 44)
br label %10
10: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
define void @DC(i32 %0) {
%2 = tail call i32 @gpio_direction(i32 44, i32 251)
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @gpio_set(i32 44)
br label %8
6: ; preds = %1
%7 = tail call i32 @gpio_clear(i32 44)
br label %8
8: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void opt_out(FILE *stream, char *p, int n) {
  for (; n; n--)
    fprintf(stream, "%c", *(p++));
}


x86 assembly (clang, -O0):
<opt_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115d <opt_out+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edx
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <opt_out+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_out>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <opt_out+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
mov    %r15,%rsi
call   1030 <fputc@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <opt_out+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @opt_out(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %17, %3
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32*, i32** %4
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
%16 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %6
%19 = add nsw i32 %18, -1
store i32 %19, i32* %6
br label %7
20: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @opt_out(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %12, %5 ], [ %2, %3 ]
%7 = phi i8* [ %8, %5 ], [ %1, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = tail call i32 @fputc(i32 %10, i32* %0)
%12 = add nsw i32 %6, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bs_timer_proc();
void bs_timer_signal(int sig) { bs_timer_proc(); }


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

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

LLVM IR (-O0):
define void @bs_timer_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @bs_timer_proc()
ret void
}

LLVM IR (-O2):
define void @bs_timer_signal(i32 %0) {
%2 = tail call i32 (...) @bs_timer_proc()
ret void
}
void fd58(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  p01B:
    goto p01B;
    goto a;
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
a : {
  typedef int(*f)[n];
P02A:
  goto P02A;
  {
    typedef int(*g)[n];
  P024A:
    goto P024A;
    0;
  };
P02B:
  goto P02B;
  {
    typedef int(*h)[n];
  P025A:
    goto P025A;
    0;
  };
P02C:
  goto P02C;
  ;
  typedef int(*i)[n];
P026A:
  goto P026A;
  0;
};
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd58>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd58+0x7>

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

LLVM IR (-O0):
define void @fd58(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; preds = %18
br label %18
19: ; No predecessors!
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
br label %22
22: ; preds = %22, %19
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd58(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  {
    printf("./firmware2header <firmware file name>\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"./firmware2header <firmware file name>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [39 x i8] c"./firmware2header <firmware file name>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int safe_socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int safe_socket_tcp() { return safe_socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<safe_socket_tcp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <safe_socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_socket_tcp>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <safe_socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @safe_socket_tcp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @safe_socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @safe_socket_tcp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @safe_socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
unsigned char *testPage(unsigned int pageIdx) {
  static unsigned char testPageBuffer[16][8192];
  return testPageBuffer[pageIdx];
}


x86 assembly (clang, -O0):
<testPage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x2f1d(%rip),%rax
shl    $0xd,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testPage>:
mov    %edi,%ecx
shl    $0xd,%rcx
lea    0x2f23(%rip),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
@testPage.testPageBuffer = internal global [16 x [8192 x i8]] zeroinitializer
define i8* @testPage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [16 x [8192 x i8]], [16 x [8192 x i8]]* @testPage.testPageBuffer, i64 0, i64 %4
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %5, i64 0, i64 0
ret i8* %6
}

LLVM IR (-O2):
@testPage.testPageBuffer = internal global [16 x [8192 x i8]] zeroinitializer
define i8* @testPage(i32 %0) {
%2 = zext i32 %0 to i64
%3 = getelementptr inbounds [16 x [8192 x i8]], [16 x [8192 x i8]]* @testPage.testPageBuffer, i64 0, i64 %2, i64 0
ret i8* %3
}
short int more(digit)
double digit;
{
  short int test;
  if (digit >= 0.0) {
    test = 1;
  } else {
    test = 0;
  }
  return (test);
}


x86 assembly (clang, -O0):
<more>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1126 <more+0x26>
movw   $0x1,-0xa(%rbp)
jmp    112c <more+0x2c>
movw   $0x0,-0xa(%rbp)
movswl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<more>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setae  %al
ret

LLVM IR (-O0):
define signext i16 @more(double %0) {
%2 = alloca double
%3 = alloca i16
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp oge double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 1, i16* %3
br label %8
7: ; preds = %1
store i16 0, i16* %3
br label %8
8: ; preds = %7, %6
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
define signext i16 @more(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = zext i1 %2 to i16
ret i16 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t hash_uint64(uint64_t v) {
  v ^= v >> 33;
  v *= 0xff51afd7ed558ccdULL;
  v ^= v >> 33;
  v *= 0xc4ceb9fe1a85ec53ULL;
  v ^= v >> 33;
  return v;
}


x86 assembly (clang, -O0):
<hash_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff51afd7ed558ccd,%rcx
af 51 ff
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xc4ceb9fe1a85ec53,%rcx
b9 ce c4
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x21,%ecx
sar    %cl,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_uint64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 33
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = mul i64 %8, -49064778989728563
%10 = trunc i64 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 33
%13 = load i32, i32* %2
%14 = xor i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = mul i64 %16, -4265267296055464877
%18 = trunc i64 %17 to i32
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = ashr i32 %19, 33
%21 = load i32, i32* %2
%22 = xor i32 %21, %20
store i32 %22, i32* %2
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @hash_uint64(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int log(double);
double pow(double, int);
double calc_curved_factor(double middle, double z) {
  if (middle < 1e-10)
    middle = 1e-10;
  return pow(z, log(0.5) / log(middle));
}


x86 assembly (clang, -O0):
<calc_curved_factor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xec6(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1152 <calc_curved_factor+0x32>
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea4(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_curved_factor>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  0xecd(%rip),%xmm1
maxsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xec4(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  (%rsp),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
movsd  0x8(%rsp),%xmm0
mov    %eax,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @calc_curved_factor(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp olt double %5, 1.000000e-10
br i1 %6, label %7, label %8
7: ; preds = %2
store double 1.000000e-10, double* %3
br label %8
8: ; preds = %7, %2
%9 = load double, double* %4
%10 = call i32 @log(double 5.000000e-01)
%11 = load double, double* %3
%12 = call i32 @log(double %11)
%13 = sdiv i32 %10, %12
%14 = call double @pow(double %9, i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @calc_curved_factor(double %0, double %1) {
%3 = fcmp olt double %0, 1.000000e-10
%4 = select i1 %3, double 1.000000e-10, double %0
%5 = tail call i32 @log(double 5.000000e-01)
%6 = tail call i32 @log(double %4)
%7 = sdiv i32 %5, %6
%8 = tail call double @pow(double %1, i32 %7)
ret double %8
}
void ws_pad(char *str, int len) {
  int i = 0;
  for (i = 0; i < len; i++) {
    if (str[i] == '\0') {
      str[i] = ' ';
      str[i + 1] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<ws_pad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116a <ws_pad+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1157 <ws_pad+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    115c <ws_pad+0x5c>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <ws_pad+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ws_pad>:
test   %esi,%esi
jle    1127 <ws_pad+0x27>
mov    %esi,%eax
xor    %ecx,%ecx
jmp    1119 <ws_pad+0x19>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmp    %rax,%rcx
je     1127 <ws_pad+0x27>
cmpb   $0x0,(%rdi,%rcx,1)
jne    1110 <ws_pad+0x10>
movw   $0x20,(%rdi,%rcx,1)
jmp    1110 <ws_pad+0x10>
ret

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

LLVM IR (-O2):
define void @ws_pad(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %16
%7 = phi i64 [ 0, %4 ], [ %17, %16 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = add nuw nsw i64 %7, 1
br label %16
13: ; preds = %6
store i8 32, i8* %8
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %11, %13
%17 = phi i64 [ %12, %11 ], [ %14, %13 ]
%18 = icmp eq i64 %17, %5
br i1 %18, label %19, label %6
19: ; preds = %16, %2
ret void
}
/* Variables and functions */
scalar_t__ atol(char *);
unsigned int CUIntChars(char *Sorc) { return (unsigned int)atol(Sorc); }


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

x86 assembly (clang, -O2):
<CUIntChars>:
jmp    1030 <atol@plt>

LLVM IR (-O0):
define i32 @CUIntChars(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atol(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @CUIntChars(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
int rho_ruby_to_int(unsigned long val, int *dest) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @rho_ruby_to_int(i64 %0, i32* nocapture readnone %1) {
ret i32 0
}
void exi_quiesce(void) {}


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

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

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

LLVM IR (-O2):
define void @exi_quiesce() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TSIL_Warn(char *, char *);
void SUMO_Warn(char *func, char *msg) { TSIL_Warn(func, msg); }


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

x86 assembly (clang, -O2):
<SUMO_Warn>:
jmp    1030 <TSIL_Warn@plt>

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

LLVM IR (-O2):
define void @SUMO_Warn(i8* %0, i8* %1) {
%3 = tail call i32 @TSIL_Warn(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
long INT_MAX;
long INT_MIN;
float scalbnf(float, int);
float scalblnf(float x, long n) {
  if (n < INT_MIN)
    return scalbnf(x, INT_MIN);
  else if (n > INT_MAX)
    return scalbnf(x, INT_MAX);
  else
    return scalbnf(x, (int)n);
}


x86 assembly (clang, -O0):
<scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%rax
jge    1155 <scalblnf+0x45>
movss  -0x8(%rbp),%xmm0
mov    0x2e9f(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <scalbnf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    119e <scalblnf+0x8e>
mov    -0x10(%rbp),%rax
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jle    1189 <scalblnf+0x79>
movss  -0x8(%rbp),%xmm0
mov    0x2e73(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
call   1030 <scalbnf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    119e <scalblnf+0x8e>
movss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <scalbnf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalblnf>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%rcx
cmp    %rdi,%rcx
cmovge %edi,%ecx
mov    (%rax),%rax
cmp    %rdi,%rax
cmovle %ecx,%eax
mov    %eax,%edi
jmp    1030 <scalbnf@plt>

LLVM IR (-O0):
@INT_MIN = global i64 0
@INT_MAX = global i64 0
define float @scalblnf(float %0, i64 %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i64
store float %0, float* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = load i64, i64* @INT_MIN
%8 = icmp slt i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load float, float* %4
%11 = load i64, i64* @INT_MIN
%12 = trunc i64 %11 to i32
%13 = call float @scalbnf(float %10, i32 %12)
store float %13, float* %3
br label %28
14: ; preds = %2
%15 = load i64, i64* %5
%16 = load i64, i64* @INT_MAX
%17 = icmp sgt i64 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load float, float* %4
%20 = load i64, i64* @INT_MAX
%21 = trunc i64 %20 to i32
%22 = call float @scalbnf(float %19, i32 %21)
store float %22, float* %3
br label %28
23: ; preds = %14
%24 = load float, float* %4
%25 = load i64, i64* %5
%26 = trunc i64 %25 to i32
%27 = call float @scalbnf(float %24, i32 %26)
store float %27, float* %3
br label %28
28: ; preds = %23, %18, %9
%29 = load float, float* %3
ret float %29
}

LLVM IR (-O2):
@INT_MIN = global i64 0
@INT_MAX = global i64 0
define float @scalblnf(float %0, i64 %1) {
%3 = load i64, i64* @INT_MIN
%4 = icmp sgt i64 %3, %1
%5 = load i64, i64* @INT_MAX
%6 = icmp slt i64 %5, %1
%7 = select i1 %6, i64 %5, i64 %1
%8 = select i1 %4, i64 %3, i64 %7
%9 = trunc i64 %8 to i32
%10 = tail call float @scalbnf(float %0, i32 %9)
ret float %10
}
/* Variables and functions */
int round(int);
int mps2knots(int mps) {
  if (mps < 0)
    return mps;
  return round(mps * 900 / 463.0);
}


x86 assembly (clang, -O0):
<mps2knots>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1130 <mps2knots+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <mps2knots+0x43>
imul   $0x384,-0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <round@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mps2knots>:
test   %edi,%edi
js     112f <mps2knots+0x1f>
imul   $0x384,%edi,%eax
cvtsi2sd %eax,%xmm0
divsd  0xeda(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <round@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mps2knots(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %15
8: ; preds = %1
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 900
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 4.630000e+02
%13 = fptosi double %12 to i32
%14 = call i32 @round(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %8, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @mps2knots(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = mul nsw i32 %0, 900
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 4.630000e+02
%7 = fptosi double %6 to i32
%8 = tail call i32 @round(i32 %7)
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ %0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_char_p(char *addr, char value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_char_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_char_p(i8* %0, i8 signext %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 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_char_p(i8* nocapture readnone %0, i8 signext %1, i32 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void test_spaces_only(void) {
  char buf[] = "   \t\t\t   ";
  trim_right(buf);
  do {
    seatest_assert_string_equal("", buf, __FUNCTION__, 18);
  } while (0);
}


x86 assembly (clang, -O0):
<test_spaces_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xa(%rbp),%rdi
mov    $0x0,%al
call   1030 <trim_right@plt>
lea    -0xa(%rbp),%rsi
lea    0xeb5(%rip),%rdi
lea    0xeaf(%rip),%rdx
mov    $0x12,%ecx
mov    $0x0,%al
call   1040 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_spaces_only>:
push   %rbx
sub    $0x10,%rsp
movabs $0x2020090909202020,%rax
09 20 20
mov    %rax,(%rsp)
movw   $0x20,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <trim_right@plt>
lea    0xebb(%rip),%rdi
lea    0xeb5(%rip),%rdx
mov    %rbx,%rsi
mov    $0x12,%ecx
xor    %eax,%eax
call   1040 <seatest_assert_string_equal@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_spaces_only.buf = [10 x i8] c" \09\09\09 \00"
@.str = [1 x i8] zeroinitializer
@__FUNCTION__.test_spaces_only = [17 x i8] c"test_spaces_only\00"
define void @test_spaces_only() {
%1 = alloca [10 x i8]
%2 = bitcast [10 x i8]* %1 to i8*
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @trim_right to i32 (i8*, ...)*)(i8* %3)
br label %5
5: ; preds = %0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.test_spaces_only, i64 0, i64 0), i32 18)
br label %8
8: ; preds = %5
ret void
}

LLVM IR (-O2):
@__const.test_spaces_only.buf = [10 x i8] c" \09\09\09 \00"
@.str = [1 x i8] zeroinitializer
@__FUNCTION__.test_spaces_only = [17 x i8] c"test_spaces_only\00"
define void @test_spaces_only() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @trim_right to i32 (i8*, ...)*)(i8* %2)
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__FUNCTION__.test_spaces_only, i64 0, i64 0), i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_javascript_comment_entities();
int /*<<< orphan*/ test_javascript_comments();
void all_javascript_tests() {
  test_javascript_comments();
  test_javascript_comment_entities();
}


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

x86 assembly (clang, -O2):
<all_javascript_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_javascript_comments@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_javascript_comment_entities@plt>

LLVM IR (-O0):
define void @all_javascript_tests() {
%1 = call i32 (...) @test_javascript_comments()
%2 = call i32 (...) @test_javascript_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_javascript_tests() {
%1 = tail call i32 (...) @test_javascript_comments()
%2 = tail call i32 (...) @test_javascript_comment_entities()
ret void
}
/* Variables and functions */
int powf(float, int);
float cubic_out(float step, float max_steps, float max_val) {
  float ratio = step / (max_steps - 1);
  return max_val * (powf(ratio, 3) + 1);
}


x86 assembly (clang, -O0):
<cubic_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  0xec7(%rip),%xmm2
subss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <powf@plt>
movss  -0x14(%rbp),%xmm0
add    $0x1,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic_out>:
push   %rax
movss  %xmm2,0x4(%rsp)
addss  0xee1(%rip),%xmm1
divss  %xmm1,%xmm0
mov    $0x3,%edi
call   1030 <powf@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cubic_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %9, 1.000000e+00
%11 = fdiv float %8, %10
store float %11, float* %7
%12 = load float, float* %6
%13 = load float, float* %7
%14 = call i32 @powf(float %13, i32 3)
%15 = add nsw i32 %14, 1
%16 = sitofp i32 %15 to float
%17 = fmul float %12, %16
ret float %17
}

LLVM IR (-O2):
define float @cubic_out(float %0, float %1, float %2) {
%4 = fadd float %1, -1.000000e+00
%5 = fdiv float %0, %4
%6 = tail call i32 @powf(float %5, i32 3)
%7 = add nsw i32 %6, 1
%8 = sitofp i32 %7 to float
%9 = fmul float %8, %2
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int main(void) {
  execlp("ls", "ls", "-al", NULL);
  perror("execlp");
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rsi
lea    0xec6(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xeb7(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
lea    0xec7(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-al\00"
@.str.2 = [7 x i8] c"execlp\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [4 x i8] c"-al\00"
@.str.2 = [7 x i8] c"execlp\00"
define i32 @main() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
const char *pretty_offset(int ofs) {
  static char esp_buf[64];
  if (ofs)
    sprintf(esp_buf, "%d(%%esp)", ofs);
  else
    strcpy(esp_buf, "(%esp)");
  return esp_buf;
}


x86 assembly (clang, -O0):
<pretty_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <pretty_offset+0x30>
mov    -0x4(%rbp),%edx
lea    0x2f01(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1040 <sprintf@plt>
jmp    1163 <pretty_offset+0x43>
lea    0x2ee9(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ed6(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_offset>:
push   %rax
test   %edi,%edi
je     113c <pretty_offset+0x1c>
mov    %edi,%edx
lea    0x2f12(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <sprintf@plt>
jmp    114f <pretty_offset+0x2f>
lea    0x2efd(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2eea(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@pretty_offset.esp_buf = internal global [64 x i8] zeroinitializer
@.str = [10 x i8] c"%d(%%esp)\00"
@.str.1 = [7 x i8] c"(%esp)\00"
define i8* @pretty_offset(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 %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @pretty_offset.esp_buf, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %1
%9 = call i32 @strcpy(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @pretty_offset.esp_buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @pretty_offset.esp_buf, i64 0, i64 0)
}

LLVM IR (-O2):
@pretty_offset.esp_buf = internal global [64 x i8] zeroinitializer
@.str = [10 x i8] c"%d(%%esp)\00"
@.str.1 = [7 x i8] c"(%esp)\00"
define i8* @pretty_offset(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @pretty_offset.esp_buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %7
5: ; preds = %1
%6 = tail call i32 @strcpy(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @pretty_offset.esp_buf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @pretty_offset.esp_buf, i64 0, i64 0)
}
int C$_Remove(const char *input) {
  int val = remove(input);
  if (val == -1) {
    perror("ca$h ERROR remove");
  }
  return val;
}


x86 assembly (clang, -O0):
<C$_Remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1152 <C$_Remove+0x32>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C$_Remove>:
push   %rbx
xor    %eax,%eax
call   1030 <remove@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    113d <C$_Remove+0x1d>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1040 <perror@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"ca$h ERROR remove\00"
define i32 @"C$_Remove"(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @remove to i32 (i8*, ...)*)(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [18 x i8] c"ca$h ERROR remove\00"
define i32 @"C$_Remove"(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @remove to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
long round(double);
long lround(double x) { return round(x); }


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

x86 assembly (clang, -O2):
<lround>:
jmp    1030 <round@plt>

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

LLVM IR (-O2):
define i64 @lround(double %0) {
%2 = tail call i64 @round(double %0)
ret i64 %2
}
char *hash_plugin_detailed(void) {
  return ("sha384 - A simple sha384 plugin\n"
          "------------------------\n"
          "Use this module to crack simple sha384 hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "None.\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


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

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

LLVM IR (-O0):
@.str = [262 x i8] c"sha384 - A simple sha384 plugin\0A------------------------\0AUse this module to crack simple sha384 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0ANone.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [262 x i8] c"sha384 - A simple sha384 plugin\0A------------------------\0AUse this module to crack simple sha384 hashes\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0ANone.\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0)
}
int _unlink(char *name) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_unlink(i8* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ handle_SEGV(int /*<<< orphan*/);
int gen_SEGV(void) {
  handle_SEGV(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_SEGV() {
%1 = tail call i32 @handle_SEGV(i32 0)
ret i32 0
}