xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ shell_insert(int *, int, int);
void shell_sort(int a[], int n) {
  int dk = n / 2;
  while (dk >= 1) {
    shell_insert(a, n, dk);
    dk /= 2;
  }
}


x86 assembly (clang, -O0):
<shell_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1159 <shell_sort+0x49>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <shell_insert@plt>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    112d <shell_sort+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x2,%esi
jl     114b <shell_sort+0x3b>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
mov    %r15d,%ebp
nopw   0x0(%rax,%rax,1)
shr    $0x1f,%ebp
add    %ebx,%ebp
sar    %ebp
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1030 <shell_insert@plt>
cmp    $0x3,%ebx
mov    %ebp,%ebx
jg     1130 <shell_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @shell_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 2
store i32 %7, i32* %5
br label %8
8: ; preds = %11, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 1
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @shell_insert(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %5
%17 = sdiv i32 %16, 2
store i32 %17, i32* %5
br label %8
18: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @shell_sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %6, %4 ], [ %1, %2 ]
%6 = sdiv i32 %5, 2
%7 = tail call i32 @shell_insert(i32* %0, i32 %1, i32 %6)
%8 = icmp sgt i32 %5, 3
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int partition(char **, int, int);
void quick_sort_str(char **array, int l, int r) {
  int j;
  if (l < r) {
    j = partition(array, l, r);
    quick_sort_str(array, l, j - 1);
    quick_sort_str(array, j + 1, r);
  }
}


x86 assembly (clang, -O0):
<quick_sort_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort_str+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort_str@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort_str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort_str>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort_str+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort_str@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort_str(i8** %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i8** %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort_str(i8** %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
call1b(us, ui, ul, uc) unsigned short us;
unsigned int ui;
unsigned long ul;
unsigned char uc;
{
  uc = 5;
  us = 6;
  ui = 7;
  ul = 8;
}


x86 assembly (clang, -O0):
<call1b>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %di,%cx
mov    %cx,-0x6(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movb   $0x5,-0x19(%rbp)
movw   $0x6,-0x6(%rbp)
movl   $0x7,-0xc(%rbp)
movq   $0x8,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @call1b(i32 %0, i32 %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8
%10 = trunc i32 %0 to i16
%11 = trunc i32 %3 to i8
store i16 %10, i16* %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8 %11, i8* %9
store i8 5, i8* %9
store i16 6, i16* %6
store i32 7, i32* %7
store i64 8, i64* %8
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @call1b(i32 %0, i32 %1, i64 %2, i32 %3) {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
void set_XKeyReleasedEvent_y(void *_p, int _v) {
  ((XKeyReleasedEvent *)_p)->y = (int)_v;
}


x86 assembly (clang, -O0):
<set_XKeyReleasedEvent_y>:
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_XKeyReleasedEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeyReleasedEvent_y(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_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeyReleasedEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int f1(int q[][3]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f1([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f1([3 x i32]* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AllPoleFilter(float *, float const *, int, int);
int /*<<< orphan*/ AllZeroFilter(float *, float const *, int, int, float *);
void ZeroPoleFilter(float *In, const float *ZeroCoef, const float *PoleCoef,
                    int lengthInOut, int orderCoef, float *Out) {
  AllZeroFilter(In, ZeroCoef, lengthInOut, orderCoef, Out);
  AllPoleFilter(Out, PoleCoef, lengthInOut, orderCoef);
}


x86 assembly (clang, -O0):
<ZeroPoleFilter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x28(%rbp),%r8
call   1030 <AllZeroFilter@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <AllPoleFilter@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZeroPoleFilter>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r9,%rbx
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %rdx,%r15
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %r9,%r8
call   1030 <AllZeroFilter@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <AllPoleFilter@plt>

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

LLVM IR (-O2):
define void @ZeroPoleFilter(float* %0, float* %1, float* %2, i32 %3, i32 %4, float* %5) {
%7 = tail call i32 @AllZeroFilter(float* %0, float* %1, i32 %3, i32 %4, float* %5)
%8 = tail call i32 @AllPoleFilter(float* %5, float* %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ argumentCheck(int);
scalar_t__ fileCheck(char *, char *);
int /*<<< orphan*/ lexicalAnalyzer(char *, char *);
int main(int argc, char *argv[]) {
  if (argumentCheck(argc))
    if (fileCheck(argv[1], argv[0])) {
      lexicalAnalyzer(argv[1], argv[0]);
    }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <argumentCheck@plt>
cmp    $0x0,%rax
je     118f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1050 <fileCheck@plt>
cmp    $0x0,%rax
je     118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1040 <lexicalAnalyzer@plt>
jmp    118f <main+0x5f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
call   1030 <argumentCheck@plt>
test   %rax,%rax
je     115b <main+0x2b>
mov    (%rbx),%rsi
mov    0x8(%rbx),%rdi
call   1050 <fileCheck@plt>
test   %rax,%rax
je     115b <main+0x2b>
mov    (%rbx),%rsi
mov    0x8(%rbx),%rdi
call   1040 <lexicalAnalyzer@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @argumentCheck(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = load i8*, i8** %1
%9 = tail call i64 @fileCheck(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = load i8*, i8** %6
%13 = load i8*, i8** %1
%14 = tail call i32 @lexicalAnalyzer(i8* %12, i8* %13)
br label %15
15: ; preds = %5, %11, %2
ret i32 0
}
void RTReqGetStatus(void) {}


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

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

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

LLVM IR (-O2):
define void @RTReqGetStatus() {
ret void
}
/* Type definitions */
typedef uintptr_t uint32_t;

/* Variables and functions */
void mmio32_write(uintptr_t base, uint32_t reg, uint32_t data) {
  *(volatile uintptr_t *)(base + reg) = data;
}


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

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

LLVM IR (-O0):
define void @mmio32_write(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* %6
%8 = load i64, i64* %4
%9 = load i64, i64* %5
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
store volatile i64 %7, i64* %11
ret void
}

LLVM IR (-O2):
define void @mmio32_write(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %1, %0
%5 = inttoptr i64 %4 to i64*
store volatile i64 %2, i64* %5
ret void
}
/* Variables and functions */
double log(int);
double gt_calculateKr(double d) {
  double kr;
  kr = -0.75 * log(1 - 4.0 / 3.0 * d);
  return kr;
}


x86 assembly (clang, -O0):
<gt_calculateKr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_calculateKr>:
push   %rax
mulsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gt_calculateKr(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 0xBFF5555555555555, double %4, double 1.000000e+00)
%6 = fptosi double %5 to i32
%7 = call double @log(i32 %6)
%8 = fmul double -7.500000e-01, %7
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @gt_calculateKr(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0xBFF5555555555555, double 1.000000e+00)
%3 = fptosi double %2 to i32
%4 = tail call double @log(i32 %3)
%5 = fmul double %4, -7.500000e-01
ret double %5
}
void *downs_memset(void *s, int c, unsigned int n) {
  unsigned int i = 0;
  for (i = 0; i < n; ++i) {
    ((unsigned char *)s)[i] = c;
  }
  return s;
}


x86 assembly (clang, -O0):
<downs_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    1145 <downs_memset+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <downs_memset+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<downs_memset>:
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
je     1122 <downs_memset+0x12>
mov    %edx,%edx
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @downs_memset(i8* returned writeonly %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %3
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ do_for_runlevel(int /*<<< orphan*/, int);
void enter_runlevel(uint8_t newmask) {
  do_for_runlevel(newmask, 3);
  do_for_runlevel(newmask, 4);
}


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

x86 assembly (clang, -O2):
<enter_runlevel>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%esi
call   1030 <do_for_runlevel@plt>
mov    %ebx,%edi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <do_for_runlevel@plt>

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

LLVM IR (-O2):
define void @enter_runlevel(i32 %0) {
%2 = tail call i32 @do_for_runlevel(i32 %0, i32 3)
%3 = tail call i32 @do_for_runlevel(i32 %0, i32 4)
ret void
}
/* Variables and functions */
int fun_stub(int, int);
int fun_call(int a, int b) {
  int stub_ret = fun_stub(a + 1, b + 1);
  if (stub_ret < 0) {
    return -1;
  } else if (stub_ret == 0) {
    return 0;
  } else {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<fun_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <fun_stub@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1148 <fun_call+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <fun_call+0x55>
cmpl   $0x0,-0x10(%rbp)
jne    115e <fun_call+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <fun_call+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call>:
push   %rax
add    $0x1,%edi
add    $0x1,%esi
call   1030 <fun_stub@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fun_call(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = add nsw i32 %1, 1
%5 = tail call i32 @fun_stub(i32 %3, i32 %4)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
%8 = icmp sgt i32 %5, -1
%9 = select i1 %8, i32 %7, i32 -1
ret i32 %9
}
/* Variables and functions */
long hashing(char *, int);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  int i = 0;
  long answ = 0;
  char sent[200];
  scanf("%[^\n]s", sent);
  i = strlen(sent);
  answ = hashing(sent, i);
  printf("%ld", answ);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0xe0(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <hashing@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xeb1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <hashing@plt>
lea    0xe94(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca [200 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store i64 0, i64* %3
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %2
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i64 @hashing(i8* %9, i32 %10)
store i64 %11, i64* %3
%12 = load i64, i64* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i64 @hashing(i8* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
void string_remove_char(char *string, int pos) {
  memmove(string + pos, string + pos + 1, strlen(string) - pos);
}


x86 assembly (clang, -O0):
<string_remove_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
movslq -0xc(%rbp),%rax
sub    %rax,%rdx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_remove_char>:
push   %r15
push   %r14
push   %rbx
movslq %esi,%rbx
lea    (%rdi,%rbx,1),%r15
lea    (%rdi,%rbx,1),%r14
add    $0x1,%r14
call   1030 <strlen@plt>
sub    %rbx,%rax
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define void @string_remove_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %3
%15 = call i64 @strlen(i8* %14)
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = sub nsw i64 %15, %17
%19 = call i32 @memmove(i8* %8, i8* %13, i64 %18)
ret void
}

LLVM IR (-O2):
define void @string_remove_char(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = sub nsw i64 %6, %3
%8 = tail call i32 @memmove(i8* %4, i8* %5, i64 %7)
ret void
}
/* Variables and functions */
char *gtm_malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *cdbg_makstr(char *str, char **buf, int len) {
  *buf = gtm_malloc(len + 1);
  memcpy(*buf, str, len);
  (*buf)[len] = 0;
  return *buf;
}


x86 assembly (clang, -O0):
<cdbg_makstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <gtm_malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdbg_makstr>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rbx),%edi
call   1040 <gtm_malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
mov    (%r14),%rax
movslq %ebx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    (%r14),%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @cdbg_makstr(i8* %0, i8** nocapture %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i8* @gtm_malloc(i32 %4)
store i8* %5, i8** %1
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %2)
%7 = load i8*, i8** %1
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8 0, i8* %9
%10 = load i8*, i8** %1
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv[]) {
  fprintf(stderr,
          "Usage: %s [-n number of pages] [-i max iterations] [-t threshold]\n",
          argv[0]);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xedd(%rip),%rsi
mov    %eax,%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: %s [-n number of pages] [-i max iterations] [-t threshold]\0A\00"
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: %s [-n number of pages] [-i max iterations] [-t threshold]\0A\00"
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_getcpu;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
int /*<<< orphan*/ syscall(int /*<<< orphan*/, unsigned int *, unsigned int *,
                           int /*<<< orphan*/ *);
void *main_thread(void *arg) {
  (void)arg;
  unsigned cpu, numa;
  assert(!syscall(SYS_getcpu, &cpu, &numa, NULL));
  printf("%u %u\n", cpu, numa);
  return NULL;
}


x86 assembly (clang, -O0):
<main_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1050 <syscall@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_thread>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %ecx,%ecx
call   1050 <syscall@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_getcpu = global i32 0
@.str = [7 x i8] c"%u %u\0A\00"
define i8* @main_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @SYS_getcpu
%7 = call i32 @syscall(i32 %6, i32* %3, i32* %4, i32* null)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13)
ret i8* null
}

LLVM IR (-O2):
@SYS_getcpu = global i32 0
@.str = [7 x i8] c"%u %u\0A\00"
define noalias i8* @main_thread(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
%6 = load i32, i32* @SYS_getcpu
%7 = call i32 @syscall(i32 %6, i32* %2, i32* %3, i32* null)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_remove_sample() {
  printf("NOT IMPLEMENTED:"
         "pa_context_remove_sample"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_remove_sample>:
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_context_remove_sample>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_context_remove_sample\00"
define i32 @pa_context_remove_sample() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int foo(int x) {
  foo(x);
  int y = foo(x);
  return foo(y);
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   1030 <foo@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <foo+0x10>

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = tail call i32 @foo(i32 %0)
br label %3
3: ; preds = %3, %1
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ enomem();
void *malloc(size_t);
void *emalloc(size_t len) {
  void *p;
  if ((p = malloc(len)) == NULL)
    enomem();
  return (p);
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    114a <emalloc+0x2a>
mov    $0x0,%al
call   1030 <enomem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <emalloc+0x15>
xor    %eax,%eax
call   1030 <enomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @enomem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ALnullState_Delete(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @ALnullState_Delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ zfree(char *);
void strfree(char *str) { zfree(str); }


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

x86 assembly (clang, -O2):
<strfree>:
jmp    1030 <zfree@plt>

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

LLVM IR (-O2):
define void @strfree(i8* %0) {
%2 = tail call i32 @zfree(i8* %0)
ret void
}
unsigned int f2(int xxx, unsigned int yyy) { return xxx ? -1 : yyy; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1121 <f2+0x21>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <f2+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
neg    %edi
sbb    %eax,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %10
10: ; preds = %8, %7
%11 = phi i32 [ -1, %7 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_cleanup(void *p) { free(*(void **)p); }


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

x86 assembly (clang, -O2):
<free_cleanup>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_cleanup(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Led1__clr();
void LedsP__Leds__led1On(void) {
  LedsP__Led1__clr();
  ;
  ;
}


x86 assembly (clang, -O0):
<LedsP__Leds__led1On>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LedsP__Led1__clr@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @LedsP__Leds__led1On() {
%1 = call i32 (...) @LedsP__Led1__clr()
ret void
}

LLVM IR (-O2):
define void @LedsP__Leds__led1On() {
%1 = tail call i32 (...) @LedsP__Led1__clr()
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, scalar_t__, char const *);
scalar_t__ totaldiratpath(char const *);
int runforpath(const char *path) {
  off_t size = totaldiratpath(path);
  printf("%lld\t%s\n", size, path);
  return size >= 0 ? EXIT_SUCCESS : EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<runforpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <totaldiratpath@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
jl     1169 <runforpath+0x49>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1175 <runforpath+0x55>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runforpath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <totaldiratpath@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rdi
mov    %rax,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
test   %rbx,%rbx
js     114f <runforpath+0x2f>
mov    0x2e8b(%rip),%rax
jmp    1156 <runforpath+0x36>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%lld\09%s\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @runforpath(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @totaldiratpath(i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %6, i8* %7)
%9 = load i64, i64* %3
%10 = icmp sge i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i32, i32* @EXIT_SUCCESS
br label %15
13: ; preds = %1
%14 = load i32, i32* @EXIT_FAILURE
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
ret i32 %16
}

LLVM IR (-O2):
@.str = [9 x i8] c"%lld\09%s\0A\00"
@EXIT_SUCCESS = global i32 0
@EXIT_FAILURE = global i32 0
define i32 @runforpath(i8* %0) {
%2 = tail call i64 @totaldiratpath(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %2, i8* %0)
%4 = icmp sgt i64 %2, -1
%5 = load i32, i32* @EXIT_SUCCESS
%6 = load i32, i32* @EXIT_FAILURE
%7 = select i1 %4, i32 %5, i32 %6
ret i32 %7
}
/* Variables and functions */
int rand();
int selectRandomNServices(int n) { return rand() % n; }


x86 assembly (clang, -O0):
<selectRandomNServices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectRandomNServices>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @selectRandomNServices(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
ret i32 %3
}
int bm_stores() { return 42; }


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

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

LLVM IR (-O0):
define i32 @bm_stores() {
ret i32 42
}

LLVM IR (-O2):
define i32 @bm_stores() {
ret i32 42
}
int len(char *data) {
  int i = 0;
  while (data[i++])
    ;
  return i - 1;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1130 <len+0x30>
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <len+0x10>
ret

LLVM IR (-O0):
define i32 @len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %4
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int balloon_sysfs_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @balloon_sysfs_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void nr_free_cvector(unsigned char *v, long nl, long nh) {
  free((char *)(v + nl - 1));
}


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

x86 assembly (clang, -O2):
<nr_free_cvector>:
add    %rsi,%rdi
add    $0xffffffffffffffff,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @nr_free_cvector(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @nr_free_cvector(i8* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nand_reset();
void nand_init(void) {
  (*((volatile unsigned long *)0x7E00F120)) &= ~(1 << 1);
  (*((volatile unsigned long *)0x70200000)) &=
      ~((1 << 30) | (7 << 12) | (7 << 8) | (7 << 4));
  (*((volatile unsigned long *)0x70200000)) |=
      ((0 << 12) | (1 << 8) | (0 << 4));
  (*((volatile unsigned long *)0x70200004)) |= 1;
  nand_reset();
}


x86 assembly (clang, -O0):
<nand_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e00f120,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x7e00f120,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
and    $0xffffffffbfff888f,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200000,%eax
mov    (%rax),%rcx
or     $0x100,%rcx
mov    $0x70200000,%eax
mov    %rcx,(%rax)
mov    $0x70200004,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x70200004,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <nand_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_init>:
andq   $0xfffffffffffffffd,0x7e00f120
7e fd
andq   $0xffffffffbfff888f,0x70200000
70 8f 88 ff bf
orq    $0x100,0x70200000
orq    $0x1,0x70200004
70 01
xor    %eax,%eax
jmp    1030 <nand_reset@plt>

LLVM IR (-O0):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 2113990944 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2113990944 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = and i64 %3, -1073772401
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%6 = or i64 %5, 256
store volatile i64 %6, i64* inttoptr (i64 1881145344 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1881145348 to i64*)
%9 = call i32 (...) @nand_reset()
ret void
}

LLVM IR (-O2):
define void @nand_init() {
%1 = load volatile i64, i64* inttoptr (i64 2113990944 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2113990944 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%4 = and i64 %3, -1073772401
store volatile i64 %4, i64* inttoptr (i64 1881145344 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1881145344 to i64*)
%6 = or i64 %5, 256
store volatile i64 %6, i64* inttoptr (i64 1881145344 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1881145348 to i64*)
%8 = or i64 %7, 1
store volatile i64 %8, i64* inttoptr (i64 1881145348 to i64*)
%9 = tail call i32 (...) @nand_reset()
ret void
}
/* Type definitions */
struct varmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ varmap_append_no_term(struct varmap **, char const *, int,
                                         int const);
void varmap_append_c(struct varmap **b, const char c, const int sync) {
  varmap_append_no_term(b, &c, 1, sync);
}


x86 assembly (clang, -O0):
<varmap_append_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <varmap_append_no_term@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varmap_append_c>:
push   %rax
mov    %edx,%ecx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <varmap_append_no_term@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.varmap = type { i32 }
define void @varmap_append_c(%struct.varmap** %0, i8 signext %1, i32 %2) {
%4 = alloca %struct.varmap**
%5 = alloca i8
%6 = alloca i32
store %struct.varmap** %0, %struct.varmap*** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load %struct.varmap**, %struct.varmap*** %4
%8 = load i32, i32* %6
%9 = call i32 @varmap_append_no_term(%struct.varmap** %7, i8* %5, i32 1, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.varmap = type { i32 }
define void @varmap_append_c(%struct.varmap** %0, i8 signext %1, i32 %2) {
%4 = alloca i8
store i8 %1, i8* %4
%5 = call i32 @varmap_append_no_term(%struct.varmap** %0, i8* %4, i32 1, i32 %2)
ret void
}