xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void __attribute__((noreturn)) version_exit(const char *prg) {
  printf("%s: Start a program if a terminal device is available, "
         "version %s\n",
         prg, "S390_TOOLS_RELEASE");
  printf("Copyright IBM Corp. 2010, 2017\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<version_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
lea    0xf05(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version_exit>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
lea    0xf01(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"%s: Start a program if a terminal device is available, version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@.str.2 = [32 x i8] c"Copyright IBM Corp. 2010, 2017\0A\00"
@EXIT_SUCCESS = global i32 0
define void @version_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str = [67 x i8] c"%s: Start a program if a terminal device is available, version %s\0A\00"
@.str.1 = [19 x i8] c"S390_TOOLS_RELEASE\00"
@EXIT_SUCCESS = global i32 0
@str = [31 x i8] c"Copyright IBM Corp. 2010, 2017\00"
define void @version_exit(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
long double __infer_nondet_long_double();
long double fmaxl(long double x, long double y) {
  return __infer_nondet_long_double();
}


x86 assembly (clang, -O0):
<fmaxl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
xor    %eax,%eax
call   1030 <__infer_nondet_long_double@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define x86_fp80 @fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @fmaxl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 (...) @__infer_nondet_long_double()
ret x86_fp80 %3
}
int do_op(int a, int b, int (*op)(int, int)) { return (*op)(a, b); }


x86 assembly (clang, -O0):
<do_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_op>:
jmp    *%rdx

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

LLVM IR (-O2):
define i32 @do_op(i32 %0, i32 %1, i32 (i32, i32)* nocapture %2) {
%4 = tail call i32 %2(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ nl();
void clrscr(void) {
  char n;
  for (n = 0; n < 24; n++)
    nl();
}


x86 assembly (clang, -O0):
<clrscr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x18,%eax
jge    113d <clrscr+0x2d>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <clrscr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
call   1030 <nl@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <nl@plt>

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

LLVM IR (-O2):
define void @clrscr() {
%1 = tail call i32 (...) @nl()
%2 = tail call i32 (...) @nl()
%3 = tail call i32 (...) @nl()
%4 = tail call i32 (...) @nl()
%5 = tail call i32 (...) @nl()
%6 = tail call i32 (...) @nl()
%7 = tail call i32 (...) @nl()
%8 = tail call i32 (...) @nl()
%9 = tail call i32 (...) @nl()
%10 = tail call i32 (...) @nl()
%11 = tail call i32 (...) @nl()
%12 = tail call i32 (...) @nl()
%13 = tail call i32 (...) @nl()
%14 = tail call i32 (...) @nl()
%15 = tail call i32 (...) @nl()
%16 = tail call i32 (...) @nl()
%17 = tail call i32 (...) @nl()
%18 = tail call i32 (...) @nl()
%19 = tail call i32 (...) @nl()
%20 = tail call i32 (...) @nl()
%21 = tail call i32 (...) @nl()
%22 = tail call i32 (...) @nl()
%23 = tail call i32 (...) @nl()
%24 = tail call i32 (...) @nl()
ret void
}
double foo(void) { return 0; }


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

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

LLVM IR (-O0):
define double @foo() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @foo() {
ret double 0.000000e+00
}
int test1(int a, int b) { return (a & b) | b; }


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

x86 assembly (clang, -O2):
<test1>:
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @test1(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 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = or i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 returned %1) {
ret i32 %1
}
void switch_off_bits(unsigned char *data, unsigned char bits_off) {
  char aux = 0xFF;
  aux ^= bits_off;
  *data &= aux;
}


x86 assembly (clang, -O0):
<switch_off_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movb   $0xff,-0xa(%rbp)
movzbl -0x9(%rbp),%ecx
movsbl -0xa(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_off_bits>:
not    %sil
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @switch_off_bits(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
store i8 -1, i8* %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = load i8, i8* %5
%9 = sext i8 %8 to i32
%10 = xor i32 %9, %7
%11 = trunc i32 %10 to i8
store i8 %11, i8* %5
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = and i32 %16, %13
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
ret void
}

LLVM IR (-O2):
define void @switch_off_bits(i8* nocapture %0, i8 zeroext %1) {
%3 = xor i8 %1, -1
%4 = load i8, i8* %0
%5 = and i8 %4, %3
store i8 %5, i8* %0
ret void
}
void gdk_cursor_new() {}


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

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

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

LLVM IR (-O2):
define void @gdk_cursor_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void ecrire_cr_binaire(FILE *fichier) {}


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

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

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

LLVM IR (-O2):
define void @ecrire_cr_binaire(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quicksort1(int *, int /*<<< orphan*/, int);
void qsort_web1(int *values, int n) { quicksort1(values, 0, n); }


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

x86 assembly (clang, -O2):
<qsort_web1>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <quicksort1@plt>

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

LLVM IR (-O2):
define void @qsort_web1(i32* %0, i32 %1) {
%3 = tail call i32 @quicksort1(i32* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
double stdlib_base_sqrt(float const);
float stdlib_base_rsqrtf(const float x) { return 1.0 / stdlib_base_sqrt(x); }


x86 assembly (clang, -O0):
<stdlib_base_rsqrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <stdlib_base_sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_rsqrtf>:
push   %rax
call   1030 <stdlib_base_sqrt@plt>
movsd  0xee2(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stdlib_base_rsqrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call double @stdlib_base_sqrt(float %3)
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @stdlib_base_rsqrtf(float %0) {
%2 = tail call double @stdlib_base_sqrt(float %0)
%3 = fdiv double 1.000000e+00, %2
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
unsigned char readByte(int);
unsigned int readInteger(int fd) {
  unsigned char high, low;
  high = readByte(fd);
  low = readByte(fd);
  return (high << 8) + low;
}


x86 assembly (clang, -O0):
<readInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readByte@plt>
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <readByte@plt>
mov    %al,-0x6(%rbp)
movzbl -0x5(%rbp),%eax
shl    $0x8,%eax
movzbl -0x6(%rbp),%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInteger>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <readByte@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <readByte@plt>
movzbl %bpl,%ecx
shl    $0x8,%ecx
movzbl %al,%eax
or     %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @readInteger(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call zeroext i8 @readByte(i32 %5)
store i8 %6, i8* %3
%7 = load i32, i32* %2
%8 = call zeroext i8 @readByte(i32 %7)
store i8 %8, i8* %4
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = add nsw i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @readInteger(i32 %0) {
%2 = tail call zeroext i8 @readByte(i32 %0)
%3 = tail call zeroext i8 @readByte(i32 %0)
%4 = zext i8 %2 to i32
%5 = shl nuw nsw i32 %4, 8
%6 = zext i8 %3 to i32
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
long bikoeff(int, int);
long k2(int m, int n) {
  if (m > n) {
    return -1;
  }
  return bikoeff(m, n);
}


x86 assembly (clang, -O0):
<k2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1137 <k2+0x27>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1146 <k2+0x36>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <bikoeff@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k2>:
cmp    %esi,%edi
jle    111c <k2+0xc>
mov    $0xffffffffffffffff,%rax
ret
jmp    1030 <bikoeff@plt>

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

LLVM IR (-O2):
define i64 @k2(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @bikoeff(i32 %0, i32 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ -1, %2 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prtime();
txt_metaeot() {
  prtime();
  printf("Meta event, end of track\n");
}


x86 assembly (clang, -O0):
<txt_metaeot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <prtime@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_metaeot>:
push   %rax
xor    %eax,%eax
call   1040 <prtime@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Meta event, end of track\0A\00"
define i32 @txt_metaeot() {
%1 = alloca i32
%2 = call i32 (...) @prtime()
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@str = [25 x i8] c"Meta event, end of track\00"
define i32 @txt_metaeot() {
%1 = tail call i32 (...) @prtime()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int SwapLong(int num) {
  return (((num >> 0) & 0xFF) << 24) + (((num >> 8) & 0xFF) << 16) +
         (((num >> 16) & 0xFF) << 8) + (((num >> 24) & 0xFF) << 0);
}


x86 assembly (clang, -O0):
<SwapLong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SwapLong(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fputsn(int, char *, int);
int print_to_base(int /*<<< orphan*/, char *, int);
int print_hex(int fd, uint64_t n) {
  int count;
  char buffer[128] = {0};
  count = print_to_base(n, buffer, 16);
  fputsn(fd, buffer, count);
  return count;
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x10,%edx
call   1050 <print_to_base@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <fputsn@plt>
mov    -0xc(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %edi,%ebx
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %esi,%edi
mov    %r14,%rsi
mov    $0x10,%edx
call   1040 <print_to_base@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <fputsn@plt>
mov    %ebp,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @print_hex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [128 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = bitcast [128 x i8]* %6 to i8*
%8 = load i32, i32* %4
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = call i32 @print_to_base(i32 %8, i8* %9, i32 16)
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* %5
%14 = call i32 @fputsn(i32 %11, i8* %12, i32 %13)
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @print_hex(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @print_to_base(i32 %1, i8* %4, i32 16)
%6 = call i32 @fputsn(i32 %0, i8* %4, i32 %5)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int, int, int /*<<< orphan*/);
void io_write_bus(uint16_t value) { write_word_data(0x20, 0x12, value); }


x86 assembly (clang, -O0):
<io_write_bus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x20,%edi
mov    $0x12,%esi
call   1030 <write_word_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_write_bus>:
mov    %edi,%edx
mov    $0x20,%edi
mov    $0x12,%esi
jmp    1030 <write_word_data@plt>

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

LLVM IR (-O2):
define void @io_write_bus(i32 %0) {
%2 = tail call i32 @write_word_data(i32 32, i32 18, i32 %0)
ret void
}
/* Variables and functions */
int getegid();
int geteuid();
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int, int, int);
void print_privs(void) {
  printf("UID: %d (%d)\nGID: %d (%d)\n", getuid(), geteuid(), getgid(),
         getegid());
}


x86 assembly (clang, -O0):
<print_privs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <getgid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1070 <getegid@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
mov    %eax,%r8d
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_privs>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <getgid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <getegid@plt>
lea    0xe82(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"UID: %d (%d)\0AGID: %d (%d)\0A\00"
define void @print_privs() {
%1 = call i32 (...) @getuid()
%2 = call i32 (...) @geteuid()
%3 = call i32 (...) @getgid()
%4 = call i32 (...) @getegid()
%5 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"UID: %d (%d)\0AGID: %d (%d)\0A\00"
define void @print_privs() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 (...) @getgid()
%4 = tail call i32 (...) @getegid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
void X509_EXTENSION_create_by_OBJ(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_EXTENSION_create_by_OBJ() {
ret void
}
double fabs(x)
double x;
{ return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Type definitions */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           unsigned int, unsigned int);
int /*<<< orphan*/ getPsFile(struct ADrawTag *);
void PsFilledCircle(struct ADrawTag *ctx, unsigned int x, unsigned int y,
                    unsigned int r) {
  fprintf(getPsFile(ctx),
          "newpath "
          "%d %d %d 0 360 arc "
          "closepath "
          "fill\n",
          x, -y, r);
}


x86 assembly (clang, -O0):
<PsFilledCircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getPsFile@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xead(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PsFilledCircle>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
call   1040 <getPsFile@plt>
neg    %ebp
lea    0xec7(%rip),%rsi
mov    %eax,%edi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
@.str = [43 x i8] c"newpath %d %d %d 0 360 arc closepath fill\0A\00"
define void @PsFilledCircle(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.ADrawTag*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.ADrawTag*, %struct.ADrawTag** %5
%10 = call i32 @getPsFile(%struct.ADrawTag* %9)
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = sub i32 0, %12
%14 = load i32, i32* %8
%15 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
@.str = [43 x i8] c"newpath %d %d %d 0 360 arc closepath fill\0A\00"
define void @PsFilledCircle(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @getPsFile(%struct.ADrawTag* %0)
%6 = sub i32 0, %2
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %6, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void print_version() {
  printf("tail %s\n", "0.0.1");
  printf("Written by Constantinos Georgiades\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"tail %s\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
@.str.2 = [36 x i8] c"Written by Constantinos Georgiades\0A\00"
@EXIT_SUCCESS = global i32 0
define void @print_version() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"tail %s\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
@EXIT_SUCCESS = global i32 0
@str = [35 x i8] c"Written by Constantinos Georgiades\00"
define void @print_version() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_storeu_si32(void *, int /*<<< orphan*/);
void test_mm_storeu_si32(void *A, __m128i B) { _mm_storeu_si32(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_storeu_si32>:
jmp    1030 <_mm_storeu_si32@plt>

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

LLVM IR (-O2):
define void @test_mm_storeu_si32(i8* %0, i32 %1) {
%3 = tail call i32 @_mm_storeu_si32(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(int);
int /*<<< orphan*/ IntUnregister(int);
void WatchdogIntUnregister(unsigned long ulBase) {
  ;
  IntDisable(34);
  IntUnregister(34);
}


x86 assembly (clang, -O0):
<WatchdogIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x22,%edi
call   1030 <IntDisable@plt>
mov    $0x22,%edi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogIntUnregister>:
push   %rax
mov    $0x22,%edi
call   1030 <IntDisable@plt>
mov    $0x22,%edi
pop    %rax
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @WatchdogIntUnregister(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @IntDisable(i32 34)
%4 = call i32 @IntUnregister(i32 34)
ret void
}

LLVM IR (-O2):
define void @WatchdogIntUnregister(i64 %0) {
%2 = tail call i32 @IntDisable(i32 34)
%3 = tail call i32 @IntUnregister(i32 34)
ret void
}
float y_step(unsigned int tp_y, unsigned int bp_y) {
  float step;
  step = (1023 - 0) / (bp_y - tp_y);
  return step;
}


x86 assembly (clang, -O0):
<y_step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %eax,%ecx
xor    %edx,%edx
mov    $0x3ff,%eax
div    %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<y_step>:
sub    %edi,%esi
mov    $0x3ff,%eax
xor    %edx,%edx
div    %esi
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @y_step(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub i32 %6, %7
%9 = udiv i32 1023, %8
%10 = uitofp i32 %9 to float
store float %10, float* %5
%11 = load float, float* %5
ret float %11
}

LLVM IR (-O2):
define float @y_step(i32 %0, i32 %1) {
%3 = sub i32 %1, %0
%4 = udiv i32 1023, %3
%5 = uitofp i32 %4 to float
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void user_func(int signum, siginfo_t *info, void *myact) {
  printf("receive signal %d\n\n\n", signum);
  sleep(5);
}


x86 assembly (clang, -O0):
<user_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<user_func>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"receive signal %d\0A\0A\0A\00"
define void @user_func(i32 %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @sleep(i32 5)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"receive signal %d\0A\0A\0A\00"
define void @user_func(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = tail call i32 @sleep(i32 5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int *b) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_attr_getdetachstate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pthread_attr_getdetachstate(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
int platform_initialize() { return 0; }


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

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

LLVM IR (-O0):
define i32 @platform_initialize() {
ret i32 0
}

LLVM IR (-O2):
define i32 @platform_initialize() {
ret i32 0
}
float sign(float x) {
  if (x < 0.0) {
    return -1.0;
  } else if (x > 0.0) {
    return 1.0;
  } else {
    return 0.0;
  }
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <sign+0x31>
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1161 <sign+0x61>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1159 <sign+0x59>
movss  0xeb1(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1161 <sign+0x61>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm0,%xmm2
movss  0xeed(%rip),%xmm3
andps  %xmm2,%xmm3
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andnps %xmm3,%xmm1
movss  0xedb(%rip),%xmm2
andps  %xmm2,%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sign(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float -1.000000e+00, float* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store float 1.000000e+00, float* %2
br label %14
13: ; preds = %8
store float 0.000000e+00, float* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @sign(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 0.000000e+00
%4 = select i1 %3, float 1.000000e+00, float 0.000000e+00
%5 = select i1 %2, float -1.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hello(void) {
  printf("Hello");
  return 1;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @hello() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
void foo671(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo671(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height;
  printf("\aI am %d years old.\n");
  printf("I am %d inches tall.\n", height);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"\07I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\07I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int is_palindrome(int, int);
void is_palindrome_test(void) {
  assert(is_palindrome(12344321, 10));
  assert(is_palindrome(1234321, 10));
  assert(is_palindrome(-1234321, 10));
  assert(!is_palindrome(12345321, 10));
}


x86 assembly (clang, -O0):
<is_palindrome_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbc5c01,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x12d591,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0xffed2a6f,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0xbc5fe9,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_palindrome_test>:
push   %rax
mov    $0xbc5c01,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0x12d591,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0xffed2a6f,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
mov    %eax,%edi
call   1040 <assert@plt>
mov    $0xbc5fe9,%edi
mov    $0xa,%esi
call   1030 <is_palindrome@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @is_palindrome_test() {
%1 = call i32 @is_palindrome(i32 12344321, i32 10)
%2 = call i32 @assert(i32 %1)
%3 = call i32 @is_palindrome(i32 1234321, i32 10)
%4 = call i32 @assert(i32 %3)
%5 = call i32 @is_palindrome(i32 -1234321, i32 10)
%6 = call i32 @assert(i32 %5)
%7 = call i32 @is_palindrome(i32 12345321, i32 10)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @is_palindrome_test() {
%1 = tail call i32 @is_palindrome(i32 12344321, i32 10)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @is_palindrome(i32 1234321, i32 10)
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @is_palindrome(i32 -1234321, i32 10)
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @is_palindrome(i32 12345321, i32 10)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
ret void
}
/* Variables and functions */
scalar_t__ niquery_set_qtype(int);
int niquery_option_ipv4_handler(int index, const char *arg) {
  if (niquery_set_qtype(4) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<niquery_option_ipv4_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <niquery_set_qtype@plt>
cmp    $0x0,%rax
jge    113f <niquery_option_ipv4_handler+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <niquery_option_ipv4_handler+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<niquery_option_ipv4_handler>:
push   %rax
mov    $0x4,%edi
call   1030 <niquery_set_qtype@plt>
sar    $0x3f,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @niquery_option_ipv4_handler(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i64 @niquery_set_qtype(i32 4)
%4 = ashr i64 %3, 63
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x0e() {
  Assert_real((isxdigit(14) == 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",
              75, ("isxdigit should be 0 for 0x0e"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x0e>:
push   %rax
mov    $0xe,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4b,%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 0x0e\00"
define void @t_isxdigit_0x0e() {
%1 = call i64 @isxdigit(i32 14)
%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 75, 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 0x0e\00"
define void @t_isxdigit_0x0e() {
%1 = tail call i64 @isxdigit(i32 14)
%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 75, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int isdigit(char);
int f_isdigit(char c) { return isdigit(c); }


x86 assembly (clang, -O0):
<f_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_isdigit>:
jmp    1030 <isdigit@plt>

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

LLVM IR (-O2):
define i32 @f_isdigit(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
ret i32 %2
}
void crashMe() {
  char *p = 0;
  *p = 'a';
}


x86 assembly (clang, -O0):
<crashMe>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @crashMe() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 97, i8* %2
ret void
}

LLVM IR (-O2):
max(aa, bb) int aa, bb;
{
  if (aa > bb)
    return (aa);
  else
    return (bb);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}