xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int /*<<< orphan*/ printf(char *, int);
int sysconf(int /*<<< orphan*/);
int main() {
  int nproc = sysconf(_SC_NPROCESSORS_ONLN);
  printf("\tNCORES\t %d\n", nproc);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [13 x i8] c"\09NCORES\09 %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @_SC_NPROCESSORS_ONLN
%4 = call i32 @sysconf(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
@.str = [13 x i8] c"\09NCORES\09 %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void open_file_cleanup(char *file_name) { unlink(file_name); }


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

x86 assembly (clang, -O2):
<open_file_cleanup>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @open_file_cleanup(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int EINVAL;
int _checkstrto32(char const *, int /*<<< orphan*/ *, char **);
int checkstrto32(const char *str, int32_t *ret) {
  char *end;
  int err;
  err = _checkstrto32(str, ret, &end);
  if (*end != '\0')
    return -EINVAL;
  return err;
}


x86 assembly (clang, -O0):
<checkstrto32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <_checkstrto32@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <checkstrto32+0x47>
xor    %eax,%eax
mov    0x2e93(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <checkstrto32+0x4d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkstrto32>:
push   %rax
mov    %rsp,%rdx
call   1030 <_checkstrto32@plt>
mov    (%rsp),%rcx
mov    0x2ebc(%rip),%rdx
xor    %esi,%esi
sub    (%rdx),%esi
cmpb   $0x0,(%rcx)
cmovne %esi,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @checkstrto32(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @_checkstrto32(i8* %0, i32* %1, i8** %3)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
%11 = select i1 %8, i32 %5, i32 %10
ret i32 %11
}
/* Variables and functions */
int getKey();
int /*<<< orphan*/ print(char *, int, int);
int getKeyPrompt(char *prompt, int x, int y) {
  print(prompt, x, y);
  return getKey();
}


x86 assembly (clang, -O0):
<getKeyPrompt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <print@plt>
mov    $0x0,%al
call   1040 <getKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getKeyPrompt>:
push   %rax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getKey@plt>

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

LLVM IR (-O2):
define i32 @getKeyPrompt(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @print(i8* %0, i32 %1, i32 %2)
%5 = tail call i32 (...) @getKey()
ret i32 %5
}
/* Type definitions */
struct forth_runtime_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ forth_open_or_create_file(struct forth_runtime_context *,
                                             int);
void forth_create_file(struct forth_runtime_context *rctx) {
  forth_open_or_create_file(rctx, 1);
}


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

x86 assembly (clang, -O2):
<forth_create_file>:
mov    $0x1,%esi
jmp    1030 <forth_open_or_create_file@plt>

LLVM IR (-O0):
%struct.forth_runtime_context = type { i32 }
define void @forth_create_file(%struct.forth_runtime_context* %0) {
%2 = alloca %struct.forth_runtime_context*
store %struct.forth_runtime_context* %0, %struct.forth_runtime_context** %2
%3 = load %struct.forth_runtime_context*, %struct.forth_runtime_context** %2
%4 = call i32 @forth_open_or_create_file(%struct.forth_runtime_context* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.forth_runtime_context = type { i32 }
define void @forth_create_file(%struct.forth_runtime_context* %0) {
%2 = tail call i32 @forth_open_or_create_file(%struct.forth_runtime_context* %0, i32 1)
ret void
}
/* Variables and functions */
char *blissc_package_name();
char *blissc_package_version();
int /*<<< orphan*/ printf(char *, char *, char *);
void print_version(void) {
  printf("%s version %s\n", blissc_package_name(), blissc_package_version());
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <blissc_package_name@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <blissc_package_version@plt>
mov    -0x8(%rbp),%rsi
mov    %rax,%rdx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rbx
xor    %eax,%eax
call   1050 <blissc_package_name@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <blissc_package_version@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s version %s\0A\00"
define void @print_version() {
%1 = call i8* (...) @blissc_package_name()
%2 = call i8* (...) @blissc_package_version()
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s version %s\0A\00"
define void @print_version() {
%1 = tail call i8* (...) @blissc_package_name()
%2 = tail call i8* (...) @blissc_package_version()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
int do_273() { return 273; }


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

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

LLVM IR (-O0):
define i32 @do_273() {
ret i32 273
}

LLVM IR (-O2):
define i32 @do_273() {
ret i32 273
}
void gdk_window_get_internal_paint_info() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_get_internal_paint_info() {
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
size_t thetime(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return (size_t)t.tv_sec;
}


x86 assembly (clang, -O0):
<thetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movslq -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thetime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @thetime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @thetime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int getchar();
int getchar_unlocked(void) { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @getchar_unlocked() {
%1 = call i32 (...) @getchar()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getchar_unlocked() {
%1 = tail call i32 (...) @getchar()
ret i32 %1
}
void fd287(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
a:
  0;
p03B:
  goto p03B;
  goto a;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd287>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd287+0x7>

x86 assembly (clang, -O2):
<fd287>:
jmp    1100 <fd287>

LLVM IR (-O0):
define void @fd287(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; preds = %12
br label %12
13: ; No predecessors!
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
br label %16
16: ; preds = %16, %13
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %42
br label %46
46: ; preds = %46, %45
br label %46
47: ; preds = %47
br label %47
}

LLVM IR (-O2):
define void @fd287(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int FlashSectorSizeGet();
uint32_t FlashSizeGet(void) {
  uint32_t ui32NoOfSectors;
  ui32NoOfSectors =
      ((*((volatile unsigned long *)(0x40030000 + 0x0000002C))) & 0x000000FF) >>
      0;
  return (ui32NoOfSectors * FlashSectorSizeGet());
}


x86 assembly (clang, -O0):
<FlashSizeGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4003002c,%eax
mov    (%rax),%rax
and    $0xff,%rax
shr    $0x0,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <FlashSectorSizeGet@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashSizeGet>:
push   %rbx
mov    0x4003002c,%rax
40
movzbl %al,%ebx
xor    %eax,%eax
call   1030 <FlashSectorSizeGet@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @FlashSizeGet() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 1073938476 to i64*)
%3 = and i64 %2, 255
%4 = lshr i64 %3, 0
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 (...) @FlashSectorSizeGet()
%8 = mul nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @FlashSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1073938476 to i64*)
%2 = trunc i64 %1 to i32
%3 = and i32 %2, 255
%4 = tail call i32 (...) @FlashSectorSizeGet()
%5 = mul nsw i32 %3, %4
ret i32 %5
}
void signed_char_shr_unsigned_char(signed char *LHS, unsigned char RHS) {
  (*LHS) >>= RHS;
}


x86 assembly (clang, -O0):
<signed_char_shr_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
sar    %cl,%edx
mov    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_shr_unsigned_char>:
mov    %esi,%ecx
movsbl (%rdi),%eax
sar    %cl,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_shr_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = ashr i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_shr_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
%6 = ashr i32 %5, %3
%7 = trunc i32 %6 to i8
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int format_int(char *, int, unsigned int, int);
int itox(char *str, unsigned n) {
  int ret = format_int(str, 9, n, 16);
  return ret;
}


x86 assembly (clang, -O0):
<itox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x9,%esi
mov    $0x10,%ecx
call   1030 <format_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itox>:
mov    %esi,%edx
mov    $0x9,%esi
mov    $0x10,%ecx
jmp    1030 <format_int@plt>

LLVM IR (-O0):
define i32 @itox(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @format_int(i8* %6, i32 9, i32 %7, i32 16)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @itox(i8* %0, i32 %1) {
%3 = tail call i32 @format_int(i8* %0, i32 9, i32 %1, i32 16)
ret i32 %3
}
void __my_finite(double __x) {
  int *i;
  i = ((union {
        double __d;
        int __i[2];
      }){__d : __x})
          .__i;
}


x86 assembly (clang, -O0):
<__my_finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { double }
define void @__my_finite(double %0) {
%2 = alloca double
%3 = alloca i32*
%4 = alloca %union.anon
store double %0, double* %2
%5 = bitcast %union.anon* %4 to double*
%6 = load double, double* %2
store double %6, double* %5
%7 = bitcast %union.anon* %4 to [2 x i32]*
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32* %8, i32** %3
ret void
}

LLVM IR (-O2):
define void @__my_finite(double %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void freeDouble(double *greenMile) {
  if (greenMile != NULL) {
    free(greenMile);
  }
}


x86 assembly (clang, -O0):
<freeDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <freeDouble+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @freeDouble(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int skipheader(int (*getin)(void *in), void *in) {
  int i;
  do {
    i = getin(in);
    if (i < 0)
      return (-1);
  } while (i & 0x80);
  return (0);
}


x86 assembly (clang, -O0):
<skipheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdi
call   *%rax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1133 <skipheader+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <skipheader+0x50>
jmp    1138 <skipheader+0x38>
mov    -0x1c(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1110 <skipheader+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipheader>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   *%rbx
test   %eax,%eax
js     1121 <skipheader+0x21>
test   $0x80,%al
jne    1110 <skipheader+0x10>
xor    %eax,%eax
jmp    1126 <skipheader+0x26>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @skipheader(i32 (i8*)* nocapture %0, i8* %1) {
br label %3
3: ; preds = %6, %2
%4 = tail call i32 %0(i8* %1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = and i32 %4, 128
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %6, %3
%10 = phi i32 [ -1, %3 ], [ 0, %6 ]
ret i32 %10
}
int countDecimal(double decimal) {
  int temp = 0;
  int count = 0;
  while (decimal != temp) {
    decimal = decimal * 10;
    temp = decimal;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<countDecimal>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jne    1136 <countDecimal+0x36>
jp     1136 <countDecimal+0x36>
jmp    115e <countDecimal+0x5e>
movsd  0xec2(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1117 <countDecimal+0x17>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countDecimal>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
jne    110e <countDecimal+0xe>
jnp    1137 <countDecimal+0x37>
movsd  0xeea(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
mulsd  %xmm1,%xmm0
add    $0x1,%eax
cvttpd2dq %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    1120 <countDecimal+0x20>
jp     1120 <countDecimal+0x20>
ret

LLVM IR (-O0):
define i32 @countDecimal(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load double, double* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = fcmp une double %6, %8
br i1 %9, label %10, label %17
10: ; preds = %5
%11 = load double, double* %2
%12 = fmul double %11, 1.000000e+01
store double %12, double* %2
%13 = load double, double* %2
%14 = fptosi double %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @countDecimal(double %0) {
%2 = fcmp une double %0, 0.000000e+00
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi double [ %6, %3 ], [ %0, %1 ]
%6 = fmul double %5, 1.000000e+01
%7 = fptosi double %6 to i32
%8 = add nuw nsw i32 %4, 1
%9 = sitofp i32 %7 to double
%10 = fcmp une double %6, %9
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
void repeating2startRepeating_interval_endRepeating() {}


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

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

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

LLVM IR (-O2):
define void @repeating2startRepeating_interval_endRepeating() {
ret void
}
unsigned hash(char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = *s + 31 * hashval;
  }
  return hashval % 101;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <hash+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <hash+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
long double log10(long double);
long double log10l(long double a1) { return log10(a1); }


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

x86 assembly (clang, -O2):
<log10l>:
jmp    1030 <log10@plt>

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

LLVM IR (-O2):
define x86_fp80 @log10l(x86_fp80 %0) {
%2 = tail call x86_fp80 @log10(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ trace(int);
int /*<<< orphan*/ trace_dump();
int main(void) {
  trace(0);
  trace(1);
  trace_dump();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @trace(i32 0)
%3 = call i32 @trace(i32 1)
%4 = call i32 (...) @trace_dump()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @trace(i32 0)
%2 = tail call i32 @trace(i32 1)
%3 = tail call i32 (...) @trace_dump()
ret i32 0
}
int main(int argc, char **argv) {
  void *x = 0;
  struct s *y = (void *)0;
  struct s *z = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s = type opaque
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.s*
%8 = alloca %struct.s*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
store %struct.s* null, %struct.s** %7
store %struct.s* null, %struct.s** %8
ret i32 0
}

LLVM IR (-O2):
%struct.s = type opaque
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
unsigned short int f30(unsigned short int x, long int y) {
  return (x >> (8 * sizeof(unsigned short) - y)) ^ (x << y);
}


x86 assembly (clang, -O0):
<f30>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f30>:
mov    $0x10,%cl
sub    %sil,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f30(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 16, %7
%9 = trunc i64 %8 to i32
%10 = ashr i32 %6, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i64, i64* %4
%14 = trunc i64 %13 to i32
%15 = shl i32 %12, %14
%16 = xor i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f30(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 16, %4
%6 = lshr i32 %3, %5
%7 = shl i32 %3, %4
%8 = xor i32 %6, %7
%9 = trunc i32 %8 to i16
ret i16 %9
}
int inode_size(version)
int version;
{ return (version == 1) ? 32 : 64; }


x86 assembly (clang, -O0):
<inode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x40,%eax
mov    $0x20,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inode_size>:
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
shl    $0x5,%eax
add    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @inode_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 32, i32 64
ret i32 %6
}

LLVM IR (-O2):
define i32 @inode_size(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i32 32, i32 64
ret i32 %3
}
/* Type definitions */
typedef int __m256i;

/* Variables and functions */
__attribute__((target("avx2"))) void CSA256(__m256i *h, __m256i *l, __m256i a,
                                            __m256i b, __m256i c) {
  __m256i u = a ^ b;
  *h = (a & b) | (u & c);
  *l = u ^ c;
}


x86 assembly (clang, -O0):
<CSA256>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
and    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%eax
and    -0x1c(%rbp),%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
xor    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSA256>:
mov    %ecx,%eax
xor    %edx,%eax
and    %edx,%ecx
mov    %eax,%edx
and    %r8d,%edx
or     %ecx,%edx
mov    %edx,(%rdi)
xor    %r8d,%eax
mov    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @CSA256(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2, i32 %3, i32 %4) {
%6 = xor i32 %3, %2
%7 = and i32 %3, %2
%8 = and i32 %6, %4
%9 = or i32 %8, %7
store i32 %9, i32* %0
%10 = xor i32 %6, %4
store i32 %10, i32* %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ memset(void *, int, size_t);
void *xfiredb_calloc(size_t num, size_t size) {
  void *region;
  region = calloc(num, size);
  memset(region, 0x0, num * size);
  return region;
}


x86 assembly (clang, -O0):
<xfiredb_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfiredb_calloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
call   1040 <calloc@plt>
mov    %rax,%r15
imul   %r14,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xfiredb_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = mul i64 %10, %11
%13 = call i32 @memset(i8* %9, i32 0, i64 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @xfiredb_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = mul i64 %1, %0
%5 = tail call i32 @memset(i8* %3, i32 0, i64 %4)
ret i8* %3
}
unsigned long memw32(unsigned char *mem) {
  int i;
  unsigned long w = 0;
  for (i = 0; i < 4; i++)
    w = (w << 8) + *mem++;
  return (w);
}


x86 assembly (clang, -O0):
<memw32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1150 <memw32+0x50>
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <memw32+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @memw32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %0
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %8, %9
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %5
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %11
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ print_internal(char *, unsigned int, int /*<<< orphan*/);
void Terminal_Print(char *string, unsigned int length) {
  print_internal(string, length, 0);
}


x86 assembly (clang, -O0):
<Terminal_Print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <print_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Terminal_Print>:
xor    %edx,%edx
jmp    1030 <print_internal@plt>

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

LLVM IR (-O2):
define void @Terminal_Print(i8* %0, i32 %1) {
%3 = tail call i32 @print_internal(i8* %0, i32 %1, i32 0)
ret void
}
int chartodig(char ch) {
  int ans = ch - 48;
  return ans;
}


x86 assembly (clang, -O0):
<chartodig>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chartodig>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @chartodig(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 48
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @chartodig(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
size_t strnlen(const char *s, size_t maxlen) {
  size_t len = 0;
  while (*s++ && maxlen--)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     114d <strnlen+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115d <strnlen+0x5d>
jmp    116e <strnlen+0x6e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1133 <strnlen+0x33>
test   %rsi,%rsi
je     1133 <strnlen+0x33>
add    $0xffffffffffffffff,%rsi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
je     1133 <strnlen+0x33>
cmp    %rcx,%rsi
mov    %rax,%rcx
jne    1120 <strnlen+0x20>
ret

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

LLVM IR (-O2):
define i64 @strnlen(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = icmp eq i64 %1, 0
%6 = or i1 %4, %5
br i1 %6, label %18, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %13, %7 ], [ 0, %2 ]
%9 = phi i64 [ %12, %7 ], [ %1, %2 ]
%10 = phi i8* [ %11, %7 ], [ %0, %2 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = add i64 %9, -1
%13 = add nuw i64 %8, 1
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
%16 = icmp eq i64 %12, 0
%17 = select i1 %15, i1 true, i1 %16
br i1 %17, label %18, label %7
18: ; preds = %7, %2
%19 = phi i64 [ 0, %2 ], [ %13, %7 ]
ret i64 %19
}
int char_cmp(const void *a, const void *b) {
  char aa = *((char *)a);
  char bb = *((char *)b);
  return aa - bb;
}


x86 assembly (clang, -O0):
<char_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
movsbl -0x11(%rbp),%eax
movsbl -0x12(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_cmp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @char_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %5
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
store i8 %10, i8* %6
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @char_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = sext i8 %3 to i32
%6 = sext i8 %4 to i32
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void myfree(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<myfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @myfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void RTDbgModSymbolAdd(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModSymbolAdd() {
ret void
}
int test_imm_3Auint16_reg(unsigned short val) {
  return ((val) & (-0x3A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Auint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffffc6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_3Auint16_reg>:
test   $0xffc6,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Auint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -58
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int msm_fsusb_set_remote_wakeup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_fsusb_set_remote_wakeup() {
ret i32 0
}
/* Variables and functions */
scalar_t__ islower(int const);
int toupper(const int c) { return islower(c) ? 'A' + (c - 'a') : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 97
%9 = add nsw i32 65, %8
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
unsigned lq2x_generic_input_fmts() { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @lq2x_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @lq2x_generic_input_fmts() {
ret i32 3
}
/* Variables and functions */
void *w32api_mem_alloc(int);
void *msvcrt_new(int size) {
  void *p;
  p = w32api_mem_alloc(size);
  ;
  return p;
}


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

x86 assembly (clang, -O2):
<msvcrt_new>:
jmp    1030 <w32api_mem_alloc@plt>

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

LLVM IR (-O2):
define i8* @msvcrt_new(i32 %0) {
%2 = tail call i8* @w32api_mem_alloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int64_t sdiv64(int64_t a, int64_t b) {
  int64_t r;
  if (b == 0) {
    fprintf(stderr, "Should not happen\n");
    exit(EXIT_FAILURE);
  }
  r = a / b;
  return r;
}


x86 assembly (clang, -O0):
<sdiv64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <sdiv64+0x3b>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdiv64>:
test   %esi,%esi
je     112a <sdiv64+0xa>
mov    %edi,%eax
cltd
idiv   %esi
ret
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @sdiv64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sdiv i32 %14, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Should not happen\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @sdiv64(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
%10 = sdiv i32 %0, %1
ret i32 %10
}