xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
uint64_t elapsed_ns(const struct timespec *const ts_start,
                    const struct timespec *const ts_finish) {
  return (ts_finish->tv_sec - ts_start->tv_sec) * 1000000000 +
         (ts_finish->tv_nsec - ts_start->tv_nsec);
}


x86 assembly (clang, -O0):
<elapsed_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3b9aca00,%eax,%eax
cltq
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x8(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_ns>:
movslq (%rsi),%rax
movslq (%rdi),%rcx
sub    %rcx,%rax
imul   $0x3b9aca00,%rax,%rcx
mov    0x8(%rsi),%rax
sub    0x8(%rdi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @elapsed_ns(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %3
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000000
%13 = sext i32 %12 to i64
%14 = load %struct.timespec*, %struct.timespec** %4
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timespec*, %struct.timespec** %3
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = add nsw i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @elapsed_ns(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add nsw i64 %14, %9
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void got_libhdr(char *cp, int len) {
  (void)cp;
  (void)len;
  printf("LIBHDR\n");
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"LIBHDR\00"
define void @got_libhdr(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
int _Locale_mb_cur_min(struct _Locale_ctype *__DUMMY_PAR) { return 0; }


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

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

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

LLVM IR (-O2):
%struct._Locale_ctype = type opaque
define i32 @_Locale_mb_cur_min(%struct._Locale_ctype* nocapture readnone %0) {
ret i32 0
}
void RTP_set_seq_num(unsigned char *p, int v) {
  p[2] = (unsigned char)((unsigned int)(0x00ff & v >> 8));
  p[3] = (unsigned char)(0xff & v);
}


x86 assembly (clang, -O0):
<RTP_set_seq_num>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_set_seq_num>:
rol    $0x8,%si
mov    %si,0x2(%rdi)
ret

LLVM IR (-O0):
define void @RTP_set_seq_num(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 255, %6
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = and i32 255, %11
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 3
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @RTP_set_seq_num(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %6, i8* %7
ret void
}
/* Type definitions */
struct altera_i2c_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ altera_i2c_disable(struct altera_i2c_dev *);
int /*<<< orphan*/ altera_i2c_enable(struct altera_i2c_dev *);
void altera_i2c_reset(struct altera_i2c_dev *dev) {
  altera_i2c_disable(dev);
  altera_i2c_enable(dev);
}


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

x86 assembly (clang, -O2):
<altera_i2c_reset>:
push   %rbx
mov    %rdi,%rbx
call   1030 <altera_i2c_disable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <altera_i2c_enable@plt>

LLVM IR (-O0):
%struct.altera_i2c_dev = type { i32 }
define void @altera_i2c_reset(%struct.altera_i2c_dev* %0) {
%2 = alloca %struct.altera_i2c_dev*
store %struct.altera_i2c_dev* %0, %struct.altera_i2c_dev** %2
%3 = load %struct.altera_i2c_dev*, %struct.altera_i2c_dev** %2
%4 = call i32 @altera_i2c_disable(%struct.altera_i2c_dev* %3)
%5 = load %struct.altera_i2c_dev*, %struct.altera_i2c_dev** %2
%6 = call i32 @altera_i2c_enable(%struct.altera_i2c_dev* %5)
ret void
}

LLVM IR (-O2):
%struct.altera_i2c_dev = type { i32 }
define void @altera_i2c_reset(%struct.altera_i2c_dev* %0) {
%2 = tail call i32 @altera_i2c_disable(%struct.altera_i2c_dev* %0)
%3 = tail call i32 @altera_i2c_enable(%struct.altera_i2c_dev* %0)
ret void
}
/* Variables and functions */
int yywrap();
int airwrap(void) { return yywrap(); }


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

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

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

LLVM IR (-O2):
define i32 @airwrap() {
%1 = tail call i32 (...) @yywrap()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putchr(char);
void beep() { putchr((('G') & 037)); }


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

x86 assembly (clang, -O2):
<beep>:
mov    $0x7,%edi
jmp    1030 <putchr@plt>

LLVM IR (-O0):
define void @beep() {
%1 = call i32 @putchr(i8 signext 7)
ret void
}

LLVM IR (-O2):
define void @beep() {
%1 = tail call i32 @putchr(i8 signext 7)
ret void
}
void gtk_tree_view_scroll_to_cell() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_scroll_to_cell() {
ret void
}
int convert_c2v(char v1, char v2) {
  int valOut;
  valOut = (unsigned char)v1;
  valOut = valOut << 8;
  valOut = (valOut + ((unsigned char)v2));
  return valOut;
}


x86 assembly (clang, -O0):
<convert_c2v>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_c2v>:
movzbl %dil,%ecx
shl    $0x8,%ecx
movzbl %sil,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @convert_c2v(i8 signext %0, i8 signext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int random();
int get_int(void) { return random() & 0xffff; }


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <random@plt>
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movzwl %ax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_int() {
%1 = call i32 (...) @random()
%2 = and i32 %1, 65535
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_int() {
%1 = tail call i32 (...) @random()
%2 = and i32 %1, 65535
ret i32 %2
}
int test() {
  int a = 0;
  goto l3;
l1:
  goto l2;
l2:
  return (a != 1);
l3:
  a++;
  goto l1;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    1123 <test+0x23>
jmp    1115 <test+0x15>
cmpl   $0x1,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1110 <test+0x10>

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
store i32 0, i32* %1
br label %7
2: ; preds = %7
br label %3
3: ; preds = %2
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
7: ; preds = %0
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
void SPUstartChannels2(unsigned short channels) {}


x86 assembly (clang, -O0):
<SPUstartChannels2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SPUstartChannels2(i16 zeroext %0) {
ret void
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, char const *, char const *);
int shim_lremovexattr(const char *path, const char *name) {
  return (int)shim_enosys(0, path, name);
}


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

x86 assembly (clang, -O2):
<shim_lremovexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_lremovexattr(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 i64 @shim_enosys(i32 0, i8* %5, i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shim_lremovexattr(i8* %0, i8* %1) {
%3 = tail call i64 @shim_enosys(i32 0, i8* %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int emac2_etherstatsoversizepkts_set(
    unsigned int dev_id, union emac2_etherstatsoversizepkts_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac2_etherstatsoversizepkts_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac2_etherstatsoversizepkts_u = type opaque
define i32 @emac2_etherstatsoversizepkts_set(i32 %0, %union.emac2_etherstatsoversizepkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatsoversizepkts_u*
store i32 %0, i32* %3
store %union.emac2_etherstatsoversizepkts_u* %1, %union.emac2_etherstatsoversizepkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatsoversizepkts_u = type opaque
define i32 @emac2_etherstatsoversizepkts_set(i32 %0, %union.emac2_etherstatsoversizepkts_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
scalar_t__ lpxtxtest(char **);
int main(int argc, char **argv) { return (int)lpxtxtest(argv); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = call i64 @lpxtxtest(i8** %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @lpxtxtest(i8** %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
int execute_mincore() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mincore() {
ret i32 0
}
int is_sep(char c) {
  if (c == ' ' || c == '\t' || c == '\n' || c == '\v')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<is_sep>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     113e <is_sep+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     113e <is_sep+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     113e <is_sep+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0xb,%eax
jne    114a <is_sep+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_sep+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sep>:
cmp    $0x20,%dil
ja     1120 <is_sep+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100000e00,%rdx
bt     %rcx,%rdx
jae    1120 <is_sep+0x20>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_sep(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 9
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 11
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_sep(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 11, label %3
i8 10, label %3
i8 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int color_offset_f3(int x, int y) {
  return ((y << 10) + (((x << 10) * 181) / 35) - (18852 << 10)) >> 10;
}


x86 assembly (clang, -O0):
<color_offset_f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0xb5,%eax,%eax
mov    $0x23,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0x1269000,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f3>:
shl    $0xa,%esi
imul   $0x2d400,%edi,%eax
cltq
imul   $0xffffffffea0ea0eb,%rax,%rcx
shr    $0x20,%rcx
add    %ecx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x5,%eax
add    %ecx,%eax
add    %esi,%eax
add    $0xfed97000,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 181
%10 = sdiv i32 %9, 35
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 19304448
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f3(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 185344
%5 = sdiv i32 %4, 35
%6 = add nsw i32 %5, -19304448
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int strcmp(void *, void *);
int csc_cdll_my_compare(void *src, void *dst) { return strcmp(src, dst); }


x86 assembly (clang, -O0):
<csc_cdll_my_compare>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csc_cdll_my_compare>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @csc_cdll_my_compare(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @csc_cdll_my_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
int _pow2(int n) {
  int i, r = 1;
  for (i = 0; i < n; ++i) {
    r *= 2;
  }
  return r;
}


x86 assembly (clang, -O0):
<_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <_pow2+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <_pow2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pow2>:
test   %edi,%edi
jle    1118 <_pow2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <_pow2+0x1e>
mov    $0x1,%eax
jmp    1138 <_pow2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <_pow2+0x30>
test   %ecx,%ecx
je     1147 <_pow2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <_pow2+0x40>
ret

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

LLVM IR (-O2):
define i32 @_pow2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xb9() {
  Assert_real((isalpha(185) == 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_isalpha.c",
              930, ("isalpha should be 0 for 0xb9"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xb9>:
push   %rax
mov    $0xb9,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3a2,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb9\00"
define void @t_isalpha_0xb9() {
%1 = call i64 @isalpha(i32 185)
%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 930, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb9\00"
define void @t_isalpha_0xb9() {
%1 = tail call i64 @isalpha(i32 185)
%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 930, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool errata_120(void) {
  if ((*(uint32_t *)0x10000130ul == 0x8ul) &&
      (*(uint32_t *)0x10000134ul == 0x0ul)) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<errata_120>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10000130,%eax
movslq (%rax),%rax
cmp    $0x8,%rax
jne    1134 <errata_120+0x34>
mov    $0x10000134,%eax
movslq (%rax),%rax
cmp    $0x0,%rax
jne    1134 <errata_120+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <errata_120+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<errata_120>:
cmpl   $0x8,0x10000130
08
jne    1114 <errata_120+0x14>
cmpl   $0x0,0x10000134
je     1117 <errata_120+0x17>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @errata_120() {
%1 = alloca i32
%2 = load i32, i32* inttoptr (i64 268435760 to i32*)
%3 = sext i32 %2 to i64
%4 = icmp eq i64 %3, 8
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* inttoptr (i64 268435764 to i32*)
%7 = sext i32 %6 to i64
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %1
br label %11
10: ; preds = %5, %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @errata_120() {
%1 = load i32, i32* inttoptr (i64 268435760 to i32*)
%2 = icmp eq i32 %1, 8
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* inttoptr (i64 268435764 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2() { printf("Hello world 2\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello world 2\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
int fseDotDir(const char *pszDirName) {
  if (pszDirName[0] != '.' && (pszDirName[1] != '.' || pszDirName[1] != '\0'))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<fseDotDir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1146 <fseDotDir+0x46>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2e,%eax
jne    113a <fseDotDir+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1146 <fseDotDir+0x46>
movl   $0x0,-0x4(%rbp)
jmp    114d <fseDotDir+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fseDotDir>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @fseDotDir(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rfc4175_set_line_continuation(uint8_t *buf, uint8_t continuation) {
  buf[4] |= (!!continuation) << 7;
}


x86 assembly (clang, -O0):
<rfc4175_set_line_continuation>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
shl    $0x7,%ecx
mov    -0x8(%rbp),%rax
or     0x10(%rax),%ecx
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_set_line_continuation>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
shl    $0x7,%eax
or     %eax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @rfc4175_set_line_continuation(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = shl i32 %9, 7
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 4
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @rfc4175_set_line_continuation(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 0, i32 128
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
extern uint8_t LowBits(uint16_t word) { return word & 0xFF; }


x86 assembly (clang, -O0):
<LowBits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowBits>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @LowBits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
ret i32 %4
}

LLVM IR (-O2):
define i32 @LowBits(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int, int, int, int);
void deccara(int top, int left, int bottom, int right, int attr) {
  do_csi("%d;%d;%d;%d;%d$r", top, left, bottom, right, attr);
}


x86 assembly (clang, -O0):
<deccara>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
lea    0xec0(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deccara>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%d;%d;%d;%d;%d$r\00"
define void @deccara(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 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @do_csi(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%d;%d;%d;%d;%d$r\00"
define void @deccara(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @do_csi(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int __mib_chain_mib2tbl_id(int);
int _mib_chain_update(int id, unsigned char *ptr, unsigned int recordNum) {
  int i = __mib_chain_mib2tbl_id(id);
  return 1;
}


x86 assembly (clang, -O0):
<_mib_chain_update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__mib_chain_mib2tbl_id@plt>
mov    %eax,-0x18(%rbp)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_mib_chain_update(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @__mib_chain_mib2tbl_id(i32 %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x73() {
  Assert_real((isdigit(115) == 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_isdigit.c",
              580, ("isdigit should be 0 for s"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x73>:
push   %rax
mov    $0x73,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x244,%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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for s\00"
define void @t_isdigit_0x73() {
%1 = call i64 @isdigit(i32 115)
%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 580, 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_isdigit.c\00"
@.str.1 = [26 x i8] c"isdigit should be 0 for s\00"
define void @t_isdigit_0x73() {
%1 = tail call i64 @isdigit(i32 115)
%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 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int my_strlen(char *s) {
  int len = 0;
  while (*s) {
    len++;
    s++;
  }
  return len - 1;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1136 <my_strlen+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <my_strlen+0xf>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
cmpb   $0x0,(%rdi)
je     111d <my_strlen+0x1d>
add    $0x1,%rdi
mov    $0xffffffff,%eax
xchg   %ax,%ax
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @my_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = sub nsw i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ -1, %1 ], [ %5, %4 ]
ret i32 %12
}
/* Variables and functions */
int getchar();
int main() {
  int c;
  c = getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_atid(char *atid) {
  write("json-task.json", "\"task-id\":\"%s\" ", atid);
}


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

x86 assembly (clang, -O2):
<function_atid>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [16 x i8] c"\22task-id\22:\22%s\22 \00"
define void @function_atid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [16 x i8] c"\22task-id\22:\22%s\22 \00"
define void @function_atid(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
signed long long signedlonglong_ignoring_longlong(signed long long x,
                                                  long long y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @signedlonglong_ignoring_longlong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_longlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr8setBank0(int);
void m87_setParams(uint16_t addr, uint8_t val) {
  (void)addr;
  chr8setBank0((((val & 1) << 1) | ((val & 2) >> 1)) << 13);
}


x86 assembly (clang, -O0):
<m87_setParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x1,%edi
shl    $0x1,%edi
mov    -0x8(%rbp),%eax
and    $0x2,%eax
sar    $0x1,%eax
or     %eax,%edi
shl    $0xd,%edi
call   1030 <chr8setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m87_setParams>:
rol    $0x4,%sil
mov    %esi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%sil
and    $0x33,%sil
or     %al,%sil
mov    %esi,%eax
shr    %al
and    $0x40,%sil
add    %sil,%sil
or     %al,%sil
shr    $0x6,%sil
movzbl %sil,%edi
shl    $0xd,%edi
jmp    1030 <chr8setBank0@plt>

LLVM IR (-O0):
define void @m87_setParams(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 = and i32 %6, 1
%8 = shl i32 %7, 1
%9 = load i32, i32* %4
%10 = and i32 %9, 2
%11 = ashr i32 %10, 1
%12 = or i32 %8, %11
%13 = shl i32 %12, 13
%14 = call i32 @chr8setBank0(i32 %13)
ret void
}

LLVM IR (-O2):
define void @m87_setParams(i32 %0, i32 %1) {
%3 = trunc i32 %1 to i2
%4 = tail call i2 @llvm.bitreverse.i2(i2 %3)
%5 = zext i2 %4 to i32
%6 = shl nuw nsw i32 %5, 13
%7 = tail call i32 @chr8setBank0(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr();
int main() {
  pr();
  pr();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pr@plt>
xor    %eax,%eax
call   1030 <pr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pr()
%2 = tail call i32 (...) @pr()
ret i32 0
}
int test_imm_53int64_highword_reg(long long val) {
  return ((val >> 32) & (0x53 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_53int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x53,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_53int64_highword_reg>:
movabs $0x5300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_53int64_highword_reg(i64 %0) {
%2 = and i64 %0, 356482285568
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *convert(char *, int);
int /*<<< orphan*/ puts(char *);
int main() {
  char *s_zigzag = convert("A", 1);
  puts(s_zigzag);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"A\00"
define i32 @main() {
%1 = tail call i8* @convert(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *malloc(size_t);
void *memcpy(void *, void const *, size_t);
void *memdup(const void *data, size_t len) {
  void *copy = NULL;
  copy = len ? malloc(len) : NULL;
  return copy ? memcpy(copy, data, len) : NULL;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1155 <memdup+0x35>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
jmp    1160 <memdup+0x40>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1160 <memdup+0x40>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1195 <memdup+0x75>
mov    -0x18(%rbp),%rdi
mov    %rdi,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    11a0 <memdup+0x80>
xor    %eax,%eax
mov    %rax,-0x28(%rbp)
jmp    11a0 <memdup+0x80>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1150 <memdup+0x30>
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1150 <memdup+0x30>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
jmp    1153 <memdup+0x33>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32* @malloc(i64 %1)
%6 = bitcast i32* %5 to i8*
%7 = icmp eq i32* %5, null
br i1 %7, label %9, label %8
8: ; preds = %4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %6, i8* align 1 %0, i64 %1, i1 false)
br label %9
9: ; preds = %2, %4, %8
%10 = phi i8* [ %6, %8 ], [ null, %4 ], [ null, %2 ]
ret i8* %10
}
double small_fmodf(double f, double div) {
  if (f < 0)
    f = -f;
  if (div < 0)
    div = -div;
  while (f > div)
    f -= div;
  return f;
}


x86 assembly (clang, -O0):
<small_fmodf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <small_fmodf+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    116c <small_fmodf+0x6c>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1171 <small_fmodf+0x71>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1199 <small_fmodf+0x99>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1171 <small_fmodf+0x71>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_fmodf>:
movapd %xmm0,%xmm2
movapd 0xef4(%rip),%xmm3
movapd %xmm0,%xmm4
xorpd  %xmm3,%xmm4
xorpd  %xmm5,%xmm5
cmpltsd %xmm5,%xmm0
andpd  %xmm0,%xmm4
andnpd %xmm2,%xmm0
orpd   %xmm4,%xmm0
xorpd  %xmm1,%xmm3
movapd %xmm1,%xmm2
cmpltsd %xmm5,%xmm2
andpd  %xmm2,%xmm3
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
ucomisd %xmm2,%xmm0
jbe    115a <small_fmodf+0x5a>
nopl   0x0(%rax,%rax,1)
subsd  %xmm2,%xmm0
ucomisd %xmm2,%xmm0
ja     1150 <small_fmodf+0x50>
ret

LLVM IR (-O0):
define double @small_fmodf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp olt double %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %3
%9 = fneg double %8
store double %9, double* %3
br label %10
10: ; preds = %7, %2
%11 = load double, double* %4
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %4
%15 = fneg double %14
store double %15, double* %4
br label %16
16: ; preds = %13, %10
br label %17
17: ; preds = %21, %16
%18 = load double, double* %3
%19 = load double, double* %4
%20 = fcmp ogt double %18, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load double, double* %4
%23 = load double, double* %3
%24 = fsub double %23, %22
store double %24, double* %3
br label %17
25: ; preds = %17
%26 = load double, double* %3
ret double %26
}

LLVM IR (-O2):
define double @small_fmodf(double %0, double %1) {
%3 = fcmp olt double %0, 0.000000e+00
%4 = fneg double %0
%5 = select i1 %3, double %4, double %0
%6 = fcmp olt double %1, 0.000000e+00
%7 = fneg double %1
%8 = select i1 %6, double %7, double %1
%9 = fcmp ogt double %5, %8
br i1 %9, label %10, label %14
10: ; preds = %2, %10
%11 = phi double [ %12, %10 ], [ %5, %2 ]
%12 = fsub double %11, %8
%13 = fcmp ogt double %12, %8
br i1 %13, label %10, label %14
14: ; preds = %10, %2
%15 = phi double [ %5, %2 ], [ %12, %10 ]
ret double %15
}