xunge/DecIR huggingface dataset:
cbuf1(f, n) { return (cbuf(f, n, 1)); }


x86 assembly (clang, -O0):
<cbuf1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf1>:
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf1(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 1)
ret i32 %3
}
void setupHandler() {}


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

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

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

LLVM IR (-O2):
define void @setupHandler() {
ret void
}
int test_imm_CEuint16_mem(unsigned short *val) {
  return ((*val) & (0xCE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CEuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xce,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CEuint16_mem>:
testb  $0xce,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 206
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *single_rotation_with_left(struct node *);
struct node *single_rotation_with_right(struct node *);
struct node *double_rotation_with_right(struct node *p_node) {
  p_node = single_rotation_with_right(p_node);
  return single_rotation_with_left(p_node);
}


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

x86 assembly (clang, -O2):
<double_rotation_with_right>:
push   %rax
call   1030 <single_rotation_with_right@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <single_rotation_with_left@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @double_rotation_with_right(%struct.node* %0) {
%2 = alloca %struct.node*
store %struct.node* %0, %struct.node** %2
%3 = load %struct.node*, %struct.node** %2
%4 = call %struct.node* @single_rotation_with_right(%struct.node* %3)
store %struct.node* %4, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call %struct.node* @single_rotation_with_left(%struct.node* %5)
ret %struct.node* %6
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @double_rotation_with_right(%struct.node* %0) {
%2 = tail call %struct.node* @single_rotation_with_right(%struct.node* %0)
%3 = tail call %struct.node* @single_rotation_with_left(%struct.node* %2)
ret %struct.node* %3
}
unsigned short mysetb(void) { return 0x1234; }


x86 assembly (clang, -O0):
<mysetb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysetb>:
mov    $0x1234,%ax
ret

LLVM IR (-O0):
define zeroext i16 @mysetb() {
ret i16 4660
}

LLVM IR (-O2):
define zeroext i16 @mysetb() {
ret i16 4660
}
void gtk_text_buffer_insert_at_cursor() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_insert_at_cursor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trm_chr(int /*<<< orphan*/);
void trm_str(char *str) {
  while (*str)
    trm_chr(*str++);
}


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

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

LLVM IR (-O0):
define void @trm_str(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 @trm_chr(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @trm_str(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 @trm_chr(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
}
void swap5(int *a, int *b) {
  int k = a;
  a = b;
  b = k;
}


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

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

LLVM IR (-O0):
define void @swap5(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** %3
%7 = ptrtoint i32* %6 to i32
store i32 %7, i32* %5
%8 = load i32*, i32** %4
store i32* %8, i32** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %4
ret void
}

LLVM IR (-O2):
define void @swap5(i32* nocapture %0, i32* nocapture %1) {
ret void
}
int test_imm_20int8_mem(signed char *val) {
  return ((*val) & (-0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20int8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0xffffffe0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20int8_mem>:
cmpb   $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp ult i8 %2, 32
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void cleanup_signal_handling() {}


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

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

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

LLVM IR (-O2):
define void @cleanup_signal_handling() {
ret void
}
char *rng_uid(void) { return "1f3a3ccab4d1cc0447e2f8c07f35cce7"; }


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

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

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

LLVM IR (-O2):
@.str = [33 x i8] c"1f3a3ccab4d1cc0447e2f8c07f35cce7\00"
define i8* @rng_uid() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
int log_2(int N) {
  int i;
  int log_N = 0;
  for (i = N; i > 1; i >>= 1) {
    log_N++;
  }
  return log_N;
}


x86 assembly (clang, -O0):
<log_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1135 <log_2+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <log_2+0x14>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_2>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     111c <log_2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log_2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log_2(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ugt i32 %5, 3
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
void *swap_byte4(long *theInt) {
  char tmp[4];
  int i;
  for (i = 0; i < sizeof(long); i++)
    tmp[i] = *((char *)theInt + (sizeof(long) - 1 - i));
  *theInt = *((long *)tmp);
}


x86 assembly (clang, -O0):
<swap_byte4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
cmp    $0x8,%rax
jae    1146 <swap_byte4+0x46>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rdx
mov    $0x7,%ecx
sub    %rdx,%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0x14(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    110f <swap_byte4+0xf>
mov    -0x14(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_byte4>:
mov    0x4(%rdi),%eax
shl    $0x20,%rax
bswap  %rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define noalias i8* @swap_byte4(i64* nocapture %0) {
%2 = bitcast i64* %0 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 7
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %2, i64 6
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %2, i64 5
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %2, i64 4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i64
%12 = shl nuw nsw i64 %11, 24
%13 = zext i8 %8 to i64
%14 = shl nuw nsw i64 %13, 16
%15 = or i64 %12, %14
%16 = zext i8 %6 to i64
%17 = shl nuw nsw i64 %16, 8
%18 = or i64 %15, %17
%19 = zext i8 %4 to i64
%20 = or i64 %18, %19
store i64 %20, i64* %0
ret i8* undef
}
void g_utf8_pointer_to_offset() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_pointer_to_offset() {
ret void
}
int subtract(int op1, int op2) { return op1 - op2; }


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

x86 assembly (clang, -O2):
<subtract>:
mov    %edi,%eax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @subtract(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 nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @subtract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
unsigned long long word_hash(char const *, int);
unsigned long long searchy_word_hash(const char *str, int len) {
  unsigned long long h = word_hash(str, len);
  h &= 0x7fffffffffffffffULL;
  if (*str != 0x1f) {
    h |= 0x8000000000000000ULL;
  }
  return h;
}


x86 assembly (clang, -O0):
<searchy_word_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <word_hash@plt>
mov    %rax,-0x18(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1f,%eax
je     1163 <searchy_word_hash+0x53>
movabs $0x8000000000000000,%rax
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchy_word_hash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <word_hash@plt>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
add    $0x1,%rcx
xor    %edx,%edx
cmpb   $0x1f,(%rbx)
cmovne %rcx,%rdx
or     %rdx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @searchy_word_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i64 @word_hash(i8* %6, i32 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = and i64 %9, 9223372036854775807
store i64 %10, i64* %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 31
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load i64, i64* %5
%17 = or i64 %16, -9223372036854775808
store i64 %17, i64* %5
br label %18
18: ; preds = %15, %2
%19 = load i64, i64* %5
ret i64 %19
}

LLVM IR (-O2):
define i64 @searchy_word_hash(i8* %0, i32 %1) {
%3 = tail call i64 @word_hash(i8* %0, i32 %1)
%4 = and i64 %3, 9223372036854775807
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 31
%7 = select i1 %6, i64 0, i64 -9223372036854775808
%8 = or i64 %7, %4
ret i64 %8
}
void i2t_ASN1_OBJECT(void) {}


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

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

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

LLVM IR (-O2):
define void @i2t_ASN1_OBJECT() {
ret void
}
void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy,
                             struct ath_rx_stats *rxstats) {}


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

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

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

LLVM IR (-O2):
%struct.dentry = type opaque
%struct.ath_rx_stats = type opaque
define void @ath9k_cmn_debug_phy_err(%struct.dentry* nocapture %0, %struct.ath_rx_stats* nocapture %1) {
ret void
}
int fn8(int a, int b, int m) { return (b & m) | (~m & a); }


x86 assembly (clang, -O0):
<fn8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x4(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn8>:
mov    %esi,%eax
xor    %edi,%eax
and    %edx,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fn8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = and i32 %7, %8
%10 = load i32, i32* %6
%11 = xor i32 %10, -1
%12 = load i32, i32* %4
%13 = and i32 %11, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @fn8(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, %1
%5 = xor i32 %2, -1
%6 = and i32 %5, %0
%7 = or i32 %4, %6
ret i32 %7
}
int test_imm_CCuint32_mem(unsigned int *val) {
  return ((*val) & (0xCC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CCuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xcc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CCuint32_mem>:
testb  $0xcc,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_CCuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 204
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("hello word!\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello word!\0A\00"
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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"hello word!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ GetCurrentThreadId();
unsigned long pthread_self() { return (unsigned long)GetCurrentThreadId(); }


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

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

LLVM IR (-O0):
define i64 @pthread_self() {
%1 = call i64 (...) @GetCurrentThreadId()
ret i64 %1
}

LLVM IR (-O2):
define i64 @pthread_self() {
%1 = tail call i64 (...) @GetCurrentThreadId()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ set_callback_random(char *, int, int);
void main(void) { set_callback_random("duck", 3000, 8000); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0xbb8,%esi
mov    $0x1f40,%edx
call   1030 <set_callback_random@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0xbb8,%esi
mov    $0x1f40,%edx
jmp    1030 <set_callback_random@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"duck\00"
define void @main() {
%1 = call i32 @set_callback_random(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3000, i32 8000)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"duck\00"
define void @main() {
%1 = tail call i32 @set_callback_random(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3000, i32 8000)
ret void
}
unsigned mexpdrv_num_passes(const unsigned batch_size) {
  unsigned num_passes = batch_size / 16 + (batch_size % 16 ? 1 : 0);
  return num_passes;
}


x86 assembly (clang, -O0):
<mexpdrv_num_passes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
mov    -0x4(%rbp),%esi
and    $0xf,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mexpdrv_num_passes>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%edi
cmp    $0x1,%edi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @mexpdrv_num_passes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 16
%6 = load i32, i32* %2
%7 = urem i32 %6, 16
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = add i32 %5, %10
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @mexpdrv_num_passes(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %0, 15
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
ret i32 %6
}
void I420ToYUY2() {}


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

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

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

LLVM IR (-O2):
define void @I420ToYUY2() {
ret void
}
int gcd(int a, int b) {
  int m;
  if (a > b) {
    m = a % b;
    if (m == 0)
      return b;
    return gcd(m, b);
  } else {
    m = b % a;
    if (m == 0)
      return a;
    return gcd(m, a);
  }
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115c <gcd+0x4c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1149 <gcd+0x39>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <gcd+0x79>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1189 <gcd+0x79>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    117b <gcd+0x6b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1189 <gcd+0x79>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%edx
mov    %edx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %esi,%ecx
jle    1130 <gcd+0x30>
mov    %ecx,%eax
cltd
idiv   %esi
mov    %edx,%ecx
test   %edx,%edx
jne    1110 <gcd+0x10>
jmp    113e <gcd+0x3e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %esi,%eax
cltd
idiv   %ecx
mov    %ecx,%esi
test   %edx,%edx
jne    1102 <gcd+0x2>
mov    %ecx,%eax
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = srem i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = load i32, i32* %5
store i32 %17, i32* %3
br label %34
18: ; preds = %10
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = call i32 @gcd(i32 %19, i32 %20)
store i32 %21, i32* %3
br label %34
22: ; preds = %2
%23 = load i32, i32* %5
%24 = load i32, i32* %4
%25 = srem i32 %23, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = load i32, i32* %4
store i32 %29, i32* %3
br label %34
30: ; preds = %22
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = call i32 @gcd(i32 %31, i32 %32)
store i32 %33, i32* %3
br label %34
34: ; preds = %30, %28, %18, %16
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %12, %2
%4 = phi i32 [ %13, %12 ], [ %0, %2 ]
%5 = phi i32 [ %7, %12 ], [ %1, %2 ]
br label %6
6: ; preds = %3, %9
%7 = phi i32 [ %10, %9 ], [ %4, %3 ]
%8 = icmp sgt i32 %7, %5
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = srem i32 %7, %5
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %6
12: ; preds = %6
%13 = srem i32 %5, %7
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %3
15: ; preds = %12, %9
%16 = phi i32 [ %5, %9 ], [ %7, %12 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int f(int);
int main(void) {
  int y = 42;
  y = f(42);
  assert(y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <f@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 42, i32* %2
%3 = call i32 @f(i32 42)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 42)
%2 = tail call i32 @assert(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double tanh(double);
double TangenteHiperbolico(double x) {
  printf("Enter a number: ");
  scanf("%lf", &x);
  return (tanh(x));
}


x86 assembly (clang, -O0):
<TangenteHiperbolico>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TangenteHiperbolico>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
call   1030 <tanh@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @TangenteHiperbolico(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @tanh(double %5)
ret double %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @TangenteHiperbolico(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = call double @tanh(double %5)
ret double %6
}
double vlistInqVarDblKey(int vlistID, int varID, const char *name) {
  double value = 0;
  (void)vlistID;
  (void)varID;
  (void)name;
  return value;
}


x86 assembly (clang, -O0):
<vlistInqVarDblKey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlistInqVarDblKey>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @vlistInqVarDblKey(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
store double 0.000000e+00, double* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load double, double* %7
ret double %11
}

LLVM IR (-O2):
define double @vlistInqVarDblKey(i32 %0, i32 %1, i8* nocapture readnone %2) {
ret double 0.000000e+00
}
void test_PTHREAD_MUTEX_DEFAULT(void) { int dummy = "PTHREAD_MUTEX_DEFAULT"; }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"PTHREAD_MUTEX_DEFAULT\00"
define void @test_PTHREAD_MUTEX_DEFAULT() {
%1 = alloca i32
store i32 ptrtoint ([22 x i8]* @.str to i32), i32* %1
ret void
}

LLVM IR (-O2):
define void @test_PTHREAD_MUTEX_DEFAULT() {
ret void
}
void foo$$1(struct _Data$$1 *this$1) { printf("X\n"); }


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

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

LLVM IR (-O0):
%"struct._Data$$1" = type opaque
@.str = [3 x i8] c"X\0A\00"
define void @"foo$$1"(%"struct._Data$$1"* %0) {
%2 = alloca %"struct._Data$$1"*
store %"struct._Data$$1"* %0, %"struct._Data$$1"** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%"struct._Data$$1" = type opaque
@str = [2 x i8] c"X\00"
define void @"foo$$1"(%"struct._Data$$1"* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
void ft_get_values(char **data, char **dest, char **src, char **n) {
  *dest = data[0];
  *src = data[1];
  *n = data[2];
}


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

x86 assembly (clang, -O2):
<ft_get_values>:
mov    (%rdi),%rax
mov    %rax,(%rsi)
mov    0x8(%rdi),%rax
mov    %rax,(%rdx)
mov    0x10(%rdi),%rax
mov    %rax,(%rcx)
ret

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

LLVM IR (-O2):
define void @ft_get_values(i8** nocapture %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3) {
%5 = load i8*, i8** %0
store i8* %5, i8** %1
%6 = getelementptr inbounds i8*, i8** %0, i64 1
%7 = load i8*, i8** %6
store i8* %7, i8** %2
%8 = getelementptr inbounds i8*, i8** %0, i64 2
%9 = load i8*, i8** %8
store i8* %9, i8** %3
ret void
}
char *Sys_FindFirst(char *path, unsigned musthave, unsigned canthave) {
  return ((void *)0);
}


x86 assembly (clang, -O0):
<Sys_FindFirst>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @Sys_FindFirst(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ inl(unsigned int);
unsigned long le32_to_cpu(int /*<<< orphan*/);
unsigned long nsp32_read4(unsigned int base, unsigned int index) {
  return le32_to_cpu(inl(base + index));
}


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

x86 assembly (clang, -O2):
<nsp32_read4>:
push   %rax
add    %esi,%edi
call   1030 <inl@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <le32_to_cpu@plt>

LLVM IR (-O0):
define i64 @nsp32_read4(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 = add i32 %5, %6
%8 = call i32 @inl(i32 %7)
%9 = call i64 @le32_to_cpu(i32 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @nsp32_read4(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call i32 @inl(i32 %3)
%5 = tail call i64 @le32_to_cpu(i32 %4)
ret i64 %5
}
void rop3_219_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_219_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_219_1_0>:
xor    %esi,%edx
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
and    %dl,%cl
or     %sil,%cl
not    %cl
and    %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_219_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = trunc i32 %30 to i8
store i8 %31, i8* %7
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %5
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i8*, i8** %4
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = and i32 %40, %42
%44 = or i32 %37, %43
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %4
store i8 %45, i8* %46
ret void
}

LLVM IR (-O2):
define void @rop3_219_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = and i8 %6, %4
%8 = or i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %5, %1
%11 = or i8 %10, %9
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int compareInt(void *key1P, void *key2P) {
  assert(key1P);
  assert(key2P);
  int *value1P = (int *)key1P;
  int *value2P = (int *)key2P;
  if ((*value1P) == (*value2P))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<compareInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1160 <compareInt+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <compareInt+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareInt>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %r14,%rdi
call   1030 <assert@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @compareInt(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = bitcast i8* %0 to i32*
%6 = bitcast i8* %1 to i32*
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int RAND_MAX;
int /*<<< orphan*/ SeedRand(int);
long lround(int);
int rand();
long RandomInRange(long Lowest, long Highest, int Seed) {
  SeedRand(Seed);
  return (Lowest +
          lround((rand() - 1) / (double)(RAND_MAX - 1) * (Highest - Lowest)));
}


x86 assembly (clang, -O0):
<RandomInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <SeedRand@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <lround@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInRange>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%edi
call   1040 <SeedRand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm0
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
add    $0xffffffff,%eax
cvtsi2sd %eax,%xmm1
sub    %r14,%rbx
cvtsi2sd %rbx,%xmm2
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <lround@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i64 @RandomInRange(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 = call i32 @SeedRand(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 (...) @rand()
%11 = sub nsw i32 %10, 1
%12 = sitofp i32 %11 to double
%13 = load i32, i32* @RAND_MAX
%14 = sub nsw i32 %13, 1
%15 = sitofp i32 %14 to double
%16 = fdiv double %12, %15
%17 = load i64, i64* %5
%18 = load i64, i64* %4
%19 = sub nsw i64 %17, %18
%20 = sitofp i64 %19 to double
%21 = fmul double %16, %20
%22 = fptosi double %21 to i32
%23 = call i64 @lround(i32 %22)
%24 = add nsw i64 %9, %23
ret i64 %24
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i64 @RandomInRange(i64 %0, i64 %1, i32 %2) {
%4 = tail call i32 @SeedRand(i32 %2)
%5 = tail call i32 (...) @rand()
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to double
%8 = load i32, i32* @RAND_MAX
%9 = add nsw i32 %8, -1
%10 = sitofp i32 %9 to double
%11 = fdiv double %7, %10
%12 = sub nsw i64 %1, %0
%13 = sitofp i64 %12 to double
%14 = fmul double %11, %13
%15 = fptosi double %14 to i32
%16 = tail call i64 @lround(i32 %15)
%17 = add nsw i64 %16, %0
ret i64 %17
}
/* Variables and functions */
long errno;
long __syscall_ret(unsigned long r) {
  if (r >= (unsigned long)-1 - 4096) {
    errno = -(long)r;
    return -1;
  }
  return (long)r;
}


x86 assembly (clang, -O0):
<__syscall_ret>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0xffffffffffffefff,-0x10(%rbp)
ff
jb     1135 <__syscall_ret+0x35>
xor    %eax,%eax
mov    %eax,%ecx
sub    -0x10(%rbp),%rcx
mov    0x2ebb(%rip),%rax
mov    %rcx,(%rax)
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    113d <__syscall_ret+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall_ret>:
mov    %rdi,%rax
cmp    $0xffffffffffffefff,%rdi
jb     1120 <__syscall_ret+0x20>
neg    %rax
mov    0x2eca(%rip),%rcx
mov    %rax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
@errno = global i64 0
define i64 @__syscall_ret(i64 %0) {
%2 = icmp ugt i64 %0, -4098
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = sub nsw i64 0, %0
store i64 %4, i64* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ -1, %3 ], [ %0, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/"
             "heads/master/src/.libs/lt-debug-helper.c",
             332, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x14c,%esi
lea    0xf4e(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf69(%rip),%rdx
mov    $0x14c,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/heads/master/src/.libs/lt-debug-helper.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/heads/master/src/.libs/lt-debug-helper.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
unsigned char sizeLZ(int n) {
  if (n > 2047)
    return 12;
  else if (n > 1023)
    return 11;
  else if (n > 511)
    return 10;
  else
    return 9;
}


x86 assembly (clang, -O0):
<sizeLZ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7ff,-0x8(%rbp)
jle    111d <sizeLZ+0x1d>
movb   $0xc,-0x1(%rbp)
jmp    114d <sizeLZ+0x4d>
cmpl   $0x3ff,-0x8(%rbp)
jle    1133 <sizeLZ+0x33>
movb   $0xb,-0x1(%rbp)
jmp    114d <sizeLZ+0x4d>
cmpl   $0x1ff,-0x8(%rbp)
jle    1149 <sizeLZ+0x49>
movb   $0xa,-0x1(%rbp)
jmp    114d <sizeLZ+0x4d>
movb   $0x9,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeLZ>:
mov    $0xc,%al
cmp    $0x7ff,%edi
jg     111f <sizeLZ+0x1f>
mov    $0xb,%al
cmp    $0x3ff,%edi
jg     111f <sizeLZ+0x1f>
cmp    $0x200,%edi
setge  %al
add    $0x9,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @sizeLZ(i32 %0) {
%2 = icmp sgt i32 %0, 2047
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 1023
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 511
%7 = select i1 %6, i8 10, i8 9
br label %8
8: ; preds = %5, %3, %1
%9 = phi i8 [ 12, %1 ], [ 11, %3 ], [ %7, %5 ]
ret i8 %9
}