xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ g(char *);
char f(int a) {
  int len = a * 3;
  char t[len];
  g(t);
  return t[0];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
lea    (%rax,%rax,2),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <g@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
movsbl %al,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
lea    (%rdi,%rdi,2),%ebx
add    $0xf,%rbx
and    $0xfffffffffffffff0,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
sub    %rbx,%rdi
neg    %rbx
mov    %rdi,%rsp
call   1030 <g@plt>
mov    (%r14,%rbx,1),%al
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 3
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %4
%11 = alloca i8, i64 %9
store i64 %9, i64* %5
%12 = call i32 @g(i8* %11)
%13 = getelementptr inbounds i8, i8* %11, i64 0
%14 = load i8, i8* %13
%15 = load i8*, i8** %4
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @f(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = zext i32 %2 to i64
%4 = alloca i8, i64 %3
%5 = call i32 @g(i8* %4)
%6 = load i8, i8* %4
ret i8 %6
}
int gcd(int x, int y) { return (!y) ? x : gcd(y, x % y); }


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <gcd+0x23>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <gcd+0x37>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(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 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = load i32, i32* %3
br label %15
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = call i32 @gcd(i32 %10, i32 %13)
br label %15
15: ; preds = %9, %7
%16 = phi i32 [ %8, %7 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int);
uint32_t netmask_from_prefixlen(uint8_t prefixlen) {
  return htonl(0xFFFFFFFFU - (1 << (32 - prefixlen)) + 1);
}


x86 assembly (clang, -O0):
<netmask_from_prefixlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20,%ecx
sub    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    $0xffffffff,%edi
sub    %eax,%edi
add    $0x1,%edi
call   1030 <htonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netmask_from_prefixlen>:
mov    %edi,%ecx
neg    %cl
mov    $0xffffffff,%edi
shl    %cl,%edi
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @netmask_from_prefixlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 32, %3
%5 = shl i32 1, %4
%6 = sub i32 -1, %5
%7 = add i32 %6, 1
%8 = call i32 @htonl(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @netmask_from_prefixlen(i32 %0) {
%2 = sub nsw i32 32, %0
%3 = shl nsw i32 -1, %2
%4 = tail call i32 @htonl(i32 %3)
ret i32 %4
}
void sys_init_sched(void) {}


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

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

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

LLVM IR (-O2):
define void @sys_init_sched() {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t Mirror64(uint64_t ins) {
  uint64_t inv_ins = 0;
  for (int i = 0; i < 64; i++)
    if ((ins >> i) & 1)
      inv_ins |= (((uint64_t)0x0000000000000001) << (64 - 1 - i));
  return inv_ins;
}


x86 assembly (clang, -O0):
<Mirror64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    115b <Mirror64+0x5b>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1148 <Mirror64+0x48>
mov    $0x3f,%ecx
sub    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    114d <Mirror64+0x4d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <Mirror64+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mirror64>:
xor    %r8d,%r8d
mov    $0x3e,%r9d
xor    %esi,%esi
xor    %eax,%eax
nopl   (%rax)
lea    0x1(%r9),%ecx
mov    $0x1,%edx
shl    %cl,%edx
bt     %esi,%edi
cmovae %r8d,%edx
or     %eax,%edx
lea    0x1(%rsi),%r10d
mov    $0x1,%eax
mov    %r9d,%ecx
shl    %cl,%eax
movzbl %r10b,%ecx
bt     %ecx,%edi
cmovae %r8d,%eax
or     %edx,%eax
add    $0xfffffffe,%r9d
add    $0x2,%esi
cmp    $0x40,%esi
jne    1110 <Mirror64+0x10>
ret

LLVM IR (-O0):
define i32 @Mirror64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 64
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
%12 = and i32 %11, 1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i32, i32* %4
%16 = sub nsw i32 63, %15
%17 = shl i32 1, %16
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
br label %20
20: ; preds = %14, %8
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @Mirror64(i32 %0) {
br label %3
2: ; preds = %3
ret i32 %20
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %21, %3 ]
%5 = phi i32 [ 0, %1 ], [ %20, %3 ]
%6 = shl nuw i32 1, %4
%7 = and i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = sub nuw nsw i32 63, %4
%10 = shl nuw i32 1, %9
%11 = select i1 %8, i32 0, i32 %10
%12 = or i32 %11, %5
%13 = or i32 %4, 1
%14 = shl nuw i32 1, %13
%15 = and i32 %14, %0
%16 = icmp eq i32 %15, 0
%17 = sub nsw i32 62, %4
%18 = shl nuw i32 1, %17
%19 = select i1 %16, i32 0, i32 %18
%20 = or i32 %19, %12
%21 = add nuw nsw i32 %4, 2
%22 = icmp eq i32 %21, 64
br i1 %22, label %2, label %3
}
void handle_60(sig) int sig;
{}


x86 assembly (clang, -O0):
<handle_60>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @handle_60(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @handle_60(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int const SIGINT;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigintHandler(const int arg) {
  if (SIGINT == arg) {
    printf("\ninterrupted\n");
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<sigintHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%eax
cmp    -0x4(%rbp),%eax
jne    1157 <sigintHandler+0x37>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigintHandler>:
test   %edi,%edi
je     1125 <sigintHandler+0x5>
ret
push   %rax
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGINT = constant i32 0
@.str = [14 x i8] c"\0Ainterrupted\0A\00"
@EXIT_SUCCESS = global i32 0
define void @sigintHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGINT
%4 = load i32, i32* %2
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = constant i32 0
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"\0Ainterrupted\00"
define void @sigintHandler(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int rand();
int RandomInt(int n) { return (rand() % n) + 1; }


x86 assembly (clang, -O0):
<RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInt>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @RandomInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @RandomInt(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
scalar_t__ isalpha(char const);
int IsAbsolutePath(const char *path) {
  return path[0] == '/' || (isalpha(path[0]) && path[1] == ':');
}


x86 assembly (clang, -O0):
<IsAbsolutePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0x9(%rbp)
je     1166 <IsAbsolutePath+0x56>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0xa(%rbp)
je     1160 <IsAbsolutePath+0x50>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAbsolutePath>:
push   %rbx
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x2f,%cl
je     1136 <IsAbsolutePath+0x26>
mov    %rdi,%rbx
movsbl %cl,%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     1138 <IsAbsolutePath+0x28>
xor    %eax,%eax
cmpb   $0x3a,0x1(%rbx)
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @IsAbsolutePath(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 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
br i1 %7, label %22, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = call i64 @isalpha(i8 signext %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 58
br label %20
20: ; preds = %14, %8
%21 = phi i1 [ false, %8 ], [ %19, %14 ]
br label %22
22: ; preds = %20, %1
%23 = phi i1 [ true, %1 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsAbsolutePath(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i64 @isalpha(i8 signext %2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 58
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %7, %1
%13 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %11, %7 ]
ret i32 %13
}
_Bool f0_0(void *a0) { return (_Bool)a0; }


x86 assembly (clang, -O0):
<f0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0_0>:
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define zeroext i1 @f0_0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @f0_0(i8* readnone %0) {
%2 = icmp ne i8* %0, null
ret i1 %2
}
void pgdat_resize_lock(struct pglist_data *p, unsigned long *f) {}


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

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

LLVM IR (-O0):
%struct.pglist_data = type opaque
define void @pgdat_resize_lock(%struct.pglist_data* %0, i64* %1) {
%3 = alloca %struct.pglist_data*
%4 = alloca i64*
store %struct.pglist_data* %0, %struct.pglist_data** %3
store i64* %1, i64** %4
ret void
}

LLVM IR (-O2):
%struct.pglist_data = type opaque
define void @pgdat_resize_lock(%struct.pglist_data* nocapture %0, i64* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_hex(char *);
char *is_hex_01b() {
  char hex[] =
      "0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3";
  do {
    if (!(is_hex(hex)))
      return "return true for hex strings with leading '0X's";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<is_hex_01b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x43,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1030 <is_hex@plt>
cmp    $0x0,%eax
jne    115f <is_hex_01b+0x3f>
lea    0xeed(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <is_hex_01b+0x4c>
jmp    1164 <is_hex_01b+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_01b>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x334132,0x3f(%rsp)
mov    %rsp,%rdi
call   1030 <is_hex@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xee5(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.is_hex_01b.hex = [67 x i8] c"0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [47 x i8] c"return true for hex strings with leading '0X's\00"
define i8* @is_hex_01b() {
%1 = alloca i8*
%2 = alloca [67 x i8]
%3 = bitcast [67 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [67 x i8], [67 x i8]* %2, i64 0, i64 0
%6 = call i32 @is_hex(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.is_hex_01b.hex = [67 x i8] c"0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [47 x i8] c"return true for hex strings with leading '0X's\00"
define i8* @is_hex_01b() {
%1 = alloca [67 x i8]
%2 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%3 = call i32 @is_hex(i8* %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %5
}
/* Variables and functions */
int strcmp(char *, char *);
int irmo_string_compare(void *string1, void *string2) {
  int result;
  result = strcmp((char *)string1, (char *)string2);
  if (result < 0) {
    return -1;
  } else if (result > 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<irmo_string_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1146 <irmo_string_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <irmo_string_compare+0x53>
cmpl   $0x0,-0x1c(%rbp)
jle    115c <irmo_string_compare+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <irmo_string_compare+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irmo_string_compare>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @irmo_string_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = icmp sgt i32 %3, -1
%7 = select i1 %6, i32 %5, i32 -1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ test_run();
int main(int argc, char *argv[]) {
  test_run();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_run()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int tabela[] = {1, 2, 4, 6, 12};
  int i;
  for (i = 4; i >= 0; i--)
    printf("tabela[%d]=%d\n", i, tabela[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1174 <main+0x64>
mov    -0x24(%rbp),%esi
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1145 <main+0x35>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xc,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"tabela[%d]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 4, i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 3, i32 6)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2, i32 4)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
void SetBit(size_t *word, size_t b, bool value) {
  if (value) {
    *word |= ((size_t)1 << b);
  } else {
    *word &= ~((size_t)1 << b);
  }
}


x86 assembly (clang, -O0):
<SetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1137 <SetBit+0x37>
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
jmp    1154 <SetBit+0x54>
mov    -0x10(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x8(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetBit>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
test   %edx,%edx
je     1116 <SetBit+0x16>
or     (%rdi),%rax
mov    %rax,(%rdi)
ret
not    %rax
and    (%rdi),%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @SetBit(i64* %0, i64 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i32
store i64* %0, i64** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i64, i64* %5
%11 = shl i64 1, %10
%12 = load i64*, i64** %4
%13 = load i64, i64* %12
%14 = or i64 %13, %11
store i64 %14, i64* %12
br label %22
15: ; preds = %3
%16 = load i64, i64* %5
%17 = shl i64 1, %16
%18 = xor i64 %17, -1
%19 = load i64*, i64** %4
%20 = load i64, i64* %19
%21 = and i64 %20, %18
store i64 %21, i64* %19
br label %22
22: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
define void @SetBit(i64* nocapture %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = shl nuw i64 1, %1
br i1 %4, label %9, label %6
6: ; preds = %3
%7 = load i64, i64* %0
%8 = or i64 %7, %5
br label %13
9: ; preds = %3
%10 = xor i64 %5, -1
%11 = load i64, i64* %0
%12 = and i64 %11, %10
br label %13
13: ; preds = %9, %6
%14 = phi i64 [ %12, %9 ], [ %8, %6 ]
store i64 %14, i64* %0
ret void
}
void iNemoEngineAPI_ForceReCalibration(void) {}


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

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

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

LLVM IR (-O2):
define void @iNemoEngineAPI_ForceReCalibration() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *ns_fopen(const char *path, const char *mode) { return fopen(path, mode); }


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

x86 assembly (clang, -O2):
<ns_fopen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @ns_fopen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
void mm_cpu_backoff(void) { asm volatile("rep; nop" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @mm_cpu_backoff() {
tail call void asm sideeffect "rep; nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
double expm1(double);
double log1p(double);
double pco_scale(double x, double n) {
  if (x >= 1.0 || x <= 0.0)
    return x;
  return -expm1(log1p(-x) * n);
}


x86 assembly (clang, -O0):
<pco_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jae    1157 <pco_scale+0x37>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1166 <pco_scale+0x46>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ad <pco_scale+0x8d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <log1p@plt>
mulsd  -0x18(%rbp),%xmm0
call   1030 <expm1@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pco_scale>:
push   %rax
ucomisd 0xed7(%rip),%xmm0
jae    1159 <pco_scale+0x39>
xorpd  %xmm2,%xmm2
ucomisd %xmm0,%xmm2
jae    1159 <pco_scale+0x39>
xorpd  0xed3(%rip),%xmm0
movsd  %xmm1,(%rsp)
call   1040 <log1p@plt>
mulsd  (%rsp),%xmm0
call   1030 <expm1@plt>
xorpd  0xeb7(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pco_scale(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = fcmp oge double %6, 1.000000e+00
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp ole double %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %8, %2
%12 = load double, double* %4
store double %12, double* %3
br label %21
13: ; preds = %8
%14 = load double, double* %4
%15 = fneg double %14
%16 = call double @log1p(double %15)
%17 = load double, double* %5
%18 = fmul double %16, %17
%19 = call double @expm1(double %18)
%20 = fneg double %19
store double %20, double* %3
br label %21
21: ; preds = %13, %11
%22 = load double, double* %3
ret double %22
}

LLVM IR (-O2):
define double @pco_scale(double %0, double %1) {
%3 = fcmp oge double %0, 1.000000e+00
%4 = fcmp ole double %0, 0.000000e+00
%5 = or i1 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = fneg double %0
%8 = tail call double @log1p(double %7)
%9 = fmul double %8, %1
%10 = tail call double @expm1(double %9)
%11 = fneg double %10
br label %12
12: ; preds = %2, %6
%13 = phi double [ %11, %6 ], [ %0, %2 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int solve(int);
int test() {
  for (int i = 0; i <= 10000000; ++i) {
    printf("%d: %d\n", i, solve(i));
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
cmpl   $0x989680,-0x8(%rbp)
jg     1169 <test+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <solve@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <test+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1030 <solve@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x989681,%ebx
jne    1130 <test+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %d\0A\00"
define i32 @test() {
br label %2
1: ; preds = %2
ret i32 undef
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i32 @solve(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 10000001
br i1 %7, label %1, label %2
}
/* Type definitions */
typedef unsigned long uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void I2SStart(uint32_t ui32Base, uint8_t ui8FixDMALength) {
  ;
  (*((volatile unsigned long *)(0x40021000 + 0x00000004))) = ui8FixDMALength;
}


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

x86 assembly (clang, -O2):
<I2SStart>:
mov    %rsi,0x40021004
40
ret

LLVM IR (-O0):
define void @I2SStart(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
store volatile i64 %5, i64* inttoptr (i64 1073876996 to i64*)
ret void
}

LLVM IR (-O2):
define void @I2SStart(i32 %0, i64 %1) {
store volatile i64 %1, i64* inttoptr (i64 1073876996 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heapify(float **, long, long);
void build_heap(float **heap, long heapsize) {
  long index;
  for (index = (heapsize) / 2; index >= 1; index--) {
    heapify(heap, heapsize, index);
  }
  return;
}


x86 assembly (clang, -O0):
<build_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
cmpq   $0x1,-0x18(%rbp)
jl     115f <build_heap+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <heapify@plt>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <build_heap+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_heap>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%rsi
jl     114b <build_heap+0x3b>
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rbx
shr    %rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <heapify@plt>
lea    -0x1(%rbx),%rax
cmp    $0x1,%rbx
mov    %rax,%rbx
ja     1130 <build_heap+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @build_heap(float** %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i64 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %9, %6 ], [ %5, %4 ]
%8 = tail call i32 @heapify(float** %0, i64 %1, i64 %7)
%9 = add nsw i64 %7, -1
%10 = icmp ugt i64 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
int field_list() {}


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

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

LLVM IR (-O0):
define i32 @field_list() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @field_list() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ drv_L7_write_ctrl(int);
int drv_L7_contrast(int contrast) {
  if (contrast < 0)
    contrast = 0;
  if (contrast > 31)
    contrast = 31;
  drv_L7_write_ctrl(0x80 | contrast);
  return contrast;
}


x86 assembly (clang, -O0):
<drv_L7_contrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <drv_L7_contrast+0x1c>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jle    113d <drv_L7_contrast+0x2d>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x80,%edi
call   1030 <drv_L7_write_ctrl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_L7_contrast>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
cmp    $0x1f,%eax
mov    $0x1f,%ebx
cmovb  %eax,%ebx
mov    %ebx,%edi
or     $0x80,%edi
call   1030 <drv_L7_write_ctrl@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @drv_L7_contrast(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 31
%5 = select i1 %4, i32 %3, i32 31
%6 = or i32 %5, 128
%7 = tail call i32 @drv_L7_write_ctrl(i32 %6)
ret i32 %5
}
unsigned int f18(unsigned int x, unsigned long int y) {
  return (x >> ((-y) & (8 * 4 - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f18>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f18>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f18(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 = sub i64 0, %6
%8 = and i64 %7, 31
%9 = trunc i64 %8 to i32
%10 = lshr i32 %5, %9
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = shl i32 %11, %13
%15 = xor i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f18(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 0, %3
%5 = and i32 %4, 31
%6 = lshr i32 %0, %5
%7 = shl i32 %0, %3
%8 = xor i32 %6, %7
ret i32 %8
}
void glutInitWindowPosition(int x, int y) {}


x86 assembly (clang, -O0):
<glutInitWindowPosition>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @glutInitWindowPosition(i32 %0, i32 %1) {
ret void
}
void ip4_num(unsigned int *u, unsigned char ip[4]) {
  *u |= ip[0] << 24;
  *u |= ip[1] << 16;
  *u |= ip[2] << 8;
  *u |= ip[3];
}


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

x86 assembly (clang, -O2):
<ip4_num>:
movzbl (%rsi),%eax
shl    $0x18,%eax
or     (%rdi),%eax
mov    %eax,(%rdi)
movzbl 0x1(%rsi),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
movzbl 0x2(%rsi),%eax
shl    $0x8,%eax
or     %ecx,%eax
mov    %eax,(%rdi)
movzbl 0x3(%rsi),%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @ip4_num(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 24
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = or i32 %11, %9
store i32 %12, i32* %10
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 16
%18 = load i32*, i32** %3
%19 = load i32, i32* %18
%20 = or i32 %19, %17
store i32 %20, i32* %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = shl i32 %24, 8
%26 = load i32*, i32** %3
%27 = load i32, i32* %26
%28 = or i32 %27, %25
store i32 %28, i32* %26
%29 = load i8*, i8** %4
%30 = getelementptr inbounds i8, i8* %29, i64 3
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = load i32*, i32** %3
%34 = load i32, i32* %33
%35 = or i32 %34, %32
store i32 %35, i32* %33
ret void
}

LLVM IR (-O2):
define void @ip4_num(i32* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = load i32, i32* %0
%7 = or i32 %5, %6
store i32 %7, i32* %0
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 16
%12 = or i32 %11, %7
store i32 %12, i32* %0
%13 = getelementptr inbounds i8, i8* %1, i64 2
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl nuw nsw i32 %15, 8
%17 = or i32 %16, %12
store i32 %17, i32* %0
%18 = getelementptr inbounds i8, i8* %1, i64 3
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
store i32 %21, i32* %0
ret void
}
int xmlUCSIsMyanmar(int code) {
  return (((code >= 0x1000) && (code <= 0x109F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMyanmar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMyanmar+0x26>
cmpl   $0x109f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsMyanmar>:
add    $0xfffff000,%edi
xor    %eax,%eax
cmp    $0xa0,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsMyanmar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 4096
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 4255
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsMyanmar(i32 %0) {
%2 = add i32 %0, -4096
%3 = icmp ult i32 %2, 160
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void testTimes() { printf("%d * %d = %d\n", 10, 4, 10 * 4); }


x86 assembly (clang, -O0):
<testTimes>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x28,%ecx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testTimes>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x28,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define void @testTimes() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 40)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define void @testTimes() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 40)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _stp_error(char *);
void stap_task_finder_unavailable(void) {
  _stp_error("process-tracking is not available in this kernel"
             " [man error::process-tracking]");
}


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

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

LLVM IR (-O0):
@.str = [79 x i8] c"process-tracking is not available in this kernel [man error::process-tracking]\00"
define void @stap_task_finder_unavailable() {
%1 = call i32 @_stp_error(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [79 x i8] c"process-tracking is not available in this kernel [man error::process-tracking]\00"
define void @stap_task_finder_unavailable() {
%1 = tail call i32 @_stp_error(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int data_elementsplaced(int, int);
int data_elementsremaining(int, int);
int ai_canupgrade(int player) {
  if (data_elementsremaining(player, 2) >= 1 &&
      data_elementsplaced(player, 1) >= 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ai_canupgrade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1040 <data_elementsremaining@plt>
cmp    $0x1,%eax
jl     1163 <ai_canupgrade+0x43>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <data_elementsplaced@plt>
cmp    $0x1,%eax
jl     1163 <ai_canupgrade+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116a <ai_canupgrade+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_canupgrade>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x2,%esi
call   1040 <data_elementsremaining@plt>
test   %eax,%eax
jle    1148 <ai_canupgrade+0x28>
mov    $0x1,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <data_elementsplaced@plt>
test   %eax,%eax
jg     114a <ai_canupgrade+0x2a>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ai_canupgrade(i32 %0) {
%2 = tail call i32 @data_elementsremaining(i32 %0, i32 2)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @data_elementsplaced(i32 %0, i32 1)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4, %1
br label %8
8: ; preds = %4, %7
%9 = phi i32 [ 0, %7 ], [ 1, %4 ]
ret i32 %9
}
/* Type definitions */
typedef size_t uint32_t;
typedef scalar_t__ Window;

/* Variables and functions */
uint32_t Lookup(Window *__restrict windows, Window window, uint32_t count) {
  windows[count] = window;
  Window *__restrict table = windows;
  uint32_t index;
  while (table[index] != window)
    index++;
  return index;
}


x86 assembly (clang, -O0):
<Lookup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
je     114f <Lookup+0x4f>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1128 <Lookup+0x28>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lookup>:
mov    %rsi,(%rdi,%rdx,8)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rcx
add    $0x1,%rax
cmp    %rsi,0x8(%rdi,%rcx,8)
jne    1110 <Lookup+0x10>
ret

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

LLVM IR (-O2):
define i64 @Lookup(i64* noalias nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i64, i64* %0, i64 %2
store i64 %1, i64* %4
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ undef, %3 ], [ %10, %5 ]
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, %1
%10 = add i64 %6, 1
br i1 %9, label %11, label %5
11: ; preds = %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void TrOpEntry(char *name) { printf(" -> %s", name); }


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

x86 assembly (clang, -O2):
<TrOpEntry>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c" -> %s\00"
define void @TrOpEntry(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}