xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void backspace(int k) {
  int i;
  for (i = 1; i <= k; i++)
    printf("\b");
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1148 <backspace+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <backspace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rbx
test   %edi,%edi
jle    112f <backspace+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x8,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <backspace+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @backspace(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 1, %1 ]
%5 = tail call i32 @putchar(i32 8)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
newpgml(proctyp, pgmflags, fdarray, pgm, pgmparm) int proctyp, pgmflags,
    fdarray[];
char *pgm, *pgmparm;
{
  int retval;
  char *parmptr;
  parmptr = &pgmparm;
  retval = newpgmv(proctyp, pgmflags, fdarray, pgm, parmptr);
  return (retval);
}


x86 assembly (clang, -O0):
<newpgml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    $0x0,%al
call   1030 <newpgmv@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newpgml>:
push   %rax
mov    %r8,(%rsp)
mov    %rsp,%r8
xor    %eax,%eax
call   1030 <newpgmv@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @newpgml(i32 %0, i32 %1, i32* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%13 = bitcast i8** %10 to i8*
store i8* %13, i8** %12
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32*, i32** %8
%17 = load i8*, i8** %9
%18 = load i8*, i8** %12
%19 = call i32 (i32, i32, i32*, i8*, i8*, ...) bitcast (i32 (...)* @newpgmv to i32 (i32, i32, i32*, i8*, i8*, ...)*)(i32 %14, i32 %15, i32* %16, i8* %17, i8* %18)
store i32 %19, i32* %11
%20 = load i32, i32* %11
ret i32 %20
}

LLVM IR (-O2):
define i32 @newpgml(i32 %0, i32 %1, i32* %2, i8* %3, i8* %4) {
%6 = alloca i8*
store i8* %4, i8** %6
%7 = bitcast i8** %6 to i8*
%8 = call i32 (i32, i32, i32*, i8*, i8*, ...) bitcast (i32 (...)* @newpgmv to i32 (i32, i32, i32*, i8*, i8*, ...)*)(i32 %0, i32 %1, i32* %2, i8* %3, i8* %7)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memory_copy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void strcopy(char *source, char *dst) {
  memory_copy(source, dst, strlen(source));
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <memory_copy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memory_copy@plt>

LLVM IR (-O0):
define void @strcopy(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @memory_copy(i8* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @strcopy(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @memory_copy(i8* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int comp_strs(void *p1, void *p2) {
  int res = strcmp((char *)p1, (char *)p2);
  return (res < 0) ? -1 : (res > 0) ? 1 : 0;
}


x86 assembly (clang, -O0):
<comp_strs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1147 <comp_strs+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    115a <comp_strs+0x4a>
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @comp_strs(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strcmp(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
br label %17
12: ; preds = %2
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
br label %17
17: ; preds = %12, %11
%18 = phi i32 [ -1, %11 ], [ %16, %12 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @comp_strs(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
void rop3_139_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S | stk3;
  stk1 = *D ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_139_1_0>:
mov    (%rdi),%al
xor    %al,%dl
or     %sil,%dl
xor    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_139_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %2
%6 = or i8 %5, %1
%7 = xor i8 %6, %4
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %4, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void g(int two) {
  (void)two;
  abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
unsigned ecc_table_size(unsigned bits, unsigned k, unsigned c) {
  unsigned p = (bits + k - 1) / k;
  unsigned M = (p + c - 1) / c;
  return M;
}


x86 assembly (clang, -O0):
<ecc_table_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecc_table_size>:
mov    %edx,%ecx
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %esi
add    %ecx,%eax
add    $0xffffffff,%eax
xor    %edx,%edx
div    %ecx
ret

LLVM IR (-O0):
define i32 @ecc_table_size(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add i32 %9, %10
%12 = sub i32 %11, 1
%13 = load i32, i32* %5
%14 = udiv i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = add i32 %15, %16
%18 = sub i32 %17, 1
%19 = load i32, i32* %6
%20 = udiv i32 %18, %19
store i32 %20, i32* %8
%21 = load i32, i32* %8
ret i32 %21
}

LLVM IR (-O2):
define i32 @ecc_table_size(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -1
%5 = add i32 %4, %1
%6 = udiv i32 %5, %1
%7 = add i32 %2, -1
%8 = add i32 %7, %6
%9 = udiv i32 %8, %2
ret i32 %9
}
int test_imm_33uint32_reg(unsigned int val) {
  return ((val) & (0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x33,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_33uint32_reg>:
test   $0x33,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_33uint32_reg(i32 %0) {
%2 = and i32 %0, 51
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float fabsf(float);
void abs_s(float *source, float *target) { *target = fabsf(*source); }


x86 assembly (clang, -O0):
<abs_s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movaps 0xee5(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_s>:
movss  (%rdi),%xmm0
andps  0xef5(%rip),%xmm0
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @abs_s(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = call float @llvm.fabs.f32(float %6)
%8 = load float*, float** %4
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @abs_s(float* nocapture %0, float* nocapture writeonly %1) {
%3 = load float, float* %0
%4 = tail call float @llvm.fabs.f32(float %3)
store float %4, float* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int open_read(char const *);
int readall(int, void *, long long);
int load(const char *fn, void *x, long long xlen) {
  int fd;
  int r;
  fd = open_read(fn);
  if (fd == -1)
    return -1;
  r = readall(fd, x, xlen);
  close(fd);
  return r;
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <open_read@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    1166 <load+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <load+0x57>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <readall@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <close@plt>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <open_read@plt>
cmp    $0xffffffff,%eax
je     1160 <load+0x30>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <readall@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1030 <close@plt>
mov    %ebx,%eax
jmp    1165 <load+0x35>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @load(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @open_read(i8* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @readall(i32 %4, i8* %1, i64 %2)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ glb_error(char *);
int glbGetFilterState() {
  glb_error("Function glbGetFilterState is deprecated.");
  return -1.0;
}


x86 assembly (clang, -O0):
<glbGetFilterState>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <glb_error@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glbGetFilterState>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <glb_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Function glbGetFilterState is deprecated.\00"
define i32 @glbGetFilterState() {
%1 = call i32 @glb_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [42 x i8] c"Function glbGetFilterState is deprecated.\00"
define i32 @glbGetFilterState() {
%1 = tail call i32 @glb_error(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ freeaddrinfo(void *);
void resolver_cleanup(void *p) {
  if (p)
    freeaddrinfo(p);
}


x86 assembly (clang, -O0):
<resolver_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <resolver_cleanup+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <freeaddrinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolver_cleanup>:
test   %rdi,%rdi
je     111a <resolver_cleanup+0xa>
jmp    1030 <freeaddrinfo@plt>
ret

LLVM IR (-O0):
define void @resolver_cleanup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @freeaddrinfo(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @resolver_cleanup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @freeaddrinfo(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned count_char(char *str, const char c) {
  int count = 0;
  int i = 0;
  while (str[i] != '\0') {
    if (str[i] == c)
      count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <count_char+0x60>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1152 <count_char+0x52>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <count_char+0x1c>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
/* Variables and functions */
double sin(double);
double func(double x, double y) { return sin(x); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @func(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 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @func(double %0, double %1) {
%3 = tail call double @sin(double %0)
ret double %3
}
int IsEqual(int x, int y) {
  int e = 0;
  if (x == y)
    e = 1;
  return e;
}


x86 assembly (clang, -O0):
<IsEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1124 <IsEqual+0x24>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsEqual>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsEqual(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ model_array_clear();
int /*<<< orphan*/ view_clearStack();
void model_finalize(void) {
  view_clearStack();
  model_array_clear();
  return;
}


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

x86 assembly (clang, -O2):
<model_finalize>:
push   %rax
xor    %eax,%eax
call   1040 <view_clearStack@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <model_array_clear@plt>

LLVM IR (-O0):
define void @model_finalize() {
%1 = call i32 (...) @view_clearStack()
%2 = call i32 (...) @model_array_clear()
ret void
}

LLVM IR (-O2):
define void @model_finalize() {
%1 = tail call i32 (...) @view_clearStack()
%2 = tail call i32 (...) @model_array_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void property(void) { printf("PASS\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define void @property() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
int getcelltype(int flag) {
  int temp = flag >> 12;
  return (temp >> 2) * 2 + temp % 2 + ((temp & 1) != ((temp >> 1) & 1)) * 5 + 2;
}


x86 assembly (clang, -O0):
<getcelltype>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xc,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x2,%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
mov    -0x8(%rbp),%edx
sar    $0x1,%edx
and    $0x1,%edx
cmp    %edx,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
imul   $0x5,%ecx,%ecx
add    %ecx,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcelltype>:
mov    %edi,%eax
sar    $0xc,%eax
mov    %edi,%ecx
sar    $0xd,%ecx
and    $0xfffffffe,%ecx
mov    %edi,%edx
shr    $0x1f,%edx
add    %eax,%edx
and    $0xfffffffe,%edx
shr    $0xd,%edi
xor    %eax,%edi
sub    %edx,%eax
add    %ecx,%eax
and    $0x1,%edi
lea    (%rdi,%rdi,4),%ecx
add    %ecx,%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @getcelltype(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 12
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = ashr i32 %6, 2
%8 = mul nsw i32 %7, 2
%9 = load i32, i32* %3
%10 = srem i32 %9, 2
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 1
%14 = load i32, i32* %3
%15 = ashr i32 %14, 1
%16 = and i32 %15, 1
%17 = icmp ne i32 %13, %16
%18 = zext i1 %17 to i32
%19 = mul nsw i32 %18, 5
%20 = add nsw i32 %11, %19
%21 = add nsw i32 %20, 2
ret i32 %21
}

LLVM IR (-O2):
define i32 @getcelltype(i32 %0) {
%2 = ashr i32 %0, 12
%3 = ashr i32 %0, 13
%4 = and i32 %3, -2
%5 = srem i32 %2, 2
%6 = lshr i32 %0, 13
%7 = xor i32 %2, %6
%8 = and i32 %7, 1
%9 = mul nuw nsw i32 %8, 5
%10 = add nsw i32 %5, 2
%11 = add nsw i32 %10, %4
%12 = add nsw i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ iothub_client_sample_amqp_websockets_run();
int main(void) {
  iothub_client_sample_amqp_websockets_run();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @iothub_client_sample_amqp_websockets_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_client_sample_amqp_websockets_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(size_t);
void *realloc(void *, size_t);
void *rpl_realloc(void *ptr, size_t size) {
  if (!ptr)
    return malloc(size);
  if (!size) {
    if (ptr)
      free(ptr);
    return malloc(size);
  }
  return realloc(ptr, size);
}


x86 assembly (clang, -O0):
<rpl_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <rpl_realloc+0x2d>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    119f <rpl_realloc+0x6f>
cmpq   $0x0,-0x18(%rbp)
jne    118e <rpl_realloc+0x5e>
cmpq   $0x0,-0x10(%rbp)
je     117c <rpl_realloc+0x4c>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    119f <rpl_realloc+0x6f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_realloc>:
test   %rdi,%rdi
je     113f <rpl_realloc+0xf>
test   %rsi,%rsi
je     1147 <rpl_realloc+0x17>
jmp    1050 <realloc@plt>
mov    %rsi,%rdi
jmp    1040 <malloc@plt>
push   %rax
call   1030 <free@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @rpl_realloc(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %13
6: ; preds = %2
%7 = icmp eq i64 %1, 0
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = tail call i32 @free(i8* %0)
%10 = tail call i8* @malloc(i64 0)
br label %13
11: ; preds = %6
%12 = tail call i8* @realloc(i8* %0, i64 %1)
br label %13
13: ; preds = %11, %8, %4
%14 = phi i8* [ %12, %11 ], [ %10, %8 ], [ %5, %4 ]
ret i8* %14
}
int file_perm_compare(unsigned long a, unsigned long b) {
  int fperm = (int)a;
  int bperm = (int)b;
  if (fperm == bperm)
    return 0;
  return (fperm & (~bperm)) ? 1 : -1;
}


x86 assembly (clang, -O0):
<file_perm_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1132 <file_perm_compare+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1150 <file_perm_compare+0x50>
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_perm_compare>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     $0x1,%ecx
xor    %eax,%eax
cmp    %esi,%edi
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @file_perm_compare(i64 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
store i32 %9, i32* %6
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %24
16: ; preds = %2
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = xor i32 %18, -1
%20 = and i32 %17, %19
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 1, i32 -1
store i32 %23, i32* %3
br label %24
24: ; preds = %16, %15
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @file_perm_compare(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = icmp eq i32 %3, %4
%6 = xor i32 %4, -1
%7 = and i32 %6, %3
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %5, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int pow(int, int);
float roundf(float);
float roundfnd(float number, int digit) {
  int N = pow(10, digit);
  if (digit > 0) {
    return roundf((number * N) / N);
  } else {
  }
}


x86 assembly (clang, -O0):
<roundfnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1170 <roundfnd+0x50>
movss  -0x8(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <roundf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    1175 <roundfnd+0x55>
jmp    1175 <roundfnd+0x55>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundfnd>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movss  %xmm0,0xc(%rsp)
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
test   %ebx,%ebx
jle    1159 <roundfnd+0x39>
cvtsi2ss %eax,%xmm1
movss  0xc(%rsp),%xmm0
mulss  %xmm1,%xmm0
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <roundf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @roundfnd(float %0, i32 %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @pow(i32 10, i32 %7)
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %2
%12 = load float, float* %4
%13 = load i32, i32* %6
%14 = sitofp i32 %13 to float
%15 = fmul float %12, %14
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to float
%18 = fdiv float %15, %17
%19 = call float @llvm.round.f32(float %18)
store float %19, float* %3
br label %21
20: ; preds = %2
br label %21
21: ; preds = %11, %20
%22 = load float, float* %3
ret float %22
}

LLVM IR (-O2):
define float @roundfnd(float %0, i32 %1) {
%3 = tail call i32 @pow(i32 10, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = sitofp i32 %3 to float
%7 = fmul float %6, %0
%8 = fdiv float %7, %6
%9 = tail call float @llvm.round.f32(float %8)
br label %10
10: ; preds = %2, %5
%11 = phi float [ %9, %5 ], [ undef, %2 ]
ret float %11
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_anonymous_locked_pages(struct __test_metadata *);
void wrapper_check_anonymous_locked_pages(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  check_anonymous_locked_pages(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_check_anonymous_locked_pages>:
jmp    1030 <check_anonymous_locked_pages@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_check_anonymous_locked_pages(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @check_anonymous_locked_pages(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_check_anonymous_locked_pages(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @check_anonymous_locked_pages(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f();
void main_main() { (void)f(); }


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

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

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

LLVM IR (-O2):
define void @main_main() {
%1 = tail call i32 (...) @f()
ret void
}
int f_lt_rr2(float a1, float a2) { return !(((a1) < (a2))); }


x86 assembly (clang, -O0):
<f_lt_rr2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_lt_rr2>:
xor    %eax,%eax
ucomiss %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @f_lt_rr2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f_lt_rr2(float %0, float %1) {
%3 = fcmp uge float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
void signal_handler(int signum) {
  printf("\n[*] detect process[%d] exit!\n", getpid());
  exit(0);
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0A[*] detect process[%d] exit!\0A\00"
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A[*] detect process[%d] exit!\0A\00"
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void uninitvar_scanf(void) {
  char *format;
  char str[42];
  (void)scanf(format, str);
}


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

x86 assembly (clang, -O2):
<uninitvar_scanf>:
sub    $0x38,%rsp
mov    %rsp,%rsi
call   1030 <scanf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_scanf() {
%1 = alloca i8*
%2 = alloca [42 x i8]
%3 = load i8*, i8** %1
%4 = getelementptr inbounds [42 x i8], [42 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_scanf() {
%1 = alloca [42 x i8]
%2 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* undef, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inflush();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readnl();
holdit() {
  inflush();
  printf("Push <RETURN>");
  readnl();
}


x86 assembly (clang, -O0):
<holdit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <inflush@plt>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <readnl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<holdit>:
push   %rax
xor    %eax,%eax
call   1040 <inflush@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <readnl@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Push <RETURN>\00"
define i32 @holdit() {
%1 = alloca i32
%2 = call i32 (...) @inflush()
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @readnl()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [14 x i8] c"Push <RETURN>\00"
define i32 @holdit() {
%1 = tail call i32 (...) @inflush()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @readnl()
ret i32 undef
}
/* Variables and functions */
unsigned char *skipName(unsigned char *);
unsigned char *skipQuestions(unsigned char *pRR, const int count) {
  if (count == 0)
    return pRR;
  pRR = skipName(pRR);
  return skipQuestions(pRR + 4, count - 1);
}


x86 assembly (clang, -O0):
<skipQuestions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1146 <skipQuestions+0x26>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <skipQuestions+0x4a>
mov    -0x10(%rbp),%rdi
call   1030 <skipName@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1040 <skipQuestions@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipQuestions>:
push   %rbx
mov    %rdi,%rax
test   %esi,%esi
je     1131 <skipQuestions+0x21>
mov    %esi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <skipName@plt>
add    $0x4,%rax
add    $0xffffffff,%ebx
jne    1120 <skipQuestions+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skipQuestions(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %9, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = tail call i8* @skipName(i8* %6)
%8 = getelementptr inbounds i8, i8* %7, i64 4
%9 = add nsw i32 %5, -1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i8* [ %0, %2 ], [ %8, %4 ]
ret i8* %12
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int rotate64left_code(int, int /*<<< orphan*/);
void threefish_mix(void *data, uint16_t rot) {
  uint64_t x;
  x = (((uint64_t *)data)[1]);
  (((uint64_t *)data)[0]) += x;
  (((uint64_t *)data)[1]) = rotate64left_code(x, rot) ^ (((uint64_t *)data)[0]);
}


x86 assembly (clang, -O0):
<threefish_mix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <rotate64left_code@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<threefish_mix>:
push   %rbx
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
add    %edi,(%rbx)
call   1030 <rotate64left_code@plt>
xor    (%rbx),%eax
mov    %eax,0x4(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @threefish_mix(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i8*, i8** %3
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
%15 = add nsw i32 %14, %10
store i32 %15, i32* %13
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i32 @rotate64left_code(i32 %16, i32 %17)
%19 = load i8*, i8** %3
%20 = bitcast i8* %19 to i32*
%21 = getelementptr inbounds i32, i32* %20, i64 0
%22 = load i32, i32* %21
%23 = xor i32 %18, %22
%24 = load i8*, i8** %3
%25 = bitcast i8* %24 to i32*
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 %23, i32* %26
ret void
}

LLVM IR (-O2):
define void @threefish_mix(i8* nocapture %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = tail call i32 @rotate64left_code(i32 %6, i32 %1)
%10 = load i32, i32* %3
%11 = xor i32 %10, %9
store i32 %11, i32* %5
ret void
}
unsigned char rj_xtime(unsigned char x) {
  return ((x << 1) & 0xFF) ^ (0x1b * ((x & 0x80) >> 7));
}


x86 assembly (clang, -O0):
<rj_xtime>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
and    $0xff,%eax
movzbl -0x1(%rbp),%ecx
and    $0x80,%ecx
sar    $0x7,%ecx
imul   $0x1b,%ecx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rj_xtime>:
lea    (%rdi,%rdi,1),%eax
sar    $0x7,%dil
and    $0x1b,%dil
xor    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @rj_xtime(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 1
%6 = and i32 %5, 255
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 128
%10 = ashr i32 %9, 7
%11 = mul nsw i32 27, %10
%12 = xor i32 %6, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @rj_xtime(i8 zeroext %0) {
%2 = shl i8 %0, 1
%3 = icmp slt i8 %0, 0
%4 = select i1 %3, i8 27, i8 0
%5 = xor i8 %4, %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ handle_50(int /*<<< orphan*/);
int gen_50(void) {
  handle_50(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_50>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_50@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_50() {
%1 = call i32 @handle_50(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_50() {
%1 = tail call i32 @handle_50(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct etimer {
  int dummy;
};

/* Variables and functions */
int timer_elapsed_minutes(struct etimer *, int /*<<< orphan*/);
bool timer_elapsed_minutes_short(struct etimer *t, uint16_t value) {
  return timer_elapsed_minutes(t, value);
}


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

x86 assembly (clang, -O2):
<timer_elapsed_minutes_short>:
jmp    1030 <timer_elapsed_minutes@plt>

LLVM IR (-O0):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_minutes_short(%struct.etimer* %0, i32 %1) {
%3 = alloca %struct.etimer*
%4 = alloca i32
store %struct.etimer* %0, %struct.etimer** %3
store i32 %1, i32* %4
%5 = load %struct.etimer*, %struct.etimer** %3
%6 = load i32, i32* %4
%7 = call i32 @timer_elapsed_minutes(%struct.etimer* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.etimer = type { i32 }
define i32 @timer_elapsed_minutes_short(%struct.etimer* %0, i32 %1) {
%3 = tail call i32 @timer_elapsed_minutes(%struct.etimer* %0, i32 %1)
ret i32 %3
}