xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void p006() {
  int result, i;
  int sum = 0;
  int square_sum = 0;
  for (i = 1; i <= 100; ++i) {
    sum += i;
    square_sum += i * i;
  }
  result = sum * sum - square_sum;
  printf("The sum square difference of the first 100 numbers is %d.", result);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     115b <p006+0x4b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <p006+0x1d>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
lea    0xee9(%rip),%rdi
mov    $0x17ff976,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"The sum square difference of the first 100 numbers is %d.\00"
define void @p006() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %2
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %8
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
%22 = load i32, i32* %3
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %4
%25 = sub nsw i32 %23, %24
store i32 %25, i32* %1
%26 = load i32, i32* %1
%27 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 %26)
ret void
}

LLVM IR (-O2):
@.str = [58 x i8] c"The sum square difference of the first 100 numbers is %d.\00"
define void @p006() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *umalloc(scalar_t__);
char *ustrdup(const char *s) {
  char *d = umalloc(strlen(s) + 1);
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<ustrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <umalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <umalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ustrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @umalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @ustrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @umalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
const char *image_extension(void) { return "bmp"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"bmp\00"
define i8* @image_extension() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"bmp\00"
define i8* @image_extension() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
void tdup() {
  asm volatile("movq (%%r11), %%rax\n\t"
               "subq $0x8, %%r11\n\t"
               "movq %%rax, (%%r11)\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<tdup>:
push   %rbp
mov    %rsp,%rbp
mov    (%r11),%rax
sub    $0x8,%r11
mov    %rax,(%r11)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdup>:
mov    (%r11),%rax
sub    $0x8,%r11
mov    %rax,(%r11)
ret

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

LLVM IR (-O2):
define void @tdup() {
tail call void asm sideeffect "movq (%r11), %rax\0A\09subq $$0x8, %r11\0A\09movq %rax, (%r11)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int rec(int a) {
  if (a == 0)
    return 0;
  else {
    int res = rec(a - 1);
    int rescopy = res;
    while (rescopy > 0)
      rescopy--;
    return 1 + res;
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <rec+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1166 <rec+0x56>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    115d <rec+0x4d>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <rec+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
test   %edi,%edi
je     1125 <rec+0x15>
push   %rax
add    $0xffffffff,%edi
call   1030 <rec@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rec(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @rec(i32 %4)
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int statlibfunc();
int main(int argc, char **argv) { return statlibfunc() == 42 ? 0 : 1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <statlibfunc@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x2a,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <statlibfunc@plt>
xor    %ecx,%ecx
cmp    $0x2a,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @statlibfunc()
%7 = icmp eq i32 %6, 42
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @statlibfunc()
%4 = icmp ne i32 %3, 42
%5 = zext i1 %4 to i32
ret i32 %5
}
double min2(double a, double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min2+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min2+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min2>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min2(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 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @min2(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
double tanh(double x) {
  return ({
    extern __typeof__(tanh) module_libc_tanh;
    &module_libc_tanh;
  })(x);
}


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ecc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  -0x8(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh>:
jmp    1030 <module_libc_tanh@plt>

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
%3 = alloca double (double)*
store double %0, double* %2
store double (double)* @module_libc_tanh, double (double)** %3
%4 = load double (double)*, double (double)** %3
%5 = load double, double* %2
%6 = call double %4(double %5)
ret double %6
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @module_libc_tanh(double %0)
ret double %2
}
int main() {
  float f = 1;
  int i = f;
  if (i == 1) {
    goto ERROR;
  }
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
cvttss2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    112f <main+0x2f>
jmp    113b <main+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <main+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %0
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %11
10: ; preds = %8
store i32 -1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
void stop_child_send(child_socket_val) int child_socket_val;
{ close(child_socket_val); }


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

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

LLVM IR (-O0):
define void @stop_child_send(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @stop_child_send(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
ret void
}
void usleep(int useconds) {
  while (useconds-- > 0)
    ;
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1120 <usleep+0x20>
jmp    1107 <usleep+0x7>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @usleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
ret void
}

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

/* Variables and functions */
int digittoascii(int);
uint16_t convert(uint16_t RAW_VALUE) {
  return digittoascii(RAW_VALUE / 16) + 256 * digittoascii(RAW_VALUE % 16);
}


x86 assembly (clang, -O0):
<convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <digittoascii@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <digittoascii@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xf(%rbx),%ebp
test   %edi,%edi
cmovns %edi,%ebp
mov    %ebp,%edi
sar    $0x4,%edi
call   1030 <digittoascii@plt>
mov    %eax,%r14d
and    $0xfffffff0,%ebp
sub    %ebp,%ebx
mov    %ebx,%edi
call   1030 <digittoascii@plt>
shl    $0x8,%eax
add    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @convert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 16
%5 = call i32 @digittoascii(i32 %4)
%6 = load i32, i32* %2
%7 = srem i32 %6, 16
%8 = call i32 @digittoascii(i32 %7)
%9 = mul nsw i32 256, %8
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @convert(i32 %0) {
%2 = sdiv i32 %0, 16
%3 = tail call i32 @digittoascii(i32 %2)
%4 = srem i32 %0, 16
%5 = tail call i32 @digittoascii(i32 %4)
%6 = shl nsw i32 %5, 8
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
char getchar();
void flush(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <flush+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <flush+0x21>
jmp    1119 <flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @flush() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @flush() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
bool isNumeric(char c) { return c >= 48 && c <= 57; }


x86 assembly (clang, -O0):
<isNumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isNumeric+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNumeric(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, 48
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, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isNumeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ copierXEArray_test();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("copierXEArray_test() : \n");
  if (copierXEArray_test() == 0) {
    printf("OK !\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <copierXEArray_test@plt>
cmp    $0x0,%rax
jne    1158 <main+0x38>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"copierXEArray_test() : \0A\00"
@.str.1 = [6 x i8] c"OK !\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i64 (...) @copierXEArray_test()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"copierXEArray_test() : \00"
@str.2 = [5 x i8] c"OK !\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i64 (...) @copierXEArray_test()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int mq_timedsend(int /*<<< orphan*/, char const *, size_t, unsigned int,
                 int /*<<< orphan*/);
int mq_send(mqd_t mqd, const char *msg, size_t len, unsigned prio) {
  return mq_timedsend(mqd, msg, len, prio, 0);
}


x86 assembly (clang, -O0):
<mq_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <mq_timedsend@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mq_send>:
xor    %r8d,%r8d
jmp    1030 <mq_timedsend@plt>

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

LLVM IR (-O2):
define i32 @mq_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @mq_timedsend(i32 %0, i8* %1, i64 %2, i32 %3, i32 0)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ state;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xvisibility_state(void *_p) {
  return (int)((XEvent *)_p)->xvisibility.state;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xvisibility_state>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xvisibility_state(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xvisibility_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void search_usage(FILE *out, char *arg0) {
  fprintf(
      out,
      "Usage: %s [...] search [OPTS]\n"
      "\n"
      "Options:\n"
      "  -g,--group TAGPATTERN   Group the output results by the TAGPATTERN\n"
      "  -h,--help               Show this help\n",
      arg0);
}


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

x86 assembly (clang, -O2):
<search_usage>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [151 x i8] c"Usage: %s [...] search [OPTS]\0A\0AOptions:\0A -g,--group TAGPATTERN Group the output results by the TAGPATTERN\0A -h,--help Show this help\0A\00"
define void @search_usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [151 x i8] c"Usage: %s [...] search [OPTS]\0A\0AOptions:\0A -g,--group TAGPATTERN Group the output results by the TAGPATTERN\0A -h,--help Show this help\0A\00"
define void @search_usage(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([151 x i8], [151 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
int missingargs(int x, int y) {
  y = x;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @missingargs(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
store i32 %5, i32* %4
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @missingargs(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
int coDex(int);
int firstNamelessRecord(int, int);
int countNamelessRecords(int m, int firstcode) {
  int i = firstNamelessRecord(m, firstcode);
  int codexm = coDex(m);
  while (coDex(m) == codexm)
    m++;
  return (m - i);
}


x86 assembly (clang, -O0):
<countNamelessRecords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <firstNamelessRecord@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <coDex@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <coDex@plt>
cmp    -0x10(%rbp),%eax
jne    1166 <countNamelessRecords+0x46>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <countNamelessRecords+0x27>
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countNamelessRecords>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <firstNamelessRecord@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1040 <coDex@plt>
mov    %eax,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <coDex@plt>
add    $0x1,%ebx
cmp    %ebp,%eax
je     1140 <countNamelessRecords+0x20>
not    %r14d
add    %ebx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countNamelessRecords(i32 %0, i32 %1) {
%3 = tail call i32 @firstNamelessRecord(i32 %0, i32 %1)
%4 = tail call i32 @coDex(i32 %0)
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %0, %2 ], [ %9, %5 ]
%7 = tail call i32 @coDex(i32 %6)
%8 = icmp eq i32 %7, %4
%9 = add nsw i32 %6, 1
br i1 %8, label %5, label %10
10: ; preds = %5
%11 = sub nsw i32 %6, %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EatIt();
int /*<<< orphan*/ Error(char *);
void BadMode() {
  Error("Illegal addressing mode");
  EatIt();
}


x86 assembly (clang, -O0):
<BadMode>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <Error@plt>
mov    $0x0,%al
call   1040 <EatIt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BadMode>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <Error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <EatIt@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Illegal addressing mode\00"
define void @BadMode() {
%1 = call i32 @Error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @EatIt()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Illegal addressing mode\00"
define void @BadMode() {
%1 = tail call i32 @Error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @EatIt()
ret void
}
float noise(int x, int y) {
  int n;
  n = x + y * 57;
  n = (n << 13) ^ n;
  return (1.0 - ((n * ((n * n * 15731) + 789221) + 1376312589) & 0x7fffffff) /
                    1073741824.0);
}


x86 assembly (clang, -O0):
<noise>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x39,-0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
imul   $0x3d73,%ecx,%ecx
add    $0xc0ae5,%ecx
imul   %ecx,%eax
add    $0x5208dd0d,%eax
and    $0x7fffffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb7(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<noise>:
imul   $0x39,%esi,%eax
add    %edi,%eax
mov    %eax,%ecx
shl    $0xd,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
imul   %ecx,%eax
imul   $0x3d73,%eax,%eax
add    $0xc0ae5,%eax
imul   %ecx,%eax
add    $0x5208dd0d,%eax
and    $0x7fffffff,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xecb(%rip),%xmm0
addsd  0xecb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @noise(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 57
%9 = add nsw i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = shl i32 %10, 13
%12 = load i32, i32* %5
%13 = xor i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %5
%16 = load i32, i32* %5
%17 = mul nsw i32 %15, %16
%18 = mul nsw i32 %17, 15731
%19 = add nsw i32 %18, 789221
%20 = mul nsw i32 %14, %19
%21 = add nsw i32 %20, 1376312589
%22 = and i32 %21, 2147483647
%23 = sitofp i32 %22 to double
%24 = fdiv double %23, 0x41D0000000000000
%25 = fsub double 1.000000e+00, %24
%26 = fptrunc double %25 to float
ret float %26
}

LLVM IR (-O2):
define float @noise(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 57
%4 = add nsw i32 %3, %0
%5 = shl i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, 15731
%8 = mul i32 %7, %6
%9 = add nuw nsw i32 %8, 789221
%10 = mul nsw i32 %9, %6
%11 = add nsw i32 %10, 1376312589
%12 = and i32 %11, 2147483647
%13 = sitofp i32 %12 to double
%14 = fmul double %13, 0x3E10000000000000
%15 = fsub double 1.000000e+00, %14
%16 = fptrunc double %15 to float
ret float %16
}
/* Type definitions */
struct avl_tree_node {
  int dummy;
};

/* Variables and functions */
struct avl_tree_node *
avl_tree_next_or_prev_in_order(struct avl_tree_node const *, int);
struct avl_tree_node *avl_tree_prev_in_order(const struct avl_tree_node *node) {
  return avl_tree_next_or_prev_in_order(node, -1);
}


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

x86 assembly (clang, -O2):
<avl_tree_prev_in_order>:
mov    $0xffffffff,%esi
jmp    1030 <avl_tree_next_or_prev_in_order@plt>

LLVM IR (-O0):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_prev_in_order(%struct.avl_tree_node* %0) {
%2 = alloca %struct.avl_tree_node*
store %struct.avl_tree_node* %0, %struct.avl_tree_node** %2
%3 = load %struct.avl_tree_node*, %struct.avl_tree_node** %2
%4 = call %struct.avl_tree_node* @avl_tree_next_or_prev_in_order(%struct.avl_tree_node* %3, i32 -1)
ret %struct.avl_tree_node* %4
}

LLVM IR (-O2):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_prev_in_order(%struct.avl_tree_node* %0) {
%2 = tail call %struct.avl_tree_node* @avl_tree_next_or_prev_in_order(%struct.avl_tree_node* %0, i32 -1)
ret %struct.avl_tree_node* %2
}
void symbol51_untagged() {}


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

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

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

LLVM IR (-O2):
define void @symbol51_untagged() {
ret void
}
void cleanMap(int **map, int rows) {
  for (int row = 0; row < rows; row++) {
    free(map[row]);
  }
  free(map);
}


x86 assembly (clang, -O0):
<cleanMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <cleanMap+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <cleanMap+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanMap>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <cleanMap+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <cleanMap+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @cleanMap(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i32** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32*, i32** %0, i64 %9
%11 = bitcast i32** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
unsigned long find_start(void) { __asm__("movl %esp,%eax"); }


x86 assembly (clang, -O0):
<find_start>:
push   %rbp
mov    %rsp,%rbp
mov    %esp,%eax
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_start>:
mov    %esp,%eax
ret

LLVM IR (-O0):
define i64 @find_start() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @find_start() {
tail call void asm sideeffect "movl %esp,%eax", "~{dirflag},~{fpsr},~{flags}"()
ret i64 undef
}
unsigned int hashstr(const char *str) {
  unsigned int i;
  for (i = 0; *str; str++) {
    i *= 16777619;
    i ^= *str;
  }
  return i;
}


x86 assembly (clang, -O0):
<hashstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hashstr+0x44>
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hashstr+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashstr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <hashstr+0x27>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
imul   $0x1000193,%eax,%edx
movsbl %cl,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashstr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hashstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 16777619
%9 = sext i8 %5 to i32
%10 = xor i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int flags;
};
typedef TYPE_1__ ASN1_STRING_TABLE;

/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(TYPE_1__ *);
int STABLE_FLAGS_MALLOC;
void st_free(ASN1_STRING_TABLE *tbl) {
  if (tbl->flags & STABLE_FLAGS_MALLOC)
    OPENSSL_free(tbl);
}


x86 assembly (clang, -O0):
<st_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2eb7(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     113d <st_free+0x2d>
mov    -0x8(%rbp),%rdi
call   1030 <OPENSSL_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_free>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
test   %eax,(%rdi)
je     1122 <st_free+0x12>
jmp    1030 <OPENSSL_free@plt>
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
@STABLE_FLAGS_MALLOC = global i32 0
define void @st_free(%struct.TYPE_4__* %0) {
%2 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %2
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @STABLE_FLAGS_MALLOC
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %2
%11 = call i32 @OPENSSL_free(%struct.TYPE_4__* %10)
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
@STABLE_FLAGS_MALLOC = global i32 0
define void @st_free(%struct.TYPE_4__* %0) {
%2 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @STABLE_FLAGS_MALLOC
%5 = and i32 %4, %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @OPENSSL_free(%struct.TYPE_4__* %0)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int f2();
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = f2();
  printf("%d", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f2@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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


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

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

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

LLVM IR (-O2):
define void @nmi_exception() {
ret void
}
int linkPossible(int old, int new) {
  return (old == 0 || old == 5) && new == 2;
}


x86 assembly (clang, -O0):
<linkPossible>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <linkPossible+0x23>
xor    %eax,%eax
cmpl   $0x5,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    112d <linkPossible+0x2d>
cmpl   $0x2,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linkPossible>:
cmp    $0x5,%edi
je     110b <linkPossible+0xb>
xor    %eax,%eax
test   %edi,%edi
jne    1113 <linkPossible+0x13>
xor    %eax,%eax
cmp    $0x2,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @linkPossible(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 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 5
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ false, %7 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @linkPossible(i32 %0, i32 %1) {
switch i32 %0, label %6 [
i32 5, label %3
i32 0, label %3
]
3: ; preds = %2, %2
%4 = icmp eq i32 %1, 2
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %3
%7 = phi i32 [ %5, %3 ], [ 0, %2 ]
ret i32 %7
}
int test_04(const char *x, const char *y) {
  return __builtin_strcmp(x, "1234567");
}


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

x86 assembly (clang, -O2):
<test_04>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"1234567\00"
define i32 @test_04(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 = call i32 @strcmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"1234567\00"
define i32 @test_04(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
void complex_mul(double *ar, double *ai, double br, double bi) {
  double tmpar = *ar * br - *ai * bi;
  *ai = *ar * bi + *ai * br;
  *ar = tmpar;
}


x86 assembly (clang, -O0):
<complex_mul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x18(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x20(%rbp),%xmm2
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<complex_mul>:
movsd  (%rdi),%xmm2
movsd  (%rsi),%xmm3
movapd %xmm3,%xmm4
mulsd  %xmm1,%xmm4
movapd %xmm2,%xmm5
mulsd  %xmm0,%xmm5
subsd  %xmm4,%xmm5
mulsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm2
addsd  %xmm3,%xmm2
movsd  %xmm2,(%rsi)
movsd  %xmm5,(%rdi)
ret

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

LLVM IR (-O2):
define void @complex_mul(double* nocapture %0, double* nocapture %1, double %2, double %3) {
%5 = load double, double* %0
%6 = load double, double* %1
%7 = fneg double %6
%8 = fmul double %7, %3
%9 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %8)
%10 = fmul double %6, %2
%11 = tail call double @llvm.fmuladd.f64(double %5, double %3, double %10)
store double %11, double* %1
store double %9, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_sbc();
void e_sbc_abs() {
  e_abs();
  e_sbc();
}


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

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

LLVM IR (-O0):
define void @e_sbc_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_sbc()
ret void
}

LLVM IR (-O2):
define void @e_sbc_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_sbc()
ret void
}
int IncrementIndex(int i) {
  i++;
  if (i < (20))
    return i;
  return 0;
}


x86 assembly (clang, -O0):
<IncrementIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1125 <IncrementIndex+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <IncrementIndex+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IncrementIndex>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    $0x13,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @IncrementIndex(i32 %0) {
%2 = icmp slt i32 %0, 19
%3 = add nsw i32 %0, 1
%4 = select i1 %2, i32 %3, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hallo Welt");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hallo Welt\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hallo Welt\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long long llrintf(float x) {
  long long r;
  __asm__("fistpll %0" : "=m"(r) : "t"(x) : "st");
  return r;
}


x86 assembly (clang, -O0):
<llrintf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
flds   -0x14(%rbp)
fistpll -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrintf>:
movss  %xmm0,-0xc(%rsp)
flds   -0xc(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ b();
void f(int v) {
  if (v == 1) {
    b();
    b();
    b();
    b();
    b();
    b();
    b();
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1156 <f+0x46>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
mov    $0x0,%al
call   1030 <b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
cmp    $0x1,%edi
jne    1148 <f+0x38>
push   %rax
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
call   1030 <b@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <b@plt>
ret

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

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = tail call i32 (...) @b()
%5 = tail call i32 (...) @b()
%6 = tail call i32 (...) @b()
%7 = tail call i32 (...) @b()
%8 = tail call i32 (...) @b()
%9 = tail call i32 (...) @b()
%10 = tail call i32 (...) @b()
br label %11
11: ; preds = %3, %1
ret void
}