xunge/DecIR huggingface dataset:
int fun_0(int i, int *a) { return a[0] + a[100] + a[1]; }


x86 assembly (clang, -O0):
<fun_0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    0x190(%rcx),%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_0>:
mov    0x190(%rsi),%eax
add    (%rsi),%eax
add    0x4(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @fun_0(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 100
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fun_0(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 100
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
int ExisteElem(int table[], int size, int element) {
  int i;
  if (size == 0)
    return 0;
  else {
    for (i = 0; i < size; i++) {
      if (table[i] == element)
        return 1;
    }
    return 0;
  }
}


x86 assembly (clang, -O0):
<ExisteElem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1124 <ExisteElem+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1171 <ExisteElem+0x71>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116a <ExisteElem+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1157 <ExisteElem+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1171 <ExisteElem+0x71>
jmp    115c <ExisteElem+0x5c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112b <ExisteElem+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExisteElem>:
test   %esi,%esi
jle    111e <ExisteElem+0x1e>
mov    %esi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rdi,%rcx,4)
je     1121 <ExisteElem+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <ExisteElem+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ExisteElem(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 1, %9 ], [ 0, %7 ]
ret i32 %16
}
/* Variables and functions */
int checknullstring(char *buf, size_t maxlen) {
  size_t i;
  for (i = 0; i < maxlen; i++) {
    if (buf[i] == 0) {
      return 0;
    }
  }
  buf[maxlen - 1] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<checknullstring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1159 <checknullstring+0x59>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1143 <checknullstring+0x43>
movl   $0x0,-0x4(%rbp)
jmp    1170 <checknullstring+0x70>
jmp    1148 <checknullstring+0x48>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <checknullstring+0x14>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checknullstring>:
test   %rsi,%rsi
je     111f <checknullstring+0x1f>
xor    %eax,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rcx,1)
je     1129 <checknullstring+0x29>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <checknullstring+0x10>
movb   $0x0,-0x1(%rsi,%rdi,1)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @checknullstring(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %6
4: ; preds = %6
%5 = icmp eq i64 %11, %1
br i1 %5, label %12, label %6
6: ; preds = %2, %4
%7 = phi i64 [ %11, %4 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = add nuw i64 %7, 1
br i1 %10, label %15, label %4
12: ; preds = %4, %2
%13 = add i64 %1, -1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
br label %15
15: ; preds = %6, %12
%16 = phi i32 [ 1, %12 ], [ 0, %6 ]
ret i32 %16
}
char const *const MOCKNAME() { return "MOCKNAME:MOCKREVNO"; }


x86 assembly (clang, -O0):
<MOCKNAME>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOCKNAME>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [19 x i8] c"MOCKNAME:MOCKREVNO\00"
define i8* @MOCKNAME() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"MOCKNAME:MOCKREVNO\00"
define i8* @MOCKNAME() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
unsigned short int foo(int a, int b) {
  unsigned short int res;
  a &= 0xffff;
  b &= 0xffff;
  if (__builtin_mul_overflow(a, b, &res))
    res = 0x123;
  return res;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edx
imul   -0x8(%rbp),%edx
seto   %al
mov    %dx,%cx
movzwl %cx,%esi
cmp    %esi,%edx
setne  %dl
or     %dl,%al
mov    %cx,-0xa(%rbp)
test   $0x1,%al
jne    1148 <foo+0x48>
jmp    114e <foo+0x4e>
movw   $0x123,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movzwl %di,%ecx
movzwl %si,%edx
mov    %ecx,%eax
imul   %edx,%eax
cmp    $0x10000,%eax
mov    $0x123,%esi
cmovae %esi,%eax
imul   %edx,%ecx
cmovo  %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = and i32 %6, 65535
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = and i32 %8, 65535
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %10, i32 %11)
%13 = extractvalue { i32, i1 } %12, 1
%14 = extractvalue { i32, i1 } %12, 0
%15 = trunc i32 %14 to i16
%16 = zext i16 %15 to i32
%17 = icmp ne i32 %14, %16
%18 = or i1 %13, %17
store i16 %15, i16* %5
br i1 %18, label %19, label %20
19: ; preds = %2
store i16 291, i16* %5
br label %20
20: ; preds = %19, %2
%21 = load i16, i16* %5
ret i16 %21
}

LLVM IR (-O2):
define zeroext i16 @foo(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = tail call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %3, i32 %4)
%6 = extractvalue { i32, i1 } %5, 1
%7 = extractvalue { i32, i1 } %5, 0
%8 = trunc i32 %7 to i16
%9 = icmp ugt i32 %7, 65535
%10 = or i1 %6, %9
%11 = select i1 %10, i16 291, i16 %8
ret i16 %11
}
/* Type definitions */
struct rlimit {
  scalar_t__ rlim_max;
};

/* Variables and functions */
scalar_t__ INT_MAX;
int /*<<< orphan*/ RLIMIT_NOFILE;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int getdtablesize(void) {
  struct rlimit rl;
  getrlimit(RLIMIT_NOFILE, &rl);
  return rl.rlim_max < INT_MAX ? rl.rlim_max : INT_MAX;
}


x86 assembly (clang, -O0):
<getdtablesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <getrlimit@plt>
mov    -0x8(%rbp),%rax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%rax
jge    114b <getdtablesize+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1159 <getdtablesize+0x49>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdtablesize>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <getrlimit@plt>
mov    (%rsp),%rcx
mov    0x2ebb(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rcx
cmovl  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rlimit = type { i64 }
@RLIMIT_NOFILE = global i32 0
@INT_MAX = global i64 0
define i32 @getdtablesize() {
%1 = alloca %struct.rlimit
%2 = load i32, i32* @RLIMIT_NOFILE
%3 = call i32 @getrlimit(i32 %2, %struct.rlimit* %1)
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @INT_MAX
%7 = icmp slt i64 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i32 0, i32 0
%10 = load i64, i64* %9
br label %13
11: ; preds = %0
%12 = load i64, i64* @INT_MAX
br label %13
13: ; preds = %11, %8
%14 = phi i64 [ %10, %8 ], [ %12, %11 ]
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
%struct.rlimit = type { i64 }
@RLIMIT_NOFILE = global i32 0
@INT_MAX = global i64 0
define i32 @getdtablesize() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_NOFILE
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @INT_MAX
%8 = icmp slt i64 %6, %7
%9 = select i1 %8, i64 %6, i64 %7
%10 = trunc i64 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ReadBE32(const unsigned char *ptr) {
  return ((uint32_t)ptr[0] << 24 | (uint32_t)ptr[1] << 16 |
          (uint32_t)ptr[2] << 8 | (uint32_t)ptr[3]);
}


x86 assembly (clang, -O0):
<ReadBE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadBE32>:
mov    (%rdi),%eax
bswap  %eax
ret

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

LLVM IR (-O2):
define i32 @ReadBE32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void __DELETE_java_io_ObjectStreamField(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_io_ObjectStreamField(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void d2i_ASN1_GENERALSTRING(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_GENERALSTRING() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ access_index_1(int *);
void call_access_index_1_on_local_array_Good() {
  int arr[4];
  access_index_1(arr);
}


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

x86 assembly (clang, -O2):
<call_access_index_1_on_local_array_Good>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <access_index_1@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @call_access_index_1_on_local_array_Good() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @access_index_1(i32* %2)
ret void
}

LLVM IR (-O2):
define void @call_access_index_1_on_local_array_Good() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @access_index_1(i32* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t bnep_event_channel_opened_get_destination_uuid(const uint8_t *event) {
  return little_endian_read_16(event, 7);
}


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

x86 assembly (clang, -O2):
<bnep_event_channel_opened_get_destination_uuid>:
mov    $0x7,%esi
jmp    1030 <little_endian_read_16@plt>

LLVM IR (-O0):
define i32 @bnep_event_channel_opened_get_destination_uuid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @little_endian_read_16(i32* %3, i32 7)
ret i32 %4
}

LLVM IR (-O2):
define i32 @bnep_event_channel_opened_get_destination_uuid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 7)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
chk(int a, int b) {
  if (a != 3 || b != 5)
    abort();
}


x86 assembly (clang, -O0):
<chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1132 <chk+0x22>
cmpl   $0x5,-0xc(%rbp)
je     1139 <chk+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk>:
cmp    $0x3,%edi
jne    111b <chk+0xb>
cmp    $0x5,%esi
jne    111b <chk+0xb>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @chk(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 3
%4 = icmp ne i32 %1, 5
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret i32 undef
}
int is_num(c)
char c;
{ return ((c >= '0' && c <= '9') || c == '+' || c == '-'); }


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_num+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    1148 <is_num+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     1148 <is_num+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
shl    $0x18,%edi
lea    -0x2f000001(%rdi),%eax
cmp    $0xaffffff,%eax
setb   %al
cmp    $0x2b000000,%edi
sete   %cl
cmp    $0x2d000000,%edi
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @is_num(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 43
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br label %19
19: ; preds = %15, %11, %7
%20 = phi i1 [ true, %11 ], [ true, %7 ], [ %18, %15 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @is_num(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -788529153
%4 = icmp ult i32 %3, 184549375
%5 = icmp eq i32 %2, 721420288
%6 = or i1 %5, %4
%7 = icmp eq i32 %2, 754974720
%8 = or i1 %7, %6
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int /*<<< orphan*/ tolower(int);
main() {
  int c;
  while ((c = getchar()) != EOF)
    putchar(tolower(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     116c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1050 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @tolower(i32 %8)
%10 = call i32 @putchar(i32 %9)
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @tolower(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int Crispy_Random();
int Crispy_SubRandom(void) {
  int r = Crispy_Random();
  return r - Crispy_Random();
}


x86 assembly (clang, -O0):
<Crispy_SubRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Crispy_Random@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Crispy_Random@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Crispy_SubRandom>:
push   %rbx
xor    %eax,%eax
call   1030 <Crispy_Random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Crispy_Random@plt>
sub    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Crispy_SubRandom() {
%1 = alloca i32
%2 = call i32 (...) @Crispy_Random()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (...) @Crispy_Random()
%5 = sub nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @Crispy_SubRandom() {
%1 = tail call i32 (...) @Crispy_Random()
%2 = tail call i32 (...) @Crispy_Random()
%3 = sub nsw i32 %1, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ set_rounding(int /*<<< orphan*/ const *);
void div_d(const uint32_t *fcr31, const double *source1, const double *source2,
           double *target) {
  set_rounding(fcr31);
  *target = *source1 / *source2;
}


x86 assembly (clang, -O0):
<div_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <set_rounding@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
divsd  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<div_d>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
call   1030 <set_rounding@plt>
movsd  (%rbx),%xmm0
divsd  (%r15),%xmm0
movsd  %xmm0,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @div_d(i32* %0, double* %1, double* %2, double* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
store i32* %0, i32** %5
store double* %1, double** %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load i32*, i32** %5
%10 = call i32 @set_rounding(i32* %9)
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = load double*, double** %7
%14 = load double, double* %13
%15 = fdiv double %12, %14
%16 = load double*, double** %8
store double %15, double* %16
ret void
}

LLVM IR (-O2):
define void @div_d(i32* %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3) {
%5 = tail call i32 @set_rounding(i32* %0)
%6 = load double, double* %1
%7 = load double, double* %2
%8 = fdiv double %6, %7
store double %8, double* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      " usage: kdd [-v] <domid> <address> <port>\n"
      " \n"
      " Makes a TCP connection to <address>:<port> and speaks the kd serial\n"
      " protocol over it, to debug Xen domain <domid>.\n"
      " To connect a debugger, set up a Windows VM with it serial port "
      "confgured\n"
      " as \"serial='tcp:<address>:<port>,server,nodelay,nowait'\".  Run\n"
      " windbg or kd in that VM, connecting to COM1; then run kdd.\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [361 x i8] c" usage: kdd [-v] <domid> <address> <port>\0A \0A Makes a TCP connection to <address>:<port> and speaks the kd serial\0A protocol over it, to debug Xen domain <domid>.\0A To connect a debugger, set up a Windows VM with it serial port confgured\0A as \22serial='tcp:<address>:<port>,server,nodelay,nowait'\22. Run\0A windbg or kd in that VM, connecting to COM1; then run kdd.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [361 x i8] c" usage: kdd [-v] <domid> <address> <port>\0A \0A Makes a TCP connection to <address>:<port> and speaks the kd serial\0A protocol over it, to debug Xen domain <domid>.\0A To connect a debugger, set up a Windows VM with it serial port confgured\0A as \22serial='tcp:<address>:<port>,server,nodelay,nowait'\22. Run\0A windbg or kd in that VM, connecting to COM1; then run kdd.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([361 x i8], [361 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ doubles_angleaxis_to_quat(double const *, double *);
int /*<<< orphan*/ doubles_quat_to_mat44(double *, double *);
void doubles_angleaxis_to_mat44(const double aa[4], double r[16]) {
  double q[4];
  doubles_angleaxis_to_quat(aa, q);
  doubles_quat_to_mat44(q, r);
}


x86 assembly (clang, -O0):
<doubles_angleaxis_to_mat44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <doubles_angleaxis_to_quat@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <doubles_quat_to_mat44@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubles_angleaxis_to_mat44>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1040 <doubles_angleaxis_to_quat@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <doubles_quat_to_mat44@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @doubles_angleaxis_to_mat44(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [4 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%8 = call i32 @doubles_angleaxis_to_quat(double* %6, double* %7)
%9 = getelementptr inbounds [4 x double], [4 x double]* %5, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @doubles_quat_to_mat44(double* %9, double* %10)
ret void
}

LLVM IR (-O2):
define void @doubles_angleaxis_to_mat44(double* %0, double* %1) {
%3 = alloca [4 x double]
%4 = bitcast [4 x double]* %3 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%6 = call i32 @doubles_angleaxis_to_quat(double* %0, double* %5)
%7 = call i32 @doubles_quat_to_mat44(double* %5, double* %1)
ret void
}
/* Variables and functions */
float powf(float, float);
float Lab(float val) {
  static const float threshold =
      ((6.f) * (((6.f)) * ((6.f)))) / ((29.f) * (((29.f)) * ((29.f))));
  if (val > threshold) {
    val = powf(val, 1.f / 3.f);
  } else {
    val = 4.f / 29.f + ((29.f) * (29.f)) / (3.f * ((6.f) * (6.f))) * val;
  }
  return val;
}


x86 assembly (clang, -O0):
<Lab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114f <Lab+0x3f>
movss  -0x4(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
call   1030 <powf@plt>
movss  %xmm0,-0x4(%rbp)
jmp    1171 <Lab+0x61>
movss  -0x4(%rbp),%xmm0
movss  0xea8(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea0(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lab>:
ucomiss 0xee9(%rip),%xmm0
jbe    1126 <Lab+0x16>
movss  0xeeb(%rip),%xmm1
jmp    1030 <powf@plt>
mulss  0xed6(%rip),%xmm0
addss  0xed2(%rip),%xmm0
ret

LLVM IR (-O0):
@Lab.threshold = internal constant float 0x3F822354E0000000
define float @Lab(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 0x3F822354E0000000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = call float @powf(float %6, float 0x3FD5555560000000)
store float %7, float* %2
br label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = call float @llvm.fmuladd.f32(float 0x401F25ED00000000, float %9, float 0x3FC1A7B960000000)
store float %10, float* %2
br label %11
11: ; preds = %8, %5
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @Lab(float %0) {
%2 = fcmp ogt float %0, 0x3F822354E0000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call float @powf(float %0, float 0x3FD5555560000000)
br label %7
5: ; preds = %1
%6 = tail call float @llvm.fmuladd.f32(float %0, float 0x401F25ED00000000, float 0x3FC1A7B960000000)
br label %7
7: ; preds = %5, %3
%8 = phi float [ %4, %3 ], [ %6, %5 ]
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ bar1();
int /*<<< orphan*/ usleep(int);
void *Thread1(void *x) {
  usleep(1000000);
  bar1();
  return NULL;
}


x86 assembly (clang, -O0):
<Thread1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf4240,%edi
call   1040 <usleep@plt>
mov    $0x0,%al
call   1030 <bar1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thread1>:
push   %rax
mov    $0xf4240,%edi
call   1040 <usleep@plt>
xor    %eax,%eax
call   1030 <bar1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @Thread1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @usleep(i32 1000000)
%4 = call i32 (...) @bar1()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @Thread1(i8* nocapture readnone %0) {
%2 = tail call i32 @usleep(i32 1000000)
%3 = tail call i32 (...) @bar1()
ret i8* null
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h264avcc_set_nb_sps(uint8_t *p, uint8_t val) { p[5] = 0xe0 | val; }


x86 assembly (clang, -O0):
<h264avcc_set_nb_sps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
or     $0xe0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264avcc_set_nb_sps>:
or     $0xe0,%esi
mov    %esi,0x14(%rdi)
ret

LLVM IR (-O0):
define void @h264avcc_set_nb_sps(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = or i32 224, %5
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 5
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @h264avcc_set_nb_sps(i32* nocapture writeonly %0, i32 %1) {
%3 = or i32 %1, 224
%4 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %3, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned long);
void *malloc(size_t);
int /*<<< orphan*/ stdout;
void *do_malloc(size_t n) {
  void *ptr = malloc(n);
  if (ptr == NULL) {
    fprintf(stdout, "** Error ** : failed to malloc() %lu bytes\n",
            ((unsigned long)(n)));
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<do_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <do_malloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <do_malloc+0x10>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [44 x i8] c"** Error ** : failed to malloc() %lu bytes\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @do_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stdout
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [44 x i8] c"** Error ** : failed to malloc() %lu bytes\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @do_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ CMGRINT_simple_invalidate();
void CMGR_simple_invalidate(void) {
  CMGRINT_simple_invalidate();
  return;
}


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

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

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

LLVM IR (-O2):
define void @CMGR_simple_invalidate() {
%1 = tail call i32 (...) @CMGRINT_simple_invalidate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int);
int f(int a) {
  if (a > 0)
    g(a, 3);
  else
    g(a + 1, 5);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <f+0x27>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <g@plt>
jmp    1147 <f+0x37>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    $0x5,%esi
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
test   %edi,%edi
jle    111c <f+0xc>
mov    $0x3,%esi
jmp    1124 <f+0x14>
add    $0x1,%edi
mov    $0x5,%esi
call   1030 <g@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @g(i32 %0, i32 3)
br label %8
5: ; preds = %1
%6 = add nsw i32 %0, 1
%7 = tail call i32 @g(i32 %6, i32 5)
br label %8
8: ; preds = %5, %3
ret i32 undef
}
void BN_mod_exp_simple(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_mod_exp_simple() {
ret void
}
rotate(int *x, int *y, int *z) {
  int temp;
  temp = *x;
  *x = *y;
  *y = *z;
  *z = temp;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    (%rdx),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define i32 @rotate(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %8
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = load i32*, i32** %6
store i32 %15, i32* %16
%17 = load i32, i32* %8
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @rotate(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
store i32 %5, i32* %0
%6 = load i32, i32* %2
store i32 %6, i32* %1
store i32 %4, i32* %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *info) {
  printf("Usage: %s  <srv PORT>\n", info);
  exit(0);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s <srv PORT>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s <srv PORT>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __infer_nondet_int();
wint_t getwc(FILE *stream) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @getwc(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @getwc(i32* nocapture readnone %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
int abs_1(int i) { return (i > 0) ? -i : i; }


x86 assembly (clang, -O0):
<abs_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111e <abs_1+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs_1+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_1>:
mov    %edi,%eax
neg    %eax
cmovns %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs_1(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 false)
%3 = sub i32 0, %2
ret i32 %3
}
unsigned int crc32c(unsigned char *message, unsigned int *table) {
  int i;
  unsigned int byte, crc;
  i = 0;
  crc = 0xFFFFFFFF;
  while ((byte = message[i]) != 0) {
    crc = (crc >> 8) ^ table[(crc ^ byte) & 0xFF];
    i = i + 1;
  }
  return ~crc;
}


x86 assembly (clang, -O0):
<crc32c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
je     115e <crc32c+0x5e>
mov    -0x1c(%rbp),%eax
shr    $0x8,%eax
mov    -0x10(%rbp),%rcx
mov    -0x1c(%rbp),%edx
xor    -0x18(%rbp),%edx
and    $0xff,%edx
mov    %edx,%edx
xor    (%rcx,%rdx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111a <crc32c+0x1a>
mov    -0x1c(%rbp),%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32c>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <crc32c+0x2c>
add    $0x1,%rdi
mov    $0xffffffff,%eax
nop
movzbl %cl,%ecx
movzbl %al,%edx
shr    $0x8,%eax
xor    %ecx,%edx
xor    (%rsi,%rdx,4),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <crc32c+0x10>
not    %eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @crc32c(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %23, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %17, %5 ], [ 0, %2 ]
%7 = phi i8 [ %19, %5 ], [ %3, %2 ]
%8 = phi i32 [ %16, %5 ], [ -1, %2 ]
%9 = zext i8 %7 to i32
%10 = lshr i32 %8, 8
%11 = and i32 %8, 255
%12 = xor i32 %11, %9
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %1, i64 %13
%15 = load i32, i32* %14
%16 = xor i32 %15, %10
%17 = add nuw nsw i64 %6, 1
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %5
21: ; preds = %5
%22 = xor i32 %16, -1
br label %23
23: ; preds = %21, %2
%24 = phi i32 [ 0, %2 ], [ %22, %21 ]
ret i32 %24
}
int test_imm_BEint64_highword_reg(long long val) {
  return ((val >> 32) & (0xBE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BEint64_highword_reg>:
movabs $0xbe00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BEint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 190
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_BEint64_highword_reg(i64 %0) {
%2 = and i64 %0, 816043786240
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *pathname, mode_t mode) {
  int rc;
  rc = open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
  return rc;
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_CREAT
%8 = load i32, i32* @O_WRONLY
%9 = or i32 %7, %8
%10 = load i32, i32* @O_TRUNC
%11 = or i32 %9, %10
%12 = load i32, i32* %4
%13 = call i32 @open(i8* %6, i32 %11, i32 %12)
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}