xunge/DecIR huggingface dataset:
int fun1221() { return 1221; }


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

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

LLVM IR (-O0):
define i32 @fun1221() {
ret i32 1221
}

LLVM IR (-O2):
define i32 @fun1221() {
ret i32 1221
}
/* Variables and functions */
int /*<<< orphan*/ addstr(char *);
clear() { addstr("\e[H\e[J"); }


x86 assembly (clang, -O0):
<clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <addstr@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define i32 @clear() {
%1 = alloca i32
%2 = call i32 @addstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define i32 @clear() {
%1 = tail call i32 @addstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int main(void) {
  int l, l2, l3, l4;
  bool b, b2, b3, b4;
  int i, i2;
#pragma acc parallel if (l)
  ;
#pragma acc parallel if (b)
  ;
#pragma acc kernels if (l2)
  ;
#pragma acc kernels if (b2)
  ;
#pragma acc data if (l3)
  ;
#pragma acc data if (b3)
  ;
#pragma acc update if (l4) self(i)
  ;
#pragma acc update if (b4) self(i2)
  ;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int tour_compare_strings(const void *left_key, const void *right_key) {
  if (left_key == right_key)
    return 1;
  else if (left_key == ((void *)0) || right_key == ((void *)0))
    return 0;
  else
    return !strcmp((const char *)left_key, (const char *)right_key);
}


x86 assembly (clang, -O0):
<tour_compare_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <tour_compare_strings+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1179 <tour_compare_strings+0x69>
cmpq   $0x0,-0x10(%rbp)
je     1150 <tour_compare_strings+0x40>
cmpq   $0x0,-0x18(%rbp)
jne    115c <tour_compare_strings+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1179 <tour_compare_strings+0x69>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tour_compare_strings>:
cmp    %rsi,%rdi
je     1135 <tour_compare_strings+0x25>
xor    %eax,%eax
test   %rdi,%rdi
je     1134 <tour_compare_strings+0x24>
test   %rsi,%rsi
je     1134 <tour_compare_strings+0x24>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @tour_compare_strings(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %24
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i8*, i8** %5
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %13, %10
store i32 0, i32* %3
br label %24
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = call i32 @strcmp(i8* %18, i8* %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
store i32 %23, i32* %3
br label %24
24: ; preds = %17, %16, %9
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @tour_compare_strings(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
%6 = icmp eq i8* %1, null
%7 = or i1 %5, %6
br i1 %7, label %12, label %8
8: ; preds = %4
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %2, %8
%13 = phi i32 [ %11, %8 ], [ 1, %2 ], [ 0, %4 ]
ret i32 %13
}
unsigned int cmpp_sequence(void) {
  static unsigned int seq = 1;
  return (seq < 0x7fffffff) ? (seq++) : (seq = 1);
}


x86 assembly (clang, -O0):
<cmpp_sequence>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x7fffffff,0x2f12(%rip)
ff ff 7f
jae    112d <cmpp_sequence+0x2d>
mov    0x2f06(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2efb(%rip)
mov    %eax,-0x4(%rbp)
jmp    113f <cmpp_sequence+0x3f>
movl   $0x1,0x2ee9(%rip)
mov    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpp_sequence>:
mov    0x2f1a(%rip),%ecx
lea    0x1(%rcx),%edx
cmp    $0x7fffffff,%ecx
mov    $0x1,%eax
cmovae %eax,%edx
cmovb  %ecx,%eax
mov    %edx,0x2f00(%rip)
ret

LLVM IR (-O0):
@cmpp_sequence.seq = internal global i32 1
define i32 @cmpp_sequence() {
%1 = load i32, i32* @cmpp_sequence.seq
%2 = icmp ult i32 %1, 2147483647
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @cmpp_sequence.seq
%5 = add i32 %4, 1
store i32 %5, i32* @cmpp_sequence.seq
br label %7
6: ; preds = %0
store i32 1, i32* @cmpp_sequence.seq
br label %7
7: ; preds = %6, %3
%8 = phi i32 [ %4, %3 ], [ 1, %6 ]
ret i32 %8
}

LLVM IR (-O2):
@cmpp_sequence.seq = internal unnamed_addr global i32 1
define i32 @cmpp_sequence() {
%1 = load i32, i32* @cmpp_sequence.seq
%2 = icmp ult i32 %1, 2147483647
%3 = add i32 %1, 1
%4 = select i1 %2, i32 %3, i32 1
%5 = select i1 %2, i32 %1, i32 1
store i32 %4, i32* @cmpp_sequence.seq
ret i32 %5
}
/* Variables and functions */
unsigned int w5100_read_byte(int);
unsigned w5100_readRTR() {
  unsigned res = w5100_read_byte(0x0017);
  res = (res << 8) + w5100_read_byte(0x0017 + 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x17,%edi
call   1030 <w5100_read_byte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    $0x18,%edi
call   1030 <w5100_read_byte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    $0x17,%edi
call   1030 <w5100_read_byte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
mov    $0x18,%edi
call   1030 <w5100_read_byte@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @w5100_readRTR() {
%1 = alloca i32
%2 = call i32 @w5100_read_byte(i32 23)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = shl i32 %3, 8
%5 = call i32 @w5100_read_byte(i32 24)
%6 = add i32 %4, %5
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @w5100_readRTR() {
%1 = tail call i32 @w5100_read_byte(i32 23)
%2 = shl i32 %1, 8
%3 = tail call i32 @w5100_read_byte(i32 24)
%4 = add i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void die() {
  perror("mipsi");
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"mipsi\00"
define void @die() {
%1 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"mipsi\00"
define void @die() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int skip_whitespace(int c, FILE *fin) {
  while (c == ' ' || c == '\t')
    c = getc(fin);
  return c;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     1138 <skip_whitespace+0x28>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1148 <skip_whitespace+0x38>
jmp    1159 <skip_whitespace+0x49>
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x4(%rbp)
jmp    111f <skip_whitespace+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%eax
jmp    1128 <skip_whitespace+0x18>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <getc@plt>
cmp    $0x20,%eax
je     1120 <skip_whitespace+0x10>
cmp    $0x9,%eax
je     1120 <skip_whitespace+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @skip_whitespace(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %13, %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 32
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 9
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i32*, i32** %4
%15 = call i32 @getc(i32* %14)
store i32 %15, i32* %3
br label %5
16: ; preds = %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @skip_whitespace(i32 %0, i32* nocapture %1) {
br label %3
3: ; preds = %5, %2
%4 = phi i32 [ %0, %2 ], [ %6, %5 ]
switch i32 %4, label %7 [
i32 32, label %5
i32 9, label %5
]
5: ; preds = %3, %3
%6 = tail call i32 @getc(i32* %1)
br label %3
7: ; preds = %3
ret i32 %4
}
int toInt(char x) { return x - 'a'; }


x86 assembly (clang, -O0):
<toInt>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toInt>:
lea    -0x61(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @toInt(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 97
ret i32 %5
}

LLVM IR (-O2):
define i32 @toInt(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -97
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void fct_pddlfree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<fct_pddlfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fct_pddlfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ oled_partialclear(int /*<<< orphan*/, int /*<<< orphan*/,
                                     int, int);
void oled_clear() { oled_partialclear(0, 0, 128 - 1, 128 - 1); }


x86 assembly (clang, -O0):
<oled_clear>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    $0x7f,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1030 <oled_partialclear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_clear>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x7f,%edx
mov    $0x7f,%ecx
jmp    1030 <oled_partialclear@plt>

LLVM IR (-O0):
define void @oled_clear() {
%1 = call i32 @oled_partialclear(i32 0, i32 0, i32 127, i32 127)
ret void
}

LLVM IR (-O2):
define void @oled_clear() {
%1 = tail call i32 @oled_partialclear(i32 0, i32 0, i32 127, i32 127)
ret void
}
yyErr(n, l) { yyAbort(n, "flatten", l); }


x86 assembly (clang, -O0):
<yyErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rsi
mov    $0x0,%al
call   1030 <yyAbort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yyErr>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
xor    %eax,%eax
jmp    1030 <yyAbort@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"flatten\00"
define i32 @yyErr(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @yyAbort to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 undef
}
int letnum(c)
register int c;
{ return (letter(c) || digit(c)); }


x86 assembly (clang, -O0):
<letnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <letter@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1158 <letnum+0x38>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <digit@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<letnum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <letter@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1137 <letnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <digit@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @letnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) bitcast (i32 (...)* @digit to i32 (i32, ...)*)(i32 %7)
%9 = icmp ne i32 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @letnum(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @letter to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @digit to i32 (i32, ...)*)(i32 %0)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void cheat_init() { ; }


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

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

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

LLVM IR (-O2):
define void @cheat_init() {
ret void
}
/* Type definitions */
struct timeval {
  long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long get_curr_us() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((long)tv.tv_sec) * 1000 * 1000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<get_curr_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
imul   $0x3e8,%rax,%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_curr_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @get_curr_us() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @get_curr_us() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ print(void *);
void *th_main(void *arg) {
  int i;
  for (i = 0; i < 10; i++)
    print(arg);
}


x86 assembly (clang, -O0):
<th_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1144 <th_main+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <print@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <th_main+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<th_main>:
push   %rbx
mov    %rdi,%rbx
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
call   1030 <print@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <print@plt>

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

LLVM IR (-O2):
define noalias i8* @th_main(i8* %0) {
%2 = tail call i32 @print(i8* %0)
%3 = tail call i32 @print(i8* %0)
%4 = tail call i32 @print(i8* %0)
%5 = tail call i32 @print(i8* %0)
%6 = tail call i32 @print(i8* %0)
%7 = tail call i32 @print(i8* %0)
%8 = tail call i32 @print(i8* %0)
%9 = tail call i32 @print(i8* %0)
%10 = tail call i32 @print(i8* %0)
%11 = tail call i32 @print(i8* %0)
ret i8* undef
}
void foo_1_2_1_2_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x67() {
  Assert_real((isalpha(103)),
              "/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",
              520, ("isalpha should be 1 for g"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x67>:
push   %rbp
mov    %rsp,%rbp
mov    $0x67,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x208,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x67>:
push   %rax
mov    $0x67,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x208,%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 = [26 x i8] c"isalpha should be 1 for g\00"
define void @t_isalpha_0x67() {
%1 = call i32 @isalpha(i32 103)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 520, 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for g\00"
define void @t_isalpha_0x67() {
%1 = tail call i32 @isalpha(i32 103)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 520, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: \n");
  printf("%s [-d] <program to restrict>\n\n");
  printf("    -d : print debug output\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xee8(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Usage: \0A\00"
@.str.1 = [32 x i8] c"%s [-d] <program to restrict>\0A\0A\00"
@.str.2 = [29 x i8] c" -d : print debug output\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"%s [-d] <program to restrict>\0A\0A\00"
@str = [8 x i8] c"Usage: \00"
@str.3 = [28 x i8] c" -d : print debug output\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct extent_status {
  int dummy;
};

/* Variables and functions */
scalar_t__ ext4_es_is_unwritten(struct extent_status *);
scalar_t__ ext4_es_is_written(struct extent_status *);
int ext4_es_is_mapped(struct extent_status *es) {
  return (ext4_es_is_written(es) || ext4_es_is_unwritten(es));
}


x86 assembly (clang, -O0):
<ext4_es_is_mapped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ext4_es_is_written@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <ext4_es_is_mapped+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <ext4_es_is_unwritten@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext4_es_is_mapped>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ext4_es_is_written@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <ext4_es_is_mapped+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <ext4_es_is_unwritten@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.extent_status = type { i32 }
define i32 @ext4_es_is_mapped(%struct.extent_status* %0) {
%2 = alloca %struct.extent_status*
store %struct.extent_status* %0, %struct.extent_status** %2
%3 = load %struct.extent_status*, %struct.extent_status** %2
%4 = call i64 @ext4_es_is_written(%struct.extent_status* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load %struct.extent_status*, %struct.extent_status** %2
%8 = call i64 @ext4_es_is_unwritten(%struct.extent_status* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.extent_status = type { i32 }
define i32 @ext4_es_is_mapped(%struct.extent_status* %0) {
%2 = tail call i64 @ext4_es_is_written(%struct.extent_status* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ext4_es_is_unwritten(%struct.extent_status* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void gsize_set(void *g, unsigned int pos, unsigned int val) {
  ((unsigned int *)g)[pos] = val;
}


x86 assembly (clang, -O0):
<gsize_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsize_set>:
mov    %esi,%eax
mov    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @gsize_set(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %5
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
store i32 %7, i32* %12
ret void
}

LLVM IR (-O2):
define void @gsize_set(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = zext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
store i32 %2, i32* %6
ret void
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int decode_mkdir(struct tcb *, int /*<<< orphan*/);
int sys_mkdir(struct tcb *tcp) { return decode_mkdir(tcp, 0); }


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

x86 assembly (clang, -O2):
<sys_mkdir>:
xor    %esi,%esi
jmp    1030 <decode_mkdir@plt>

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

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_mkdir(%struct.tcb* %0) {
%2 = tail call i32 @decode_mkdir(%struct.tcb* %0, i32 0)
ret i32 %2
}
void outer_nolock_flush_all(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_nolock_flush_all() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num;
  num = 1;
  while (num < 100) {
    printf("%d - ", num);
    num = num + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
lea    0xee0(%rip),%r14
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x62,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d - \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 2
%5 = icmp ult i32 %2, 98
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ numa_free(void *, int);
void buf_release(void *buf) { numa_free(buf, 256 * 1024 * 1024); }


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

x86 assembly (clang, -O2):
<buf_release>:
mov    $0x10000000,%esi
jmp    1030 <numa_free@plt>

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

LLVM IR (-O2):
define void @buf_release(i8* %0) {
%2 = tail call i32 @numa_free(i8* %0, i32 268435456)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int x = 30, y = 20, z = 10;
  if (x > y && y > z)
    printf("x: %d is greater than y: %d and y: %d is greater than z: %d", x, y,
           y, z);
  else
    printf("expression return false");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1e,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    116c <main+0x5c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    116c <main+0x5c>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117a <main+0x6a>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1e,%esi
mov    $0x14,%edx
mov    $0x14,%ecx
mov    $0xa,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"x: %d is greater than y: %d and y: %d is greater than z: %d\00"
@.str.1 = [24 x i8] c"expression return false\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 30, i32* %2
store i32 20, i32* %3
store i32 10, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %18
8: ; preds = %0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i32 %15, i32 %16)
br label %20
18: ; preds = %8, %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [60 x i8] c"x: %d is greater than y: %d and y: %d is greater than z: %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i32 30, i32 20, i32 20, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void USB_HP_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @USB_HP_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @USB_HP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
unsigned int pfa_GetPageIndexOfAddr(unsigned int addr) { return addr / 4096; }


x86 assembly (clang, -O0):
<pfa_GetPageIndexOfAddr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfa_GetPageIndexOfAddr>:
mov    %edi,%eax
shr    $0xc,%eax
ret

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

LLVM IR (-O2):
define i32 @pfa_GetPageIndexOfAddr(i32 %0) {
%2 = lshr i32 %0, 12
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ print_char(int, int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ set_text_color(unsigned char);
void main() {
  clear_screen();
  int i;
  for (i = 'a'; i <= 'y'; i++) {
    set_text_color((unsigned char)i);
    print_char(i, -1, -1);
    puts("test \n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clear_screen@plt>
movl   $0x61,-0x4(%rbp)
cmpl   $0x79,-0x4(%rbp)
jg     1194 <main+0x54>
mov    -0x4(%rbp),%eax
movzbl %al,%edi
call   1060 <set_text_color@plt>
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%edx
mov    %edx,%esi
call   1050 <print_char@plt>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1156 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <clear_screen@plt>
mov    $0x61,%ebx
lea    0xea9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movzbl %bl,%edi
call   1060 <set_text_color@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
call   1050 <print_char@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
cmp    $0x7a,%ebx
jne    1160 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"test \0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @clear_screen()
store i32 97, i32* %1
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 121
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
%9 = call i32 @set_text_color(i8 zeroext %8)
%10 = load i32, i32* %1
%11 = call i32 @print_char(i32 %10, i32 -1, i32 -1)
%12 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %6
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test \0A\00"
define void @main() {
%1 = tail call i32 (...) @clear_screen()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 97, %0 ], [ %8, %2 ]
%4 = trunc i32 %3 to i8
%5 = tail call i32 @set_text_color(i8 zeroext %4)
%6 = tail call i32 @print_char(i32 %3, i32 -1, i32 -1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 122
br i1 %9, label %10, label %2
10: ; preds = %2
ret void
}
int get_thin_subvol_size(struct mosaic *m, struct volume *v,
                         unsigned long *size_in_blocks) {
  return -1;
}


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

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

LLVM IR (-O0):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @get_thin_subvol_size(%struct.mosaic* %0, %struct.volume* %1, i64* %2) {
%4 = alloca %struct.mosaic*
%5 = alloca %struct.volume*
%6 = alloca i64*
store %struct.mosaic* %0, %struct.mosaic** %4
store %struct.volume* %1, %struct.volume** %5
store i64* %2, i64** %6
ret i32 -1
}

LLVM IR (-O2):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @get_thin_subvol_size(%struct.mosaic* nocapture readnone %0, %struct.volume* nocapture readnone %1, i64* nocapture readnone %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xbb() {
  Assert_real((isxdigit(187) == 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_isxdigit.c",
              940, ("isxdigit should be 0 for 0xbb"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xbb>:
push   %rax
mov    $0xbb,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3ac,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xbb\00"
define void @t_isxdigit_0xbb() {
%1 = call i64 @isxdigit(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xbb\00"
define void @t_isxdigit_0xbb() {
%1 = tail call i64 @isxdigit(i32 187)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 940, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint8_t;
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t get32bit(const uint8_t **ptr) {
  uint32_t t32;
  t32 =
      ((*ptr)[3] + 256U * ((*ptr)[2] + 256U * ((*ptr)[1] + 256U * (*ptr)[0])));
  (*ptr) += 4;
  return t32;
}


x86 assembly (clang, -O0):
<get32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0xc(%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    0x8(%rcx),%ecx
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rdx
mov    0x4(%rdx),%edx
mov    -0x8(%rbp),%rsi
mov    (%rsi),%rsi
mov    (%rsi),%esi
shl    $0x8,%esi
add    %esi,%edx
shl    $0x8,%edx
add    %edx,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x10,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32bit>:
mov    (%rdi),%rcx
mov    (%rcx),%eax
shl    $0x8,%eax
add    0x4(%rcx),%eax
shl    $0x8,%eax
add    0x8(%rcx),%eax
shl    $0x8,%eax
add    0xc(%rcx),%eax
add    $0x10,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i32 @get32bit(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load i32, i32* %6
%8 = load i32**, i32*** %2
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = load i32**, i32*** %2
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32**, i32*** %2
%17 = load i32*, i32** %16
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = mul i32 256, %19
%21 = add i32 %15, %20
%22 = mul i32 256, %21
%23 = add i32 %11, %22
%24 = mul i32 256, %23
%25 = add i32 %7, %24
store i32 %25, i32* %3
%26 = load i32**, i32*** %2
%27 = load i32*, i32** %26
%28 = getelementptr inbounds i32, i32* %27, i64 4
store i32* %28, i32** %26
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @get32bit(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 3
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %2, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %2, i64 1
%8 = load i32, i32* %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = add i32 %10, %8
%12 = shl i32 %11, 8
%13 = add i32 %12, %6
%14 = shl i32 %13, 8
%15 = add i32 %14, %4
%16 = getelementptr inbounds i32, i32* %2, i64 4
store i32* %16, i32** %0
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ set_ptr_local_array();
void set_ptr_local_array_return_true_ok() {
  int *p = 0;
  if (!set_ptr_local_array())
    *p = 42;
}


x86 assembly (clang, -O0):
<set_ptr_local_array_return_true_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <set_ptr_local_array@plt>
cmp    $0x0,%eax
jne    113a <set_ptr_local_array_return_true_ok+0x2a>
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_ptr_local_array_return_true_ok() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32 (...) @set_ptr_local_array()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = load i32*, i32** %1
store i32 42, i32* %5
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @set_ptr_local_array_return_true_ok() {
%1 = tail call i32 (...) @set_ptr_local_array()
%2 = icmp ne i32 %1, 0
tail call void @llvm.assume(i1 %2)
ret void
}
/* Variables and functions */
double M_PI;
double rad_to_deg(double radians) { return radians * (180.0 / M_PI); }


x86 assembly (clang, -O0):
<rad_to_deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mov    0x2ecb(%rip),%rax
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad_to_deg>:
mov    0x2ee1(%rip),%rax
movsd  0xef1(%rip),%xmm1
divsd  (%rax),%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @rad_to_deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* @M_PI
%5 = fdiv double 1.800000e+02, %4
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @rad_to_deg(double %0) {
%2 = load double, double* @M_PI
%3 = fdiv double 1.800000e+02, %2
%4 = fmul double %3, %0
ret double %4
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void platform_main_end(uint16_t crc) {
  printf("checksum = %04X\n", (unsigned int)crc);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"checksum = %04X\0A\00"
define void @platform_main_end(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"checksum = %04X\0A\00"
define void @platform_main_end(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
void remove_entry(void *memory) {}


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

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

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

LLVM IR (-O2):
define void @remove_entry(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure();
void texit(void) {
  extern void exit(int);
  exit(1);
  link_failure();
}


x86 assembly (clang, -O0):
<texit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<texit>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @texit() {
unreachable
}

LLVM IR (-O2):
define void @texit() {
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
int onSameCol(int, int);
int onSameRow(int, int);
int isOnQueenRoute(int cellId, int queenCellId) {
  return onSameCol(cellId, queenCellId) | onSameRow(cellId, queenCellId);
}


x86 assembly (clang, -O0):
<isOnQueenRoute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <onSameCol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <onSameRow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOnQueenRoute>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <onSameCol@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <onSameRow@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isOnQueenRoute(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 = call i32 @onSameCol(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @onSameRow(i32 %8, i32 %9)
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @isOnQueenRoute(i32 %0, i32 %1) {
%3 = tail call i32 @onSameCol(i32 %0, i32 %1)
%4 = tail call i32 @onSameRow(i32 %0, i32 %1)
%5 = or i32 %4, %3
ret i32 %5
}
int test_imm_20uint8_reg(unsigned char val) {
  return ((val) & (0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x20,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20uint8_reg>:
test   $0x20,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_20uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 32
%6 = icmp ne i32 %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_20uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 32
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}