xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int /*<<< orphan*/ strlen(char *);
void old_str_append(char *base, const char *app) {
  base += strlen(base);
  strcpy(base, app);
}


x86 assembly (clang, -O0):
<old_str_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @old_str_append(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 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %3
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @old_str_append(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendbyte(int /*<<< orphan*/);
void sendbuf(char *buf) {
  while (*buf != '\0') {
    sendbyte(*buf++);
  }
}


x86 assembly (clang, -O0):
<sendbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <sendbuf+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <sendbyte@plt>
jmp    111c <sendbuf+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendbuf>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <sendbuf+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <sendbyte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <sendbuf+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sendbuf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @sendbyte(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int Mystrlen(const char *str) {
  int len = 0;
  while ((*str++) != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<Mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <Mystrlen+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <Mystrlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mystrlen>:
cmpb   $0x0,(%rdi)
je     111c <Mystrlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <Mystrlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Mystrlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("print help on screen\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"print help on screen\0A\00"
@EXIT_FAILURE = global i32 0
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [21 x i8] c"print help on screen\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int FNM_NOMATCH;
int octave_fnm_nomatch_wrapper(void) { return FNM_NOMATCH; }


x86 assembly (clang, -O0):
<octave_fnm_nomatch_wrapper>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_fnm_nomatch_wrapper>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@FNM_NOMATCH = global i32 0
define i32 @octave_fnm_nomatch_wrapper() {
%1 = load i32, i32* @FNM_NOMATCH
ret i32 %1
}

LLVM IR (-O2):
@FNM_NOMATCH = global i32 0
define i32 @octave_fnm_nomatch_wrapper() {
%1 = load i32, i32* @FNM_NOMATCH
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ASL_();
int /*<<< orphan*/ c64_memZeroX();
void ASL_zpx(void) {
  c64_memZeroX();
  ASL_();
}


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

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

LLVM IR (-O0):
define void @ASL_zpx() {
%1 = call i32 (...) @c64_memZeroX()
%2 = call i32 (...) @ASL_()
ret void
}

LLVM IR (-O2):
define void @ASL_zpx() {
%1 = tail call i32 (...) @c64_memZeroX()
%2 = tail call i32 (...) @ASL_()
ret void
}
void init_led() {
  unsigned int val = 0;
  (*(volatile unsigned int *)(0x44e000AC) = (0x02));
  val = (*(volatile unsigned int *)(0x4804C134));
  val &= ~(0xF << 21);
  (*(volatile unsigned int *)(0x4804C134) = (val));
  (*(volatile unsigned int *)(0x4804C190) = (0x0F << 21));
}


x86 assembly (clang, -O0):
<init_led>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x44e000ac,%eax
movl   $0x2,(%rax)
mov    $0x4804c134,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe1fffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x4804c134,%eax
mov    %ecx,(%rax)
mov    $0x4804c190,%eax
movl   $0x1e00000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_led>:
movl   $0x2,0x44e000ac
andl   $0xfe1fffff,0x4804c134
ff ff 1f fe
movl   $0x1e00000,0x4804c190
ret

LLVM IR (-O0):
define void @init_led() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i32 2, i32* inttoptr (i64 1155530924 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 1208271156 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -31457281
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 1208271156 to i32*)
store volatile i32 31457280, i32* inttoptr (i64 1208271248 to i32*)
ret void
}

LLVM IR (-O2):
define void @init_led() {
store volatile i32 2, i32* inttoptr (i64 1155530924 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1208271156 to i32*)
%2 = and i32 %1, -31457281
store volatile i32 %2, i32* inttoptr (i64 1208271156 to i32*)
store volatile i32 31457280, i32* inttoptr (i64 1208271248 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int streq(const char *str1, const char *str2) {
  return strcmp(str1, str2) == 0;
}


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(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 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct KIrand {
  int dummy;
};

/* Variables and functions */
scalar_t__ KIrand_genrand_int32(struct KIrand *);
double KIrand_genrand_real3(struct KIrand *r) {
  return (((double)KIrand_genrand_int32(r)) + 0.5) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<KIrand_genrand_real3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <KIrand_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIrand_genrand_real3>:
push   %rax
call   1030 <KIrand_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedd(%rip),%xmm0
mulsd  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.KIrand = type { i32 }
define double @KIrand_genrand_real3(%struct.KIrand* %0) {
%2 = alloca %struct.KIrand*
store %struct.KIrand* %0, %struct.KIrand** %2
%3 = load %struct.KIrand*, %struct.KIrand** %2
%4 = call i64 @KIrand_genrand_int32(%struct.KIrand* %3)
%5 = sitofp i64 %4 to double
%6 = fadd double %5, 5.000000e-01
%7 = fmul double %6, 0x3DF0000000000000
ret double %7
}

LLVM IR (-O2):
%struct.KIrand = type { i32 }
define double @KIrand_genrand_real3(%struct.KIrand* %0) {
%2 = tail call i64 @KIrand_genrand_int32(%struct.KIrand* %0)
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 5.000000e-01
%5 = fmul double %4, 0x3DF0000000000000
ret double %5
}
void rtv_from_u16(unsigned char **pp, unsigned short v) {
  unsigned char *p = *pp;
  *p++ = (v & 0xff00) >> 8;
  *p++ = v & 0x00ff;
  *pp = p;
}


x86 assembly (clang, -O0):
<rtv_from_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtv_from_u16>:
rol    $0x8,%si
mov    (%rdi),%rax
mov    %si,(%rax)
add    $0x2,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @rtv_from_u16(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
%5 = alloca i8*
store i8** %0, i8*** %3
store i16 %1, i16* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = and i32 %9, 65280
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %5
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %5
store i8 %12, i8* %13
%15 = load i16, i16* %4
%16 = zext i16 %15 to i32
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %5
store i8 %18, i8* %19
%21 = load i8*, i8** %5
%22 = load i8**, i8*** %3
store i8* %21, i8** %22
ret void
}

LLVM IR (-O2):
define void @rtv_from_u16(i8** nocapture %0, i16 zeroext %1) {
%3 = load i8*, i8** %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds i8, i8* %3, i64 2
store i8 %7, i8* %6
store i8* %8, i8** %0
ret void
}
double rosenbrockFunctionLowerRangeBound(int dimension) { return (-1e+308); }


x86 assembly (clang, -O0):
<rosenbrockFunctionLowerRangeBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rosenbrockFunctionLowerRangeBound>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rosenbrockFunctionLowerRangeBound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret double -1.000000e+308
}

LLVM IR (-O2):
define double @rosenbrockFunctionLowerRangeBound(i32 %0) {
ret double -1.000000e+308
}
int frequencyNotation(int index) {
  if (index >= 9)
    return index - 9;
  else
    return -(index + 3);
}


x86 assembly (clang, -O0):
<frequencyNotation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x9,-0x8(%rbp)
jl     111f <frequencyNotation+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x9,%eax
mov    %eax,-0x4(%rbp)
jmp    112c <frequencyNotation+0x2c>
mov    -0x8(%rbp),%ecx
add    $0x3,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<frequencyNotation>:
lea    -0x9(%rdi),%ecx
mov    $0xfffffffd,%eax
sub    %edi,%eax
cmp    $0x9,%edi
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @frequencyNotation(i32 %0) {
%2 = icmp sgt i32 %0, 8
%3 = add nsw i32 %0, -9
%4 = sub i32 -3, %0
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
void __change_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % 32));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / 32);
  *p ^= mask;
}


x86 assembly (clang, -O0):
<__change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
xor    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__change_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
mov    %eax,%edx
and    $0xffffffe0,%edx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
sar    $0x5,%eax
cltq
xor    %rdx,(%rsi,%rax,8)
ret

LLVM IR (-O0):
define void @__change_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = srem i32 %7, 32
%9 = zext i32 %8 to i64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sdiv i32 %12, 32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = xor i64 %18, %16
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @__change_bit(i32 %0, i64* nocapture %1) {
%3 = srem i32 %0, 32
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = sdiv i32 %0, 32
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = xor i64 %9, %5
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ md4_init(void *);
void hash_method_init_md4(void *context) { md4_init(context); }


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

x86 assembly (clang, -O2):
<hash_method_init_md4>:
jmp    1030 <md4_init@plt>

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

LLVM IR (-O2):
define void @hash_method_init_md4(i8* %0) {
%2 = tail call i32 @md4_init(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOTSUP;
int /*<<< orphan*/ errno;
int _write(int file, char *ptr, int len) {
  errno = file < 0 ? EINVAL : ENOTSUP;
  return -1;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1129 <_write+0x29>
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    1135 <_write+0x35>
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%ecx
mov    0x2e99(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
test   %edi,%edi
jns    110d <_write+0xd>
mov    0x2ec5(%rip),%rax
jmp    1114 <_write+0x14>
mov    0x2ed4(%rip),%rax
mov    (%rax),%eax
mov    0x2ebb(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load i32, i32* @EINVAL
br label %13
11: ; preds = %3
%12 = load i32, i32* @ENOTSUP
br label %13
13: ; preds = %11, %9
%14 = phi i32 [ %10, %9 ], [ %12, %11 ]
store i32 %14, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOTSUP = global i32 0
@errno = global i32 0
define i32 @_write(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = load i32, i32* @EINVAL
%6 = load i32, i32* @ENOTSUP
%7 = select i1 %4, i32 %5, i32 %6
store i32 %7, i32* @errno
ret i32 -1
}
void ConvertVertex(void) {}


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

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

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

LLVM IR (-O2):
define void @ConvertVertex() {
ret void
}
/* Variables and functions */
scalar_t__ atoi(scalar_t__);
scalar_t__ getenv(char *);
int get_screen_rows(void) {
  if (getenv("LINES"))
    return ((unsigned int)atoi(getenv("LINES")));
  return 25;
}


x86 assembly (clang, -O0):
<get_screen_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     115a <get_screen_rows+0x3a>
lea    0xebb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <get_screen_rows+0x41>
movl   $0x19,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_screen_rows>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113c <get_screen_rows+0x1c>
mov    %rax,%rdi
call   1040 <atoi@plt>
pop    %rcx
ret
mov    $0x19,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"LINES\00"
define i32 @get_screen_rows() {
%1 = alloca i32
%2 = call i64 @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i64 @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @atoi(i64 %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 25, i32* %1
br label %9
9: ; preds = %8, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"LINES\00"
define i32 @get_screen_rows() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @atoi(i64 %1)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 25, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ad_push(int);
int /*<<< orphan*/ jmp(int);
void call(int addr, int retaddr) {
  ad_push(retaddr);
  jmp(addr);
}


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

x86 assembly (clang, -O2):
<call>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <ad_push@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <jmp@plt>

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

LLVM IR (-O2):
define void @call(i32 %0, i32 %1) {
%3 = tail call i32 @ad_push(i32 %1)
%4 = tail call i32 @jmp(i32 %0)
ret void
}
void RTLatin1ToUtf8ExTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLatin1ToUtf8ExTag() {
ret void
}
char *strdup(s)
char *s;
{
  extern char *malloc();
  char *p = malloc(strlen(s) + 1);
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
xor    %eax,%eax
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* (i64, ...) bitcast (i8* (...)* @malloc to i8* (i64, ...)*)(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @strdup(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* (i64, ...) bitcast (i8* (...)* @malloc to i8* (i64, ...)*)(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
void gtk_range_set_adjustment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_range_set_adjustment() {
ret void
}
char *testUnit() {
  do {
    if (!(1 == 1))
      return "error, testUnit 1 != 1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<testUnit>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <testUnit+0x9>
jmp    110e <testUnit+0xe>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @testUnit() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @testUnit() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ checkError(char *);
int /*<<< orphan*/ glClearColor(double, double, double, double);
void initRendering(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  checkError("initRendering");
}


x86 assembly (clang, -O0):
<initRendering>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
lea    0xec4(%rip),%rdi
call   1040 <checkError@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initRendering>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <checkError@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"initRendering\00"
define void @initRendering() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = call i32 @checkError(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"initRendering\00"
define void @initRendering() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = tail call i32 @checkError(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_28int64_midword_reg(long long val) {
  return ((val >> 16) & (0x28 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_28int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x28,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_28int64_midword_reg>:
test   $0x280000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_28int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 40
%6 = icmp ne i64 %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_28int64_midword_reg(i64 %0) {
%2 = and i64 %0, 2621440
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ creat_page();
int /*<<< orphan*/ mmu_init();
void mmu_start() {
  creat_page();
  mmu_init();
}


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

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

LLVM IR (-O0):
define void @mmu_start() {
%1 = call i32 (...) @creat_page()
%2 = call i32 (...) @mmu_init()
ret void
}

LLVM IR (-O2):
define void @mmu_start() {
%1 = tail call i32 (...) @creat_page()
%2 = tail call i32 (...) @mmu_init()
ret void
}
void *test_anti_range_88(short n) {
  extern void *alloc_anti_range_88(short) __attribute__((alloc_size(1)));
  if (0x7fff - 2 <= n && n <= 0x7fff - 1)
    n = 0x7fff - 2 - 1;
  return alloc_anti_range_88(n);
}


x86 assembly (clang, -O0):
<test_anti_range_88>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
mov    $0x7ffd,%eax
cmp    %ecx,%eax
jg     1145 <test_anti_range_88+0x35>
movswl -0x2(%rbp),%eax
cmp    $0x7ffe,%eax
jg     1145 <test_anti_range_88+0x35>
movw   $0x7ffc,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_88@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_88>:
lea    -0x7ffd(%rdi),%eax
cmp    $0x2,%ax
mov    $0x7ffc,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_88@plt>

LLVM IR (-O0):
define i8* @test_anti_range_88(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 32765, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 32766
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 32764, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_88(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_88(i16 signext %0) {
%2 = add i16 %0, -32765
%3 = icmp ult i16 %2, 2
%4 = select i1 %3, i16 32764, i16 %0
%5 = tail call i8* @alloc_anti_range_88(i16 signext %4)
ret i8* %5
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int getCodeDepth(int code_depth, int64_t file_depth) {
  if (file_depth < 0)
    return code_depth;
  else if ((file_depth > 65535) || (!file_depth))
    return 0;
  else if (file_depth > code_depth)
    return (int)file_depth;
  else
    return code_depth;
}


x86 assembly (clang, -O0):
<getCodeDepth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    111f <getCodeDepth+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <getCodeDepth+0x5f>
cmpl   $0xffff,-0xc(%rbp)
jg     1136 <getCodeDepth+0x36>
cmpl   $0x0,-0xc(%rbp)
jne    1142 <getCodeDepth+0x42>
movl   $0x0,-0x4(%rbp)
jmp    115f <getCodeDepth+0x5f>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1159 <getCodeDepth+0x59>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <getCodeDepth+0x5f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCodeDepth>:
test   %esi,%esi
js     1116 <getCodeDepth+0x16>
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0xfffe,%ecx
ja     1118 <getCodeDepth+0x18>
cmp    %edi,%esi
cmovg  %esi,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @getCodeDepth(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = add nsw i32 %1, -1
%6 = icmp ult i32 %5, 65535
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = icmp sgt i32 %1, %0
%9 = select i1 %8, i32 %1, i32 %0
br label %10
10: ; preds = %7, %4, %2
%11 = phi i32 [ %0, %2 ], [ 0, %4 ], [ %9, %7 ]
ret i32 %11
}
/* Variables and functions */
int yylex();
int main(void) { return yylex(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @yylex()
ret i32 %1
}
/* Variables and functions */
int rn_contentType(int);
int rn_groupable(int p1, int p2) {
  int ct1 = rn_contentType(p1), ct2 = rn_contentType(p2);
  return ((ct1 & ct2 & 0x00000800) || ((ct1 | ct2) & 0x00000400));
}


x86 assembly (clang, -O0):
<rn_groupable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rn_contentType@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <rn_contentType@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
and    -0x10(%rbp),%ecx
and    $0x800,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    1162 <rn_groupable+0x52>
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rn_groupable>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <rn_contentType@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <rn_contentType@plt>
mov    %ebp,%ecx
and    %eax,%ecx
or     %ebp,%eax
shr    $0xa,%eax
and    $0x1,%eax
test   $0x800,%ecx
mov    $0x1,%ecx
cmovne %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rn_groupable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @rn_contentType(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @rn_contentType(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = and i32 %13, 2048
%15 = icmp ne i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %2
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = or i32 %17, %18
%20 = and i32 %19, 1024
%21 = icmp ne i32 %20, 0
br label %22
22: ; preds = %16, %2
%23 = phi i1 [ true, %2 ], [ %21, %16 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @rn_groupable(i32 %0, i32 %1) {
%3 = tail call i32 @rn_contentType(i32 %0)
%4 = tail call i32 @rn_contentType(i32 %1)
%5 = and i32 %3, 2048
%6 = and i32 %5, %4
%7 = icmp eq i32 %6, 0
%8 = or i32 %4, %3
%9 = lshr i32 %8, 10
%10 = and i32 %9, 1
%11 = select i1 %7, i32 %10, i32 1
ret i32 %11
}
double milesToFeet(double miles) { return miles * 5280.0; }


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

x86 assembly (clang, -O2):
<milesToFeet>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @milesToFeet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 5.280000e+03
ret double %4
}

LLVM IR (-O2):
define double @milesToFeet(double %0) {
%2 = fmul double %0, 5.280000e+03
ret double %2
}
int default_score(char x, char y) {
  if ((x < 0) || (y < 0)) {
    return 2;
  }
  if ((x == 0) || (y == 0)) {
    return 2;
  }
  if (x == y) {
    return 0;
  }
  return 3;
}


x86 assembly (clang, -O0):
<default_score>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jl     112a <default_score+0x2a>
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jge    1136 <default_score+0x36>
movl   $0x2,-0x4(%rbp)
jmp    117f <default_score+0x7f>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     1150 <default_score+0x50>
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jne    115c <default_score+0x5c>
movl   $0x2,-0x4(%rbp)
jmp    117f <default_score+0x7f>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    1178 <default_score+0x78>
movl   $0x0,-0x4(%rbp)
jmp    117f <default_score+0x7f>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_score>:
mov    $0x2,%eax
mov    %esi,%ecx
or     %dil,%cl
js     1121 <default_score+0x21>
test   %dil,%dil
je     1121 <default_score+0x21>
test   %sil,%sil
je     1121 <default_score+0x21>
xor    %eax,%eax
cmp    %sil,%dil
setne  %al
lea    (%rax,%rax,2),%eax
ret

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

LLVM IR (-O2):
define i32 @default_score(i8 signext %0, i8 signext %1) {
%3 = or i8 %1, %0
%4 = icmp sgt i8 %3, -1
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = icmp eq i8 %0, 0
%7 = icmp eq i8 %1, 0
%8 = or i1 %6, %7
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = icmp eq i8 %0, %1
%11 = select i1 %10, i32 0, i32 3
br label %12
12: ; preds = %9, %5, %2
%13 = phi i32 [ 2, %2 ], [ 2, %5 ], [ %11, %9 ]
ret i32 %13
}
void Scrobj_Destruct(void *data) {}


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

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

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

LLVM IR (-O2):
define void @Scrobj_Destruct(i8* nocapture %0) {
ret void
}
int main(int argc, const char *argv[]) {
  int buffer[10];
  int i = 0;
  int a = 0;
  while (i < 10) {
    buffer[i] = i;
    ++i;
    ++a;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    114c <main+0x4c>
mov    -0x44(%rbp),%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
void readonly(int fd, int cfd) {
  char html[128];
  int letten;
  while ((letten = read(fd, html, 128)) > 0) {
    write(cfd, html, letten);
  }
}


x86 assembly (clang, -O0):
<readonly>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1040 <read@plt>
mov    %eax,-0x94(%rbp)
cmp    $0x0,%eax
jle    116e <readonly+0x4e>
mov    -0x8(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    -0x94(%rbp),%edx
call   1030 <write@plt>
jmp    1131 <readonly+0x11>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readonly>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %esi,%r14d
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x80,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <readonly+0x50>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <readonly+0x30>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @readonly(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [128 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %3
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = call i32 @read(i32 %8, i8* %9, i32 128)
store i32 %10, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = load i32, i32* %4
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* %6
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @readonly(i32 %0, i32 %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 128)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = call i32 @write(i32 %1, i8* %4, i32 %8)
%10 = call i32 @read(i32 %0, i8* %4, i32 128)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}
void __attribute__((weak)) gc_finalize(void *obj, void *client_data) {}


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

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

LLVM IR (-O0):
define weak void @gc_finalize(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define weak void @gc_finalize(i8* %0, i8* %1) {
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_item(struct list_head *, unsigned long long);
void collatz(struct list_head *head, unsigned long long i) {
  if (i % 2 == 0)
    i = i / 2;
  else
    i = i * 3 + 1;
  add_item(head, i);
  if (i != 1)
    collatz(head, i);
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    1153 <collatz+0x33>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1160 <collatz+0x40>
imul   $0x3,-0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <add_item@plt>
cmpq   $0x1,-0x10(%rbp)
je     1185 <collatz+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <collatz@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rax
shr    %rax
test   $0x1,%bl
lea    0x1(%rbx,%rbx,2),%rbx
cmove  %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <add_item@plt>
cmp    $0x1,%rbx
jne    1120 <collatz+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @collatz(%struct.list_head* %0, i64 %1) {
%3 = alloca %struct.list_head*
%4 = alloca i64
store %struct.list_head* %0, %struct.list_head** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = urem i64 %5, 2
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i64, i64* %4
%10 = udiv i64 %9, 2
store i64 %10, i64* %4
br label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = mul i64 %12, 3
%14 = add i64 %13, 1
store i64 %14, i64* %4
br label %15
15: ; preds = %11, %8
%16 = load %struct.list_head*, %struct.list_head** %3
%17 = load i64, i64* %4
%18 = call i32 @add_item(%struct.list_head* %16, i64 %17)
%19 = load i64, i64* %4
%20 = icmp ne i64 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %15
%22 = load %struct.list_head*, %struct.list_head** %3
%23 = load i64, i64* %4
br label %24
24: ; preds = %21, %15
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @collatz(%struct.list_head* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %1, %2 ], [ %10, %3 ]
%5 = and i64 %4, 1
%6 = icmp eq i64 %5, 0
%7 = lshr i64 %4, 1
%8 = mul i64 %4, 3
%9 = add i64 %8, 1
%10 = select i1 %6, i64 %7, i64 %9
%11 = tail call i32 @add_item(%struct.list_head* %0, i64 %10)
%12 = icmp eq i64 %10, 1
br i1 %12, label %13, label %3
13: ; preds = %3
ret void
}
int isInMap(unsigned int x, unsigned int y) {
  return (0 <= x) && (x < 16) && (0 <= y) && (y < 16);
}


x86 assembly (clang, -O0):
<isInMap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
ja     1143 <isInMap+0x43>
xor    %eax,%eax
cmpl   $0x10,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jae    1143 <isInMap+0x43>
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%ecx
mov    %al,-0x9(%rbp)
ja     1143 <isInMap+0x43>
cmpl   $0x10,-0x8(%rbp)
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInMap>:
or     %esi,%edi
xor    %eax,%eax
cmp    $0x10,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isInMap(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 16
%5 = zext i1 %4 to i32
ret i32 %5
}