xunge/DecIR huggingface dataset:
void rotate(double *a, double *b, double *c) {
  double temp;
  temp = *a;
  *a = *b;
  *b = *c;
  *c = temp;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  (%rdx),%xmm1
movsd  %xmm1,(%rsi)
movsd  %xmm0,(%rdx)
ret

LLVM IR (-O0):
define void @rotate(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%8 = load double*, double** %4
%9 = load double, double* %8
store double %9, double* %7
%10 = load double*, double** %5
%11 = load double, double* %10
%12 = load double*, double** %4
store double %11, double* %12
%13 = load double*, double** %6
%14 = load double, double* %13
%15 = load double*, double** %5
store double %14, double* %15
%16 = load double, double* %7
%17 = load double*, double** %6
store double %16, double* %17
ret void
}

LLVM IR (-O2):
define void @rotate(double* nocapture %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %0
%5 = load double, double* %1
store double %5, double* %0
%6 = load double, double* %2
store double %6, double* %1
store double %4, double* %2
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
unsigned long hash_fd(const pid_t pid, const int fd) {
  unsigned long h;
  unsigned long lpid = (unsigned long)pid;
  h = (lpid ^ (lpid << 3) ^ fd) % (1997);
  return h;
}


x86 assembly (clang, -O0):
<hash_fd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x20(%rbp),%rcx
shl    $0x3,%rcx
xor    %rcx,%rax
movslq -0xc(%rbp),%rcx
xor    %rcx,%rax
mov    $0x7cd,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_fd>:
lea    0x0(,%rdi,8),%rax
xor    %rdi,%rax
movslq %esi,%rcx
xor    %rax,%rcx
movabs $0x689adb3574c87e3,%rdx
ad 89 06
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0xa,%rax
imul   $0x7cd,%rax,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @hash_fd(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%7 = load i64, i64* %3
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = load i64, i64* %6
%10 = shl i64 %9, 3
%11 = xor i64 %8, %10
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = xor i64 %11, %13
%15 = urem i64 %14, 1997
store i64 %15, i64* %5
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @hash_fd(i64 %0, i32 %1) {
%3 = shl i64 %0, 3
%4 = xor i64 %3, %0
%5 = sext i32 %1 to i64
%6 = xor i64 %4, %5
%7 = urem i64 %6, 1997
ret i64 %7
}
float quarticEaseInOutf(float p) {
  if (p < 0.5) {
    return 8 * p * p * p * p;
  } else {
    float f = (p - 1);
    return -8 * f * f * f * f + 1;
  }
}


x86 assembly (clang, -O0):
<quarticEaseInOutf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    114a <quarticEaseInOutf+0x4a>
movss  0xee4(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1191 <quarticEaseInOutf+0x91>
movss  -0x8(%rbp),%xmm0
movss  0xeb1(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xea4(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe80(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<quarticEaseInOutf>:
movss  0xef8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <quarticEaseInOutf+0x29>
movss  0xefb(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret
addss  0xed3(%rip),%xmm0
movss  0xecf(%rip),%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
addss  0xebb(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @quarticEaseInOutf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = fcmp olt double %6, 5.000000e-01
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load float, float* %3
%10 = fmul float 8.000000e+00, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = load float, float* %3
%16 = fmul float %14, %15
store float %16, float* %2
br label %28
17: ; preds = %1
%18 = load float, float* %3
%19 = fsub float %18, 1.000000e+00
store float %19, float* %4
%20 = load float, float* %4
%21 = fmul float -8.000000e+00, %20
%22 = load float, float* %4
%23 = fmul float %21, %22
%24 = load float, float* %4
%25 = fmul float %23, %24
%26 = load float, float* %4
%27 = call float @llvm.fmuladd.f32(float %25, float %26, float 1.000000e+00)
store float %27, float* %2
br label %28
28: ; preds = %17, %8
%29 = load float, float* %2
ret float %29
}

LLVM IR (-O2):
define float @quarticEaseInOutf(float %0) {
%2 = fcmp olt float %0, 5.000000e-01
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fmul float %0, 8.000000e+00
%5 = fmul float %4, %0
%6 = fmul float %5, %0
%7 = fmul float %6, %0
br label %14
8: ; preds = %1
%9 = fadd float %0, -1.000000e+00
%10 = fmul float %9, -8.000000e+00
%11 = fmul float %9, %10
%12 = fmul float %9, %11
%13 = tail call float @llvm.fmuladd.f32(float %12, float %9, float 1.000000e+00)
br label %14
14: ; preds = %8, %3
%15 = phi float [ %7, %3 ], [ %13, %8 ]
ret float %15
}
/* Variables and functions */
int /*<<< orphan*/ mx_set_clear_imap_bit(int, int, int);
void mx_set_imap_bit(int device, int i) { mx_set_clear_imap_bit(device, i, 1); }


x86 assembly (clang, -O0):
<mx_set_imap_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <mx_set_clear_imap_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mx_set_imap_bit>:
mov    $0x1,%edx
jmp    1030 <mx_set_clear_imap_bit@plt>

LLVM IR (-O0):
define void @mx_set_imap_bit(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 @mx_set_clear_imap_bit(i32 %5, i32 %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @mx_set_imap_bit(i32 %0, i32 %1) {
%3 = tail call i32 @mx_set_clear_imap_bit(i32 %0, i32 %1, i32 1)
ret void
}
void im_a_minion_01(void) {}


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

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

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

LLVM IR (-O2):
define void @im_a_minion_01() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
unsigned c_strlen(const char *sptr) { return (unsigned)strlen(sptr); }


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

x86 assembly (clang, -O2):
<c_strlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @c_strlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
int test_option_d(int x) { return !!(~x & 0xFF); }


x86 assembly (clang, -O0):
<test_option_d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_option_d>:
xor    %eax,%eax
cmp    $0xff,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @test_option_d(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, -1
%5 = and i32 %4, 255
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_option_d(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ne i32 %2, 255
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *arg0) {
  printf("Garmin IMG/ADM Splitter, (c) 2013 by Bernhard R. Fischer, "
         "<bf@abenteuerland.at>\n"
         "usage: %s [OPTIONS]\n"
         "   -d <dir> ..... Directory to extract files to.\n",
         arg0);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [150 x i8] c"Garmin IMG/ADM Splitter, (c) 2013 by Bernhard R. Fischer, <bf@abenteuerland.at>\0Ausage: %s [OPTIONS]\0A -d <dir> ..... Directory to extract files to.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [150 x i8] c"Garmin IMG/ADM Splitter, (c) 2013 by Bernhard R. Fischer, <bf@abenteuerland.at>\0Ausage: %s [OPTIONS]\0A -d <dir> ..... Directory to extract files to.\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int my_is_prime(int nombre) {
  int i;
  if (nombre < 0 || nombre == 0 || nombre == 1)
    return (0);
  for (i = 2; i < nombre; i++) {
    if (nombre % i == 0)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1125 <my_is_prime+0x25>
cmpl   $0x0,-0x8(%rbp)
je     1125 <my_is_prime+0x25>
cmpl   $0x1,-0x8(%rbp)
jne    1131 <my_is_prime+0x31>
movl   $0x0,-0x4(%rbp)
jmp    117a <my_is_prime+0x7a>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1173 <my_is_prime+0x73>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1160 <my_is_prime+0x60>
movl   $0x0,-0x4(%rbp)
jmp    117a <my_is_prime+0x7a>
jmp    1165 <my_is_prime+0x65>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <my_is_prime+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <my_is_prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <my_is_prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <my_is_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <my_is_prime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @my_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
void flipEndian(unsigned char *x, int length) { return; }


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

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

LLVM IR (-O0):
define void @flipEndian(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 @flipEndian(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ potential(int, double *, double *, double *, double *);
void potential_(int ndim, double *pos, double *acc, double *pot, double *time) {
  potential(ndim, pos, acc, pot, time);
}


x86 assembly (clang, -O0):
<potential_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <potential@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<potential_>:
jmp    1030 <potential@plt>

LLVM IR (-O0):
define void @potential_(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load i32, i32* %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load double*, double** %9
%15 = load double*, double** %10
%16 = call i32 @potential(i32 %11, double* %12, double* %13, double* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @potential_(i32 %0, double* %1, double* %2, double* %3, double* %4) {
%6 = tail call i32 @potential(i32 %0, double* %1, double* %2, double* %3, double* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ gluOrtho2D(int, int, int, int);
void init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  gluOrtho2D(-200, 200, -200, 200);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    $0xffffff38,%edx
mov    $0xc8,%ecx
mov    %edx,%edi
mov    %ecx,%esi
call   1040 <gluOrtho2D@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    $0xffffff38,%edi
mov    $0xc8,%esi
mov    $0xffffff38,%edx
mov    $0xc8,%ecx
pop    %rax
jmp    1040 <gluOrtho2D@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = call i32 @gluOrtho2D(i32 -200, i32 200, i32 -200, i32 200)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 @gluOrtho2D(i32 -200, i32 200, i32 -200, i32 200)
ret void
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int xdialogPresent() {
  static int lXdialogPresent = -1;
  if (lXdialogPresent < 0) {
    lXdialogPresent = detectPresence("Xdialog");
  }
  return lXdialogPresent && graphicMode();
}


x86 assembly (clang, -O0):
<xdialogPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <xdialogPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <xdialogPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdialogPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <xdialogPresent+0x23>
test   %eax,%eax
je     1159 <xdialogPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <xdialogPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@xdialogPresent.lXdialogPresent = internal global i32 -1
@.str = [8 x i8] c"Xdialog\00"
define i32 @xdialogPresent() {
%1 = load i32, i32* @xdialogPresent.lXdialogPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @xdialogPresent.lXdialogPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @xdialogPresent.lXdialogPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@xdialogPresent.lXdialogPresent = internal unnamed_addr global i32 -1
@.str = [8 x i8] c"Xdialog\00"
define i32 @xdialogPresent() {
%1 = load i32, i32* @xdialogPresent.lXdialogPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @xdialogPresent.lXdialogPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t le32_to_cpu(uint32_t v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @le32_to_cpu(i32 returned %0) {
ret i32 %0
}
main(t) {
  for (t = 0;; t++)
    putchar((t >> 6 | t | t >> (t >> 16)) * 10 + ((t >> 11) & 7));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x6,%eax
or     -0x8(%rbp),%eax
mov    -0x8(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
imul   $0xa,%eax,%edi
mov    -0x8(%rbp),%eax
sar    $0xb,%eax
and    $0x7,%eax
add    %eax,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%eax
shr    $0x6,%eax
or     %ebx,%eax
mov    %ebx,%ecx
shr    $0x10,%ecx
mov    %ebx,%edx
shr    %cl,%edx
or     %eax,%edx
lea    (%rdx,%rdx,4),%eax
mov    %ebx,%ecx
shr    $0xb,%ecx
and    $0x7,%ecx
lea    (%rcx,%rax,2),%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x1,%ebx
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = ashr i32 %5, 6
%7 = load i32, i32* %3
%8 = or i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 16
%12 = ashr i32 %9, %11
%13 = or i32 %8, %12
%14 = mul nsw i32 %13, 10
%15 = load i32, i32* %3
%16 = ashr i32 %15, 11
%17 = and i32 %16, 7
%18 = add nsw i32 %14, %17
%19 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %18)
br label %20
20: ; preds = %4
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %14, %2 ]
%4 = lshr i32 %3, 6
%5 = or i32 %4, %3
%6 = lshr i32 %3, 16
%7 = lshr i32 %3, %6
%8 = or i32 %5, %7
%9 = mul nsw i32 %8, 10
%10 = lshr i32 %3, 11
%11 = and i32 %10, 7
%12 = add nsw i32 %9, %11
%13 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %12)
%14 = add nuw nsw i32 %3, 1
br label %2
}
double average(int arr[], int n) { return 1337; }


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  0xeed(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @average(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret double 1.337000e+03
}

LLVM IR (-O2):
define double @average(i32* nocapture readnone %0, i32 %1) {
ret double 1.337000e+03
}
float returnFloatProduct(float a, float b) { return (a * b) / 1000000; }


x86 assembly (clang, -O0):
<returnFloatProduct>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<returnFloatProduct>:
mulss  %xmm1,%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @returnFloatProduct(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fmul float %5, %6
%8 = fdiv float %7, 1.000000e+06
ret float %8
}

LLVM IR (-O2):
define float @returnFloatProduct(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fdiv float %3, 1.000000e+06
ret float %4
}
double sdtools_abs(double x) { return (x < 0.0) ? -x : x; }


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

x86 assembly (clang, -O2):
<sdtools_abs>:
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 @sdtools_abs(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 @sdtools_abs(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 */
typedef int uint32_t;

/* Variables and functions */
uint32_t rmd_f1(uint32_t x, uint32_t y, uint32_t z) { return x ^ y ^ z; }


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

x86 assembly (clang, -O2):
<rmd_f1>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @rmd_f1(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 = load i32, i32* %5
%9 = xor i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @rmd_f1(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
int test_imm_5Auint16_reg(unsigned short val) {
  return ((val) & (-0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffa6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Auint16_reg>:
test   $0xffa6,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Auint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -90
%6 = icmp ne i32 %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_5Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -90
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int isspace(unsigned char);
bool c_isspace(char c) {
  unsigned char uc = c;
  if (c != uc) {
    return false;
  }
  return isspace(uc);
}


x86 assembly (clang, -O0):
<c_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movzbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
je     1140 <c_isspace+0x30>
movl   $0x0,-0x4(%rbp)
jmp    114c <c_isspace+0x3c>
movzbl -0x6(%rbp),%edi
call   1030 <isspace@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_isspace>:
test   $0xffffff00,%edi
jne    1121 <c_isspace+0x11>
movzbl %dil,%edi
jmp    1030 <isspace@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @c_isspace(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
store i8 %5, i8* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %15
12: ; preds = %1
%13 = load i8, i8* %4
%14 = call i32 @isspace(i8 zeroext %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @c_isspace(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = zext i8 %0 to i32
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @isspace(i8 zeroext %0)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ]
ret i32 %8
}
int rl_insert_text(const char *c) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @rl_insert_text(i8* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int bar(jmp_buf buf, int i) {
  printf("Inside bar %d\n", i);
  longjmp(buf, i);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <longjmp@plt>

x86 assembly (clang, -O2):
<bar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <longjmp@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Inside bar %d\0A\00"
define i32 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @longjmp(i32 %7, i32 %8)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"Inside bar %d\0A\00"
define i32 @bar(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = tail call i32 @longjmp(i32 %0, i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else
    putchar(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @putchar(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @putchar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fistp_preg64_qword(int reg64) {
  put8(0xDF);
  put8(0x38 + reg64);
}


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

x86 assembly (clang, -O2):
<fistp_preg64_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdf,%edi
call   1030 <put8@plt>
add    $0x38,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fistp_preg64_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 223)
%4 = load i32, i32* %2
%5 = add nsw i32 56, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fistp_preg64_qword(i32 %0) {
%2 = tail call i32 @put8(i32 223)
%3 = add nsw i32 %0, 56
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getline(char *, int);
void clearbuff(void) {
  char cbuff[2];
  getline(cbuff, 2);
}


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

x86 assembly (clang, -O2):
<clearbuff>:
push   %rax
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <getline@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @clearbuff() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 2)
ret void
}

LLVM IR (-O2):
define void @clearbuff() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Converter ADF (GTA Vice City) to MP3 and back.\n"
         "Version: "
         "1.0.0"
         "\n\n"
         "Usage: adfconv <source> <destination>\n");
}


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

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

LLVM IR (-O0):
@.str = [102 x i8] c"Converter ADF (GTA Vice City) to MP3 and back.\0AVersion: 1.0.0\0A\0AUsage: adfconv <source> <destination>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [101 x i8] c"Converter ADF (GTA Vice City) to MP3 and back.\0AVersion: 1.0.0\0A\0AUsage: adfconv <source> <destination>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char const *);
void emit(const char *fn, int n) {
  printf(" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\"%s\")==0) "
         "lua_call(L, 0, 0);\n",
         n, n, fn);
}


x86 assembly (clang, -O0):
<emit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %esi,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [82 x i8] c" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\22%s\22)==0) lua_call(L, 0, 0);\0A\00"
define void @emit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c" if (luaL_loadbuffer(L,(const char*)B%d,sizeof(B%d),\22%s\22)==0) lua_call(L, 0, 0);\0A\00"
define void @emit(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1, i8* %0)
ret void
}
/* Variables and functions */
unsigned char __VERIFIER_nondet_U8();
void ecrobot_read_bt_packet(unsigned char *bt_receive_buf, unsigned char sz) {
  {
    *(bt_receive_buf + 0) = __VERIFIER_nondet_U8();
    *(bt_receive_buf + 1) = __VERIFIER_nondet_U8();
    return;
  }
}


x86 assembly (clang, -O0):
<ecrobot_read_bt_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_U8@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_U8@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecrobot_read_bt_packet>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_U8@plt>
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_U8@plt>
mov    %al,0x1(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @ecrobot_read_bt_packet(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = call zeroext i8 (...) @__VERIFIER_nondet_U8()
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = call zeroext i8 (...) @__VERIFIER_nondet_U8()
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %8, i8* %10
ret void
}

LLVM IR (-O2):
define void @ecrobot_read_bt_packet(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = tail call zeroext i8 (...) @__VERIFIER_nondet_U8()
store i8 %3, i8* %0
%4 = tail call zeroext i8 (...) @__VERIFIER_nondet_U8()
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
ret void
}
__typeof__(strchr(1, "")) test_strchr_177(void) { return strchr(1, ""); }


x86 assembly (clang, -O0):
<test_strchr_177>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rax
mov    %eax,%esi
call   1030 <strchr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strchr_177>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <strchr@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test_strchr_177() {
%1 = call i8* @strchr(i8* inttoptr (i64 1 to i8*), i32 ptrtoint ([1 x i8]* @.str to i32))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @test_strchr_177() {
%1 = tail call i8* @strchr(i8* inttoptr (i64 1 to i8*), i32 ptrtoint ([1 x i8]* @.str to i32))
ret i8* %1
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct aiocb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int aio_suspend(const struct aiocb *const list[], int nent,
                const struct timespec *timeout) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<aio_suspend>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aio_suspend>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.aiocb = type { i32 }
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_suspend(%struct.aiocb** %0, i32 %1, %struct.timespec* %2) {
%4 = alloca %struct.aiocb**
%5 = alloca i32
%6 = alloca %struct.timespec*
store %struct.aiocb** %0, %struct.aiocb*** %4
store i32 %1, i32* %5
store %struct.timespec* %2, %struct.timespec** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.aiocb = type { i32 }
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @aio_suspend(%struct.aiocb** nocapture readnone %0, i32 %1, %struct.timespec* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef double time_t;
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
struct timeval double_to_timeval(const double val) {
  struct timeval tv;
  tv.tv_sec = val;
  tv.tv_usec = (val - (time_t)val) * 1000000.0;
  return tv;
}


x86 assembly (clang, -O0):
<double_to_timeval>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_timeval>:
movapd %xmm0,%xmm1
subsd  %xmm0,%xmm1
mulsd  0xef0(%rip),%xmm1
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define { double, double } @double_to_timeval(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store double %4, double* %5
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fsub double %6, %7
%9 = fmul double %8, 1.000000e+06
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store double %9, double* %10
%11 = bitcast %struct.timeval* %2 to { double, double }*
%12 = load { double, double }, { double, double }* %11
ret { double, double } %12
}

LLVM IR (-O2):
define { double, double } @double_to_timeval(double %0) {
%2 = fsub double %0, %0
%3 = fmul double %2, 1.000000e+06
%4 = insertvalue { double, double } poison, double %0, 0
%5 = insertvalue { double, double } %4, double %3, 1
ret { double, double } %5
}
void g_value_register_transform_func() {}


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

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

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

LLVM IR (-O2):
define void @g_value_register_transform_func() {
ret void
}
int test_imm_52uint16_reg(unsigned short val) {
  return ((val) & (-0x52 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_52uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffae,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_52uint16_reg>:
test   $0xffae,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_52uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -82
%6 = icmp ne i32 %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_52uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -82
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void startParsing(const char *fileName) {
  printf("---------------------------------------------\n");
  printf("Start Parsing AT >>>>>>>>> %s <<<<<<<<<\n", fileName);
  printf("---------------------------------------------\n");
}


x86 assembly (clang, -O0):
<startParsing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startParsing>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xefb(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"---------------------------------------------\0A\00"
@.str.1 = [41 x i8] c"Start Parsing AT >>>>>>>>> %s <<<<<<<<<\0A\00"
define void @startParsing(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"Start Parsing AT >>>>>>>>> %s <<<<<<<<<\0A\00"
@str.2 = [46 x i8] c"---------------------------------------------\00"
define void @startParsing(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void callback2(void) { printf("callback2 called\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"callback2 called\00"
define void @callback2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int gcd(int a, int b) {
  while (b > 0) {
    int tmp;
    tmp = a % b;
    a = b;
    b = tmp;
  }
  return (a < 0 ? -a : a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
cmpl   $0x0,-0x4(%rbp)
jge    1146 <gcd+0x46>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114c <gcd+0x4c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
jle    111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
jmp    111f <gcd+0x1f>
mov    %eax,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %0, %2 ]
%6 = phi i32 [ %7, %4 ], [ %1, %2 ]
%7 = srem i32 %5, %6
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %6, %4 ]
%11 = tail call i32 @llvm.abs.i32(i32 %10, i1 true)
ret i32 %11
}