xunge/DecIR huggingface dataset:
unsigned short extract2byteuint(unsigned char *buffer, unsigned short *index) {
  unsigned short data;
  data = (unsigned short)buffer[*index] << 0;
  *index += 1;
  data |= (unsigned short)buffer[*index] << 8;
  *index += 1;
  return (data);
}


x86 assembly (clang, -O0):
<extract2byteuint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
movzbl (%rax,%rcx,1),%eax
movzwl %ax,%eax
shl    $0x0,%eax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
movzwl (%rax),%ecx
add    $0x1,%ecx
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
movzbl (%rax,%rcx,1),%eax
movzwl %ax,%ecx
shl    $0x8,%ecx
movzwl -0x12(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
movzwl (%rax),%ecx
add    $0x1,%ecx
mov    %cx,(%rax)
movzwl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract2byteuint>:
movzwl (%rsi),%ecx
movzbl (%rdi,%rcx,1),%edx
lea    0x1(%rcx),%eax
mov    %ax,(%rsi)
movzwl %ax,%eax
movzbl (%rdi,%rax,1),%eax
shl    $0x8,%eax
or     %edx,%eax
add    $0x2,%ecx
mov    %cx,(%rsi)
ret

LLVM IR (-O0):
define zeroext i16 @extract2byteuint(i8* %0, i16* %1) {
%3 = alloca i8*
%4 = alloca i16*
%5 = alloca i16
store i8* %0, i8** %3
store i16* %1, i16** %4
%6 = load i8*, i8** %3
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 0
%15 = trunc i32 %14 to i16
store i16 %15, i16* %5
%16 = load i16*, i16** %4
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = add nsw i32 %18, 1
%20 = trunc i32 %19 to i16
store i16 %20, i16* %16
%21 = load i8*, i8** %3
%22 = load i16*, i16** %4
%23 = load i16, i16* %22
%24 = zext i16 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i8, i8* %25
%27 = zext i8 %26 to i16
%28 = zext i16 %27 to i32
%29 = shl i32 %28, 8
%30 = load i16, i16* %5
%31 = zext i16 %30 to i32
%32 = or i32 %31, %29
%33 = trunc i32 %32 to i16
store i16 %33, i16* %5
%34 = load i16*, i16** %4
%35 = load i16, i16* %34
%36 = zext i16 %35 to i32
%37 = add nsw i32 %36, 1
%38 = trunc i32 %37 to i16
store i16 %38, i16* %34
%39 = load i16, i16* %5
ret i16 %39
}

LLVM IR (-O2):
define zeroext i16 @extract2byteuint(i8* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %1
%4 = zext i16 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = add i16 %3, 1
store i16 %8, i16* %1
%9 = zext i16 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = shl nuw i16 %12, 8
%14 = or i16 %13, %7
%15 = add i16 %3, 2
store i16 %15, i16* %1
ret i16 %14
}
void autonomous3() {}


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

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

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

LLVM IR (-O2):
define void @autonomous3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void xmlClose(void) { printf("</lamps>\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"</lamps>\0A\00"
define void @xmlClose() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"</lamps>\00"
define void @xmlClose() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long ENOSYS;
long compat_ni_syscall(void) { return -ENOSYS; }


x86 assembly (clang, -O0):
<compat_ni_syscall>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compat_ni_syscall>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%rax
ret

LLVM IR (-O0):
@ENOSYS = global i64 0
define i64 @compat_ni_syscall() {
%1 = load i64, i64* @ENOSYS
%2 = sub nsw i64 0, %1
ret i64 %2
}

LLVM IR (-O2):
@ENOSYS = global i64 0
define i64 @compat_ni_syscall() {
%1 = load i64, i64* @ENOSYS
%2 = sub nsw i64 0, %1
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ write_big_endian_word(int /*<<< orphan*/);
void write_string_as_big_endian_unicode(char *s) {
  while (*s != 0) {
    write_big_endian_word(*s++);
  }
}


x86 assembly (clang, -O0):
<write_string_as_big_endian_unicode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1148 <write_string_as_big_endian_unicode+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <write_big_endian_word@plt>
jmp    111c <write_string_as_big_endian_unicode+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_string_as_big_endian_unicode>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <write_string_as_big_endian_unicode+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <write_big_endian_word@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <write_string_as_big_endian_unicode+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write_string_as_big_endian_unicode(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @write_big_endian_word(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
func1() { printf("in func1\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"in func1\00"
define i32 @func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int char2int(char c) {
  int i;
  switch (c) {
  case '0':
    i = 0;
    break;
  case '1':
    i = 1;
    break;
  case '2':
    i = 2;
    break;
  case '3':
    i = 3;
    break;
  case '4':
    i = 4;
    break;
  case '5':
    i = 5;
    break;
  case '6':
    i = 6;
    break;
  case '7':
    i = 7;
    break;
  case '8':
    i = 8;
    break;
  case '9':
    i = 9;
    break;
  default:
    i = -1;
    break;
  }
  return i;
}


x86 assembly (clang, -O0):
<char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <char2int+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x1,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x2,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x3,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x4,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x5,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x6,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x7,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x8,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0x9,-0x8(%rbp)
jmp    11b3 <char2int+0xb3>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2int>:
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @char2int(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %3
br label %17
7: ; preds = %1
store i32 1, i32* %3
br label %17
8: ; preds = %1
store i32 2, i32* %3
br label %17
9: ; preds = %1
store i32 3, i32* %3
br label %17
10: ; preds = %1
store i32 4, i32* %3
br label %17
11: ; preds = %1
store i32 5, i32* %3
br label %17
12: ; preds = %1
store i32 6, i32* %3
br label %17
13: ; preds = %1
store i32 7, i32* %3
br label %17
14: ; preds = %1
store i32 8, i32* %3
br label %17
15: ; preds = %1
store i32 9, i32* %3
br label %17
16: ; preds = %1
store i32 -1, i32* %3
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @char2int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, char *);
char *tmpnam(char *);
main() {
  char buffer[128];
  int counter;
  for (counter = 0; counter < 3; counter++)
    printf(" \nTemporary file is %s", tmpnam(buffer));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x3,-0x94(%rbp)
jge    1188 <main+0x58>
lea    -0x90(%rbp),%rdi
call   1050 <tmpnam@plt>
mov    %rax,%rsi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114c <main+0x1c>
mov    $0x0,%al
call   1040 <getch@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <tmpnam@plt>
lea    0xeb4(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1050 <tmpnam@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
call   1050 <tmpnam@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getch@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c" \0ATemporary file is %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i8* @tmpnam(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = call i32 (...) @getch()
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [23 x i8] c" \0ATemporary file is %s\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i8* @tmpnam(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @tmpnam(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i8* @tmpnam(i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (...) @getch()
ret i32 0
}
void delay(void) {}


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

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

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

LLVM IR (-O2):
define void @delay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void separator_memory_exit(char *var) {
  fprintf(stderr,
          "#### HPC-MW-VIS-E0001:There is no enough memory allocated for "
          "variable %s\n",
          var);
  exit(0);
}


x86 assembly (clang, -O0):
<separator_memory_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<separator_memory_exit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"#### HPC-MW-VIS-E0001:There is no enough memory allocated for variable %s\0A\00"
define void @separator_memory_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"#### HPC-MW-VIS-E0001:There is no enough memory allocated for variable %s\0A\00"
define void @separator_memory_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
unsigned long hash(char *s) {
  unsigned long hashval;
  for (hashval = 0; *s != '\0';)
    hashval = (*s++) + (hashval << 6) + (hashval << 16) - hashval;
  return (hashval % 997);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <hash+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbq (%rax),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
mov    $0x3e5,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     114b <hash+0x4b>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbq %al,%rax
imul   $0x1003f,%rcx,%rcx
add    %rax,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movabs $0x41bbb2f80a4553f7,%rdx
b2 bb 41
mov    %rcx,%rax
mul    %rdx
shr    $0x8,%rdx
imul   $0x3e5,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %6, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 997
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 0, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Variables and functions */
int /*<<< orphan*/ lex(char *, char *, char *);
int main(int argc, char *argv[]) {
  lex("target.txt", "key.txt", "mapped.txt");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    0xed7(%rip),%rsi
lea    0xed8(%rip),%rdx
call   1030 <lex@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xeed(%rip),%rdx
call   1030 <lex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"target.txt\00"
@.str.1 = [8 x i8] c"key.txt\00"
@.str.2 = [11 x i8] c"mapped.txt\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @lex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"target.txt\00"
@.str.1 = [8 x i8] c"key.txt\00"
@.str.2 = [11 x i8] c"mapped.txt\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @lex(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
void thread_detach(void *thread) { pthread_detach((pthread_t)(thread)); }


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

x86 assembly (clang, -O2):
<thread_detach>:
jmp    1030 <pthread_detach@plt>

LLVM IR (-O0):
define void @thread_detach(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i32
%5 = call i32 @pthread_detach(i32 %4)
ret void
}

LLVM IR (-O2):
define void @thread_detach(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @pthread_detach(i32 %3)
ret void
}
/* Variables and functions */
int drand48();
int rrand(int l, int u) { return (l + (int)((1 + u - l) * drand48())); }


x86 assembly (clang, -O0):
<rrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrand>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sub    %edi,%esi
lea    0x1(%rsi),%ebp
xor    %eax,%eax
call   1030 <drand48@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rrand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 1, %6
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = call i32 (...) @drand48()
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rrand(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i32 (...) @drand48()
%6 = mul nsw i32 %5, %4
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  char p[16];
  p[16] = 0;
  printf(p);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 16
store i8 0, i8* %7
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 16
store i8 0, i8* %5
%6 = call i32 @printf(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int);
void merge_sort(int *a, int start, int n) {
  if (n > 1) {
    int half = n / 2;
    merge_sort(a, start, half);
    merge_sort(a, start + half, n - half);
    merge(a, start, n);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jle    117d <merge_sort+0x5d>
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    -0x14(%rbp),%edx
call   1040 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    $0x1,%edx
jle    1167 <merge_sort+0x47>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%r15
mov    %edx,%ebx
shr    %ebx
mov    %ebx,%edx
call   1040 <merge_sort@plt>
mov    %ebp,%edx
sub    %ebx,%edx
add    %r14d,%ebx
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <merge_sort@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <merge@plt>
ret

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

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 1
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = lshr i32 %2, 1
tail call void @merge_sort(i32* %0, i32 %1, i32 %7)
%8 = add nsw i32 %7, %1
%9 = sub nsw i32 %2, %7
tail call void @merge_sort(i32* %0, i32 %8, i32 %9)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ prologue(char *);
void menu_basedefs(void) { prologue("menu"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"menu\00"
define void @menu_basedefs() {
%1 = call i32 @prologue(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"menu\00"
define void @menu_basedefs() {
%1 = tail call i32 @prologue(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ vdp_dma_vram(int /*<<< orphan*/, scalar_t__, int);
int /*<<< orphan*/ vdp_set_autoinc(int);
void vdp_hscroll_tile(uint16_t plan, int16_t *hscroll) {
  vdp_set_autoinc(32);
  vdp_dma_vram((uint32_t)hscroll,
               ((uint16_t)0xFC00) + (plan == ((uint16_t)0xC000) ? 0 : 2), 32);
  vdp_set_autoinc(2);
}


x86 assembly (clang, -O0):
<vdp_hscroll_tile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x20,%edi
call   1040 <vdp_set_autoinc@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0xc000,%rdx
cmove  %ecx,%eax
movslq %eax,%rsi
add    $0xfc00,%rsi
mov    $0x20,%edx
call   1030 <vdp_dma_vram@plt>
mov    $0x2,%edi
call   1040 <vdp_set_autoinc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdp_hscroll_tile>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x20,%edi
call   1040 <vdp_set_autoinc@plt>
xor    %eax,%eax
cmp    $0xc000,%rbx
setne  %al
lea    (%rax,%rax,1),%rsi
add    $0xfc00,%rsi
mov    %r14d,%edi
mov    $0x20,%edx
call   1030 <vdp_dma_vram@plt>
mov    $0x2,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <vdp_set_autoinc@plt>

LLVM IR (-O0):
define void @vdp_hscroll_tile(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%5 = call i32 @vdp_set_autoinc(i32 32)
%6 = load i32*, i32** %4
%7 = ptrtoint i32* %6 to i32
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 49152
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 2
%12 = sext i32 %11 to i64
%13 = add nsw i64 64512, %12
%14 = call i32 @vdp_dma_vram(i32 %7, i64 %13, i32 32)
%15 = call i32 @vdp_set_autoinc(i32 2)
ret void
}

LLVM IR (-O2):
define void @vdp_hscroll_tile(i64 %0, i32* %1) {
%3 = tail call i32 @vdp_set_autoinc(i32 32)
%4 = ptrtoint i32* %1 to i64
%5 = trunc i64 %4 to i32
%6 = icmp eq i64 %0, 49152
%7 = select i1 %6, i64 64512, i64 64514
%8 = tail call i32 @vdp_dma_vram(i32 %5, i64 %7, i32 32)
%9 = tail call i32 @vdp_set_autoinc(i32 2)
ret void
}
void nao_troca(int a, int b) {
  int temp;
  temp = a;
  a = b;
  b = temp;
}


x86 assembly (clang, -O0):
<nao_troca>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nao_troca(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %4
store i32 %7, i32* %3
%8 = load i32, i32* %5
store i32 %8, i32* %4
ret void
}

LLVM IR (-O2):
define void @nao_troca(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int Cyc_Tcutil_typecmp(void *, void *);
int Cyc_Tcutil_type_equals(void *t1, void *t2) {
  int _T0;
  int _T1;
  _T0 = Cyc_Tcutil_typecmp(t1, t2);
  _T1 = _T0 == 0;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_Tcutil_type_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Tcutil_typecmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Tcutil_type_equals>:
push   %rax
call   1030 <Cyc_Tcutil_typecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Cyc_Tcutil_type_equals(i8* %0, i8* %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** %3
%8 = load i8*, i8** %4
%9 = call i32 @Cyc_Tcutil_typecmp(i8* %7, i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
define i32 @Cyc_Tcutil_type_equals(i8* %0, i8* %1) {
%3 = tail call i32 @Cyc_Tcutil_typecmp(i8* %0, i8* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void __unlock_modules(void *state) { assert(state); }


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

x86 assembly (clang, -O2):
<__unlock_modules>:
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define void @__unlock_modules(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cprint(char const, char, int);
void putch(const char x, char attr) { cprint(x, attr, 1); }


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x1,%edx
movsbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1030 <cprint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    $0x1,%edx
jmp    1030 <cprint@plt>

LLVM IR (-O0):
define void @putch(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @cprint(i8 signext %5, i8 signext %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @putch(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @cprint(i8 signext %0, i8 signext %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void func(void) {
  int sz;
  scanf("%d", &sz);
  char buf[sz];
  gets(buf);
  printf(buf);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1040 <gets@plt>
mov    -0x20(%rbp),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rsp
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @func() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
%9 = call i32 @gets(i8* %8)
%10 = call i32 @printf(i8* %8)
%11 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @func() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
%7 = alloca i8, i64 %5
%8 = call i32 @gets(i8* %7)
%9 = call i32 @printf(i8* %7)
ret void
}
BOOST_AUTO_TEST_CASE(log10) {
  TESTCASE1(log10, 1, 0);
  TESTCASE1(log10, 10, 1);
  TESTCASE1(log10, 100, 2);
  TESTCASE1(log10, 0.1, -1);
  TESTCASE1(log10, 0.01, -2);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
mov    $0xa,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
mov    $0x64,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
movsd  0xea9(%rip),%xmm0
mov    $0xffffffff,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    -0x8(%rbp),%edi
movsd  0xe8a(%rip),%xmm0
mov    $0xfffffffe,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1030 <TESTCASE1@plt>
mov    %ebx,%edi
mov    $0xa,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <TESTCASE1@plt>
mov    %ebx,%edi
mov    $0x64,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1030 <TESTCASE1@plt>
movsd  0xeb1(%rip),%xmm0
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0x1,%al
call   1030 <TESTCASE1@plt>
movsd  0xea3(%rip),%xmm0
mov    %ebx,%edi
mov    $0xfffffffe,%esi
mov    $0x1,%al
pop    %rbx
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 1, i32 0)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %6, i32 10, i32 1)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %8, i32 100, i32 2)
%10 = load i32, i32* %3
%11 = call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %10, double 1.000000e-01, i32 -1)
%12 = load i32, i32* %3
%13 = call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %12, double 1.000000e-02, i32 -2)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0)
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 10, i32 1)
%4 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 100, i32 2)
%5 = tail call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %0, double 1.000000e-01, i32 -1)
%6 = tail call i32 (i32, double, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, double, i32, ...)*)(i32 %0, double 1.000000e-02, i32 -2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int _critbit_has_tag(const uintptr_t v) {
  assert(v != 0);
  return (v & 1);
}


x86 assembly (clang, -O0):
<_critbit_has_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_critbit_has_tag>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
and    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_critbit_has_tag(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* %2
%8 = and i64 %7, 1
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_critbit_has_tag(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = trunc i64 %0 to i32
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xef() {
  Assert_real((isxdigit(239) == 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",
              1200, ("isxdigit should be 0 for 0xef"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xef>:
push   %rax
mov    $0xef,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4b0,%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 0xef\00"
define void @t_isxdigit_0xef() {
%1 = call i64 @isxdigit(i32 239)
%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 1200, 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 0xef\00"
define void @t_isxdigit_0xef() {
%1 = tail call i64 @isxdigit(i32 239)
%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 1200, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct strbuf {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ strbuf_addmem(struct strbuf *, char const *,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
ssize_t strbuf_addstr(struct strbuf *sb, const char *str) {
  return (strbuf_addmem(sb, str, strlen(str)));
}


x86 assembly (clang, -O0):
<strbuf_addstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <strbuf_addmem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbuf_addstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strbuf_addmem@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define i32 @strbuf_addstr(%struct.strbuf* %0, i8* %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i8*
store %struct.strbuf* %0, %struct.strbuf** %3
store i8* %1, i8** %4
%5 = load %struct.strbuf*, %struct.strbuf** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strbuf_addmem(%struct.strbuf* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define i32 @strbuf_addstr(%struct.strbuf* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strbuf_addmem(%struct.strbuf* %0, i8* %1, i32 %3)
ret i32 %4
}
int js_AlertOK(const char *title, const char *message) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @js_AlertOK(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void _set_enbb(unsigned char *u) { u[3] |= (1 << 2); }


x86 assembly (clang, -O0):
<_set_enbb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
or     $0x4,%ecx
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_set_enbb>:
orb    $0x4,0x3(%rdi)
ret

LLVM IR (-O0):
define void @_set_enbb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = or i32 %6, 4
%8 = trunc i32 %7 to i8
store i8 %8, i8* %4
ret void
}

LLVM IR (-O2):
define void @_set_enbb(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = or i8 %3, 4
store i8 %4, i8* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ demo_Map_MatrixXd();
int /*<<< orphan*/ demo_MatrixXd();
int main() {
  demo_MatrixXd();
  demo_Map_MatrixXd();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <demo_MatrixXd@plt>
mov    $0x0,%al
call   1040 <demo_Map_MatrixXd@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @demo_MatrixXd()
%2 = call i32 (...) @demo_Map_MatrixXd()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @demo_MatrixXd()
%2 = tail call i32 (...) @demo_Map_MatrixXd()
ret i32 0
}
/* Variables and functions */
int strlen(char *);
int verificaBairro(char *bairro) {
  int tamBairro = strlen(bairro);
  if (bairro == NULL || tamBairro == 0 || tamBairro >= 80)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verificaBairro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <verificaBairro+0x37>
cmpl   $0x0,-0x14(%rbp)
je     1147 <verificaBairro+0x37>
cmpl   $0x50,-0x14(%rbp)
jl     1153 <verificaBairro+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <verificaBairro+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaBairro>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rbx,%rbx
setne  %cl
test   %eax,%eax
setne  %dl
and    %cl,%dl
cmp    $0x50,%eax
setl   %al
and    %dl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @verificaBairro(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = icmp sge i32 %13, 80
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %1
store i32 0, i32* %2
br label %17
16: ; preds = %12
store i32 1, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @verificaBairro(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp ne i8* %0, null
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = icmp slt i32 %2, 80
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
struct eembed_log {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ eembed_fprintf_context(struct eembed_log *);
int /*<<< orphan*/ eembed_system_fprintf(int /*<<< orphan*/, char *,
                                         char const *);
void eembed_fprintf_append_s(struct eembed_log *log, const char *str) {
  eembed_system_fprintf(eembed_fprintf_context(log), "%s", str);
}


x86 assembly (clang, -O0):
<eembed_fprintf_append_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <eembed_fprintf_context@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
call   1030 <eembed_system_fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_fprintf_append_s>:
push   %rbx
mov    %rsi,%rbx
call   1040 <eembed_fprintf_context@plt>
lea    0xed0(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <eembed_system_fprintf@plt>

LLVM IR (-O0):
%struct.eembed_log = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @eembed_fprintf_append_s(%struct.eembed_log* %0, i8* %1) {
%3 = alloca %struct.eembed_log*
%4 = alloca i8*
store %struct.eembed_log* %0, %struct.eembed_log** %3
store i8* %1, i8** %4
%5 = load %struct.eembed_log*, %struct.eembed_log** %3
%6 = call i32 @eembed_fprintf_context(%struct.eembed_log* %5)
%7 = load i8*, i8** %4
%8 = call i32 @eembed_system_fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
%struct.eembed_log = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @eembed_fprintf_append_s(%struct.eembed_log* %0, i8* %1) {
%3 = tail call i32 @eembed_fprintf_context(%struct.eembed_log* %0)
%4 = tail call i32 @eembed_system_fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rdtscll(unsigned long long);
unsigned long long sched_clock_cycles(void) {
  unsigned long long cycles;
  rdtscll(cycles);
  return cycles;
}


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

x86 assembly (clang, -O2):
<sched_clock_cycles>:
jmp    1030 <rdtscll@plt>

LLVM IR (-O0):
define i64 @sched_clock_cycles() {
%1 = alloca i64
%2 = load i64, i64* %1
%3 = call i32 @rdtscll(i64 %2)
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @sched_clock_cycles() {
%1 = tail call i32 @rdtscll(i64 undef)
ret i64 undef
}