xunge/DecIR huggingface dataset:
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ perror_msg_and_die(char *);
scalar_t__ setreuid(int, int);
void swap_uid(void) {
  int euid = geteuid(), uid = getuid();
  if (euid != uid && setreuid(euid, uid) < 0) {
    perror_msg_and_die("setreuid");
  }
}


x86 assembly (clang, -O0):
<swap_uid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1189 <swap_uid+0x49>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <setreuid@plt>
cmp    $0x0,%rax
jge    1189 <swap_uid+0x49>
lea    0xe7c(%rip),%rdi
call   1050 <perror_msg_and_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_uid>:
push   %rbx
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
cmp    %eax,%ebx
je     1163 <swap_uid+0x23>
mov    %ebx,%edi
mov    %eax,%esi
call   1060 <setreuid@plt>
test   %rax,%rax
js     1165 <swap_uid+0x25>
pop    %rbx
ret
lea    0xe94(%rip),%rdi
pop    %rbx
jmp    1050 <perror_msg_and_die@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"setreuid\00"
define void @swap_uid() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @geteuid()
store i32 %3, i32* %1
%4 = call i32 (...) @getuid()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i64 @setreuid(i32 %9, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @perror_msg_and_die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %8, %0
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"setreuid\00"
define void @swap_uid() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 (...) @getuid()
%3 = icmp eq i32 %1, %2
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = tail call i64 @setreuid(i32 %1, i32 %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @perror_msg_and_die(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_error(char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ terminate();
void error_die(const char *msg) {
  log_error(msg);
  perror(msg);
  terminate();
}


x86 assembly (clang, -O0):
<error_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <log_error@plt>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1040 <terminate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_die>:
push   %rbx
mov    %rdi,%rbx
call   1030 <log_error@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <terminate@plt>

LLVM IR (-O0):
define void @error_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_error(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @perror(i8* %5)
%7 = call i32 (...) @terminate()
ret void
}

LLVM IR (-O2):
define void @error_die(i8* %0) {
%2 = tail call i32 @log_error(i8* %0)
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 (...) @terminate()
ret void
}
void perf_measure_mutex(void) {}


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

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

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

LLVM IR (-O2):
define void @perf_measure_mutex() {
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int rand_r(unsigned int *);
int genRand(unsigned int *seed) {
  int value = rand_r(seed);
  value = (int)(value / ((double)RAND_MAX));
  value *= 9999;
  value += 1;
  return value;
}


x86 assembly (clang, -O0):
<genRand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rand_r@plt>
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
mov    0x2eb4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
imul   $0x270f,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genRand>:
push   %rax
call   1030 <rand_r@plt>
cvtsi2sd %eax,%xmm0
mov    0x2ec7(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
imul   $0x270f,%eax,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @genRand(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @rand_r(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fdiv double %7, %9
%11 = fptosi double %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 9999
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @genRand(i32* %0) {
%2 = tail call i32 @rand_r(i32* %0)
%3 = sitofp i32 %2 to double
%4 = load i64, i64* @RAND_MAX
%5 = sitofp i64 %4 to double
%6 = fdiv double %3, %5
%7 = fptosi double %6 to i32
%8 = mul nsw i32 %7, 9999
%9 = add nsw i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void spaceballMotionCB(int x, int y, int z) {
  printf("spaceballMotionCB: translations are X %d, Y %d, Z %d\n", x, y, z);
}


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

x86 assembly (clang, -O2):
<spaceballMotionCB>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"spaceballMotionCB: translations are X %d, Y %d, Z %d\0A\00"
define void @spaceballMotionCB(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 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"spaceballMotionCB: translations are X %d, Y %d, Z %d\0A\00"
define void @spaceballMotionCB(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}
void GPIOPinTypeUART(unsigned long i, unsigned long j) {}


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

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

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

LLVM IR (-O2):
define void @GPIOPinTypeUART(i64 %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ indirecty();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcIndirecty8(void) { sbc8(readmem65816(indirecty())); }


x86 assembly (clang, -O0):
<sbcIndirecty8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <indirecty@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1040 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirecty8>:
push   %rax
xor    %eax,%eax
call   1030 <indirecty@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sbc8@plt>

LLVM IR (-O0):
define void @sbcIndirecty8() {
%1 = call i32 (...) @indirecty()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirecty8() {
%1 = tail call i32 (...) @indirecty()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
fatal() {
  fprintf(stderr, "bad format or Csum to atob\n");
  exit(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"bad format or Csum to atob\0A\00"
define i32 @fatal() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"bad format or Csum to atob\0A\00"
define i32 @fatal() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double log(double);
double logPriorRatioGamma(double xnew, double xold, double a, double b) {
  return (a - 1) * log(xnew / xold) - b * (xnew - xold);
}


x86 assembly (clang, -O0):
<logPriorRatioGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logPriorRatioGamma>:
sub    $0x28,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
addsd  0xed2(%rip),%xmm2
movsd  %xmm2,0x18(%rsp)
divsd  %xmm1,%xmm0
call   1030 <log@plt>
movsd  0x10(%rsp),%xmm1
subsd  0x8(%rsp),%xmm1
mulsd  0x20(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm0
subsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @logPriorRatioGamma(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %7
%10 = fsub double %9, 1.000000e+00
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fdiv double %11, %12
%14 = call double @log(double %13)
%15 = load double, double* %8
%16 = load double, double* %5
%17 = load double, double* %6
%18 = fsub double %16, %17
%19 = fmul double %15, %18
%20 = fneg double %19
%21 = call double @llvm.fmuladd.f64(double %10, double %14, double %20)
ret double %21
}

LLVM IR (-O2):
define double @logPriorRatioGamma(double %0, double %1, double %2, double %3) {
%5 = fadd double %2, -1.000000e+00
%6 = fdiv double %0, %1
%7 = tail call double @log(double %6)
%8 = fsub double %0, %1
%9 = fneg double %8
%10 = fmul double %9, %3
%11 = tail call double @llvm.fmuladd.f64(double %5, double %7, double %10)
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i, j;
  i = 1;
  j = 2;
  assert(i == j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
};
struct TYPE_4__ {
  TYPE_1__ max_aspect;
};
typedef TYPE_2__ XSizeHints;

/* Variables and functions */
void set_XSizeHints_max_aspect_x(void *_p, int _v) {
  ((XSizeHints *)_p)->max_aspect.x = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XSizeHints_max_aspect_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XSizeHints_max_aspect_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XSizeHints_max_aspect_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int /*<<< orphan*/ __VERIFIER_assume(int);
void main() {
  int i;
  int j, k;
  int n;
  j = k = 1;
  __VERIFIER_assume(n >= 1);
  for (i = 0; i < n; i++) {
    j = 2 * j;
  }
  for (i = 0; i < n; i++) {
    k = 2 * k;
  }
  __VERIFIER_assert(j == k);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x10(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assume@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <main+0x51>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114e <main+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    119b <main+0x7b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <main+0x58>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <__VERIFIER_assume@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <__VERIFIER_assert@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @__VERIFIER_assume(i32 1)
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("Enteros:\n char = %2d bytes\n short = %2d bytes\n int = %2d bytes\n "
         "long = %2d bytes\n",
         sizeof(char), sizeof(short), sizeof(int), sizeof(long));
  printf(" (Los tipos signed, ocupan igual que sus respectivos unsigned)\n");
  printf("Reales:\n float = %2d bytes\n double = %2d bytes\n long double = %2d "
         "bytes\n",
         sizeof(float), sizeof(double), sizeof(long double));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x10,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xefb(%rip),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
mov    $0x10,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [82 x i8] c"Enteros:\0A char = %2d bytes\0A short = %2d bytes\0A int = %2d bytes\0A long = %2d bytes\0A\00"
@.str.1 = [64 x i8] c" (Los tipos signed, ocupan igual que sus respectivos unsigned)\0A\00"
@.str.2 = [73 x i8] c"Reales:\0A float = %2d bytes\0A double = %2d bytes\0A long double = %2d bytes\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i64 1, i64 2, i64 4, i64 8)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i64 4, i64 8, i64 16)
ret i32 0
}

LLVM IR (-O2):
@.str = [82 x i8] c"Enteros:\0A char = %2d bytes\0A short = %2d bytes\0A int = %2d bytes\0A long = %2d bytes\0A\00"
@.str.2 = [73 x i8] c"Reales:\0A float = %2d bytes\0A double = %2d bytes\0A long double = %2d bytes\0A\00"
@str = [63 x i8] c" (Los tipos signed, ocupan igual que sus respectivos unsigned)\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i64 1, i64 2, i64 4, i64 8)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str.2, i64 0, i64 0), i64 4, i64 8, i64 16)
ret i32 0
}
void init_board(void) {}


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

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

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

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

/* Variables and functions */
size_t regerror(int, int /*<<< orphan*/ const *, char *, size_t);
size_t c_regerror(int errcode, const void *preg, char *msg, size_t msz) {
  return regerror(errcode, (const regex_t *)preg, msg, msz);
}


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

x86 assembly (clang, -O2):
<c_regerror>:
jmp    1030 <regerror@plt>

LLVM IR (-O0):
define i64 @c_regerror(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i64 @regerror(i32 %9, i32* %11, i8* %12, i64 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @c_regerror(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = bitcast i8* %1 to i32*
%6 = tail call i64 @regerror(i32 %0, i32* %5, i8* %2, i64 %3)
ret i64 %6
}
int testClosureVrI(int (*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrI>:
jmp    *%rdi

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

LLVM IR (-O2):
define i32 @testClosureVrI(i32 ()* nocapture %0) {
%2 = tail call i32 %0()
ret i32 %2
}
int substitute_char(char *string, char old_char, char new_char) {
  int substitutions = 0;
  while (*string) {
    if (*string == old_char) {
      *string = new_char;
      substitutions++;
    }
    string++;
  }
  return substitutions;
}


x86 assembly (clang, -O0):
<substitute_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <substitute_char+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <substitute_char+0x4c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111a <substitute_char+0x1a>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<substitute_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <substitute_char+0x29>
add    $0x1,%rdi
xor    %eax,%eax
jmp    111b <substitute_char+0x1b>
xchg   %ax,%ax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1128 <substitute_char+0x28>
cmp    %sil,%cl
jne    1110 <substitute_char+0x10>
mov    %dl,-0x1(%rdi)
add    $0x1,%eax
jmp    1110 <substitute_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @substitute_char(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3, %13
%7 = phi i8 [ %16, %13 ], [ %4, %3 ]
%8 = phi i32 [ %14, %13 ], [ 0, %3 ]
%9 = phi i8* [ %15, %13 ], [ %0, %3 ]
%10 = icmp eq i8 %7, %1
br i1 %10, label %11, label %13
11: ; preds = %6
store i8 %2, i8* %9
%12 = add nsw i32 %8, 1
br label %13
13: ; preds = %11, %6
%14 = phi i32 [ %12, %11 ], [ %8, %6 ]
%15 = getelementptr inbounds i8, i8* %9, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %13, %3
%19 = phi i32 [ 0, %3 ], [ %14, %13 ]
ret i32 %19
}
void link_error2() {}


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

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

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

LLVM IR (-O2):
define void @link_error2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char const *);
char *e_strdup(const char *s1) {
  char *a = strdup(s1);
  if (a == NULL) {
    fprintf(stderr, "Error: strdup failed\n");
    exit(2);
  }
  return a;
}


x86 assembly (clang, -O0):
<e_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <e_strdup+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_strdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <e_strdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Error: strdup failed\0A\00"
define i8* @e_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Error: strdup failed\0A\00"
define noalias i8* @e_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
ret i8* %2
}
long double test2l(long double x) { return __builtin_cosl(x); }


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

x86 assembly (clang, -O2):
<test2l>:
jmp    1030 <cosl@plt>

LLVM IR (-O0):
define x86_fp80 @test2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @cosl(x86_fp80 %3)
ret x86_fp80 %4
}

LLVM IR (-O2):
define x86_fp80 @test2l(x86_fp80 %0) {
%2 = tail call x86_fp80 @cosl(x86_fp80 %0)
ret x86_fp80 %2
}
int main() {
  int x = 5;
  {
    int x = x;
    if (x == 0) {
    ERROR:
      goto ERROR;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1125 <main+0x25>
jmp    1120 <main+0x20>
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void emovz(a, b) register unsigned short *a, *b;
{
  register int i;
  for (i = 0; i < (6 + 3) - 1; i++)
    *b++ = *a++;
  *b = 0;
}


x86 assembly (clang, -O0):
<emovz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    114f <emovz+0x4f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x2,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <emovz+0x13>
mov    -0x10(%rbp),%rax
movw   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<emovz>:
movzwl (%rdi),%eax
mov    %ax,(%rsi)
movzwl 0x2(%rdi),%eax
mov    %ax,0x2(%rsi)
movzwl 0x4(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0x6(%rdi),%eax
mov    %ax,0x6(%rsi)
movzwl 0x8(%rdi),%eax
mov    %ax,0x8(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0xa(%rsi)
movzwl 0xc(%rdi),%eax
mov    %ax,0xc(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0xe(%rsi)
movw   $0x0,0x10(%rsi)
ret

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

LLVM IR (-O2):
define void @emovz(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %0
%5 = getelementptr inbounds i16, i16* %1, i64 1
store i16 %4, i16* %1
%6 = getelementptr inbounds i16, i16* %0, i64 2
%7 = load i16, i16* %3
%8 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %7, i16* %5
%9 = getelementptr inbounds i16, i16* %0, i64 3
%10 = load i16, i16* %6
%11 = getelementptr inbounds i16, i16* %1, i64 3
store i16 %10, i16* %8
%12 = getelementptr inbounds i16, i16* %0, i64 4
%13 = load i16, i16* %9
%14 = getelementptr inbounds i16, i16* %1, i64 4
store i16 %13, i16* %11
%15 = getelementptr inbounds i16, i16* %0, i64 5
%16 = load i16, i16* %12
%17 = getelementptr inbounds i16, i16* %1, i64 5
store i16 %16, i16* %14
%18 = getelementptr inbounds i16, i16* %0, i64 6
%19 = load i16, i16* %15
%20 = getelementptr inbounds i16, i16* %1, i64 6
store i16 %19, i16* %17
%21 = getelementptr inbounds i16, i16* %0, i64 7
%22 = load i16, i16* %18
%23 = getelementptr inbounds i16, i16* %1, i64 7
store i16 %22, i16* %20
%24 = load i16, i16* %21
%25 = getelementptr inbounds i16, i16* %1, i64 8
store i16 %24, i16* %23
store i16 0, i16* %25
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AddString(char **, int *, int *, char *);
void AddChar(char **buf, int *blen, int *maxlen, int c) {
  char tbuf[2];
  tbuf[0] = (char)c;
  tbuf[1] = '\0';
  AddString(buf, blen, maxlen, tbuf);
}


x86 assembly (clang, -O0):
<AddChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,-0x1e(%rbp)
movb   $0x0,-0x1d(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1e(%rbp),%rcx
call   1030 <AddString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AddChar>:
push   %rax
mov    %cl,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rcx
call   1030 <AddString@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @AddChar(i8** %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca [2 x i8]
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = trunc i32 %3 to i8
store i8 %7, i8* %6
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 0, i8* %8
%9 = call i32 @AddString(i8** %0, i32* %1, i32* %2, i8* %6)
ret void
}
int test_imm_CCuint16_mem(unsigned short *val) {
  return ((*val) & (-0xCC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CCuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CCuint16_mem>:
movzwl (%rdi),%eax
test   $0xff34,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CCuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -204
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_dtim_period_usage(void) {
  printf("\nUsage : sys_cfg_dtim_period [DTIM_PERIOD]\n");
  printf("\nIf DTIM_PERIOD is provided, a 'set' is performed, else a 'get' is "
         "performed.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_dtim_period_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"\0AUsage : sys_cfg_dtim_period [DTIM_PERIOD]\0A\00"
@.str.1 = [79 x i8] c"\0AIf DTIM_PERIOD is provided, a 'set' is performed, else a 'get' is performed.\0A\00"
define void @print_sys_cfg_dtim_period_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"\0AUsage : sys_cfg_dtim_period [DTIM_PERIOD]\00"
@str.2 = [78 x i8] c"\0AIf DTIM_PERIOD is provided, a 'set' is performed, else a 'get' is performed.\00"
define void @print_sys_cfg_dtim_period_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ctor1() { printf("Create1!\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"Create1!\00"
define void @ctor1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float dB_to_coefficient(float);
float meter_deflect_vu(float db) {
  const float rv = 6.77165f * dB_to_coefficient(db);
  if (rv > 1.0)
    return 1.0;
  return rv;
}


x86 assembly (clang, -O0):
<meter_deflect_vu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <dB_to_coefficient@plt>
movaps %xmm0,%xmm1
movss  0xed6(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb4(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1168 <meter_deflect_vu+0x58>
movss  0xeae(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <meter_deflect_vu+0x62>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<meter_deflect_vu>:
push   %rax
call   1030 <dB_to_coefficient@plt>
mulss  0xee2(%rip),%xmm0
movss  0xede(%rip),%xmm1
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @meter_deflect_vu(float %0) {
%2 = tail call float @dB_to_coefficient(float %0)
%3 = fmul float %2, 0x401B162B60000000
%4 = fcmp ogt float %3, 1.000000e+00
%5 = select i1 %4, float 1.000000e+00, float %3
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int pthread_rwlockattr_destroy(int /*<<< orphan*/ *);
int my_pthread_rwlockattr_destroy(pthread_rwlockattr_t *__attr) {
  int ret;
  pthread_rwlockattr_t *realattr =
      (pthread_rwlockattr_t *)*(unsigned int *)__attr;
  ret = pthread_rwlockattr_destroy(realattr);
  free(realattr);
  return ret;
}


x86 assembly (clang, -O0):
<my_pthread_rwlockattr_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pthread_rwlockattr_destroy@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_rwlockattr_destroy>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebx
mov    %rbx,%rdi
call   1040 <pthread_rwlockattr_destroy@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @my_pthread_rwlockattr_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = call i32 @pthread_rwlockattr_destroy(i32* %9)
store i32 %10, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @free(i32* %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_pthread_rwlockattr_destroy(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @pthread_rwlockattr_destroy(i32* %4)
%6 = tail call i32 @free(i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main() {
  int result = sum(2, 3);
  printf("The addition of 2 and 3 is: %i", result);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"The addition of 2 and 3 is: %i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sum(i32 2, i32 3)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"The addition of 2 and 3 is: %i\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ teredo_hash(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *,
                               int, int /*<<< orphan*/ *, int /*<<< orphan*/);
void teredo_get_nonce(uint32_t timestamp, uint32_t ipv4, uint16_t port,
                      uint8_t *restrict nonce) {
  uint8_t buf[16];
  teredo_hash(&ipv4, 4, &port, 2, buf, timestamp);
  memcpy(nonce, buf, 8);
}


x86 assembly (clang, -O0):
<teredo_get_nonce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
lea    -0x60(%rbp),%r8
mov    -0x4(%rbp),%r9d
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
mov    $0x2,%ecx
call   1040 <teredo_hash@plt>
mov    -0x18(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teredo_get_nonce>:
push   %r14
push   %rbx
sub    $0x58,%rsp
mov    %rcx,%rbx
mov    %edi,%r9d
mov    %esi,0xc(%rsp)
mov    %edx,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%r14
mov    $0x4,%esi
mov    $0x2,%ecx
mov    %r14,%r8
call   1040 <teredo_hash@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @teredo_get_nonce(i32 %0, i32 %1, i32 %2, i32* noalias %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca [16 x i32]
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast [16 x i32]* %7 to i8*
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%10 = call i32 @teredo_hash(i32* %5, i32 4, i32* %6, i32 2, i32* %9, i32 %0)
%11 = call i32 @memcpy(i32* %3, i32* %9, i32 8)
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double GetMilliTimed(void) {
  struct timeval tv;
  int h = gettimeofday(&tv, NULL);
  assert(!h);
  return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<GetMilliTimed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xea1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMilliTimed>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @GetMilliTimed() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to double
%15 = call double @llvm.fmuladd.f64(double %14, double 0x3EB0C6F7A0B5ED8D, double %11)
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @GetMilliTimed() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %13
}
__attribute__((weak)) int _times(struct tms *buf) { return -1; }


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

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

LLVM IR (-O0):
%struct.tms = type opaque
define weak i32 @_times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type opaque
define weak i32 @_times(%struct.tms* %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ work();
int main() {
  int cases;
  scanf("%d", &cases);
  do
    work();
  while (--cases);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <work@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    113f <main+0x1f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <work@plt>
addl   $0xffffffff,0x4(%rsp)
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %4, %0
%5 = call i32 (...) @work()
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
ret i32 0
}