xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rev8(int);
uint32_t encode_voltage(uint32_t v) {
  return rev8((0x78 - v / 125) << 1 | 1) << 8;
}


x86 assembly (clang, -O0):
<encode_voltage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x7d,%ecx
cltd
idiv   %ecx
mov    $0x78,%edi
sub    %eax,%edi
shl    $0x1,%edi
or     $0x1,%edi
call   1030 <rev8@plt>
shl    $0x8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_voltage>:
push   %rax
movslq %edi,%rax
imul   $0xffffffffef9db22d,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x23,%rax
add    %ecx,%eax
lea    (%rax,%rax,1),%edi
add    $0xf1,%edi
call   1030 <rev8@plt>
shl    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @encode_voltage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 125
%5 = sub nsw i32 120, %4
%6 = shl i32 %5, 1
%7 = or i32 %6, 1
%8 = call i32 @rev8(i32 %7)
%9 = shl i32 %8, 8
ret i32 %9
}

LLVM IR (-O2):
define i32 @encode_voltage(i32 %0) {
%2 = sdiv i32 %0, -125
%3 = shl nsw i32 %2, 1
%4 = add i32 %3, 241
%5 = tail call i32 @rev8(i32 %4)
%6 = shl i32 %5, 8
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ assert_mem_eq(int *, int *, int /*<<< orphan*/);
void test_assert_mem_eq_pass_2(void) {
  int a[6] = {1, 2, 3, 4, 5, 6};
  int b[6] = {6, 5, 4, 3, 2, 1};
  assert_mem_eq(a, b, 0);
}


x86 assembly (clang, -O0):
<test_assert_mem_eq_pass_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xee0(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
xor    %edx,%edx
call   1030 <assert_mem_eq@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_mem_eq_pass_2>:
sub    $0x38,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xefd(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <assert_mem_eq@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.test_assert_mem_eq_pass_2.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.test_assert_mem_eq_pass_2.b = [6 x i32] [i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define void @test_assert_mem_eq_pass_2() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @assert_mem_eq(i32* %5, i32* %6, i32 0)
ret void
}

LLVM IR (-O2):
@__const.test_assert_mem_eq_pass_2.a = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@__const.test_assert_mem_eq_pass_2.b = [6 x i32] [i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
define void @test_assert_mem_eq_pass_2() {
%1 = alloca [6 x i32]
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast [6 x i32]* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @assert_mem_eq(i32* %5, i32* %6, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x8a() {
  Assert_real((isodigit(138) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              695, ("isodigit should be 0 for 0x8a"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x8a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8a,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2b7,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x8a>:
push   %rax
mov    $0x8a,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x2b7,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8a\00"
define void @t_isodigit_0x8a() {
%1 = call i64 @isodigit(i32 138)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x8a\00"
define void @t_isodigit_0x8a() {
%1 = tail call i64 @isodigit(i32 138)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 695, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ri_parallel_finalize() {}


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

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

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

LLVM IR (-O2):
define void @ri_parallel_finalize() {
ret void
}
/* Type definitions */
struct cfbuf_obj {
  int dummy;
};

/* Variables and functions */
int cfbuf__close(struct cfbuf_obj *);
int teardown(struct cfbuf_obj *f) { return cfbuf__close(f); }


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

x86 assembly (clang, -O2):
<teardown>:
jmp    1030 <cfbuf__close@plt>

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

LLVM IR (-O2):
%struct.cfbuf_obj = type { i32 }
define i32 @teardown(%struct.cfbuf_obj* %0) {
%2 = tail call i32 @cfbuf__close(%struct.cfbuf_obj* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void heap_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<heap_free>:
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):
<heap_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @heap_free(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 @heap_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: RNAheat [-Tmin t1] [-Tmax t2] [-h stepsize] [-m ipoints] "
          "[-4] [-d]\n"
          "               [-noGU] [-noCloseGU] [-noLP] [-e 1|2] [-P paramfile] "
          "[-nsp pairs]");
}


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

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

LLVM IR (-O0):
@.str = [155 x i8] c"usage: RNAheat [-Tmin t1] [-Tmax t2] [-h stepsize] [-m ipoints] [-4] [-d]\0A [-noGU] [-noCloseGU] [-noLP] [-e 1|2] [-P paramfile] [-nsp pairs]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [155 x i8] c"usage: RNAheat [-Tmin t1] [-Tmax t2] [-h stepsize] [-m ipoints] [-4] [-d]\0A [-noGU] [-noCloseGU] [-noLP] [-e 1|2] [-P paramfile] [-nsp pairs]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str, i64 0, i64 0))
ret void
}
AX0I1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((((unsigned short *)10000000)[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzwl (%rax,%rcx,2),%eax
cmp    $0x21,%eax
jg     1141 <AX0I1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <AX0I1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpw   $0x22,0x989680(%rcx,%rcx,1)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @AX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 10000000 to i16*), i64 %7
%9 = load i16, i16* %8
%10 = icmp ult i16 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
double va_ri(double redchan, double bluechan, double greenchan) {
  double result;
  result = (greenchan - redchan) / (greenchan + redchan - bluechan);
  return result;
}


x86 assembly (clang, -O0):
<va_ri>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<va_ri>:
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
addsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define double @va_ri(double %0, double %1, double %2) {
%4 = fsub double %2, %0
%5 = fadd double %0, %2
%6 = fsub double %5, %1
%7 = fdiv double %4, %6
ret double %7
}
void make_model() {}


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

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

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

LLVM IR (-O2):
define void @make_model() {
ret void
}
void free_array(float **arr) {
  free(arr[0]);
  free(arr);
}


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

x86 assembly (clang, -O2):
<free_array>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_array(float** %0) {
%2 = alloca float**
store float** %0, float*** %2
%3 = load float**, float*** %2
%4 = getelementptr inbounds float*, float** %3, i64 0
%5 = load float*, float** %4
%6 = bitcast float* %5 to i8*
%7 = load float**, float*** %2
%8 = bitcast float** %7 to i8*
ret void
}

LLVM IR (-O2):
define void @free_array(float** nocapture %0) {
%2 = bitcast float** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast float** %0 to i8*
tail call void @free(i8* %4)
ret void
}
int main(void) {
  unsigned char var = 1;
  if (var != 1)
    abort();
  {
    extern unsigned char var;
    asm(".globl "
        "extern_block_start");
    asm("extern_block_start"
        ":");
    if (var != 2)
      abort();
    asm(".globl "
        "extern_block_end");
    asm("extern_block_end"
        ":");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x1,%eax
je     1135 <extern_block_start>
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax

LLVM IR (-O0):
@var = external global i8
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
unreachable
7: ; preds = %0
%8 = load i8, i8* @var
%9 = zext i8 %8 to i32
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %7
unreachable
12: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@var = external global i8
define i32 @main() {
tail call void asm sideeffect ".globl extern_block_start", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "extern_block_start:", "~{dirflag},~{fpsr},~{flags}"()
%1 = load i8, i8* @var
%2 = icmp eq i8 %1, 2
br i1 %2, label %4, label %3
3: ; preds = %0
tail call void @abort()
unreachable
4: ; preds = %0
tail call void asm sideeffect ".globl extern_block_end", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "extern_block_end:", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read_mosaic_xgrid_order2(char const *, int *, int *, int *,
                                            int *, double *, double *,
                                            double *);
void read_mosaic_xgrid_order2_(const char *xgrid_file, int *i1, int *j1,
                               int *i2, int *j2, double *area, double *di,
                               double *dj) {
  read_mosaic_xgrid_order2(xgrid_file, i1, j1, i2, j2, area, di, dj);
}


x86 assembly (clang, -O0):
<read_mosaic_xgrid_order2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <read_mosaic_xgrid_order2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mosaic_xgrid_order2_>:
jmp    1030 <read_mosaic_xgrid_order2@plt>

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

LLVM IR (-O2):
define void @read_mosaic_xgrid_order2_(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5, double* %6, double* %7) {
%9 = tail call i32 @read_mosaic_xgrid_order2(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, double* %5, double* %6, double* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ munmap(char *, size_t);
unsigned int sysconf(int /*<<< orphan*/);
void unmapfile(char *map, size_t size) {
  unsigned ps = sysconf(_SC_PAGESIZE);
  munmap(map, (size + ps - 1) & ~(ps - 1));
}


x86 assembly (clang, -O0):
<unmapfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    %rax,%rsi
sub    $0x1,%rsi
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
xor    $0xffffffff,%eax
mov    %eax,%eax
and    %rax,%rsi
call   1030 <munmap@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmapfile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    (%rbx,%rax,1),%esi
add    $0xffffffff,%esi
neg    %eax
and    %eax,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <munmap@plt>

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
define void @unmapfile(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i32, i32* @_SC_PAGESIZE
%7 = call i32 @sysconf(i32 %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = add i64 %9, %11
%13 = sub i64 %12, 1
%14 = load i32, i32* %5
%15 = sub i32 %14, 1
%16 = xor i32 %15, -1
%17 = zext i32 %16 to i64
%18 = and i64 %13, %17
%19 = call i32 @munmap(i8* %8, i64 %18)
ret void
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
define void @unmapfile(i8* %0, i64 %1) {
%3 = load i32, i32* @_SC_PAGESIZE
%4 = tail call i32 @sysconf(i32 %3)
%5 = zext i32 %4 to i64
%6 = add i64 %1, 4294967295
%7 = add i64 %6, %5
%8 = sub i32 0, %4
%9 = zext i32 %8 to i64
%10 = and i64 %7, %9
%11 = tail call i32 @munmap(i8* %0, i64 %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *message) {
  printf("%s\n", message);
  printf("Usage: gps -s sample_rate -i if_freq -o offset filename\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [57 x i8] c"Usage: gps -s sample_rate -i if_freq -o offset filename\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [56 x i8] c"Usage: gps -s sample_rate -i if_freq -o offset filename\00"
define void @usage(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int get_groups(int max_levels, int lvl) {
  return lvl == max_levels ? 1 : (1 << 8);
}


x86 assembly (clang, -O0):
<get_groups>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%esi
mov    $0x100,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_groups>:
cmp    %edi,%esi
mov    $0x1,%ecx
mov    $0x100,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_groups(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 256
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_groups(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
%4 = select i1 %3, i32 1, i32 256
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY_CTX;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int do_sigver_init(int /*<<< orphan*/ *, int /*<<< orphan*/ **,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *, int /*<<< orphan*/);
int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type,
                       ENGINE *e, EVP_PKEY *pkey) {
  return do_sigver_init(ctx, pctx, type, e, pkey, 0);
}


x86 assembly (clang, -O0):
<EVP_DigestSignInit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
xor    %r9d,%r9d
call   1030 <do_sigver_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_DigestSignInit>:
xor    %r9d,%r9d
jmp    1030 <do_sigver_init@plt>

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

LLVM IR (-O2):
define i32 @EVP_DigestSignInit(i32* %0, i32** %1, i32* %2, i32* %3, i32* %4) {
%6 = tail call i32 @do_sigver_init(i32* %0, i32** %1, i32* %2, i32* %3, i32* %4, i32 0)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ gluOrtho2D(double, int /*<<< orphan*/, double,
                              int /*<<< orphan*/);
void skaliraj(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluOrtho2D(0.0, (GLdouble)w, 0.0, (GLdouble)h);
}


x86 assembly (clang, -O0):
<skaliraj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1050 <gluOrtho2D@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skaliraj>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <gluOrtho2D@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @skaliraj(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 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @gluOrtho2D(double 0.000000e+00, i32 %11, double 0.000000e+00, i32 %12)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @skaliraj(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @gluOrtho2D(double 0.000000e+00, i32 %0, double 0.000000e+00, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uintmax_t;
typedef scalar_t__ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
struct tm *localtime(scalar_t__ *);
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
scalar_t__ time(int /*<<< orphan*/ *);
void get_time() {
  time_t t;
  struct tm *lt;
  t = time(NULL);
  lt = localtime(&t);
  printf("%s%ju secs since the Epoch\n", asctime(lt), (uintmax_t)t);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,%rsi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe85(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
mov    (%rsp),%edx
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
call   1050 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [28 x i8] c"%s%ju secs since the Epoch\0A\00"
define void @get_time() {
%1 = alloca i64
%2 = alloca %struct.tm*
%3 = call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = call %struct.tm* @localtime(i64* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i8* @asctime(%struct.tm* %5)
%7 = load i64, i64* %1
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [28 x i8] c"%s%ju secs since the Epoch\0A\00"
define void @get_time() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 @time(i32* null)
store i64 %3, i64* %1
%4 = call %struct.tm* @localtime(i64* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = load i64, i64* %1
%7 = trunc i64 %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, int);
void TrafficError(char *sFieldName, int dRecordNum) {
  printf("labd: syntax error in %s field on line %d of traffic file\n",
         sFieldName, dRecordNum);
  exit(1);
}


x86 assembly (clang, -O0):
<TrafficError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<TrafficError>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"labd: syntax error in %s field on line %d of traffic file\0A\00"
define void @TrafficError(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 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [59 x i8] c"labd: syntax error in %s field on line %d of traffic file\0A\00"
define void @TrafficError(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int *strchr(char *, char);
void f(int i) {
  char buf[] = "f(_)\n";
  *strchr(buf, '_') = i + '0';
  printf(buf);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x10(%rbp)
lea    -0xa(%rbp),%rdi
mov    $0x5f,%esi
call   1030 <strchr@plt>
mov    -0x10(%rbp),%ecx
mov    %ecx,(%rax)
lea    -0xa(%rbp),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movw   $0xa,0x4(%rsp)
movl   $0x295f2866,(%rsp)
add    $0x30,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x5f,%esi
call   1030 <strchr@plt>
mov    %ebx,(%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.f.buf = [6 x i8] c"f(_)\0A\00"
define void @f(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i8]
store i32 %0, i32* %2
%4 = bitcast [6 x i8]* %3 to i8*
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 48
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = call i32* @strchr(i8* %7, i8 signext 95)
store i32 %6, i32* %8
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%10 = call i32 @printf(i8* %9)
ret void
}

LLVM IR (-O2):
@__const.f.buf = [6 x i8] c"f(_)\0A\00"
define void @f(i32 %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = add nsw i32 %0, 48
%5 = call i32* @strchr(i8* %3, i8 signext 95)
store i32 %4, i32* %5
%6 = call i32 @printf(i8* %3)
ret void
}
void do_group_exit_debug_dump(int exit_code) {}


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

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

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

LLVM IR (-O2):
define void @do_group_exit_debug_dump(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_help(const char *prg) {
  printf("Usage: %s -i <input video> "
         "-f <filter xml> "
         "[-s <training size as edge * edge> ]"
         "[ -x <x resolution> ] "
         "[ -y <y resolution> ] "
         "[-med]"
         "[-edge]"
         "\n",
         prg);
}


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

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

LLVM IR (-O0):
@.str = [138 x i8] c"Usage: %s -i <input video> -f <filter xml> [-s <training size as edge * edge> ][ -x <x resolution> ] [ -y <y resolution> ] [-med][-edge]\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [138 x i8] c"Usage: %s -i <input video> -f <filter xml> [-s <training size as edge * edge> ][ -x <x resolution> ] [ -y <y resolution> ] [-med][-edge]\0A\00"
define void @print_help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double double_plus(double x, double y, int index) { return x + y; }


x86 assembly (clang, -O0):
<double_plus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_plus>:
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @double_plus(double %0, double %1, i32 %2) {
%4 = fadd double %0, %1
ret double %4
}
int eq(void *a, void *b) { return (a == b); }


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @eq(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int fgetc(FILE *f) {
  unsigned char ch;
  return (fread(&ch, 1, 1, f) == 1) ? (int)ch : EOF;
}


x86 assembly (clang, -O0):
<fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1145 <fgetc+0x35>
movzbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <fgetc+0x41>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetc>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     1138 <fgetc+0x28>
mov    0x2eb4(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret
movzbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fgetc(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
br label %12
10: ; preds = %1
%11 = load i32, i32* @EOF
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fgetc(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fread(i8* %2, i32 1, i32 1, i32* %0)
%4 = icmp eq i32 %3, 1
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = load i32, i32* @EOF
%8 = select i1 %4, i32 %6, i32 %7
ret i32 %8
}
long long longlong_ignoring_signedlong(long long x, signed long y) { return x; }


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

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

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

LLVM IR (-O2):
define i64 @longlong_ignoring_signedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
int AND_OP(int x, int y) { return x && y; }


x86 assembly (clang, -O0):
<AND_OP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <AND_OP+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AND_OP>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @AND_OP(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
float __nearbyint(float);
float nearbyintf(float x) { return __nearbyint(x); }


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

x86 assembly (clang, -O2):
<nearbyintf>:
jmp    1030 <__nearbyint@plt>

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

LLVM IR (-O2):
define float @nearbyintf(float %0) {
%2 = tail call float @__nearbyint(float %0)
ret float %2
}
double dot(const double x[], const double y[]) {
  return x[0] * y[0] + x[1] * y[1] + x[2] * y[2];
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double %13, %16
%18 = call double @llvm.fmuladd.f64(double %7, double %10, double %17)
%19 = load double*, double** %3
%20 = getelementptr inbounds double, double* %19, i64 2
%21 = load double, double* %20
%22 = load double*, double** %4
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double, double* %23
%25 = call double @llvm.fmuladd.f64(double %21, double %24, double %18)
ret double %25
}

LLVM IR (-O2):
define double @dot(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
unsigned long long cpucycles(void) {
  unsigned long long result;
  asm volatile(".byte 15;.byte 49;shlq $32,%%rdx;orq %%rdx,%%rax"
               : "=a"(result)::"%rdx");
  return result;
}


x86 assembly (clang, -O0):
<cpucycles>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpucycles>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @cpucycles() {
%1 = alloca i64
%2 = call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @cpucycles() {
%1 = tail call i64 asm sideeffect ".byte 15;.byte 49;shlq $$32,%rdx;orq %rdx,%rax", "={ax},~{rdx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mdelay(int ms) {
  for (; ms > 0; --ms)
    udelay(1000);
}


x86 assembly (clang, -O0):
<mdelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113d <mdelay+0x2d>
mov    $0x3e8,%edi
call   1030 <udelay@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <mdelay+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdelay>:
push   %rbx
test   %edi,%edi
jle    1132 <mdelay+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <udelay@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <mdelay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @mdelay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @udelay(i32 1000)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @mdelay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @udelay(i32 1000)
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *strdup(char *);
char *clib_strdup(char *ptr) { return strdup(ptr); }


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

x86 assembly (clang, -O2):
<clib_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @clib_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printTmpSample(void) {
  printf("Hello tmp repo sample!!\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"Hello tmp repo sample!!\00"
define void @printTmpSample() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int io_in8(int);
void wait_kbc_sendready(void) {
  for (;;) {
    if (0 == (io_in8((0x0064)) & (0x02)))
      break;
  }
}


x86 assembly (clang, -O0):
<wait_kbc_sendready>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <wait_kbc_sendready+0x9>
mov    $0x64,%edi
call   1030 <io_in8@plt>
mov    %eax,%ecx
and    $0x2,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1137 <wait_kbc_sendready+0x27>
jmp    113c <wait_kbc_sendready+0x2c>
jmp    1119 <wait_kbc_sendready+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_kbc_sendready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x64,%edi
call   1030 <io_in8@plt>
test   $0x2,%al
jne    1120 <wait_kbc_sendready+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @wait_kbc_sendready() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 0, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @wait_kbc_sendready() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @io_in8(i32 100)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ makesubtree(unsigned int, int /*<<< orphan*/);
void wl_untar(void) {
  unsigned testcode = 302;
  makesubtree(testcode, 0);
}


x86 assembly (clang, -O0):
<wl_untar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x12e,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <makesubtree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_untar>:
mov    $0x12e,%edi
xor    %esi,%esi
jmp    1030 <makesubtree@plt>

LLVM IR (-O0):
define void @wl_untar() {
%1 = alloca i32
store i32 302, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @makesubtree(i32 %2, i32 0)
ret void
}

LLVM IR (-O2):
define void @wl_untar() {
%1 = tail call i32 @makesubtree(i32 302, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main(void) {
  int a[2];
  a[0] = 2017;
  a[1] = 2018;
  printf("a[0] = %d\na[1] = %d\n", *a, a[1]);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x7e1,%esi
mov    $0x7e2,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"a[0] = %d\0Aa[1] = %d\0A\00"
define void @main() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 2017, i32* %2
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
store i32 2018, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"a[0] = %d\0Aa[1] = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2017, i32 2018)
ret void
}