xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ WriteByte(int /*<<< orphan*/ *, unsigned long);
void WriteLong(FILE *fp, unsigned long l) {
  int f;
  for (f = 0; f < 4; f++) {
    WriteByte(fp, l & 0xff);
    l >>= 8u;
  }
}


x86 assembly (clang, -O0):
<WriteLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    115f <WriteLong+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
and    $0xff,%rsi
call   1030 <WriteByte@plt>
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <WriteLong+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteLong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movzbl %bl,%esi
call   1030 <WriteByte@plt>
movzbl %bh,%esi
mov    %r14,%rdi
call   1030 <WriteByte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    %r14,%rdi
call   1030 <WriteByte@plt>
shr    $0x18,%ebx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <WriteByte@plt>

LLVM IR (-O0):
define void @WriteLong(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i32*, i32** %3
%11 = load i64, i64* %4
%12 = and i64 %11, 255
%13 = call i32 @WriteByte(i32* %10, i64 %12)
%14 = load i64, i64* %4
%15 = lshr i64 %14, 8
store i64 %15, i64* %4
br label %16
16: ; preds = %9
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @WriteLong(i32* %0, i64 %1) {
%3 = and i64 %1, 255
%4 = tail call i32 @WriteByte(i32* %0, i64 %3)
%5 = lshr i64 %1, 8
%6 = and i64 %5, 255
%7 = tail call i32 @WriteByte(i32* %0, i64 %6)
%8 = lshr i64 %1, 16
%9 = and i64 %8, 255
%10 = tail call i32 @WriteByte(i32* %0, i64 %9)
%11 = lshr i64 %1, 24
%12 = and i64 %11, 255
%13 = tail call i32 @WriteByte(i32* %0, i64 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M900_f(char *s) {
  debug("M900_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M900_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M900_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M900_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M900_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ kinetis_ps_cache_restore(unsigned long *);
int /*<<< orphan*/ kinetis_ps_cache_save(unsigned long *);
void kinetis_ps_cache_flush(void) {
  unsigned long flags;
  kinetis_ps_cache_save(&flags);
  kinetis_ps_cache_restore(&flags);
}


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

x86 assembly (clang, -O2):
<kinetis_ps_cache_flush>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <kinetis_ps_cache_save@plt>
mov    %rbx,%rdi
call   1040 <kinetis_ps_cache_restore@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @kinetis_ps_cache_flush() {
%1 = alloca i64
%2 = call i32 @kinetis_ps_cache_save(i64* %1)
%3 = call i32 @kinetis_ps_cache_restore(i64* %1)
ret void
}

LLVM IR (-O2):
define void @kinetis_ps_cache_flush() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @kinetis_ps_cache_save(i64* %1)
%4 = call i32 @kinetis_ps_cache_restore(i64* %1)
ret void
}
/* Type definitions */
typedef scalar_t__ u_char;

/* Variables and functions */
scalar_t__ cd_current_track();
scalar_t__ cd_first_track();
scalar_t__ cd_last_track();
int /*<<< orphan*/ cd_play_disc(scalar_t__);
u_char cd_play_next_track(void) {
  u_char target_track;
  u_char cur_track = cd_current_track();
  if (cur_track >= cd_last_track())
    target_track = cd_first_track();
  else
    target_track = (cur_track + 1);
  cd_play_disc(target_track);
  return target_track;
}


x86 assembly (clang, -O0):
<cd_play_next_track>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <cd_current_track@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <cd_last_track@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jl     1182 <cd_play_next_track+0x42>
mov    $0x0,%al
call   1030 <cd_first_track@plt>
mov    %rax,-0x8(%rbp)
jmp    118e <cd_play_next_track+0x4e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cd_play_disc@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cd_play_next_track>:
push   %rbx
xor    %eax,%eax
call   1050 <cd_current_track@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <cd_last_track@plt>
cmp    %rax,%rbx
jge    115d <cd_play_next_track+0x1d>
add    $0x1,%rbx
jmp    1167 <cd_play_next_track+0x27>
xor    %eax,%eax
call   1030 <cd_first_track@plt>
mov    %rax,%rbx
mov    %rbx,%rdi
call   1040 <cd_play_disc@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @cd_play_next_track() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @cd_current_track()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = call i64 (...) @cd_last_track()
%6 = icmp sge i64 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i64 (...) @cd_first_track()
store i64 %8, i64* %1
br label %12
9: ; preds = %0
%10 = load i64, i64* %2
%11 = add nsw i64 %10, 1
store i64 %11, i64* %1
br label %12
12: ; preds = %9, %7
%13 = load i64, i64* %1
%14 = call i32 @cd_play_disc(i64 %13)
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @cd_play_next_track() {
%1 = tail call i64 (...) @cd_current_track()
%2 = tail call i64 (...) @cd_last_track()
%3 = icmp slt i64 %1, %2
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i64 (...) @cd_first_track()
br label %8
6: ; preds = %0
%7 = add nsw i64 %1, 1
br label %8
8: ; preds = %6, %4
%9 = phi i64 [ %5, %4 ], [ %7, %6 ]
%10 = tail call i32 @cd_play_disc(i64 %9)
ret i64 %9
}
int jerarquia(char operador) {
  int valor;
  switch (operador) {
  case ')':
    valor = 5;
    break;
  case '^':
    valor = 4;
    break;
  case '*':
    valor = 3;
    break;
  case '/':
    valor = 3;
    break;
  case '+':
    valor = 2;
    break;
  case '-':
    valor = 2;
    break;
  case '(':
    valor = 1;
    break;
  }
  return valor;
}


x86 assembly (clang, -O0):
<jerarquia>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x36,%eax
ja     1183 <jerarquia+0x83>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5,-0x8(%rbp)
jmp    1183 <jerarquia+0x83>
movl   $0x4,-0x8(%rbp)
jmp    1183 <jerarquia+0x83>
movl   $0x3,-0x8(%rbp)
jmp    1183 <jerarquia+0x83>
movl   $0x3,-0x8(%rbp)
jmp    1183 <jerarquia+0x83>
movl   $0x2,-0x8(%rbp)
jmp    1183 <jerarquia+0x83>
movl   $0x2,-0x8(%rbp)
jmp    1183 <jerarquia+0x83>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jerarquia>:
mov    $0x5,%eax
add    $0xffffffd8,%edi
cmp    $0x36,%edi
ja     112e <jerarquia+0x2e>
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x1,%eax
ret
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @jerarquia(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 41, label %6
i32 94, label %7
i32 42, label %8
i32 47, label %9
i32 43, label %10
i32 45, label %11
i32 40, label %12
]
6: ; preds = %1
store i32 5, i32* %3
br label %13
7: ; preds = %1
store i32 4, i32* %3
br label %13
8: ; preds = %1
store i32 3, i32* %3
br label %13
9: ; preds = %1
store i32 3, i32* %3
br label %13
10: ; preds = %1
store i32 2, i32* %3
br label %13
11: ; preds = %1
store i32 2, i32* %3
br label %13
12: ; preds = %1
store i32 1, i32* %3
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @jerarquia(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 40, label %8
i32 94, label %3
i32 42, label %4
i32 47, label %5
i32 43, label %6
i32 45, label %7
]
3: ; preds = %1
br label %9
4: ; preds = %1
br label %9
5: ; preds = %1
br label %9
6: ; preds = %1
br label %9
7: ; preds = %1
br label %9
8: ; preds = %1
br label %9
9: ; preds = %1, %8, %7, %6, %5, %4, %3
%10 = phi i32 [ 1, %8 ], [ 2, %7 ], [ 2, %6 ], [ 3, %5 ], [ 3, %4 ], [ 4, %3 ], [ 5, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void clear_screen() { int80(2, 1, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <int80@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
mov    $0x2,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <int80@plt>

LLVM IR (-O0):
define void @clear_screen() {
%1 = call i32 @int80(i32 2, i32 1, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @clear_screen() {
%1 = tail call i32 @int80(i32 2, i32 1, i32 0, i32 0, i32 0, i32 0)
ret void
}
void screen_set_bgfg(unsigned char bgfg) {
  __asm__("mov $0x04, %%eax" ::"b"(bgfg));
  __asm__("int $0x83");
}


x86 assembly (clang, -O0):
<screen_set_bgfg>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%bl
mov    $0x4,%eax
int    $0x83
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_set_bgfg>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%eax
int    $0x83
pop    %rbx
ret

LLVM IR (-O0):
define void @screen_set_bgfg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
ret void
}

LLVM IR (-O2):
define void @screen_set_bgfg(i8 zeroext %0) {
tail call void asm sideeffect "mov $$0x04, %eax", "{bx},~{dirflag},~{fpsr},~{flags}"(i8 %0)
tail call void asm sideeffect "int $$0x83", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int log_console_callback_init(void *args) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @log_console_callback_init(i8* nocapture readnone %0) {
ret i32 0
}
int heap_cmp(void *a, void *b) { return *(int *)a - *(int *)b; }


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

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

LLVM IR (-O0):
define i32 @heap_cmp(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @heap_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct nlattr {
  int dummy;
};
typedef int /*<<< orphan*/ __le64;

/* Variables and functions */
scalar_t__ nla_data(struct nlattr const *);
__le64 nla_get_le64(const struct nlattr *nla) {
  return *(__le64 *)nla_data(nla);
}


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

x86 assembly (clang, -O2):
<nla_get_le64>:
push   %rax
call   1030 <nla_data@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlattr = type { i32 }
define i32 @nla_get_le64(%struct.nlattr* %0) {
%2 = alloca %struct.nlattr*
store %struct.nlattr* %0, %struct.nlattr** %2
%3 = load %struct.nlattr*, %struct.nlattr** %2
%4 = call i64 @nla_data(%struct.nlattr* %3)
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.nlattr = type { i32 }
define i32 @nla_get_le64(%struct.nlattr* %0) {
%2 = tail call i64 @nla_data(%struct.nlattr* %0)
%3 = inttoptr i64 %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LCD_command(int);
void LCD_display_mode(int dm) { LCD_command(0x90 + dm); }


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

x86 assembly (clang, -O2):
<LCD_display_mode>:
add    $0x90,%edi
jmp    1030 <LCD_command@plt>

LLVM IR (-O0):
define void @LCD_display_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 144, %3
%5 = call i32 @LCD_command(i32 %4)
ret void
}

LLVM IR (-O2):
define void @LCD_display_mode(i32 %0) {
%2 = add nsw i32 %0, 144
%3 = tail call i32 @LCD_command(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BaroSensorHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void BaroSensorUpdated() { UAVObjUpdated(BaroSensorHandle()); }


x86 assembly (clang, -O0):
<BaroSensorUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <BaroSensorHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaroSensorUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <BaroSensorHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @BaroSensorUpdated() {
%1 = call i32 (...) @BaroSensorHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @BaroSensorUpdated() {
%1 = tail call i32 (...) @BaroSensorHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xcd() {
  Assert_real((iscntrl(205) == 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",
              1030, ("iscntrl should be 0 for 0xcd"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xcd>:
push   %rax
mov    $0xcd,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x406,%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 = [29 x i8] c"iscntrl should be 0 for 0xcd\00"
define void @t_iscntrl_0xcd() {
%1 = call i64 @iscntrl(i32 205)
%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 1030, i8* getelementptr inbounds ([29 x i8], [29 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 = [29 x i8] c"iscntrl should be 0 for 0xcd\00"
define void @t_iscntrl_0xcd() {
%1 = tail call i64 @iscntrl(i32 205)
%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 1030, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *gets(char *buff) {
  __asm__("mov $0x02, %%eax" ::"b"(buff));
  __asm__("int $0x84");
  return buff;
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x2,%eax
int    $0x84
mov    -0x10(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %rbx
mov    %rdi,%rax
mov    %rdi,%rbx
mov    $0x2,%eax
int    $0x84
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @gets(i8* returned %0) {
tail call void asm sideeffect "mov $$0x02, %eax", "{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
tail call void asm sideeffect "int $$0x84", "~{dirflag},~{fpsr},~{flags}"()
ret i8* %0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
scalar_t__ stat(char const *, struct stat *);
int readlink(const char *path, char *buf, size_t bufsize) {
  struct stat statbuf;
  if (stat(path, &statbuf) >= 0)
    errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jl     114d <readlink+0x3d>
mov    0x2e96(%rip),%rax
mov    (%rax),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1130 <readlink+0x20>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
mov    0x2eb2(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @readlink(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.stat
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i64 @stat(i8* %8, %struct.stat* %7)
%10 = icmp sge i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* @EINVAL
store i32 %12, i32* @errno
br label %13
13: ; preds = %11, %3
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @readlink(i8* %0, i8* nocapture readnone %1, i64 %2) {
%4 = alloca %struct.stat
%5 = bitcast %struct.stat* %4 to i8*
%6 = call i64 @stat(i8* %0, %struct.stat* %4)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = load i32, i32* @EINVAL
store i32 %9, i32* @errno
br label %10
10: ; preds = %8, %3
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t func1(uint32_t x) { return (x ^ (x >> 27)) * (uint32_t)1664525UL; }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1b,%ecx
xor    %ecx,%eax
imul   $0x19660d,%eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %edi,%eax
sar    $0x1b,%eax
xor    %edi,%eax
imul   $0x19660d,%eax,%eax
ret

LLVM IR (-O0):
define i32 @func1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 27
%6 = xor i32 %3, %5
%7 = mul nsw i32 %6, 1664525
ret i32 %7
}

LLVM IR (-O2):
define i32 @func1(i32 %0) {
%2 = ashr i32 %0, 27
%3 = xor i32 %2, %0
%4 = mul nsw i32 %3, 1664525
ret i32 %4
}
int f(int a) {
  int tmp, count = 0;
  while (a > 1) {
    tmp = a % 2;
    if (tmp == 0)
      a = a / 2;
    else
      a = a - 1;
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    115a <f+0x5a>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1143 <f+0x43>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    114c <f+0x4c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <f+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1128 <f+0x28>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
shr    %edx
add    $0xffffffff,%ecx
test   $0x1,%dil
cmove  %edx,%ecx
add    $0x1,%eax
mov    %ecx,%edi
cmp    $0x1,%ecx
ja     1110 <f+0x10>
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %11, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = lshr i32 %5, 1
%9 = add nsw i32 %5, -1
%10 = select i1 %7, i32 %8, i32 %9
%11 = add nuw nsw i32 %4, 1
%12 = icmp ugt i32 %10, 1
br i1 %12, label %3, label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %11, %3 ]
ret i32 %14
}
int test_imm_10uint16_mem(unsigned short *val) {
  return ((*val) & (-0x10 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_10uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xfffffff0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_10uint16_mem>:
cmpw   $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_10uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 16
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __l2_flush_invalidate_phys(unsigned long start, int size) {}


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

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

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

LLVM IR (-O2):
define void @__l2_flush_invalidate_phys(i64 %0, i32 %1) {
ret void
}
/* Variables and functions */
int mkdir(char *, int);
int wfile_status(char *);
int wfile_makedir(char *path) {
  int status;
  status = wfile_status(path);
  if (status != 0)
    return (-1);
  status = mkdir(path, 0755);
  if (status)
    return (-2);
  return (status);
}


x86 assembly (clang, -O0):
<wfile_makedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <wfile_status@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114e <wfile_makedir+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <wfile_makedir+0x5b>
mov    -0x10(%rbp),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1175 <wfile_makedir+0x55>
movl   $0xfffffffe,-0x4(%rbp)
jmp    117b <wfile_makedir+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_makedir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <wfile_status@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
je     1136 <wfile_makedir+0x16>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xfffffffe,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @wfile_makedir(i8* %0) {
%2 = tail call i32 @wfile_status(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @mkdir(i8* %0, i32 493)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 0, i32 -2
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int getchar();
int get_next_stdin(char const *not_used) { return getchar(); }


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

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

LLVM IR (-O0):
define i32 @get_next_stdin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @getchar()
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_next_stdin(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @getchar()
ret i32 %2
}
void ff_hevc_put_hevc_uni_epel_v32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v32_8_avx2() {
ret void
}
unsigned long get_state_synchronize_rcu(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @get_state_synchronize_rcu() {
ret i64 0
}

LLVM IR (-O2):
define i64 @get_state_synchronize_rcu() {
ret i64 0
}
void free_matrix(int ***M, int nx) {
  int i;
  for (i = 0; i < nx; i++)
    free((*M)[i]);
  free(*M);
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1154 <free_matrix+0x44>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_matrix+0x16>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_matrix>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1145 <free_matrix+0x35>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rax
mov    (%rax,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_matrix+0x20>
mov    (%r14),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_matrix(i32*** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = load i32**, i32*** %0
%9 = getelementptr inbounds i32*, i32** %8, i64 %7
%10 = bitcast i32** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast i32*** %0 to i8**
%16 = load i8*, i8** %15
tail call void @free(i8* %16)
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
double timeval_to_num(struct timeval *tv) {
  double d = tv->tv_sec;
  return d + (tv->tv_usec) / 1000000.0;
}


x86 assembly (clang, -O0):
<timeval_to_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
movsd  0xed5(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeval_to_num>:
movsd  0x8(%rdi),%xmm0
divsd  0xef3(%rip),%xmm0
addsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @timeval_to_num(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca double
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load double, double* %5
store double %6, double* %3
%7 = load double, double* %3
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %7, %11
ret double %12
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @timeval_to_num(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load double, double* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = fadd double %3, %6
ret double %7
}
/* Variables and functions */
int inb(unsigned int);
int t1_isfastlink(unsigned int base) { return (inb(base + 0x17) & ~0x82) == 1; }


x86 assembly (clang, -O0):
<t1_isfastlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x17,%edi
call   1030 <inb@plt>
and    $0xffffff7d,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_isfastlink>:
push   %rax
add    $0x17,%edi
call   1030 <inb@plt>
and    $0xffffff7d,%eax
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @t1_isfastlink(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 23
%5 = call i32 @inb(i32 %4)
%6 = and i32 %5, -131
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @t1_isfastlink(i32 %0) {
%2 = add i32 %0, 23
%3 = tail call i32 @inb(i32 %2)
%4 = and i32 %3, -131
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
long retbr_subcall();
long retbr_do_return_retaa(void) { return retbr_subcall() + 1; }


x86 assembly (clang, -O0):
<retbr_do_return_retaa>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <retbr_subcall@plt>
add    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @retbr_do_return_retaa() {
%1 = call i64 (...) @retbr_subcall()
%2 = add nsw i64 %1, 1
ret i64 %2
}

LLVM IR (-O2):
define i64 @retbr_do_return_retaa() {
%1 = tail call i64 (...) @retbr_subcall()
%2 = add nsw i64 %1, 1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ about();
int /*<<< orphan*/ start();
int main() {
  start();
  about();
  return 10;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @start()
%2 = tail call i32 (...) @about()
ret i32 10
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand_fraction(void) { return ((double)rand() / (RAND_MAX + 1.0)); }


x86 assembly (clang, -O0):
<rand_fraction>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
mov    0x2eb9(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_fraction>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_fraction() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_fraction() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %2, %4
ret double %5
}
void ff_hevc_put_hevc_bi_qpel_h32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h32_12_sse4() {
ret void
}
void lib$movc3(const unsigned short *size, const void *source,
               void *destination) {
  memmove(destination, source, *size);
  return;
}


x86 assembly (clang, -O0):
<lib$movc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib$movc3>:
mov    %rdx,%rax
movzwl (%rdi),%edx
mov    %rax,%rdi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @"lib$movc3"(i16* %0, i8* %1, i8* %2) {
%4 = alloca i16*
%5 = alloca i8*
%6 = alloca i8*
store i16* %0, i16** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %5
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = zext i16 %10 to i64
ret void
}

LLVM IR (-O2):
define void @"lib$movc3"(i16* nocapture %0, i8* nocapture %1, i8* nocapture writeonly %2) {
%4 = load i16, i16* %0
%5 = zext i16 %4 to i64
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %2, i8* align 1 %1, i64 %5, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *velika(char *);
int main() {
  char s[] = "Ovo je primjer.";
  printf("%s", velika(s));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <velika@plt>
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [16 x i8] c"Ovo je primjer.\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = bitcast [16 x i8]* %2 to i8*
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i8* @velika(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [16 x i8] c"Ovo je primjer.\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i8* @velika(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
long long util_rng_next(int);
long double util_rng_next_double() {
  long long a = util_rng_next(26);
  return ((a << 27) + util_rng_next(27)) / (long double)(1LL << 53);
}


x86 assembly (clang, -O0):
<util_rng_next_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1a,%edi
call   1030 <util_rng_next@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1b,%rax
mov    %rax,-0x18(%rbp)
mov    $0x1b,%edi
call   1030 <util_rng_next@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
fildll -0x10(%rbp)
flds   0xead(%rip)
fdivrp %st,%st(1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_rng_next_double>:
push   %rbx
sub    $0x10,%rsp
mov    $0x1a,%edi
call   1030 <util_rng_next@plt>
mov    %rax,%rbx
shl    $0x1b,%rbx
mov    $0x1b,%edi
call   1030 <util_rng_next@plt>
add    %rbx,%rax
mov    %rax,0x8(%rsp)
fildll 0x8(%rsp)
fmuls  0xebe(%rip)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define x86_fp80 @util_rng_next_double() {
%1 = alloca i64
%2 = call i64 @util_rng_next(i32 26)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = shl i64 %3, 27
%5 = call i64 @util_rng_next(i32 27)
%6 = add nsw i64 %4, %5
%7 = sitofp i64 %6 to x86_fp80
%8 = fdiv x86_fp80 %7, 0xK40348000000000000000
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @util_rng_next_double() {
%1 = tail call i64 @util_rng_next(i32 26)
%2 = shl i64 %1, 27
%3 = tail call i64 @util_rng_next(i32 27)
%4 = add nsw i64 %2, %3
%5 = sitofp i64 %4 to x86_fp80
%6 = fmul x86_fp80 %5, 0xK3FCA8000000000000000
ret x86_fp80 %6
}
void __cspec_noop() {}


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

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

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

LLVM IR (-O2):
define void @__cspec_noop() {
ret void
}
void init_3270() {}


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

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

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

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

/* Variables and functions */
uint8_t rot3(uint8_t x) { return (x << 3) | (x >> 5); }


x86 assembly (clang, -O0):
<rot3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot3>:
lea    0x0(,%rdi,8),%eax
sar    $0x5,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = load i32, i32* %2
%6 = ashr i32 %5, 5
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot3(i32 %0) {
%2 = shl i32 %0, 3
%3 = ashr i32 %0, 5
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
int strcmp(const char *s1, const char *s2) {
  printf("hack function invoked. s1=<%s> s2=<%s>\n", s1, s2);
  return 0;
}


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

x86 assembly (clang, -O2):
<strcmp>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"hack function invoked. s1=<%s> s2=<%s>\0A\00"
define i32 @strcmp(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 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"hack function invoked. s1=<%s> s2=<%s>\0A\00"
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int num1 = 4, num2 = 6;
  printf("num1 = %d, num2 = %d\n", num1, num2);
  swap(&num1, &num2);
  printf("num1 = %d, num2 = %d\n", num1, num2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [22 x i8] c"num1 = %d, num2 = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 6, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 4, i32 6)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
void *end_address(void *);
int continuous(void *ptr1, void *ptr2) { return end_address(ptr1) == ptr2; }


x86 assembly (clang, -O0):
<continuous>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <end_address@plt>
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<continuous>:
push   %rbx
mov    %rsi,%rbx
call   1030 <end_address@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @continuous(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 = call i8* @end_address(i8* %5)
%7 = load i8*, i8** %4
%8 = icmp eq i8* %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @continuous(i8* %0, i8* readnone %1) {
%3 = tail call i8* @end_address(i8* %0)
%4 = icmp eq i8* %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
int test11u(unsigned int x) { return x / 10U >= 2; }


x86 assembly (clang, -O0):
<test11u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x2,%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test11u>:
xor    %eax,%eax
cmp    $0x14,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @test11u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 10
%5 = icmp uge i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test11u(i32 %0) {
%2 = icmp ugt i32 %0, 19
%3 = zext i1 %2 to i32
ret i32 %3
}