xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello");
  if (0 == fork()) {
    printf("child\n");
    return 0;
  }
  printf("parent\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1168 <main+0x48>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    117b <main+0x5b>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
lea    0xebf(%rip),%rax
lea    0xeb1(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@str = [7 x i8] c"parent\00"
@str.3 = [6 x i8] c"child\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 (...) @fork()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0)
%5 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cont_str();
int main(int argc, const char *argv[]) { cont_str(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cont_str()
ret i32 0
}
int stringLength(const char *str) {
  int result = 0;
  for (; str[result]; ++result)
    ;
  return result;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1134 <stringLength+0x34>
jmp    1126 <stringLength+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stringLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <stringLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int is_I_slice(int slice_type) {
  return slice_type == 2 || slice_type == 4 || slice_type == 7 ||
         slice_type == 9;
}


x86 assembly (clang, -O0):
<is_I_slice>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_I_slice+0x3e>
mov    $0x1,%al
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_I_slice+0x3e>
mov    $0x1,%al
cmpl   $0x7,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <is_I_slice+0x3e>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_I_slice>:
cmp    $0x7,%edi
ja     1115 <is_I_slice+0x15>
mov    $0x1,%eax
mov    $0x94,%ecx
bt     %edi,%ecx
jae    1115 <is_I_slice+0x15>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_I_slice(i32 %0) {
switch i32 %0, label %2 [
i32 7, label %5
i32 4, label %5
i32 2, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ jbcdoubler_(float *, float *);
int /*<<< orphan*/ printf(char *, double, float);
int main(int argc, char **argv) {
  float two = 2.0;
  float four = 1.0;
  jbcdoubler_(&two, &four);
  printf("doubled %f = %f\n", 2.0, four);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xed5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec4(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <jbcdoubler_@plt>
movss  -0x18(%rbp),%xmm1
lea    0xeae(%rip),%rdi
movsd  0xe96(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x40000000,0x4(%rsp)
40
movl   $0x3f800000,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <jbcdoubler_@plt>
movss  (%rsp),%xmm1
lea    0xebf(%rip),%rdi
movsd  0xeaf(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"doubled %f = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %3
store i8** %1, i8*** %4
store float 2.000000e+00, float* %5
store float 1.000000e+00, float* %6
%7 = call i32 @jbcdoubler_(float* %5, float* %6)
%8 = load float, float* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"doubled %f = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca float
%5 = bitcast float* %3 to i8*
store float 2.000000e+00, float* %3
%6 = bitcast float* %4 to i8*
store float 1.000000e+00, float* %4
%7 = call i32 @jbcdoubler_(float* %3, float* %4)
%8 = load float, float* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, float %8)
ret i32 0
}
void deselect_chip() { (*(volatile unsigned long *)0x4E000004) |= (1 << 1); }


x86 assembly (clang, -O0):
<deselect_chip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4e000004,%eax
mov    (%rax),%rcx
or     $0x2,%rcx
mov    $0x4e000004,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<deselect_chip>:
orq    $0x2,0x4e000004
4e 02
ret

LLVM IR (-O0):
define void @deselect_chip() {
%1 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1308622852 to i64*)
ret void
}

LLVM IR (-O2):
define void @deselect_chip() {
%1 = load volatile i64, i64* inttoptr (i64 1308622852 to i64*)
%2 = or i64 %1, 2
store volatile i64 %2, i64* inttoptr (i64 1308622852 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Open Source YEE Project\n");
  printf("Hi Taehun Lee~\n");
  printf("First Github Training\n");
  printf("2014244013 Daeyeon Noh\n");
  printf("2012244072 TaeHun Lee\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"Open Source YEE Project\0A\00"
@.str.1 = [16 x i8] c"Hi Taehun Lee~\0A\00"
@.str.2 = [23 x i8] c"First Github Training\0A\00"
@.str.3 = [24 x i8] c"2014244013 Daeyeon Noh\0A\00"
@.str.4 = [23 x i8] c"2012244072 TaeHun Lee\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"Open Source YEE Project\00"
@str.5 = [15 x i8] c"Hi Taehun Lee~\00"
@str.6 = [22 x i8] c"First Github Training\00"
@str.7 = [23 x i8] c"2014244013 Daeyeon Noh\00"
@str.8 = [22 x i8] c"2012244072 TaeHun Lee\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int x) { printf("%d\n", x); }


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

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void AYUVToYRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @AYUVToYRow_NEON() {
ret void
}
int max1(int a, int b) { return a < b ? b : a; }


x86 assembly (clang, -O0):
<max1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max1+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max1+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max1>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max1(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max1(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Type definitions */
struct TagItem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct TagItem *);
void FreeTagItems(struct TagItem *tagList) {
  if (tagList)
    free(tagList);
}


x86 assembly (clang, -O0):
<FreeTagItems>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <FreeTagItems+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeTagItems>:
test   %rdi,%rdi
je     111a <FreeTagItems+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.TagItem = type { i32 }
define void @FreeTagItems(%struct.TagItem* %0) {
%2 = alloca %struct.TagItem*
store %struct.TagItem* %0, %struct.TagItem** %2
%3 = load %struct.TagItem*, %struct.TagItem** %2
%4 = icmp ne %struct.TagItem* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load %struct.TagItem*, %struct.TagItem** %2
%7 = call i32 @free(%struct.TagItem* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
%struct.TagItem = type { i32 }
define void @FreeTagItems(%struct.TagItem* %0) {
%2 = icmp eq %struct.TagItem* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.TagItem* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void set_tty_crmod(int enabled) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @set_tty_crmod(i32 %0) {
ret void
}
/* Variables and functions */
int hiperfatorial(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("O hiperfatorial de 4 eh: %d", hiperfatorial(4));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"O hiperfatorial de 4 eh: %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hiperfatorial(i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"O hiperfatorial de 4 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @hiperfatorial(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void fixline(char *line) {
  char *p;
  if ((p = strchr(line, '\n'))) {
    *p = '\0';
  }
}


x86 assembly (clang, -O0):
<fixline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <fixline+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixline>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <fixline+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @fixline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8 0, i8* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fixline(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_whence;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int lock(int fd) {
  struct flock lock;
  lock.l_type = F_WRLCK;
  lock.l_whence = SEEK_SET;
  lock.l_start = 0;
  lock.l_len = 0;
  return fcntl(fd, F_SETLK, &lock);
}


x86 assembly (clang, -O0):
<lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock>:
sub    $0x18,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i64, i32, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @lock(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLK
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret i32 %12
}

LLVM IR (-O2):
%struct.flock = type { i64, i64, i32, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @lock(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = load i32, i32* @SEEK_SET
%7 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i32 %6, i32* %7
%8 = bitcast %struct.flock* %2 to i8*
%9 = load i32, i32* @F_SETLK
%10 = call i32 @fcntl(i32 %0, i32 %9, %struct.flock* %2)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x12() {
  Assert_real((ispunct(18) == 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_ispunct.c",
              95, ("ispunct should be 0 for 0x12"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x12>:
push   %rax
mov    $0x12,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5f,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x12\00"
define void @t_ispunct_0x12() {
%1 = call i64 @ispunct(i32 18)
%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 95, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x12\00"
define void @t_ispunct_0x12() {
%1 = tail call i64 @ispunct(i32 18)
%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 95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char get_random();
char get_random_char_range(char min, char max) {
  char tmp;
  uint8_t range;
  range = max - min;
  tmp = get_random();
  return ((tmp & 0xFF) % range) + min;
}


x86 assembly (clang, -O0):
<get_random_char_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x1(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_random@plt>
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
and    $0xff,%eax
movsbl -0x4(%rbp),%ecx
cltd
idiv   %ecx
movsbl -0x1(%rbp),%eax
add    %eax,%edx
mov    %dl,%al
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_char_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
sub    %bpl,%bl
xor    %eax,%eax
call   1030 <get_random@plt>
movzbl %al,%eax
movsbl %bl,%ecx
xor    %edx,%edx
idiv   %cx
add    %dl,%bpl
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @get_random_char_range(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %8, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
%13 = call signext i8 (...) @get_random()
store i8 %13, i8* %5
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = and i32 %15, 255
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = srem i32 %16, %18
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = add nsw i32 %19, %21
%23 = trunc i32 %22 to i8
ret i8 %23
}

LLVM IR (-O2):
define signext i8 @get_random_char_range(i8 signext %0, i8 signext %1) {
%3 = sub i8 %1, %0
%4 = tail call signext i8 (...) @get_random()
%5 = zext i8 %4 to i16
%6 = sext i8 %3 to i16
%7 = srem i16 %5, %6
%8 = trunc i16 %7 to i8
%9 = add i8 %8, %0
ret i8 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ST7735_Line(int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
void LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,
                  uint16_t color) {
  ST7735_Line(x1, y1, x2, y2, color);
}


x86 assembly (clang, -O0):
<LCD_DrawLine>:
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),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <ST7735_Line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_DrawLine>:
jmp    1030 <ST7735_Line@plt>

LLVM IR (-O0):
define void @LCD_DrawLine(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 @ST7735_Line(i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
define void @LCD_DrawLine(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @ST7735_Line(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void window_editor_objective_options_open() {
  RCT2_CALLPROC_EBPSAFE(0x0067137D);
}


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

x86 assembly (clang, -O2):
<window_editor_objective_options_open>:
mov    $0x67137d,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @window_editor_objective_options_open() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 6755197)
ret void
}

LLVM IR (-O2):
define void @window_editor_objective_options_open() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 6755197)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void expect(unsigned int pattern, unsigned int value) {
  if (pattern != value)
    abort();
}


x86 assembly (clang, -O0):
<expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1131 <expect+0x21>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect>:
cmp    %esi,%edi
jne    1115 <expect+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @expect(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @expect(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret void
}
/* Variables and functions */
int bsearch(char **, int /*<<< orphan*/, int, char *);
int search(char *d[], int len, char *s) { return bsearch(d, 0, len - 1, s); }


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <bsearch@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    %rdx,%rcx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <bsearch@plt>

LLVM IR (-O0):
define i32 @search(i8** %0, i32 %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8*
store i8** %0, i8*** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i8*, i8** %6
%11 = call i32 @bsearch(i8** %7, i32 0, i32 %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @search(i8** %0, i32 %1, i8* %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @bsearch(i8** %0, i32 0, i32 %4, i8* %2)
ret i32 %5
}
void EXTI9_5_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @EXTI9_5_IRQHandler() {
ret void
}
/* Variables and functions */
scalar_t__ lookup_frec(unsigned short, unsigned int);
unsigned short rand16();
unsigned short get_id(unsigned int crc) {
  unsigned short ret = 0;
  do
    ret = rand16();
  while (lookup_frec(ret, crc));
  return ret;
}


x86 assembly (clang, -O0):
<get_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
mov    $0x0,%al
call   1030 <rand16@plt>
mov    %ax,-0x6(%rbp)
mov    -0x6(%rbp),%ax
mov    -0x4(%rbp),%esi
movzwl %ax,%edi
call   1040 <lookup_frec@plt>
cmp    $0x0,%rax
jne    1131 <get_id+0x11>
movzwl -0x6(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_id>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand16@plt>
mov    %eax,%ebp
movzwl %ax,%edi
mov    %ebx,%esi
call   1040 <lookup_frec@plt>
test   %rax,%rax
jne    1130 <get_id+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @get_id(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
store i16 0, i16* %3
br label %4
4: ; preds = %6, %1
%5 = call zeroext i16 (...) @rand16()
store i16 %5, i16* %3
br label %6
6: ; preds = %4
%7 = load i16, i16* %3
%8 = load i32, i32* %2
%9 = call i64 @lookup_frec(i16 zeroext %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %6
%12 = load i16, i16* %3
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @get_id(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call zeroext i16 (...) @rand16()
%4 = tail call i64 @lookup_frec(i16 zeroext %3, i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int epoll_create1(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int xepoll_create1(int flags) {
  int epfd;
  epfd = epoll_create1(flags);
  if (epfd == -1) {
    perror("epoll_create1");
    exit(EXIT_FAILURE);
  } else {
    return epfd;
  }
}


x86 assembly (clang, -O0):
<xepoll_create1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <epoll_create1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    116a <xepoll_create1+0x3a>
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xepoll_create1>:
push   %rax
call   1050 <epoll_create1@plt>
cmp    $0xffffffff,%eax
je     113d <xepoll_create1+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"epoll_create1\00"
@EXIT_FAILURE = global i32 0
define i32 @xepoll_create1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @epoll_create1(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [14 x i8] c"epoll_create1\00"
@EXIT_FAILURE = global i32 0
define i32 @xepoll_create1(i32 %0) {
%2 = tail call i32 @epoll_create1(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i32 %2
}
unsigned char Read_1302_Port(void) {
  unsigned char c;
  c = *(volatile unsigned char *)(0x10000000 + 0x1c9);
  c = c & (1 + 2 + 4);
  return (c);
}


x86 assembly (clang, -O0):
<Read_1302_Port>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100001c9,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x7,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Read_1302_Port>:
mov    0x100001c9,%al
and    $0x7,%al
ret

LLVM IR (-O0):
define zeroext i8 @Read_1302_Port() {
%1 = alloca i8
%2 = load volatile i8, i8* inttoptr (i64 268435913 to i8*)
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = and i32 %4, 7
%6 = trunc i32 %5 to i8
store i8 %6, i8* %1
%7 = load i8, i8* %1
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @Read_1302_Port() {
%1 = load volatile i8, i8* inttoptr (i64 268435913 to i8*)
%2 = and i8 %1, 7
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ mdea_error(char **, char *);
int mdea_array_node_get_string(void *p, const char **string, char **error) {
  mdea_error(error, "Expected string, got array");
  return -1;
}


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

x86 assembly (clang, -O2):
<mdea_array_node_get_string>:
push   %rax
mov    %rdx,%rdi
lea    0xee5(%rip),%rsi
call   1030 <mdea_error@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Expected string, got array\00"
define i32 @mdea_array_node_get_string(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = call i32 @mdea_error(i8** %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [27 x i8] c"Expected string, got array\00"
define i32 @mdea_array_node_get_string(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** %2) {
%4 = tail call i32 @mdea_error(i8** %2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int checkchar(char p) {
  if ((p >= 'a') && (p <= 'z'))
    return 1;
  if ((p >= 'A') && (p <= 'Z'))
    return 1;
  if ((p >= '0') && (p <= '9'))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<checkchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1130 <checkchar+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1130 <checkchar+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1183 <checkchar+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1156 <checkchar+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1156 <checkchar+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1183 <checkchar+0x83>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     117c <checkchar+0x7c>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     117c <checkchar+0x7c>
movl   $0x1,-0x4(%rbp)
jmp    1183 <checkchar+0x83>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkchar>:
mov    %edi,%eax
and    $0xdf,%al
add    $0xbf,%al
cmp    $0x1a,%al
setb   %al
add    $0xd0,%dil
cmp    $0xa,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @checkchar(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 sge i32 %5, 97
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %31
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sge i32 %14, 65
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %31
21: ; preds = %16, %12
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 48
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 1, i32* %2
br label %31
30: ; preds = %25, %21
store i32 0, i32* %2
br label %31
31: ; preds = %30, %29, %20, %11
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
define i32 @checkchar(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = add i8 %0, -48
%6 = icmp ult i8 %5, 10
%7 = or i1 %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
unsigned xrop3_15_0_0(unsigned char s, unsigned char t) {
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = ~T;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_15_0_0>:
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_15_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putbc(unsigned int, int);
int /*<<< orphan*/ putnum_l1a(unsigned int);
void putnum_l1b(unsigned int i) {
  if (i <= 2) {
    putbc(i + 1, 0x2);
    return;
  }
  putnum_l1a(i - 1);
  return;
}


x86 assembly (clang, -O0):
<putnum_l1b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
ja     114a <putnum_l1b+0x2a>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    $0x2,%esi
call   1030 <putbc@plt>
jmp    1155 <putnum_l1b+0x35>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <putnum_l1a@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putnum_l1b>:
cmp    $0x2,%edi
ja     1132 <putnum_l1b+0x12>
add    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <putbc@plt>
add    $0xffffffff,%edi
jmp    1040 <putnum_l1a@plt>

LLVM IR (-O0):
define void @putnum_l1b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ule i32 %3, 2
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add i32 %6, 1
%8 = call i32 @putbc(i32 %7, i32 2)
br label %13
9: ; preds = %1
%10 = load i32, i32* %2
%11 = sub i32 %10, 1
%12 = call i32 @putnum_l1a(i32 %11)
br label %13
13: ; preds = %9, %5
ret void
}

LLVM IR (-O2):
define void @putnum_l1b(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = add nuw nsw i32 %0, 1
%5 = tail call i32 @putbc(i32 %4, i32 2)
br label %9
6: ; preds = %1
%7 = add i32 %0, -1
%8 = tail call i32 @putnum_l1a(i32 %7)
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void mp_decode_nil(const char **data) {
  unsigned char c = (unsigned char)**data;
  assert(c == 0xc0);
  (void)c;
  *data += 1;
}


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

x86 assembly (clang, -O2):
<mp_decode_nil>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
xor    %edi,%edi
cmpb   $0xc0,(%rax)
sete   %dil
call   1030 <assert@plt>
addq   $0x1,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mp_decode_nil(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 192
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8, i8* %3
%13 = load i8**, i8*** %2
%14 = load i8*, i8** %13
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %13
ret void
}

LLVM IR (-O2):
define void @mp_decode_nil(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, -64
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
ret void
}
void g_node_find() {}


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

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

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

LLVM IR (-O2):
define void @g_node_find() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(size_t);
void *s_malloc(size_t size) {
  void *ptr = NULL;
  ptr = malloc(size);
  if (ptr == NULL) {
    error("s_malloc(): Unable to alloc");
  }
  return ptr;
}


x86 assembly (clang, -O0):
<s_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <s_malloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <s_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"s_malloc(): Unable to alloc\00"
define i8* @s_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
store i8* null, i8** %3
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [28 x i8] c"s_malloc(): Unable to alloc\00"
define noalias i8* @s_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
char *fp(const char *dir, const char *fn, const char *ft) {
  char *s = (char *)malloc(100);
  strcpy(s, dir);
  strcat(s, fn);
  strcat(s, ".");
  strcat(s, ft);
  return (s);
}


x86 assembly (clang, -O0):
<fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
lea    0xe95(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i8* @fp(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i64 @malloc(i32 100)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %7
%14 = load i8*, i8** %5
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = load i8*, i8** %7
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = load i8*, i8** %7
%19 = load i8*, i8** %6
%20 = call i32 @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @fp(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @malloc(i32 100)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
%7 = tail call i32 @strcat(i8* %5, i8* %1)
%8 = tail call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @strcat(i8* %5, i8* %2)
ret i8* %5
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= "
         "CHANGE_DATE= BUILD_DATE=Вт. июля  7 13:29:40 MSK 2015 BUILD=debug "
         "TARGET_PLATFORM= MALI_PLATFORM= KDIR= "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= "
         "USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [351 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=\D0\92\D1\82. \D0\B8\D1\8E\D0\BB\D1\8F 7 13:29:40 MSK 2015 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [351 x i8] c"malidrv: API_VERSION=401 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=\D0\92\D1\82. \D0\B8\D1\8E\D0\BB\D1\8F 7 13:29:40 MSK 2015 BUILD=debug TARGET_PLATFORM= MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0)
}