xunge/DecIR huggingface dataset:
/* Type definitions */
struct strbuf {
  int dummy;
};
struct child_process {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strbuf_addf(struct strbuf *, char *);
int no_job(struct child_process *cp, struct strbuf *err, void *cb,
           void **task_cb) {
  strbuf_addf(err, "no further jobs available\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.child_process = type { i32 }
%struct.strbuf = type { i32 }
@.str = [27 x i8] c"no further jobs available\0A\00"
define i32 @no_job(%struct.child_process* %0, %struct.strbuf* %1, i8* %2, i8** %3) {
%5 = alloca %struct.child_process*
%6 = alloca %struct.strbuf*
%7 = alloca i8*
%8 = alloca i8**
store %struct.child_process* %0, %struct.child_process** %5
store %struct.strbuf* %1, %struct.strbuf** %6
store i8* %2, i8** %7
store i8** %3, i8*** %8
%9 = load %struct.strbuf*, %struct.strbuf** %6
%10 = call i32 @strbuf_addf(%struct.strbuf* %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.child_process = type { i32 }
%struct.strbuf = type { i32 }
@.str = [27 x i8] c"no further jobs available\0A\00"
define i32 @no_job(%struct.child_process* nocapture readnone %0, %struct.strbuf* %1, i8* nocapture readnone %2, i8** nocapture readnone %3) {
%5 = tail call i32 @strbuf_addf(%struct.strbuf* %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strchr(char const *, char const);
char *strpbrk(const char *str, const char *set) {
  while (*str != '\0')
    if (strchr(set, *str) == 0)
      ++str;
    else
      return (char *)str;
  return 0;
}


x86 assembly (clang, -O0):
<strpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116d <strpbrk+0x5d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    115b <strpbrk+0x4b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1168 <strpbrk+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <strpbrk+0x65>
jmp    1120 <strpbrk+0x10>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpbrk>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     113c <strpbrk+0x2c>
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
jne    113e <strpbrk+0x2e>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strpbrk+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strpbrk(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = tail call i64 @strchr(i8* %1, i8 signext %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
void blank() {}


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

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

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

LLVM IR (-O2):
define void @blank() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_floats_test();
int /*<<< orphan*/ add_ints_test();
int main() {
  add_ints_test();
  add_floats_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @add_ints_test()
%2 = tail call i32 (...) @add_floats_test()
ret i32 0
}
INSTR(MACW) { LOG_FATAL("MACW not implemented"); }


x86 assembly (clang, -O0):
<INSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <LOG_FATAL@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<INSTR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <LOG_FATAL@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"MACW not implemented\00"
define i32 @INSTR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @LOG_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [21 x i8] c"MACW not implemented\00"
define i32 @INSTR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @LOG_FATAL to i32 (i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
long stub1();
long testClosureVrL(long (*closure)(void)) {
  return closure != NULL ? (*closure)() : (long)0;
}


x86 assembly (clang, -O0):
<testClosureVrL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1123 <testClosureVrL+0x23>
call   *-0x8(%rbp)
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrL+0x2e>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    112e <testClosureVrL+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrL>:
test   %rdi,%rdi
je     1107 <testClosureVrL+0x7>
jmp    *%rdi
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @testClosureVrL(i64 ()* %0) {
%2 = alloca i64 ()*
store i64 ()* %0, i64 ()** %2
%3 = load i64 ()*, i64 ()** %2
%4 = icmp ne i64 ()* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64 ()*, i64 ()** %2
%7 = call i64 %6()
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i64 [ %7, %5 ], [ 0, %8 ]
ret i64 %10
}

LLVM IR (-O2):
define i64 @testClosureVrL(i64 ()* %0) {
%2 = icmp eq i64 ()* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 %0()
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void put_str(const char *x) { fputs(x, stdout); }


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

x86 assembly (clang, -O2):
<put_str>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @put_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @put_str(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
long LeftChild(long a) { return (2 * a + 1); }


x86 assembly (clang, -O0):
<LeftChild>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeftChild>:
lea    (%rdi,%rdi,1),%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i64 @LeftChild(i64 %0) {
%2 = shl nsw i64 %0, 1
%3 = or i64 %2, 1
ret i64 %3
}
void why_me() {
  printf("This function is %s\n", __func__);
  printf("This line is %d\n", 29);
}


x86 assembly (clang, -O0):
<why_me>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x1d,%esi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<why_me>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    $0x1d,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"This function is %s\0A\00"
@__func__.why_me = [7 x i8] c"why_me\00"
@.str.1 = [17 x i8] c"This line is %d\0A\00"
define void @why_me() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.why_me, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 29)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"This function is %s\0A\00"
@__func__.why_me = [7 x i8] c"why_me\00"
@.str.1 = [17 x i8] c"This line is %d\0A\00"
define void @why_me() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.why_me, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 29)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: look [-df] [-t char] string [file ...]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"usage: look [-df] [-t char] string [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"usage: look [-df] [-t char] string [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
bool nrf51_errata_64(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_64() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showversion(void) {
  printf("genext2fs "
         "1.4.1"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"genext2fs 1.4.1\00"
define void @showversion() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
int __UpdateMode(char *servip, char *filename, void *hook) { return 0; }


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

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

LLVM IR (-O0):
define i32 @__UpdateMode(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
ret i32 0
}

LLVM IR (-O2):
define i32 @__UpdateMode(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
int mod2m(int x, int m) {
  int ret = x;
  if (x >= m)
    ret = ret - m;
  return ret;
}


x86 assembly (clang, -O0):
<mod2m>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1125 <mod2m+0x25>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod2m>:
mov    %edi,%eax
xor    %ecx,%ecx
cmp    %esi,%edi
cmovge %esi,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mod2m(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* %3
%8 = load i32, i32* %4
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %5
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @mod2m(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 0, i32 %1
%5 = sub nsw i32 %0, %4
ret i32 %5
}
void gspscan_(scan_no, feed_no, record, return_code) int *scan_no;
int *feed_no;
float *record;
int *return_code;
{}


x86 assembly (clang, -O0):
<gspscan_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gspscan_(i32* nocapture %0, i32* nocapture %1, float* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mergesort_r(int /*<<< orphan*/, int, int *, int *);
void mergesort(int *lista, int longitud, int *iter) {
  mergesort_r(0, longitud, lista, iter);
}


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

x86 assembly (clang, -O2):
<mergesort>:
mov    %rdx,%rcx
mov    %rdi,%rdx
xor    %edi,%edi
jmp    1030 <mergesort_r@plt>

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

LLVM IR (-O2):
define void @mergesort(i32* %0, i32 %1, i32* %2) {
%4 = tail call i32 @mergesort_r(i32 0, i32 %1, i32* %0, i32* %2)
ret void
}
/* Variables and functions */
scalar_t__ atoi(scalar_t__);
scalar_t__ getenv(char *);
int get_screen_columns(void) {
  if (getenv("COLUMNS"))
    return ((unsigned int)atoi(getenv("COLUMNS")));
  return 80;
}


x86 assembly (clang, -O0):
<get_screen_columns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     115a <get_screen_columns+0x3a>
lea    0xebb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <get_screen_columns+0x41>
movl   $0x50,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_screen_columns>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     113c <get_screen_columns+0x1c>
mov    %rax,%rdi
call   1040 <atoi@plt>
pop    %rcx
ret
mov    $0x50,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"COLUMNS\00"
define i32 @get_screen_columns() {
%1 = alloca i32
%2 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = call i64 @atoi(i64 %5)
%7 = trunc i64 %6 to i32
store i32 %7, i32* %1
br label %9
8: ; preds = %0
store i32 80, i32* %1
br label %9
9: ; preds = %8, %4
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"COLUMNS\00"
define i32 @get_screen_columns() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 @atoi(i64 %1)
%5 = trunc i64 %4 to i32
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ 80, %0 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ *__m128d;
typedef int /*<<< orphan*/ *__m128;

/* Variables and functions */
__m128 __attribute__((__always___, __nodebug__))
_mm_cvtsd_ss(__m128 a, __m128d b) {
  a[0] = b[0];
  return a;
}


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

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

LLVM IR (-O0):
define i32* @_mm_cvtsd_ss(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @_mm_cvtsd_ss(i32* returned writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
ret i32* %0
}
/* Type definitions */
struct StringPart {
  int dummy;
};

/* Variables and functions */
int lastChar(struct StringPart *);
int isSyllable(struct StringPart *part) {
  switch (lastChar(part)) {
  case '0':
    return 1;
  case '1':
    return 1;
  case '2':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isSyllable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lastChar@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x30,%eax
je     115a <isSyllable+0x4a>
jmp    1138 <isSyllable+0x28>
mov    -0x14(%rbp),%eax
sub    $0x31,%eax
je     1166 <isSyllable+0x56>
jmp    1149 <isSyllable+0x39>
mov    -0x14(%rbp),%eax
sub    $0x32,%eax
je     1172 <isSyllable+0x62>
jmp    117e <isSyllable+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <isSyllable+0x75>
movl   $0x1,-0x4(%rbp)
jmp    1185 <isSyllable+0x75>
movl   $0x1,-0x4(%rbp)
jmp    1185 <isSyllable+0x75>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSyllable>:
push   %rax
call   1030 <lastChar@plt>
add    $0xffffffd0,%eax
xor    %ecx,%ecx
cmp    $0x3,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.StringPart = type { i32 }
define i32 @isSyllable(%struct.StringPart* %0) {
%2 = alloca i32
%3 = alloca %struct.StringPart*
store %struct.StringPart* %0, %struct.StringPart** %3
%4 = load %struct.StringPart*, %struct.StringPart** %3
%5 = call i32 @lastChar(%struct.StringPart* %4)
switch i32 %5, label %9 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
]
6: ; preds = %1
store i32 1, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.StringPart = type { i32 }
define i32 @isSyllable(%struct.StringPart* %0) {
%2 = tail call i32 @lastChar(%struct.StringPart* %0)
%3 = add i32 %2, -48
%4 = icmp ult i32 %3, 3
%5 = zext i1 %4 to i32
ret i32 %5
}
__attribute__((always_)) void patch_CAS_1_7_2741_extra(void) {}


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

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

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

LLVM IR (-O2):
define void @patch_CAS_1_7_2741_extra() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteConsole(char *);
void InputMain() {
  while (1) {
    WriteConsole("B");
  }
}


x86 assembly (clang, -O0):
<InputMain>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <InputMain+0x9>
lea    0xee0(%rip),%rdi
call   1030 <WriteConsole@plt>
jmp    1119 <InputMain+0x9>

x86 assembly (clang, -O2):
<InputMain>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <WriteConsole@plt>
jmp    1120 <InputMain+0x10>

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
define void @InputMain() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @WriteConsole(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %1
}

LLVM IR (-O2):
@.str = [2 x i8] c"B\00"
define void @InputMain() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @WriteConsole(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgpublic(char *s) { ngen("public\t%s", s, 0); }


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

x86 assembly (clang, -O2):
<cgpublic>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"public\09%s\00"
define void @cgpublic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"public\09%s\00"
define void @cgpublic(i8* %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ f3();
int main() {
  f1();
  f2();
  f3();
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @f1()
%2 = call i32 (...) @f2()
%3 = call i32 (...) @f3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 (...) @f3()
ret i32 0
}
/* Variables and functions */
bool is_pow2(unsigned v) { return v && !(v & (v - 1)); }


x86 assembly (clang, -O0):
<is_pow2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <is_pow2+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pow2>:
test   %edi,%edi
je     110f <is_pow2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_pow2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
double doubles_extreme(double *, int, int /*<<< orphan*/);
double doubles_max(double *doubles, int size) {
  return (doubles_extreme(doubles, size, 0));
}


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

x86 assembly (clang, -O2):
<doubles_max>:
xor    %edx,%edx
jmp    1030 <doubles_extreme@plt>

LLVM IR (-O0):
define double @doubles_max(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call double @doubles_extreme(double* %5, i32 %6, i32 0)
ret double %7
}

LLVM IR (-O2):
define double @doubles_max(double* %0, i32 %1) {
%3 = tail call double @doubles_extreme(double* %0, i32 %1, i32 0)
ret double %3
}
void insw(int port, void *buf, unsigned long count) {
  asm volatile("cld;rep;ins"
               "w"
               : "+c"(count), "+D"(buf)
               : "d"(port));
}


x86 assembly (clang, -O0):
<insw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
cld
rep insw (%dx),%es:(%rdi)
mov    %rcx,-0x18(%rbp)
mov    %rdi,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insw>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
cld
rep insw (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insw(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i8*, i8** %5
%9 = load i32, i32* %4
%10 = call { i64, i8* } asm sideeffect "cld;rep;insw", "={cx},={di},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %9, i64 %7, i8* %8)
%11 = extractvalue { i64, i8* } %10, 0
%12 = extractvalue { i64, i8* } %10, 1
store i64 %11, i64* %6
store i8* %12, i8** %5
ret void
}

LLVM IR (-O2):
define void @insw(i32 %0, i8* %1, i64 %2) {
%4 = tail call { i64, i8* } asm sideeffect "cld;rep;insw", "={cx},={di},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i32 %0, i64 %2, i8* %1)
ret void
}
void abcde7fghijklmn9opqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcde7fghijklmn9opqrstuvwxzy() {
ret void
}
void loop_delay(unsigned char count, unsigned char check) {
  do {
    unsigned char loop = check;
    do {
      loop--;
    } while (loop > 0);
    count--;
  } while (count > 0);
}


x86 assembly (clang, -O0):
<loop_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
add    $0xff,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jg     1116 <loop_delay+0x16>
mov    -0x1(%rbp),%al
add    $0xff,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jg     1110 <loop_delay+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @loop_delay(i8 zeroext %0, i8 zeroext %1) {
ret void
}
/* Variables and functions */
int syscall(int, int *, int);
int uv__pipe2(int pipefd[2], int flags) { return syscall(293, pipefd, flags); }


x86 assembly (clang, -O0):
<uv__pipe2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x125,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uv__pipe2>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x125,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @uv__pipe2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @syscall(i32 293, i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @uv__pipe2(i32* %0, i32 %1) {
%3 = tail call i32 @syscall(i32 293, i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ blank();
int Mblank(int nargs, int *args) { blank(); }


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

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

LLVM IR (-O0):
define i32 @Mblank(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = call i32 (...) @blank()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @Mblank(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @blank()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int aw_bdb_put(void *v_mydb, void *v_txn, char *keystr, int keylen,
               char *datastr, int datalen) {
  fatal("BerkeleyDB support not compiled");
  return 0;
}


x86 assembly (clang, -O0):
<aw_bdb_put>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <fatal@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aw_bdb_put>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <fatal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define i32 @aw_bdb_put(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define i32 @aw_bdb_put(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i32 %5) {
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main() {
  int i;
  int *p;
  for (i = 0; i < 1000; i++) {
    p = (int *)malloc(10 * 8);
    free(p);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    1168 <main+0x48>
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 @malloc(i32 80)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @free(i32* %4)
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_PutChar(char const);
void LCD_PutString(const char *const str) {
  const char *p = str;
  while (*p != '\0') {
    LCD_PutChar(*p);
    p += 1;
  }
}


x86 assembly (clang, -O0):
<LCD_PutString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <LCD_PutString+0x41>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <LCD_PutChar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <LCD_PutString+0x14>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @LCD_PutString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @LCD_PutChar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x82() {
  Assert_real((isupper(130) == 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_isupper.c",
              655, ("isupper should be 0 for 0x82"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x82>:
push   %rax
mov    $0x82,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x82\00"
define void @t_isupper_0x82() {
%1 = call i64 @isupper(i32 130)
%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 655, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x82\00"
define void @t_isupper_0x82() {
%1 = tail call i64 @isupper(i32 130)
%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 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printWord(char *word) { printf("%s\n", word); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printWord(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int strncmp(char const *, char const *, int /*<<< orphan*/);
int keywdcmp(const char *buf, const char *key) {
  return strncmp(buf, key, strlen(key));
}


x86 assembly (clang, -O0):
<keywdcmp>:
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   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @keywdcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getField(char *, int);
int isGameOver(char *line) {
  if (!getField(line, 3))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isGameOver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1030 <getField@plt>
cmp    $0x0,%eax
jne    113f <isGameOver+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <isGameOver+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isGameOver>:
push   %rax
mov    $0x3,%esi
call   1030 <getField@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isGameOver(i8* %0) {
%2 = tail call i32 @getField(i8* %0, i32 3)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
bool pos_eq_lim(const char *pos, const char *lim) { return pos == lim; }


x86 assembly (clang, -O0):
<pos_eq_lim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos_eq_lim>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @pos_eq_lim(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pos_eq_lim(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc_or_die(int);
int *int_malloc_or_die(int num_ints) {
  return (int *)malloc_or_die(num_ints * sizeof(int));
}


x86 assembly (clang, -O0):
<int_malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc_or_die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_malloc_or_die>:
shl    $0x2,%edi
jmp    1030 <malloc_or_die@plt>

LLVM IR (-O0):
define i32* @int_malloc_or_die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc_or_die(i32 %6)
%8 = inttoptr i64 %7 to i32*
ret i32* %8
}

LLVM IR (-O2):
define i32* @int_malloc_or_die(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc_or_die(i32 %2)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ draw_filled_rectangle(int, int, int, int, int);
void draw_small_block(int y, int x, int color) {
  draw_filled_rectangle(y * 4, x * 4, 4, 4, color);
}


x86 assembly (clang, -O0):
<draw_small_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
mov    -0x8(%rbp),%esi
shl    $0x2,%esi
mov    -0xc(%rbp),%r8d
mov    $0x4,%ecx
mov    %ecx,%edx
call   1030 <draw_filled_rectangle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_small_block>:
mov    %edx,%r8d
shl    $0x2,%edi
shl    $0x2,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
jmp    1030 <draw_filled_rectangle@plt>

LLVM IR (-O0):
define void @draw_small_block(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 4
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 4
%11 = load i32, i32* %6
%12 = call i32 @draw_filled_rectangle(i32 %8, i32 %10, i32 4, i32 4, i32 %11)
ret void
}

LLVM IR (-O2):
define void @draw_small_block(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %0, 2
%5 = shl nsw i32 %1, 2
%6 = tail call i32 @draw_filled_rectangle(i32 %4, i32 %5, i32 4, i32 4, i32 %2)
ret void
}
void local_event_delivery_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @local_event_delivery_disable() {
ret void
}
int strlength(char *t) {
  int taille = 0;
  do {
    taille++;
  } while (t[taille] != '\0');
  return taille + 1;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}