xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ atof(char *);
int atoi(char *);
int /*<<< orphan*/ atol(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
unsigned int _stdlib(FILE *output) {
  srand(time(NULL));
  fprintf(output, "%d%f%ld", atoi("103"), atof("985.3"), atol("12141312"));
  return 5;
}


x86 assembly (clang, -O0):
<_stdlib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xe7d(%rip),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x10(%rbp)
lea    0xe72(%rip),%rdi
call   1030 <atof@plt>
mov    %eax,-0xc(%rbp)
lea    0xe69(%rip),%rdi
call   1070 <atol@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    %eax,%r8d
lea    0xe3e(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x5,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stdlib>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    0xeaf(%rip),%rdi
call   1030 <atof@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
mov    $0x67,%edx
mov    %eax,%ecx
mov    $0xb94300,%r8d
call   1050 <fprintf@plt>
mov    $0x5,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%d%f%ld\00"
@.str.1 = [4 x i8] c"103\00"
@.str.2 = [6 x i8] c"985.3\00"
@.str.3 = [9 x i8] c"12141312\00"
define i32 @_stdlib(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
%5 = load i32*, i32** %2
%6 = call i32 @atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @atof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @atol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 5
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d%f%ld\00"
@.str.2 = [6 x i8] c"985.3\00"
define i32 @_stdlib(i32* nocapture %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 @atof(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 103, i32 %4, i32 12141312)
ret i32 5
}
int compd(const void *A, const void *B) {
  const double *a = A, *b = B;
  if (*a < *b)
    return -1;
  if (*a > *b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <compd+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <compd+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <compd+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <compd+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compd>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compd(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @compd(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_gid;
};
struct group {
  char *gr_name;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
struct group *getgrgid(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
char *getgroup(struct stat stats) {
  struct group *grp = getgrgid(stats.st_gid);
  if (grp == NULL) {
    fprintf(stderr, "could not get group of file\n");
    exit(1);
  }
  return grp->gr_name;
}


x86 assembly (clang, -O0):
<getgroup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getgrgid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <getgroup+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgroup>:
push   %rax
call   1030 <getgrgid@plt>
test   %rax,%rax
je     1140 <getgroup+0x10>
mov    (%rax),%rax
pop    %rcx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.group = type { i8* }
@stderr = global i32 0
@.str = [29 x i8] c"could not get group of file\0A\00"
define i8* @getgroup(i32 %0) {
%2 = alloca %struct.stat
%3 = alloca %struct.group*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
store i32 %0, i32* %4
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call %struct.group* @getgrgid(i32 %6)
store %struct.group* %7, %struct.group** %3
%8 = load %struct.group*, %struct.group** %3
%9 = icmp eq %struct.group* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load %struct.group*, %struct.group** %3
%16 = getelementptr inbounds %struct.group, %struct.group* %15, i32 0, i32 0
%17 = load i8*, i8** %16
ret i8* %17
}

LLVM IR (-O2):
%struct.group = type { i8* }
@stderr = global i32 0
@.str = [29 x i8] c"could not get group of file\0A\00"
define i8* @getgroup(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
%3 = icmp eq %struct.group* %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 ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%10 = load i8*, i8** %9
ret i8* %10
}
void swap(int *p_a, int *p_b, char **n_a, char **n_b) {
  int p_t = *p_a;
  *p_a = *p_b;
  *p_b = p_t;
  char *n_t = *n_a;
  *n_a = *n_b;
  *n_b = n_t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%r8d
mov    (%rsi),%eax
mov    %eax,(%rdi)
mov    %r8d,(%rsi)
mov    (%rdx),%rax
mov    (%rcx),%rsi
mov    %rsi,(%rdx)
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1, i8** %2, i8** %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
store i32 %12, i32* %9
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
store i32 %14, i32* %15
%16 = load i32, i32* %9
%17 = load i32*, i32** %6
store i32 %16, i32* %17
%18 = load i8**, i8*** %7
%19 = load i8*, i8** %18
store i8* %19, i8** %10
%20 = load i8**, i8*** %8
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %7
store i8* %21, i8** %22
%23 = load i8*, i8** %10
%24 = load i8**, i8*** %8
store i8* %23, i8** %24
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1, i8** nocapture %2, i8** nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %1
store i32 %6, i32* %0
store i32 %5, i32* %1
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
store i8* %8, i8** %2
store i8* %7, i8** %3
ret void
}
int main(void) {
  int a = 1, b = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
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
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
AR0AX1(r0, r1, x0, x1, p0, p1) signed char r0, r1;
signed char *p0, *p1;
{
  if ((p0[10000000]) <= (((signed char *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl 0x989680(%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jg     114a <AR0AX1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <AR0AX1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AX1>:
mov    0x989680(%r8),%dl
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(%rcx),%dl
setle  %al
ret

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

LLVM IR (-O2):
define i32 @AR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
%8 = load i8, i8* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i8, i8* inttoptr (i64 11111111 to i8*), i64 %9
%11 = load i8, i8* %10
%12 = icmp sle i8 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
double cos(double);
float de_jongs(float, float);
double sqrt(float);
float drop_wave(float x1, float x2) {
  float valor = de_jongs(x1, x2);
  return -((1.0 + cos(12.0 * sqrt(valor))) / ((0.5 * valor) + 2.0));
}


x86 assembly (clang, -O0):
<drop_wave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <de_jongs@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  0xe91(%rip),%xmm0
addsd  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xe6c(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe68(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_wave>:
push   %rax
call   1030 <de_jongs@plt>
movss  %xmm0,0x4(%rsp)
call   1050 <sqrt@plt>
mulsd  0xeb7(%rip),%xmm0
call   1040 <cos@plt>
addsd  0xeb2(%rip),%xmm0
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  0xea8(%rip),%xmm1
addsd  0xea8(%rip),%xmm1
xorpd  0xea8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @drop_wave(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @de_jongs(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
%10 = call double @sqrt(float %9)
%11 = fmul double 1.200000e+01, %10
%12 = call double @cos(double %11)
%13 = fadd double 1.000000e+00, %12
%14 = load float, float* %5
%15 = fpext float %14 to double
%16 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %15, double 2.000000e+00)
%17 = fdiv double %13, %16
%18 = fneg double %17
%19 = fptrunc double %18 to float
ret float %19
}

LLVM IR (-O2):
define float @drop_wave(float %0, float %1) {
%3 = tail call float @de_jongs(float %0, float %1)
%4 = tail call double @sqrt(float %3)
%5 = fmul double %4, 1.200000e+01
%6 = tail call double @cos(double %5)
%7 = fadd double %6, 1.000000e+00
%8 = fpext float %3 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 5.000000e-01, double 2.000000e+00)
%10 = fneg double %7
%11 = fdiv double %10, %9
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
void *alloc(unsigned int);
int /*<<< orphan*/ alloc_free(void *);
int /*<<< orphan*/ byte_copy(void *, unsigned int, void *);
int alloc_re(void **x, unsigned int m, unsigned int n) {
  void *y;
  y = alloc(n);
  if (!y)
    return 0;
  byte_copy(y, m, *x);
  alloc_free(*x);
  *x = y;
  return 1;
}


x86 assembly (clang, -O0):
<alloc_re>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <alloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <alloc_re+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1196 <alloc_re+0x66>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
call   1050 <byte_copy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <alloc_free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_re>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %edx,%edi
call   1040 <alloc@plt>
test   %rax,%rax
je     1167 <alloc_re+0x37>
mov    %rax,%rbx
mov    (%r14),%rdx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <byte_copy@plt>
mov    (%r14),%rdi
call   1030 <alloc_free@plt>
mov    %rbx,(%r14)
mov    $0x1,%eax
jmp    1169 <alloc_re+0x39>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @alloc_re(i8** %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
%10 = call i8* @alloc(i32 %9)
store i8* %10, i8** %8
%11 = load i8*, i8** %8
%12 = icmp ne i8* %11, null
br i1 %12, label %14, label %13
13: ; preds = %3
store i32 0, i32* %4
br label %25
14: ; preds = %3
%15 = load i8*, i8** %8
%16 = load i32, i32* %6
%17 = load i8**, i8*** %5
%18 = load i8*, i8** %17
%19 = call i32 @byte_copy(i8* %15, i32 %16, i8* %18)
%20 = load i8**, i8*** %5
%21 = load i8*, i8** %20
%22 = call i32 @alloc_free(i8* %21)
%23 = load i8*, i8** %8
%24 = load i8**, i8*** %5
store i8* %23, i8** %24
store i32 1, i32* %4
br label %25
25: ; preds = %14, %13
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @alloc_re(i8** nocapture %0, i32 %1, i32 %2) {
%4 = tail call i8* @alloc(i32 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = tail call i32 @byte_copy(i8* %4, i32 %1, i8* %7)
%9 = load i8*, i8** %0
%10 = tail call i32 @alloc_free(i8* %9)
store i8* %4, i8** %0
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ priklad_dva();
int /*<<< orphan*/ priklad_jedna();
int /*<<< orphan*/ system(char *);
int main() {
  priklad_jedna();
  priklad_dva();
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <priklad_jedna@plt>
mov    $0x0,%al
call   1050 <priklad_dva@plt>
lea    0xeb7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <priklad_jedna@plt>
xor    %eax,%eax
call   1050 <priklad_dva@plt>
lea    0xeba(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = call i32 (...) @priklad_jedna()
%2 = call i32 (...) @priklad_dva()
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 (...) @priklad_jedna()
%2 = tail call i32 (...) @priklad_dva()
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int c036(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c036() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_proplist_size() {
  printf("NOT IMPLEMENTED:"
         "pa_proplist_size"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"NOT IMPLEMENTED:pa_proplist_size\0A\00"
define i32 @pa_proplist_size() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_proplist_size\00"
define i32 @pa_proplist_size() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int brothers;
  int brides;
  brothers = 7;
  brides = 7;
  printf("%d brides for %d brothers", brides, brothers);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [26 x i8] c"%d brides for %d brothers\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 7, i32 7)
ret i32 0
}
/* Variables and functions */
int mprotect(void *addr, size_t len, int prot) { return (int)-1; }


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

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

LLVM IR (-O0):
define i32 @mprotect(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @mprotect(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 -1
}
/* Type definitions */
struct timespec {
  long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int waitatick(void) {
  struct timespec delay;
  delay.tv_sec = 0;
  delay.tv_nsec = 500000000L;
  if (nanosleep(&delay, NULL)) {
    perror("nanosleep");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<waitatick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
movq   $0x1dcd6500,-0x18(%rbp)
1d
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
je     1167 <waitatick+0x47>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116e <waitatick+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitatick>:
push   %rbx
sub    $0x10,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
test   %rax,%rax
jne    1149 <waitatick+0x29>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xec0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%ebx
jmp    1141 <waitatick+0x21>

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@.str = [10 x i8] c"nanosleep\00"
define i32 @waitatick() {
%1 = alloca i32
%2 = alloca %struct.timespec
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 500000000, i64* %4
%5 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@.str = [10 x i8] c"nanosleep\00"
define i32 @waitatick() {
%1 = alloca <2 x i64>
%2 = bitcast <2 x i64>* %1 to %struct.timespec*
%3 = bitcast <2 x i64>* %1 to i8*
store <2 x i64> <i64 500000000, i64 0>, <2 x i64>* %1
%4 = call i64 @nanosleep(%struct.timespec* %2, i32* null)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %6
%9 = phi i32 [ 1, %6 ], [ 0, %0 ]
ret i32 %9
}
int test_imm_E9uint16_mem(unsigned short *val) {
  return ((*val) & (0xE9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E9uint16_mem>:
testb  $0xe9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E9uint16_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, 233
%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_E9uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 233
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rop3_130_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_130_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_130_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_130_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int close(int);
int udpClose(int fd) { return close(fd); }


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

x86 assembly (clang, -O2):
<udpClose>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @udpClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Type definitions */
struct block {
  int dummy;
};

/* Variables and functions */
size_t serialize_block(int /*<<< orphan*/ *, struct block const *);
size_t block_size(struct block const *block) {
  return serialize_block(NULL, block);
}


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

x86 assembly (clang, -O2):
<block_size>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <serialize_block@plt>

LLVM IR (-O0):
%struct.block = type { i32 }
define i64 @block_size(%struct.block* %0) {
%2 = alloca %struct.block*
store %struct.block* %0, %struct.block** %2
%3 = load %struct.block*, %struct.block** %2
%4 = call i64 @serialize_block(i32* null, %struct.block* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.block = type { i32 }
define i64 @block_size(%struct.block* %0) {
%2 = tail call i64 @serialize_block(i32* null, %struct.block* %0)
ret i64 %2
}
int test_imm_76int8_mem(signed char *val) {
  return ((*val) & (-0x76 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_76int8_mem>:
testb  $0x8a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_76int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -118
%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_76int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -118
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
wr_int2(fd, i) {
  char buf[2];
  {
    register int j = (i);
    (((buf)[0] = (j)), ((buf)[1] = (j) >> 8));
  };
  wr_bytes(fd, buf, 2L);
}


x86 assembly (clang, -O0):
<wr_int2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0x14(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xe(%rbp),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <wr_bytes@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr_int2>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <wr_bytes@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wr_int2(i32 %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @wr_bytes to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %4, i64 2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void printRecCount(int *recCount, int max) {
  int i;
  for (i = 1; i <= max; i++) {
    printf("\n  Rec Count at rank %2d is %d.", i + 1, recCount[i]);
  }
}


x86 assembly (clang, -O0):
<printRecCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     115d <printRecCount+0x4d>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printRecCount+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printRecCount>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printRecCount+0x47>
mov    %esi,%r15d
mov    %rdi,%r14
add    $0x1,%r15d
mov    $0x1,%ebx
lea    0xece(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edx
add    $0x1,%rbx
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %rbx,%r15
jne    1140 <printRecCount+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\0A Rec Count at rank %2d is %d.\00"
define void @printRecCount(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0A Rec Count at rank %2d is %d.\00"
define void @printRecCount(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = load i32, i32* %10
%12 = trunc i64 %9 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %11)
%14 = icmp eq i64 %9, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %2
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_length_current_dobldobl_solution_string(int *cursor, int *n) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(526, cursor, n, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<solcon_length_current_dobldobl_solution_string>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x20e,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @solcon_length_current_dobldobl_solution_string(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 526, i32* %0, i32* %1, double* undef)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ cgincloc(char *, int, int);
void cgdecpl(int a, int v) { cgincloc("sub", a, v); }


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

x86 assembly (clang, -O2):
<cgdecpl>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <cgincloc@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"sub\00"
define void @cgdecpl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @cgincloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"sub\00"
define void @cgdecpl(i32 %0, i32 %1) {
%3 = tail call i32 @cgincloc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *, char *);
void redm(const char *red_msg) {
  printf("%s%s%s\n", "\033[31m", red_msg, "\033[0m");
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"%s%s%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @redm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s%s%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @redm(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int dbg_create_files(struct ci13xxx *ci) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ci13xxx = type opaque
define i32 @dbg_create_files(%struct.ci13xxx* nocapture readnone %0) {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void set_XGravityEvent_serial(void *_p, unsigned long _v) {
  ((XGravityEvent *)_p)->serial = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XGravityEvent_serial>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XGravityEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int sscanf(char *, char *, int *);
int get_int(int argc, char **argv) {
  if (argc < 2) {
    return -1;
  }
  int ret;
  if (sscanf(argv[1], "%d", &ret) == 1) {
    return ret;
  }
  return -1;
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1135 <get_int+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <get_int+0x58>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xebc(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
jne    1161 <get_int+0x51>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <get_int+0x58>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jl     1144 <get_int+0x34>
push   %rax
mov    0x8(%rsi),%rdi
lea    0xeda(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x1,%ecx
jne    1140 <get_int+0x30>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @get_int(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %19
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sscanf(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i32, i32* %6
store i32 %17, i32* %3
br label %19
18: ; preds = %10
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %16, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @get_int(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp slt i32 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = icmp eq i32 %9, 1
%11 = load i32, i32* %3
%12 = select i1 %10, i32 %11, i32 -1
br label %13
13: ; preds = %2, %5
%14 = phi i32 [ %12, %5 ], [ -1, %2 ]
ret i32 %14
}
void __tracepoint_handle(struct __trace_point *tp) {}


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

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

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

LLVM IR (-O2):
%struct.__trace_point = type opaque
define void @__tracepoint_handle(%struct.__trace_point* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ increment(int *);
void test() {
  uint64_t i = 42;
  increment(&i);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2a,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <increment@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
movl   $0x2a,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <increment@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
store i32 42, i32* %1
%2 = call i32 @increment(i32* %1)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 42, i32* %1
%3 = call i32 @increment(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_lmatrix(long **m, long nrl, long ncl) {
  free((char *)(m[nrl] + ncl - 1));
  free((char *)(m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_lmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_lmatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rdx,8),%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_lmatrix(i64** %0, i64 %1, i64 %2) {
%4 = alloca i64**
%5 = alloca i64
%6 = alloca i64
store i64** %0, i64*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64**, i64*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i64*, i64** %7, i64 %8
%10 = load i64*, i64** %9
%11 = load i64, i64* %6
%12 = getelementptr inbounds i64, i64* %10, i64 %11
%13 = getelementptr inbounds i64, i64* %12, i64 -1
%14 = bitcast i64* %13 to i8*
%15 = call i32 @free(i8* %14)
%16 = load i64**, i64*** %4
%17 = load i64, i64* %5
%18 = getelementptr inbounds i64*, i64** %16, i64 %17
%19 = getelementptr inbounds i64*, i64** %18, i64 -1
%20 = bitcast i64** %19 to i8*
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
define void @free_lmatrix(i64** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64*, i64** %0, i64 %1
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 %2
%7 = getelementptr inbounds i64, i64* %6, i64 -1
%8 = bitcast i64* %7 to i8*
%9 = tail call i32 @free(i8* %8)
%10 = getelementptr inbounds i64*, i64** %4, i64 -1
%11 = bitcast i64** %10 to i8*
%12 = tail call i32 @free(i8* %11)
ret void
}