xunge/DecIR huggingface dataset:
int odd_ones(unsigned x) {
  unsigned high_16_bits = x >> 16;
  unsigned xor_16_bits = high_16_bits ^ x;
  unsigned high_8_bits = xor_16_bits >> 8;
  unsigned xor_8_bits = high_8_bits ^ xor_16_bits;
  unsigned high_4_bits = xor_8_bits >> 4;
  unsigned xor_4_bits = high_4_bits ^ xor_8_bits;
  unsigned high_2_bits = xor_4_bits >> 2;
  unsigned xor_2_bits = high_2_bits ^ xor_4_bits;
  unsigned high_1_bit = xor_2_bits >> 1;
  unsigned xor_1_bit = high_1_bit ^ xor_2_bits;
  return xor_1_bit & 0x01;
}


x86 assembly (clang, -O0):
<odd_ones>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shr    $0x2,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
xor    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odd_ones>:
mov    %edi,%eax
shr    $0x10,%eax
xor    %edi,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    $0x4,%eax
xor    %ecx,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
xor    %eax,%ecx
mov    %ecx,%eax
shr    %eax
xor    %ecx,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @odd_ones(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %2
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %2
%17 = xor i32 %15, %16
store i32 %17, i32* %4
%18 = load i32, i32* %4
%19 = lshr i32 %18, 8
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = load i32, i32* %4
%22 = xor i32 %20, %21
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = lshr i32 %23, 4
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = xor i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = lshr i32 %28, 2
store i32 %29, i32* %9
%30 = load i32, i32* %9
%31 = load i32, i32* %8
%32 = xor i32 %30, %31
store i32 %32, i32* %10
%33 = load i32, i32* %10
%34 = lshr i32 %33, 1
store i32 %34, i32* %11
%35 = load i32, i32* %11
%36 = load i32, i32* %10
%37 = xor i32 %35, %36
store i32 %37, i32* %12
%38 = load i32, i32* %12
%39 = and i32 %38, 1
ret i32 %39
}

LLVM IR (-O2):
define i32 @odd_ones(i32 %0) {
%2 = lshr i32 %0, 16
%3 = xor i32 %2, %0
%4 = lshr i32 %3, 8
%5 = xor i32 %4, %3
%6 = lshr i32 %5, 4
%7 = xor i32 %6, %5
%8 = lshr i32 %7, 2
%9 = xor i32 %8, %7
%10 = lshr i32 %9, 1
%11 = xor i32 %10, %9
%12 = and i32 %11, 1
ret i32 %12
}
int GetValueFromASM() {
  int no = 100, val = 0;
  asm("mov %1, %%ebx;"
      "mov %%ebx, %0;"
      : "=r"(val)
      : "r"(no)
      : "%ebx");
  return val;
}


x86 assembly (clang, -O0):
<GetValueFromASM>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x64,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ebx
mov    %ebx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetValueFromASM>:
push   %rbx
mov    $0x64,%eax
mov    %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetValueFromASM() {
%1 = alloca i32
%2 = alloca i32
store i32 100, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = call i32 asm "mov $1, %ebx;mov %ebx, $0;", "=r,r,~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetValueFromASM() {
%1 = tail call i32 asm "mov $1, %ebx;mov %ebx, $0;", "=r,r,~{ebx},~{dirflag},~{fpsr},~{flags}"(i32 100)
ret i32 %1
}
void init_new_windows(void) {}


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

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

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

LLVM IR (-O2):
define void @init_new_windows() {
ret void
}
void clearstack(void) {
  extern sp;
  sp = 0;
}


x86 assembly (clang, -O0):
<clearstack>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearstack>:
mov    0x2ed9(%rip),%rax
movl   $0x0,(%rax)
ret

LLVM IR (-O0):
@sp = external global i32
define void @clearstack() {
store i32 0, i32* @sp
ret void
}

LLVM IR (-O2):
@sp = external global i32
define void @clearstack() {
store i32 0, i32* @sp
ret void
}
double TPU_ch3_unit_in_sec(void) { return (1024.0 / 48e6); }


x86 assembly (clang, -O0):
<TPU_ch3_unit_in_sec>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @TPU_ch3_unit_in_sec() {
ret double 0x3EF65E9F80F29212
}

LLVM IR (-O2):
define double @TPU_ch3_unit_in_sec() {
ret double 0x3EF65E9F80F29212
}
int gettext_init_locale(const char *locale) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gettext_init_locale(i8* nocapture readnone %0) {
ret i32 0
}
void fa118(int n) {
  {
    int b[n];
    {
      int c[n];
      0;
    }
    {
      int d[n];
      0;
    };
    int e[n];
  a:
    goto a;
    0;
  };
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa118>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rax,-0x40(%rbp)
jmp    114d <fa118+0x4d>

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

LLVM IR (-O0):
define void @fa118(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
%27 = load i8*, i8** %5
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
%30 = call i8* @llvm.stacksave()
store i8* %30, i8** %7
%31 = alloca i32, i64 %29
store i64 %29, i64* %8
%32 = load i8*, i8** %7
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
%35 = alloca i32, i64 %34
store i64 %34, i64* %9
br label %36
36: ; preds = %36, %1
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
%40 = call i8* @llvm.stacksave()
store i8* %40, i8** %10
%41 = alloca i32, i64 %39
store i64 %39, i64* %11
%42 = load i32, i32* %2
%43 = zext i32 %42 to i64
%44 = call i8* @llvm.stacksave()
store i8* %44, i8** %12
%45 = alloca i32, i64 %43
store i64 %43, i64* %13
%46 = load i8*, i8** %12
%47 = load i32, i32* %2
%48 = zext i32 %47 to i64
%49 = call i8* @llvm.stacksave()
store i8* %49, i8** %14
%50 = alloca i32, i64 %48
store i64 %48, i64* %15
%51 = load i8*, i8** %14
%52 = load i32, i32* %2
%53 = zext i32 %52 to i64
%54 = alloca i32, i64 %53
store i64 %53, i64* %16
%55 = load i8*, i8** %10
%56 = load i32, i32* %2
%57 = zext i32 %56 to i64
%58 = call i8* @llvm.stacksave()
store i8* %58, i8** %17
%59 = alloca i32, i64 %57
store i64 %57, i64* %18
%60 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa118(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ MCL_CURRENT;
int /*<<< orphan*/ MCL_FUTURE;
int /*<<< orphan*/ MCL_ONFAULT;
int mlockall(int /*<<< orphan*/);
int munlockall();
int main(void) {
  int ret;
  ret = mlockall(MCL_CURRENT);
  (void)ret;
  ret = mlockall(MCL_FUTURE);
  (void)ret;
  ret = mlockall(MCL_ONFAULT);
  (void)ret;
  return munlockall();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <munlockall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <mlockall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <munlockall@plt>

LLVM IR (-O0):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@MCL_ONFAULT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @MCL_CURRENT
%4 = call i32 @mlockall(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @MCL_FUTURE
%7 = call i32 @mlockall(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* @MCL_ONFAULT
%10 = call i32 @mlockall(i32 %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 (...) @munlockall()
ret i32 %12
}

LLVM IR (-O2):
@MCL_CURRENT = global i32 0
@MCL_FUTURE = global i32 0
@MCL_ONFAULT = global i32 0
define i32 @main() {
%1 = load i32, i32* @MCL_CURRENT
%2 = tail call i32 @mlockall(i32 %1)
%3 = load i32, i32* @MCL_FUTURE
%4 = tail call i32 @mlockall(i32 %3)
%5 = load i32, i32* @MCL_ONFAULT
%6 = tail call i32 @mlockall(i32 %5)
%7 = tail call i32 (...) @munlockall()
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, unsigned int);
int /*<<< orphan*/ stderr;
void *orealloc(void *po, unsigned int len) {
  void *tmp;
  if ((tmp = realloc(po, len)) == NULL) {
    fprintf(stderr, "Can't reallocate memory");
    exit(-1);
  }
  return (tmp);
}


x86 assembly (clang, -O0):
<orealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1178 <orealloc+0x48>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
lea    0xe97(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<orealloc>:
push   %rax
call   1040 <realloc@plt>
test   %rax,%rax
je     113d <orealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Can't reallocate memory\00"
define i8* @orealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Can't reallocate memory\00"
define i8* @orealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int function(char *);
int main() { return function("asdf"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = tail call i32 @function(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
long LONG_MAX;
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  long foo1 = LONG_MAX;
  long foo2 = 9223372036854775807;
  printf("%li\n", foo1);
  printf("%li\n", foo2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rax
mov    (%rax),%rsi
lea    0xede(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movabs $0x7fffffffffffffff,%rsi
ff ff 7f
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@LONG_MAX = global i64 0
@.str = [5 x i8] c"%li\0A\00"
define i32 @main() {
%1 = load i64, i64* @LONG_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 9223372036854775807)
ret i32 0
}
/* Variables and functions */
void unref_pages(void *ptr, size_t siz, void *data) {}


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

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

LLVM IR (-O0):
define void @unref_pages(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @unref_pages(i8* nocapture %0, i64 %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ filename_size(char *, int, struct tm const *);
void filename_size_hour(char *buf, int level, const struct tm *ts) {
  filename_size(buf, level, ts);
}


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

x86 assembly (clang, -O2):
<filename_size_hour>:
jmp    1030 <filename_size@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @filename_size_hour(i8* %0, i32 %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.tm* %2, %struct.tm** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i32 @filename_size(i8* %7, i32 %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @filename_size_hour(i8* %0, i32 %1, %struct.tm* %2) {
%4 = tail call i32 @filename_size(i8* %0, i32 %1, %struct.tm* %2)
ret void
}
void abc() {}


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

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

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

LLVM IR (-O2):
define void @abc() {
ret void
}
/* Type definitions */
struct xrdp_tcp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_free(struct xrdp_tcp *);
void xrdp_tcp_delete(struct xrdp_tcp *self) { g_free(self); }


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

x86 assembly (clang, -O2):
<xrdp_tcp_delete>:
jmp    1030 <g_free@plt>

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

LLVM IR (-O2):
%struct.xrdp_tcp = type { i32 }
define void @xrdp_tcp_delete(%struct.xrdp_tcp* %0) {
%2 = tail call i32 @g_free(%struct.xrdp_tcp* %0)
ret void
}
signed int f43(signed long long v_x) {
  signed long long v_shr3 = ((unsigned long long)v_x) >> 12;
  signed int v_shr3_tr = (unsigned int)v_shr3;
  signed int v_conv = v_shr3_tr & -4;
  return v_conv;
}


x86 assembly (clang, -O0):
<f43>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0xfffffffc,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f43>:
mov    %rdi,%rax
shr    $0xc,%rax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @f43(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = lshr i64 %6, 12
store i64 %7, i64* %3
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = and i32 %10, -4
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @f43(i64 %0) {
%2 = lshr i64 %0, 12
%3 = trunc i64 %2 to i32
%4 = and i32 %3, -4
ret i32 %4
}
int functiona(int a, int b) { return a + b; }


x86 assembly (clang, -O0):
<functiona>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<functiona>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @functiona(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, soma;
  scanf("%d", &a);
  scanf("%d", &b);
  soma = a + b;
  printf("SOMA = %d\n", soma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
add    0xc(%rsp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"SOMA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"SOMA = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int, size_t);
unsigned char *castle_norm_key_pad(unsigned char *dst, int pad_val, int end_val,
                                   size_t len) {
  memset(dst, pad_val, len);
  dst += len;
  *dst++ = end_val;
  return dst;
}


x86 assembly (clang, -O0):
<castle_norm_key_pad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<castle_norm_key_pad>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%rbx
mov    %edx,%r14d
mov    %rdi,%rbp
mov    %rcx,%rdx
call   1030 <memset@plt>
lea    (%rbx,%rbp,1),%rax
add    $0x1,%rax
mov    %r14b,0x0(%rbp,%rbx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @castle_norm_key_pad(i8* %0, i32 %1, i32 %2, i64 %3) {
%5 = tail call i32 @memset(i8* %0, i32 %1, i64 %3)
%6 = getelementptr inbounds i8, i8* %0, i64 %3
%7 = trunc i32 %2 to i8
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %7, i8* %6
ret i8* %8
}
/* Variables and functions */
int checkcmp();
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ unlink(char *);
int checksocklib() {
  int rc;
  unlink("tools/.chk");
  system("gcc tools/chksock.c -o tools/chksock"
         " 2>tools/.chk ");
  return checkcmp();
}


x86 assembly (clang, -O0):
<checksocklib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec0(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <checkcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checksocklib>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <unlink@plt>
lea    0xec7(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <checkcmp@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [51 x i8] c"gcc tools/chksock.c -o tools/chksock 2>tools/.chk \00"
define i32 @checksocklib() {
%1 = alloca i32
%2 = call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @checkcmp()
ret i32 %4
}

LLVM IR (-O2):
@.str = [11 x i8] c"tools/.chk\00"
@.str.1 = [51 x i8] c"gcc tools/chksock.c -o tools/chksock 2>tools/.chk \00"
define i32 @checksocklib() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @checkcmp()
ret i32 %3
}
char current(const char **input) { return **input; }


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

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

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

LLVM IR (-O2):
define signext i8 @current(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void ver() { print("\nPDOS: ver.2.0.1\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"\0APDOS: ver.2.0.1\0A\00"
define void @ver() {
%1 = call i32 @print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0APDOS: ver.2.0.1\0A\00"
define void @ver() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
float erp(float k_p, float k_d, float s) {
  return ((s * (k_p)) / (((s) * (k_p)) + (k_d)));
}


x86 assembly (clang, -O0):
<erp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<erp>:
mulss  %xmm2,%xmm0
addss  %xmm0,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @erp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = load float, float* %6
%11 = load float, float* %4
%12 = load float, float* %5
%13 = call float @llvm.fmuladd.f32(float %10, float %11, float %12)
%14 = fdiv float %9, %13
ret float %14
}

LLVM IR (-O2):
define float @erp(float %0, float %1, float %2) {
%4 = fmul float %0, %2
%5 = tail call float @llvm.fmuladd.f32(float %2, float %0, float %1)
%6 = fdiv float %4, %5
ret float %6
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void send_qual(struct ship *ship, long a) { Write(18, ship, a, 0, 0, 0); }


x86 assembly (clang, -O0):
<send_qual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x12,%edi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_qual>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x12,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_qual(%struct.ship* %0, i64 %1) {
%3 = alloca %struct.ship*
%4 = alloca i64
store %struct.ship* %0, %struct.ship** %3
store i64 %1, i64* %4
%5 = load %struct.ship*, %struct.ship** %3
%6 = load i64, i64* %4
%7 = call i32 @Write(i32 18, %struct.ship* %5, i64 %6, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_qual(%struct.ship* %0, i64 %1) {
%3 = tail call i32 @Write(i32 18, %struct.ship* %0, i64 %1, i32 0, i32 0, i32 0)
ret void
}
int is_leap_year(int yr) {
  if (yr % 400 == 0) {
    return 1;
  }
  if (yr % 100 == 0) {
    return 0;
  }
  return yr % 4 == 0;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <is_leap_year+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1160 <is_leap_year+0x60>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <is_leap_year+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1160 <is_leap_year+0x60>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <is_leap_year+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <is_leap_year+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_function() { printf("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @test_function() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @test_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
int isdict(unsigned char *dict, int length, unsigned char c) {
  int ii;
  for (ii = 0; ii < length; ii++)
    if (dict[ii] == c)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdict>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115a <isdict+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1147 <isdict+0x47>
movl   $0x1,-0x4(%rbp)
jmp    1161 <isdict+0x61>
jmp    114c <isdict+0x4c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <isdict+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isdict(i8* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8 %2, i8* %7
store i32 0, i32* %8
br label %9
9: ; preds = %25, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %9
%14 = load i8*, i8** %5
%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 = zext i8 %18 to i32
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = icmp eq i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %13
store i32 1, i32* %4
br label %29
24: ; preds = %13
br label %25
25: ; preds = %24
%26 = load i32, i32* %8
%27 = add nsw i32 %26, 1
store i32 %27, i32* %8
br label %9
28: ; preds = %9
store i32 0, i32* %4
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %4
ret i32 %30
}

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


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

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

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

LLVM IR (-O2):
define void @__aeabi_uidiv() {
ret void
}
int cmd_cluster_status(int fd, int argc, char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<cmd_cluster_status>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cmd_cluster_status(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @cmd_cluster_status(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ read_string(char *, char *, int);
int sscanf(char *, char *, int *);
int read_int(char *filename, int *value) {
  char buf[20];
  if (0 < read_string(filename, buf, 20)) {
    return (1 == sscanf(buf, "%d", value));
  }
  return 0;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x14,%edx
call   1040 <read_string@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jge    117d <read_int+0x5d>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <read_int+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %rsp,%rsi
mov    $0x14,%edx
call   1040 <read_string@plt>
test   %rax,%rax
jle    1158 <read_int+0x38>
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
call   1030 <sscanf@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
jmp    115a <read_int+0x3a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @read_int(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [20 x i8]
store i8* %0, i8** %4
store i32* %1, i32** %5
%7 = load i8*, i8** %4
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%9 = call i64 @read_string(i8* %7, i8* %8, i32 20)
%10 = icmp slt i64 0, %9
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = icmp eq i32 1, %14
%16 = zext i1 %15 to i32
store i32 %16, i32* %3
br label %18
17: ; preds = %2
store i32 0, i32* %3
br label %18
18: ; preds = %17, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @read_int(i8* %0, i32* %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i64 @read_string(i8* %0, i8* %4, i32 20)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ 0, %2 ]
ret i32 %12
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
void cpu_clear(uint64_t *cpu_mask, int cpu) {
  uint64_t *mask;
  mask = cpu_mask + (cpu >> 6);
  *mask &= ~(1ULL << (cpu & ((1ULL << 6) - 1)));
}


x86 assembly (clang, -O0):
<cpu_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x6,%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
movslq -0xc(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x18(%rbp),%rax
and    (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_clear>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x6,%eax
mov    $0xfffffffffffffffe,%rdx
rol    %cl,%rdx
cltq
and    %rdx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @cpu_clear(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64*
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i32, i32* %4
%8 = ashr i32 %7, 6
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %6, i64 %9
store i64* %10, i64** %5
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = and i64 %12, 63
%14 = shl i64 1, %13
%15 = xor i64 %14, -1
%16 = load i64*, i64** %5
%17 = load i64, i64* %16
%18 = and i64 %17, %15
store i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
define void @cpu_clear(i64* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 6
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = and i32 %1, 63
%7 = zext i32 %6 to i64
%8 = shl nuw i64 1, %7
%9 = xor i64 %8, -1
%10 = load i64, i64* %5
%11 = and i64 %10, %9
store i64 %11, i64* %5
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void write32(uint32_t nAddress, uint32_t nValue) {
  *((uint32_t *)nAddress) = nValue;
}


x86 assembly (clang, -O0):
<write32>:
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):
<write32>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @write32(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *showParameters_il() {
  static char text[200];
  sprintf(text, "lenBitmapDiv=%d", 8);
  return text;
}


x86 assembly (clang, -O0):
<showParameters_il>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x8,%edx
call   1030 <sprintf@plt>
lea    0x2f0d(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<showParameters_il>:
push   %rbx
lea    0x2f28(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [16 x i8] c"lenBitmapDiv=%d\00"
define i8* @showParameters_il() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 8)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}

LLVM IR (-O2):
@showParameters_il.text = internal global [200 x i8] zeroinitializer
@.str = [16 x i8] c"lenBitmapDiv=%d\00"
define i8* @showParameters_il() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 8)
ret i8* getelementptr inbounds ([200 x i8], [200 x i8]* @showParameters_il.text, i64 0, i64 0)
}
dbg() {}


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

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

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

LLVM IR (-O2):
define i32 @dbg() {
ret i32 undef
}
/* Variables and functions */
long random();
long rand_range(long min, long max) { return random() % (max - min + 1) + min; }


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
mov    -0x10(%rbp),%rcx
sub    -0x8(%rbp),%rcx
add    $0x1,%rcx
cqto
idiv   %rcx
mov    %rdx,%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <random@plt>
sub    %r14,%rbx
add    $0x1,%rbx
mov    %rax,%rcx
or     %rbx,%rcx
shr    $0x20,%rcx
je     113e <rand_range+0x2e>
cqto
idiv   %rbx
mov    %rdx,%rax
jmp    1144 <rand_range+0x34>
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @rand_range(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i64 (...) @random()
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = srem i64 %5, %9
%11 = load i64, i64* %3
%12 = add nsw i64 %10, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @rand_range(i64 %0, i64 %1) {
%3 = tail call i64 (...) @random()
%4 = sub i64 1, %0
%5 = add i64 %4, %1
%6 = srem i64 %3, %5
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void stub_mutex_enter(pthread_mutex_t *mutex) { pthread_mutex_lock(mutex); }


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

x86 assembly (clang, -O2):
<stub_mutex_enter>:
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define void @stub_mutex_enter(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
ret void
}
/* Variables and functions */
size_t mangle_serialize_get_size(size_t a_size) {
  size_t blks = (a_size / 3);
  return ((blks + 1) * 4);
}


x86 assembly (clang, -O0):
<mangle_serialize_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mangle_serialize_get_size>:
mov    %rdi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rdx,1),%rax
add    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @mangle_serialize_get_size(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = udiv i64 %4, 3
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = add i64 %6, 1
%8 = mul i64 %7, 4
ret i64 %8
}

LLVM IR (-O2):
define i64 @mangle_serialize_get_size(i64 %0) {
%2 = udiv i64 %0, 3
%3 = shl i64 %2, 2
%4 = add i64 %3, 4
ret i64 %4
}