xunge/DecIR huggingface dataset:
/* Type definitions */
struct feed_utf8_code {
  int dummy;
};
struct feed_glyph {
  int dummy;
};
struct feed_client {
  int dummy;
};

/* Variables and functions */
char feed_glyph_init(struct feed_glyph *const,
                     struct feed_utf8_code const *const);
char feed_glyph_init_cb(void *const p_object,
                        struct feed_client *const p_client,
                        void const *const p_descriptor) {
  char b_result;
  struct feed_glyph *const p_glyph = (struct feed_glyph *)(p_object);
  struct feed_utf8_code const *const p_utf8_code =
      (struct feed_utf8_code const *)(p_descriptor);
  (void)(p_client);
  b_result = feed_glyph_init(p_glyph, p_utf8_code);
  return b_result;
}


x86 assembly (clang, -O0):
<feed_glyph_init_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <feed_glyph_init@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_glyph_init_cb>:
mov    %rdx,%rsi
jmp    1030 <feed_glyph_init@plt>

LLVM IR (-O0):
%struct.feed_client = type { i32 }
%struct.feed_glyph = type { i32 }
%struct.feed_utf8_code = type { i32 }
define signext i8 @feed_glyph_init_cb(i8* %0, %struct.feed_client* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.feed_client*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca %struct.feed_glyph*
%9 = alloca %struct.feed_utf8_code*
store i8* %0, i8** %4
store %struct.feed_client* %1, %struct.feed_client** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to %struct.feed_glyph*
store %struct.feed_glyph* %11, %struct.feed_glyph** %8
%12 = load i8*, i8** %6
%13 = bitcast i8* %12 to %struct.feed_utf8_code*
store %struct.feed_utf8_code* %13, %struct.feed_utf8_code** %9
%14 = load %struct.feed_client*, %struct.feed_client** %5
%15 = load %struct.feed_glyph*, %struct.feed_glyph** %8
%16 = load %struct.feed_utf8_code*, %struct.feed_utf8_code** %9
%17 = call signext i8 @feed_glyph_init(%struct.feed_glyph* %15, %struct.feed_utf8_code* %16)
store i8 %17, i8* %7
%18 = load i8, i8* %7
ret i8 %18
}

LLVM IR (-O2):
%struct.feed_client = type { i32 }
%struct.feed_glyph = type { i32 }
%struct.feed_utf8_code = type { i32 }
define signext i8 @feed_glyph_init_cb(i8* %0, %struct.feed_client* nocapture readnone %1, i8* %2) {
%4 = bitcast i8* %0 to %struct.feed_glyph*
%5 = bitcast i8* %2 to %struct.feed_utf8_code*
%6 = tail call signext i8 @feed_glyph_init(%struct.feed_glyph* %4, %struct.feed_utf8_code* %5)
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ show_state_filter(int /*<<< orphan*/);
void show_state(void) { show_state_filter(0); }


x86 assembly (clang, -O0):
<show_state>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <show_state_filter@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_state>:
xor    %edi,%edi
jmp    1030 <show_state_filter@plt>

LLVM IR (-O0):
define void @show_state() {
%1 = call i32 @show_state_filter(i32 0)
ret void
}

LLVM IR (-O2):
define void @show_state() {
%1 = tail call i32 @show_state_filter(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ S_IXGRP;
int /*<<< orphan*/ S_IXOTH;
int /*<<< orphan*/ S_IXUSR;
int _is_file_rwx(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                 int /*<<< orphan*/);
int _is_file_executable(char *pathname) {
  return _is_file_rwx(pathname, S_IXUSR, S_IXGRP, S_IXOTH);
}


x86 assembly (clang, -O0):
<_is_file_executable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
mov    (%rax),%edx
mov    0x2eaf(%rip),%rax
mov    (%rax),%ecx
call   1030 <_is_file_rwx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_file_executable>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
mov    0x2ebf(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <_is_file_rwx@plt>

LLVM IR (-O0):
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IXOTH = global i32 0
define i32 @_is_file_executable(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IXUSR
%5 = load i32, i32* @S_IXGRP
%6 = load i32, i32* @S_IXOTH
%7 = call i32 @_is_file_rwx(i8* %3, i32 %4, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@S_IXUSR = global i32 0
@S_IXGRP = global i32 0
@S_IXOTH = global i32 0
define i32 @_is_file_executable(i8* %0) {
%2 = load i32, i32* @S_IXUSR
%3 = load i32, i32* @S_IXGRP
%4 = load i32, i32* @S_IXOTH
%5 = tail call i32 @_is_file_rwx(i8* %0, i32 %2, i32 %3, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x37() {
  Assert_real((iscntrl(55) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              280, ("iscntrl should be 0 for 7"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x37>:
push   %rax
mov    $0x37,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x118,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for 7\00"
define void @t_iscntrl_0x37() {
%1 = tail call i64 @iscntrl(i32 55)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void nanosecond_wait(long ms) {
  struct timespec st;
  st.tv_sec = ms / 1000;
  st.tv_nsec = ms % 1000 * 1000000;
  nanosleep(&st, NULL);
}


x86 assembly (clang, -O0):
<nanosecond_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanosecond_wait>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @nanosecond_wait(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @nanosecond_wait(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i64 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = srem i64 %0, 1000
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void duplicate_carry(int n) {
  int i;
  for (i = 0; i <= n; i++)
    printf("\t");
  printf("COPY_CARRY ();\n");
}


x86 assembly (clang, -O0):
<duplicate_carry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1148 <duplicate_carry+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <duplicate_carry+0x12>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<duplicate_carry>:
push   %rbx
test   %edi,%edi
js     113f <duplicate_carry+0x1f>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1130 <duplicate_carry+0x10>
lea    0xeba(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [16 x i8] c"COPY_CARRY ();\0A\00"
define void @duplicate_carry(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"COPY_CARRY ();\00"
define void @duplicate_carry(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 9)
%6 = add nuw i32 %4, 1
%7 = icmp eq i32 %4, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int calculate_sum(int lhs, int rhs) { return lhs + rhs; }


x86 assembly (clang, -O0):
<calculate_sum>:
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):
<calculate_sum>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @calculate_sum(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 @calculate_sum(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
unsigned long bit_next_power_of_two(register unsigned long value) {
  if (!(value & (value - 1)))
    return (value);
  while (value & (value - 1))
    value = value & (value - 1);
  value = value << 1;
  return value;
}


x86 assembly (clang, -O0):
<bit_next_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jne    112e <bit_next_power_of_two+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <bit_next_power_of_two+0x78>
jmp    1133 <bit_next_power_of_two+0x33>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1164 <bit_next_power_of_two+0x64>
mov    -0x10(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1133 <bit_next_power_of_two+0x33>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_next_power_of_two>:
mov    %rdi,%rax
lea    -0x1(%rdi),%rcx
test   %rcx,%rdi
je     1122 <bit_next_power_of_two+0x22>
nopl   0x0(%rax)
mov    %rax,%rcx
add    $0xffffffffffffffff,%rax
and    %rcx,%rax
jne    1110 <bit_next_power_of_two+0x10>
add    %rcx,%rcx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @bit_next_power_of_two(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ %0, %1 ]
%6 = add i64 %5, -1
%7 = and i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = shl i64 %5, 1
br label %11
11: ; preds = %1, %9
%12 = phi i64 [ %10, %9 ], [ %0, %1 ]
ret i64 %12
}
/* Variables and functions */
float powf(int, float);
float db2lin_alt(float db) {
  if (db <= -200.0f)
    return 0.0f;
  else
    return powf(10, (5.000000e-02f * db));
}


x86 assembly (clang, -O0):
<db2lin_alt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113c <db2lin_alt+0x2c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1158 <db2lin_alt+0x48>
movss  0xec0(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
mov    $0xa,%edi
call   1030 <powf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db2lin_alt>:
movss  0xee8(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    112f <db2lin_alt+0x1f>
mulss  0xedf(%rip),%xmm0
mov    $0xa,%edi
jmp    1030 <powf@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @db2lin_alt(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, -2.000000e+02
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %11
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float 0x3FA99999A0000000, %8
%10 = call float @powf(i32 10, float %9)
store float %10, float* %2
br label %11
11: ; preds = %7, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @db2lin_alt(float %0) {
%2 = fcmp ugt float %0, -2.000000e+02
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul float %0, 0x3FA99999A0000000
%5 = tail call float @powf(i32 10, float %4)
br label %6
6: ; preds = %1, %3
%7 = phi float [ %5, %3 ], [ 0.000000e+00, %1 ]
ret float %7
}
long labs(long n) { return n < 0 ? -n : n; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ CPUbasepriSet(unsigned long);
void IntPriorityMaskSet(unsigned long ulPriorityMask) {
  CPUbasepriSet(ulPriorityMask);
}


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

x86 assembly (clang, -O2):
<IntPriorityMaskSet>:
jmp    1030 <CPUbasepriSet@plt>

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

LLVM IR (-O2):
define void @IntPriorityMaskSet(i64 %0) {
%2 = tail call i32 @CPUbasepriSet(i64 %0)
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
int alpha(char c) { return (isalpha(c) || c == '_' || c == '@'); }


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1158 <alpha+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x2(%rbp)
je     1158 <alpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x40,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
cmp    $0x40,%bl
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @alpha(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 95
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 64
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @alpha(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = icmp eq i8 %0, 64
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ aes_enc_dec(unsigned char *, unsigned char *,
                               int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void AES_128_ENC(unsigned const char *key, unsigned const char *msg,
                 unsigned char *cipher) {
  unsigned char key_copy[16];
  memcpy(cipher, msg, 16);
  memcpy(key_copy, key, 16);
  aes_enc_dec(cipher, key_copy, 0);
}


x86 assembly (clang, -O0):
<AES_128_ENC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1040 <aes_enc_dec@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_128_ENC>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rdx,%rdi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <aes_enc_dec@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @AES_128_ENC(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = load i8*, i8** %5
%10 = call i32 @memcpy(i8* %8, i8* %9, i32 16)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%12 = load i8*, i8** %4
%13 = call i32 @memcpy(i8* %11, i8* %12, i32 16)
%14 = load i8*, i8** %6
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = call i32 @aes_enc_dec(i8* %14, i8* %15, i32 0)
ret void
}

LLVM IR (-O2):
define void @AES_128_ENC(i8* %0, i8* %1, i8* %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @memcpy(i8* %2, i8* %1, i32 16)
%7 = call i32 @memcpy(i8* %5, i8* %0, i32 16)
%8 = call i32 @aes_enc_dec(i8* %2, i8* %5, i32 0)
ret void
}
/* Variables and functions */
int safe_add(int, scalar_t__);
int sub(int register2, int register3) {
  return safe_add(register2, 0 - register3);
}


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
sub    -0x8(%rbp),%eax
movslq %eax,%rsi
call   1030 <safe_add@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub>:
neg    %esi
movslq %esi,%rsi
jmp    1030 <safe_add@plt>

LLVM IR (-O0):
define i32 @sub(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 = sub nsw i32 0, %6
%8 = sext i32 %7 to i64
%9 = call i32 @safe_add(i32 %5, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = sext i32 %3 to i64
%5 = tail call i32 @safe_add(i32 %0, i64 %4)
ret i32 %5
}
int func1(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @func1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
int /*<<< orphan*/ stderr;
void zmalloc_default_oom(size_t size) {
  fprintf(stderr, "zmalloc: Out of memory trying to allocate %zu bytes\n",
          size);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<zmalloc_default_oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<zmalloc_default_oom>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rbx
mov    (%rbx),%edi
lea    0xebc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"zmalloc: Out of memory trying to allocate %zu bytes\0A\00"
define void @zmalloc_default_oom(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stderr
%4 = load i64, i64* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"zmalloc: Out of memory trying to allocate %zu bytes\0A\00"
define void @zmalloc_default_oom(i64 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i64 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXECVPR(char const *, char const **);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void EXECVP(const char *path, const char *av[]) { exit(EXECVPR(path, av)); }


x86 assembly (clang, -O0):
<EXECVP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <EXECVPR@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<EXECVP>:
push   %rax
call   1030 <EXECVPR@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @EXECVP(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call i32 @EXECVPR(i8* %5, i8** %6)
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
define void @EXECVP(i8* %0, i8** %1) {
%3 = tail call i32 @EXECVPR(i8* %0, i8** %1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ execSysCall(int, int /*<<< orphan*/, char *, int);
char getChar() {
  char c = -1;
  while (c == -1)
    execSysCall(0x03, 0, &c, 1);
  return c;
}


x86 assembly (clang, -O0):
<getChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xffffffff,%eax
jne    1143 <getChar+0x33>
mov    $0x3,%edi
xor    %esi,%esi
lea    -0x1(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <execSysCall@plt>
jmp    111c <getChar+0xc>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getChar>:
push   %rbx
sub    $0x10,%rsp
movb   $0xff,0xf(%rsp)
lea    0xf(%rsp),%rbx
nop
mov    $0x3,%edi
xor    %esi,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1030 <execSysCall@plt>
movzbl 0xf(%rsp),%eax
cmp    $0xff,%al
je     1120 <getChar+0x10>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getChar() {
%1 = alloca i8
store i8 -1, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @execSysCall(i32 3, i32 0, i8* %1, i32 1)
br label %2
8: ; preds = %2
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @getChar() {
%1 = alloca i8
store i8 -1, i8* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @execSysCall(i32 3, i32 0, i8* %1, i32 1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, -1
br i1 %5, label %2, label %6
6: ; preds = %2
ret i8 %4
}
/* Variables and functions */
int btp_strcmp0(char const *, char const *);
int ptrstrcmp(const void *s1, const void *s2) {
  return btp_strcmp0(*(const char **)s1, *(const char **)s2);
}


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

x86 assembly (clang, -O2):
<ptrstrcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <btp_strcmp0@plt>

LLVM IR (-O0):
define i32 @ptrstrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @btp_strcmp0(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @ptrstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @btp_strcmp0(i8* %4, i8* %6)
ret i32 %7
}
int gethinfo(char *hostname, char *cpu, int cpulen, char *os, int oslen) {
  return (0);
}


x86 assembly (clang, -O0):
<gethinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gethinfo(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @gethinfo(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int _strlen(char *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char *str;
  int len;
  str = "Holberton!";
  len = _strlen(str);
  printf("%d\n", len);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Holberton!\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @_strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
const char *sljit_get_platform_name(void) {
  return "x86"
         " 64bit ("
         "little endian + "
         "unaligned)";
}


x86 assembly (clang, -O0):
<sljit_get_platform_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sljit_get_platform_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"x86 64bit (little endian + unaligned)\00"
define i8* @sljit_get_platform_name() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [38 x i8] c"x86 64bit (little endian + unaligned)\00"
define i8* @sljit_get_platform_name() {
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ nano_disabled_msg();
int do_help(void) {
  nano_disabled_msg();
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @do_help() {
%1 = tail call i32 (...) @nano_disabled_msg()
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int);
int /*<<< orphan*/ printFile(char *);
void skelframe(int fn) {
  char *file;
  asprintf(&file, "frame/frame%d.txt", fn);
  printFile(file);
}


x86 assembly (clang, -O0):
<skelframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <printFile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skelframe>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rsi
mov    %rsp,%rdi
call   1040 <asprintf@plt>
mov    (%rsp),%rdi
call   1030 <printFile@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"frame/frame%d.txt\00"
define void @skelframe(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %3
%7 = call i32 @printFile(i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"frame/frame%d.txt\00"
define void @skelframe(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8*, i8** %2
%6 = call i32 @printFile(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ w;

/* Variables and functions */
unsigned long generic_hweight32(unsigned long);
unsigned long generic_hweight64(unsigned long);
__attribute__((always_)) unsigned long hweight_long(unsigned long w) {
  return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w);
}


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

x86 assembly (clang, -O2):
<hweight_long>:
jmp    1030 <generic_hweight64@plt>

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

LLVM IR (-O2):
define i64 @hweight_long(i64 %0) {
%2 = tail call i64 @generic_hweight64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int bbm_word_write(void *, unsigned short, unsigned short, unsigned short);
int bbm_com_word_write(void *handle, unsigned short devid, unsigned short addr,
                       unsigned short data) {
  int res;
  res = bbm_word_write(handle, devid, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_word_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %cx,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%cx
mov    -0xc(%rbp),%ax
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0xe(%rbp),%ecx
call   1030 <bbm_word_write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_word_write>:
jmp    1030 <bbm_word_write@plt>

LLVM IR (-O0):
define i32 @bbm_com_word_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i16, i16* %7
%13 = load i16, i16* %8
%14 = call i32 @bbm_word_write(i8* %10, i16 zeroext %11, i16 zeroext %12, i16 zeroext %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
ret i32 %15
}

LLVM IR (-O2):
define i32 @bbm_com_word_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @bbm_word_write(i8* %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3)
ret i32 %5
}
void calculate_queue_sizes(int mem, int *readq, int *fragq, int *bwriteq,
                           int *fwriteq) {
  *readq = mem / 4;
  *bwriteq = mem / 4;
  *fwriteq = mem / 4;
  *fragq = mem - *readq - *bwriteq - *fwriteq;
}


x86 assembly (clang, -O0):
<calculate_queue_sizes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x20(%rbp),%rax
sub    (%rax),%ecx
mov    -0x28(%rbp),%rax
sub    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_queue_sizes>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
mov    %eax,(%rsi)
mov    %eax,(%rcx)
mov    %eax,(%r8)
add    (%rsi),%eax
add    (%rcx),%eax
sub    %eax,%edi
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define void @calculate_queue_sizes(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = sdiv i32 %11, 4
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = sdiv i32 %14, 4
%16 = load i32*, i32** %9
store i32 %15, i32* %16
%17 = load i32, i32* %6
%18 = sdiv i32 %17, 4
%19 = load i32*, i32** %10
store i32 %18, i32* %19
%20 = load i32, i32* %6
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = sub nsw i32 %20, %22
%24 = load i32*, i32** %9
%25 = load i32, i32* %24
%26 = sub nsw i32 %23, %25
%27 = load i32*, i32** %10
%28 = load i32, i32* %27
%29 = sub nsw i32 %26, %28
%30 = load i32*, i32** %8
store i32 %29, i32* %30
ret void
}

LLVM IR (-O2):
define void @calculate_queue_sizes(i32 %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture %3, i32* nocapture writeonly %4) {
%6 = sdiv i32 %0, 4
store i32 %6, i32* %1
store i32 %6, i32* %3
store i32 %6, i32* %4
%7 = load i32, i32* %1
%8 = load i32, i32* %3
%9 = add i32 %6, %7
%10 = add i32 %9, %8
%11 = sub i32 %0, %10
store i32 %11, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_string(void *value) {
  char *str = *((char **)value);
  printf("%s", str);
}


x86 assembly (clang, -O0):
<show_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_string>:
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @show_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @show_string(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int pipe(int *);
void open_pipe(int *fd) {
  if (pipe(fd) == -1)
    perror("could not open pipe");
}


x86 assembly (clang, -O0):
<open_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
jne    114a <open_pipe+0x2a>
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_pipe>:
push   %rax
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     112d <open_pipe+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"could not open pipe\00"
define void @open_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @pipe(i32* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"could not open pipe\00"
define void @open_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char name[81];
  printf("Hi, what's your name?\n");
  gets(name);
  printf("Nice name, %s.\n", name);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Hi, what's your name?\0A\00"
@.str.1 = [16 x i8] c"Nice name, %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Nice name, %s.\0A\00"
@str = [22 x i8] c"Hi, what's your name?\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void add_int(char *string, int *val) {}


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

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

LLVM IR (-O0):
define void @add_int(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
define void @add_int(i8* nocapture %0, i32* nocapture %1) {
ret void
}
int fs_handler_remove(void *p) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fs_handler_remove(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double linemin_function(double *, void *);
double fun_wrapper1d(double x, void *info) {
  return linemin_function(&x, info);
}


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

x86 assembly (clang, -O2):
<fun_wrapper1d>:
push   %rax
mov    %rdi,%rsi
movsd  %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <linemin_function@plt>
pop    %rax
ret

LLVM IR (-O0):
define double @fun_wrapper1d(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
store double %0, double* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call double @linemin_function(double* %3, i8* %5)
ret double %6
}

LLVM IR (-O2):
define double @fun_wrapper1d(double %0, i8* %1) {
%3 = alloca double
store double %0, double* %3
%4 = call double @linemin_function(double* %3, i8* %1)
ret double %4
}
void ff_hevc_put_hevc_qpel_h48_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_h48_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cleanup(void *arg) { printf("cleanup :%s\n", (char *)arg); }


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"cleanup :%s\0A\00"
define void @cleanup(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
int IsBlank(char *p) {
  int ch;
  while ((ch = *p++) != '\0')
    if (!isspace(ch))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<IsBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     115c <IsBlank+0x4c>
mov    -0x14(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1157 <IsBlank+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1163 <IsBlank+0x53>
jmp    111c <IsBlank+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsBlank>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <IsBlank+0x28>
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %eax,%eax
jne    1120 <IsBlank+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @IsBlank(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @isspace(i32 %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %2, %6
%12 = phi i32 [ 0, %6 ], [ 1, %2 ]
ret i32 %12
}