xunge/DecIR huggingface dataset:
/* Variables and functions */
int write(int, char *, int);
int write_file_(int *fd, char *buf, int *ierr, int strlen) {
  int nbytes;
  nbytes = write(*fd, buf, strlen);
  if (nbytes != strlen) {
    *ierr = -1;
  } else {
    *ierr = 0;
  }
  return *ierr;
}


x86 assembly (clang, -O0):
<write_file_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1157 <write_file_+0x47>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
jmp    1161 <write_file_+0x51>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file_>:
push   %r14
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdx,%r14
mov    (%rdi),%edi
mov    %ecx,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
neg    %ecx
mov    %ecx,(%r14)
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @write_file_(i32* nocapture %0, i8* nocapture %1, i32* nocapture writeonly %2, i32 %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @write(i32 %5, i8* %1, i32 %3)
%7 = icmp ne i32 %6, %3
%8 = sext i1 %7 to i32
store i32 %8, i32* %2
ret i32 %8
}
/* Variables and functions */
int rand();
int didItHappen(int chance) { return rand() % 100 < chance; }


x86 assembly (clang, -O0):
<didItHappen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    -0x4(%rbp),%edx
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<didItHappen>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movslq %eax,%rcx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setl   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @didItHappen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 100
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @didItHappen(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 100
%4 = icmp slt i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
int test2n(long long n) {
  if (n < -2LL)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test2n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xfffffffffffffffe,-0x10(%rbp)
jge    111f <test2n+0x1f>
movl   $0x1,-0x4(%rbp)
jmp    1126 <test2n+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2n>:
xor    %eax,%eax
cmp    $0xfffffffffffffffe,%rdi
setl   %al
ret

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

LLVM IR (-O2):
define i32 @test2n(i64 %0) {
%2 = icmp slt i64 %0, -2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ funcb2();
int /*<<< orphan*/ funcc();
int /*<<< orphan*/ printf(char *);
void funcb(void) {
  printf("b\n");
  funcb2();
  funcc();
}


x86 assembly (clang, -O0):
<funcb>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <funcb2@plt>
mov    $0x0,%al
call   1030 <funcc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcb>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <funcb2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <funcc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"b\0A\00"
define void @funcb() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @funcb2()
%3 = call i32 (...) @funcc()
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"b\00"
define void @funcb() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @funcb2()
%3 = tail call i32 (...) @funcc()
ret void
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
int _cmp_time_t(const void *_a, const void *_b) {
  const time_t *a = _a, *b = _b;
  if (*a < *b)
    return -1;
  else if (*a > *b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<_cmp_time_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    113c <_cmp_time_t+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <_cmp_time_t+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jle    115c <_cmp_time_t+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <_cmp_time_t+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_cmp_time_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = icmp sgt i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void Interp7(unsigned char *pc, int c1, int c2, int c3) {
  *((int *)pc) = ((((c1 & 0x00FF00) * 6 + (c2 & 0x00FF00) + (c3 & 0x00FF00)) &
                   0x0007F800) +
                  (((c1 & 0xFF00FF) * 6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF)) &
                   0x07F807F8)) >>
                 3;
}


x86 assembly (clang, -O0):
<Interp7>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff00,%eax
imul   $0x6,%eax,%ecx
mov    -0x10(%rbp),%eax
and    $0xff00,%eax
add    %eax,%ecx
mov    -0x14(%rbp),%eax
and    $0xff00,%eax
add    %eax,%ecx
and    $0x7f800,%ecx
mov    -0xc(%rbp),%eax
and    $0xff00ff,%eax
imul   $0x6,%eax,%eax
mov    -0x10(%rbp),%edx
and    $0xff00ff,%edx
add    %edx,%eax
mov    -0x14(%rbp),%edx
and    $0xff00ff,%edx
add    %edx,%eax
and    $0x7f807f8,%eax
add    %eax,%ecx
sar    $0x3,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Interp7>:
mov    %esi,%eax
and    $0xff00,%eax
lea    (%rax,%rax,2),%r8d
mov    %edx,%eax
and    $0xff00,%eax
lea    (%rax,%r8,2),%r8d
mov    %ecx,%eax
and    $0xff00,%eax
add    %r8d,%eax
and    $0x7f800,%eax
and    $0xff00ff,%esi
lea    (%rsi,%rsi,2),%esi
and    $0xff00ff,%edx
lea    (%rdx,%rsi,2),%edx
and    $0xff00ff,%ecx
add    %edx,%ecx
and    $0x7f807f8,%ecx
or     %eax,%ecx
shr    $0x3,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @Interp7(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, 65280
%11 = mul nsw i32 %10, 6
%12 = load i32, i32* %7
%13 = and i32 %12, 65280
%14 = add nsw i32 %11, %13
%15 = load i32, i32* %8
%16 = and i32 %15, 65280
%17 = add nsw i32 %14, %16
%18 = and i32 %17, 522240
%19 = load i32, i32* %6
%20 = and i32 %19, 16711935
%21 = mul nsw i32 %20, 6
%22 = load i32, i32* %7
%23 = and i32 %22, 16711935
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %8
%26 = and i32 %25, 16711935
%27 = add nsw i32 %24, %26
%28 = and i32 %27, 133695480
%29 = add nsw i32 %18, %28
%30 = ashr i32 %29, 3
%31 = load i8*, i8** %5
%32 = bitcast i8* %31 to i32*
store i32 %30, i32* %32
ret void
}

LLVM IR (-O2):
define void @Interp7(i8* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, 65280
%6 = mul nuw nsw i32 %5, 6
%7 = and i32 %2, 65280
%8 = add nuw nsw i32 %6, %7
%9 = and i32 %3, 65280
%10 = add nuw nsw i32 %8, %9
%11 = and i32 %10, 522240
%12 = and i32 %1, 16711935
%13 = mul nuw nsw i32 %12, 6
%14 = and i32 %2, 16711935
%15 = add nuw nsw i32 %13, %14
%16 = and i32 %3, 16711935
%17 = add nuw nsw i32 %15, %16
%18 = and i32 %17, 133695480
%19 = or i32 %11, %18
%20 = lshr exact i32 %19, 3
%21 = bitcast i8* %0 to i32*
store i32 %20, i32* %21
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ wet_puts(char *);
void version(void) {
  wet_puts("wet"
           " (WEather Tool) "
           "1.5.6"
           "\n"
           "Written by Nathan Forbes (2014)\n");
  exit(0);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <wet_puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <wet_puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [58 x i8] c"wet (WEather Tool) 1.5.6\0AWritten by Nathan Forbes (2014)\0A\00"
define void @version() {
%1 = call i32 @wet_puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [58 x i8] c"wet (WEather Tool) 1.5.6\0AWritten by Nathan Forbes (2014)\0A\00"
define void @version() {
%1 = tail call i32 @wet_puts(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, long, char *);
char *strdup(char *);
char *alloc_C_string(void) {
  char *phrase = strdup("I was written in C");
  printf("      C just allocated %p(%ld):  %s\n", phrase, (long int)phrase,
         phrase);
  return phrase;
}


x86 assembly (clang, -O0):
<alloc_C_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_C_string>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
lea    0xedc(%rip),%rdi
mov    %rax,%rsi
mov    %rax,%rdx
mov    %rax,%rcx
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"I was written in C\00"
@.str.1 = [37 x i8] c" C just allocated %p(%ld): %s\0A\00"
define i8* @alloc_C_string() {
%1 = alloca i8*
%2 = call i8* @strdup(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = load i8*, i8** %1
%5 = ptrtoint i8* %4 to i64
%6 = load i8*, i8** %1
%7 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %3, i64 %5, i8* %6)
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@.str = [19 x i8] c"I was written in C\00"
@.str.1 = [37 x i8] c" C just allocated %p(%ld): %s\0A\00"
define i8* @alloc_C_string() {
%1 = tail call dereferenceable_or_null(19) i8* @strdup(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = ptrtoint i8* %1 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i8* %1, i64 %2, i8* %1)
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __STREXB(uint8_t value,
                                           volatile uint8_t *addr) {
  uint32_t result;
  return (result);
}


x86 assembly (clang, -O0):
<__STREXB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__STREXB(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @__STREXB(i32 %0, i32* nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
struct eb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __eb_delete(struct eb_node *);
void eb_delete(struct eb_node *node) { __eb_delete(node); }


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

x86 assembly (clang, -O2):
<eb_delete>:
jmp    1030 <__eb_delete@plt>

LLVM IR (-O0):
%struct.eb_node = type { i32 }
define void @eb_delete(%struct.eb_node* %0) {
%2 = alloca %struct.eb_node*
store %struct.eb_node* %0, %struct.eb_node** %2
%3 = load %struct.eb_node*, %struct.eb_node** %2
%4 = call i32 @__eb_delete(%struct.eb_node* %3)
ret void
}

LLVM IR (-O2):
%struct.eb_node = type { i32 }
define void @eb_delete(%struct.eb_node* %0) {
%2 = tail call i32 @__eb_delete(%struct.eb_node* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u64;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_le32(int, int /*<<< orphan*/ *);
void __put_unaligned_le64(__u64 val, __u8 *p) {
  __put_unaligned_le32(val >> 32, p + 4);
  __put_unaligned_le32(val, p);
}


x86 assembly (clang, -O0):
<__put_unaligned_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x20,%ecx
sar    %cl,%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1030 <__put_unaligned_le32@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__put_unaligned_le32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__put_unaligned_le64>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x10,%rsi
call   1030 <__put_unaligned_le32@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_le32@plt>

LLVM IR (-O0):
define void @__put_unaligned_le64(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 32
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 4
%9 = call i32 @__put_unaligned_le32(i32 %6, i32* %8)
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @__put_unaligned_le32(i32 %10, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_le64(i32 %0, i32* %1) {
%3 = getelementptr inbounds i32, i32* %1, i64 4
%4 = tail call i32 @__put_unaligned_le32(i32 poison, i32* %3)
%5 = tail call i32 @__put_unaligned_le32(i32 %0, i32* %1)
ret void
}
unsigned int Shift(unsigned int val, unsigned int normal, unsigned int bright) {
  if (val == 0) {
    return 9 + normal;
  }
  val -= 1;
  if (val >= 8) {
    return (val - 8) + bright;
  }
  return val + normal;
}


x86 assembly (clang, -O0):
<Shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1125 <Shift+0x25>
mov    -0xc(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <Shift+0x52>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jb     1149 <Shift+0x49>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <Shift+0x52>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Shift>:
mov    %esi,%eax
test   %edi,%edi
je     1115 <Shift+0x15>
lea    -0x1(%rdi),%ecx
cmp    $0x8,%ecx
jb     1119 <Shift+0x19>
lea    (%rdi,%rdx,1),%eax
add    $0xfffffff7,%eax
ret
add    $0x9,%eax
ret
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Shift(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add i32 %1, 9
br label %15
7: ; preds = %3
%8 = add i32 %0, -1
%9 = icmp ugt i32 %8, 7
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = add i32 %0, -9
%12 = add i32 %11, %2
br label %15
13: ; preds = %7
%14 = add i32 %8, %1
br label %15
15: ; preds = %13, %10, %5
%16 = phi i32 [ %6, %5 ], [ %12, %10 ], [ %14, %13 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
void put_double_le(char *cp, double fval) {
  unsigned char *dp = (unsigned char *)&fval;
  memcpy(cp, dp, 8);
}


x86 assembly (clang, -O0):
<put_double_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_double_le>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @put_double_le(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
%5 = alloca i8*
store i8* %0, i8** %3
store double %1, double* %4
%6 = bitcast double* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 8)
ret void
}

LLVM IR (-O2):
define void @put_double_le(i8* %0, double %1) {
%3 = alloca double
store double %1, double* %3
%4 = bitcast double* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_nrfd(int);
int /*<<< orphan*/ parallel_set_nrfd(int);
void parallel_drv1_set_nrfd(unsigned char val) {
  if (val) {
    parallel_set_nrfd(0x08);
  } else {
    parallel_clr_nrfd(~0x08);
  }
}


x86 assembly (clang, -O0):
<parallel_drv1_set_nrfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_drv1_set_nrfd+0x27>
mov    $0x8,%edi
call   1040 <parallel_set_nrfd@plt>
jmp    1151 <parallel_drv1_set_nrfd+0x31>
mov    $0xfffffff7,%edi
call   1030 <parallel_clr_nrfd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_drv1_set_nrfd>:
test   %edi,%edi
je     112e <parallel_drv1_set_nrfd+0xe>
mov    $0x8,%edi
jmp    1040 <parallel_set_nrfd@plt>
mov    $0xfffffff7,%edi
jmp    1030 <parallel_clr_nrfd@plt>

LLVM IR (-O0):
define void @parallel_drv1_set_nrfd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @parallel_set_nrfd(i32 8)
br label %9
7: ; preds = %1
%8 = call i32 @parallel_clr_nrfd(i32 -9)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @parallel_drv1_set_nrfd(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_nrfd(i32 8)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_nrfd(i32 -9)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void window_map_scrollgetsize() { RCT2_CALLPROC_EBPSAFE(0x0068D7CC); }


x86 assembly (clang, -O0):
<window_map_scrollgetsize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x68d7cc,%edi
call   1030 <RCT2_CALLPROC_EBPSAFE@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_map_scrollgetsize>:
mov    $0x68d7cc,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @window_map_scrollgetsize() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 6870988)
ret void
}

LLVM IR (-O2):
define void @window_map_scrollgetsize() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 6870988)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ffindex_restore(FILE *data_file, FILE *index_file, char *input_dir_name) {
  return -1;
}


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

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

LLVM IR (-O0):
define i32 @ffindex_restore(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @ffindex_restore(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ towerOfHanoi(int, char, char, char);
int main() {
  int disks;
  printf("Enter the no. of disks: ");
  scanf("%d", &disks);
  towerOfHanoi(disks, 'A', 'C', 'B');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x43,%edx
mov    $0x42,%ecx
call   1040 <towerOfHanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    $0x41,%esi
mov    $0x43,%edx
mov    $0x42,%ecx
call   1040 <towerOfHanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Enter the no. of disks: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @towerOfHanoi(i32 %5, i8 signext 65, i8 signext 67, i8 signext 66)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Enter the no. of disks: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @towerOfHanoi(i32 %5, i8 signext 65, i8 signext 67, i8 signext 66)
ret i32 0
}
int ipow(int x, int n) {
  if (n == 0)
    return 1;
  else if (n == 1)
    return x;
  else
    return x * ipow(x, n - 1);
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <ipow+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1168 <ipow+0x58>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <ipow+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <ipow+0x58>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <ipow@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
mov    %edi,%eax
mov    $0x1,%ecx
test   %esi,%esi
je     111f <ipow+0x1f>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%esi
je     1124 <ipow+0x24>
add    $0xffffffff,%esi
imul   %eax,%ecx
test   %esi,%esi
jne    1110 <ipow+0x10>
mov    $0x1,%eax
imul   %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ipow(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* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %21
9: ; preds = %2
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %4
store i32 %13, i32* %3
br label %21
14: ; preds = %9
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
%19 = call i32 @ipow(i32 %16, i32 %18)
%20 = mul nsw i32 %15, %19
store i32 %20, i32* %3
br label %21
21: ; preds = %14, %12, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i32 [ 1, %2 ], [ %8, %6 ]
%5 = phi i32 [ %1, %2 ], [ %7, %6 ]
switch i32 %5, label %6 [
i32 0, label %9
i32 1, label %10
]
6: ; preds = %3
%7 = add nsw i32 %5, -1
%8 = mul nsw i32 %4, %0
br label %3
9: ; preds = %3
br label %10
10: ; preds = %3, %9
%11 = phi i32 [ 1, %9 ], [ %0, %3 ]
%12 = mul nsw i32 %11, %4
ret i32 %12
}
void initialise_benchmark(void) {}


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

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

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

LLVM IR (-O2):
define void @initialise_benchmark() {
ret void
}
unsigned char gf256_is_nonzero(unsigned char a) {
  unsigned a8 = a;
  unsigned r = ((unsigned)0) - a8;
  r >>= 8;
  return r & 1;
}


x86 assembly (clang, -O0):
<gf256_is_nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf256_is_nonzero>:
mov    %edi,%eax
neg    %eax
shr    $0x8,%eax
and    $0x1,%al
ret

LLVM IR (-O0):
define zeroext i8 @gf256_is_nonzero(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = sub i32 0, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = and i32 %11, 1
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @gf256_is_nonzero(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = sub nsw i32 0, %2
%4 = lshr i32 %3, 8
%5 = trunc i32 %4 to i8
%6 = and i8 %5, 1
ret i8 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
int get_XPointerMovedEvent_type(void *_p) {
  return (int)((XPointerMovedEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XPointerMovedEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XPointerMovedEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void writel(l) register const char *l;
{
  while (*l)
    writec(*l++);
}


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

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

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

LLVM IR (-O2):
define void @writel(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @writec to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned long swapl(unsigned long);
unsigned long htonl(unsigned long hostlong) { return swapl(hostlong); }


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

x86 assembly (clang, -O2):
<htonl>:
jmp    1030 <swapl@plt>

LLVM IR (-O0):
define i64 @htonl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @swapl(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @htonl(i64 %0) {
%2 = tail call i64 @swapl(i64 %0)
ret i64 %2
}
unsigned int f49(unsigned int x, unsigned int y) {
  return (x << (8 * 4 - y)) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f49>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f49(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub i32 32, %6
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = lshr i32 %9, %10
%12 = xor i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @f49(i32 %0, i32 %1) {
%3 = sub i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = xor i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t be_to_h_u32(const uint8_t *buf) {
  return (uint32_t)(buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24);
}


x86 assembly (clang, -O0):
<be_to_h_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_to_h_u32>:
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
or     0xc(%rdi),%ecx
mov    (%rdi),%eax
mov    0x4(%rdi),%edx
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @be_to_h_u32(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = or i32 %7, %10
%12 = load i32, i32* %0
%13 = shl i32 %12, 24
%14 = or i32 %11, %13
ret i32 %14
}
int main_deref() {
  int x;
  int *y;
  int **w;
  int *z;
  x = 2;
  y = &x;
  w = &y;
  z = *w;
  return x;
}


x86 assembly (clang, -O0):
<main_deref>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main_deref() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca i32*
store i32 2, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%5 = load i32**, i32*** %3
%6 = load i32*, i32** %5
store i32* %6, i32** %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @main_deref() {
ret i32 2
}
f(a) unsigned long a;
{
  if (a != 0xdeadbeefL)
    abort();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xdeadbeef,%eax
cmp    %rax,-0x10(%rbp)
je     1130 <f+0x20>
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0xdeadbeef,%eax
cmp    %rax,%rdi
jne    111b <f+0xb>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @f(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 3735928559
br i1 %5, label %6, label %7
6: ; preds = %1
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = icmp eq i64 %0, 3735928559
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @abort()
unreachable
4: ; preds = %1
ret i32 undef
}
char has_num(const char *str) {
  int index = 0;
  while (str[index] != '\0') {
    if (str[index] >= '0' && str[index] <= '9') {
      return 1;
    }
    index++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<has_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1165 <has_num+0x65>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     1157 <has_num+0x57>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jg     1157 <has_num+0x57>
movb   $0x1,-0x1(%rbp)
jmp    1169 <has_num+0x69>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <has_num+0xf>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_num>:
mov    (%rdi),%al
test   %al,%al
je     1121 <has_num+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
add    $0xd0,%al
cmp    $0x9,%al
jbe    1124 <has_num+0x24>
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <has_num+0x10>
xor    %eax,%eax
ret
mov    $0x1,%al
ret

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

LLVM IR (-O2):
define signext i8 @has_num(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -48
%12 = icmp ult i8 %11, 10
%13 = add nuw i64 %9, 1
br i1 %12, label %14, label %4
14: ; preds = %8, %4, %1
%15 = phi i8 [ 0, %1 ], [ 0, %4 ], [ 1, %8 ]
ret i8 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct proto_hdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ proto_field_set_bytes(struct proto_hdr *, int /*<<< orphan*/,
                                         int /*<<< orphan*/ *);
void proto_field_set_u8(struct proto_hdr *hdr, uint32_t fid, uint8_t val) {
  proto_field_set_bytes(hdr, fid, (uint8_t *)&val);
}


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

x86 assembly (clang, -O2):
<proto_field_set_u8>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <proto_field_set_bytes@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.proto_hdr = type { i32 }
define void @proto_field_set_u8(%struct.proto_hdr* %0, i32 %1, i32 %2) {
%4 = alloca %struct.proto_hdr*
%5 = alloca i32
%6 = alloca i32
store %struct.proto_hdr* %0, %struct.proto_hdr** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.proto_hdr*, %struct.proto_hdr** %4
%8 = load i32, i32* %5
%9 = call i32 @proto_field_set_bytes(%struct.proto_hdr* %7, i32 %8, i32* %6)
ret void
}

LLVM IR (-O2):
%struct.proto_hdr = type { i32 }
define void @proto_field_set_u8(%struct.proto_hdr* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @proto_field_set_bytes(%struct.proto_hdr* %0, i32 %1, i32* %4)
ret void
}
int simpleArraySum(int array[6]) {
  int soma = 0;
  for (int i = 0; i < 6; i++)
    soma += array[i];
  return soma;
}


x86 assembly (clang, -O0):
<simpleArraySum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    113f <simpleArraySum+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <simpleArraySum+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simpleArraySum>:
movdqu 0x8(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    0x4(%rdi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @simpleArraySum(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 = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 6
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @simpleArraySum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = bitcast i32* %5 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %7)
%9 = add nsw i32 %8, %4
%10 = add nsw i32 %9, %2
ret i32 %10
}
void FtpInit(void) {}


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

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

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

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

/* Variables and functions */
unsigned char CLAMP0255(int32_t a) {
  return (unsigned char)((((-a) >> 31) & a) | (255 - a) >> 31);
}


x86 assembly (clang, -O0):
<CLAMP0255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    -0x4(%rbp),%eax
mov    $0xff,%ecx
sub    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CLAMP0255>:
xor    %ecx,%ecx
test   %edi,%edi
cmovns %edi,%ecx
cmp    $0xff,%ecx
mov    $0xff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @CLAMP0255(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 0, %3
%5 = ashr i32 %4, 31
%6 = load i32, i32* %2
%7 = and i32 %5, %6
%8 = load i32, i32* %2
%9 = sub nsw i32 255, %8
%10 = ashr i32 %9, 31
%11 = or i32 %7, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @CLAMP0255(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
%4 = icmp ult i32 %3, 255
%5 = select i1 %4, i32 %3, i32 255
%6 = trunc i32 %5 to i8
ret i8 %6
}
void EthernetInitExpClk(unsigned long ulBase, unsigned long ulEthClk) {
  unsigned long ulDiv;
  ;
  ulDiv = (ulEthClk / 2) / 2500000;
  (*((volatile unsigned long *)(ulBase + 0x00000024))) = (ulDiv & 0x000000FF);
}


x86 assembly (clang, -O0):
<EthernetInitExpClk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    $0x2625a0,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
and    $0xff,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetInitExpClk>:
mov    %rsi,%rax
movabs $0xd6bf94d5e57a42bd,%rcx
94 bf d6
mul    %rcx
shr    $0x16,%edx
movzbl %dl,%eax
mov    %rax,0x24(%rdi)
ret

LLVM IR (-O0):
define void @EthernetInitExpClk(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = udiv i64 %6, 2
%8 = udiv i64 %7, 2500000
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = and i64 %9, 255
%11 = load i64, i64* %3
%12 = add i64 %11, 36
%13 = inttoptr i64 %12 to i64*
store volatile i64 %10, i64* %13
ret void
}

LLVM IR (-O2):
define void @EthernetInitExpClk(i64 %0, i64 %1) {
%3 = udiv i64 %1, 5000000
%4 = and i64 %3, 255
%5 = add i64 %0, 36
%6 = inttoptr i64 %5 to i64*
store volatile i64 %4, i64* %6
ret void
}
__attribute__((always_)) void sync$fence$RDP() {}


x86 assembly (clang, -O0):
<sync$fence$RDP>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync$fence$RDP>:
ret

LLVM IR (-O0):
define void @"sync$fence$RDP"() {
ret void
}

LLVM IR (-O2):
define void @"sync$fence$RDP"() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pthread_yield();
unsigned long sched_getcpu();
int asyncos_pin_wait(unsigned long cpuid) {
  int i;
  for (i = 0; i < 10000; i++) {
    if (sched_getcpu() == cpuid) {
      return 0;
    }
    pthread_yield();
  }
  return 1;
}


x86 assembly (clang, -O0):
<asyncos_pin_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jge    1172 <asyncos_pin_wait+0x52>
mov    $0x0,%al
call   1040 <sched_getcpu@plt>
cmp    -0x10(%rbp),%rax
jne    115d <asyncos_pin_wait+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <asyncos_pin_wait+0x59>
mov    $0x0,%al
call   1030 <pthread_yield@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <asyncos_pin_wait+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asyncos_pin_wait>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x2710,%ebp
xor    %r14d,%r14d
nop
xor    %eax,%eax
call   1040 <sched_getcpu@plt>
cmp    %rbx,%rax
je     114e <asyncos_pin_wait+0x2e>
xor    %eax,%eax
call   1030 <pthread_yield@plt>
add    $0xffffffff,%ebp
jne    1130 <asyncos_pin_wait+0x10>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @asyncos_pin_wait(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10000
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = call i64 (...) @sched_getcpu()
%10 = load i64, i64* %3
%11 = icmp eq i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %19
13: ; preds = %8
%14 = call i32 (...) @pthread_yield()
br label %15
15: ; preds = %13
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
store i32 1, i32* %2
br label %19
19: ; preds = %18, %12
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @asyncos_pin_wait(i64 %0) {
br label %2
2: ; preds = %1, %6
%3 = phi i32 [ 0, %1 ], [ %8, %6 ]
%4 = tail call i64 (...) @sched_getcpu()
%5 = icmp eq i64 %4, %0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 (...) @pthread_yield()
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 10000
br i1 %9, label %10, label %2
10: ; preds = %6, %2
%11 = phi i32 [ 0, %2 ], [ 1, %6 ]
ret i32 %11
}