xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int label_ispointer(const uint8_t *label) {
  return (((*label) & 0xC0) == 0xC0);
}


x86 assembly (clang, -O0):
<label_ispointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xc0,%eax
cmp    $0xc0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_ispointer>:
mov    (%rdi),%ecx
not    %ecx
xor    %eax,%eax
test   $0xc0,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @label_ispointer(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 192
%6 = icmp eq i32 %5, 192
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @label_ispointer(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 192
%4 = icmp eq i32 %3, 192
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ dlock_lock(int /*<<< orphan*/ *, int /*<<< orphan*/);
int o_pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_self();
int pthread_mutex_lock(pthread_mutex_t *mutex) {
  dlock_lock(mutex, pthread_self());
  return o_pthread_mutex_lock(mutex);
}


x86 assembly (clang, -O0):
<pthread_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <dlock_lock@plt>
mov    -0x8(%rbp),%rdi
call   1030 <o_pthread_mutex_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutex_lock>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <dlock_lock@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <o_pthread_mutex_lock@plt>

LLVM IR (-O0):
define i32 @pthread_mutex_lock(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @dlock_lock(i32* %3, i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @o_pthread_mutex_lock(i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pthread_mutex_lock(i32* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @dlock_lock(i32* %0, i32 %2)
%4 = tail call i32 @o_pthread_mutex_lock(i32* %0)
ret i32 %4
}
void check_pos(int *j) {
  if (*j <= 0)
    *j = 1;
}


x86 assembly (clang, -O0):
<check_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jg     111f <check_pos+0x1f>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_pos>:
cmpl   $0x0,(%rdi)
jle    1106 <check_pos+0x6>
ret
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @check_pos(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 1, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/);
int ptys_open(char *pts_name) {
  int fds;
  if ((fds = open(pts_name, O_RDWR)) < 0)
    return (-5);
  return (fds);
}


x86 assembly (clang, -O0):
<ptys_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1146 <ptys_open+0x36>
movl   $0xfffffffb,-0x4(%rbp)
jmp    114c <ptys_open+0x3c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptys_open>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
test   %eax,%eax
mov    $0xfffffffb,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @ptys_open(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -5, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @ptys_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 -5, i32 %3
ret i32 %5
}
/* Variables and functions */
double fmod(double, double);
double __fmod(double x, double y) { return fmod(x, y); }


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

x86 assembly (clang, -O2):
<__fmod>:
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define double @__fmod(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 = call double @fmod(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__fmod(double %0, double %1) {
%3 = tail call double @fmod(double %0, double %1)
ret double %3
}
int t_abs(int x) {
  int s = x >> 31;
  return (x ^ s) + (s & 1);
}


x86 assembly (clang, -O0):
<t_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @t_abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = and i32 %9, 1
%11 = add nsw i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @t_abs(i32 %0) {
%2 = ashr i32 %0, 31
%3 = xor i32 %2, %0
%4 = and i32 %2, 1
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ReadWriteData(unsigned int);
void WriteData(unsigned int in_data) { ReadWriteData(in_data); }


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

x86 assembly (clang, -O2):
<WriteData>:
jmp    1030 <ReadWriteData@plt>

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

LLVM IR (-O2):
define void @WriteData(i32 %0) {
%2 = tail call i32 @ReadWriteData(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
int msleep(unsigned int ms) {
  usleep(ms * 1000);
  return 0;
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rax
imul   $0x3e8,%edi,%edi
call   1030 <usleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @msleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 0
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *wormParser(char *header) {
  return tokenParser(header, " \t\n;", 1, "wormParser");
}


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

x86 assembly (clang, -O2):
<wormParser>:
lea    0xee9(%rip),%rsi
lea    0xee7(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0A;\00"
@.str.1 = [11 x i8] c"wormParser\00"
define i8* @wormParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ei(void) { op_write1(0xfb); }


x86 assembly (clang, -O0):
<op_enc_ei>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfb,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_ei>:
mov    $0xfb,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ei() {
%1 = call i32 @op_write1(i32 251)
ret void
}

LLVM IR (-O2):
define void @op_enc_ei() {
%1 = tail call i32 @op_write1(i32 251)
ret void
}
main() {
  if (sizeof(long) == 4) {
    union {
      double d;
      unsigned long l[2];
    } x;
    x.d = 2.;
    if (x.l[0] == 0 && x.l[1] == (1UL << 30))
      printf("1\n");
    else if (x.l[1] == 0 && x.l[0] == (1UL << 30))
      printf("0\n");
    else
      printf("NOT IEEE (32 bit)\n");
  } else {
    union {
      double d;
      unsigned long l;
    } x;
    x.d = 2.;
    if (x.l == (1UL << 62))
      printf("-\n");
    else
      printf("NOT IEEE (64 bit)\n");
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movabs $0x4000000000000000,%rax
cmp    %rax,-0x10(%rbp)
jne    1163 <main+0x43>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <main+0x51>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%union.anon = type { double }
@.str = [3 x i8] c"-\0A\00"
@.str.1 = [19 x i8] c"NOT IEEE (64 bit)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.anon
store i32 0, i32* %1
%3 = bitcast %union.anon* %2 to double*
store double 2.000000e+00, double* %3
%4 = bitcast %union.anon* %2 to i64*
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 4611686018427387904
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
unreachable
}

LLVM IR (-O2):
@str = [2 x i8] c"-\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void hello() { fprintf(stderr, "hello\n"); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"hello\0A\00"
define void @hello() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"hello\0A\00"
define void @hello() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double _edotime_normalize_time(double);
double _edotime_offset_time(double t, double offset, int subtract) {
  double result;
  if (subtract)
    result = t - offset;
  else
    result = t + offset;
  result = _edotime_normalize_time(result);
  return result;
}


x86 assembly (clang, -O0):
<_edotime_offset_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1143 <_edotime_offset_time+0x33>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1152 <_edotime_offset_time+0x42>
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <_edotime_normalize_time@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_edotime_offset_time>:
test   %edi,%edi
je     111c <_edotime_offset_time+0xc>
xorpd  0xee4(%rip),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <_edotime_normalize_time@plt>

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

LLVM IR (-O2):
define double @_edotime_offset_time(double %0, double %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = fneg double %1
%6 = select i1 %4, double %1, double %5
%7 = fadd double %6, %0
%8 = tail call double @_edotime_normalize_time(double %7)
ret double %8
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ permutar(int /*<<< orphan*/, int, int *, int, int **);
long enum_permut(int n, int *v) {
  int fat = fatorial(n);
  int p[fat][n];
  permutar(0, n, v, fat, p);
}


x86 assembly (clang, -O0):
<enum_permut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <fatorial@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
mov    %rsp,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rcx,%rdx
imul   %rax,%rdx
lea    0xf(,%rdx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%r8
sub    %rdx,%r8
mov    %r8,%rsp
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %edi,%edi
call   1040 <permutar@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%rax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enum_permut>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
call   1030 <fatorial@plt>
mov    %eax,%ecx
mov    %ebx,%edx
imul   %rcx,%rdx
lea    0xf(,%rdx,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r8
sub    %rcx,%r8
mov    %r8,%rsp
xor    %edi,%edi
mov    %ebx,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1040 <permutar@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @enum_permut(i32 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %4
store i32* %1, i32** %5
%10 = load i32, i32* %4
%11 = call i32 @fatorial(i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
%14 = load i32, i32* %4
%15 = zext i32 %14 to i64
%16 = call i8* @llvm.stacksave()
store i8* %16, i8** %7
%17 = mul nuw i64 %13, %15
%18 = alloca i32, i64 %17
store i64 %13, i64* %8
store i64 %15, i64* %9
%19 = load i32, i32* %4
%20 = load i32*, i32** %5
%21 = load i32, i32* %6
%22 = bitcast i32* %18 to i32**
%23 = call i32 @permutar(i32 0, i32 %19, i32* %20, i32 %21, i32** %22)
%24 = load i8*, i8** %7
%25 = load i64, i64* %3
ret i64 %25
}

LLVM IR (-O2):
define i64 @enum_permut(i32 %0, i32* %1) {
%3 = tail call i32 @fatorial(i32 %0)
%4 = zext i32 %3 to i64
%5 = zext i32 %0 to i64
%6 = mul nuw i64 %4, %5
%7 = alloca i32, i64 %6
%8 = bitcast i32* %7 to i32**
%9 = call i32 @permutar(i32 0, i32 %0, i32* %1, i32 %3, i32** %8)
ret i64 undef
}
/* Variables and functions */
void *malloc(size_t);
void *avifAlloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<avifAlloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @avifAlloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int parent(int k) { return ((k + 1) / 2) - 1; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0x1,%eax
sar    %eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sdiv i32 %2, 2
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write_to_address(int, int);
void uart_init() {
  write_to_address(0x3F201044, 0x7FF);
  write_to_address(0x3F201024, 1);
  write_to_address(0x3F201028, 40);
  write_to_address(0x3F20102C, (1 << 4) | (1 << 5) | (1 << 6));
  write_to_address(0x3F201038, (1 << 1) | (1 << 4) | (1 << 5) | (1 << 6) |
                                   (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10));
  write_to_address(0x3F201030, (1 << 0) | (1 << 8) | (1 << 9));
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f201044,%edi
mov    $0x7ff,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201024,%edi
mov    $0x1,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201028,%edi
mov    $0x28,%esi
call   1030 <write_to_address@plt>
mov    $0x3f20102c,%edi
mov    $0x70,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201038,%edi
mov    $0x7f2,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201030,%edi
mov    $0x301,%esi
call   1030 <write_to_address@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
push   %rax
mov    $0x3f201044,%edi
mov    $0x7ff,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201024,%edi
mov    $0x1,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201028,%edi
mov    $0x28,%esi
call   1030 <write_to_address@plt>
mov    $0x3f20102c,%edi
mov    $0x70,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201038,%edi
mov    $0x7f2,%esi
call   1030 <write_to_address@plt>
mov    $0x3f201030,%edi
mov    $0x301,%esi
pop    %rax
jmp    1030 <write_to_address@plt>

LLVM IR (-O0):
define void @uart_init() {
%1 = call i32 @write_to_address(i32 1059065924, i32 2047)
%2 = call i32 @write_to_address(i32 1059065892, i32 1)
%3 = call i32 @write_to_address(i32 1059065896, i32 40)
%4 = call i32 @write_to_address(i32 1059065900, i32 112)
%5 = call i32 @write_to_address(i32 1059065912, i32 2034)
%6 = call i32 @write_to_address(i32 1059065904, i32 769)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
%1 = tail call i32 @write_to_address(i32 1059065924, i32 2047)
%2 = tail call i32 @write_to_address(i32 1059065892, i32 1)
%3 = tail call i32 @write_to_address(i32 1059065896, i32 40)
%4 = tail call i32 @write_to_address(i32 1059065900, i32 112)
%5 = tail call i32 @write_to_address(i32 1059065912, i32 2034)
%6 = tail call i32 @write_to_address(i32 1059065904, i32 769)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strncat(char *, char *, int);
void fatal(char *message) {
  char error_message[100];
  strcpy(error_message, "[!!] Fatal Error ");
  strncat(error_message, message, 83);
  perror(error_message);
  exit(-1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x53,%edx
call   1040 <strncat@plt>
lea    -0x70(%rbp),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
lea    0xeaf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x53,%edx
call   1040 <strncat@plt>
mov    %r14,%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"[!!] Fatal Error \00"
define void @fatal(i8* %0) {
%2 = alloca i8*
%3 = alloca [100 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @strncat(i8* %6, i8* %7, i32 83)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%10 = call i32 @perror(i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"[!!] Fatal Error \00"
define void @fatal(i8* %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @strncat(i8* %3, i8* %0, i32 83)
%6 = call i32 @perror(i8* %3)
%7 = call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    nrerror("allocation failure in vector()");
  return v - nl + 1;
}


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

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

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

LLVM IR (-O2):
@.str = [31 x i8] c"allocation failure in vector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nrerror(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
int /*<<< orphan*/ stderr;
void bye(const char *s, int i) {
  fprintf(stderr, "%s: %d\n", s, i);
  fflush(NULL);
  abort();
}


x86 assembly (clang, -O0):
<bye>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<bye>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %d\0A\00"
define void @bye(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @fflush(i32* null)
%10 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %d\0A\00"
define void @bye(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @fflush(i32* null)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ remap_pic();
void pic_init(void) { remap_pic(); }


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

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

LLVM IR (-O0):
define void @pic_init() {
%1 = call i32 (...) @remap_pic()
ret void
}

LLVM IR (-O2):
define void @pic_init() {
%1 = tail call i32 (...) @remap_pic()
ret void
}
int test_imm_6Bint64_highword_reg(long long val) {
  return ((val >> 32) & (0x6B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Bint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x6b,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Bint64_highword_reg>:
movabs $0x6b00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Bint64_highword_reg(i64 %0) {
%2 = and i64 %0, 459561500672
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long double u2ld(u)
unsigned int u;
{ return u; }


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

x86 assembly (clang, -O2):
<u2ld>:
mov    %edi,%eax
mov    %rax,-0x8(%rsp)
fildll -0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @u2ld(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = uitofp i32 %3 to x86_fp80
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @u2ld(i32 %0) {
%2 = uitofp i32 %0 to x86_fp80
ret x86_fp80 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void PerformanceAPI_SetCurrentThreadName_N(const char *inThreadName,
                                           uint16_t inThreadNameLength) {}


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

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

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

LLVM IR (-O2):
define void @PerformanceAPI_SetCurrentThreadName_N(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int arrayToUIntBE(unsigned char *, int);
int extractTotalLength(unsigned char *buff) { return arrayToUIntBE(buff, 2); }


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

x86 assembly (clang, -O2):
<extractTotalLength>:
mov    $0x2,%esi
jmp    1030 <arrayToUIntBE@plt>

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

LLVM IR (-O2):
define i32 @extractTotalLength(i8* %0) {
%2 = tail call i32 @arrayToUIntBE(i8* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int read_dobldobl_start_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(763, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<read_dobldobl_start_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2fb,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dobldobl_start_Laurent_system>:
mov    $0x2fb,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @read_dobldobl_start_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 763, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_dobldobl_start_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 763, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int index(int z, int y, int x) { return z * 512 * 512 + y * 512 + x; }


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x9,%eax
shl    $0x9,%eax
mov    -0x8(%rbp),%ecx
shl    $0x9,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
shl    $0x12,%edi
shl    $0x9,%esi
lea    (%rsi,%rdi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @index(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* %4
%8 = mul nsw i32 %7, 512
%9 = mul nsw i32 %8, 512
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 512
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @index(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %0, 18
%5 = shl nsw i32 %1, 9
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void err(const char *err_msg, int fatal) {
  fprintf(stderr, err_msg);
  if (fatal) {
    exit(fatal);
  }
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     1153 <err+0x33>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    113a <err+0x1a>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @err(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* %6)
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @err(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* %0)
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @exit(i32 %1)
unreachable
8: ; preds = %2
ret void
}
void termop_whatareyou(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      446, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_whatareyou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1be,%r8d
lea    0xf37(%rip),%r9
lea    0xf42(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_whatareyou>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf69(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1be,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_whatareyou = [18 x i8] c"termop_whatareyou\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_whatareyou(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 446, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.termop_whatareyou, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_whatareyou = [18 x i8] c"termop_whatareyou\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_whatareyou(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 446, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.termop_whatareyou, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
int test_imm_B0uint32_reg(unsigned int val) {
  return ((val) & (0xB0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B0uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xb0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B0uint32_reg(i32 %0) {
%2 = and i32 %0, 176
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ l;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, long *, int);
float fb_CVSFROML(long l) {
  do {
    if ((4) == sizeof(l) && (4) == sizeof(float)) {
      float to;
      memcpy(&to, &l, 4);
      return to;
    } else {
      return (float)0;
    }
  } while (0);
}


x86 assembly (clang, -O0):
<fb_CVSFROML>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    110d <fb_CVSFROML+0xd>
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_CVSFROML>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @fb_CVSFROML(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @fb_CVSFROML(i64 %0) {
ret float 0.000000e+00
}
void __sharc_thread_init(void) {}


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

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

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

LLVM IR (-O2):
define void @__sharc_thread_init() {
ret void
}
unsigned int __member_hash_index(void *key) {
  unsigned int gid = (unsigned int)key;
  return ((gid >> 16) & 0x0000FFFF) - 1;
}


x86 assembly (clang, -O0):
<__member_hash_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xffff,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__member_hash_index>:
shr    $0x10,%edi
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @__member_hash_index(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = lshr i32 %6, 16
%8 = and i32 %7, 65535
%9 = sub i32 %8, 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @__member_hash_index(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i32 %3, 16
%5 = add nsw i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ log_write(int, char *, char *, char *, char const *);
void log_signal(const char *signame) {
  log_write(0x00008000, "SIG", "CATCH", "Caught signal %s", signame);
}


x86 assembly (clang, -O0):
<log_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
mov    $0x8000,%edi
lea    0xed4(%rip),%rsi
lea    0xed1(%rip),%rdx
lea    0xed0(%rip),%rcx
call   1030 <log_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_signal>:
mov    %rdi,%r8
lea    0xee6(%rip),%rsi
lea    0xee3(%rip),%rdx
lea    0xee2(%rip),%rcx
mov    $0x8000,%edi
jmp    1030 <log_write@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"SIG\00"
@.str.1 = [6 x i8] c"CATCH\00"
@.str.2 = [17 x i8] c"Caught signal %s\00"
define void @log_signal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_write(i32 32768, 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), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"SIG\00"
@.str.1 = [6 x i8] c"CATCH\00"
@.str.2 = [17 x i8] c"Caught signal %s\00"
define void @log_signal(i8* %0) {
%2 = tail call i32 @log_write(i32 32768, 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), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n))
    if (n == 42)
      break;
    else
      printf("%d\n", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     116c <main+0x4c>
cmpl   $0x2a,-0x8(%rbp)
jne    1158 <main+0x38>
jmp    116c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1181 <main+0x61>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     1181 <main+0x61>
lea    0xeb4(%rip),%r14
lea    0xeaa(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1181 <main+0x61>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 42
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %13, %8 ], [ %5, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%12 = icmp eq i64 %11, 0
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 42
%15 = select i1 %12, i1 true, i1 %14
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xfb() {
  Assert_real((isxdigit(251) == 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_isxdigit.c",
              1260, ("isxdigit should be 0 for 0xfb"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xfb>:
push   %rax
mov    $0xfb,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4ec,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xfb\00"
define void @t_isxdigit_0xfb() {
%1 = call i64 @isxdigit(i32 251)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1260, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xfb\00"
define void @t_isxdigit_0xfb() {
%1 = tail call i64 @isxdigit(i32 251)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1260, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int errno;
int __get_errno() { return errno; }


x86 assembly (clang, -O0):
<__get_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_errno>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @__get_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @__get_errno() {
%1 = load i32, i32* @errno
ret i32 %1
}