xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fill(unsigned char *, size_t);
unsigned char *malloc(size_t);
int /*<<< orphan*/ printf(char *, unsigned char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(int argc, char **argv) {
  unsigned char *result;
  char input;
  size_t s = 1 << 30;
  result = malloc(s);
  printf("Addr: %p\n", result);
  fill(result, s);
  scanf("%c", &input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x40000000,-0x28(%rbp)
40
mov    -0x28(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <fill@plt>
lea    0xe7b(%rip),%rdi
lea    -0x19(%rbp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x40000000,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x40000000,%esi
mov    %rbx,%rdi
call   1040 <fill@plt>
lea    0xe95(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Addr: %p\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1073741824, i64* %8
%9 = load i64, i64* %8
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %6
%14 = load i64, i64* %8
%15 = call i32 @fill(i8* %13, i64 %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Addr: %p\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = tail call dereferenceable_or_null(1073741824) i8* @malloc(i64 1073741824)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @fill(i8* %4, i64 1073741824)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ mpz_mul_2exp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_set_ui(int /*<<< orphan*/, int);
void mpz_set_uint64(mpz_t z, uint64_t x) {
  mpz_set_ui(z, (x >> 32));
  mpz_mul_2exp(z, z, 32);
  mpz_add_ui(z, z, (uint32_t)x);
}


x86 assembly (clang, -O0):
<mpz_set_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1050 <mpz_set_ui@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x20,%edx
call   1040 <mpz_mul_2exp@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <mpz_add_ui@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_set_uint64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <mpz_set_ui@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    $0x20,%edx
call   1040 <mpz_mul_2exp@plt>
mov    %ebp,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mpz_add_ui@plt>

LLVM IR (-O0):
define void @mpz_set_uint64(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 = ashr i32 %6, 32
%8 = call i32 @mpz_set_ui(i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @mpz_mul_2exp(i32 %9, i32 %10, i32 32)
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @mpz_add_ui(i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @mpz_set_uint64(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_set_ui(i32 %0, i32 poison)
%4 = tail call i32 @mpz_mul_2exp(i32 %0, i32 %0, i32 32)
%5 = tail call i32 @mpz_add_ui(i32 %0, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_exit(char *message) {
  fprintf(stderr, message);
  exit(1);
}


x86 assembly (clang, -O0):
<error_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_exit>:
push   %rax
mov    %rdi,%rsi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @error_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
signed char getSoundData(char *buf, long unit, long sample) {
  signed char ret;
  char *p;
  long offset, shift;
  p = buf;
  shift = (unit % 2) * 4;
  offset = 16 + (unit / 2) + (sample * 4);
  p += offset;
  ret = (*p >> shift) & 0x0F;
  if (ret > 7) {
    ret -= 16;
  }
  return ret;
}


x86 assembly (clang, -O0):
<getSoundData>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
shl    $0x2,%rdx
mov    %rdx,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
add    $0x10,%rax
mov    -0x18(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
mov    -0x38(%rbp),%rcx
sar    %cl,%eax
and    $0xf,%eax
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x7,%eax
jle    1185 <getSoundData+0x85>
movsbl -0x19(%rbp),%eax
sub    $0x10,%eax
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSoundData>:
mov    %rsi,%rax
shr    $0x3f,%rax
add    %rsi,%rax
sar    %rax
sub    %eax,%esi
sub    %eax,%esi
lea    (%rax,%rdx,4),%rax
movsbl 0x10(%rdi,%rax,1),%edx
lea    0x0(,%rsi,4),%ecx
sar    %cl,%edx
and    $0xf,%dl
cmp    $0x8,%dl
setb   %al
shl    $0x4,%al
or     %dl,%al
add    $0xf0,%al
ret

LLVM IR (-O0):
define signext i8 @getSoundData(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%11 = load i8*, i8** %4
store i8* %11, i8** %8
%12 = load i64, i64* %5
%13 = srem i64 %12, 2
%14 = mul nsw i64 %13, 4
store i64 %14, i64* %10
%15 = load i64, i64* %5
%16 = sdiv i64 %15, 2
%17 = add nsw i64 16, %16
%18 = load i64, i64* %6
%19 = mul nsw i64 %18, 4
%20 = add nsw i64 %17, %19
store i64 %20, i64* %9
%21 = load i64, i64* %9
%22 = load i8*, i8** %8
%23 = getelementptr inbounds i8, i8* %22, i64 %21
store i8* %23, i8** %8
%24 = load i8*, i8** %8
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = load i64, i64* %10
%28 = trunc i64 %27 to i32
%29 = ashr i32 %26, %28
%30 = and i32 %29, 15
%31 = trunc i32 %30 to i8
store i8 %31, i8* %7
%32 = load i8, i8* %7
%33 = sext i8 %32 to i32
%34 = icmp sgt i32 %33, 7
br i1 %34, label %35, label %40
35: ; preds = %3
%36 = load i8, i8* %7
%37 = sext i8 %36 to i32
%38 = sub nsw i32 %37, 16
%39 = trunc i32 %38 to i8
store i8 %39, i8* %7
br label %40
40: ; preds = %35, %3
%41 = load i8, i8* %7
ret i8 %41
}

LLVM IR (-O2):
define signext i8 @getSoundData(i8* nocapture %0, i64 %1, i64 %2) {
%4 = srem i64 %1, 2
%5 = sdiv i64 %1, 2
%6 = add nsw i64 %5, 16
%7 = shl nsw i64 %2, 2
%8 = add nsw i64 %6, %7
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = trunc i64 %4 to i32
%13 = shl nsw i32 %12, 2
%14 = ashr i32 %11, %13
%15 = trunc i32 %14 to i8
%16 = and i8 %15, 15
%17 = icmp ugt i8 %16, 7
%18 = select i1 %17, i8 -16, i8 0
%19 = or i8 %18, %16
ret i8 %19
}
/* Variables and functions */
int any_decrqss(char const *, char *);
int rpt_DECTTC(const char *the_title) { return any_decrqss(the_title, "|"); }


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

x86 assembly (clang, -O2):
<rpt_DECTTC>:
lea    0xee9(%rip),%rsi
jmp    1030 <any_decrqss@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"|\00"
define i32 @rpt_DECTTC(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @any_decrqss(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [2 x i8] c"|\00"
define i32 @rpt_DECTTC(i8* %0) {
%2 = tail call i32 @any_decrqss(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int isDigit(char c) {
  if (c >= '0' && c <= '9') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isDigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <isDigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isDigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isDigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ backend_init();
int /*<<< orphan*/ parallel_init();
void bomp_custom_init(void) {
  parallel_init();
  backend_init();
}


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

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

LLVM IR (-O0):
define void @bomp_custom_init() {
%1 = call i32 (...) @parallel_init()
%2 = call i32 (...) @backend_init()
ret void
}

LLVM IR (-O2):
define void @bomp_custom_init() {
%1 = tail call i32 (...) @parallel_init()
%2 = tail call i32 (...) @backend_init()
ret void
}
/* Variables and functions */
int __builtin_ctz(unsigned int);
int /*<<< orphan*/ assert(int);
int CountTrailingZeroes(unsigned int x) {
  assert(x != 0);
  int value = __builtin_ctz(x);
  assert(value >= 0 && value <= 31);
  return value;
}


x86 assembly (clang, -O0):
<CountTrailingZeroes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
bsf    %eax,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jl     114e <CountTrailingZeroes+0x3e>
cmpl   $0x1f,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CountTrailingZeroes>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setne  %dil
call   1030 <assert@plt>
bsf    %ebx,%ebx
mov    $0x1,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CountTrailingZeroes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @llvm.cttz.i32(i32 %8, i1 true)
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %3
%14 = icmp sle i32 %13, 31
br label %15
15: ; preds = %12, %1
%16 = phi i1 [ false, %1 ], [ %14, %12 ]
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @CountTrailingZeroes(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%6 = tail call i32 @assert(i32 1)
ret i32 %5
}
int compare(const void *X, const void *Y) {
  int x = *(const int *)X;
  int y = *(const int *)Y;
  return x - y;
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int compareINT(const void *current, const void *candidate) {
  return ((*(int *)current < *(int *)candidate
               ? -1
               : (*(int *)current > *(int *)candidate ? 1 : 0)));
}


x86 assembly (clang, -O0):
<compareINT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    112b <compareINT+0x2b>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <compareINT+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareINT>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareINT(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
%20 = icmp sgt i32 %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %13, %12
%24 = phi i32 [ -1, %12 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @compareINT(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ CallBack2(int, void *, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
scalar_t__ XOPRefNum();
void SetDialogBalloonHelpID(int balloonHelpID) {
  if (!CheckRunningInMainThread("SetDialogBalloonHelpID"))
    return;
  CallBack2(183, (void *)XOPRefNum(), (void *)balloonHelpID);
}


x86 assembly (clang, -O0):
<SetDialogBalloonHelpID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    1155 <SetDialogBalloonHelpID+0x25>
jmp    116d <SetDialogBalloonHelpID+0x3d>
mov    $0x0,%al
call   1050 <XOPRefNum@plt>
mov    %rax,%rsi
movslq -0x4(%rbp),%rdx
mov    $0xb7,%edi
call   1040 <CallBack2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetDialogBalloonHelpID>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1030 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     115b <SetDialogBalloonHelpID+0x2b>
xor    %eax,%eax
call   1050 <XOPRefNum@plt>
movslq %ebx,%rdx
mov    $0xb7,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <CallBack2@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"SetDialogBalloonHelpID\00"
define void @SetDialogBalloonHelpID(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %13
6: ; preds = %1
%7 = call i64 (...) @XOPRefNum()
%8 = inttoptr i64 %7 to i8*
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = call i32 @CallBack2(i32 183, i8* %8, i8* %11)
br label %13
13: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"SetDialogBalloonHelpID\00"
define void @SetDialogBalloonHelpID(i32 %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = tail call i64 (...) @XOPRefNum()
%6 = inttoptr i64 %5 to i8*
%7 = sext i32 %0 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @CallBack2(i32 183, i8* %6, i8* %8)
br label %10
10: ; preds = %1, %4
ret void
}
/* Variables and functions */
scalar_t__ strdup(char *);
void *chrdupe(void *key) { return (void *)strdup((char *)key); }


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

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

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

LLVM IR (-O2):
define i8* @chrdupe(i8* %0) {
%2 = tail call i64 @strdup(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int cairo_code_draw_envReverseLabel_get_height() { return 7; }


x86 assembly (clang, -O0):
<cairo_code_draw_envReverseLabel_get_height>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cairo_code_draw_envReverseLabel_get_height>:
mov    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @cairo_code_draw_envReverseLabel_get_height() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envReverseLabel_get_height() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ have_a_very_merry_interrupt();
main() {
  foo();
  have_a_very_merry_interrupt();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1040 <have_a_very_merry_interrupt@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @have_a_very_merry_interrupt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @have_a_very_merry_interrupt()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ client_main();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ server_main();
int main(int argc, char const *argv[]) {
  printf("Enter main\n");
  server_main();
  client_main();
  printf("Exit main\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <server_main@plt>
mov    $0x0,%al
call   1040 <client_main@plt>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <server_main@plt>
xor    %eax,%eax
call   1040 <client_main@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Enter main\0A\00"
@.str.1 = [11 x i8] c"Exit main\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @server_main()
%8 = call i32 (...) @client_main()
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"Enter main\00"
@str.2 = [10 x i8] c"Exit main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @server_main()
%5 = tail call i32 (...) @client_main()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
writeshm(int shmid, char *segptr, char *text) {
  strcpy(segptr, text);
  printf("Done...\n");
}


x86 assembly (clang, -O0):
<writeshm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeshm>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strcpy@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Done...\0A\00"
define i32 @writeshm(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i8*, i8** %6
%9 = load i8*, i8** %7
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@str = [8 x i8] c"Done...\00"
define i32 @writeshm(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %1, i8* %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int _create_DMA_buff(unsigned long *virtual_addr, unsigned long *physical_addr,
                     size_t length) {
  int temp;
  size_t contig_length;
  void *v_addr;
  unsigned int p_addr;
  return 1;
}


x86 assembly (clang, -O0):
<_create_DMA_buff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_create_DMA_buff>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_create_DMA_buff(i64* %0, i64* %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i32
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @_create_DMA_buff(i64* nocapture readnone %0, i64* nocapture readnone %1, i64 %2) {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
unsigned char ELFDATA2LSB;
unsigned char ELFDATA2MSB;
unsigned char endianness(void) {
  uint16_t two_byte = 0x00FF;
  uint8_t low_address = *((uint8_t *)&two_byte);
  if (low_address == 0) {
    return ELFDATA2MSB;
  } else {
    return ELFDATA2LSB;
  }
}


x86 assembly (clang, -O0):
<endianness>:
push   %rbp
mov    %rsp,%rbp
movl   $0xff,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112f <endianness+0x2f>
mov    0x2eb3(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
jmp    113b <endianness+0x3b>
mov    0x2eba(%rip),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endianness>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%al
ret

LLVM IR (-O0):
@ELFDATA2MSB = global i8 0
@ELFDATA2LSB = global i8 0
define zeroext i8 @endianness() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i64
store i32 255, i32* %2
%4 = bitcast i32* %2 to i64*
%5 = load i64, i64* %4
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load i8, i8* @ELFDATA2MSB
store i8 %9, i8* %1
br label %12
10: ; preds = %0
%11 = load i8, i8* @ELFDATA2LSB
store i8 %11, i8* %1
br label %12
12: ; preds = %10, %8
%13 = load i8, i8* %1
ret i8 %13
}

LLVM IR (-O2):
@ELFDATA2MSB = global i8 0
@ELFDATA2LSB = global i8 0
define zeroext i8 @endianness() {
%1 = load i8, i8* @ELFDATA2LSB
ret i8 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void one() {
  char a[20] = "You_are_a_girl";
  char *p = a;
  char **ptr = &p;
  printf("**ptr=%c\n", **ptr);
  p++;
  p--;
  printf("**ptr=%c\n", **ptr);
}


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
lea    0xebf(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
lea    0xe91(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x59,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x59,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@__const.one.a = [20 x i8] c"You_are_a_girl\00\00\00\00\00\00"
@.str = [10 x i8] c"**ptr=%c\0A\00"
define void @one() {
%1 = alloca [20 x i8]
%2 = alloca i8*
%3 = alloca i8**
%4 = bitcast [20 x i8]* %1 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
store i8* %5, i8** %2
store i8** %2, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = load i8, i8* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 -1
store i8* %13, i8** %2
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = load i8, i8* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %16)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"**ptr=%c\0A\00"
define void @one() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 89)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext 89)
ret void
}
int do_800() { return 800; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x320,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x320,%eax
ret

LLVM IR (-O0):
define i32 @do_800() {
ret i32 800
}

LLVM IR (-O2):
define i32 @do_800() {
ret i32 800
}
__attribute__((__weak__, __always___)) char *
softboundmpx_dcngettext(const char *domainname, const char *msgid,
                        const char *msgid_plural, unsigned long int n,
                        int category) {
  void *ret_ptr = dcngettext(domainname, msgid, msgid_plural, n, category);
  __softboundmpx_store_return_metadata(
      ret_ptr, (void *)((char *)ret_ptr + strlen(ret_ptr)));
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_dcngettext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    $0x0,%al
call   1040 <dcngettext@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdi
add    %rax,%rsi
mov    $0x0,%al
call   1050 <__softboundmpx_store_return_metadata@plt>
mov    -0x30(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_dcngettext>:
push   %rbx
xor    %eax,%eax
call   1040 <dcngettext@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    (%rax,%rbx,1),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i8* @softboundmpx_dcngettext(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%12 = load i8*, i8** %6
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i32, i32* %10
%17 = call i32 (i8*, i8*, i8*, i64, i32, ...) bitcast (i32 (...)* @dcngettext to i32 (i8*, i8*, i8*, i64, i32, ...)*)(i8* %12, i8* %13, i8* %14, i64 %15, i32 %16)
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %11
%20 = load i8*, i8** %11
%21 = load i8*, i8** %11
%22 = load i8*, i8** %11
%23 = call i64 @strlen(i8* %22)
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__softboundmpx_store_return_metadata to i32 (i8*, i8*, ...)*)(i8* %20, i8* %24)
%26 = load i8*, i8** %11
ret i8* %26
}

LLVM IR (-O2):
define weak i8* @softboundmpx_dcngettext(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = tail call i32 (i8*, i8*, i8*, i64, i32, ...) bitcast (i32 (...)* @dcngettext to i32 (i8*, i8*, i8*, i64, i32, ...)*)(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i64 @strlen(i8* dereferenceable(1) %8)
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__softboundmpx_store_return_metadata to i32 (i8*, i8*, ...)*)(i8* %8, i8* %10)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_cmatrix(unsigned char **m, long nrl, long nrh, long ncl, long nch) {
  free((char *)(m[nrl] + ncl - 0));
  free((char *)(m + nrl - 0));
}


x86 assembly (clang, -O0):
<free_cmatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_cmatrix>:
push   %rbx
lea    (%rdi,%rsi,8),%rbx
add    (%rdi,%rsi,8),%rcx
mov    %rcx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_cmatrix(i8** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i8*, i8** %0, i64 %1
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 %3
%9 = tail call i32 @free(i8* %8)
%10 = bitcast i8** %6 to i8*
%11 = tail call i32 @free(i8* %10)
ret void
}
/* Variables and functions */
float curr_time();
int /*<<< orphan*/ msleep(long);
int /*<<< orphan*/ now();
void wait_till(float t) {
  now();
  msleep((long)((t - curr_time()) * 1000));
}


x86 assembly (clang, -O0):
<wait_till>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <now@plt>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <curr_time@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  0xe97(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1030 <msleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_till>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1050 <now@plt>
xor    %eax,%eax
call   1040 <curr_time@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
mulss  0xea9(%rip),%xmm1
cvttss2si %xmm1,%rdi
pop    %rax
jmp    1030 <msleep@plt>

LLVM IR (-O0):
define void @wait_till(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 (...) @now()
%4 = load float, float* %2
%5 = call float (...) @curr_time()
%6 = fsub float %4, %5
%7 = fmul float %6, 1.000000e+03
%8 = fptosi float %7 to i64
%9 = call i32 @msleep(i64 %8)
ret void
}

LLVM IR (-O2):
define void @wait_till(float %0) {
%2 = tail call i32 (...) @now()
%3 = tail call float (...) @curr_time()
%4 = fsub float %0, %3
%5 = fmul float %4, 1.000000e+03
%6 = fptosi float %5 to i64
%7 = tail call i32 @msleep(i64 %6)
ret void
}
/* Variables and functions */
int strncmp(char const *, char const *, int);
int compare_strings_3(const void *a, const void *b) {
  return strncmp(*(const char **)a, *(const char **)b, 3);
}


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

x86 assembly (clang, -O2):
<compare_strings_3>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
define i32 @compare_strings_3(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strncmp(i8* %7, i8* %10, i32 3)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_strings_3(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strncmp(i8* %4, i8* %6, i32 3)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ print_trace();
int /*<<< orphan*/ printf(char *);
void empty_pop() {
  printf("pop with empty stack\n");
  print_trace();
}


x86 assembly (clang, -O0):
<empty_pop>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <print_trace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_pop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <print_trace@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"pop with empty stack\0A\00"
define void @empty_pop() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @print_trace()
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"pop with empty stack\00"
define void @empty_pop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @print_trace()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *nth_line(char *s, int n) {
  while (s && n--) {
    s = strchr(s, '\n');
    if (s)
      s++;
  }
  return s;
}


x86 assembly (clang, -O0):
<nth_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1143 <nth_line+0x33>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1153 <nth_line+0x43>
jmp    1181 <nth_line+0x71>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     117c <nth_line+0x6c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <nth_line+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_line>:
push   %rbx
test   %rdi,%rdi
je     1141 <nth_line+0x31>
mov    %esi,%ebx
test   %esi,%esi
je     1141 <nth_line+0x31>
add    $0xffffffff,%ebx
nop
mov    $0xa,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
sub    $0x1,%ebx
setb   %cl
test   %rax,%rax
cmove  %rax,%rdi
je     1141 <nth_line+0x31>
test   %cl,%cl
je     1120 <nth_line+0x10>
mov    %rdi,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @nth_line(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %22, %2
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
store i32 %10, i32* %4
%11 = icmp ne i32 %9, 0
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %23
14: ; preds = %12
%15 = load i8*, i8** %3
%16 = call i8* @strchr(i8* %15, i8 signext 10)
store i8* %16, i8** %3
%17 = load i8*, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %22
22: ; preds = %19, %14
br label %5
23: ; preds = %12
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @nth_line(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %1, %2 ]
%8 = phi i8* [ %13, %6 ], [ %0, %2 ]
%9 = add nsw i32 %7, -1
%10 = tail call i8* @strchr(i8* %8, i8 signext 10)
%11 = icmp eq i8* %10, null
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = select i1 %11, i8* null, i8* %12
%14 = icmp eq i32 %9, 0
%15 = select i1 %11, i1 true, i1 %14
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i8* [ %0, %2 ], [ %13, %6 ]
ret i8* %17
}
/* Variables and functions */
int /*<<< orphan*/ LogStackTrace(int, void **, int);
int backtrace(void **, int);
void EmitStackTrace(int signo) {
  void *stack[50];
  int count = backtrace(stack, 50);
  LogStackTrace(signo, stack, count);
}


x86 assembly (clang, -O0):
<EmitStackTrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
mov    $0x32,%esi
call   1030 <backtrace@plt>
mov    %eax,-0x1a4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1a0(%rbp),%rsi
mov    -0x1a4(%rbp),%edx
call   1040 <LogStackTrace@plt>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmitStackTrace>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x32,%esi
call   1030 <backtrace@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <LogStackTrace@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @EmitStackTrace(i32 %0) {
%2 = alloca i32
%3 = alloca [50 x i8*]
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds [50 x i8*], [50 x i8*]* %3, i64 0, i64 0
%6 = call i32 @backtrace(i8** %5, i32 50)
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = getelementptr inbounds [50 x i8*], [50 x i8*]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @LogStackTrace(i32 %7, i8** %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @EmitStackTrace(i32 %0) {
%2 = alloca [50 x i8*]
%3 = bitcast [50 x i8*]* %2 to i8*
%4 = getelementptr inbounds [50 x i8*], [50 x i8*]* %2, i64 0, i64 0
%5 = call i32 @backtrace(i8** %4, i32 50)
%6 = call i32 @LogStackTrace(i32 %0, i8** %4, i32 %5)
ret void
}
void fild_WakeLockInit(void) {}


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

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

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

LLVM IR (-O2):
define void @fild_WakeLockInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_object_node_get_number(void *p, double *number, char **error) {
  mdea_error(error, "Expected number, got object");
  return -1;
}


x86 assembly (clang, -O0):
<mdea_object_node_get_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdea_object_node_get_number>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Expected number, got object\00"
define i32 @mdea_object_node_get_number(i8* %0, double* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca i8**
store i8* %0, i8** %4
store double* %1, double** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [28 x i8] c"Expected number, got object\00"
define i32 @mdea_object_node_get_number(i8* nocapture readnone %0, double* nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int to_pd_revision(int rev) {
  if (rev == 1)
    return 0;
  else if (rev == 2)
    return 1;
  else
    return 3;
}


x86 assembly (clang, -O0):
<to_pd_revision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <to_pd_revision+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113a <to_pd_revision+0x3a>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <to_pd_revision+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <to_pd_revision+0x3a>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_pd_revision>:
xor    %eax,%eax
cmp    $0x2,%edi
setne  %al
lea    (%rax,%rax,1),%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmp    $0x1,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @to_pd_revision(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 1, i32 3
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
double Cudd_Random();
double random_generator() { return ((double)(Cudd_Random() / 2147483561.0)); }


x86 assembly (clang, -O0):
<random_generator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Cudd_Random@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_generator>:
push   %rax
xor    %eax,%eax
call   1030 <Cudd_Random@plt>
divsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_generator() {
%1 = call double (...) @Cudd_Random()
%2 = fdiv double %1, 0x41DFFFFFEA400000
ret double %2
}

LLVM IR (-O2):
define double @random_generator() {
%1 = tail call double (...) @Cudd_Random()
%2 = fdiv double %1, 0x41DFFFFFEA400000
ret double %2
}
pts(s) char *s;
{
  while (*s)
    ptc(*s++);
}


x86 assembly (clang, -O0):
<pts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <pts+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <ptc@plt>
jmp    111c <pts+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pts(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* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @ptc to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}