xunge/DecIR huggingface dataset:
/* Variables and functions */
double log(double);
double expdev(long *idum) {
  double ran1(long *idum);
  double dum;
  do
    dum = ran1(idum);
  while (dum == 0.0);
  return -log(dum);
}


x86 assembly (clang, -O0):
<expdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ran1@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1157 <expdev+0x37>
jp     1157 <expdev+0x37>
jmp    112c <expdev+0xc>
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdev>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <ran1@plt>
ucomisd 0xed0(%rip),%xmm0
jne    1144 <expdev+0x24>
jnp    1130 <expdev+0x10>
call   1040 <log@plt>
xorpd  0xeaf(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @expdev(i64* %0) {
%2 = alloca i64*
%3 = alloca double
store i64* %0, i64** %2
br label %4
4: ; preds = %7, %1
%5 = load i64*, i64** %2
%6 = call double @ran1(i64* %5)
store double %6, double* %3
br label %7
7: ; preds = %4
%8 = load double, double* %3
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %4, label %10
10: ; preds = %7
%11 = load double, double* %3
%12 = call double @log(double %11)
%13 = fneg double %12
ret double %13
}

LLVM IR (-O2):
define double @expdev(i64* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call double @ran1(i64* %0)
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call double @log(double %3)
%7 = fneg double %6
ret double %7
}
/* Type definitions */
struct hexdump {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct hexdump *);
int /*<<< orphan*/ hxd_destroy(struct hexdump *);
void hxd_close(struct hexdump *X) {
  if (!X)
    return;
  hxd_destroy(X);
  free(X);
}


x86 assembly (clang, -O0):
<hxd_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <hxd_close+0x1c>
jmp    114e <hxd_close+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <hxd_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hxd_close>:
test   %rdi,%rdi
je     1137 <hxd_close+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <hxd_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.hexdump = type { i32 }
define void @hxd_close(%struct.hexdump* %0) {
%2 = alloca %struct.hexdump*
store %struct.hexdump* %0, %struct.hexdump** %2
%3 = load %struct.hexdump*, %struct.hexdump** %2
%4 = icmp ne %struct.hexdump* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.hexdump*, %struct.hexdump** %2
%8 = call i32 @hxd_destroy(%struct.hexdump* %7)
%9 = load %struct.hexdump*, %struct.hexdump** %2
%10 = call i32 @free(%struct.hexdump* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.hexdump = type { i32 }
define void @hxd_close(%struct.hexdump* %0) {
%2 = icmp eq %struct.hexdump* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @hxd_destroy(%struct.hexdump* %0)
%5 = tail call i32 @free(%struct.hexdump* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("works");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"works\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"works\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_le16(int /*<<< orphan*/ *, int /*<<< orphan*/);
void write_at_le16(void *dest, uint16_t val, size_t offset) {
  uint8_t *d = dest;
  d += offset;
  write_le16(d, val);
}


x86 assembly (clang, -O0):
<write_at_le16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <write_le16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_at_le16>:
lea    (%rdi,%rdx,4),%rdi
jmp    1030 <write_le16@plt>

LLVM IR (-O0):
define void @write_at_le16(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = getelementptr inbounds i32, i32* %11, i64 %10
store i32* %12, i32** %7
%13 = load i32*, i32** %7
%14 = load i32, i32* %5
%15 = call i32 @write_le16(i32* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @write_at_le16(i8* %0, i32 %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 %2
%6 = tail call i32 @write_le16(i32* %5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glCallList(int);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ glTranslatef(int, int, int /*<<< orphan*/);
void DrawDisk(int xcenter, int ycenter, int size) {
  glPushMatrix();
  {
    glTranslatef(xcenter, ycenter, 0);
    glRotatef(90, 1, 0, 0);
    glCallList(size);
  }
  glPopMatrix();
}


x86 assembly (clang, -O0):
<DrawDisk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <glPushMatrix@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1060 <glTranslatef@plt>
mov    $0x5a,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1070 <glRotatef@plt>
mov    -0xc(%rbp),%edi
call   1050 <glCallList@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawDisk>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <glPushMatrix@plt>
mov    %ebx,%edi
mov    %ebp,%esi
xor    %edx,%edx
call   1060 <glTranslatef@plt>
mov    $0x5a,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1070 <glRotatef@plt>
mov    %r14d,%edi
call   1050 <glCallList@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @DrawDisk(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 = call i32 (...) @glPushMatrix()
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @glTranslatef(i32 %8, i32 %9, i32 0)
%11 = call i32 @glRotatef(i32 90, i32 1, i32 0, i32 0)
%12 = load i32, i32* %6
%13 = call i32 @glCallList(i32 %12)
%14 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @DrawDisk(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @glPushMatrix()
%5 = tail call i32 @glTranslatef(i32 %0, i32 %1, i32 0)
%6 = tail call i32 @glRotatef(i32 90, i32 1, i32 0, i32 0)
%7 = tail call i32 @glCallList(i32 %2)
%8 = tail call i32 (...) @glPopMatrix()
ret void
}
unsigned long xdebug_hash_str(const char *key, unsigned int key_length) {
  char *p = (char *)key;
  char *end = (char *)key + key_length;
  unsigned long h = 5381;
  while (p < end) {
    h += h << 5;
    h ^= (unsigned long)*p++;
  }
  return h;
}


x86 assembly (clang, -O0):
<xdebug_hash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
movq   $0x1505,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1167 <xdebug_hash_str+0x67>
mov    -0x28(%rbp),%rax
shl    $0x5,%rax
add    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbq (%rax),%rax
xor    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1129 <xdebug_hash_str+0x29>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdebug_hash_str>:
test   %esi,%esi
je     112b <xdebug_hash_str+0x2b>
mov    %esi,%ecx
add    %rdi,%rcx
mov    $0x1505,%eax
xchg   %ax,%ax
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq (%rdi),%rax
add    $0x1,%rdi
xor    %rdx,%rax
cmp    %rcx,%rdi
jb     1110 <xdebug_hash_str+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @xdebug_hash_str(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %13, %6 ], [ 5381, %2 ]
%8 = phi i8* [ %10, %6 ], [ %0, %2 ]
%9 = mul i64 %7, 33
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %8
%12 = sext i8 %11 to i64
%13 = xor i64 %9, %12
%14 = icmp ult i8* %10, %4
br i1 %14, label %6, label %15
15: ; preds = %6, %2
%16 = phi i64 [ 5381, %2 ], [ %13, %6 ]
ret i64 %16
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int main(void) {
  *((volatile unsigned int *)(0xA0008820)) = 0x1111;
  int i = 0;
  while (1) {
    *((volatile unsigned int *)(0xA0008824)) = ~(1 << i++);
    delay();
    if (i > 3)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa0008820,%eax
movl   $0x1111,(%rax)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    $0xa0008824,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <delay@plt>
cmpl   $0x3,-0x8(%rbp)
jle    1167 <main+0x57>
movl   $0x0,-0x8(%rbp)
jmp    1131 <main+0x21>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xa0008820,%r14d
movl   $0x1111,(%r14)
xor    %r15d,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    0x1(%rbx),%ebp
mov    $0xfffffffe,%eax
mov    %ebx,%ecx
rol    %cl,%eax
mov    %eax,0x4(%r14)
xor    %eax,%eax
call   1030 <delay@plt>
cmp    $0x3,%ebx
cmovge %r15d,%ebp
mov    %ebp,%ebx
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store volatile i32 4369, i32* inttoptr (i64 2684389408 to i32*)
store i32 0, i32* %2
br label %3
3: ; preds = %0, %12
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = shl i32 1, %4
%7 = xor i32 %6, -1
store volatile i32 %7, i32* inttoptr (i64 2684389412 to i32*)
%8 = call i32 (...) @delay()
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 3
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %2
br label %12
12: ; preds = %11, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 4369, i32* inttoptr (i64 2684389408 to i32*)
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = add nsw i32 %2, 1
%4 = shl nuw i32 1, %2
%5 = xor i32 %4, -1
store volatile i32 %5, i32* inttoptr (i64 2684389412 to i32*)
%6 = tail call i32 (...) @delay()
%7 = icmp sgt i32 %2, 2
%8 = select i1 %7, i32 0, i32 %3
br label %1
}
int f(int *x) { return *x; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
scalar_t__ gdome_di_mkref();
unsigned int cgate_gdome_di_mkref() { return (unsigned int)gdome_di_mkref(); }


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

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

LLVM IR (-O0):
define i32 @cgate_gdome_di_mkref() {
%1 = call i64 (...) @gdome_di_mkref()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @cgate_gdome_di_mkref() {
%1 = tail call i64 (...) @gdome_di_mkref()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ klogi(char const *);
void printw(const char text[]) { klogi(text); }


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

x86 assembly (clang, -O2):
<printw>:
jmp    1030 <klogi@plt>

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

LLVM IR (-O2):
define void @printw(i8* %0) {
%2 = tail call i32 @klogi(i8* %0)
ret void
}
void gtk_drag_set_icon_pixmap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_set_icon_pixmap() {
ret void
}
unsigned short int rev_s(unsigned short int r0) {
  return (unsigned short int)((r0 >> 8) | (r0 << 8));
}


x86 assembly (clang, -O0):
<rev_s>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
movzwl -0x2(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rev_s>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @rev_s(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @rev_s(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
int /*<<< orphan*/ uart_puts(char *);
void print_size_int() {
  int i = sizeof(int);
  uart_puts("Size of int");
  while (i--) {
    uart_putc('T');
  }
}


x86 assembly (clang, -O0):
<print_size_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <uart_puts@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     115e <print_size_int+0x3e>
mov    $0x54,%edi
call   1030 <uart_putc@plt>
jmp    113b <print_size_int+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_size_int>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <uart_puts@plt>
mov    $0x54,%edi
call   1030 <uart_putc@plt>
mov    $0x54,%edi
call   1030 <uart_putc@plt>
mov    $0x54,%edi
call   1030 <uart_putc@plt>
mov    $0x54,%edi
pop    %rax
jmp    1030 <uart_putc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Size of int\00"
define void @print_size_int() {
%1 = alloca i32
store i32 4, i32* %1
%2 = call i32 @uart_puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %7, %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @uart_putc(i8 signext 84)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Size of int\00"
define void @print_size_int() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @uart_putc(i8 signext 84)
%3 = tail call i32 @uart_putc(i8 signext 84)
%4 = tail call i32 @uart_putc(i8 signext 84)
%5 = tail call i32 @uart_putc(i8 signext 84)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear32(int, int);
void HWResetDisable(void) { clear32((0xd800000 + 0x194), 0x4800); }


x86 assembly (clang, -O0):
<HWResetDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd800194,%edi
mov    $0x4800,%esi
call   1030 <clear32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HWResetDisable>:
mov    $0xd800194,%edi
mov    $0x4800,%esi
jmp    1030 <clear32@plt>

LLVM IR (-O0):
define void @HWResetDisable() {
%1 = call i32 @clear32(i32 226492820, i32 18432)
ret void
}

LLVM IR (-O2):
define void @HWResetDisable() {
%1 = tail call i32 @clear32(i32 226492820, i32 18432)
ret void
}
void processCommands(char *commands) {}


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

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

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

LLVM IR (-O2):
define void @processCommands(i8* nocapture %0) {
ret void
}
int util_nib_to_hex(int nibble) {
  if (nibble < 0)
    return -1;
  if (nibble < 10)
    return nibble + 0x30;
  if (nibble < 16)
    return nibble + 0x57;
  return -1;
}


x86 assembly (clang, -O0):
<util_nib_to_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <util_nib_to_hex+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <util_nib_to_hex+0x54>
cmpl   $0xa,-0x8(%rbp)
jge    1135 <util_nib_to_hex+0x35>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <util_nib_to_hex+0x54>
cmpl   $0x10,-0x8(%rbp)
jge    114d <util_nib_to_hex+0x4d>
mov    -0x8(%rbp),%eax
add    $0x57,%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <util_nib_to_hex+0x54>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_nib_to_hex>:
test   %edi,%edi
js     110f <util_nib_to_hex+0xf>
mov    %edi,%eax
cmp    $0x9,%edi
ja     1115 <util_nib_to_hex+0x15>
add    $0x30,%eax
ret
mov    $0xffffffff,%eax
ret
lea    0x57(%rax),%ecx
cmp    $0x10,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @util_nib_to_hex(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 10
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = add nuw nsw i32 %0, 48
br label %11
7: ; preds = %3
%8 = icmp ult i32 %0, 16
%9 = add nuw nsw i32 %0, 87
%10 = select i1 %8, i32 %9, i32 -1
br label %11
11: ; preds = %7, %1, %5
%12 = phi i32 [ %6, %5 ], [ -1, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct sheepdog_vnode_list_entry {
  int dummy;
};

/* Variables and functions */
int obj_to_sheep(struct sheepdog_vnode_list_entry *, int, int /*<<< orphan*/,
                 int);
int obj_to_sheep_def(struct sheepdog_vnode_list_entry *entries, int nr_entries,
                     int nr_obj, uint64_t oid, int idx) {
  return obj_to_sheep(entries, nr_entries, oid, idx);
}


x86 assembly (clang, -O0):
<obj_to_sheep_def>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <obj_to_sheep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obj_to_sheep_def>:
mov    %ecx,%edx
mov    %r8d,%ecx
jmp    1030 <obj_to_sheep@plt>

LLVM IR (-O0):
%struct.sheepdog_vnode_list_entry = type { i32 }
define i32 @obj_to_sheep_def(%struct.sheepdog_vnode_list_entry* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.sheepdog_vnode_list_entry*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.sheepdog_vnode_list_entry* %0, %struct.sheepdog_vnode_list_entry** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.sheepdog_vnode_list_entry*, %struct.sheepdog_vnode_list_entry** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = call i32 @obj_to_sheep(%struct.sheepdog_vnode_list_entry* %11, i32 %12, i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.sheepdog_vnode_list_entry = type { i32 }
define i32 @obj_to_sheep_def(%struct.sheepdog_vnode_list_entry* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @obj_to_sheep(%struct.sheepdog_vnode_list_entry* %0, i32 %1, i32 %3, i32 %4)
ret i32 %6
}
void *__infer_nondet_ptr() {
  void *res;
  return res;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @__infer_nondet_ptr() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ quicksort_aux(int *, int /*<<< orphan*/, size_t);
void quicksort(int arr[], size_t arr_sz) { quicksort_aux(arr, 0, arr_sz); }


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <quicksort_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <quicksort_aux@plt>

LLVM IR (-O0):
define void @quicksort(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = call i32 @quicksort_aux(i32* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i64 %1) {
%3 = tail call i32 @quicksort_aux(i32* %0, i32 0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ choffset();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void keypress(unsigned char key, int x, int y) {
  if (key == 'q')
    exit(0);
  if (key == '+') {
    glutPostRedisplay();
    choffset();
  };
}


x86 assembly (clang, -O0):
<keypress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x71,%eax
jne    1158 <keypress+0x28>
xor    %edi,%edi
call   1050 <exit@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
jne    1173 <keypress+0x43>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
mov    $0x0,%al
call   1030 <choffset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keypress>:
push   %rax
cmp    $0x2b,%dil
je     113f <keypress+0xf>
cmp    $0x71,%dil
je     114e <keypress+0x1e>
pop    %rax
ret
xor    %eax,%eax
call   1040 <glutPostRedisplay@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <choffset@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @keypress(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 113
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %14, 43
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = call i32 (...) @glutPostRedisplay()
%18 = call i32 (...) @choffset()
br label %19
19: ; preds = %16, %12
ret void
}

LLVM IR (-O2):
define void @keypress(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %9 [
i8 113, label %4
i8 43, label %6
]
4: ; preds = %3
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %3
%7 = tail call i32 (...) @glutPostRedisplay()
%8 = tail call i32 (...) @choffset()
br label %9
9: ; preds = %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgr(char *);
int main() {
  msgr("/dev/ms0\0");
  msgr("/dev/ms0\0");
  msgr("/dev/ms0\0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <msgr@plt>
lea    0xece(%rip),%rdi
call   1030 <msgr@plt>
lea    0xec2(%rip),%rdi
call   1030 <msgr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ms0\00\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @msgr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @msgr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @msgr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ms0\00\00"
define i32 @main() {
%1 = tail call i32 @msgr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @msgr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @msgr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void backend_create_time(int cores) {}


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

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

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

LLVM IR (-O2):
define void @backend_create_time(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VisualizarMatriz(int *, int);
main() {
  int x[] = {10, 20, 30, 40, 50};
  VisualizarMatriz(x, 5);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <VisualizarMatriz@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <VisualizarMatriz@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @VisualizarMatriz(i32* %3, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [5 x i32] [i32 10, i32 20, i32 30, i32 40, i32 50]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @VisualizarMatriz(i32* %3, i32 5)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t nextpow2(uint32_t val) {
  val--;
  val |= val >> 1;
  val |= val >> 2;
  val |= val >> 4;
  val |= val >> 8;
  val |= val >> 16;
  return ++val;
}


x86 assembly (clang, -O0):
<nextpow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextpow2>:
lea    -0x1(%rdi),%eax
mov    %eax,%ecx
sar    %ecx
or     %eax,%ecx
mov    %ecx,%eax
sar    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
sar    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x8,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    $0x10,%eax
or     %edx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @nextpow2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @nextpow2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = ashr i32 %2, 1
%4 = or i32 %3, %2
%5 = ashr i32 %4, 2
%6 = or i32 %5, %4
%7 = ashr i32 %6, 4
%8 = or i32 %7, %6
%9 = ashr i32 %8, 8
%10 = or i32 %9, %8
%11 = ashr i32 %10, 16
%12 = or i32 %11, %10
%13 = add nsw i32 %12, 1
ret i32 %13
}
void RGBAToYJRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYJRow_Any_AVX2() {
ret void
}
unsigned gz_intmax(void) {
  unsigned p, q;
  p = 1;
  do {
    q = p;
    p <<= 1;
    p++;
  } while (p > q);
  return q >> 1;
}


x86 assembly (clang, -O0):
<gz_intmax>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     110b <gz_intmax+0xb>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gz_intmax() {
ret i32 2147483647
}
int f(int x) {
  int result = ((x * 2) / 42);
  return result;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    $0x2a,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movslq %edi,%rax
imul   $0x30c30c31,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 2
%6 = sdiv i32 %5, 42
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = sdiv i32 %0, 21
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test_fun(void) {
  printf("this is test function\r");
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"this is test function\0D\00"
define i32 @test_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [23 x i8] c"this is test function\0D\00"
define i32 @test_fun() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int strlen(char *);
void strip_return(char *string_to_strip) {
  int len;
  len = strlen(string_to_strip);
  if (string_to_strip[len - 1] == '\n')
    string_to_strip[len - 1] = '\0';
}


x86 assembly (clang, -O0):
<strip_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1153 <strip_return+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_return>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <strip_return+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @strip_return(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %20
14: ; preds = %1
%15 = load i8*, i8** %2
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 0, i8* %19
br label %20
20: ; preds = %14, %1
ret void
}

LLVM IR (-O2):
define void @strip_return(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
scalar_t__ pipe(int *);
int main(void) {
  (void)close(0);
  (void)close(1);
  int fds[2];
  if (pipe(fds) || fds[0] != 0 || fds[1] != 1)
    return 77;
  return 77;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <close@plt>
mov    $0x1,%edi
call   1030 <close@plt>
lea    -0xc(%rbp),%rdi
call   1040 <pipe@plt>
cmp    $0x0,%rax
jne    1167 <main+0x47>
cmpl   $0x0,-0xc(%rbp)
jne    1167 <main+0x47>
cmpl   $0x1,-0x8(%rbp)
je     1173 <main+0x53>
movl   $0x4d,-0x4(%rbp)
jmp    117a <main+0x5a>
movl   $0x4d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
store i32 0, i32* %1
%3 = call i32 @close(i32 0)
%4 = call i32 @close(i32 1)
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%6 = call i64 @pipe(i32* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 1
br i1 %15, label %16, label %17
16: ; preds = %12, %8, %0
store i32 77, i32* %1
br label %18
17: ; preds = %12
store i32 77, i32* %1
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x i32]
%2 = tail call i32 @close(i32 0)
%3 = tail call i32 @close(i32 1)
%4 = bitcast [2 x i32]* %1 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = call i64 @pipe(i32* %5)
ret i32 77
}
/* Type definitions */
struct tfshdr {
  int dummy;
};

/* Variables and functions */
struct tfshdr *_tfsnext(struct tfshdr *);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
struct tfshdr *mon_tfsnext(struct tfshdr *fp) {
  struct tfshdr *ret;
  monLock();
  ret = _tfsnext(fp);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfsnext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x8(%rbp),%rdi
call   1040 <_tfsnext@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfsnext>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %rbx,%rdi
call   1040 <_tfsnext@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tfshdr = type { i32 }
define %struct.tfshdr* @mon_tfsnext(%struct.tfshdr* %0) {
%2 = alloca %struct.tfshdr*
%3 = alloca %struct.tfshdr*
store %struct.tfshdr* %0, %struct.tfshdr** %2
%4 = call i32 (...) @monLock()
%5 = load %struct.tfshdr*, %struct.tfshdr** %2
%6 = call %struct.tfshdr* @_tfsnext(%struct.tfshdr* %5)
store %struct.tfshdr* %6, %struct.tfshdr** %3
%7 = call i32 (...) @monUnlock()
%8 = load %struct.tfshdr*, %struct.tfshdr** %3
ret %struct.tfshdr* %8
}

LLVM IR (-O2):
%struct.tfshdr = type { i32 }
define %struct.tfshdr* @mon_tfsnext(%struct.tfshdr* %0) {
%2 = tail call i32 (...) @monLock()
%3 = tail call %struct.tfshdr* @_tfsnext(%struct.tfshdr* %0)
%4 = tail call i32 (...) @monUnlock()
ret %struct.tfshdr* %3
}
/* Variables and functions */
float quick_select_float(float *, int, int);
float quick_select_median_float(float *arr, int nelems) {
  return quick_select_float(arr, nelems, (nelems - 1) / 2);
}


x86 assembly (clang, -O0):
<quick_select_median_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1030 <quick_select_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_select_median_float>:
lea    -0x1(%rsi),%eax
shr    $0x1f,%eax
lea    (%rsi,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
jmp    1030 <quick_select_float@plt>

LLVM IR (-O0):
define float @quick_select_median_float(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = call float @quick_select_float(float* %5, i32 %6, i32 %9)
ret float %10
}

LLVM IR (-O2):
define float @quick_select_median_float(float* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call float @quick_select_float(float* %0, i32 %1, i32 %4)
ret float %5
}
unsigned int cvtUlongToBits(unsigned int src, unsigned int dest,
                            unsigned bitFieldOffset, unsigned bitFieldLength) {
  unsigned int mask;
  mask = (1 << bitFieldLength) - 1;
  mask = mask << bitFieldOffset;
  src = src << bitFieldOffset;
  dest = (dest & ~mask) | (src & mask);
  return dest;
}


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

x86 assembly (clang, -O2):
<cvtUlongToBits>:
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %edx,%ecx
shl    %cl,%eax
shl    %cl,%edi
xor    %esi,%edi
and    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @cvtUlongToBits(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* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = shl i32 1, %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i32, i32* %7
%15 = shl i32 %13, %14
store i32 %15, i32* %9
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = shl i32 %16, %17
store i32 %18, i32* %5
%19 = load i32, i32* %6
%20 = load i32, i32* %9
%21 = xor i32 %20, -1
%22 = and i32 %19, %21
%23 = load i32, i32* %5
%24 = load i32, i32* %9
%25 = and i32 %23, %24
%26 = or i32 %22, %25
store i32 %26, i32* %6
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
define i32 @cvtUlongToBits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %3
%6 = xor i32 %5, -1
%7 = shl i32 %6, %2
%8 = shl i32 %0, %2
%9 = xor i32 %7, -1
%10 = and i32 %9, %1
%11 = and i32 %7, %8
%12 = or i32 %10, %11
ret i32 %12
}
void genddivu() {}


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

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

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

LLVM IR (-O2):
define void @genddivu() {
ret void
}
/* Type definitions */
struct turn_attr_hdr {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct iovec {
  int dummy;
};

/* Variables and functions */
struct turn_attr_hdr *turn_attr_address_create(int, struct sockaddr const *,
                                               struct iovec *);
struct turn_attr_hdr *
turn_attr_alternate_server_create(const struct sockaddr *address,
                                  struct iovec *iov) {
  return turn_attr_address_create(0x8023, address, iov);
}


x86 assembly (clang, -O0):
<turn_attr_alternate_server_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x8023,%edi
call   1030 <turn_attr_address_create@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_attr_alternate_server_create>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x8023,%edi
jmp    1030 <turn_attr_address_create@plt>

LLVM IR (-O0):
%struct.turn_attr_hdr = type { i32 }
%struct.sockaddr = type { i32 }
%struct.iovec = type { i32 }
define %struct.turn_attr_hdr* @turn_attr_alternate_server_create(%struct.sockaddr* %0, %struct.iovec* %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca %struct.iovec*
store %struct.sockaddr* %0, %struct.sockaddr** %3
store %struct.iovec* %1, %struct.iovec** %4
%5 = load %struct.sockaddr*, %struct.sockaddr** %3
%6 = load %struct.iovec*, %struct.iovec** %4
%7 = call %struct.turn_attr_hdr* @turn_attr_address_create(i32 32803, %struct.sockaddr* %5, %struct.iovec* %6)
ret %struct.turn_attr_hdr* %7
}

LLVM IR (-O2):
%struct.turn_attr_hdr = type { i32 }
%struct.sockaddr = type { i32 }
%struct.iovec = type { i32 }
define %struct.turn_attr_hdr* @turn_attr_alternate_server_create(%struct.sockaddr* %0, %struct.iovec* %1) {
%3 = tail call %struct.turn_attr_hdr* @turn_attr_address_create(i32 32803, %struct.sockaddr* %0, %struct.iovec* %1)
ret %struct.turn_attr_hdr* %3
}
unsigned is_flush(const unsigned CHITS, const unsigned DHITS,
                  const unsigned HHITS, const unsigned SHITS) {
  if (CHITS >= 5) {
    return 1;
  }
  if (DHITS >= 5) {
    return 2;
  }
  if (HHITS >= 5) {
    return 3;
  }
  if (SHITS >= 5) {
    return 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_flush>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x5,-0x8(%rbp)
jb     1126 <is_flush+0x26>
movl   $0x1,-0x4(%rbp)
jmp    116f <is_flush+0x6f>
cmpl   $0x5,-0xc(%rbp)
jb     113c <is_flush+0x3c>
movl   $0x2,-0x4(%rbp)
jmp    116f <is_flush+0x6f>
cmpl   $0x5,-0x10(%rbp)
jb     1152 <is_flush+0x52>
movl   $0x3,-0x4(%rbp)
jmp    116f <is_flush+0x6f>
cmpl   $0x5,-0x14(%rbp)
jb     1168 <is_flush+0x68>
movl   $0x4,-0x4(%rbp)
jmp    116f <is_flush+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_flush>:
mov    $0x1,%eax
cmp    $0x4,%edi
ja     1129 <is_flush+0x29>
mov    $0x2,%eax
cmp    $0x4,%esi
ja     1129 <is_flush+0x29>
mov    $0x3,%eax
cmp    $0x4,%edx
ja     1129 <is_flush+0x29>
xor    %eax,%eax
cmp    $0x5,%ecx
setae  %al
shl    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @is_flush(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %0, 4
br i1 %5, label %13, label %6
6: ; preds = %4
%7 = icmp ugt i32 %1, 4
br i1 %7, label %13, label %8
8: ; preds = %6
%9 = icmp ugt i32 %2, 4
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp ugt i32 %3, 4
%12 = select i1 %11, i32 4, i32 0
br label %13
13: ; preds = %10, %8, %6, %4
%14 = phi i32 [ 1, %4 ], [ 2, %6 ], [ 3, %8 ], [ %12, %10 ]
ret i32 %14
}
void set_the_trap() {}


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

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

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

LLVM IR (-O2):
define void @set_the_trap() {
ret void
}