xunge/DecIR huggingface dataset:
int xmlUCSIsUnifiedCanadianAboriginalSyllabics(int code) {
  return (((code >= 0x1400) && (code <= 0x167F)));
}


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

x86 assembly (clang, -O2):
<xmlUCSIsUnifiedCanadianAboriginalSyllabics>:
add    $0xffffec00,%edi
xor    %eax,%eax
cmp    $0x280,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsUnifiedCanadianAboriginalSyllabics(i32 %0) {
%2 = add i32 %0, -5120
%3 = icmp ult i32 %2, 640
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int strlen(char *);
int main(void) {
  int ret = 0;
  char str[] = "bientot";
  printf("The lenght of the string %s id %d", str, strlen(str));
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x746f746e656962,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [8 x i8] c"bientot\00"
@.str = [34 x i8] c"The lenght of the string %s id %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [8 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [8 x i8]* %3 to i8*
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [34 x i8] c"The lenght of the string %s id %d\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 32773643157465442, i64* %1
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ next_start_code();
void user_data(void) {
  {
    next_start_code();
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @user_data() {
%1 = tail call i32 (...) @next_start_code()
ret void
}
int kmr_ntuple_entry_size(int len) {
  return (((len) + ((8) - 1)) & ~((8) - 1));
}


x86 assembly (clang, -O0):
<kmr_ntuple_entry_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
and    $0xfffffff8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmr_ntuple_entry_size>:
lea    0x7(%rdi),%eax
and    $0xfffffff8,%eax
ret

LLVM IR (-O0):
define i32 @kmr_ntuple_entry_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 7
%5 = and i32 %4, -8
ret i32 %5
}

LLVM IR (-O2):
define i32 @kmr_ntuple_entry_size(i32 %0) {
%2 = add nsw i32 %0, 7
%3 = and i32 %2, -8
ret i32 %3
}
double MBtoPSI(double MB) {
  double PSI = 0.0145038 * MB;
  return PSI;
}


x86 assembly (clang, -O0):
<MBtoPSI>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MBtoPSI>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MBtoPSI(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 1.450380e-02, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @MBtoPSI(double %0) {
%2 = fmul double %0, 1.450380e-02
ret double %2
}
void midi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @midi_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void decaln(void) { esc("#8"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\00"
define void @decaln() {
%1 = call i32 @esc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\00"
define void @decaln() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmove(int, int /*<<< orphan*/);
int /*<<< orphan*/ gputs(char *);
void saystat(char *s) {
  gmove(24, 0);
  gputs(s);
}


x86 assembly (clang, -O0):
<saystat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x18,%edi
xor    %esi,%esi
call   1040 <gmove@plt>
mov    -0x8(%rbp),%rdi
call   1030 <gputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saystat>:
push   %rbx
mov    %rdi,%rbx
mov    $0x18,%edi
xor    %esi,%esi
call   1040 <gmove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <gputs@plt>

LLVM IR (-O0):
define void @saystat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @gmove(i32 24, i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @gputs(i8* %4)
ret void
}

LLVM IR (-O2):
define void @saystat(i8* %0) {
%2 = tail call i32 @gmove(i32 24, i32 0)
%3 = tail call i32 @gputs(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ILibReadFileFromDiskEx(char **, char *);
char *ILibReadFileFromDisk(char *FileName) {
  char *RetVal;
  ILibReadFileFromDiskEx(&RetVal, FileName);
  return (RetVal);
}


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

x86 assembly (clang, -O2):
<ILibReadFileFromDisk>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <ILibReadFileFromDiskEx@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ILibReadFileFromDisk(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ILibReadFileFromDiskEx(i8** %3, i8* %4)
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @ILibReadFileFromDisk(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @ILibReadFileFromDiskEx(i8** %2, i8* %0)
%5 = load i8*, i8** %2
ret i8* %5
}
unsigned int Strings_CanAssignAll(unsigned int sourceLength, char *destination,
                                  unsigned int _destination_high) {
  return sourceLength <= _destination_high;
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<Strings_CanAssignAll>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Strings_CanAssignAll(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @Strings_CanAssignAll(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp ule i32 %0, %2
%5 = zext i1 %4 to i32
ret i32 %5
}
char *stringLiteral(void) {
  char *str = "Hello world";
  return str;
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\00"
define i8* @stringLiteral() {
%1 = alloca i8*
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i8* @stringLiteral() {
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
}
void *__wrap_malloc(unsigned long sz) {
  extern void *sbrk(long);
  void *res = sbrk(sz);
  if ((long)res == -1)
    return 0;
  return res;
}


x86 assembly (clang, -O0):
<__wrap_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <sbrk@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    $0xffffffffffffffff,%rax
jne    1144 <__wrap_malloc+0x34>
movq   $0x0,-0x8(%rbp)
jmp    114c <__wrap_malloc+0x3c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_malloc>:
push   %rax
call   1030 <sbrk@plt>
xor    %ecx,%ecx
cmp    $0xffffffffffffffff,%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @__wrap_malloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i8* @sbrk(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = icmp eq i64 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %13
11: ; preds = %1
%12 = load i8*, i8** %4
store i8* %12, i8** %2
br label %13
13: ; preds = %11, %10
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @__wrap_malloc(i64 %0) {
%2 = tail call i8* @sbrk(i64 %0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
%4 = select i1 %3, i8* null, i8* %2
ret i8* %4
}
/* Type definitions */
typedef unsigned char uint16_t;

/* Variables and functions */
uint16_t read_u16_le(unsigned char *buf) {
  uint16_t n = 0;
  n |= buf[1] << 8;
  n |= buf[0];
  return n;
}


x86 assembly (clang, -O0):
<read_u16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
shl    $0x8,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_u16_le>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @read_u16_le(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ gd_filetype_function(int);
void gif_filetype_function(void) { gd_filetype_function(2); }


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

x86 assembly (clang, -O2):
<gif_filetype_function>:
mov    $0x2,%edi
jmp    1030 <gd_filetype_function@plt>

LLVM IR (-O0):
define void @gif_filetype_function() {
%1 = call i32 @gd_filetype_function(i32 2)
ret void
}

LLVM IR (-O2):
define void @gif_filetype_function() {
%1 = tail call i32 @gd_filetype_function(i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_w8(struct serializer *, int /*<<< orphan*/);
int /*<<< orphan*/ s_wb16(struct serializer *, int /*<<< orphan*/);
void s_wb24(struct serializer *s, uint32_t u24) {
  s_wb16(s, (uint16_t)(u24 >> 8));
  s_w8(s, (uint8_t)u24);
  return;
}


x86 assembly (clang, -O0):
<s_wb24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x8,%esi
call   1040 <s_wb16@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <s_w8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_wb24>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
sar    $0x8,%esi
call   1040 <s_wb16@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <s_w8@plt>

LLVM IR (-O0):
%struct.serializer = type { i32 }
define void @s_wb24(%struct.serializer* %0, i32 %1) {
%3 = alloca %struct.serializer*
%4 = alloca i32
store %struct.serializer* %0, %struct.serializer** %3
store i32 %1, i32* %4
%5 = load %struct.serializer*, %struct.serializer** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 8
%8 = call i32 @s_wb16(%struct.serializer* %5, i32 %7)
%9 = load %struct.serializer*, %struct.serializer** %3
%10 = load i32, i32* %4
%11 = call i32 @s_w8(%struct.serializer* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define void @s_wb24(%struct.serializer* %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = tail call i32 @s_wb16(%struct.serializer* %0, i32 %3)
%5 = tail call i32 @s_w8(%struct.serializer* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void ecrire_commentaire_binaire(FILE *fichier, char *comment) {}


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

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

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

LLVM IR (-O2):
define void @ecrire_commentaire_binaire(i32* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void pic_disable() {
  outb(0x21, 0xfb);
  outb(0xa1, 0xff);
}


x86 assembly (clang, -O0):
<pic_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21,%edi
mov    $0xfb,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_disable>:
push   %rax
mov    $0x21,%edi
mov    $0xfb,%esi
call   1030 <outb@plt>
mov    $0xa1,%edi
mov    $0xff,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pic_disable() {
%1 = call i32 @outb(i32 33, i32 251)
%2 = call i32 @outb(i32 161, i32 255)
ret void
}

LLVM IR (-O2):
define void @pic_disable() {
%1 = tail call i32 @outb(i32 33, i32 251)
%2 = tail call i32 @outb(i32 161, i32 255)
ret void
}
unsigned long int_hash(int data, unsigned long size) { return data % size; }


x86 assembly (clang, -O0):
<int_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_hash>:
movslq %edi,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <int_hash+0x18>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
mov    %edi,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @int_hash(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @int_hash(i32 %0, i64 %1) {
%3 = sext i32 %0 to i64
%4 = urem i64 %3, %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *strdup_vprintf(char const *, int /*<<< orphan*/);
char *xstrdup_vprintf(const char *fmt, va_list ap) {
  char *s = strdup_vprintf(fmt, ap);
  if (NULL == s)
    fatal("Out of memory");
  return s;
}


x86 assembly (clang, -O0):
<xstrdup_vprintf>:
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 <strdup_vprintf@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
jne    1157 <xstrdup_vprintf+0x37>
lea    0xeae(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup_vprintf>:
push   %rbx
call   1030 <strdup_vprintf@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup_vprintf+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xstrdup_vprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @strdup_vprintf(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* null, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xstrdup_vprintf(i8* %0, i32 %1) {
%3 = tail call i8* @strdup_vprintf(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
unsigned int get_be32(unsigned int);
float get_bef32(float v_) {
  union {
    float f;
    unsigned int i;
  } v;
  v.f = v_;
  v.i = get_be32(v.i);
  return v.f;
}


x86 assembly (clang, -O0):
<get_bef32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <get_be32@plt>
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bef32>:
push   %rax
movd   %xmm0,%edi
call   1030 <get_be32@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @get_bef32(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = call i32 @get_be32(i32 %7)
%9 = bitcast %union.anon* %3 to i32*
store i32 %8, i32* %9
%10 = bitcast %union.anon* %3 to float*
%11 = load float, float* %10
ret float %11
}

LLVM IR (-O2):
define float @get_bef32(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @get_be32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
unsigned long DWORD_SWAP(unsigned long x) {
  return ((unsigned long)(((x) << 24) | ((x) >> 24) | (((x)&0xFF00) << 8) |
                          (((x)&0xFF0000) >> 8)));
}


x86 assembly (clang, -O0):
<DWORD_SWAP>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x18,%rax
mov    -0x8(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DWORD_SWAP>:
mov    %rdi,%rax
shl    $0x18,%rax
mov    %rdi,%rcx
shr    $0x18,%rcx
or     %rax,%rcx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %rcx,%rax
shr    $0x8,%rdi
and    $0xff00,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @DWORD_SWAP(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 24
%5 = load i64, i64* %2
%6 = lshr i64 %5, 24
%7 = or i64 %4, %6
%8 = load i64, i64* %2
%9 = and i64 %8, 65280
%10 = shl i64 %9, 8
%11 = or i64 %7, %10
%12 = load i64, i64* %2
%13 = and i64 %12, 16711680
%14 = lshr i64 %13, 8
%15 = or i64 %11, %14
ret i64 %15
}

LLVM IR (-O2):
define i64 @DWORD_SWAP(i64 %0) {
%2 = shl i64 %0, 24
%3 = lshr i64 %0, 24
%4 = or i64 %2, %3
%5 = shl i64 %0, 8
%6 = and i64 %5, 16711680
%7 = or i64 %4, %6
%8 = lshr i64 %0, 8
%9 = and i64 %8, 65280
%10 = or i64 %7, %9
ret i64 %10
}
int fs_hfs_probe(int fd, long long offs) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fs_hfs_probe(i32 %0, i64 %1) {
ret i32 -1
}
int dev_redir_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dev_redir_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int file4_ok_() {
  printf(" Ok from file4_ok in file4.c\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c" Ok from file4_ok in file4.c\0A\00"
define i32 @file4_ok_() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [29 x i8] c" Ok from file4_ok in file4.c\00"
define i32 @file4_ok_() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", (1 << 8));
  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
mov    $0x100,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 256)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 256)
ret i32 0
}
/* Type definitions */
struct oidset_iter {
  int dummy;
};
struct oidset {
  int dummy;
};
struct object_id {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oidset_iter_init(struct oidset *, struct oidset_iter *);
struct object_id *oidset_iter_next(struct oidset_iter *);
struct object_id *oidset_iter_first(struct oidset *set,
                                    struct oidset_iter *iter) {
  oidset_iter_init(set, iter);
  return oidset_iter_next(iter);
}


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

x86 assembly (clang, -O2):
<oidset_iter_first>:
push   %rbx
mov    %rsi,%rbx
call   1040 <oidset_iter_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <oidset_iter_next@plt>

LLVM IR (-O0):
%struct.object_id = type { i32 }
%struct.oidset = type { i32 }
%struct.oidset_iter = type { i32 }
define %struct.object_id* @oidset_iter_first(%struct.oidset* %0, %struct.oidset_iter* %1) {
%3 = alloca %struct.oidset*
%4 = alloca %struct.oidset_iter*
store %struct.oidset* %0, %struct.oidset** %3
store %struct.oidset_iter* %1, %struct.oidset_iter** %4
%5 = load %struct.oidset*, %struct.oidset** %3
%6 = load %struct.oidset_iter*, %struct.oidset_iter** %4
%7 = call i32 @oidset_iter_init(%struct.oidset* %5, %struct.oidset_iter* %6)
%8 = load %struct.oidset_iter*, %struct.oidset_iter** %4
%9 = call %struct.object_id* @oidset_iter_next(%struct.oidset_iter* %8)
ret %struct.object_id* %9
}

LLVM IR (-O2):
%struct.object_id = type { i32 }
%struct.oidset = type { i32 }
%struct.oidset_iter = type { i32 }
define %struct.object_id* @oidset_iter_first(%struct.oidset* %0, %struct.oidset_iter* %1) {
%3 = tail call i32 @oidset_iter_init(%struct.oidset* %0, %struct.oidset_iter* %1)
%4 = tail call %struct.object_id* @oidset_iter_next(%struct.oidset_iter* %1)
ret %struct.object_id* %4
}
RX0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<RX0RX1>:
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),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %ecx,%rax
mov    (%r9,%rax,4),%eax
movslq %edx,%rcx
mov    %eax,(%r8,%rcx,4)
ret

LLVM IR (-O0):
define i32 @RX0RX1(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* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = load i32*, i32** %12
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
store i32 %18, i32* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @RX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds i32, i32* %4, i64 %10
store i32 %9, i32* %11
ret i32 undef
}
char *getenv(const char *name) {
  char *_getenv(const char *);
  return (_getenv(name));
}


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

x86 assembly (clang, -O2):
<getenv>:
jmp    1030 <_getenv@plt>

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

LLVM IR (-O2):
define i8* @getenv(i8* %0) {
%2 = tail call i8* @_getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ hz_assert_char(char *, int /*<<< orphan*/, char);
int /*<<< orphan*/ hz_assert_strncpy_ok(char *, char *, int);
void test_utils_strncpy_1(void) {
  char buf[1];
  hz_assert_strncpy_ok(buf, "", 1);
  hz_assert_char(buf, 0, '\0');
}


x86 assembly (clang, -O0):
<test_utils_strncpy_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x1,%edx
call   1040 <hz_assert_strncpy_ok@plt>
lea    -0x1(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <hz_assert_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_utils_strncpy_1>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0xf(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <hz_assert_strncpy_ok@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <hz_assert_char@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @test_utils_strncpy_1() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = call i32 @hz_assert_strncpy_ok(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%5 = call i32 @hz_assert_char(i8* %4, i32 0, i8 signext 0)
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @test_utils_strncpy_1() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = call i32 @hz_assert_strncpy_ok(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @hz_assert_char(i8* %2, i32 0, i8 signext 0)
ret void
}
long rand() {
  long r;
  r = *((long *)0x300000000);
  r = r * 0xfef3f6f4f3f2f1;
  *((long *)0x300000000) = r;
  return r;
}


x86 assembly (clang, -O0):
<rand>:
push   %rbp
mov    %rsp,%rbp
movabs $0x300000000,%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movabs $0xfef3f6f4f3f2f1,%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
movabs $0x300000000,%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand>:
movabs $0x300000000,%rcx
movabs $0xfef3f6f4f3f2f1,%rax
imul   (%rcx),%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define i64 @rand() {
%1 = alloca i64
%2 = load i64, i64* inttoptr (i64 12884901888 to i64*)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = mul nsw i64 %3, 71762886081639153
store i64 %4, i64* %1
%5 = load i64, i64* %1
store i64 %5, i64* inttoptr (i64 12884901888 to i64*)
%6 = load i64, i64* %1
ret i64 %6
}

LLVM IR (-O2):
define i64 @rand() {
%1 = load i64, i64* inttoptr (i64 12884901888 to i64*)
%2 = mul nsw i64 %1, 71762886081639153
store i64 %2, i64* inttoptr (i64 12884901888 to i64*)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free_list();
int /*<<< orphan*/ populate();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ random_song(int);
void test_random_song() {
  printf(
      "====================================================================\n");
  printf("TESTING RANDOM SONG...\n");
  populate();
  random_song(10);
  free_list();
}


x86 assembly (clang, -O0):
<test_random_song>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <populate@plt>
mov    $0xa,%edi
call   1060 <random_song@plt>
mov    $0x0,%al
call   1050 <free_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_random_song>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <populate@plt>
mov    $0xa,%edi
call   1060 <random_song@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <free_list@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"====================================================================\0A\00"
@.str.1 = [24 x i8] c"TESTING RANDOM SONG...\0A\00"
define void @test_random_song() {
%1 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @populate()
%4 = call i32 @random_song(i32 10)
%5 = call i32 (...) @free_list()
ret void
}

LLVM IR (-O2):
@str = [69 x i8] c"====================================================================\00"
@str.2 = [23 x i8] c"TESTING RANDOM SONG...\00"
define void @test_random_song() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 (...) @populate()
%4 = tail call i32 @random_song(i32 10)
%5 = tail call i32 (...) @free_list()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
struct dirCache_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _addHash(struct dirCache_t *, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ calcHash(int /*<<< orphan*/ *);
void addNameToHash(struct dirCache_t *cache, wchar_t *name) {
  _addHash(cache, calcHash(name), 0);
}


x86 assembly (clang, -O0):
<addNameToHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <calcHash@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <_addHash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addNameToHash>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <calcHash@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <_addHash@plt>

LLVM IR (-O0):
%struct.dirCache_t = type { i32 }
define void @addNameToHash(%struct.dirCache_t* %0, i32* %1) {
%3 = alloca %struct.dirCache_t*
%4 = alloca i32*
store %struct.dirCache_t* %0, %struct.dirCache_t** %3
store i32* %1, i32** %4
%5 = load %struct.dirCache_t*, %struct.dirCache_t** %3
%6 = load i32*, i32** %4
%7 = call i32 @calcHash(i32* %6)
%8 = call i32 @_addHash(%struct.dirCache_t* %5, i32 %7, i32 0)
ret void
}

LLVM IR (-O2):
%struct.dirCache_t = type { i32 }
define void @addNameToHash(%struct.dirCache_t* %0, i32* %1) {
%3 = tail call i32 @calcHash(i32* %1)
%4 = tail call i32 @_addHash(%struct.dirCache_t* %0, i32 %3, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ strtod_i8n(char const *, char **);
float strtof_i8n(const char *str, char **endptr) {
  return (float)strtod_i8n(str, endptr);
}


x86 assembly (clang, -O0):
<strtof_i8n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod_i8n@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtof_i8n>:
push   %rax
call   1030 <strtod_i8n@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @strtof_i8n(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call i64 @strtod_i8n(i8* %5, i8** %6)
%8 = sitofp i64 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @strtof_i8n(i8* %0, i8** %1) {
%3 = tail call i64 @strtod_i8n(i8* %0, i8** %1)
%4 = sitofp i64 %3 to float
ret float %4
}
void foo_2_2_2_1_2_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_1_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ARRAY_NELEMS(char const *);
int /*<<< orphan*/ memcmp(unsigned char const *, char const *,
                          int /*<<< orphan*/);
int elf_loader_is_elf(const unsigned char *img) {
  static const char ident[4] = {0x7f, 'E', 'L', 'F'};
  return !memcmp(img, ident, ARRAY_NELEMS(ident));
}


x86 assembly (clang, -O0):
<elf_loader_is_elf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <ARRAY_NELEMS@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elf_loader_is_elf>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1040 <ARRAY_NELEMS@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@elf_loader_is_elf.ident = internal constant [4 x i8] c"\7FELF"
define i32 @elf_loader_is_elf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ARRAY_NELEMS(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @elf_loader_is_elf.ident, i64 0, i64 0))
%5 = call i32 @memcmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @elf_loader_is_elf.ident, i64 0, i64 0), i32 %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@elf_loader_is_elf.ident = internal constant [4 x i8] c"\7FELF"
define i32 @elf_loader_is_elf(i8* %0) {
%2 = tail call i32 @ARRAY_NELEMS(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @elf_loader_is_elf.ident, i64 0, i64 0))
%3 = tail call i32 @memcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @elf_loader_is_elf.ident, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int g() {
  int l = 0;
  l++;
  return l;
}


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

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

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 1
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @g() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ values_not_equal_display_error(unsigned long long const,
                                                  unsigned long long const);
void _assert_int_not_equal(const unsigned long long a,
                           const unsigned long long b, const char *const file,
                           const int line) {
  if (!values_not_equal_display_error(a, b)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_int_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <values_not_equal_display_error@plt>
cmp    $0x0,%eax
jne    1159 <_assert_int_not_equal+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_int_not_equal>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rdx,%rbx
call   1040 <values_not_equal_display_error@plt>
test   %eax,%eax
je     1138 <_assert_int_not_equal+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

LLVM IR (-O0):
define void @_assert_int_not_equal(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = call i32 @values_not_equal_display_error(i64 %9, i64 %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @_fail(i8* %14, i32 %15)
br label %17
17: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @_assert_int_not_equal(i64 %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 @values_not_equal_display_error(i64 %0, i64 %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_fail(i8* %2, i32 %3)
br label %9
9: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_data(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c)) == __cpu_to_le16(0x0008);
}


x86 assembly (clang, -O0):
<ieee80211_is_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_data>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x8,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_data(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 12)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 8)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_data(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 12)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 8)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int foo();
int bar(void) { return foo() + foo() + 1; }


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

x86 assembly (clang, -O2):
<bar>:
push   %rbx
xor    %eax,%eax
call   1030 <foo@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <foo@plt>
add    %ebx,%eax
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @foo()
%3 = add nsw i32 %1, %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = add i32 %1, 1
%4 = add i32 %3, %2
ret i32 %4
}
int path_part_len(const char *p) {
  int i = 0;
  while (p[i] != '\0' && p[i] != '[' && p[i] != '.')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<path_part_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1158 <path_part_len+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x5b,%ecx
mov    %al,-0xd(%rbp)
je     1158 <path_part_len+0x58>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1168 <path_part_len+0x68>
jmp    1176 <path_part_len+0x76>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <path_part_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_part_len>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1128 <path_part_len+0x28>
cmp    $0x2e,%cl
je     1128 <path_part_len+0x28>
cmp    $0x5b,%cl
je     1128 <path_part_len+0x28>
add    $0x1,%rax
jmp    1110 <path_part_len+0x10>
ret

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

LLVM IR (-O2):
define i32 @path_part_len(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 91, label %8
i8 46, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2, %2, %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
char toupper(char);
void strupper(char *s) {
  for (; *s; ++s)
    *s = toupper(*s);
}


x86 assembly (clang, -O0):
<strupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strupper+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strupper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strupper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}