xunge/DecIR huggingface dataset:
int pat_strcmp_prefix(char *s1, char *s2) {
  for (;;) {
    if (*s2 == '\t')
      return 1;
    if (*s1++ != *s2++)
      return 0;
  }
}


x86 assembly (clang, -O0):
<pat_strcmp_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1128 <pat_strcmp_prefix+0x28>
movl   $0x1,-0x4(%rbp)
jmp    1165 <pat_strcmp_prefix+0x65>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1160 <pat_strcmp_prefix+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1165 <pat_strcmp_prefix+0x65>
jmp    110c <pat_strcmp_prefix+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pat_strcmp_prefix>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
cmp    $0x9,%cl
je     1128 <pat_strcmp_prefix+0x28>
lea    0x1(%rax),%rdx
cmp    %cl,(%rdi,%rax,1)
mov    %rdx,%rax
je     1110 <pat_strcmp_prefix+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @pat_strcmp_prefix(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 9
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %8, %3
%14 = phi i32 [ 1, %3 ], [ 0, %8 ]
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
void bound_uint16(uint16_t *number, uint16_t max, uint16_t min) {
  if (*number > max)
    *number = max;
  else if (*number < min)
    *number = min;
}


x86 assembly (clang, -O0):
<bound_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jle    1131 <bound_uint16+0x31>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1152 <bound_uint16+0x52>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jge    114d <bound_uint16+0x4d>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1152 <bound_uint16+0x52>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound_uint16>:
mov    (%rdi),%rax
cmp    %rsi,%rax
jg     1110 <bound_uint16+0x10>
mov    %rdx,%rsi
cmp    %rdx,%rax
jge    1113 <bound_uint16+0x13>
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @bound_uint16(i64* nocapture %0, i64 %1, i64 %2) {
%4 = load i64, i64* %0
%5 = icmp sgt i64 %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = icmp slt i64 %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi i64 [ %1, %3 ], [ %2, %6 ]
store i64 %9, i64* %0
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addr_of_char(unsigned char);
int /*<<< orphan*/ write(int, int /*<<< orphan*/, int);
void console_tx_byte(unsigned char ch) { write(1, addr_of_char(ch), 1); }


x86 assembly (clang, -O0):
<console_tx_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <addr_of_char@plt>
mov    %eax,%esi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_tx_byte>:
push   %rax
call   1040 <addr_of_char@plt>
mov    $0x1,%edi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @console_tx_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @addr_of_char(i8 zeroext %3)
%5 = call i32 @write(i32 1, i32 %4, i32 1)
ret void
}

LLVM IR (-O2):
define void @console_tx_byte(i8 zeroext %0) {
%2 = tail call i32 @addr_of_char(i8 zeroext %0)
%3 = tail call i32 @write(i32 1, i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sort_a_opcode_table();
int /*<<< orphan*/ sort_i_opcode_table();
int /*<<< orphan*/ sort_name_table();
void initialize_inst_tables() {
  sort_name_table();
  sort_i_opcode_table();
  sort_a_opcode_table();
}


x86 assembly (clang, -O0):
<initialize_inst_tables>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <sort_name_table@plt>
mov    $0x0,%al
call   1030 <sort_i_opcode_table@plt>
mov    $0x0,%al
call   1040 <sort_a_opcode_table@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_inst_tables>:
push   %rax
xor    %eax,%eax
call   1050 <sort_name_table@plt>
xor    %eax,%eax
call   1030 <sort_i_opcode_table@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sort_a_opcode_table@plt>

LLVM IR (-O0):
define void @initialize_inst_tables() {
%1 = call i32 (...) @sort_name_table()
%2 = call i32 (...) @sort_i_opcode_table()
%3 = call i32 (...) @sort_a_opcode_table()
ret void
}

LLVM IR (-O2):
define void @initialize_inst_tables() {
%1 = tail call i32 (...) @sort_name_table()
%2 = tail call i32 (...) @sort_i_opcode_table()
%3 = tail call i32 (...) @sort_a_opcode_table()
ret void
}
/* Variables and functions */
bool ibetween(int x, int lower, int upper) {
  return ((x - lower) <= (upper - lower));
}


x86 assembly (clang, -O0):
<ibetween>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibetween>:
xor    %eax,%eax
cmp    %edx,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @ibetween(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* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
%13 = icmp sle i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @ibetween(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %0, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ is_hostaddr(char const *);
int /*<<< orphan*/ is_hostname(char const *);
int /*<<< orphan*/ usage(char *, char const *);
void getopt_host(const char *optarg, const char **hostname) {
  if (!is_hostname(optarg) && !is_hostaddr(optarg))
    usage("Illegal host argument '%s'.", optarg);
  *hostname = optarg;
}


x86 assembly (clang, -O0):
<getopt_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_hostname@plt>
cmp    $0x0,%eax
jne    1174 <getopt_host+0x44>
mov    -0x8(%rbp),%rdi
call   1040 <is_hostaddr@plt>
cmp    $0x0,%eax
jne    1174 <getopt_host+0x44>
mov    -0x8(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1050 <usage@plt>
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt_host>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <is_hostname@plt>
test   %eax,%eax
jne    115e <getopt_host+0x2e>
mov    %rbx,%rdi
call   1040 <is_hostaddr@plt>
test   %eax,%eax
jne    115e <getopt_host+0x2e>
lea    0xeaa(%rip),%rdi
mov    %rbx,%rsi
call   1050 <usage@plt>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Illegal host argument '%s'.\00"
define void @getopt_host(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = call i32 @is_hostname(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %15, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i32 @is_hostaddr(i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = call i32 @usage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %8, %2
%16 = load i8*, i8** %3
%17 = load i8**, i8*** %4
store i8* %16, i8** %17
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Illegal host argument '%s'.\00"
define void @getopt_host(i8* %0, i8** nocapture writeonly %1) {
%3 = tail call i32 @is_hostname(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @is_hostaddr(i8* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @usage(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %5, %2
store i8* %0, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ japi_fillcircle(int, int, int, int);
void j_fillcircle(int arg0, int arg1, int arg2, int arg3) {
  japi_fillcircle(arg0, arg1, arg2, arg3);
}


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

x86 assembly (clang, -O2):
<j_fillcircle>:
jmp    1030 <japi_fillcircle@plt>

LLVM IR (-O0):
define void @j_fillcircle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @japi_fillcircle(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @j_fillcircle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @japi_fillcircle(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void stub1();
void print_available_subflags(char *program, char *prefix, void (*flags)()) {
  fprintf(stderr, "Available %s flags (prefixed with --%s-) are:\n\n", program,
          prefix);
  (*flags)();
}


x86 assembly (clang, -O0):
<print_available_subflags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   *-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_available_subflags>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
mov    %rbx,%rcx
pop    %rbx
jmp    *%rcx

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Available %s flags (prefixed with --%s-) are:\0A\0A\00"
define void @print_available_subflags(i8* %0, i8* %1, void (...)* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca void (...)*
store i8* %0, i8** %4
store i8* %1, i8** %5
store void (...)* %2, void (...)** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load void (...)*, void (...)** %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Available %s flags (prefixed with --%s-) are:\0A\0A\00"
define void @print_available_subflags(i8* %0, i8* %1, void (...)* nocapture %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
tail call void (...) %2()
ret void
}
imm0indreg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    $0x16,%eax
cmp    (%rcx),%eax
jg     1135 <imm0indreg1+0x35>
movl   $0x1,-0x4(%rbp)
jmp    113c <imm0indreg1+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0indreg1>:
xor    %eax,%eax
cmpl   $0x16,(%r9)
setge  %al
ret

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

LLVM IR (-O2):
define i32 @imm0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = load i32, i32* %5
%8 = icmp sgt i32 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
long double __tgammal_r(long double, int *);
long double tgammal(long double x) {
  int local_sgngaml = 0;
  return (__tgammal_r(x, &local_sgngaml));
}


x86 assembly (clang, -O0):
<tgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movl   $0x0,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    -0x14(%rbp),%rdi
call   1030 <__tgammal_r@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgammal>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
movl   $0x0,0x14(%rsp)
fstpt  (%rsp)
lea    0x14(%rsp),%rdi
call   1030 <__tgammal_r@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @tgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
store x86_fp80 %0, x86_fp80* %2
store i32 0, i32* %3
%4 = load x86_fp80, x86_fp80* %2
%5 = call x86_fp80 @__tgammal_r(x86_fp80 %4, i32* %3)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @tgammal(x86_fp80 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call x86_fp80 @__tgammal_r(x86_fp80 %0, i32* %2)
ret x86_fp80 %4
}
signed long long signedlonglong_ignoring_signedlongint(signed long long x,
                                                       signed long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlonglong_ignoring_signedlongint>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *thread_entry(void *p __attribute__((unused))) {
  printf("pthread_self()=%lu\n", pthread_self());
  return NULL;
}


x86 assembly (clang, -O0):
<thread_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_entry>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"pthread_self()=%lu\0A\00"
define i8* @thread_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [20 x i8] c"pthread_self()=%lu\0A\00"
define noalias i8* @thread_entry(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* null
}
void do_id(void) {}


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

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

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

LLVM IR (-O2):
define void @do_id() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int A[1024];
  int i;
  for (i = 0; A[i] != 0; i++) {
    if (i >= 1024) {
      break;
    }
  }
  __VERIFIER_assert(i <= 1024);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1014(%rbp)
movslq -0x1014(%rbp),%rax
cmpl   $0x0,-0x1010(%rbp,%rax,4)
je     116f <main+0x5f>
cmpl   $0x400,-0x1014(%rbp)
jl     1156 <main+0x46>
jmp    116f <main+0x5f>
jmp    115b <main+0x4b>
mov    -0x1014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1014(%rbp)
jmp    112c <main+0x1c>
cmpl   $0x400,-0x1014(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x1020,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %15, %0
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [1024 x i32], [1024 x i32]* %2, i64 0, i64 %6
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %4
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 1024
br i1 %12, label %13, label %14
13: ; preds = %10
br label %18
14: ; preds = %10
br label %15
15: ; preds = %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %13, %4
%19 = load i32, i32* %3
%20 = icmp sle i32 %19, 1024
%21 = zext i1 %20 to i32
%22 = call i32 @__VERIFIER_assert(i32 %21)
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
/* Variables and functions */
int Q_log2(int val) {
  int answer;
  answer = 0;
  while ((val >>= 1) != 0) {
    answer++;
  }
  return answer;
}


x86 assembly (clang, -O0):
<Q_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <Q_log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Q_log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Q_log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
extern int GetScreenBpp() {
  int retval;
  __asm__ __volatile__("int $0x40" : "=a"(retval) : "a"(61), "b"(2));
  return retval;
}


x86 assembly (clang, -O0):
<GetScreenBpp>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x3d,%eax
mov    $0x2,%ebx
int    $0x40
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetScreenBpp>:
push   %rbx
mov    $0x3d,%eax
mov    $0x2,%ebx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetScreenBpp() {
%1 = alloca i32
%2 = call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 61, i32 2)
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @GetScreenBpp() {
%1 = tail call i32 asm sideeffect "int $$0x40", "={ax},{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 61, i32 2)
ret i32 %1
}
int dmp_tm_edit_config(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmp_tm_edit_config() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void error_msg(void) {
  printf("\nUsage: Enter positive integers as arguments.\n\n");
  exit(EXIT_FAILURE);
}


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

x86 assembly (clang, -O2):
<error_msg>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"\0AUsage: Enter positive integers as arguments.\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @error_msg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [47 x i8] c"\0AUsage: Enter positive integers as arguments.\0A\00"
define void @error_msg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int test_imm_C3uint8_reg(unsigned char val) {
  return ((val) & (0xC3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C3uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xc3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C3uint8_reg>:
test   $0xc3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 195
%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_C3uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -61
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long myWriteSector(struct Device *dev, long n, int size, unsigned char *buf) {
  return 0;
}


x86 assembly (clang, -O0):
<myWriteSector>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Device = type opaque
define i64 @myWriteSector(%struct.Device* %0, i64 %1, i32 %2, i8* %3) {
%5 = alloca %struct.Device*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store %struct.Device* %0, %struct.Device** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
ret i64 0
}

LLVM IR (-O2):
%struct.Device = type opaque
define i64 @myWriteSector(%struct.Device* nocapture readnone %0, i64 %1, i32 %2, i8* nocapture readnone %3) {
ret i64 0
}
char testchar(void) { return (char)-1; }


x86 assembly (clang, -O0):
<testchar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xff,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testchar>:
mov    $0xff,%al
ret

LLVM IR (-O0):
define signext i8 @testchar() {
ret i8 -1
}

LLVM IR (-O2):
define signext i8 @testchar() {
ret i8 -1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void usage(void) {
  puts("Usage: sbot [-n nick] [-c channel (required)] [-h host (required)] [-p "
       "port]");
}


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

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

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: sbot [-n nick] [-c channel (required)] [-h host (required)] [-p port]\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: sbot [-n nick] [-c channel (required)] [-h host (required)] [-p port]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
ret void
}
double trio_nzero(void) {
  volatile double zero = 0.0;
  return -zero;
}


x86 assembly (clang, -O0):
<trio_nzero>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_nzero>:
movq   $0x0,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
xorps  0xeea(%rip),%xmm0
ret

LLVM IR (-O0):
define double @trio_nzero() {
%1 = alloca double
store volatile double 0.000000e+00, double* %1
%2 = load volatile double, double* %1
%3 = fneg double %2
ret double %3
}

LLVM IR (-O2):
define double @trio_nzero() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 0.000000e+00, double* %1
%3 = load volatile double, double* %1
%4 = fneg double %3
ret double %4
}
int mt_get_thread_index(void) {
  int ti;
  ti = 0;
  return ti;
}


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

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

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

LLVM IR (-O2):
define i32 @mt_get_thread_index() {
ret i32 0
}
void foo820() {}


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

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

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

LLVM IR (-O2):
define void @foo820() {
ret void
}
int gb_random_range_int(int min_inc, int max_inc) {
  static unsigned int random_value = 0xdeadbeef;
  unsigned int diff, result;
  random_value = random_value * 2147001325 + 715136305;
  diff = max_inc - min_inc + 1;
  result = random_value % diff;
  result += min_inc;
  return result;
}


x86 assembly (clang, -O0):
<gb_random_range_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x7ff8a3ed,0x2f0c(%rip),%eax
a3 f8 7f
add    $0x2aa01d31,%eax
mov    %eax,0x2f01(%rip)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    0x2eef(%rip),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_random_range_int>:
imul   $0x7ff8a3ed,0x2f16(%rip),%eax
a3 f8 7f
add    $0x2aa01d31,%eax
mov    %eax,0x2f0b(%rip)
sub    %edi,%esi
add    $0x1,%esi
xor    %edx,%edx
div    %esi
lea    (%rdx,%rdi,1),%eax
ret

LLVM IR (-O0):
@gb_random_range_int.random_value = internal global i32 -559038737
define i32 @gb_random_range_int(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* @gb_random_range_int.random_value
%8 = mul i32 %7, 2147001325
%9 = add i32 %8, 715136305
store i32 %9, i32* @gb_random_range_int.random_value
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* @gb_random_range_int.random_value
%15 = load i32, i32* %5
%16 = urem i32 %14, %15
store i32 %16, i32* %6
%17 = load i32, i32* %3
%18 = load i32, i32* %6
%19 = add i32 %18, %17
store i32 %19, i32* %6
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
@gb_random_range_int.random_value = internal unnamed_addr global i32 -559038737
define i32 @gb_random_range_int(i32 %0, i32 %1) {
%3 = load i32, i32* @gb_random_range_int.random_value
%4 = mul i32 %3, 2147001325
%5 = add i32 %4, 715136305
store i32 %5, i32* @gb_random_range_int.random_value
%6 = sub i32 1, %0
%7 = add i32 %6, %1
%8 = urem i32 %5, %7
%9 = add i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int strcmp(char *, char *);
int main(int argc, char **argv) { return strcmp("incorrect", "correct"); }


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
lea    0xece(%rip),%rsi
call   1030 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"incorrect\00"
@.str.1 = [8 x i8] c"correct\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 @strcmp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
void debug_dump_hw(void) {}


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

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

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

LLVM IR (-O2):
define void @debug_dump_hw() {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t i;
  for (i = 0; s[i]; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1138 <strlen+0x38>
jmp    1127 <strlen+0x27>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %4
br label %11
11: ; preds = %10
%12 = load i64, i64* %3
%13 = add i64 %12, 1
store i64 %13, i64* %3
br label %4
14: ; preds = %4
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int memcmp(void *, void *, size_t);
int compare(void *element1, void *element2, size_t element_size) {
  return memcmp(element1, element2, element_size);
}


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

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <memcmp@plt>

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @memcmp(i8* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_pipe(void) {
  printf("\npipe is represented by '|'");
  printf("\nplease separate pipe with spaces");
  printf("\nfor any problem contact amrit kumar at amritkrs@gmail.com\n");
}


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

x86 assembly (clang, -O2):
<help_pipe>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
call   1040 <printf@plt>
lea    0xefe(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0Apipe is represented by '|'\00"
@.str.1 = [34 x i8] c"\0Aplease separate pipe with spaces\00"
@.str.2 = [60 x i8] c"\0Afor any problem contact amrit kumar at amritkrs@gmail.com\0A\00"
define void @help_pipe() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0Apipe is represented by '|'\00"
@.str.1 = [34 x i8] c"\0Aplease separate pipe with spaces\00"
@str = [59 x i8] c"\0Afor any problem contact amrit kumar at amritkrs@gmail.com\00"
define void @help_pipe() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int isfdtype(int fildes, int fdtype) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<isfdtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfdtype>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @isfdtype(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
int msm_fsusb_remote_dev_disconnected(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_fsusb_remote_dev_disconnected() {
ret i32 0
}
int fun1358() { return 1358; }


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

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

LLVM IR (-O0):
define i32 @fun1358() {
ret i32 1358
}

LLVM IR (-O2):
define i32 @fun1358() {
ret i32 1358
}
/* Variables and functions */
int /*<<< orphan*/ EFAULT;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int socketpair(int domain, int type, int protocol, int *rsv) {
  if (!rsv) {
    errno = EFAULT;
    return -1;
  }
  rsv[0] = -1;
  rsv[1] = -1;
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<socketpair>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113a <socketpair+0x3a>
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea4(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <socketpair+0x68>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x18(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
mov    0x2e8a(%rip),%rax
mov    (%rax),%ecx
mov    0x2e71(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<socketpair>:
test   %rcx,%rcx
je     1115 <socketpair+0x15>
movq   $0xffffffffffffffff,(%rcx)
mov    0x2ecd(%rip),%rax
jmp    111c <socketpair+0x1c>
mov    0x2edc(%rip),%rax
mov    (%rax),%eax
mov    0x2eab(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EFAULT = global i32 0
@errno = global i32 0
@ENOSYS = global i32 0
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
%10 = load i32*, i32** %9
%11 = icmp ne i32* %10, null
br i1 %11, label %14, label %12
12: ; preds = %4
%13 = load i32, i32* @EFAULT
store i32 %13, i32* @errno
store i32 -1, i32* %5
br label %20
14: ; preds = %4
%15 = load i32*, i32** %9
%16 = getelementptr inbounds i32, i32* %15, i64 0
store i32 -1, i32* %16
%17 = load i32*, i32** %9
%18 = getelementptr inbounds i32, i32* %17, i64 1
store i32 -1, i32* %18
%19 = load i32, i32* @ENOSYS
store i32 %19, i32* @errno
store i32 -1, i32* %5
br label %20
20: ; preds = %14, %12
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
@EFAULT = global i32 0
@errno = global i32 0
@ENOSYS = global i32 0
define i32 @socketpair(i32 %0, i32 %1, i32 %2, i32* writeonly %3) {
%5 = icmp eq i32* %3, null
br i1 %5, label %8, label %6
6: ; preds = %4
store i32 -1, i32* %3
%7 = getelementptr inbounds i32, i32* %3, i64 1
store i32 -1, i32* %7
br label %8
8: ; preds = %4, %6
%9 = phi i32* [ @ENOSYS, %6 ], [ @EFAULT, %4 ]
%10 = load i32, i32* %9
store i32 %10, i32* @errno
ret i32 -1
}
int test_imm_4Bint64_lowword_mem(long long *val) {
  return ((*val) & (0x4B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_4Bint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 75
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void *target_get_scratch_address(void) { return ((void *)0x80200000); }


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

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

LLVM IR (-O0):
define i8* @target_get_scratch_address() {
ret i8* inttoptr (i64 2149580800 to i8*)
}

LLVM IR (-O2):
define i8* @target_get_scratch_address() {
ret i8* inttoptr (i64 2149580800 to i8*)
}
void ft_strclr(char *s) {
  if (!(s))
    return;
  while (*s)
    *s++ = '\0';
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <ft_strclr+0x18>
jmp    1141 <ft_strclr+0x41>
jmp    111d <ft_strclr+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <ft_strclr+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    111d <ft_strclr+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return ('a' + c - 'A');
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <ft_tolower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <ft_tolower+0x2c>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ft_tolower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
struct __sk_buff {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
void cilium_trace_capture2(struct __sk_buff *skb, __u8 type, __u32 arg1,
                           __u32 arg2) {}


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

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

LLVM IR (-O0):
%struct.__sk_buff = type { i32 }
define void @cilium_trace_capture2(%struct.__sk_buff* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.__sk_buff*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.__sk_buff* %0, %struct.__sk_buff** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%struct.__sk_buff = type { i32 }
define void @cilium_trace_capture2(%struct.__sk_buff* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
int f4(int x, int y) {
  int s = (x & (-0x7fffffff - 1));
  int t = (y & (-0x7fffffff - 1));
  return s == t;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
mov    %edi,%eax
xor    %esi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @f4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = and i32 %7, -2147483648
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = and i32 %9, -2147483648
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @f4(i32 %0, i32 %1) {
%3 = xor i32 %0, %1
%4 = xor i32 %3, -1
%5 = lshr i32 %4, 31
ret i32 %5
}
int is_p2(int i) { return __builtin_popcount(i) == 1; }


x86 assembly (clang, -O0):
<is_p2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%ecx
mov    %ecx,%eax
and    $0x33333333,%eax
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_p2>:
lea    -0x1(%rdi),%eax
test   %eax,%edi
sete   %al
test   %edi,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_p2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctpop.i32(i32 %3)
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_p2(i32 %0) {
%2 = tail call i32 @llvm.ctpop.i32(i32 %0)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}