xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 27:
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    113b <keyboard+0x2b>
jmp    1134 <keyboard+0x24>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1140 <keyboard+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
br label %12
12: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void __attribute__((no)) foo(int a) {
  int z = a > 0 ? a : -a;
  long long x = z;
  if (x > 0x100000000LL)
    abort();
  else
    exit(0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1140 <foo+0x20>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1148 <foo+0x28>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movabs $0x100000000,%rax
cmp    %rax,-0x10(%rbp)
jle    1171 <foo+0x51>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sub nsw i32 0, %10
br label %12
12: ; preds = %9, %7
%13 = phi i32 [ %8, %7 ], [ %11, %9 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = icmp sgt i64 %16, 4294967296
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 (...) @abort()
unreachable
20: ; preds = %12
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ close(int);
int qcd_close_pipe(int *tuberia) {
  if (close(tuberia[0]) < 0)
    return (3);
  if (close(tuberia[1]) < 0)
    return (3);
  return (0);
}


x86 assembly (clang, -O0):
<qcd_close_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    113d <qcd_close_pipe+0x2d>
movl   $0x3,-0x4(%rbp)
jmp    1166 <qcd_close_pipe+0x56>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    115f <qcd_close_pipe+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    1166 <qcd_close_pipe+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcd_close_pipe>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
test   %rax,%rax
js     1131 <qcd_close_pipe+0x21>
mov    0x4(%rbx),%edi
call   1030 <close@plt>
sar    $0x3f,%rax
and    $0x3,%eax
pop    %rbx
ret
mov    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @qcd_close_pipe(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = call i64 @close(i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 3, i32* %2
br label %18
10: ; preds = %1
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = call i64 @close(i32 %13)
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 3, i32* %2
br label %18
17: ; preds = %10
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @qcd_close_pipe(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i64 @close(i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = tail call i64 @close(i32 %7)
%9 = icmp slt i64 %8, 0
%10 = select i1 %9, i32 3, i32 0
br label %11
11: ; preds = %5, %1
%12 = phi i32 [ 3, %1 ], [ %10, %5 ]
ret i32 %12
}
/* Type definitions */
struct group {
  int dummy;
};
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
struct group *getgrgid(gid_t gid) {
  ;
  errno = ENOSYS;
  return NULL;
  ;
}


x86 assembly (clang, -O0):
<getgrgid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.group = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.group* @getgrgid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.group* null
}

LLVM IR (-O2):
%struct.group = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.group* @getgrgid(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.group* null
}
/* Type definitions */
struct D {
  int dummy;
};

/* Variables and functions */
void s(struct D *d) {}


x86 assembly (clang, -O0):

:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):

:
ret

LLVM IR (-O0):
%struct.D = type { i32 }
define void @s(%struct.D* %0) {
%2 = alloca %struct.D*
store %struct.D* %0, %struct.D** %2
ret void
}

LLVM IR (-O2):
%struct.D = type { i32 }
define void @s(%struct.D* nocapture %0) {
ret void
}
/* Type definitions */
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int32_t GSM_L_MULT(int16_t a, int16_t b) {
  return ((int32_t)(a)) * ((int32_t)(b)) << 1;
}


x86 assembly (clang, -O0):
<GSM_L_MULT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   %ecx,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GSM_L_MULT>:
imul   %edi,%esi
lea    (%rsi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @GSM_L_MULT(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, 1
%6 = mul i32 %5, %4
ret i32 %6
}
/* Variables and functions */
long udivmodsi4(long, long, int);
long __modsi3(long a, long b) {
  int neg = 0;
  long res;
  if (a < 0) {
    a = -a;
    neg = 1;
  }
  if (b < 0)
    b = -b;
  res = udivmodsi4(a, b, 1);
  if (neg)
    res = -res;
  return res;
}


x86 assembly (clang, -O0):
<__modsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1143 <__modsi3+0x33>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1158 <__modsi3+0x48>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <udivmodsi4@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1182 <__modsi3+0x72>
xor    %eax,%eax
sub    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__modsi3>:
push   %rbx
mov    %rdi,%rbx
neg    %rdi
cmovs  %rbx,%rdi
mov    %rsi,%rax
neg    %rax
cmovns %rax,%rsi
mov    $0x1,%edx
call   1030 <udivmodsi4@plt>
mov    %rax,%rcx
neg    %rcx
test   %rbx,%rbx
cmovs  %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @__modsi3(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = sub nsw i64 0, %0
%5 = select i1 %3, i64 %4, i64 %0
%6 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%7 = tail call i64 @udivmodsi4(i64 %5, i64 %6, i32 1)
%8 = sub nsw i64 0, %7
%9 = select i1 %3, i64 %8, i64 %7
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a = 0, b = 0;
  while (a < 10) {
    if (a++ > 0)
      test_assert(b > 0);
    b++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    116a <main+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jle    115c <main+0x4c>
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
mov    $0x1,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @test_assert(i32 %14)
br label %16
16: ; preds = %11, %7
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test_assert(i32 1)
%2 = tail call i32 @test_assert(i32 1)
%3 = tail call i32 @test_assert(i32 1)
%4 = tail call i32 @test_assert(i32 1)
%5 = tail call i32 @test_assert(i32 1)
%6 = tail call i32 @test_assert(i32 1)
%7 = tail call i32 @test_assert(i32 1)
%8 = tail call i32 @test_assert(i32 1)
%9 = tail call i32 @test_assert(i32 1)
ret i32 0
}
/* Type definitions */
struct Screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_save_current_buffer(struct Screen *);
void cb_save(struct Screen *scrn) { screen_save_current_buffer(scrn); }


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

x86 assembly (clang, -O2):
<cb_save>:
jmp    1030 <screen_save_current_buffer@plt>

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

LLVM IR (-O2):
%struct.Screen = type { i32 }
define void @cb_save(%struct.Screen* %0) {
%2 = tail call i32 @screen_save_current_buffer(%struct.Screen* %0)
ret void
}
double svd_fsign(double a, double b) {
  if ((a >= 0.0 && b >= 0.0) || (a < 0.0 && b < 0.0))
    return (a);
  else
    return -a;
}


x86 assembly (clang, -O0):
<svd_fsign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1132 <svd_fsign+0x32>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jae    114e <svd_fsign+0x4e>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115d <svd_fsign+0x5d>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    115d <svd_fsign+0x5d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117e <svd_fsign+0x7e>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<svd_fsign>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jb     1111 <svd_fsign+0x11>
ucomisd %xmm2,%xmm1
jb     1111 <svd_fsign+0x11>
ret
movapd 0xee7(%rip),%xmm3
xorpd  %xmm0,%xmm3
cmpltsd %xmm2,%xmm1
movapd %xmm1,%xmm4
andpd  %xmm0,%xmm4
andnpd %xmm3,%xmm1
orpd   %xmm4,%xmm1
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @svd_fsign(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %5
%10 = fcmp oge double %9, 0.000000e+00
br i1 %10, label %17, label %11
11: ; preds = %8, %2
%12 = load double, double* %4
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load double, double* %5
%16 = fcmp olt double %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %14, %8
%18 = load double, double* %4
store double %18, double* %3
br label %22
19: ; preds = %14, %11
%20 = load double, double* %4
%21 = fneg double %20
store double %21, double* %3
br label %22
22: ; preds = %19, %17
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @svd_fsign(double %0, double %1) {
%3 = fcmp oge double %0, 0.000000e+00
%4 = fcmp oge double %1, 0.000000e+00
%5 = and i1 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = fcmp olt double %0, 0.000000e+00
%8 = fcmp olt double %1, 0.000000e+00
%9 = and i1 %7, %8
%10 = fneg double %0
%11 = select i1 %9, double %0, double %10
br label %12
12: ; preds = %6, %2
%13 = phi double [ %0, %2 ], [ %11, %6 ]
ret double %13
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int swap_dobldobl_slices(void) {
  double *c;
  int fail, *a, *b;
  fail = _ada_use_c2phc4c(636, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<swap_dobldobl_slices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x27c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_dobldobl_slices>:
mov    $0x27c,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @swap_dobldobl_slices() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 636, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Type definitions */
struct tml_node {
  int dummy;
};

/* Variables and functions */
float tml_node_to_double(struct tml_node const *);
float tml_node_to_float(const struct tml_node *node) {
  return tml_node_to_double(node);
}


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

x86 assembly (clang, -O2):
<tml_node_to_float>:
jmp    1030 <tml_node_to_double@plt>

LLVM IR (-O0):
%struct.tml_node = type { i32 }
define float @tml_node_to_float(%struct.tml_node* %0) {
%2 = alloca %struct.tml_node*
store %struct.tml_node* %0, %struct.tml_node** %2
%3 = load %struct.tml_node*, %struct.tml_node** %2
%4 = call float @tml_node_to_double(%struct.tml_node* %3)
ret float %4
}

LLVM IR (-O2):
%struct.tml_node = type { i32 }
define float @tml_node_to_float(%struct.tml_node* %0) {
%2 = tail call float @tml_node_to_double(%struct.tml_node* %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ kfree(void *);
void free(void *ptr) { kfree(ptr); }


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

x86 assembly (clang, -O2):
<free>:
jmp    1030 <kfree@plt>

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

LLVM IR (-O2):
define void @free(i8* %0) {
%2 = tail call i32 @kfree(i8* %0)
ret void
}
/* Variables and functions */
int read(int, int *, int);
int read_int4(int f, int *i) {
  if (read(f, i, 4) == 4) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<read_int4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
cmp    $0x4,%eax
jne    1145 <read_int4+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <read_int4+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int4>:
push   %rax
mov    $0x4,%edx
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_int4(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 = call i32 @read(i32 %6, i32* %7, i32 4)
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @read_int4(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @read(i32 %0, i32* %1, i32 4)
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
void openxcas_set_caid(uint16_t UNUSED__caid __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @openxcas_set_caid(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
foo() {
  static int count;
  count++;
  if (count > 1)
    abort();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2f0e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f05(%rip)
cmpl   $0x1,0x2efe(%rip)
jle    113b <foo+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jg     1126 <foo+0x16>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@foo.count = internal global i32 0
define i32 @foo() {
%1 = alloca i32
%2 = load i32, i32* @foo.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @foo.count
%4 = load i32, i32* @foo.count
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@foo.count = internal unnamed_addr global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @foo.count
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 undef
}
long a_swap_l(volatile void *x, long v) {
  __asm__(".byte 0x67\n\txchg %0, %1"
          : "=r"(v), "=m"(*(long *)x)
          : "0"(v)
          : "memory");
  return v;
}


x86 assembly (clang, -O0):
<a_swap_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
xchg   %rax,(%ecx)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_swap_l>:
mov    %rsi,%rax
xchg   %rax,(%edi)
ret

LLVM IR (-O0):
define i64 @a_swap_l(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %4
%8 = call i64 asm ".byte 0x67\0A\09xchg $0, $1", "=r,=*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7)
store i64 %8, i64* %4
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
define i64 @a_swap_l(i8* %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = tail call i64 asm ".byte 0x67\0A\09xchg $0, $1", "=r,=*m,0,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i64 %1)
ret i64 %4
}
int foo(int x) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dt_info_print();
int /*<<< orphan*/ dt_init();
int do_device_info(void) {
  dt_init();
  dt_info_print();
  return 0;
}


x86 assembly (clang, -O0):
<do_device_info>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dt_init@plt>
mov    $0x0,%al
call   1040 <dt_info_print@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_device_info>:
push   %rax
xor    %eax,%eax
call   1030 <dt_init@plt>
xor    %eax,%eax
call   1040 <dt_info_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @do_device_info() {
%1 = call i32 (...) @dt_init()
%2 = call i32 (...) @dt_info_print()
ret i32 0
}

LLVM IR (-O2):
define i32 @do_device_info() {
%1 = tail call i32 (...) @dt_init()
%2 = tail call i32 (...) @dt_info_print()
ret i32 0
}
/* Variables and functions */
int rand();
void troca_cor(char senha[5], int a) {
  int aux1 = 0;
  char aux2;
  while (aux1) {
    switch (rand() % 4) {
    case 0:
      aux2 = 'R';
      break;
    case 1:
      aux2 = 'G';
      break;
    case 2:
      aux2 = 'Y';
      break;
    case 3:
      aux2 = 'B';
      break;
    }
    if (aux2 != senha[a])
      aux1 = 1;
  }
}


x86 assembly (clang, -O0):
<troca_cor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11ae <troca_cor+0x9e>
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%edx
add    $0x3,%edx
test   %eax,%eax
mov    %eax,%ecx
cmovs  %edx,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x3,%eax
ja     118a <troca_cor+0x7a>
mov    -0x20(%rbp),%rax
lea    0xe9e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x52,-0x11(%rbp)
jmp    118a <troca_cor+0x7a>
movb   $0x47,-0x11(%rbp)
jmp    118a <troca_cor+0x7a>
movb   $0x59,-0x11(%rbp)
jmp    118a <troca_cor+0x7a>
movb   $0x42,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     11a9 <troca_cor+0x99>
movl   $0x1,-0x10(%rbp)
jmp    1126 <troca_cor+0x16>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @troca_cor(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %28, %2
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %7
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 4
switch i32 %12, label %17 [
i32 0, label %13
i32 1, label %14
i32 2, label %15
i32 3, label %16
]
13: ; preds = %10
store i8 82, i8* %6
br label %17
14: ; preds = %10
store i8 71, i8* %6
br label %17
15: ; preds = %10
store i8 89, i8* %6
br label %17
16: ; preds = %10
store i8 66, i8* %6
br label %17
17: ; preds = %10, %16, %15, %14, %13
%18 = load i8, i8* %6
%19 = sext i8 %18 to i32
%20 = load i8*, i8** %3
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp ne i32 %19, %25
br i1 %26, label %27, label %28
27: ; preds = %17
store i32 1, i32* %5
br label %28
28: ; preds = %27, %17
br label %7
29: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @troca_cor(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usageInit() {
  printf("Usage Init (Initialisateur Simulateurs):\n./init_simulateurs -c "
         "fichierConfiguration\n");
}


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

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

LLVM IR (-O0):
@.str = [85 x i8] c"Usage Init (Initialisateur Simulateurs):\0A./init_simulateurs -c fichierConfiguration\0A\00"
define void @usageInit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [84 x i8] c"Usage Init (Initialisateur Simulateurs):\0A./init_simulateurs -c fichierConfiguration\00"
define void @usageInit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void adts_get_cp_id(const uint8_t *p_adts, bool *pb_bit, bool *pb_start) {
  *pb_bit = !!(p_adts[3] & 0x08);
  *pb_start = !!(p_adts[3] & 0x04);
}


x86 assembly (clang, -O0):
<adts_get_cp_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adts_get_cp_id>:
mov    0xc(%rdi),%eax
shr    $0x3,%eax
and    $0x1,%eax
mov    %eax,(%rsi)
mov    0xc(%rdi),%eax
shr    $0x2,%eax
and    $0x1,%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @adts_get_cp_id(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 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = and i32 %9, 8
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = and i32 %18, 4
%20 = icmp ne i32 %19, 0
%21 = xor i1 %20, true
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = load i32*, i32** %6
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @adts_get_cp_id(i32* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 3
%5 = load i32, i32* %4
%6 = lshr i32 %5, 3
%7 = and i32 %6, 1
store i32 %7, i32* %1
%8 = load i32, i32* %4
%9 = lshr i32 %8, 2
%10 = and i32 %9, 1
store i32 %10, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int a;
  printf("introduce un numero entero: ");
  scanf("%d", &a);
  if (a % 2 == 0) {
    printf("el valor de a es par\n");
  } else {
    printf("el valor de a es impar\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xedd(%rip),%rax
lea    0xebf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"introduce un numero entero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"el valor de a es par\0A\00"
@.str.3 = [24 x i8] c"el valor de a es impar\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"introduce un numero entero: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [23 x i8] c"el valor de a es impar\00"
@str.4 = [21 x i8] c"el valor de a es par\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_variable_name_data(int, char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void fgmvwrite_variable_name_data_(int *data_type, char varname[], char *vids) {
  char name[10];
  strncpy(name, varname, 8);
  *(name + 8) = '\0';
  gmvwrite_variable_name_data(*data_type, name, vids);
}


x86 assembly (clang, -O0):
<fgmvwrite_variable_name_data_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x22(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x1a(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x22(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <gmvwrite_variable_name_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgmvwrite_variable_name_data_>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0x6(%rsp),%r15
mov    %r15,%rdi
mov    $0x8,%edx
call   1030 <strncpy@plt>
movb   $0x0,0xe(%rsp)
mov    (%rbx),%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <gmvwrite_variable_name_data@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fgmvwrite_variable_name_data_(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [10 x i8]
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = call i32 @strncpy(i8* %8, i8* %9, i32 8)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds i8, i8* %11, i64 8
store i8 0, i8* %12
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i32 @gmvwrite_variable_name_data(i32 %14, i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @fgmvwrite_variable_name_data_(i32* nocapture %0, i8* %1, i8* %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = call i32 @strncpy(i8* %5, i8* %1, i32 8)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 8
store i8 0, i8* %7
%8 = load i32, i32* %0
%9 = call i32 @gmvwrite_variable_name_data(i32 %8, i8* %5, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ homeViewModel();
int /*<<< orphan*/ loadHomeView();
int main(int argc, char const *argv[]) {
  homeViewModel();
  loadHomeView();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <homeViewModel@plt>
mov    $0x0,%al
call   1030 <loadHomeView@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <homeViewModel@plt>
xor    %eax,%eax
call   1030 <loadHomeView@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @homeViewModel()
%7 = call i32 (...) @loadHomeView()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @homeViewModel()
%4 = tail call i32 (...) @loadHomeView()
ret i32 0
}
int fun434() { return 434; }


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

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

LLVM IR (-O0):
define i32 @fun434() {
ret i32 434
}

LLVM IR (-O2):
define i32 @fun434() {
ret i32 434
}
/* Variables and functions */
int /*<<< orphan*/ fn(unsigned long long *);
void f1(void) {
  unsigned long long a;
  fn(&a);
}


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

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    %rsp,%rdi
call   1030 <fn@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f1() {
%1 = alloca i64
%2 = call i32 @fn(i64* %1)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @fn(i64* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ copy_from_kernel(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char mybuf[528];
  copy_from_kernel(mybuf, -528);
  printf("%s\n", mybuf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    -0x210(%rbp),%rdi
mov    $0xfffffdf0,%esi
call   1030 <copy_from_kernel@plt>
lea    -0x210(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x210,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xfffffdf0,%esi
call   1030 <copy_from_kernel@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [528 x i8]
%2 = getelementptr inbounds [528 x i8], [528 x i8]* %1, i64 0, i64 0
%3 = call i32 @copy_from_kernel(i8* %2, i32 -528)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int foo_0();
int foo_1();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("0x%x\n", foo_0());
  printf("0x%x\n", foo_1());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <foo_0@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <foo_1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @foo_0()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @foo_1()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tok(char *);
int main() {
  char *test = "select \"foo\" from test;";
  tok(test);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"select \22foo\22 from test;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @tok(i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"select \22foo\22 from test;\00"
define i32 @main() {
%1 = tail call i32 @tok(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void U_WMRRESTOREDC_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_WMRRESTOREDC_print(i8* nocapture %0) {
ret void
}
void initialiseStatesAndConstants(double *states, double *variables) {
  states[0] = 0.0;
}


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

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movq   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
store double 0.000000e+00, double* %6
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture readnone %1) {
store double 0.000000e+00, double* %0
ret void
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isxdigit(int c) {
  if (isdigit(c) || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    115d <isxdigit+0x4d>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     1145 <isxdigit+0x35>
cmpl   $0x66,-0x8(%rbp)
jle    115d <isxdigit+0x4d>
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     1169 <isxdigit+0x59>
cmpl   $0x46,-0x8(%rbp)
jg     1169 <isxdigit+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1170 <isxdigit+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
and    $0xffffffdf,%ebx
add    $0xffffffbf,%ebx
cmp    $0x6,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 97, %8
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 102
br i1 %12, label %19, label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
%15 = icmp sle i32 65, %14
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 70
br i1 %18, label %19, label %20
19: ; preds = %16, %10, %1
store i32 1, i32* %2
br label %21
20: ; preds = %16, %13
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %6, %3
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void map_seq(int (*work)(int), int *arr, int *out, size_t n) {
  for (size_t i = 0; i < n; i++) {
    out[i] = work(arr[i]);
  }
}


x86 assembly (clang, -O0):
<map_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115d <map_seq+0x5d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <map_seq+0x20>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_seq>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rcx,%rcx
je     1134 <map_seq+0x34>
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r15,%rbx,4),%edi
call   *%r13
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <map_seq+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @map_seq(i32 (i32)* %0, i32* %1, i32* %2, i64 %3) {
%5 = alloca i32 (i32)*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i64
%9 = alloca i64
store i32 (i32)* %0, i32 (i32)** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i64 %3, i64* %8
store i64 0, i64* %9
br label %10
10: ; preds = %24, %4
%11 = load i64, i64* %9
%12 = load i64, i64* %8
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = load i32 (i32)*, i32 (i32)** %5
%16 = load i32*, i32** %6
%17 = load i64, i64* %9
%18 = getelementptr inbounds i32, i32* %16, i64 %17
%19 = load i32, i32* %18
%20 = call i32 %15(i32 %19)
%21 = load i32*, i32** %7
%22 = load i64, i64* %9
%23 = getelementptr inbounds i32, i32* %21, i64 %22
store i32 %20, i32* %23
br label %24
24: ; preds = %14
%25 = load i64, i64* %9
%26 = add i64 %25, 1
store i64 %26, i64* %9
br label %10
27: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @map_seq(i32 (i32)* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %7
6: ; preds = %7, %4
ret void
7: ; preds = %4, %7
%8 = phi i64 [ %13, %7 ], [ 0, %4 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 %0(i32 %10)
%12 = getelementptr inbounds i32, i32* %2, i64 %8
store i32 %11, i32* %12
%13 = add nuw i64 %8, 1
%14 = icmp eq i64 %13, %3
br i1 %14, label %6, label %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
unsigned long get_XPropertyEvent_window(void *_p) {
  return (unsigned long)((XPropertyEvent *)_p)->window;
}


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

x86 assembly (clang, -O2):
<get_XPropertyEvent_window>:
mov    (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_XPropertyEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int Cyc_Core_intcmp(int a, int b) {
  int _T0;
  _T0 = a - b;
  return _T0;
}


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

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

LLVM IR (-O0):
define i32 @Cyc_Core_intcmp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @Cyc_Core_intcmp(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}