xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ realloc(char *, scalar_t__);
scalar_t__ strlen(char *);
char *gs_fix_realloc(char *str) {
  if (!str)
    return 0;
  return (char *)realloc(str, strlen(str) + 1);
}


x86 assembly (clang, -O0):
<gs_fix_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <gs_fix_realloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1169 <gs_fix_realloc+0x49>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_fix_realloc>:
test   %rdi,%rdi
je     113c <gs_fix_realloc+0x1c>
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
call   1040 <realloc@plt>
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @gs_fix_realloc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i64 @realloc(i8* %8, i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %2
br label %14
14: ; preds = %7, %6
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @gs_fix_realloc(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @realloc(i8* %0, i64 %5)
%7 = inttoptr i64 %6 to i8*
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ g(int const *);
int f(const int *restrict p) {
  g(p);
  return *p;
}


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

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <g@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @f(i32* noalias %0) {
%2 = tail call i32 @g(i32* %0)
%3 = load i32, i32* %0
ret i32 %3
}
/* Variables and functions */
int _compar(const void *a_, const void *b_) {
  size_t a = *((size_t *)a_);
  size_t b = *((size_t *)b_);
  if (a < b) {
    return -1;
  } else if (a > b) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_compar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    113c <_compar+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <_compar+0x62>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    1156 <_compar+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1162 <_compar+0x62>
jmp    115b <_compar+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_compar>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp ult i64 %4, %6
%8 = icmp ugt i64 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_by_value_5b_x();
int main() {
  struct_by_value_5b_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <struct_by_value_5b_x@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <struct_by_value_5b_x@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_by_value_5b_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ even(unsigned int);
unsigned int odd(unsigned int value) { return !even(value); }


x86 assembly (clang, -O0):
<odd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <even@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @odd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @even(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @odd(i32 %0) {
%2 = tail call i32 @even(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int int_least32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void dec_dump(int_least32_t stack, int n, FILE *fOut) {
  int i, it;
  for (i = 2; (3 - n) <= i; --i) {
    it = (stack >> (8 * i)) & 255;
    fputc(it, fOut);
  }
}


x86 assembly (clang, -O0):
<dec_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    $0x3,%eax
sub    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1167 <dec_dump+0x57>
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <dec_dump+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_dump>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    115d <dec_dump+0x4d>
mov    %rdx,%r14
mov    %edi,%r15d
mov    $0x3,%ebp
mov    $0x3,%r12d
sub    %esi,%r12d
mov    $0x10,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15d,%eax
mov    %ebx,%ecx
sar    %cl,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
add    $0xfffffff8,%ebx
cmp    %ebp,%r12d
jl     1140 <dec_dump+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @dec_dump(i32 %0, i32 %1, i32* nocapture %2) {
%4 = sub nsw i32 3, %1
%5 = icmp slt i32 %1, 1
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ 2, %3 ]
%8 = shl nsw i32 %7, 3
%9 = ashr i32 %0, %8
%10 = and i32 %9, 255
%11 = tail call i32 @fputc(i32 %10, i32* %2)
%12 = add nsw i32 %7, -1
%13 = icmp slt i32 %4, %7
br i1 %13, label %6, label %14
14: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bl_read(int /*<<< orphan*/, int, int, char *);
void loadIt() {
  int i;
  for (i = 0; i < 2048 * 4; i++) {
    bl_read(0, i + (0x300000 / 512), 1, (char *)(0x300000 + (i * 512)));
  }
}


x86 assembly (clang, -O0):
<loadIt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2000,-0x4(%rbp)
jge    115d <loadIt+0x4d>
mov    -0x4(%rbp),%esi
add    $0x1800,%esi
mov    -0x4(%rbp),%eax
shl    $0x9,%eax
add    $0x300000,%eax
movslq %eax,%rcx
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <bl_read@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <loadIt+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadIt>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1800,%ebp
mov    $0x300000,%ebx
nopl   (%rax)
xor    %edi,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <bl_read@plt>
add    $0x1,%ebp
add    $0x200,%rbx
cmp    $0x700000,%rbx
jne    1120 <loadIt+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @loadIt() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %14, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 8192
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 6144
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 512
%10 = add nsw i32 3145728, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = call i32 @bl_read(i32 0, i32 %7, i32 1, i8* %12)
br label %14
14: ; preds = %5
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %2
17: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @loadIt() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %9, %1 ]
%3 = shl nuw nsw i64 %2, 9
%4 = add nuw nsw i64 %3, 3145728
%5 = inttoptr i64 %4 to i8*
%6 = trunc i64 %2 to i32
%7 = add i32 %6, 6144
%8 = tail call i32 @bl_read(i32 0, i32 %7, i32 1, i8* %5)
%9 = add nuw nsw i64 %2, 1
%10 = icmp eq i64 %9, 8192
br i1 %10, label %11, label %1
11: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_cdp2(int, int, int, int, int, int);
void cdp2() { __builtin_arm_cdp2(1, 2, 3, 4, 5, 6); }


x86 assembly (clang, -O0):
<cdp2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
call   1030 <__builtin_arm_cdp2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdp2>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
jmp    1030 <__builtin_arm_cdp2@plt>

LLVM IR (-O0):
define void @cdp2() {
%1 = call i32 @__builtin_arm_cdp2(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
ret void
}

LLVM IR (-O2):
define void @cdp2() {
%1 = tail call i32 @__builtin_arm_cdp2(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fput_u8(int /*<<< orphan*/ *, unsigned int);
void fput_u16l(FILE *f, unsigned val) {
  fput_u8(f, val & 0xff);
  fput_u8(f, val >> 8);
}


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

x86 assembly (clang, -O2):
<fput_u16l>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%esi
call   1030 <fput_u8@plt>
shr    $0x8,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fput_u8@plt>

LLVM IR (-O0):
define void @fput_u16l(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 255
%8 = call i32 @fput_u8(i32* %5, i32 %7)
%9 = load i32*, i32** %3
%10 = load i32, i32* %4
%11 = lshr i32 %10, 8
%12 = call i32 @fput_u8(i32* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @fput_u16l(i32* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @fput_u8(i32* %0, i32 %3)
%5 = lshr i32 %1, 8
%6 = tail call i32 @fput_u8(i32* %0, i32 %5)
ret void
}
int test_imm_33uint16_reg(unsigned short val) {
  return ((val) & (0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x33,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_33uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 51
%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_33uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 51
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CMGR_finalize();
int /*<<< orphan*/ crypt_finalize();
void hcache_finalize_complex(void) {
  crypt_finalize();
  CMGR_finalize();
  ;
}


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

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

LLVM IR (-O0):
define void @hcache_finalize_complex() {
%1 = call i32 (...) @crypt_finalize()
%2 = call i32 (...) @CMGR_finalize()
ret void
}

LLVM IR (-O2):
define void @hcache_finalize_complex() {
%1 = tail call i32 (...) @crypt_finalize()
%2 = tail call i32 (...) @CMGR_finalize()
ret void
}
/* Variables and functions */
int GetWordUsage(void const *);
int VocabCompare(const void *a, const void *b) {
  return GetWordUsage(b) - GetWordUsage(a);
}


x86 assembly (clang, -O0):
<VocabCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <GetWordUsage@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <GetWordUsage@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VocabCompare>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <GetWordUsage@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <GetWordUsage@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @VocabCompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @GetWordUsage(i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @GetWordUsage(i8* %7)
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @VocabCompare(i8* %0, i8* %1) {
%3 = tail call i32 @GetWordUsage(i8* %1)
%4 = tail call i32 @GetWordUsage(i8* %0)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
int is_alnum(char character) {
  int temp_ascii = (int)character;
  if (((temp_ascii >= 65) && (temp_ascii <= 90)) ||
      ((temp_ascii >= 97) && (temp_ascii <= 122)) ||
      ((temp_ascii >= 48) && (temp_ascii <= 57))) {
    return 8;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_alnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x41,-0xc(%rbp)
jl     1125 <is_alnum+0x25>
cmpl   $0x5a,-0xc(%rbp)
jle    114d <is_alnum+0x4d>
cmpl   $0x61,-0xc(%rbp)
jl     1139 <is_alnum+0x39>
cmpl   $0x7a,-0xc(%rbp)
jle    114d <is_alnum+0x4d>
cmpl   $0x30,-0xc(%rbp)
jl     1159 <is_alnum+0x59>
cmpl   $0x39,-0xc(%rbp)
jg     1159 <is_alnum+0x59>
movl   $0x8,-0x4(%rbp)
jmp    1160 <is_alnum+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alnum>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
shl    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @is_alnum(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 65
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sle i32 %10, 90
br i1 %11, label %24, label %12
12: ; preds = %9, %1
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %4
%17 = icmp sle i32 %16, 122
br i1 %17, label %24, label %18
18: ; preds = %15, %12
%19 = load i32, i32* %4
%20 = icmp sge i32 %19, 48
br i1 %20, label %21, label %25
21: ; preds = %18
%22 = load i32, i32* %4
%23 = icmp sle i32 %22, 57
br i1 %23, label %24, label %25
24: ; preds = %21, %15, %9
store i32 8, i32* %2
br label %26
25: ; preds = %21, %18
store i32 0, i32* %2
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @is_alnum(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 = select i1 %7, i32 8, i32 0
ret i32 %8
}
char *stack_check_star(char *str) { return str; }


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

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

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

LLVM IR (-O2):
define i8* @stack_check_star(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare(const char *a, const char *b) { return strcmp(a, b); }


x86 assembly (clang, -O0):
<compare>:
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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(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 i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int number_of_indent_levels(char *line) {
  int i, result = 0;
  for (i = 0; i < 100; i++) {
    if (line[i] == '.')
      result++;
    if (line[i] != '.')
      i = 100 + 1;
  }
  return (result);
}


x86 assembly (clang, -O0):
<number_of_indent_levels>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    116d <number_of_indent_levels+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    113e <number_of_indent_levels+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
je     115a <number_of_indent_levels+0x5a>
movl   $0x65,-0xc(%rbp)
jmp    115f <number_of_indent_levels+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <number_of_indent_levels+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_indent_levels>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%esi
movzbl (%rdi,%rcx,1),%edx
xor    %eax,%eax
cmp    $0x2e,%dl
sete   %al
add    %esi,%eax
cmp    $0x2e,%dl
jne    1131 <number_of_indent_levels+0x31>
lea    0x1(%rcx),%rdx
cmp    $0x63,%ecx
mov    %rdx,%rcx
jb     1110 <number_of_indent_levels+0x10>
ret

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

LLVM IR (-O2):
define i32 @number_of_indent_levels(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %11, %2 ]
%4 = phi i32 [ 0, %1 ], [ %9, %2 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 46
%9 = add nuw nsw i32 %4, 1
%10 = zext i1 %8 to i32
%11 = add nuw nsw i32 %3, %10
%12 = icmp ult i32 %4, 99
%13 = select i1 %8, i1 %12, i1 false
br i1 %13, label %2, label %14
14: ; preds = %2
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage() {
  fputs("Usage: rmdir [OPTION(S)] [DIRECTORY]\n\n"
        "OPTIONS:\n"
        "  -v, --verbose      print a message for every created directory\n"
        "  -p, --parents      remove DIRECTORY and its parents\n"
        "    --help           print this message and exit\n"
        "    --version        print version and exit\n",
        stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [260 x i8] c"Usage: rmdir [OPTION(S)] [DIRECTORY]\0A\0AOPTIONS:\0A -v, --verbose print a message for every created directory\0A -p, --parents remove DIRECTORY and its parents\0A --help print this message and exit\0A --version print version and exit\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [260 x i8] c"Usage: rmdir [OPTION(S)] [DIRECTORY]\0A\0AOPTIONS:\0A -v, --verbose print a message for every created directory\0A -p, --parents remove DIRECTORY and its parents\0A --help print this message and exit\0A --version print version and exit\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([260 x i8], [260 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
char *strcpy(char *s1, const char *s2) {
  char *s1_p = s1;
  while ((*s1++ = *s2++))
    ;
  return s1_p;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
int getNumberDigits(long lNum) {
  int iDig;
  if (lNum == 0)
    iDig = 1;
  else
    for (iDig = 0; lNum != 0; ++iDig)
      lNum /= 10;
  return iDig;
}


x86 assembly (clang, -O0):
<getNumberDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    111f <getNumberDigits+0x1f>
movl   $0x1,-0xc(%rbp)
jmp    1156 <getNumberDigits+0x56>
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <getNumberDigits+0x51>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <getNumberDigits+0x26>
jmp    1156 <getNumberDigits+0x56>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNumberDigits>:
test   %rdi,%rdi
je     1147 <getNumberDigits+0x47>
xor    %ecx,%ecx
movabs $0x6666666666666667,%rsi
66 66 66
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rax
imul   %rsi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x2,%rdx
add    %rax,%rdx
add    $0x1,%ecx
add    $0x9,%rdi
cmp    $0x12,%rdi
mov    %rdx,%rdi
ja     1120 <getNumberDigits+0x20>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getNumberDigits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i64 %5, 9
%9 = icmp ult i64 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void os_trace_api_u32x3(unsigned id, uint32_t p0, uint32_t p1, uint32_t p2) {}


x86 assembly (clang, -O0):
<os_trace_api_u32x3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @os_trace_api_u32x3(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @os_trace_api_u32x3(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
suid() {
  setuid(0);
  execl("/bin/tcsh", " tcsh", NULL);
  exit(1);
}


x86 assembly (clang, -O0):
<suid>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xebe(%rip),%rdi
lea    0xec1(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execl@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<suid>:
push   %rax
xor    %edi,%edi
call   1040 <setuid@plt>
lea    0xec1(%rip),%rdi
lea    0xec4(%rip),%rsi
xor    %edx,%edx
call   1050 <execl@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/tcsh\00"
@.str.1 = [6 x i8] c" tcsh\00"
define i32 @suid() {
%1 = call i32 @setuid(i32 0)
%2 = call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/tcsh\00"
@.str.1 = [6 x i8] c" tcsh\00"
define i32 @suid() {
%1 = tail call i32 @setuid(i32 0)
%2 = tail call i32 @execl(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* null)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void X509V3_conf_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_conf_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *);
char *strdup(char *);
char *measurement_backup_sys_string(char *where) {
  char sys_string[1024];
  sprintf(sys_string, "select.sh '*' %s \"%s\" \"%s\"", "measurement_backup",
          where, "measurement_update_date,measurement_update_time");
  return strdup(sys_string);
}


x86 assembly (clang, -O0):
<measurement_backup_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
lea    0xed3(%rip),%rdx
lea    0xedf(%rip),%r8
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurement_backup_sys_string>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
lea    0xee2(%rip),%rdx
lea    0xeee(%rip),%r8
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"select.sh '*' %s \22%s\22 \22%s\22\00"
@.str.1 = [19 x i8] c"measurement_backup\00"
@.str.2 = [48 x i8] c"measurement_update_date,measurement_update_time\00"
define i8* @measurement_backup_sys_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [27 x i8] c"select.sh '*' %s \22%s\22 \22%s\22\00"
@.str.1 = [19 x i8] c"measurement_backup\00"
@.str.2 = [48 x i8] c"measurement_update_date,measurement_update_time\00"
define noalias i8* @measurement_backup_sys_string(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
int valueFromUnary(int value) { return value - 1; }


x86 assembly (clang, -O0):
<valueFromUnary>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valueFromUnary>:
lea    -0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @valueFromUnary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @valueFromUnary(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
extern unsigned long long get_cycles() {
  long long out;
  asm volatile("RDTSCP;"
               "SHLQ $32,%%rdx;"
               "ORQ %%rdx,%%rax;"
               "MOVQ %%rax,%0;"
               : "=r"(out)
               :
               : "rdx", "rax", "rcx");
  return out;
}


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

x86 assembly (clang, -O2):
<get_cycles>:
rdtscp
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,%rsi
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @get_cycles() {
%1 = alloca i64
%2 = call i64 asm sideeffect "RDTSCP;SHLQ $$32,%rdx;ORQ %rdx,%rax;MOVQ %rax,$0;", "=r,~{rdx},~{rax},~{rcx},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @get_cycles() {
%1 = tail call i64 asm sideeffect "RDTSCP;SHLQ $$32,%rdx;ORQ %rdx,%rax;MOVQ %rax,$0;", "=r,~{rdx},~{rax},~{rcx},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ report_and_exit();
int /*<<< orphan*/ test_ttl();
int main() {
  initialize();
  test_ttl();
  report_and_exit();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @test_ttl()
%3 = tail call i32 (...) @report_and_exit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRD6_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRD6_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRD6_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void bot_vector_subtract_2d(const double v1[2], const double v2[2],
                            double result[2]) {
  result[0] = v1[0] - v2[0];
  result[1] = v1[1] - v2[1];
}


x86 assembly (clang, -O0):
<bot_vector_subtract_2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_vector_subtract_2d>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
subsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @bot_vector_subtract_2d(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
ret void
}

LLVM IR (-O2):
define void @bot_vector_subtract_2d(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(size_t);
void *memcre_(size_t count) {
  void *tmp = (void *)malloc(count * sizeof(char));
  if (tmp == NULL)
    exit(1);
  return tmp;
}


x86 assembly (clang, -O0):
<memcre_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0x0,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <memcre_+0x32>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcre_>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     112d <memcre_+0xd>
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @memcre_(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 1
%6 = call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @memcre_(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
int parity(unsigned int i) {
  int count = 0;
  while (i > 0) {
    if (i & 1) {
      count++;
    }
    i = i >> 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<parity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    113e <parity+0x3e>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <parity+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <parity+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parity>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <parity+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <parity+0x10>
ret

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

LLVM IR (-O2):
define i32 @parity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int readidew(int);
uint32_t readidel(int ide_board) {
  uint16_t temp;
  temp = readidew(ide_board);
  return temp | (readidew(ide_board) << 16);
}


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

x86 assembly (clang, -O2):
<readidel>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <readidew@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <readidew@plt>
shl    $0x10,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @readidel(i32 %0) {
%2 = tail call i32 @readidew(i32 %0)
%3 = tail call i32 @readidew(i32 %0)
%4 = shl i32 %3, 16
%5 = or i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int f1();
int main() {
  if (f1() != 2)
    abort();
  if (f1() != 2)
    abort();
  if (f1() != 2)
    abort();
  if (f1() != 2)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f1@plt>
cmp    $0x2,%eax
je     1146 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <f1@plt>
cmp    $0x2,%eax
je     115d <main+0x3d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <f1@plt>
cmp    $0x2,%eax
je     1174 <main+0x54>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x0,%al
call   1040 <f1@plt>
cmp    $0x2,%eax
je     118b <main+0x6b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f1@plt>
cmp    $0x2,%eax
jne    1155 <main+0x35>
xor    %eax,%eax
call   1040 <f1@plt>
cmp    $0x2,%eax
jne    1155 <main+0x35>
xor    %eax,%eax
call   1040 <f1@plt>
cmp    $0x2,%eax
jne    1155 <main+0x35>
xor    %eax,%eax
call   1040 <f1@plt>
cmp    $0x2,%eax
jne    1155 <main+0x35>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 (...) @f1()
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 (...) @f1()
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %11
%17 = call i32 (...) @f1()
%18 = icmp ne i32 %17, 2
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @f1()
%7 = icmp eq i32 %6, 2
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 (...) @f1()
%12 = icmp eq i32 %11, 2
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @abort()
unreachable
15: ; preds = %10
%16 = tail call i32 (...) @f1()
%17 = icmp eq i32 %16, 2
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %15
ret i32 0
}
reg0adr1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ r0 = (*((int *)11111111)); }


x86 assembly (clang, -O0):
<reg0adr1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0xa98ac7,%eax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* inttoptr (i64 11111111 to i32*)
store i32 %14, i32* %8
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @reg0adr1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 undef
}
void unw_set_reg() {}


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

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

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

LLVM IR (-O2):
define void @unw_set_reg() {
ret void
}