xunge/DecIR huggingface dataset:
int qsort_cmp_FILE_COUNT_INT(const void *x, const void *y) {
  if (*((int *)x) < *((int *)y))
    return (-1);
  else
    return (*((int *)x) > *((int *)y));
}


x86 assembly (clang, -O0):
<qsort_cmp_FILE_COUNT_INT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    112a <qsort_cmp_FILE_COUNT_INT+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <qsort_cmp_FILE_COUNT_INT+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @qsort_cmp_FILE_COUNT_INT(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
}
unsigned char _ucAsyncGet(void) { return (0); }


x86 assembly (clang, -O0):
<_ucAsyncGet>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @_ucAsyncGet() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @_ucAsyncGet() {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ cpy(float *, void *, int);
float getFloat(void *data) {
  float v;
  cpy(&v, data, sizeof(float));
  return v;
}


x86 assembly (clang, -O0):
<getFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <cpy@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFloat>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <cpy@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @getFloat(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @cpy(float* %3, i8* %4, i32 4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @getFloat(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @cpy(float* %2, i8* %0, i32 4)
%5 = load float, float* %2
ret float %5
}
int initialize_proximity_sensor(struct ssp_data *data) { return 0; }


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

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

LLVM IR (-O0):
%struct.ssp_data = type opaque
define i32 @initialize_proximity_sensor(%struct.ssp_data* %0) {
%2 = alloca %struct.ssp_data*
store %struct.ssp_data* %0, %struct.ssp_data** %2
ret i32 0
}

LLVM IR (-O2):
%struct.ssp_data = type opaque
define i32 @initialize_proximity_sensor(%struct.ssp_data* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
union bpf_attr {
  int map_type;
  int key_size;
  int value_size;
  int max_entries;
};
typedef enum bpf_map_type { ____Placeholder_bpf_map_type } bpf_map_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_CREATE;
int syscall(int, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
                   int max_entries) {
  union bpf_attr attr = {.map_type = map_type,
                         .key_size = key_size,
                         .value_size = value_size,
                         .max_entries = max_entries};
  return syscall(321, BPF_MAP_CREATE, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_create_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    $0x141,%edi
lea    -0x18(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_create_map>:
push   %rax
mov    %ecx,(%rsp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x141,%edi
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@BPF_MAP_CREATE = global i32 0
define i32 @bpf_create_map(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %union.bpf_attr
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = bitcast %union.bpf_attr* %9 to i32*
%11 = load i32, i32* %8
store i32 %11, i32* %10
%12 = load i32, i32* @BPF_MAP_CREATE
%13 = call i32 @syscall(i32 321, i32 %12, %union.bpf_attr* %9, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@BPF_MAP_CREATE = global i32 0
define i32 @bpf_create_map(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %union.bpf_attr
%6 = bitcast %union.bpf_attr* %5 to i8*
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %5, i64 0, i32 0
store i32 %3, i32* %7
%8 = load i32, i32* @BPF_MAP_CREATE
%9 = call i32 @syscall(i32 321, i32 %8, %union.bpf_attr* %5, i32 4)
ret i32 %9
}
void UART_RS485_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_RS485_RestoreConfig() {
ret void
}
int clipNum(int iInput, int iHigh, int iLow) {
  return iInput <= iLow ? iLow : (iInput >= iHigh ? iHigh : iInput);
}


x86 assembly (clang, -O0):
<clipNum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1124 <clipNum+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <clipNum+0x47>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     113b <clipNum+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1141 <clipNum+0x41>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipNum>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
cmp    %edx,%edi
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @clipNum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* %6
br label %22
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %5
br label %20
18: ; preds = %12
%19 = load i32, i32* %4
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i32 [ %11, %10 ], [ %21, %20 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @clipNum(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %2
%5 = icmp slt i32 %0, %1
%6 = select i1 %5, i32 %0, i32 %1
%7 = select i1 %4, i32 %6, i32 %2
ret i32 %7
}
unsigned long mt_abs(long x) {
  if (x < 0)
    return -x;
  return x;
}


x86 assembly (clang, -O0):
<mt_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1122 <mt_abs+0x22>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <mt_abs+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @mt_abs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
int do_634() { return 634; }


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

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

LLVM IR (-O0):
define i32 @do_634() {
ret i32 634
}

LLVM IR (-O2):
define i32 @do_634() {
ret i32 634
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int);
void bar(int x) {
  foo(x, 3);
  foo(x, 4);
}


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

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %edi,%ebx
mov    $0x3,%esi
call   1030 <foo@plt>
mov    %ebx,%edi
mov    $0x4,%esi
pop    %rbx
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @foo(i32 %0, i32 3)
%3 = tail call i32 @foo(i32 %0, i32 4)
ret void
}
int *Bar() { return 0; }


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

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

LLVM IR (-O0):
define i32* @Bar() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @Bar() {
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void i2sStopRecord(void) {
  printf("I2S stop recording\n");
  *((volatile unsigned int *)((0xB0020000 + 0x04))) =
      (*((volatile unsigned int *)((0xB0020000 + 0x04)))) & ~(1 << 6);
}


x86 assembly (clang, -O0):
<i2sStopRecord>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb0020004,%eax
mov    (%rax),%ecx
and    $0xffffffbf,%ecx
mov    $0xb0020004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2sStopRecord>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xb0020004,%eax
andl   $0xffffffbf,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I2S stop recording\0A\00"
define void @i2sStopRecord() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = and i32 %2, -65
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"I2S stop recording\00"
define void @i2sStopRecord() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = and i32 %2, -65
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rotateRight(int, int);
uint32_t BigSigma0(uint32_t x) {
  return rotateRight(x, 2) ^ rotateRight(x, 13) ^ rotateRight(x, 22);
}


x86 assembly (clang, -O0):
<BigSigma0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <rotateRight@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xd,%esi
call   1030 <rotateRight@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x16,%esi
call   1030 <rotateRight@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BigSigma0>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <rotateRight@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xd,%esi
call   1030 <rotateRight@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x16,%esi
call   1030 <rotateRight@plt>
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @BigSigma0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @rotateRight(i32 %3, i32 2)
%5 = load i32, i32* %2
%6 = call i32 @rotateRight(i32 %5, i32 13)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @rotateRight(i32 %8, i32 22)
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @BigSigma0(i32 %0) {
%2 = tail call i32 @rotateRight(i32 %0, i32 2)
%3 = tail call i32 @rotateRight(i32 %0, i32 13)
%4 = xor i32 %3, %2
%5 = tail call i32 @rotateRight(i32 %0, i32 22)
%6 = xor i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f(int);
int main(int argc, char *argv[]) {
  if (f(-2))
    abort();
  exit(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)
mov    $0xfffffffe,%edi
call   1040 <f@plt>
cmp    $0x0,%rax
je     1161 <main+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffe,%edi
call   1040 <f@plt>
test   %rax,%rax
jne    1147 <main+0x17>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
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 i64 @f(i32 -2)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @f(i32 -2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void refcnt_incref_fin(void *pub) {
  fprintf(stderr,
          "Method rtpp_refcnt@%p::incref (refcnt_incref) is invoked after "
          "destruction\x0a",
          pub);
  abort();
}


x86 assembly (clang, -O0):
<refcnt_incref_fin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<refcnt_incref_fin>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::incref (refcnt_incref) is invoked after destruction\0A\00"
define void @refcnt_incref_fin(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* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [76 x i8] c"Method rtpp_refcnt@%p::incref (refcnt_incref) is invoked after destruction\0A\00"
define void @refcnt_incref_fin(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
int tolower(int c) {
  if ((c >= 'A') && (c <= 'Z')) {
    c += 'a' - 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int ei_read_fill_t(int, char *, int, int /*<<< orphan*/);
int ei_read_fill(int fd, char *buf, int len) {
  return ei_read_fill_t(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<ei_read_fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <ei_read_fill_t@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ei_read_fill>:
xor    %ecx,%ecx
jmp    1030 <ei_read_fill_t@plt>

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

LLVM IR (-O2):
define i32 @ei_read_fill(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @ei_read_fill_t(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int my_EPSIO_input();
int lex_EPSIO_input() { return my_EPSIO_input(); }


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

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

LLVM IR (-O0):
define i32 @lex_EPSIO_input() {
%1 = call i32 (...) @my_EPSIO_input()
ret i32 %1
}

LLVM IR (-O2):
define i32 @lex_EPSIO_input() {
%1 = tail call i32 (...) @my_EPSIO_input()
ret i32 %1
}
int InitTimer(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @InitTimer() {
ret i32 0
}

LLVM IR (-O2):
define i32 @InitTimer() {
ret i32 0
}
void NCONF_load(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @__asan_report_load16() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long requestor;
};
struct TYPE_4__ {
  TYPE_1__ xselectionrequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselectionrequest_requestor(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselectionrequest.requestor = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselectionrequest_requestor(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xselectionrequest_requestor(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strerror(int);
void uninivar_strerror(void) {
  int i;
  (void)strerror(i);
}


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

x86 assembly (clang, -O2):
<uninivar_strerror>:
jmp    1030 <strerror@plt>

LLVM IR (-O0):
define void @uninivar_strerror() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @strerror(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninivar_strerror() {
%1 = tail call i32 @strerror(i32 undef)
ret void
}
long double fabsl(long double x) {
  long double res;
  asm("fabs;" : "=t"(res) : "0"(x));
  return res;
}


x86 assembly (clang, -O0):
<fabsl>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fabs
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsl>:
fldt   0x8(%rsp)
fabs
ret

LLVM IR (-O0):
define x86_fp80 @fabsl(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 asm "fabs;", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fabsl(x86_fp80 %0) {
%2 = tail call x86_fp80 asm "fabs;", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ tcp_reset_state();
void iso_reset_state(void) { tcp_reset_state(); }


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

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

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

LLVM IR (-O2):
define void @iso_reset_state() {
%1 = tail call i32 (...) @tcp_reset_state()
ret void
}
double cos(arg)
double arg;
{
  double sinus();
  if (arg < 0)
    arg = -arg;
  return (sinus(arg, 1));
}


x86 assembly (clang, -O0):
<cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114c <cos+0x3c>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <sinus@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos>:
movapd 0xee8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
mov    $0x1,%edi
mov    $0x1,%al
jmp    1030 <sinus@plt>

LLVM IR (-O0):
define double @cos(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
store double %7, double* %2
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call double (double, i32, ...) bitcast (double (...)* @sinus to double (double, i32, ...)*)(double %9, i32 1)
ret double %10
}

LLVM IR (-O2):
define double @cos(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = tail call double (double, i32, ...) bitcast (double (...)* @sinus to double (double, i32, ...)*)(double %4, i32 1)
ret double %5
}
void xfree(p) void *p;
{
  if (p != 0)
    free(p);
  p = 0;
}


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

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

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @free(i8* %0)
br label %4
4: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isrealf(float const);
int iszerod(double);
int flt_eq(const float x, const float y) {
  double delta;
  if (!isrealf(x) || !isrealf(y)) {
    return 0;
  }
  delta = (double)x - (double)y;
  return ((iszerod(delta)));
}


x86 assembly (clang, -O0):
<flt_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <isrealf@plt>
cmp    $0x0,%eax
je     1158 <flt_eq+0x38>
movss  -0xc(%rbp),%xmm0
call   1040 <isrealf@plt>
cmp    $0x0,%eax
jne    1164 <flt_eq+0x44>
movl   $0x0,-0x4(%rbp)
jmp    118c <flt_eq+0x6c>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <iszerod@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_eq>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1040 <isrealf@plt>
test   %eax,%eax
je     1160 <flt_eq+0x40>
movss  (%rsp),%xmm0
call   1040 <isrealf@plt>
test   %eax,%eax
je     1160 <flt_eq+0x40>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
subsd  %xmm1,%xmm0
pop    %rax
jmp    1030 <iszerod@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @flt_eq(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca double
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %4
%8 = call i32 @isrealf(float %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load float, float* %5
%12 = call i32 @isrealf(float %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10, %2
store i32 0, i32* %3
br label %23
15: ; preds = %10
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = fsub double %17, %19
store double %20, double* %6
%21 = load double, double* %6
%22 = call i32 @iszerod(double %21)
store i32 %22, i32* %3
br label %23
23: ; preds = %15, %14
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @flt_eq(float %0, float %1) {
%3 = tail call i32 @isrealf(float %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = tail call i32 @isrealf(float %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %5
%9 = fpext float %0 to double
%10 = fpext float %1 to double
%11 = fsub double %9, %10
%12 = tail call i32 @iszerod(double %11)
br label %13
13: ; preds = %2, %5, %8
%14 = phi i32 [ %12, %8 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ io_hlt();
int /*<<< orphan*/ write_mem8(int, int);
void HariMain(void) {
  int i;
  for (i = 0xa0000; i <= 0xaffff; ++i)
    write_mem8(i, i & 0x0f);
  for (;;)
    io_hlt();
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa0000,-0x4(%rbp)
cmpl   $0xaffff,-0x4(%rbp)
jg     1158 <HariMain+0x38>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
and    $0xf,%esi
call   1040 <write_mem8@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <HariMain+0xf>
jmp    115d <HariMain+0x3d>
mov    $0x0,%al
call   1030 <io_hlt@plt>
jmp    115d <HariMain+0x3d>

x86 assembly (clang, -O2):
<HariMain>:
push   %rbx
mov    $0xa0000,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%esi
and    $0xf,%esi
mov    %ebx,%edi
call   1040 <write_mem8@plt>
add    $0x1,%ebx
cmp    $0xb0000,%ebx
jne    1130 <HariMain+0x10>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <io_hlt@plt>
jmp    1150 <HariMain+0x30>

LLVM IR (-O0):
define void @HariMain() {
%1 = alloca i32
store i32 655360, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp sle i32 %3, 720895
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = and i32 %7, 15
%9 = call i32 @write_mem8(i32 %6, i32 %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
br label %14
14: ; preds = %14, %13
%15 = call i32 (...) @io_hlt()
br label %14
}

LLVM IR (-O2):
define void @HariMain() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 655360, %0 ], [ %5, %1 ]
%3 = and i32 %2, 15
%4 = tail call i32 @write_mem8(i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 720896
br i1 %6, label %7, label %1
7: ; preds = %1, %7
%8 = tail call i32 (...) @io_hlt()
br label %7
}
/* Variables and functions */
int pow(int, double);
float henyey_greenstein_phase_func(float mu) {
  return (1. - (.76) * (.76)) /
         ((4. + 3.14159265359) *
          pow(1. + (.76) * (.76) - 2. * (.76) * mu, 1.5));
}


x86 assembly (clang, -O0):
<henyey_greenstein_phase_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xec6(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xead(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe99(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<henyey_greenstein_phase_func>:
push   %rax
cvtss2sd %xmm0,%xmm0
mulsd  0xee3(%rip),%xmm0
addsd  0xee3(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xedf(%rip),%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed3(%rip),%xmm0
movsd  0xed3(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @henyey_greenstein_phase_func(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double -1.520000e+00, double %4, double 1.577600e+00)
%6 = fptosi double %5 to i32
%7 = call i32 @pow(i32 %6, double 1.500000e+00)
%8 = sitofp i32 %7 to double
%9 = fmul double 0x401C90FDAA221775, %8
%10 = fdiv double 4.224000e-01, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @henyey_greenstein_phase_func(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double -1.520000e+00, double 1.577600e+00)
%4 = fptosi double %3 to i32
%5 = tail call i32 @pow(i32 %4, double 1.500000e+00)
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x401C90FDAA221775
%8 = fdiv double 4.224000e-01, %7
%9 = fptrunc double %8 to float
ret float %9
}
/* Variables and functions */
float powf(float, float);
float cmop_db2lin(float db) { return powf(10.0f, 0.05f * db); }


x86 assembly (clang, -O0):
<cmop_db2lin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xece(%rip),%xmm0
call   1030 <powf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmop_db2lin>:
movaps %xmm0,%xmm1
mulss  0xee5(%rip),%xmm1
movss  0xee1(%rip),%xmm0
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @cmop_db2lin(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x3FA99999A0000000, %3
%5 = call float @powf(float 1.000000e+01, float %4)
ret float %5
}

LLVM IR (-O2):
define float @cmop_db2lin(float %0) {
%2 = fmul float %0, 0x3FA99999A0000000
%3 = tail call float @powf(float 1.000000e+01, float %2)
ret float %3
}
/* Variables and functions */
int bmm050_compensate_Y(short, unsigned short);
signed int bmm050_compensate_Y_s32(signed short mdata_y,
                                   unsigned short data_r) {
  signed int retval = 0;
  retval = bmm050_compensate_Y(mdata_y, data_r);
  if (retval == -32768)
    retval = ((signed int)(-2147483647 - 1));
  return retval;
}


x86 assembly (clang, -O0):
<bmm050_compensate_Y_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <bmm050_compensate_Y@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffff8000,-0x8(%rbp)
jne    1154 <bmm050_compensate_Y_s32+0x44>
movl   $0x80000000,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bmm050_compensate_Y_s32>:
push   %rax
call   1030 <bmm050_compensate_Y@plt>
cmp    $0xffff8000,%eax
mov    $0x80000000,%ecx
cmove  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bmm050_compensate_Y_s32(i16 signext %0, i16 zeroext %1) {
%3 = tail call i32 @bmm050_compensate_Y(i16 signext %0, i16 zeroext %1)
%4 = icmp eq i32 %3, -32768
%5 = select i1 %4, i32 -2147483648, i32 %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *xmalloc(scalar_t__);
char *allocstring(const char *p) {
  char *s;
  s = xmalloc(strlen(p) + 1);
  strcpy(s, p);
  return s;
}


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

x86 assembly (clang, -O2):
<allocstring>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @allocstring(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
int64_t bson_parse_integer_64(const char *cur) {
  int64_t out;
  (memcpy(&out, cur, 8));
  return out;
}


x86 assembly (clang, -O0):
<bson_parse_integer_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_parse_integer_64>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x8,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bson_parse_integer_64(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 8)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bson_parse_integer_64(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 8)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void error(char *msg) {
  perror(msg);
  exit(0);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char buff[256];
  printf("Please enter a string of hexadecimal:");
  scanf("%s", buff);
  printf("Hexadecimal number %s conver to decimal is %d\n", buff, htoi(buff));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x100(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x100(%rbp),%rax
mov    %rax,-0x108(%rbp)
lea    -0x100(%rbp),%rdi
call   1040 <htoi@plt>
mov    -0x108(%rbp),%rsi
mov    %eax,%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <htoi@plt>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Please enter a string of hexadecimal:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [47 x i8] c"Hexadecimal number %s conver to decimal is %d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%7 = call i32 @htoi(i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Please enter a string of hexadecimal:\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [47 x i8] c"Hexadecimal number %s conver to decimal is %d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @htoi(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32 %5)
ret i32 0
}
int checkoption(char option, int source) {
  switch (option) {
  case 'l':
    source = source | (1 << (0));
    break;
  case 'i':
    source = source | (1 << (1));
    break;
  case 'a':
    source = source | (1 << (0)) | (1 << (1)) | (1 << (2));
    break;
  case 'h':
    source = source | (1 << (2));
    break;
  default:
    source = -1;
  }
  return source;
}


x86 assembly (clang, -O0):
<checkoption>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffff9f,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xb,%eax
ja     1175 <checkoption+0x75>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <checkoption+0x7c>
mov    -0x8(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <checkoption+0x7c>
mov    -0x8(%rbp),%eax
or     $0x1,%eax
or     $0x2,%eax
or     $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <checkoption+0x7c>
mov    -0x8(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <checkoption+0x7c>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkoption>:
mov    $0xffffffff,%eax
add    $0xffffff9f,%edi
cmp    $0xb,%edi
ja     1131 <checkoption+0x31>
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
or     $0x7,%esi
jmp    112f <checkoption+0x2f>
or     $0x4,%esi
jmp    112f <checkoption+0x2f>
or     $0x2,%esi
jmp    112f <checkoption+0x2f>
or     $0x1,%esi
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @checkoption(i8 signext %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 = sext i8 %5 to i32
switch i32 %6, label %21 [
i32 108, label %7
i32 105, label %10
i32 97, label %13
i32 104, label %18
]
7: ; preds = %2
%8 = load i32, i32* %4
%9 = or i32 %8, 1
store i32 %9, i32* %4
br label %22
10: ; preds = %2
%11 = load i32, i32* %4
%12 = or i32 %11, 2
store i32 %12, i32* %4
br label %22
13: ; preds = %2
%14 = load i32, i32* %4
%15 = or i32 %14, 1
%16 = or i32 %15, 2
%17 = or i32 %16, 4
store i32 %17, i32* %4
br label %22
18: ; preds = %2
%19 = load i32, i32* %4
%20 = or i32 %19, 4
store i32 %20, i32* %4
br label %22
21: ; preds = %2
store i32 -1, i32* %4
br label %22
22: ; preds = %21, %18, %13, %10, %7
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @checkoption(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %12 [
i32 108, label %4
i32 105, label %6
i32 97, label %8
i32 104, label %10
]
4: ; preds = %2
%5 = or i32 %1, 1
br label %12
6: ; preds = %2
%7 = or i32 %1, 2
br label %12
8: ; preds = %2
%9 = or i32 %1, 7
br label %12
10: ; preds = %2
%11 = or i32 %1, 4
br label %12
12: ; preds = %2, %10, %8, %6, %4
%13 = phi i32 [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ -1, %2 ]
ret i32 %13
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int direxists(const char *dir) {
  struct stat buf;
  return stat(dir, &buf) == 0 && S_ISDIR(buf.st_mode);
}


x86 assembly (clang, -O0):
<direxists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <direxists+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direxists>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <direxists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @direxists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @direxists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int nrerror_return(const char *error_text) {
  fprintf(stderr, "Numerical Recipes run-time error: %s\n", error_text);
  return (-1);
}


x86 assembly (clang, -O0):
<nrerror_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrerror_return>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"Numerical Recipes run-time error: %s\0A\00"
define i32 @nrerror_return(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* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"Numerical Recipes run-time error: %s\0A\00"
define i32 @nrerror_return(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}