xunge/DecIR huggingface dataset:
int irc_isspecial(int c) {
  return ((c >= 0x5b && c <= 0x60) || (c >= 0x7b && c <= 0x7d));
}


x86 assembly (clang, -O0):
<irc_isspecial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x5b,-0x4(%rbp)
jl     1120 <irc_isspecial+0x20>
mov    $0x1,%al
cmpl   $0x60,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <irc_isspecial+0x3f>
xor    %eax,%eax
cmpl   $0x7b,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <irc_isspecial+0x39>
cmpl   $0x7d,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_isspecial>:
lea    -0x5b(%rdi),%eax
cmp    $0x6,%eax
setb   %al
add    $0xffffff85,%edi
cmp    $0x3,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @irc_isspecial(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 91
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 96
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 123
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 125
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @irc_isspecial(i32 %0) {
%2 = add i32 %0, -91
%3 = icmp ult i32 %2, 6
%4 = add i32 %0, -123
%5 = icmp ult i32 %4, 3
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void configureBt5Patch(void) {
  uint8_t *pPatchTab = (uint8_t *)(0x21000000 + 0x03D4);
  pPatchTab[76] = 0;
  pPatchTab[91] = 1;
  pPatchTab[79] = 2;
}


x86 assembly (clang, -O0):
<configureBt5Patch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x210003d4,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x130(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0x16c(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0x13c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureBt5Patch>:
movl   $0x0,0x21000504
movl   $0x1,0x21000540
movl   $0x2,0x21000510
ret

LLVM IR (-O0):
define void @configureBt5Patch() {
%1 = alloca i32*
store i32* inttoptr (i64 553649108 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = getelementptr inbounds i32, i32* %2, i64 76
store i32 0, i32* %3
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 91
store i32 1, i32* %5
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 79
store i32 2, i32* %7
ret void
}

LLVM IR (-O2):
define void @configureBt5Patch() {
store i32 0, i32* inttoptr (i64 553649412 to i32*)
store i32 1, i32* inttoptr (i64 553649472 to i32*)
store i32 2, i32* inttoptr (i64 553649424 to i32*)
ret void
}
/* Variables and functions */
long find_array(char *, int, char *, long, long);
long int gpt_check(char *buffer, long int buff_size, long int offset) {
  long int x;
  char label[8] = "EFI PART";
  x = find_array(label, 8, buffer, buff_size, offset);
  return x;
}


x86 assembly (clang, -O0):
<gpt_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x8,%esi
call   1030 <find_array@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpt_check>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
movabs $0x5452415020494645,%rax
41 52 54
mov    %rax,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <find_array@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.gpt_check.label = [8 x i8] c"EFI PART"
define i64 @gpt_check(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca [8 x i8]
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = bitcast [8 x i8]* %8 to i8*
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = call i64 @find_array(i8* %10, i32 8, i8* %11, i64 %12, i64 %13)
store i64 %14, i64* %7
%15 = load i64, i64* %7
ret i64 %15
}

LLVM IR (-O2):
define i64 @gpt_check(i8* %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
store i64 6075990659671082565, i64* %4
%6 = call i64 @find_array(i8* %5, i32 8, i8* %0, i64 %1, i64 %2)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
int main() {
  int x, y, i;
  x = 0;
  y = 0;
  for (i = 0; i < 10; i++) {
    x++;
    y++;
  }
  __CRAB_assert(x == y);
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    115e <main+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <__CRAB_assert@plt>
mov    $0x14,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__CRAB_assert(i32 1)
ret i32 20
}
int test_imm_74int8_reg(signed char val) {
  return ((val) & (-0x74 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_74int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff8c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_74int8_reg(i8 signext %0) {
%2 = and i8 %0, -116
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned int *);
void linsched_destroy_rand(unsigned int *state) {
  if (state)
    free(state);
}


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

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

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

LLVM IR (-O2):
define void @linsched_destroy_rand(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
char *get_data() { return "012345678"; }


x86 assembly (clang, -O0):
<get_data>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_data>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"012345678\00"
define i8* @get_data() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"012345678\00"
define i8* @get_data() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
float scalbnf(float, int);
float ldexpf(float x, int n) { return scalbnf(x, n); }


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

x86 assembly (clang, -O2):
<ldexpf>:
jmp    1030 <scalbnf@plt>

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = load float, float* %3
%6 = load i32, i32* %4
%7 = call float @scalbnf(float %5, i32 %6)
ret float %7
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call float @scalbnf(float %0, i32 %1)
ret float %3
}
void pmv2_(x, y) float *x, *y;
{ pmv(*x, *y, 0.0); }


x86 assembly (clang, -O0):
<pmv2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pmv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmv2_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <pmv@plt>

LLVM IR (-O0):
define void @pmv2_(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 = fpext float %6 to double
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %7, double %10, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @pmv2_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %4, double %6, double 0.000000e+00)
ret void
}
void SHA224_Init(void) {}


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

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

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

LLVM IR (-O2):
define void @SHA224_Init() {
ret void
}
/* Variables and functions */
bool IsIdentifierChar(char C) {
  bool Result = ('a' <= C && C <= 'z') || ('A' <= C && C <= 'Z') ||
                ('0' <= C && C <= '9') || C == '_';
  return Result;
}


x86 assembly (clang, -O0):
<IsIdentifierChar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     112d <IsIdentifierChar+0x2d>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x9(%rbp)
jle    1180 <IsIdentifierChar+0x80>
movsbl -0x1(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1150 <IsIdentifierChar+0x50>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x9(%rbp)
jle    1180 <IsIdentifierChar+0x80>
movsbl -0x1(%rbp),%ecx
mov    $0x30,%eax
cmp    %ecx,%eax
jg     1173 <IsIdentifierChar+0x73>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x9(%rbp)
jle    1180 <IsIdentifierChar+0x80>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsIdentifierChar>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
lea    -0x30(%rdi),%ecx
cmp    $0xa,%cl
setb   %cl
cmp    $0x5f,%dil
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @IsIdentifierChar(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sle i32 97, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %31, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sle i32 65, %13
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %31, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 48, %21
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 57
br i1 %26, label %31, label %27
27: ; preds = %23, %19
%28 = load i8, i8* %2
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 95
br label %31
31: ; preds = %27, %23, %15, %7
%32 = phi i1 [ true, %23 ], [ true, %15 ], [ true, %7 ], [ %30, %27 ]
%33 = zext i1 %32 to i32
store i32 %33, i32* %3
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @IsIdentifierChar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = icmp eq i8 %0, 95
%9 = or i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
void g_main_context_find_source_by_id() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ j64_false_encode(char *, int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ strcmp(char *, char *);
int test_false_encode_5(void) {
  char buf[5 + 1];
  memset(buf, '\0', sizeof(buf));
  j64_false_encode(buf, 5);
  return strcmp(buf, "false") == 0;
}


x86 assembly (clang, -O0):
<test_false_encode_5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x6(%rbp),%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
lea    -0x6(%rbp),%rdi
mov    $0x5,%esi
call   1050 <j64_false_encode@plt>
lea    -0x6(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_false_encode_5>:
push   %rbx
sub    $0x10,%rsp
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x6,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <j64_false_encode@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"false\00"
define i32 @test_false_encode_5() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 6)
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%5 = call i32 @j64_false_encode(i8* %4, i32 5)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [6 x i8] c"false\00"
define i32 @test_false_encode_5() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 6)
%4 = call i32 @j64_false_encode(i8* %2, i32 5)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
__attribute__((__always___)) void writew(unsigned short b,
                                         volatile void *addr) {
  *(volatile unsigned short *)addr = b;
}


x86 assembly (clang, -O0):
<writew>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writew>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @writew(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i16*
store volatile i16 %5, i16* %7
ret void
}

LLVM IR (-O2):
define void @writew(i16 zeroext %0, i8* %1) {
%3 = bitcast i8* %1 to i16*
store volatile i16 %0, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expecti(int, int);
void test() {
  int a = 0;
  int i = 0;
  while (i <= 100)
    a = a + i++;
  expecti(a, 5050);
  a = 5;
  i = 0;
  while (i <= 100) {
    a = a + i++;
  }
  expecti(a, 5055);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1148 <test+0x38>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <test+0x16>
mov    -0x4(%rbp),%edi
mov    $0x13ba,%esi
call   1030 <expecti@plt>
movl   $0x5,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1185 <test+0x75>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <test+0x53>
mov    -0x4(%rbp),%edi
mov    $0x13bf,%esi
call   1030 <expecti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x13ba,%edi
mov    $0x13ba,%esi
call   1030 <expecti@plt>
mov    $0x13bf,%edi
mov    $0x13bf,%esi
pop    %rax
jmp    1030 <expecti@plt>

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @expecti(i32 5050, i32 5050)
%2 = tail call i32 @expecti(i32 5055, i32 5055)
ret void
}
/* Variables and functions */
scalar_t__ access_test();
scalar_t__ read_write_test();
scalar_t__ utils_test();
int unistd_file_test(void) {
  if (access_test() < 0) {
    return -1;
  }
  if (1) {
    if (read_write_test()) {
      return -1;
    }
  }
  if (1) {
    if (utils_test()) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<unistd_file_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <access_test@plt>
cmp    $0x0,%rax
jge    1155 <unistd_file_test+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <unistd_file_test+0x66>
mov    $0x0,%al
call   1050 <read_write_test@plt>
cmp    $0x0,%rax
je     1172 <unistd_file_test+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <unistd_file_test+0x66>
mov    $0x0,%al
call   1030 <utils_test@plt>
cmp    $0x0,%rax
je     118f <unistd_file_test+0x5f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <unistd_file_test+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unistd_file_test>:
push   %rbx
xor    %eax,%eax
call   1040 <access_test@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
js     115a <unistd_file_test+0x2a>
xor    %eax,%eax
call   1050 <read_write_test@plt>
test   %rax,%rax
jne    115a <unistd_file_test+0x2a>
xor    %eax,%eax
call   1030 <utils_test@plt>
neg    %rax
sbb    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @unistd_file_test() {
%1 = alloca i32
%2 = call i64 (...) @access_test()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %14
5: ; preds = %0
%6 = call i64 (...) @read_write_test()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %14
9: ; preds = %5
%10 = call i64 (...) @utils_test()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 -1, i32* %1
br label %14
13: ; preds = %9
store i32 0, i32* %1
br label %14
14: ; preds = %13, %12, %8, %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @unistd_file_test() {
%1 = tail call i64 (...) @access_test()
%2 = icmp slt i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 (...) @read_write_test()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 (...) @utils_test()
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ -1, %0 ], [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_close__(int);
void sys_closesocket(int fd) { __coverity_close__(fd); }


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

x86 assembly (clang, -O2):
<sys_closesocket>:
jmp    1030 <__coverity_close__@plt>

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

LLVM IR (-O2):
define void @sys_closesocket(i32 %0) {
%2 = tail call i32 @__coverity_close__(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, char *);
void notEmbl(char *fileName) { errAbort("%s is not an emblFile", fileName); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"%s is not an emblFile\00"
define void @notEmbl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @errAbort(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s is not an emblFile\00"
define void @notEmbl(i8* %0) {
%2 = tail call i32 @errAbort(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSpecialFunc(void (*)(int, int, int));
void s2winSpecialFunc(void (*func)(int key, int x, int y)) {
  glutSpecialFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winSpecialFunc>:
jmp    1030 <glutSpecialFunc@plt>

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

LLVM IR (-O2):
define void @s2winSpecialFunc(void (i32, i32, i32)* %0) {
%2 = tail call i32 @glutSpecialFunc(void (i32, i32, i32)* %0)
ret void
}
void loop_standby(void) {}


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

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

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

LLVM IR (-O2):
define void @loop_standby() {
ret void
}
double log(double x) { return x; }


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

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

LLVM IR (-O0):
define double @log(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @log(double returned %0) {
ret double %0
}
int dir_deg(d) {
  switch (d) {
  case 0:
    return (0);
  case 1:
    return (45);
  case 2:
    return (90);
  case 3:
    return (135);
  case 4:
    return (180);
  case 5:
    return (225);
  case 6:
    return (270);
  case 7:
    return (315);
  default:
    return (-1);
  }
}


x86 assembly (clang, -O0):
<dir_deg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x7,%rax
ja     118c <dir_deg+0x8c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0x2d,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0x5a,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0x87,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0xb4,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0xe1,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0x10e,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0x13b,-0x4(%rbp)
jmp    1193 <dir_deg+0x93>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_deg>:
cmp    $0x8,%edi
lea    (%rdi,%rdi,8),%eax
lea    (%rax,%rax,4),%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dir_deg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
i32 6, label %11
i32 7, label %12
]
5: ; preds = %1
store i32 0, i32* %2
br label %14
6: ; preds = %1
store i32 45, i32* %2
br label %14
7: ; preds = %1
store i32 90, i32* %2
br label %14
8: ; preds = %1
store i32 135, i32* %2
br label %14
9: ; preds = %1
store i32 180, i32* %2
br label %14
10: ; preds = %1
store i32 225, i32* %2
br label %14
11: ; preds = %1
store i32 270, i32* %2
br label %14
12: ; preds = %1
store i32 315, i32* %2
br label %14
13: ; preds = %1
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @dir_deg(i32 %0) {
%2 = icmp ult i32 %0, 8
%3 = mul i32 %0, 45
%4 = select i1 %2, i32 %3, i32 -1
ret i32 %4
}
void machdep_restore_float_state(void) {}


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

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

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

LLVM IR (-O2):
define void @machdep_restore_float_state() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[], char *envp[]) {
  if (argc < 2) {
    printf("usage : echo <string> \n");
    return 1;
  }
  printf("%s\n", argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114e <main+0x3e>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    116b <main+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jge    1124 <main+0x14>
mov    $0x1,%ebx
lea    0xede(%rip),%rdi
jmp    112a <main+0x1a>
mov    0x8(%rsi),%rdi
xor    %ebx,%ebx
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"usage : echo <string> \0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %4
br label %17
12: ; preds = %3
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %15)
store i32 0, i32* %4
br label %17
17: ; preds = %12, %10
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
@str = [23 x i8] c"usage : echo <string> \00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp slt i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %3, %5
%9 = phi i8* [ %7, %5 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0), %3 ]
%10 = phi i32 [ 0, %5 ], [ 1, %3 ]
%11 = tail call i32 @puts(i8* dereferenceable(1) %9)
ret i32 %10
}
/* Variables and functions */
int write_bool(char *, int const, size_t);
int option_write_bool(char *out, const void *in, size_t n) {
  const int *in_bool = in;
  return write_bool(out, *in_bool, n);
}


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

x86 assembly (clang, -O2):
<option_write_bool>:
mov    (%rsi),%esi
jmp    1030 <write_bool@plt>

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

LLVM IR (-O2):
define i32 @option_write_bool(i8* %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @write_bool(i8* %0, i32 %5, i64 %2)
ret i32 %6
}
int cnss_logger_event_register(int radio, int event,
                               int (*cb)(struct sk_buff *skb)) {
  return 0;
}


x86 assembly (clang, -O0):
<cnss_logger_event_register>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sk_buff = type opaque
define i32 @cnss_logger_event_register(i32 %0, i32 %1, i32 (%struct.sk_buff*)* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32 (%struct.sk_buff*)*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 (%struct.sk_buff*)* %2, i32 (%struct.sk_buff*)** %6
ret i32 0
}

LLVM IR (-O2):
%struct.sk_buff = type opaque
define i32 @cnss_logger_event_register(i32 %0, i32 %1, i32 (%struct.sk_buff*)* nocapture readnone %2) {
ret i32 0
}
int int_pos(int *i) {
  if (*i > 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<int_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    1121 <int_pos+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1128 <int_pos+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_pos>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
setg   %al
ret

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

LLVM IR (-O2):
define i32 @int_pos(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int cmpflo(const void *flo1, const void *flo2) {
  float *f1 = (float *)flo1;
  float *f2 = (float *)flo2;
  if (*f1 > *f2)
    return 1;
  else if (*f1 < *f2)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmpflo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    113d <cmpflo+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1169 <cmpflo+0x69>
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1162 <cmpflo+0x62>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <cmpflo+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpflo>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmpflo(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
%8 = fcmp olt float %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) int32_t log2_up(uint32_t n) {
  int32_t log = -1;
  uint32_t t = n;
  while (t) {
    log++;
    t >>= 1;
  }
  if (n & (n - 1))
    log++;
  return log;
}


x86 assembly (clang, -O0):
<log2_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1135 <log2_up+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <log2_up+0x14>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1152 <log2_up+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_up>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <log2_up+0x1c>
mov    %edi,%ecx
mov    %edi,%edx
nopl   (%rax)
add    $0x1,%eax
sar    %edx
cmp    $0x1,%ecx
mov    %edx,%ecx
ja     1110 <log2_up+0x10>
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @log2_up(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ -1, %1 ]
%6 = add nsw i32 %5, 1
%7 = ashr i32 %4, 1
%8 = icmp ult i32 %4, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %6, %3 ]
%11 = tail call i32 @llvm.ctpop.i32(i32 %0)
%12 = icmp ugt i32 %11, 1
%13 = zext i1 %12 to i32
%14 = add nsw i32 %10, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2SIntEnable(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  DEBUG_ASSERT((ulIntFlags & (0x00000020 | 0x00000010 | 0x00000002 |
                              0x00000001)) == ulIntFlags);
  (*((volatile unsigned long *)(ulBase + 0x00000C10))) |= ulIntFlags;
}


x86 assembly (clang, -O0):
<I2SIntEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
and    $0x33,%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0xc10(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0xc10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SIntEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
test   $0xffffffffffffffcc,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
or     %r14,0xc10(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2SIntEnable(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
%6 = icmp eq i64 %5, 1074085888
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = and i64 %9, 51
%11 = load i64, i64* %4
%12 = icmp eq i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @DEBUG_ASSERT(i32 %13)
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = add i64 %16, 3088
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = or i64 %19, %15
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @I2SIntEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074085888
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = and i64 %1, 51
%7 = icmp eq i64 %6, %1
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = add i64 %0, 3088
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %1
store volatile i64 %13, i64* %11
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_will_need() {
  printf("NOT IMPLEMENTED:"
         "pa_will_need"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [29 x i8] c"NOT IMPLEMENTED:pa_will_need\00"
define i32 @pa_will_need() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t *write_u16(uint8_t *p, size_t *s, const uint16_t v) {
  *p++ = (v >> 8) & 0xFF;
  *p++ = (v >> 0) & 0xFF;
  if (s != NULL)
    *s -= 2;
  return (p);
}


x86 assembly (clang, -O0):
<write_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     1162 <write_u16+0x62>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
sub    $0x2,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u16>:
mov    %rdi,%rax
movzbl %dh,%ecx
mov    %ecx,(%rdi)
movzbl %dl,%ecx
mov    %ecx,0x4(%rdi)
test   %rsi,%rsi
je     1117 <write_u16+0x17>
addq   $0xfffffffffffffffe,(%rsi)
add    $0x8,%rax
ret

LLVM IR (-O0):
define i32* @write_u16(i32* %0, i64* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i64*
%6 = alloca i32
store i32* %0, i32** %4
store i64* %1, i64** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
%12 = load i32, i32* %6
%13 = ashr i32 %12, 0
%14 = and i32 %13, 255
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %4
store i32 %14, i32* %15
%17 = load i64*, i64** %5
%18 = icmp ne i64* %17, null
br i1 %18, label %19, label %23
19: ; preds = %3
%20 = load i64*, i64** %5
%21 = load i64, i64* %20
%22 = sub i64 %21, 2
store i64 %22, i64* %20
br label %23
23: ; preds = %19, %3
%24 = load i32*, i32** %4
ret i32* %24
}

LLVM IR (-O2):
define i32* @write_u16(i32* writeonly %0, i64* %1, i32 %2) {
%4 = lshr i32 %2, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %0
%7 = and i32 %2, 255
store i32 %7, i32* %6
%8 = icmp eq i64* %1, null
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = load i64, i64* %1
%11 = add i64 %10, -2
store i64 %11, i64* %1
br label %12
12: ; preds = %9, %3
%13 = getelementptr inbounds i32, i32* %0, i64 2
ret i32* %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ post(char);
int /*<<< orphan*/ printf(char *, char *);
char *rate();
void die(int signum) {
  printf("bye.\nYour rating was %s.\n", rate());
  post(' ');
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rate@plt>
mov    %rax,%rsi
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    $0x20,%edi
call   1050 <post@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
xor    %eax,%eax
call   1030 <rate@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x20,%edi
call   1050 <post@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"bye.\0AYour rating was %s.\0A\00"
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* (...) @rate()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @post(i8 signext 32)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"bye.\0AYour rating was %s.\0A\00"
define void @die(i32 %0) {
%2 = tail call i8* (...) @rate()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @post(i8 signext 32)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float atof(char *);
char *cfg_get_str(char *, char *, char *);
float cfg_get_float(char *dname, char *sname, char *ename, float def) {
  char *val;
  val = cfg_get_str(dname, sname, ename);
  if (NULL == val)
    return def;
  return atof(val);
}


x86 assembly (clang, -O0):
<cfg_get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <cfg_get_str@plt>
mov    %rax,-0x30(%rbp)
xor    %eax,%eax
cmp    -0x30(%rbp),%rax
jne    1169 <cfg_get_float+0x49>
movss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1177 <cfg_get_float+0x57>
mov    -0x30(%rbp),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_get_float>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <cfg_get_str@plt>
test   %rax,%rax
je     113a <cfg_get_float+0x1a>
mov    %rax,%rdi
pop    %rax
jmp    1030 <atof@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @cfg_get_float(i8* %0, i8* %1, i8* %2, float %3) {
%5 = tail call i8* @cfg_get_str(i8* %0, i8* %1, i8* %2)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call float @atof(i8* %5)
br label %9
9: ; preds = %4, %7
%10 = phi float [ %8, %7 ], [ %3, %4 ]
ret float %10
}
/* Type definitions */
typedef scalar_t__ __v4si;
typedef scalar_t__ __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_cmpgt_epi32(__m128i a, __m128i b) {
  return (__m128i)((__v4si)a > (__v4si)b);
}


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

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

LLVM IR (-O0):
define i64 @_mm_cmpgt_epi32(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
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mm_cmpgt_epi32(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}