xunge/DecIR huggingface dataset:
unsigned char(readb)(void const volatile *addr) {
  unsigned char volatile *mem_2;
  {
    mem_2 = (unsigned char volatile *)addr;
    return ((unsigned char)(*mem_2));
  }
}


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

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

LLVM IR (-O0):
define zeroext i8 @readb(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load volatile i8, i8* %5
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @readb(i8* %0) {
%2 = load volatile i8, i8* %0
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ error(char *);
scalar_t__ fclose(int /*<<< orphan*/ *);
void closeFile(FILE *filePtr) {
  if (fclose(filePtr) == EOF) {
    error("Error closing file!");
  }
}


x86 assembly (clang, -O0):
<closeFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jne    1151 <closeFile+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeFile>:
push   %rax
call   1030 <fclose@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
jne    113f <closeFile+0x1f>
lea    0xec7(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [20 x i8] c"Error closing file!\00"
define void @closeFile(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fclose(i32* %3)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [20 x i8] c"Error closing file!\00"
define void @closeFile(i32* nocapture %0) {
%2 = tail call i64 @fclose(i32* %0)
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
void rcu_prepare_for_idle(int cpu) {}


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

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

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

LLVM IR (-O2):
define void @rcu_prepare_for_idle(i32 %0) {
ret void
}
int min3(int a, int b, int c) {
  if (a > b)
    if (b > c)
      return c;
    else
      return b;
  else if (a > c)
    return c;
  return a;
}


x86 assembly (clang, -O0):
<min3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113b <min3+0x3b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1130 <min3+0x30>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <min3+0x5d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <min3+0x5d>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1152 <min3+0x52>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <min3+0x5d>
jmp    1157 <min3+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min3>:
mov    %esi,%eax
cmp    %edx,%esi
cmovg  %edx,%eax
cmp    %edi,%eax
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, %2
%5 = select i1 %4, i32 %2, i32 %1
%6 = icmp slt i32 %5, %0
%7 = select i1 %6, i32 %5, i32 %0
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *res_name;
};
typedef TYPE_1__ XClassHint;

/* Variables and functions */
void set_XClassHint_res_name(void *_p, void *_v) {
  ((XClassHint *)_p)->res_name = (char *)_v;
}


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

x86 assembly (clang, -O2):
<set_XClassHint_res_name>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XClassHint_res_name(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void printUsageRem(char *pgmName) {
  fprintf(stderr, "Usage: %s %s\n", pgmName,
          "-r"
          " <Attr Name> <path>");
}


x86 assembly (clang, -O0):
<printUsageRem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xed7(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsageRem>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xee4(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"Usage: %s %s\0A\00"
@.str.1 = [22 x i8] c"-r <Attr Name> <path>\00"
define void @printUsageRem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"Usage: %s %s\0A\00"
@.str.1 = [22 x i8] c"-r <Attr Name> <path>\00"
define void @printUsageRem(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xbf() {
  Assert_real((isodigit(191) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              960, ("isodigit should be 0 for 0xbf"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xbf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xbf,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3c0,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xbf>:
push   %rax
mov    $0xbf,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3c0,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xbf\00"
define void @t_isodigit_0xbf() {
%1 = call i64 @isodigit(i32 191)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xbf\00"
define void @t_isodigit_0xbf() {
%1 = tail call i64 @isodigit(i32 191)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 960, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getNumber(double *);
double sinh(double);
double senoh(double a) {
  getNumber(&a);
  return sinh(a);
}


x86 assembly (clang, -O0):
<senoh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <getNumber@plt>
movsd  -0x8(%rbp),%xmm0
call   1030 <sinh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senoh>:
push   %rax
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <getNumber@plt>
movsd  (%rsp),%xmm0
call   1030 <sinh@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @senoh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @sinh(double %4)
ret double %5
}

LLVM IR (-O2):
define double @senoh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i32 @getNumber(double* %2)
%4 = load double, double* %2
%5 = call double @sinh(double %4)
ret double %5
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int htons(int);
int /*<<< orphan*/ write(int, int *, int);
void write_16_le(int fd, uint16_t x) {
  x = htons(x);
  x = (x & 0xff) << 8 ^ (x >> 8);
  write(fd, &x, 2);
}


x86 assembly (clang, -O0):
<write_16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <htons@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_16_le>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <htons@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
movzwl %cx,%ecx
sar    $0x8,%eax
xor    %ecx,%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @write_16_le(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @htons(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = xor i32 %9, %11
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = call i32 @write(i32 %13, i32* %4, i32 2)
ret void
}

LLVM IR (-O2):
define void @write_16_le(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
%5 = shl i32 %4, 8
%6 = and i32 %5, 65280
%7 = ashr i32 %4, 8
%8 = xor i32 %6, %7
store i32 %8, i32* %3
%9 = call i32 @write(i32 %0, i32* %3, i32 2)
ret void
}
/* Variables and functions */
int O_NONBLOCK;
int get_socket_flags(int);
int /*<<< orphan*/ set_socket_flags(int, int);
int set_socket_non_blocking(int socket_fd) {
  int flags;
  flags = get_socket_flags(socket_fd);
  flags |= O_NONBLOCK;
  set_socket_flags(socket_fd, flags);
  return flags;
}


x86 assembly (clang, -O0):
<set_socket_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <get_socket_flags@plt>
mov    %eax,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <set_socket_flags@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_non_blocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <get_socket_flags@plt>
mov    %eax,%ebp
mov    0x2eb5(%rip),%rax
or     (%rax),%ebp
mov    %ebx,%edi
mov    %ebp,%esi
call   1030 <set_socket_flags@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_NONBLOCK = global i32 0
define i32 @set_socket_non_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_socket_flags(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* @O_NONBLOCK
%7 = load i32, i32* %3
%8 = or i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @set_socket_flags(i32 %9, i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@O_NONBLOCK = global i32 0
define i32 @set_socket_non_blocking(i32 %0) {
%2 = tail call i32 @get_socket_flags(i32 %0)
%3 = load i32, i32* @O_NONBLOCK
%4 = or i32 %3, %2
%5 = tail call i32 @set_socket_flags(i32 %0, i32 %4)
ret i32 %4
}
short saturate(int val) {
  if (val > 32767)
    return 32767;
  else if (val < -32768)
    return -32768;
  else
    return val;
}


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7fff,-0x8(%rbp)
jle    111f <saturate+0x1f>
movw   $0x7fff,-0x2(%rbp)
jmp    113e <saturate+0x3e>
cmpl   $0xffff8000,-0x8(%rbp)
jge    1137 <saturate+0x37>
movw   $0x8000,-0x2(%rbp)
jmp    113e <saturate+0x3e>
mov    -0x8(%rbp),%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
cmp    $0xffff8001,%edi
mov    $0xffff8000,%ecx
cmovge %edi,%ecx
cmp    $0x7fff,%ecx
mov    $0x7fff,%eax
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define signext i16 @saturate(i32 %0) {
%2 = alloca i16
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 32767
br i1 %5, label %6, label %7
6: ; preds = %1
store i16 32767, i16* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, -32768
br i1 %9, label %10, label %11
10: ; preds = %7
store i16 -32768, i16* %2
br label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i16
store i16 %13, i16* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @saturate(i32 %0) {
%2 = icmp sgt i32 %0, -32768
%3 = select i1 %2, i32 %0, i32 -32768
%4 = icmp slt i32 %3, 32767
%5 = select i1 %4, i32 %3, i32 32767
%6 = trunc i32 %5 to i16
ret i16 %6
}
/* Type definitions */
struct block_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bdev_get_queue(struct block_device *);
unsigned short queue_logical_block_size(int /*<<< orphan*/);
__attribute__((always_)) unsigned short
bdev_logical_block_size(struct block_device *bdev) {
  return queue_logical_block_size(bdev_get_queue(bdev));
}


x86 assembly (clang, -O0):
<bdev_logical_block_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <bdev_get_queue@plt>
mov    %eax,%edi
call   1030 <queue_logical_block_size@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdev_logical_block_size>:
push   %rax
call   1040 <bdev_get_queue@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <queue_logical_block_size@plt>

LLVM IR (-O0):
%struct.block_device = type { i32 }
define zeroext i16 @bdev_logical_block_size(%struct.block_device* %0) {
%2 = alloca %struct.block_device*
store %struct.block_device* %0, %struct.block_device** %2
%3 = load %struct.block_device*, %struct.block_device** %2
%4 = call i32 @bdev_get_queue(%struct.block_device* %3)
%5 = call zeroext i16 @queue_logical_block_size(i32 %4)
ret i16 %5
}

LLVM IR (-O2):
%struct.block_device = type { i32 }
define zeroext i16 @bdev_logical_block_size(%struct.block_device* %0) {
%2 = tail call i32 @bdev_get_queue(%struct.block_device* %0)
%3 = tail call zeroext i16 @queue_logical_block_size(i32 %2)
ret i16 %3
}
void print_binary_tree_pre_order(struct binaryTree *root) {
  struct binaryTree *curr = root;
  if (!curr)
    return;
}


x86 assembly (clang, -O0):
<print_binary_tree_pre_order>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1120 <print_binary_tree_pre_order+0x20>
jmp    1120 <print_binary_tree_pre_order+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.binaryTree = type opaque
define void @print_binary_tree_pre_order(%struct.binaryTree* %0) {
%2 = alloca %struct.binaryTree*
%3 = alloca %struct.binaryTree*
store %struct.binaryTree* %0, %struct.binaryTree** %2
%4 = load %struct.binaryTree*, %struct.binaryTree** %2
store %struct.binaryTree* %4, %struct.binaryTree** %3
%5 = load %struct.binaryTree*, %struct.binaryTree** %3
%6 = icmp ne %struct.binaryTree* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
br label %8
8: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.binaryTree = type opaque
define void @print_binary_tree_pre_order(%struct.binaryTree* nocapture %0) {
ret void
}
void av_strndup() {}


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

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

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

LLVM IR (-O2):
define void @av_strndup() {
ret void
}
long fact(int n) {
  long ans;
  for (ans = 1; n > 1; n--) {
    ans *= n;
  }
  return ans;
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1134 <fact+0x34>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    110f <fact+0xf>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <fact+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <fact+0x20>
ret

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

LLVM IR (-O2):
define i64 @fact(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %9, %5 ]
%7 = phi i64 [ 1, %3 ], [ %8, %5 ]
%8 = mul nsw i64 %7, %6
%9 = add nsw i64 %6, -1
%10 = icmp ugt i64 %6, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %8, %5 ]
ret i64 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int /*<<< orphan*/ iswlower(int /*<<< orphan*/);
void uninitvar_iswlower(void) {
  wint_t i;
  (void)iswlower(i);
}


x86 assembly (clang, -O0):
<uninitvar_iswlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%edi
call   1030 <iswlower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_iswlower>:
jmp    1030 <iswlower@plt>

LLVM IR (-O0):
define void @uninitvar_iswlower() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @iswlower(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_iswlower() {
%1 = tail call i32 @iswlower(i32 undef)
ret void
}
/* Variables and functions */
int linsert(int, int);
int tab(int f, int n) {
  if (n < 0)
    return (0);
  return (linsert(n, 9));
}


x86 assembly (clang, -O0):
<tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1134 <tab+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1144 <tab+0x34>
mov    -0xc(%rbp),%edi
mov    $0x9,%esi
call   1030 <linsert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tab>:
test   %esi,%esi
js     1120 <tab+0x10>
mov    %esi,%edi
mov    $0x9,%esi
jmp    1030 <linsert@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @tab(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @linsert(i32 %1, i32 9)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
double M_PI;
double nanotec_rad_to_deg(double rad) { return rad * 180.0 / M_PI; }


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

x86 assembly (clang, -O2):
<nanotec_rad_to_deg>:
mulsd  0xef8(%rip),%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @nanotec_rad_to_deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = load double, double* @M_PI
%6 = fdiv double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @nanotec_rad_to_deg(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = load double, double* @M_PI
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
unsigned int RAND_MAX;
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
int rand_r(unsigned int *seed) {
  _DIAGASSERT(seed != NULL);
  return ((*seed = *seed * 1103515245 + 12345) & RAND_MAX);
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rax
imul   $0x41c64e6d,(%rax),%eax
add    $0x3039,%eax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
mov    0x2e9e(%rip),%rcx
and    (%rcx),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <_DIAGASSERT@plt>
imul   $0x41c64e6d,(%rbx),%eax
add    $0x3039,%eax
mov    %eax,(%rbx)
mov    0x2eb2(%rip),%rcx
and    (%rcx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rand_r(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = mul i32 %8, 1103515245
%10 = add i32 %9, 12345
%11 = load i32*, i32** %2
store i32 %10, i32* %11
%12 = load i32, i32* @RAND_MAX
%13 = and i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_r(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = load i32, i32* %0
%6 = mul i32 %5, 1103515245
%7 = add i32 %6, 12345
store i32 %7, i32* %0
%8 = load i32, i32* @RAND_MAX
%9 = and i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usleep(int);
void *pinta_cruz() {
  while (1) {
    printf("+");
    usleep(200);
  }
}


x86 assembly (clang, -O0):
<pinta_cruz>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <pinta_cruz+0x9>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xc8,%edi
call   1040 <usleep@plt>
jmp    1129 <pinta_cruz+0x9>

x86 assembly (clang, -O2):
<pinta_cruz>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2b,%edi
call   1030 <putchar@plt>
mov    $0xc8,%edi
call   1040 <usleep@plt>
jmp    1130 <pinta_cruz+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"+\00"
define i8* @pinta_cruz() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @usleep(i32 200)
br label %1
}

LLVM IR (-O2):
define noalias i8* @pinta_cruz() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @putchar(i32 43)
%3 = tail call i32 @usleep(i32 200)
br label %1
}
int harmless() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @harmless() {
ret i32 0
}
unsigned int _U_Qfcnvfxt_quad_to_usgl(long double a) {
  extern long long _U_Qfcnvfxt_quad_to_dbl(long double a);
  return (unsigned int)_U_Qfcnvfxt_quad_to_dbl(a);
}


x86 assembly (clang, -O0):
<_U_Qfcnvfxt_quad_to_usgl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <_U_Qfcnvfxt_quad_to_dbl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_U_Qfcnvfxt_quad_to_usgl>:
jmp    1030 <_U_Qfcnvfxt_quad_to_dbl@plt>

LLVM IR (-O0):
define i32 @_U_Qfcnvfxt_quad_to_usgl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @_U_Qfcnvfxt_quad_to_dbl(x86_fp80 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_U_Qfcnvfxt_quad_to_usgl(x86_fp80 %0) {
%2 = tail call i64 @_U_Qfcnvfxt_quad_to_dbl(x86_fp80 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void nullingArray(char *array) {
  for (int i = 0; i < sizeof(array); i++)
    array[i] = '\0';
}


x86 assembly (clang, -O0):
<nullingArray>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movslq -0xc(%rbp),%rax
cmp    $0x8,%rax
jae    1137 <nullingArray+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <nullingArray+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nullingArray>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @nullingArray(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i64*
store i64 0, i64* %2
ret void
}
/* Variables and functions */
scalar_t__ is_http_char(int);
int /*<<< orphan*/ is_http_ctl(int);
int /*<<< orphan*/ is_http_separator(int);
int is_http_token(int c) {
  return is_http_char(c) && !is_http_ctl(c) && !is_http_separator(c);
}


x86 assembly (clang, -O0):
<is_http_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <is_http_char@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1180 <is_http_token+0x50>
mov    -0x4(%rbp),%edi
call   1040 <is_http_ctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1180 <is_http_token+0x50>
mov    -0x4(%rbp),%edi
call   1030 <is_http_separator@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_http_token>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <is_http_char@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115a <is_http_token+0x2a>
mov    %ebp,%edi
call   1040 <is_http_ctl@plt>
test   %eax,%eax
jne    115a <is_http_token+0x2a>
mov    %ebp,%edi
call   1030 <is_http_separator@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_http_token(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @is_http_char(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @is_http_ctl(i32 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @is_http_separator(i32 %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_http_token(i32 %0) {
%2 = tail call i64 @is_http_char(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @is_http_ctl(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i32 @is_http_separator(i32 %0)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float, float);
float soma(float, int);
int main() {
  int a;
  float b, res;
  a = 10;
  b = 12.3;
  res = soma(b, a);
  printf("A soma de %d com %6.3f é %6.3f\n", a, b, res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movss  0xec2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1040 <soma@plt>
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
mov    $0xa,%edi
call   1040 <soma@plt>
movaps %xmm0,%xmm1
lea    0xec7(%rip),%rdi
mov    $0xa,%esi
movss  0xeb6(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"A soma de %d com %6.3f \C3\A9 %6.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store i32 10, i32* %2
store float 0x40289999A0000000, float* %3
%5 = load float, float* %3
%6 = load i32, i32* %2
%7 = call float @soma(float %5, i32 %6)
store float %7, float* %4
%8 = load i32, i32* %2
%9 = load float, float* %3
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8, float %9, float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"A soma de %d com %6.3f \C3\A9 %6.3f\0A\00"
define i32 @main() {
%1 = tail call float @soma(float 0x40289999A0000000, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 10, float 0x40289999A0000000, float %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
long sysconf(int name) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sysconf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec1(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysconf>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i64 @sysconf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i64 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i64 @sysconf(i32 %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i64 -1
}
/* Type definitions */
struct genhash {
  int dummy;
};
struct entry_hash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genhash_clear(struct genhash *);
void entry_hash_clear(struct entry_hash *tthis) {
  genhash_clear((struct genhash *)tthis);
}


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

x86 assembly (clang, -O2):
<entry_hash_clear>:
jmp    1030 <genhash_clear@plt>

LLVM IR (-O0):
%struct.entry_hash = type { i32 }
%struct.genhash = type { i32 }
define void @entry_hash_clear(%struct.entry_hash* %0) {
%2 = alloca %struct.entry_hash*
store %struct.entry_hash* %0, %struct.entry_hash** %2
%3 = load %struct.entry_hash*, %struct.entry_hash** %2
%4 = bitcast %struct.entry_hash* %3 to %struct.genhash*
%5 = call i32 @genhash_clear(%struct.genhash* %4)
ret void
}

LLVM IR (-O2):
%struct.entry_hash = type { i32 }
%struct.genhash = type { i32 }
define void @entry_hash_clear(%struct.entry_hash* %0) {
%2 = bitcast %struct.entry_hash* %0 to %struct.genhash*
%3 = tail call i32 @genhash_clear(%struct.genhash* %2)
ret void
}
void test_three(int x, int y) {
#pragma omp target simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
float mp3d_scale_pcm(float sample) { return sample * (1.f / 32768.f); }


x86 assembly (clang, -O0):
<mp3d_scale_pcm>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @mp3d_scale_pcm(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F00000000000000
ret float %4
}

LLVM IR (-O2):
define float @mp3d_scale_pcm(float %0) {
%2 = fmul float %0, 0x3F00000000000000
ret float %2
}
void spti_init(void) {}


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

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

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

LLVM IR (-O2):
define void @spti_init() {
ret void
}
/* Variables and functions */
bool last_png_input_page(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @last_png_input_page() {
ret i32 1
}

LLVM IR (-O2):
define i32 @last_png_input_page() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sleep(int);
void *thread1(void *vargp) {
  char *a = (char *)malloc(20);
  char *b = (char *)malloc(20);
  char *c = (char *)malloc(20);
  free(a);
  free(b);
  free(c);
  sleep(100);
  return NULL;
}


x86 assembly (clang, -O0):
<thread1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x64,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread1>:
push   %r15
push   %r14
push   %rbx
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x64,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @thread1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = call i64 @malloc(i32 20)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %3
%8 = call i64 @malloc(i32 20)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %4
%10 = call i64 @malloc(i32 20)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
%16 = load i8*, i8** %5
%17 = call i32 @free(i8* %16)
%18 = call i32 @sleep(i32 100)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread1(i8* nocapture readnone %0) {
%2 = tail call i64 @malloc(i32 20)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i64 @malloc(i32 20)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @malloc(i32 20)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @free(i8* %3)
%9 = tail call i32 @free(i8* %5)
%10 = tail call i32 @free(i8* %7)
%11 = tail call i32 @sleep(i32 100)
ret i8* null
}
int b(int n) { return n * n; }


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

x86 assembly (clang, -O2):
<b>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @b(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
struct table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct table *);
void release_table(struct table *p_table) {
  if (!p_table) {
    return;
  }
  free(p_table);
}


x86 assembly (clang, -O0):
<release_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <release_table+0x1c>
jmp    1135 <release_table+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_table>:
test   %rdi,%rdi
je     111a <release_table+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.table = type { i32 }
define void @release_table(%struct.table* %0) {
%2 = icmp eq %struct.table* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.table* %0)
br label %5
5: ; preds = %1, %3
ret void
}
double mu_d(double mu_rep, double gamma_M) { return (mu_rep / gamma_M); }


x86 assembly (clang, -O0):
<mu_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mu_d>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @mu_d(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int is_email_wsp(char c) { return strchr(" \t\r\n", c) != NULL; }


x86 assembly (clang, -O0):
<is_email_wsp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_email_wsp>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c" \09\0D\0A\00"
define i32 @is_email_wsp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c" \09\0D\0A\00"
define i32 @is_email_wsp(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
double onlyTwoDecimals(double incoming) {
  double holdNum = incoming * 100.0f;
  int holdNum2 = (int)holdNum;
  holdNum = (double)holdNum2;
  holdNum = holdNum / 100.0f;
  holdNum = (double)((int)holdNum);
  return holdNum;
}


x86 assembly (clang, -O0):
<onlyTwoDecimals>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyTwoDecimals>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @onlyTwoDecimals(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 1.000000e+02
store double %6, double* %3
%7 = load double, double* %3
%8 = fptosi double %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to double
store double %10, double* %3
%11 = load double, double* %3
%12 = fdiv double %11, 1.000000e+02
store double %12, double* %3
%13 = load double, double* %3
%14 = fptosi double %13 to i32
%15 = sitofp i32 %14 to double
store double %15, double* %3
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @onlyTwoDecimals(double %0) {
%2 = fmul double %0, 1.000000e+02
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 1.000000e+02
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
ret double %7
}
int GetNumberDigitsInteger(char *input, const int length, const char decChar) {
  int totDigits = 0;
  int i = 0;
  for (i = 0; i < length; i++) {
    if (input[i] == decChar)
      break;
    totDigits++;
  }
  return totDigits;
}


x86 assembly (clang, -O0):
<GetNumberDigitsInteger>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <GetNumberDigitsInteger+0x65>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <GetNumberDigitsInteger+0x4e>
jmp    1165 <GetNumberDigitsInteger+0x65>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1125 <GetNumberDigitsInteger+0x25>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNumberDigitsInteger>:
test   %esi,%esi
jle    1121 <GetNumberDigitsInteger+0x21>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmp    %dl,(%rdi,%rax,1)
je     1120 <GetNumberDigitsInteger+0x20>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <GetNumberDigitsInteger+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @GetNumberDigitsInteger(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %1, %12 ]
ret i32 %18
}