xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void fatal(char *msg) {
  printf(msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @fatal(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
char getchar();
void cleartoendofline(void) {
  char ch;
  ch = getchar();
  while (ch != '\n')
    ch = getchar();
}


x86 assembly (clang, -O0):
<cleartoendofline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     113e <cleartoendofline+0x2e>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
jmp    1122 <cleartoendofline+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleartoendofline>:
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 <cleartoendofline+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @cleartoendofline() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3, %0
ret void
}
int one(void) { return -30; }


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

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

LLVM IR (-O0):
define i32 @one() {
ret i32 -30
}

LLVM IR (-O2):
define i32 @one() {
ret i32 -30
}
unsigned long get_fs(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_fs() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_fs() {
ret i64 0
}
/* Variables and functions */
int shm_unlink(char const *);
int sem_unlink(const char *name) { return shm_unlink(name); }


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

x86 assembly (clang, -O2):
<sem_unlink>:
jmp    1030 <shm_unlink@plt>

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

LLVM IR (-O2):
define i32 @sem_unlink(i8* %0) {
%2 = tail call i32 @shm_unlink(i8* %0)
ret i32 %2
}
int cmp(const void *lhs, const void *rhs) {
  double left = *((double *)lhs);
  double right = *((double *)rhs);
  double diff = left - right;
  if (diff < 0)
    return -1;
  else if (diff > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    114f <cmp+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <cmp+0x74>
movsd  -0x30(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    116d <cmp+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1174 <cmp+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to double*
%14 = load double, double* %13
store double %14, double* %7
%15 = load double, double* %6
%16 = load double, double* %7
%17 = fsub double %15, %16
store double %17, double* %8
%18 = load double, double* %8
%19 = fcmp olt double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %2
store i32 -1, i32* %3
br label %26
21: ; preds = %2
%22 = load double, double* %8
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %3
br label %26
25: ; preds = %21
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fcmp ogt double %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
int addOne(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<addOne>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addOne(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @addOne(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int move_to_position(int motor, int speed, long goal_pos) {}


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

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

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

LLVM IR (-O2):
define i32 @move_to_position(i32 %0, i32 %1, i64 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main() {
  int i;
  for (i = 0; i < 1000; i++)
    test();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x0,%al
call   1030 <test@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <test@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @test()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 1000
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int strncmp(char *, char *, int);
void strncmp_diff_length_5() {
  char *x = "012";
  char *y = "12345";
  if (strncmp(x, y, 3) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_diff_length_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncmp_diff_length_5+0x39>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_5>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"012\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_5() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncmp(i8* %3, i8* %4, i32 3)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"012\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_5() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
char *lmalloc(scalar_t__);
int /*<<< orphan*/ strlcpy(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *lstrdup(const char *in) {
  char *out = lmalloc(strlen(in) + 1);
  strlcpy(out, in, strlen(in) + 1);
  return out;
}


x86 assembly (clang, -O0):
<lstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <lmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1050 <strlcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @lstrdup(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* @lmalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @strlcpy(i8* %8, i8* %9, i64 %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @lstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @lmalloc(i64 %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add nsw i64 %5, 1
%7 = tail call i32 @strlcpy(i8* %4, i8* %0, i64 %6)
ret i8* %4
}
/* Variables and functions */
int increment(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i = 1, j = 2;
  printf("i is %d \n", increment(i));
  printf("j is %d", increment(j));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <increment@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <increment@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"i is %d \0A\00"
@.str.1 = [8 x i8] c"j is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @increment(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @increment(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"i is %d \0A\00"
@.str.1 = [8 x i8] c"j is %d\00"
define i32 @main() {
%1 = tail call i32 @increment(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @increment(i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
void __attribute__((section(".fini"))) func(void) {}


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


x86 assembly (clang, -O2):
<func>:
ret
add    $0x8,%rsp
ret


LLVM IR (-O0):
define void @func() section ".fini" {
ret void
}

LLVM IR (-O2):
define void @func() section ".fini" {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int peekc(FILE *f) {
  int c = getc(f);
  if (c != EOF)
    ungetc(c, f);
  return c;
}


x86 assembly (clang, -O0):
<peekc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
je     1156 <peekc+0x36>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peekc>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    %eax,%ebp
mov    0x2eb4(%rip),%rax
cmp    (%rax),%ebp
je     1142 <peekc+0x22>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @peekc(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @ungetc(i32 %2, i32* %0)
br label %7
7: ; preds = %5, %1
ret i32 %2
}
unsigned invert(unsigned x, int p, int n) {
  return (~((~(~0 << n) & (x >> (p + 1 - n))) << (p + 1 - n))) &
         (((~(~0 << n)) << (p + 1 - n)) | x);
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     -0x4(%rbp),%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
mov    %edi,%edx
shr    %cl,%edx
and    %eax,%edx
shl    %cl,%edx
shl    %cl,%eax
not    %edx
or     %edi,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = shl i32 -1, %7
%9 = xor i32 %8, -1
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = lshr i32 %10, %14
%16 = and i32 %9, %15
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
%21 = shl i32 %16, %20
%22 = xor i32 %21, -1
%23 = load i32, i32* %6
%24 = shl i32 -1, %23
%25 = xor i32 %24, -1
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
%28 = load i32, i32* %6
%29 = sub nsw i32 %27, %28
%30 = shl i32 %25, %29
%31 = load i32, i32* %4
%32 = or i32 %30, %31
%33 = and i32 %22, %32
ret i32 %33
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %1, 1
%7 = sub i32 %6, %2
%8 = lshr i32 %0, %7
%9 = and i32 %8, %5
%10 = shl i32 %9, %7
%11 = xor i32 %10, -1
%12 = shl i32 %5, %7
%13 = or i32 %12, %0
%14 = and i32 %13, %11
ret i32 %14
}
XUngrabKey() {}


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

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

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

LLVM IR (-O2):
define i32 @XUngrabKey() {
ret i32 undef
}
unsigned f(unsigned x, unsigned y) { return (x | y) & ~x; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = and i32 %3, %1
ret i32 %4
}
/* Type definitions */
struct hashEl {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freez(struct hashEl **);
void hashElFree(struct hashEl **pEl) { freez(pEl); }


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

x86 assembly (clang, -O2):
<hashElFree>:
jmp    1030 <freez@plt>

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

LLVM IR (-O2):
%struct.hashEl = type { i32 }
define void @hashElFree(%struct.hashEl** %0) {
%2 = tail call i32 @freez(%struct.hashEl** %0)
ret void
}
float cos_52s(float x) {
  static const float c1 = 0.9999932946;
  static const float c2 = -0.4999124376;
  static const float c3 = 0.0414877472;
  static const float c4 = -0.0012712095;
  float x2;
  x2 = x * x;
  return (c1 + x2 * (c2 + x2 * (c3 + c4 * x2)));
}


x86 assembly (clang, -O0):
<cos_52s>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movss  0xed9(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0xed1(%rip),%xmm3
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xeb9(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  0xea5(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_52s>:
mulss  %xmm0,%xmm0
movss  0xef4(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xeec(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xee4(%rip),%xmm1
mulss  %xmm1,%xmm0
addss  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
@cos_52s.c1 = internal constant float 0x3FEFFFF200000000
@cos_52s.c2 = internal constant float 0xBFDFFE90C0000000
@cos_52s.c3 = internal constant float 0x3FA53DE1C0000000
@cos_52s.c4 = internal constant float 0xBF54D3D6C0000000
define float @cos_52s(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = load float, float* %3
%10 = call float @llvm.fmuladd.f32(float 0xBF54D3D6C0000000, float %9, float 0x3FA53DE1C0000000)
%11 = call float @llvm.fmuladd.f32(float %8, float %10, float 0xBFDFFE90C0000000)
%12 = call float @llvm.fmuladd.f32(float %7, float %11, float 0x3FEFFFF200000000)
ret float %12
}

LLVM IR (-O2):
define float @cos_52s(float %0) {
%2 = fmul float %0, %0
%3 = tail call float @llvm.fmuladd.f32(float %2, float 0xBF54D3D6C0000000, float 0x3FA53DE1C0000000)
%4 = tail call float @llvm.fmuladd.f32(float %2, float %3, float 0xBFDFFE90C0000000)
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float 0x3FEFFFF200000000)
ret float %5
}
int f_le_mr2(float *a1, float a2) { return !(((*a1) <= (a2))); }


x86 assembly (clang, -O0):
<f_le_mr2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_le_mr2>:
xor    %eax,%eax
ucomiss (%rdi),%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @f_le_mr2(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = load float, float* %4
%8 = fcmp ole float %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f_le_mr2(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fcmp ugt float %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
char test_64_0(char *mem) { return __atomic_fetch_nand(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_64_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
and    %sil,%dl
mov    %dl,-0x1a(%rbp)
not    %dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114f <test_64_0+0x4f>
jmp    111f <test_64_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_64_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
or     $0xfe,%cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_64_0+0x10>
ret

LLVM IR (-O0):
define signext i8 @test_64_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw nand i8* %6, i8 %7 acq_rel
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @test_64_0(i8* nocapture %0) {
%2 = atomicrmw nand i8* %0, i8 1 acq_rel
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xe9() {
  Assert_real((isprint(233) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              1170, ("isprint should be 0 for 0xe9"));
}


x86 assembly (clang, -O0):
<t_isprint_0xe9>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe9,%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x492,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0xe9>:
push   %rax
mov    $0xe9,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x492,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe9\00"
define void @t_isprint_0xe9() {
%1 = call i64 @isprint(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xe9\00"
define void @t_isprint_0xe9() {
%1 = tail call i64 @isprint(i32 233)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *malloc(int);
int rand();
int *make_array(int size) {
  int *arr = malloc(size * sizeof(int));
  int i;
  for (i = 0; i < size; i++) {
    arr[i] = rand() % size;
  }
  return arr;
}


x86 assembly (clang, -O0):
<make_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1175 <make_array+0x55>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <make_array+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x0(,%r14,4),%edi
call   1030 <malloc@plt>
mov    %rax,%r15
test   %r14d,%r14d
jle    1168 <make_array+0x48>
mov    %r14d,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %r14d
mov    %edx,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <make_array+0x30>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i32* @make_array(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %0
%11 = getelementptr inbounds i32, i32* %3, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void server_cleanup(void *arg) {
  int i;
  printf("cleaning up ressources allocated by server thread: %s\n",
         (char *)arg);
  for (i = 0; i < 50; i++)
    printf("this is clean function %d\n", i);
}


x86 assembly (clang, -O0):
<server_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    115e <server_cleanup+0x4e>
mov    -0xc(%rbp),%esi
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <server_cleanup+0x25>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_cleanup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf0c(%rip),%rbx
xor    %ebp,%ebp
nopl   (%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x32,%ebp
jne    1130 <server_cleanup+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [55 x i8] c"cleaning up ressources allocated by server thread: %s\0A\00"
@.str.1 = [27 x i8] c"this is clean function %d\0A\00"
define void @server_cleanup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
store i32 0, i32* %3
br label %6
6: ; preds = %12, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 50
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"cleaning up ressources allocated by server thread: %s\0A\00"
@.str.1 = [27 x i8] c"this is clean function %d\0A\00"
define void @server_cleanup(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 50
br i1 %7, label %8, label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
void Sys_FindClose(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_FindClose() {
ret void
}
unsigned fftw_hash(const char *s) {
  unsigned h = 0xDEADBEEFu;
  do {
    h = h * 17 + (int)*s;
  } while (*s++);
  return h;
}


x86 assembly (clang, -O0):
<fftw_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xdeadbeef,-0xc(%rbp)
imul   $0x11,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    110f <fftw_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftw_hash>:
mov    $0xdeadbeef,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,%ecx
shl    $0x4,%ecx
add    %ecx,%eax
movsbl (%rdi),%ecx
add    %ecx,%eax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <fftw_hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @fftw_hash(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %9, %2 ]
%4 = phi i32 [ -559038737, %1 ], [ %8, %2 ]
%5 = mul i32 %4, 17
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = add i32 %5, %7
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = icmp eq i8 %6, 0
br i1 %10, label %11, label %2
11: ; preds = %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *xmalloc(size_t size) {
  register void *result = malloc(size);
  if (result == NULL) {
    die("Out of memory (malloc)\n");
  }
  return result;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Out of memory (malloc)\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [24 x i8] c"Out of memory (malloc)\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int setreuid(int, int /*<<< orphan*/);
int seteuid(uid_t euid) { return setreuid(-1, euid); }


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

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

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

LLVM IR (-O2):
define i32 @seteuid(i32 %0) {
%2 = tail call i32 @setreuid(i32 -1, i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rtp_set_marker(uint8_t *p_rtp) { p_rtp[1] |= 0x80; }


x86 assembly (clang, -O0):
<rtp_set_marker>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtp_set_marker>:
orb    $0x80,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rtp_set_marker(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @rtp_set_marker(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = or i32 %3, 128
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_bzfree(void *opaque, void *addr) {
  if (addr != NULL)
    free(addr);
}


x86 assembly (clang, -O0):
<default_bzfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1134 <default_bzfree+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_bzfree>:
test   %rsi,%rsi
je     111d <default_bzfree+0xd>
mov    %rsi,%rdi
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @default_bzfree(i8* nocapture readnone %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
void unsigned_char_shl_signed_char_signed_int(unsigned char *LHS,
                                              signed int RHS) {
  (*LHS) <<= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_shl_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
shl    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_shl_signed_char_signed_int>:
mov    %esi,%ecx
movzbl (%rdi),%eax
shl    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_shl_signed_char_signed_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @unsigned_char_shl_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = shl i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
scalar_t__ fwrite(char const *, int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char const *);
int fputs(const char *s, FILE *stream) {
  int ret = 1;
  ret += fwrite(s, strlen(s), 1, stream);
  fputc('\n', stream);
  return ret;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <fwrite@plt>
mov    %rax,%rbx
add    $0x1,%ebx
mov    $0xa,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputs(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 1, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i32*, i32** %4
%10 = call i64 @fwrite(i8* %6, i32 %8, i32 1, i32* %9)
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %5
%15 = load i32*, i32** %4
%16 = call i32 @fputc(i8 signext 10, i32* %15)
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @fputs(i8* %0, i32* nocapture %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @fwrite(i8* %0, i32 %3, i32 1, i32* %1)
%5 = trunc i64 %4 to i32
%6 = add i32 %5, 1
%7 = tail call i32 @fputc(i8 signext 10, i32* %1)
ret i32 %6
}
void stop_hz_timer(void) {}


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

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

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

LLVM IR (-O2):
define void @stop_hz_timer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *, char *);
void gen_program_end() { print("M2", "end program"); }


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

x86 assembly (clang, -O2):
<gen_program_end>:
lea    0xee9(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"M2\00"
@.str.1 = [12 x i8] c"end program\00"
define void @gen_program_end() {
%1 = call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"M2\00"
@.str.1 = [12 x i8] c"end program\00"
define void @gen_program_end() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
void do_backtrace(void) { free(malloc(123)); }


x86 assembly (clang, -O0):
<do_backtrace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7b,%edi
call   1040 <malloc@plt>
mov    %eax,%edi
call   1030 <free@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_backtrace>:
push   %rax
mov    $0x7b,%edi
call   1040 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @do_backtrace() {
%1 = call i32 @malloc(i32 123)
%2 = call i32 @free(i32 %1)
ret void
}

LLVM IR (-O2):
define void @do_backtrace() {
%1 = tail call i32 @malloc(i32 123)
%2 = tail call i32 @free(i32 %1)
ret void
}
unsigned int la_version(unsigned int version) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @la_version(i32 %0) {
ret i32 1
}
void ls_costN_nm7_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm7_incref() {
ret void
}
void gui_info(char *format, ...) {}


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

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

LLVM IR (-O0):
define void @gui_info(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @gui_info(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ strstr(char *, char *);
wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2) {
  return (wchar_t *)strstr((char *)s1, (char *)s2);
}


x86 assembly (clang, -O0):
<wcsstr>:
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 <strstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsstr>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i32* @wcsstr(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 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = call i64 @strstr(i8* %6, i8* %8)
%10 = inttoptr i64 %9 to i32*
ret i32* %10
}

LLVM IR (-O2):
define i32* @wcsstr(i32* %0, i32* %1) {
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i64 @strstr(i8* %3, i8* %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void logger(void *fail, bool error, const char *fmt, va_list ap) {
  *((bool *)fail) = true;
  (void)error;
  vfprintf(stderr, fmt, ap);
  fputc('\n', stderr);
}


x86 assembly (clang, -O0):
<logger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <vfprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger>:
push   %rbx
movl   $0x1,(%rdi)
mov    0x2eb2(%rip),%rbx
mov    (%rbx),%edi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1040 <vfprintf@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
pop    %rbx
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @logger(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
store i32 1, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @vfprintf(i32 %12, i8* %13, i32 %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fputc(i8 signext 10, i32 %16)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @logger(i8* nocapture writeonly %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8* %0 to i32*
store i32 1, i32* %5
%6 = load i32, i32* @stderr
%7 = tail call i32 @vfprintf(i32 %6, i8* %2, i32 %3)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputc(i8 signext 10, i32 %8)
ret void
}