xunge/DecIR huggingface dataset:
/* Variables and functions */
int mul8bit(unsigned char const, int);
unsigned short pack_rgb565(const unsigned char *c) {
  return ((mul8bit(c[2], 31) << 11) | (mul8bit(c[1], 63) << 5) |
          (mul8bit(c[0], 31)));
}


x86 assembly (clang, -O0):
<pack_rgb565>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f,%esi
movzbl 0x2(%rax),%edi
call   1030 <mul8bit@plt>
shl    $0xb,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3f,%esi
movzbl 0x1(%rax),%edi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
shl    $0x5,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1f,%esi
movzbl (%rax),%edi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_rgb565>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
movzbl 0x2(%rdi),%edi
mov    $0x1f,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebp
shl    $0xb,%ebp
movzbl 0x1(%r14),%edi
mov    $0x3f,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebx
shl    $0x5,%ebx
or     %ebp,%ebx
movzbl (%r14),%edi
mov    $0x1f,%esi
call   1030 <mul8bit@plt>
or     %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i16 @pack_rgb565(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = tail call i32 @mul8bit(i8 zeroext %3, i32 31)
%5 = shl i32 %4, 11
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @mul8bit(i8 zeroext %7, i32 63)
%9 = shl i32 %8, 5
%10 = or i32 %9, %5
%11 = load i8, i8* %0
%12 = tail call i32 @mul8bit(i8 zeroext %11, i32 31)
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}
void call0a(char c, short s, int i, long l) {
  c = 'a';
  s = 5;
  i = 6;
  l = 7;
}


x86 assembly (clang, -O0):
<call0a>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
movb   $0x61,-0x1(%rbp)
movw   $0x5,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movq   $0x7,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call0a(i8 signext %0, i16 signext %1, i32 %2, i64 %3) {
%5 = alloca i8
%6 = alloca i16
%7 = alloca i32
%8 = alloca i64
store i8 %0, i8* %5
store i16 %1, i16* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
store i8 97, i8* %5
store i16 5, i16* %6
store i32 6, i32* %7
store i64 7, i64* %8
ret void
}

LLVM IR (-O2):
define void @call0a(i8 signext %0, i16 signext %1, i32 %2, i64 %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int get_balance_policy(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pp1_node_to_cpu(int /*<<< orphan*/);
int get_pp1_balance_policy(uint64_t node, uint64_t *priority_level) {
  uint64_t cpu = pp1_node_to_cpu(node);
  return get_balance_policy(cpu, 0x642, priority_level);
}


x86 assembly (clang, -O0):
<get_pp1_balance_policy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pp1_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x642,%esi
call   1040 <get_balance_policy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pp1_balance_policy>:
push   %rbx
mov    %rsi,%rbx
call   1030 <pp1_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x642,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <get_balance_policy@plt>

LLVM IR (-O0):
define i32 @get_pp1_balance_policy(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* %3
%7 = call i32 @pp1_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
%10 = call i32 @get_balance_policy(i32 %8, i32 1602, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_pp1_balance_policy(i32 %0, i32* %1) {
%3 = tail call i32 @pp1_node_to_cpu(i32 %0)
%4 = tail call i32 @get_balance_policy(i32 %3, i32 1602, i32* %1)
ret i32 %4
}
/* Type definitions */
struct myproc {
  int dummy;
};

/* Variables and functions */
struct myproc **umalloc(int);
struct myproc **proc_init() {
  return umalloc(128 * sizeof *proc_init());
}


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

x86 assembly (clang, -O2):
<proc_init>:
mov    $0x400,%edi
jmp    1030 <umalloc@plt>

LLVM IR (-O0):
%struct.myproc = type { i32 }
define %struct.myproc** @proc_init() {
%1 = call %struct.myproc** @umalloc(i32 1024)
ret %struct.myproc** %1
}

LLVM IR (-O2):
%struct.myproc = type { i32 }
define %struct.myproc** @proc_init() {
%1 = tail call %struct.myproc** @umalloc(i32 1024)
ret %struct.myproc** %1
}
/* Variables and functions */
char *itostr(int);
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  int x = 102456;
  char *c;
  c = itostr(x);
  printf("\n\nstring = %s\n\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x19038,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <itostr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x19038,%edi
call   1040 <itostr@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A\0Astring = %s\0A\0A\00"
define void @main() {
%1 = tail call i8* @itostr(i32 102456)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void ReleaseDebugSettings(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @_Unwind_ForcedUnwind() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bbm_write(void *, int, int);
int fc8080_deinit(void *handle) {
  bbm_write(handle, 0x0001, 0x00);
  return 0;
}


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

x86 assembly (clang, -O2):
<fc8080_deinit>:
push   %rax
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <bbm_write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fc8080_deinit(i8* %0) {
%2 = tail call i32 @bbm_write(i8* %0, i32 1, i32 0)
ret i32 0
}
/* Variables and functions */
size_t INT8_MAX;
__attribute__((visibility("default"), always_, const)) size_t
orle_encode_size_bound(size_t len) {
  return len + (len + INT8_MAX - 1) / INT8_MAX;
}


x86 assembly (clang, -O0):
<orle_encode_size_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ec5(%rip),%rcx
add    (%rcx),%rax
sub    $0x1,%rax
mov    0x2eb7(%rip),%rcx
xor    %edx,%edx
divq   (%rcx)
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<orle_encode_size_bound>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rcx
lea    (%rdi,%rcx,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1127 <orle_encode_size_bound+0x27>
xor    %edx,%edx
div    %rcx
add    %rdi,%rax
ret
xor    %edx,%edx
div    %ecx
add    %rdi,%rax
ret

LLVM IR (-O0):
@INT8_MAX = global i64 0
define i64 @orle_encode_size_bound(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* @INT8_MAX
%6 = add i64 %4, %5
%7 = sub i64 %6, 1
%8 = load i64, i64* @INT8_MAX
%9 = udiv i64 %7, %8
%10 = add i64 %3, %9
ret i64 %10
}

LLVM IR (-O2):
@INT8_MAX = global i64 0
define i64 @orle_encode_size_bound(i64 %0) {
%2 = load i64, i64* @INT8_MAX
%3 = add i64 %0, -1
%4 = add i64 %3, %2
%5 = udiv i64 %4, %2
%6 = add i64 %5, %0
ret i64 %6
}
void sigbus_handler(int signal) {}


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

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

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

LLVM IR (-O2):
define void @sigbus_handler(i32 %0) {
ret void
}
int wait_for_word(int index, char *str) {
  int i;
  i = index;
  while ((*(str + i) != '\0') && (*(str + i) <= 32))
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<wait_for_word>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     1140 <wait_for_word+0x40>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1150 <wait_for_word+0x50>
jmp    115e <wait_for_word+0x5e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1111 <wait_for_word+0x11>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for_word>:
movslq %edi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rsi
nopl   0x0(%rax)
movzbl (%rsi),%ecx
add    $0x1,%eax
test   %cl,%cl
je     1123 <wait_for_word+0x23>
add    $0x1,%rsi
cmp    $0x21,%cl
jl     1110 <wait_for_word+0x10>
ret

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

LLVM IR (-O2):
define i32 @wait_for_word(i32 %0, i8* nocapture %1) {
%3 = sext i32 %0 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %11, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp slt i8 %7, 33
%10 = and i1 %8, %9
%11 = add i64 %5, 1
br i1 %10, label %4, label %12
12: ; preds = %4
%13 = trunc i64 %5 to i32
ret i32 %13
}
char *getenv(name)
char *name;
{
  int offset;
  return (_findenv(name, &offset));
}


x86 assembly (clang, -O0):
<getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <_findenv@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getenv>:
push   %rax
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <_findenv@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @_findenv to i32 (i8*, i32*, ...)*)(i8* %4, i32* %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @getenv(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i32*, ...) bitcast (i32 (...)* @_findenv to i32 (i8*, i32*, ...)*)(i8* %0, i32* %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
int pinmux_enable_setting2(struct pinctrl_setting const *setting) { return 0; }


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

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

LLVM IR (-O0):
%struct.pinctrl_setting = type opaque
define i32 @pinmux_enable_setting2(%struct.pinctrl_setting* %0) {
%2 = alloca %struct.pinctrl_setting*
store %struct.pinctrl_setting* %0, %struct.pinctrl_setting** %2
ret i32 0
}

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define i32 @pinmux_enable_setting2(%struct.pinctrl_setting* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int tests_init(void) {
  printf("[TEST] CommonCrypto\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"[TEST] CommonCrypto\0A\00"
define i32 @tests_init() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"[TEST] CommonCrypto\00"
define i32 @tests_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t cfs_basic_chown(const char *path, int64_t uid, int64_t gid) {
  return 0;
}


x86 assembly (clang, -O0):
<cfs_basic_chown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cfs_basic_chown(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
ret i32 0
}

LLVM IR (-O2):
define i32 @cfs_basic_chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISLNK(int /*<<< orphan*/);
scalar_t__ lstat(char *, struct stat *);
int dashl(char *fname) {
  struct stat st;
  return (lstat(fname, &st) == 0 && S_ISLNK(st.st_mode));
}


x86 assembly (clang, -O0):
<dashl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <dashl+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dashl>:
push   %rax
mov    %rsp,%rsi
call   1040 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dashl+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISLNK@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dashl(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @lstat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISLNK(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dashl(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISLNK(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int html_string(char *, char *);
int html_break() { return html_string("%s\n", "<BR>"); }


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

x86 assembly (clang, -O2):
<html_break>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <html_string@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"<BR>\00"
define i32 @html_break() {
%1 = call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"<BR>\00"
define i32 @html_break() {
%1 = tail call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int dup(int);
int /*<<< orphan*/ *zfs_fdopendir_nofd_dup(int);
DIR *zfs_fdopendir(int fd) {
  int dup_fd = dup(fd);
  if (dup_fd == -1)
    return NULL;
  return zfs_fdopendir_nofd_dup(dup_fd);
}


x86 assembly (clang, -O0):
<zfs_fdopendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <dup@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    114d <zfs_fdopendir+0x2d>
movq   $0x0,-0x8(%rbp)
jmp    1159 <zfs_fdopendir+0x39>
mov    -0x10(%rbp),%edi
call   1040 <zfs_fdopendir_nofd_dup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zfs_fdopendir>:
push   %rax
call   1030 <dup@plt>
cmp    $0xffffffff,%eax
je     1133 <zfs_fdopendir+0x13>
mov    %eax,%edi
pop    %rax
jmp    1040 <zfs_fdopendir_nofd_dup@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32* @zfs_fdopendir(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32* @zfs_fdopendir_nofd_dup(i32 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32* [ %5, %4 ], [ null, %1 ]
ret i32* %7
}
int distinti(int i, int *arr) {
  int j = 0;
  int dist = 1;
  while (j < i && dist) {
    if (arr[j] == arr[i])
      dist = 0;
    j++;
  }
  return dist;
}


x86 assembly (clang, -O0):
<distinti>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x19(%rbp)
jge    1134 <distinti+0x34>
cmpl   $0x0,-0x18(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1144 <distinti+0x44>
jmp    1175 <distinti+0x75>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x4(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1167 <distinti+0x67>
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <distinti+0x19>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<distinti>:
test   %edi,%edi
jle    1129 <distinti+0x29>
mov    %edi,%eax
mov    (%rsi,%rax,4),%ecx
mov    $0x1,%edx
xchg   %ax,%ax
mov    -0x4(%rsi,%rdx,4),%edi
cmp    %rax,%rdx
jae    1121 <distinti+0x21>
add    $0x1,%rdx
cmp    %ecx,%edi
jne    1110 <distinti+0x10>
xor    %eax,%eax
cmp    %ecx,%edi
setne  %al
ret
mov    $0x1,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @ls_costN_nm6_n_in() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void printBits(long b) {
  int i = 63;
  for (; i >= 0; i--)
    putchar(1 & (b >> i) ? '1' : '0');
  putchar('\n');
}


x86 assembly (clang, -O0):
<printBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x3f,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1164 <printBits+0x54>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
sar    %cl,%rdx
and    $0x1,%rdx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printBits+0x13>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBits>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x3f,%ebx
nopl   0x0(%rax)
bt     %rbx,%r14
mov    $0x31,%edi
adc    $0xffffffff,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jb     1120 <printBits+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printBits(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 63, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i64, i64* %2
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = ashr i64 %8, %10
%12 = and i64 1, %11
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 49, i32 48
%16 = trunc i32 %15 to i8
%17 = call i32 @putchar(i8 signext %16)
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @printBits(i64 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 63, %1 ], [ %9, %2 ]
%4 = shl nuw i64 1, %3
%5 = and i64 %4, %0
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8 48, i8 49
%8 = tail call i32 @putchar(i8 signext %7)
%9 = add nsw i64 %3, -1
%10 = icmp eq i64 %3, 0
br i1 %10, label %11, label %2
11: ; preds = %2
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/tamediadigital/h2o/refs/"
               "heads/master/include/h2o/h2o/memory.h"
               ":"
               "320"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tamediadigital/h2o/refs/heads/master/include/h2o/h2o/memory.h:320:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/tamediadigital/h2o/refs/heads/master/include/h2o/h2o/memory.h:320:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}
create_struct_table() {}


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

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

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

LLVM IR (-O2):
define i32 @create_struct_table() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 1; i < argc; ++i) {
    printf("%s", argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
int main(void) {
  _Bool a = 0;
  if (a == 1) {
    printf("_Bool is working!!\n");
  } else {
    printf("_Bool is still working!!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    1147 <main+0x37>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1155 <main+0x45>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"_Bool is working!!\0A\00"
@.str.1 = [26 x i8] c"_Bool is still working!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 0, i8* %2
%3 = load i8, i8* %2
%4 = trunc i8 %3 to i1
%5 = zext i1 %4 to i32
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"_Bool is still working!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void get_index() { ; }


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

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

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

LLVM IR (-O2):
define void @get_index() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ rotate_piece(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void rotate_piece_ncp(uint8_t *piece) {
  uint8_t swap[5];
  rotate_piece(piece, swap);
  memcpy(piece, swap, 5 * sizeof *piece);
}


x86 assembly (clang, -O0):
<rotate_piece_ncp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <rotate_piece@plt>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x14,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_piece_ncp>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <rotate_piece@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x14,%edx
call   1040 <memcpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @rotate_piece_ncp(i32* %0) {
%2 = alloca i32*
%3 = alloca [5 x i32]
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%6 = call i32 @rotate_piece(i32* %4, i32* %5)
%7 = load i32*, i32** %2
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%9 = call i32 @memcpy(i32* %7, i32* %8, i32 20)
ret void
}

LLVM IR (-O2):
define void @rotate_piece_ncp(i32* %0) {
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @rotate_piece(i32* %0, i32* %4)
%6 = call i32 @memcpy(i32* %0, i32* %4, i32 20)
ret void
}
int wlan_chan2freq(int channel) {
  if (channel == 14)
    return 2484;
  if (channel < 14)
    return 2407 + (channel * 5);
  return 5000 + (channel * 5);
}


x86 assembly (clang, -O0):
<wlan_chan2freq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xe,-0x8(%rbp)
jne    111d <wlan_chan2freq+0x1d>
movl   $0x9b4,-0x4(%rbp)
jmp    1144 <wlan_chan2freq+0x44>
cmpl   $0xe,-0x8(%rbp)
jge    1138 <wlan_chan2freq+0x38>
imul   $0x5,-0x8(%rbp),%eax
add    $0x967,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <wlan_chan2freq+0x44>
imul   $0x5,-0x8(%rbp),%eax
add    $0x1388,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wlan_chan2freq>:
mov    $0x9b4,%eax
cmp    $0xe,%edi
je     111a <wlan_chan2freq+0x1a>
lea    (%rdi,%rdi,4),%eax
jge    1115 <wlan_chan2freq+0x15>
add    $0x967,%eax
ret
add    $0x1388,%eax
ret

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

LLVM IR (-O2):
define i32 @wlan_chan2freq(i32 %0) {
%2 = icmp eq i32 %0, 14
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 14
%5 = mul nsw i32 %0, 5
br i1 %4, label %6, label %8
6: ; preds = %3
%7 = add nsw i32 %5, 2407
br label %10
8: ; preds = %3
%9 = add nsw i32 %5, 5000
br label %10
10: ; preds = %1, %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ], [ 2484, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long ftell(int /*<<< orphan*/ *);
int CPGetFilePosition(FILE *fileRef, unsigned long *filePosPtr) {
  long pos;
  pos = ftell(fileRef);
  if (pos == -1L)
    return 10005;
  *filePosPtr = pos;
  return 0;
}


x86 assembly (clang, -O0):
<CPGetFilePosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0xffffffffffffffff,-0x20(%rbp)
jne    1144 <CPGetFilePosition+0x34>
movl   $0x2715,-0x4(%rbp)
jmp    1156 <CPGetFilePosition+0x46>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPGetFilePosition>:
push   %rbx
mov    %rsi,%rbx
call   1030 <ftell@plt>
cmp    $0xffffffffffffffff,%rax
je     1126 <CPGetFilePosition+0x16>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret
mov    $0x2715,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CPGetFilePosition(i32* nocapture %0, i64* nocapture writeonly %1) {
%3 = tail call i64 @ftell(i32* %0)
%4 = icmp eq i64 %3, -1
br i1 %4, label %6, label %5
5: ; preds = %2
store i64 %3, i64* %1
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 0, %5 ], [ 10005, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ memcpy(void *, char *, int);
void swap(void *a, void *b, int sz) {
  char *buf = malloc(sizeof(char) * sz);
  memcpy(buf, a, sz);
  memcpy(a, b, sz);
  memcpy(b, buf, sz);
  free(buf);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = call i32 @memcpy(i8* %13, i8* %14, i32 %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = load i32, i32* %6
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %5
%22 = load i8*, i8** %7
%23 = load i32, i32* %6
%24 = call i32 @memcpy(i8* %21, i8* %22, i32 %23)
%25 = load i8*, i8** %7
%26 = call i32 @free(i8* %25)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i32 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
int bits_required_unsigned(int max) {
  int n = 1;
  if (max < 0)
    max = 0;
  while (max >= (1 << n))
    n++;
  return n;
}


x86 assembly (clang, -O0):
<bits_required_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <bits_required_unsigned+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1124 <bits_required_unsigned+0x24>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jl     1149 <bits_required_unsigned+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <bits_required_unsigned+0x24>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_required_unsigned>:
xor    %ecx,%ecx
test   %edi,%edi
cmovs  %ecx,%edi
nopw   0x0(%rax,%rax,1)
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cmp    %eax,%edi
jge    1110 <bits_required_unsigned+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_required_unsigned(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 %0, i32 0
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ 1, %1 ], [ %8, %4 ]
%6 = shl nuw i32 1, %5
%7 = icmp slt i32 %3, %6
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
ret i32 %5
}
/* Variables and functions */
double log(double);
double sre_random();
double ExponentialRandom(void) {
  double x;
  do
    x = sre_random();
  while (x == 0.0);
  return -log(x);
}


x86 assembly (clang, -O0):
<ExponentialRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <sre_random@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1151 <ExponentialRandom+0x31>
jp     1151 <ExponentialRandom+0x31>
jmp    1128 <ExponentialRandom+0x8>
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExponentialRandom>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <sre_random@plt>
ucomisd 0xed1(%rip),%xmm0
jne    1143 <ExponentialRandom+0x23>
jnp    1130 <ExponentialRandom+0x10>
call   1030 <log@plt>
xorpd  0xeb0(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @ExponentialRandom() {
br label %1
1: ; preds = %1, %0
%2 = tail call double (...) @sre_random()
%3 = fcmp oeq double %2, 0.000000e+00
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call double @log(double %2)
%6 = fneg double %5
ret double %6
}
int del_timer(struct timer_list *timer) {
  int a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.timer_list = type opaque
define i32 @del_timer(%struct.timer_list* %0) {
%2 = alloca %struct.timer_list*
%3 = alloca i32
store %struct.timer_list* %0, %struct.timer_list** %2
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timer_list = type opaque
define i32 @del_timer(%struct.timer_list* nocapture readnone %0) {
ret i32 undef
}
unsigned int ror(unsigned int x, unsigned int i) {
  return (x >> i) | (x << (32 - i));
}


x86 assembly (clang, -O0):
<ror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ror>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @ror(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 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = shl i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ror(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 32, %1
%5 = shl i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}