xunge/DecIR huggingface dataset:
void termop_scrollregion(struct ansiseq *s) {
  tnc_log_log(
      7, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c",
      474, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_scrollregion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x1da,%r8d
lea    0xf37(%rip),%r9
lea    0xf44(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_scrollregion>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf6b(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x7,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x1da,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_scrollregion = [20 x i8] c"termop_scrollregion\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_scrollregion(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 474, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.termop_scrollregion, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/xterm.c\00"
@__func__.termop_scrollregion = [20 x i8] c"termop_scrollregion\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_scrollregion(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 7, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 474, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__func__.termop_scrollregion, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
char *strrchr(char *, char);
char *stripquotes(char *s) {
  char *start, *end;
  start = strchr(s, '"');
  if (start)
    ++start;
  else
    start = s;
  end = strrchr(start, '"');
  if (end)
    *(end) = '\0';
  return start;
}


x86 assembly (clang, -O0):
<stripquotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x22,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115a <stripquotes+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1162 <stripquotes+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x22,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1186 <stripquotes+0x66>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripquotes>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x22,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rbx
test   %rax,%rax
cmove  %r14,%rbx
mov    %rbx,%rdi
mov    $0x22,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1151 <stripquotes+0x31>
movb   $0x0,(%rax)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @stripquotes(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 34)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %5, i8 signext 34)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
store i8 0, i8* %6
br label %9
9: ; preds = %8, %1
ret i8* %5
}
int rfxsensor_checksum(unsigned char *buf) {
  unsigned int chksum;
  chksum = buf[0] + (buf[0] >> 4) + buf[1] + (buf[1] >> 4) + buf[2] +
           (buf[2] >> 4) + buf[3] + (buf[3] >> 4);
  chksum = ~chksum & 0x0fu;
  return (int)0xffu;
}


x86 assembly (clang, -O0):
<rfxsensor_checksum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    $0xff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rfxsensor_checksum(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = ashr i32 %11, 4
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = add nsw i32 %13, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = ashr i32 %22, 4
%24 = add nsw i32 %18, %23
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 2
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = add nsw i32 %24, %28
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 2
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = ashr i32 %33, 4
%35 = add nsw i32 %29, %34
%36 = load i8*, i8** %2
%37 = getelementptr inbounds i8, i8* %36, i64 3
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = add nsw i32 %35, %39
%41 = load i8*, i8** %2
%42 = getelementptr inbounds i8, i8* %41, i64 3
%43 = load i8, i8* %42
%44 = zext i8 %43 to i32
%45 = ashr i32 %44, 4
%46 = add nsw i32 %40, %45
store i32 %46, i32* %3
%47 = load i32, i32* %3
%48 = xor i32 %47, -1
%49 = and i32 %48, 15
store i32 %49, i32* %3
ret i32 255
}

LLVM IR (-O2):
define i32 @rfxsensor_checksum(i8* nocapture readnone %0) {
ret i32 255
}
/* Variables and functions */
void *getchar();
int /*<<< orphan*/ printf(char *);
char getchar_and_flush() {
  char foo;
  int loop;
  printf("Please enter some text. Press enter to finish. To quit, type a \"%\" "
         "symbol. ");
  foo = getchar();
  loop = foo;
  while (loop != '\n') {
    loop = getchar();
  }
  return foo;
}


x86 assembly (clang, -O0):
<getchar_and_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     115e <getchar_and_flush+0x3e>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    1145 <getchar_and_flush+0x25>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar_and_flush>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rax,%rbx
cmp    $0xa,%bl
je     114c <getchar_and_flush+0x2c>
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1140 <getchar_and_flush+0x20>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Please enter some text. Press enter to finish. To quit, type a \22%\22 symbol. \00"
define signext i8 @getchar_and_flush() {
%1 = alloca i8
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%4 = call i8* (...) @getchar()
%5 = ptrtoint i8* %4 to i8
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
store i32 %7, i32* %2
br label %8
8: ; preds = %11, %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i8* (...) @getchar()
%13 = ptrtoint i8* %12 to i32
store i32 %13, i32* %2
br label %8
14: ; preds = %8
%15 = load i8, i8* %1
ret i8 %15
}

LLVM IR (-O2):
@.str = [76 x i8] c"Please enter some text. Press enter to finish. To quit, type a \22%\22 symbol. \00"
define signext i8 @getchar_and_flush() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @getchar()
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i8
%5 = icmp eq i8 %4, 10
br i1 %5, label %11, label %6
6: ; preds = %0, %6
%7 = tail call i8* (...) @getchar()
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i32
%10 = icmp eq i32 %9, 10
br i1 %10, label %11, label %6
11: ; preds = %6, %0
ret i8 %4
}
BOOST_AUTO_TEST_CASE(sech) { TESTCASE1(sech, 0, 1); }


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

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
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 0, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

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 0, i32 1)
ret i32 undef
}
error(s, f) char *s, *f;
{
  std_err("comm: ");
  std_err(s);
  if (f)
    std_err(f);
  std_err("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <std_err@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <std_err@plt>
cmpq   $0x0,-0x10(%rbp)
je     115f <error+0x3f>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <std_err@plt>
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1040 <std_err@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <std_err@plt>
test   %r14,%r14
je     1151 <error+0x31>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <std_err@plt>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"comm: \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %6)
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %11)
br label %13
13: ; preds = %10, %2
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"comm: \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @error(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %0)
%5 = icmp eq i8* %1, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* %1)
br label %8
8: ; preds = %6, %2
%9 = tail call i32 (i8*, ...) bitcast (i32 (...)* @std_err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
tail call void @exit(i32 1)
unreachable
}
void __raw_writel(unsigned int b, volatile void *addr) {
  *(volatile unsigned int *)addr = b;
}


x86 assembly (clang, -O0):
<__raw_writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__raw_writel>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @__raw_writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
int main(int argc, char *argv[]) {
  __attribute__((vector_size(16))) float a;
  if (sizeof(a) != 16)
    abort();
  if (__alignof__(a) != 16)
    abort();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca <4 x float>
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ apply_bios_map_if(int);
int /*<<< orphan*/ pmmap_mark_all_used();
void apply_bios_map() {
  pmmap_mark_all_used();
  apply_bios_map_if(true);
  apply_bios_map_if(false);
}


x86 assembly (clang, -O0):
<apply_bios_map>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <pmmap_mark_all_used@plt>
mov    $0x1,%edi
call   1030 <apply_bios_map_if@plt>
xor    %edi,%edi
call   1030 <apply_bios_map_if@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apply_bios_map>:
push   %rax
xor    %eax,%eax
call   1040 <pmmap_mark_all_used@plt>
mov    $0x1,%edi
call   1030 <apply_bios_map_if@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <apply_bios_map_if@plt>

LLVM IR (-O0):
define void @apply_bios_map() {
%1 = call i32 (...) @pmmap_mark_all_used()
%2 = call i32 @apply_bios_map_if(i32 1)
%3 = call i32 @apply_bios_map_if(i32 0)
ret void
}

LLVM IR (-O2):
define void @apply_bios_map() {
%1 = tail call i32 (...) @pmmap_mark_all_used()
%2 = tail call i32 @apply_bios_map_if(i32 1)
%3 = tail call i32 @apply_bios_map_if(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello");
  printf("world");
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
int main() {
  system("gnome-terminal 			"
         "--default-working-directory=/home/eds/kernel 			"
         "--geometry=+800+575 &");
  system("gedit &");
  system("nautilus 			--geometry=800x550+475+0 &");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [88 x i8] c"gnome-terminal \09\09\09--default-working-directory=/home/eds/kernel \09\09\09--geometry=+800+575 &\00"
@.str.1 = [8 x i8] c"gedit &\00"
@.str.2 = [39 x i8] c"nautilus \09\09\09--geometry=800x550+475+0 &\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @system(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [88 x i8] c"gnome-terminal \09\09\09--default-working-directory=/home/eds/kernel \09\09\09--geometry=+800+575 &\00"
@.str.1 = [8 x i8] c"gedit &\00"
@.str.2 = [39 x i8] c"nautilus \09\09\09--geometry=800x550+475+0 &\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close_range_cloexec_unshare_syzbot(struct __test_metadata *);
void wrapper_close_range_cloexec_unshare_syzbot(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  close_range_cloexec_unshare_syzbot(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_close_range_cloexec_unshare_syzbot>:
jmp    1030 <close_range_cloexec_unshare_syzbot@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range_cloexec_unshare_syzbot(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @close_range_cloexec_unshare_syzbot(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_close_range_cloexec_unshare_syzbot(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @close_range_cloexec_unshare_syzbot(%struct.__test_metadata* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void al_ansi_escape_reset() { fprintf(stdout, "\\[\\e[0m\\]"); }


x86 assembly (clang, -O0):
<al_ansi_escape_reset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<al_ansi_escape_reset>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"\\[\\e[0m\\]\00"
define void @al_ansi_escape_reset() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"\\[\\e[0m\\]\00"
define void @al_ansi_escape_reset() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hci_event_extended_inquiry_response_get_num_responses(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_extended_inquiry_response_get_num_responses>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_extended_inquiry_response_get_num_responses(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_extended_inquiry_response_get_num_responses(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
unsigned int readl(void *);
int /*<<< orphan*/ writel(unsigned int, void *);
void apq_set_gpio_bits(unsigned n, void *addr) {
  writel(readl(addr) | n, addr);
}


x86 assembly (clang, -O0):
<apq_set_gpio_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <readl@plt>
mov    %eax,%edi
or     -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<apq_set_gpio_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <readl@plt>
or     %eax,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @apq_set_gpio_bits(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @readl(i8* %5)
%7 = load i32, i32* %3
%8 = or i32 %6, %7
%9 = load i8*, i8** %4
%10 = call i32 @writel(i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @apq_set_gpio_bits(i32 %0, i8* %1) {
%3 = tail call i32 @readl(i8* %1)
%4 = or i32 %3, %0
%5 = tail call i32 @writel(i32 %4, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double kup() {
  double a;
  printf("Kupu alinacak bir deger veriniz.\n");
  scanf("%lf", &a);
  return a * a * a;
}


x86 assembly (clang, -O0):
<kup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kup>:
push   %rax
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Kupu alinacak bir deger veriniz.\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
define double @kup() {
%1 = alloca double
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = load double, double* %1
%6 = fmul double %4, %5
%7 = load double, double* %1
%8 = fmul double %6, %7
ret double %8
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@str = [33 x i8] c"Kupu alinacak bir deger veriniz.\00"
define double @kup() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = fmul double %5, %5
%7 = fmul double %5, %6
ret double %7
}
/* Variables and functions */
void strcpy(char *dst, const char *src) {
  while (*src != 0)
    *dst++ = *src++;
  *dst = 0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <strcpy+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <strcpy+0x10>
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %10, %2
%6 = load i8*, i8** %4
%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** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8, i8* %11
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 %13, i8* %14
br label %5
16: ; preds = %5
%17 = load i8*, i8** %3
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @strcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int i_rnd(int);
int il_rnd(int index, int maximum) { return i_rnd(maximum); }


x86 assembly (clang, -O0):
<il_rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <i_rnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<il_rnd>:
mov    %esi,%edi
jmp    1030 <i_rnd@plt>

LLVM IR (-O0):
define i32 @il_rnd(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 = call i32 @i_rnd(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @il_rnd(i32 %0, i32 %1) {
%3 = tail call i32 @i_rnd(i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a = 5, b = 8, c = 18;
  printf("%dx + %dy = %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x8,-0xc(%rbp)
movl   $0x12,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"%dx + %dy = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 5, i32 8, i32 18)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cat_fd(int);
int close(int);
int /*<<< orphan*/ exit(int);
int open(char const *, int /*<<< orphan*/);
void cat(const char *path) {
  int r, fd;
  fd = open(path, 0);
  if (fd < 0)
    exit(1);
  cat_fd(fd);
  r = close(fd);
  if (r < 0)
    exit(2);
}


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1050 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    116e <cat+0x2e>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%edi
call   1030 <cat_fd@plt>
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1195 <cat+0x55>
mov    $0x2,%edi
call   1060 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
push   %rbx
xor    %esi,%esi
call   1050 <open@plt>
test   %eax,%eax
js     1162 <cat+0x22>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <cat_fd@plt>
mov    %ebx,%edi
call   1040 <close@plt>
test   %eax,%eax
js     116c <cat+0x2c>
pop    %rbx
ret
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x2,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define void @cat(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @open(i8* %5, i32 0)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %4
%13 = call i32 @cat_fd(i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @close(i32 %14)
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %11
%19 = call i32 @exit(i32 2)
unreachable
20: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @cat(i8* nocapture %0) {
%2 = tail call i32 @open(i8* %0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %1
%7 = tail call i32 @cat_fd(i32 %2)
%8 = tail call i32 @close(i32 %2)
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @exit(i32 2)
unreachable
12: ; preds = %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glRectf(double, double, double, double);
void tmp_draw_hexplane(void) { glRectf(-2.0, -2.0, 2.0, 2.0); }


x86 assembly (clang, -O0):
<tmp_draw_hexplane>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm3,%xmm2
call   1030 <glRectf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmp_draw_hexplane>:
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm2
movaps %xmm0,%xmm1
movaps %xmm2,%xmm3
jmp    1030 <glRectf@plt>

LLVM IR (-O0):
define void @tmp_draw_hexplane() {
%1 = call i32 @glRectf(double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.000000e+00)
ret void
}

LLVM IR (-O2):
define void @tmp_draw_hexplane() {
%1 = tail call i32 @glRectf(double -2.000000e+00, double -2.000000e+00, double 2.000000e+00, double 2.000000e+00)
ret void
}
void read_input(double array[512][512], const char *filename) {}


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

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

LLVM IR (-O0):
define void @read_input([512 x double]* %0, i8* %1) {
%3 = alloca [512 x double]*
%4 = alloca i8*
store [512 x double]* %0, [512 x double]** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @read_input([512 x double]* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lmrgpa_(double *, double *, int *);
void clmrgpa(double *para, double *xmom, int nmom) {
  lmrgpa_(para, xmom, &nmom);
}


x86 assembly (clang, -O0):
<clmrgpa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <lmrgpa_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clmrgpa>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <lmrgpa_@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @clmrgpa(double* %0, double* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @lmrgpa_(double* %0, double* %1, i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ *stdout;
void close_output_file(FILE *handle, char *filename, int errors) {
  if ((handle != stdout) && (handle != NULL)) {
    fclose(handle);
    if (errors)
      remove(filename);
  }
  return;
}


x86 assembly (clang, -O0):
<close_output_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1173 <close_output_file+0x53>
cmpq   $0x0,-0x8(%rbp)
je     1173 <close_output_file+0x53>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
cmpl   $0x0,-0x14(%rbp)
je     116e <close_output_file+0x4e>
mov    -0x10(%rbp),%rdi
call   1030 <remove@plt>
jmp    1173 <close_output_file+0x53>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_output_file>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1150 <close_output_file+0x30>
mov    0x2eb1(%rip),%rax
cmp    %rdi,(%rax)
je     1150 <close_output_file+0x30>
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <fclose@plt>
test   %ebp,%ebp
je     1150 <close_output_file+0x30>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <remove@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stdout = global i32* null
define void @close_output_file(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** @stdout
%9 = icmp ne i32* %7, %8
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = icmp ne i32* %11, null
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = call i32 @fclose(i32* %14)
%16 = load i32, i32* %6
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = call i32 @remove(i8* %19)
br label %21
21: ; preds = %18, %13
br label %22
22: ; preds = %21, %10, %3
ret void
}

LLVM IR (-O2):
@stdout = global i32* null
define void @close_output_file(i32* %0, i8* nocapture %1, i32 %2) {
%4 = load i32*, i32** @stdout
%5 = icmp ne i32* %4, %0
%6 = icmp ne i32* %0, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = tail call i32 @fclose(i32* %0)
%10 = icmp eq i32 %2, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @remove(i8* %1)
br label %13
13: ; preds = %8, %11, %3
ret void
}
/* Variables and functions */
double _sinh(double);
double sinh(double x) { return _sinh(x); }


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

x86 assembly (clang, -O2):
<sinh>:
jmp    1030 <_sinh@plt>

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @_sinh(double %3)
ret double %4
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call double @_sinh(double %0)
ret double %2
}
unsigned int disable_uint(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @disable_uint() {
ret i32 0
}
char const *pubnub_sdk_name(void) { return "ContikiOS"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"ContikiOS\00"
define i8* @pubnub_sdk_name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"ContikiOS\00"
define i8* @pubnub_sdk_name() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
__u32 rta_getattr_u32(const struct rtattr *rta) {
  return *(__u32 *)((
      void *)(((char *)(rta)) +
              ((((sizeof(struct rtattr)) + 4U - 1) & ~(4U - 1)) + (0))));
}


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

x86 assembly (clang, -O2):
<rta_getattr_u32>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u32(%struct.rtattr* %0) {
%2 = alloca %struct.rtattr*
store %struct.rtattr* %0, %struct.rtattr** %2
%3 = load %struct.rtattr*, %struct.rtattr** %2
%4 = bitcast %struct.rtattr* %3 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u32(%struct.rtattr* nocapture %0) {
%2 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %0, i64 1, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void wczytaj_liczbe_calkowita(int *n_p) {
  printf("Podaj liczbe calkowita wieksza od 0: ");
  scanf("%d", n_p);
  if (*n_p <= 0) {
    printf("Liczba musi byc wieksza od 0");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<wczytaj_liczbe_calkowita>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jg     117b <wczytaj_liczbe_calkowita+0x4b>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wczytaj_liczbe_calkowita>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rbx)
jle    1156 <wczytaj_liczbe_calkowita+0x26>
pop    %rbx
ret
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Podaj liczbe calkowita wieksza od 0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Liczba musi byc wieksza od 0\00"
define void @wczytaj_liczbe_calkowita(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"Podaj liczbe calkowita wieksza od 0: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [29 x i8] c"Liczba musi byc wieksza od 0\00"
define void @wczytaj_liczbe_calkowita(i32* %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%4 = load i32, i32* %0
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
void fun_base_v0() { return; }


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

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

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

LLVM IR (-O2):
define void @fun_base_v0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printascii(char const *);
extern void puts(const char *string) { printascii(string); }


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

x86 assembly (clang, -O2):
<puts>:
jmp    1030 <printascii@plt>

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

LLVM IR (-O2):
define void @puts(i8* %0) {
%2 = tail call i32 @printascii(i8* %0)
ret void
}
/* Type definitions */
struct connstruct {
  int dummy;
};

/* Variables and functions */
int WEB_write_blk(struct connstruct *, char *, int /*<<< orphan*/, int);
int web__Test1_html(struct connstruct *cn, char *datap) {
  int send_len = 0;
  int total_send_len = 0;
  send_len = WEB_write_blk(cn, datap, 0, 173);
  if (send_len != 173)
    return send_len;
  total_send_len += send_len;
  return total_send_len;
}


x86 assembly (clang, -O0):
<web__Test1_html>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
mov    $0xad,%ecx
call   1030 <WEB_write_blk@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xad,-0x1c(%rbp)
je     115d <web__Test1_html+0x4d>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <web__Test1_html+0x5c>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<web__Test1_html>:
xor    %edx,%edx
mov    $0xad,%ecx
jmp    1030 <WEB_write_blk@plt>

LLVM IR (-O0):
%struct.connstruct = type { i32 }
define i32 @web__Test1_html(%struct.connstruct* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.connstruct*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.connstruct* %0, %struct.connstruct** %4
store i8* %1, i8** %5
store i32 0, i32* %6
store i32 0, i32* %7
%8 = load %struct.connstruct*, %struct.connstruct** %4
%9 = load i8*, i8** %5
%10 = call i32 @WEB_write_blk(%struct.connstruct* %8, i8* %9, i32 0, i32 173)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 173
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %6
store i32 %14, i32* %3
br label %20
15: ; preds = %2
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %17, %16
store i32 %18, i32* %7
%19 = load i32, i32* %7
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
%struct.connstruct = type { i32 }
define i32 @web__Test1_html(%struct.connstruct* %0, i8* %1) {
%3 = tail call i32 @WEB_write_blk(%struct.connstruct* %0, i8* %1, i32 0, i32 173)
ret i32 %3
}
/* Variables and functions */
bool is_digit(char c) { return c >= '0' && c <= '9'; }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ c_sgr(char *);
void set_test_colors(void) { c_sgr("0"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define void @set_test_colors() {
%1 = tail call i32 @c_sgr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}