xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ Callee(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, j = 0;
  for (i = 0; i < 10000; ++i)
    j += Callee(i);
  printf("%d\n", j);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    116d <main+0x4d>
mov    -0x8(%rbp),%edi
call   1040 <Callee@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1040 <Callee@plt>
add    %eax,%ebx
add    $0x1,%ebp
cmp    $0x2710,%ebp
jne    1130 <main+0x10>
lea    0xeb5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i64 @Callee(i32 %8)
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %9
%13 = trunc i64 %12 to i32
store i32 %13, i32* %3
br label %14
14: ; preds = %7
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %7, %1 ]
%4 = tail call i64 @Callee(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %2, %5
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 10000
br i1 %8, label %9, label %1
9: ; preds = %1
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int i2c_smbus_write_byte(int, int);
int wiringPiI2CWrite(int fd, int data) {
  return i2c_smbus_write_byte(fd, data);
}


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

x86 assembly (clang, -O2):
<wiringPiI2CWrite>:
jmp    1030 <i2c_smbus_write_byte@plt>

LLVM IR (-O0):
define i32 @wiringPiI2CWrite(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 = call i32 @i2c_smbus_write_byte(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @wiringPiI2CWrite(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_write_byte(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ returnSpaces(char *);
void echo(char *message) {
  returnSpaces(message);
  printf("%s\n", message);
}


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

x86 assembly (clang, -O2):
<echo>:
push   %rbx
mov    %rdi,%rbx
call   1040 <returnSpaces@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @echo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @returnSpaces(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @echo(i8* %0) {
%2 = tail call i32 @returnSpaces(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int _use_blas() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_use_blas() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ List(char *);
main() {
  char path[] = "/home/hadoop";
  List(path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x11(%rbp),%rdi
call   1030 <List@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x706f6f6461682f,%rax
mov    %rax,0xd(%rsp)
movabs $0x61682f656d6f682f,%rax
2f 68 61
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <List@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.path = [13 x i8] c"/home/hadoop\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
store i32 0, i32* %1
%3 = bitcast [13 x i8]* %2 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 @List(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.path = [13 x i8] c"/home/hadoop\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = call i32 @List(i8* %2)
ret i32 0
}
int create_hash(char *key) {
  int result = 0;
  int i = 0;
  for (i = 0; key[i] != 0; i = i + 1) {
    result = result + key[i];
  }
  return (result % 100);
}


x86 assembly (clang, -O0):
<create_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1154 <create_hash+0x54>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111d <create_hash+0x1d>
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_hash>:
mov    (%rdi),%al
test   %al,%al
je     113d <create_hash+0x3d>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <create_hash+0x10>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @create_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8 [ %12, %4 ], [ %2, %1 ]
%7 = phi i32 [ %9, %4 ], [ 0, %1 ]
%8 = sext i8 %6 to i32
%9 = add nsw i32 %7, %8
%10 = add nuw nsw i64 %5, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = srem i32 %9, 100
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
struct nouveau_pushbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ PUSH_DATA(struct nouveau_pushbuf *, int);
int /*<<< orphan*/ PUSH_SPACE(struct nouveau_pushbuf *, int);
void BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, int size) {
  PUSH_SPACE(push, size + 1);
  PUSH_DATA(push, 0x40000000 | (size << 18) | (subc << 13) | mthd);
}


x86 assembly (clang, -O0):
<BEGIN_NI04>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
call   1040 <PUSH_SPACE@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
shl    $0x12,%esi
or     $0x40000000,%esi
mov    -0xc(%rbp),%eax
shl    $0xd,%eax
or     %eax,%esi
or     -0x10(%rbp),%esi
call   1030 <PUSH_DATA@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEGIN_NI04>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
lea    0x1(%rbx),%esi
call   1040 <PUSH_SPACE@plt>
shl    $0x12,%ebx
shl    $0xd,%ebp
or     %r14d,%ebp
or     %ebx,%ebp
or     $0x40000000,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <PUSH_DATA@plt>

LLVM IR (-O0):
%struct.nouveau_pushbuf = type { i32 }
define void @BEGIN_NI04(%struct.nouveau_pushbuf* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.nouveau_pushbuf*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.nouveau_pushbuf* %0, %struct.nouveau_pushbuf** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.nouveau_pushbuf*, %struct.nouveau_pushbuf** %5
%10 = load i32, i32* %8
%11 = add nsw i32 %10, 1
%12 = call i32 @PUSH_SPACE(%struct.nouveau_pushbuf* %9, i32 %11)
%13 = load %struct.nouveau_pushbuf*, %struct.nouveau_pushbuf** %5
%14 = load i32, i32* %8
%15 = shl i32 %14, 18
%16 = or i32 1073741824, %15
%17 = load i32, i32* %6
%18 = shl i32 %17, 13
%19 = or i32 %16, %18
%20 = load i32, i32* %7
%21 = or i32 %19, %20
%22 = call i32 @PUSH_DATA(%struct.nouveau_pushbuf* %13, i32 %21)
ret void
}

LLVM IR (-O2):
%struct.nouveau_pushbuf = type { i32 }
define void @BEGIN_NI04(%struct.nouveau_pushbuf* %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %3, 1
%6 = tail call i32 @PUSH_SPACE(%struct.nouveau_pushbuf* %0, i32 %5)
%7 = shl i32 %3, 18
%8 = shl i32 %1, 13
%9 = or i32 %8, %2
%10 = or i32 %9, %7
%11 = or i32 %10, 1073741824
%12 = tail call i32 @PUSH_DATA(%struct.nouveau_pushbuf* %0, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DymosimError(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
void AssertModelicaF(int b, const char *bs, const char *x) {
  if (!b) {
    char buf[1000];
    sprintf(buf, "  %.400s\n  Failed condition: %.400s\n", x, bs);
    DymosimError(buf);
  }
}


x86 assembly (clang, -O0):
<AssertModelicaF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1167 <AssertModelicaF+0x47>
lea    -0x400(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeaa(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <DymosimError@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssertModelicaF>:
test   %edi,%edi
je     1125 <AssertModelicaF+0x5>
ret
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rcx
lea    0xec9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimError@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c" %.400s\0A Failed condition: %.400s\0A\00"
define void @AssertModelicaF(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1000 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %17, label %10
10: ; preds = %3
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %6
%13 = load i8*, i8** %5
%14 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%16 = call i32 @DymosimError(i8* %15)
br label %17
17: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c" %.400s\0A Failed condition: %.400s\0A\00"
define void @AssertModelicaF(i32 %0, i8* %1, i8* %2) {
%4 = alloca [1000 x i8]
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %1)
%9 = call i32 @DymosimError(i8* %7)
br label %10
10: ; preds = %6, %3
ret void
}
/* Variables and functions */
int CompareStringsGivenPointers(char const **, char const **);
int ReverseCompareStringsGivenPointers(const char **ptrs1, const char **ptrs2) {
  return -CompareStringsGivenPointers(ptrs1, ptrs2);
}


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

x86 assembly (clang, -O2):
<ReverseCompareStringsGivenPointers>:
push   %rax
call   1030 <CompareStringsGivenPointers@plt>
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ReverseCompareStringsGivenPointers(i8** %0, i8** %1) {
%3 = tail call i32 @CompareStringsGivenPointers(i8** %0, i8** %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
void *malloc(int);
int32_t cons(int32_t a, int32_t d) {
  void *v = malloc(2 * sizeof(int32_t));
  int32_t *p = (int32_t *)v;
  p[0] = a;
  p[1] = d;
  return (int32_t)p + 1;
}


x86 assembly (clang, -O0):
<cons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cons>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rbx,(%rax)
mov    %r14,0x8(%rax)
add    $0x1,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @cons(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = call i8* @malloc(i32 16)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i64*
store i64* %9, i64** %6
%10 = load i64, i64* %3
%11 = load i64*, i64** %6
%12 = getelementptr inbounds i64, i64* %11, i64 0
store i64 %10, i64* %12
%13 = load i64, i64* %4
%14 = load i64*, i64** %6
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %13, i64* %15
%16 = load i64*, i64** %6
%17 = ptrtoint i64* %16 to i64
%18 = add nsw i64 %17, 1
ret i64 %18
}

LLVM IR (-O2):
define i64 @cons(i64 %0, i64 %1) {
%3 = tail call dereferenceable_or_null(16) i8* @malloc(i32 16)
%4 = bitcast i8* %3 to i64*
store i64 %0, i64* %4
%5 = getelementptr inbounds i64, i64* %4, i64 1
store i64 %1, i64* %5
%6 = ptrtoint i8* %3 to i64
%7 = add nsw i64 %6, 1
ret i64 %7
}
/* Variables and functions */
int spi_send_command(int, char *);
int nrf_flush_tx(char *retstatus) { return spi_send_command(0xE1, retstatus); }


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

x86 assembly (clang, -O2):
<nrf_flush_tx>:
mov    %rdi,%rsi
mov    $0xe1,%edi
jmp    1030 <spi_send_command@plt>

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

LLVM IR (-O2):
define i32 @nrf_flush_tx(i8* %0) {
%2 = tail call i32 @spi_send_command(i32 225, i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double r, raio, esfera;
  scanf("%lf", &raio);
  esfera = ((4 / 3.0) * 3.14159 * (raio * raio * raio));
  printf("VOLUME = %.3lf\n", esfera);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
movsd  0xeaa(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xeb7(%rip),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %4, %5
%7 = fmul double %6, 0x4010C1514ABD0449
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %7)
ret i32 0
}
int upload_hash(unsigned char *h) { return (int)*h; }


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

x86 assembly (clang, -O2):
<upload_hash>:
movzbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @upload_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @upload_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int toint(char);
int credential_series(char fascn[40]) {
  int temp;
  temp = toint(fascn[18]);
  return (temp);
}


x86 assembly (clang, -O0):
<credential_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x12(%rax),%edi
call   1030 <toint@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<credential_series>:
movsbl 0x12(%rdi),%edi
jmp    1030 <toint@plt>

LLVM IR (-O0):
define i32 @credential_series(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 18
%6 = load i8, i8* %5
%7 = call i32 @toint(i8 signext %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @credential_series(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 18
%3 = load i8, i8* %2
%4 = tail call i32 @toint(i8 signext %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ crc16(int /*<<< orphan*/ const *, size_t, int, int);
uint16_t crc16_ccitt(const uint8_t *src, size_t len) {
  return crc16(src, len, 0x1021, 0xffff);
}


x86 assembly (clang, -O0):
<crc16_ccitt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1021,%edx
mov    $0xffff,%ecx
call   1030 <crc16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16_ccitt>:
mov    $0x1021,%edx
mov    $0xffff,%ecx
jmp    1030 <crc16@plt>

LLVM IR (-O0):
define i32 @crc16_ccitt(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @crc16(i32* %5, i64 %6, i32 4129, i32 65535)
ret i32 %7
}

LLVM IR (-O2):
define i32 @crc16_ccitt(i32* %0, i64 %1) {
%3 = tail call i32 @crc16(i32* %0, i64 %1, i32 4129, i32 65535)
ret i32 %3
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] & 914778474UL) << 7UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] &= state[local1];
      local1++;
    }
    output[0UL] = state[0UL] & 116737752064UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
and    $0x3686696a,%rax
shl    $0x7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1156 <RandomFunc+0x56>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1129 <RandomFunc+0x29>
movabs $0x1b2e1cbc00,%rcx
and    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
and    $0x36042968,%eax
shl    $0x7,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = and i64 %9, 914778474
%11 = shl i64 %10, 7
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %25
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = and i64 %21, %19
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 1
store i64 %24, i64* %6
br label %13
25: ; preds = %13
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = and i64 %27, 116737752064
%29 = load i64*, i64** %4
%30 = getelementptr inbounds i64, i64* %29, i64 0
store i64 %28, i64* %30
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 7
%5 = and i64 %4, 115999028224
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_PHONE(int /*<<< orphan*/);
int gen_PHONE() {
  handle_PHONE(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_PHONE>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_PHONE@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_PHONE>:
push   %rax
xor    %edi,%edi
call   1030 <handle_PHONE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gen_PHONE() {
%1 = call i32 @handle_PHONE(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_PHONE() {
%1 = tail call i32 @handle_PHONE(i32 0)
ret i32 0
}
/* Variables and functions */
void *fopen(char *, char *);
void *opendir(char *name) { return fopen(name, "r"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define noalias i8* @opendir(i8* nocapture %0) {
%2 = tail call i8* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
double pnorm(double);
double sqrt(double);
double pbinom(int q, int n, double p) {
  double t = ((double)q - (double)n * p) / sqrt((double)n * p * (1 - p));
  return pnorm(t);
}


x86 assembly (clang, -O0):
<pbinom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe88(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <pnorm@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbinom>:
push   %rax
movapd %xmm0,%xmm1
cvtsi2sd %edi,%xmm3
cvtsi2sd %esi,%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm3
movsd  0xec3(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1155 <pbinom+0x35>
sqrtsd %xmm0,%xmm0
jmp    1164 <pbinom+0x44>
movsd  %xmm3,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm3
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
pop    %rax
jmp    1030 <pnorm@plt>

LLVM IR (-O0):
define double @pbinom(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to double
%12 = load double, double* %6
%13 = fneg double %11
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double %9)
%15 = load i32, i32* %5
%16 = sitofp i32 %15 to double
%17 = load double, double* %6
%18 = fmul double %16, %17
%19 = load double, double* %6
%20 = fsub double 1.000000e+00, %19
%21 = fmul double %18, %20
%22 = call double @sqrt(double %21)
%23 = fdiv double %14, %22
store double %23, double* %7
%24 = load double, double* %7
%25 = call double @pnorm(double %24)
ret double %25
}

LLVM IR (-O2):
define double @pbinom(i32 %0, i32 %1, double %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fneg double %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %2, double %4)
%8 = fmul double %5, %2
%9 = fsub double 1.000000e+00, %2
%10 = fmul double %8, %9
%11 = tail call double @sqrt(double %10)
%12 = fdiv double %7, %11
%13 = tail call double @pnorm(double %12)
ret double %13
}
/* Type definitions */
struct timeval {
  long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
void print_time(struct timeval start, struct timeval finish) {
  long t = finish.tv_sec - start.tv_sec;
  t *= 1000 * 1000;
  t += finish.tv_usec - start.tv_usec;
  printf("%ld us\n", t);
}


x86 assembly (clang, -O0):
<print_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
imul   $0xf4240,-0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x8(%rbp),%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_time>:
sub    %rdi,%rdx
imul   $0xf4240,%rdx,%rax
sub    %rsi,%rcx
add    %rcx,%rax
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [8 x i8] c"%ld us\0A\00"
define void @print_time(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca i64
%8 = bitcast %struct.timeval* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timeval* %6 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%17 = load i64, i64* %16
%18 = sub nsw i64 %15, %17
store i64 %18, i64* %7
%19 = load i64, i64* %7
%20 = mul nsw i64 %19, 1000000
store i64 %20, i64* %7
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%22 = load i64, i64* %21
%23 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%24 = load i64, i64* %23
%25 = sub nsw i64 %22, %24
%26 = load i64, i64* %7
%27 = add nsw i64 %26, %25
store i64 %27, i64* %7
%28 = load i64, i64* %7
%29 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %28)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%ld us\0A\00"
define void @print_time(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %2, %0
%6 = mul nsw i64 %5, 1000000
%7 = sub i64 %3, %1
%8 = add nsw i64 %7, %6
%9 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 %8)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp(const void *a, const void *b) {
  return (strcmp(*(char **)a, *(char **)b));
}


x86 assembly (clang, -O0):
<cmp>:
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
call   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmp(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 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
double m_max_d(double left, double right) {
  return (left > right) ? left : right;
}


x86 assembly (clang, -O0):
<m_max_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <m_max_d+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <m_max_d+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_max_d>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @m_max_d(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @m_max_d(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void char_switch(char *first, char *second) {
  char tmp = *first;
  *first = *second;
  *second = tmp;
}


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

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

LLVM IR (-O0):
define void @char_switch(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @char_switch(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello World, test addSysIncludePath!\n"); }


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [38 x i8] c"Hello World, test addSysIncludePath!\0A\00"
define void @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [37 x i8] c"Hello World, test addSysIncludePath!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ start_color();
void initWindow() {
  initscr();
  start_color();
}


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

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

LLVM IR (-O0):
define void @initWindow() {
%1 = call i32 (...) @initscr()
%2 = call i32 (...) @start_color()
ret void
}

LLVM IR (-O2):
define void @initWindow() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @start_color()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int rc) {
  printf(
      "usage: tone [-?hsqrwe] [-m magnitude] [-f sample-freq] [wave-freq]\n\n"
      "\t-h?\tthis help\n"
      "\t-s\tsine wave output\n"
      "\t-q\tsquare wave output\n"
      "\t-r\tramp wave output\n"
      "\t-w\tsawtooth wave output\n"
      "\t-e\toutput big-endian data\n"
      "\t-m\tmagnitude of wave (0 <= x <= 256)\n"
      "\t-f\tsampling frequency\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [262 x i8] c"usage: tone [-?hsqrwe] [-m magnitude] [-f sample-freq] [wave-freq]\0A\0A\09-h?\09this help\0A\09-s\09sine wave output\0A\09-q\09square wave output\0A\09-r\09ramp wave output\0A\09-w\09sawtooth wave output\0A\09-e\09output big-endian data\0A\09-m\09magnitude of wave (0 <= x <= 256)\0A\09-f\09sampling frequency\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [261 x i8] c"usage: tone [-?hsqrwe] [-m magnitude] [-f sample-freq] [wave-freq]\0A\0A\09-h?\09this help\0A\09-s\09sine wave output\0A\09-q\09square wave output\0A\09-r\09ramp wave output\0A\09-w\09sawtooth wave output\0A\09-e\09output big-endian data\0A\09-m\09magnitude of wave (0 <= x <= 256)\0A\09-f\09sampling frequency\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([261 x i8], [261 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct in_addr {
  int dummy;
};

/* Variables and functions */
int memcmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int addr_cmp(struct sockaddr_in *in1, struct sockaddr_in *in2) {
  return memcmp(&in1->sin_addr, &in2->sin_addr, sizeof(struct in_addr));
}


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

x86 assembly (clang, -O2):
<addr_cmp>:
mov    $0x4,%edx
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
define i32 @addr_cmp(%struct.sockaddr_in* %0, %struct.sockaddr_in* %1) {
%3 = alloca %struct.sockaddr_in*
%4 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
%5 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%6 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i32 0, i32 0
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 0
%9 = call i32 @memcmp(i32* %6, i32* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
define i32 @addr_cmp(%struct.sockaddr_in* %0, %struct.sockaddr_in* %1) {
%3 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
%4 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 0
%5 = tail call i32 @memcmp(i32* %3, i32* %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i;
  char **ptr;
  extern char **environ;
  for (ptr = environ; *ptr != 0; ptr++)
    printf("%s\n", *ptr);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpq   $0x0,(%rax)
je     1176 <main+0x56>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1144 <main+0x24>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ebd(%rip),%rax
mov    (%rax),%rbx
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1164 <main+0x44>
add    $0x8,%rbx
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1150 <main+0x30>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@environ = external global i8**
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** @environ
store i8** %8, i8*** %7
br label %9
9: ; preds = %17, %2
%10 = load i8**, i8*** %7
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i8**, i8*** %7
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %13
%18 = load i8**, i8*** %7
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %7
br label %9
20: ; preds = %9
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@environ = external global i8**
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i8**, i8*** @environ
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %4, %2 ]
%8 = phi i8** [ %10, %6 ], [ %3, %2 ]
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int tprot(unsigned long);
int page_is_valid(unsigned long addr) {
  int rc;
  rc = tprot(addr);
  return (rc == 0) || (rc == 1);
}


x86 assembly (clang, -O0):
<page_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <tprot@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
je     1141 <page_is_valid+0x31>
cmpl   $0x1,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<page_is_valid>:
push   %rax
call   1030 <tprot@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @page_is_valid(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 @tprot(i64 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br label %11
11: ; preds = %8, %1
%12 = phi i1 [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @page_is_valid(i64 %0) {
%2 = tail call i32 @tprot(i64 %0)
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};
struct katcp_arb {
  int dummy;
};

/* Variables and functions */
struct katcp_arb *find_type_arb_katcp(struct katcp_dispatch *, char *,
                                      int /*<<< orphan*/);
struct katcp_arb *find_arb_katcp(struct katcp_dispatch *d, char *name) {
  return find_type_arb_katcp(d, name, 0);
}


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

x86 assembly (clang, -O2):
<find_arb_katcp>:
xor    %edx,%edx
jmp    1030 <find_type_arb_katcp@plt>

LLVM IR (-O0):
%struct.katcp_arb = type { i32 }
%struct.katcp_dispatch = type { i32 }
define %struct.katcp_arb* @find_arb_katcp(%struct.katcp_dispatch* %0, i8* %1) {
%3 = alloca %struct.katcp_dispatch*
%4 = alloca i8*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %3
store i8* %1, i8** %4
%5 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %3
%6 = load i8*, i8** %4
%7 = call %struct.katcp_arb* @find_type_arb_katcp(%struct.katcp_dispatch* %5, i8* %6, i32 0)
ret %struct.katcp_arb* %7
}

LLVM IR (-O2):
%struct.katcp_arb = type { i32 }
%struct.katcp_dispatch = type { i32 }
define %struct.katcp_arb* @find_arb_katcp(%struct.katcp_dispatch* %0, i8* %1) {
%3 = tail call %struct.katcp_arb* @find_type_arb_katcp(%struct.katcp_dispatch* %0, i8* %1, i32 0)
ret %struct.katcp_arb* %3
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int);
int /*<<< orphan*/ pgp_show_stacktrace();
int /*<<< orphan*/ stderr;
void __pgp_switch_default(const char *_function_name, const char *_file_name,
                          int _line_number) {
  fprintf(stderr,
          "switch-case default occurred: file=%s, function=%s, line=%d\n",
          _file_name, _function_name, _line_number);
  pgp_show_stacktrace();
  exit(EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pgp_switch_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x14(%rbp),%r8d
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <pgp_show_stacktrace@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<__pgp_switch_default>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rdx
mov    %rdi,%rcx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <pgp_show_stacktrace@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"switch-case default occurred: file=%s, function=%s, line=%d\0A\00"
@EX_SOFTWARE = global i32 0
define void @__pgp_switch_default(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i32 %10)
%12 = call i32 (...) @pgp_show_stacktrace()
%13 = load i32, i32* @EX_SOFTWARE
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"switch-case default occurred: file=%s, function=%s, line=%d\0A\00"
@EX_SOFTWARE = global i32 0
define void @__pgp_switch_default(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0, i32 %2)
%6 = tail call i32 (...) @pgp_show_stacktrace()
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @exit(i32 %7)
unreachable
}