xunge/DecIR huggingface dataset:
const char *PI_get_options(void) {}


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

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

LLVM IR (-O0):
define i8* @PI_get_options() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @PI_get_options() {
ret i8* undef
}
void X509v3_add_ext(void) {}


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

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

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

LLVM IR (-O2):
define void @X509v3_add_ext() {
ret void
}
const char *db_list_entities_report_sql(void) {
  static const char *query = "SELECT"
                             "  id AS 'ID',"
                             "  shortname AS 'Short',"
                             "  name AS 'Entity Name',"
                             "  currency AS 'Curr.',"
                             "  parent AS 'Parent'"
                             "  FROM entities"
                             "  ORDER BY id";
  return query;
}


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

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

LLVM IR (-O0):
@db_list_entities_report_sql.query = internal global i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i32 0, i32 0)
@.str = [137 x i8] c"SELECT id AS 'ID', shortname AS 'Short', name AS 'Entity Name', currency AS 'Curr.', parent AS 'Parent' FROM entities ORDER BY id\00"
define i8* @db_list_entities_report_sql() {
%1 = load i8*, i8** @db_list_entities_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [137 x i8] c"SELECT id AS 'ID', shortname AS 'Short', name AS 'Entity Name', currency AS 'Curr.', parent AS 'Parent' FROM entities ORDER BY id\00"
define i8* @db_list_entities_report_sql() {
ret i8* getelementptr inbounds ([137 x i8], [137 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: midfadeterminize [-ip d/s[dr]] [-op d/s] [-silent] "
                  "[-v] [-l/-h]\n	    [filename]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [88 x i8] c"Usage: midfadeterminize [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h]\0A\09 [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [88 x i8] c"Usage: midfadeterminize [-ip d/s[dr]] [-op d/s] [-silent] [-v] [-l/-h]\0A\09 [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int Min(int a, int b, int c) {
  int res;
  res = a;
  if (b < a)
    res = b;
  if (c < res)
    res = c;
  return res;
}


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1125 <Min+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <Min+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Min(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ f1();
void f2() { f1(); }


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

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

LLVM IR (-O0):
define void @f2() {
%1 = call i32 (...) @f1()
ret void
}

LLVM IR (-O2):
define void @f2() {
%1 = tail call i32 (...) @f1()
ret void
}
/* Variables and functions */
scalar_t__ phys_to_virt(int);
unsigned long get_bios_ebda(void) {
  unsigned long address = *(unsigned short *)phys_to_virt(0x40EUL);
  address <<= 4;
  return address;
}


x86 assembly (clang, -O0):
<get_bios_ebda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40e,%edi
call   1030 <phys_to_virt@plt>
movzwl (%rax),%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bios_ebda>:
push   %rax
mov    $0x40e,%edi
call   1030 <phys_to_virt@plt>
movzwl (%rax),%eax
shl    $0x4,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @get_bios_ebda() {
%1 = alloca i64
%2 = call i64 @phys_to_virt(i32 1038)
%3 = inttoptr i64 %2 to i16*
%4 = load i16, i16* %3
%5 = zext i16 %4 to i64
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = shl i64 %6, 4
store i64 %7, i64* %1
%8 = load i64, i64* %1
ret i64 %8
}

LLVM IR (-O2):
define i64 @get_bios_ebda() {
%1 = tail call i64 @phys_to_virt(i32 1038)
%2 = inttoptr i64 %1 to i16*
%3 = load i16, i16* %2
%4 = zext i16 %3 to i64
%5 = shl nuw nsw i64 %4, 4
ret i64 %5
}
int consumerinit(int tid) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @consumerinit(i32 %0) {
ret i32 0
}
void write_l(unsigned int addr, unsigned int val) {
  volatile unsigned int *ptr = (unsigned int *)(addr);
  *ptr = val;
}


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

x86 assembly (clang, -O2):
<write_l>:
mov    %edi,%eax
mov    %esi,(%rax)
ret

LLVM IR (-O0):
define void @write_l(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
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %5
store volatile i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @write_l(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 %1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handle_intr() { printf("handled signal\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"handled signal\00"
define void @handle_intr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int show(void) {
  printf("Line 1\n");
  printf("Line 2\n");
  printf("Line 3\n");
  printf("Line 4\n");
  printf("Line 5\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<show>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Line 1\0A\00"
@.str.1 = [8 x i8] c"Line 2\0A\00"
@.str.2 = [8 x i8] c"Line 3\0A\00"
@.str.3 = [8 x i8] c"Line 4\0A\00"
@.str.4 = [8 x i8] c"Line 5\0A\00"
define i32 @show() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"Line 1\00"
@str.5 = [7 x i8] c"Line 2\00"
@str.6 = [7 x i8] c"Line 3\00"
@str.7 = [7 x i8] c"Line 4\00"
@str.8 = [7 x i8] c"Line 5\00"
define i32 @show() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0))
ret i32 0
}
int listSize(char *list[]) {
  int i = 0;
  while (list[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<listSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <listSize+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <listSize+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @listSize(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ __glGetPixelMap_size(int /*<<< orphan*/);
GLint __glGetPixelMapuiv_size(GLenum map) { return __glGetPixelMap_size(map); }


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

x86 assembly (clang, -O2):
<__glGetPixelMapuiv_size>:
jmp    1030 <__glGetPixelMap_size@plt>

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

LLVM IR (-O2):
define i32 @__glGetPixelMapuiv_size(i32 %0) {
%2 = tail call i32 @__glGetPixelMap_size(i32 %0)
ret i32 %2
}
void RTAvlrPVGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrPVGet() {
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getrlimit(int resource, struct rlimit *rlim) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<getrlimit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrlimit>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getrlimit(i32 %0, %struct.rlimit* %1) {
%3 = alloca i32
%4 = alloca %struct.rlimit*
store i32 %0, i32* %3
store %struct.rlimit* %1, %struct.rlimit** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getrlimit(i32 %0, %struct.rlimit* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ convertFile(char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  puts(convertFile(argv[1]));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <convertFile@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @convertFile(i8* %4)
%6 = tail call i32 @puts(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void __attribute__((cdecl)) irq_snp(unsigned cs, unsigned ip) {
  printf("irq_"
         "snp"
         "!%x:%x",
         cs, ip);
  halt();
}


x86 assembly (clang, -O0):
<irq_snp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_snp>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"irq_snp!%x:%x\00"
define void @irq_snp(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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"irq_snp!%x:%x\00"
define void @irq_snp(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 (...) @halt()
ret void
}
void glScissor(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glScissor() {
ret void
}
/* Variables and functions */
double abs(scalar_t__);
scalar_t__ pow(double, int);
double euclideanDistance(float x1, float y1, float x2, float y2) {
  double x = x1 - x2;
  double y = y1 - y2;
  return abs(pow(x, 2) + pow(y, 2));
}


x86 assembly (clang, -O0):
<euclideanDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %rax,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
call   1030 <abs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclideanDistance>:
push   %rbx
sub    $0x10,%rsp
subss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
subss  %xmm3,%xmm1
cvtss2sd %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <abs@plt>

LLVM IR (-O0):
define double @euclideanDistance(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca double
%10 = alloca double
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %5
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = fpext float %13 to double
store double %14, double* %9
%15 = load float, float* %6
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = fpext float %17 to double
store double %18, double* %10
%19 = load double, double* %9
%20 = call i64 @pow(double %19, i32 2)
%21 = load double, double* %10
%22 = call i64 @pow(double %21, i32 2)
%23 = add nsw i64 %20, %22
%24 = call double @abs(i64 %23)
ret double %24
}

LLVM IR (-O2):
define double @euclideanDistance(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fpext float %5 to double
%7 = fsub float %1, %3
%8 = fpext float %7 to double
%9 = tail call i64 @pow(double %6, i32 2)
%10 = tail call i64 @pow(double %8, i32 2)
%11 = add nsw i64 %10, %9
%12 = tail call double @abs(i64 %11)
ret double %12
}
/* Variables and functions */
char const *skip_prefix_2(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ ss3_input();
const char *skip_ss3_2(const char *input) {
  if ((unsigned char)*input == 0217) {
    return input + 1;
  }
  return skip_prefix_2(ss3_input(), input);
}


x86 assembly (clang, -O0):
<skip_ss3_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x8f,%eax
jne    114f <skip_ss3_2+0x2f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <skip_ss3_2+0x45>
mov    $0x0,%al
call   1030 <ss3_input@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <skip_prefix_2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_ss3_2>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x8f,(%rdi)
jne    1132 <skip_ss3_2+0x12>
add    $0x1,%rbx
mov    %rbx,%rax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <ss3_input@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <skip_prefix_2@plt>

LLVM IR (-O0):
define i8* @skip_ss3_2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 143
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %2
br label %15
11: ; preds = %1
%12 = call i32 (...) @ss3_input()
%13 = load i8*, i8** %3
%14 = call i8* @skip_prefix_2(i32 %12, i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @skip_ss3_2(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, -113
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
br label %9
6: ; preds = %1
%7 = tail call i32 (...) @ss3_input()
%8 = tail call i8* @skip_prefix_2(i32 %7, i8* %0)
br label %9
9: ; preds = %6, %4
%10 = phi i8* [ %5, %4 ], [ %8, %6 ]
ret i8* %10
}
const char *Len_Definition(void) {
  return "struct Len {\n"
         "  size_t (*len)(var);\n"
         "};\n";
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"struct Len {\0A size_t (*len)(var);\0A};\0A\00"
define i8* @Len_Definition() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [39 x i8] c"struct Len {\0A size_t (*len)(var);\0A};\0A\00"
define i8* @Len_Definition() {
ret i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
FILE *open_test_file(char *file) {
  FILE *f = fopen(file, "a");
  if (f == NULL) {
    printf("Could not create the output file. Does the enclosing folder "
           "exist?\n...Aborting...\n");
    exit(1);
  }
  return f;
}


x86 assembly (clang, -O0):
<open_test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <open_test_file+0x41>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_test_file>:
push   %rax
lea    0xec8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1144 <open_test_file+0x14>
pop    %rcx
ret
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
@.str.1 = [83 x i8] c"Could not create the output file. Does the enclosing folder exist?\0A...Aborting...\0A\00"
define i32* @open_test_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@str = [82 x i8] c"Could not create the output file. Does the enclosing folder exist?\0A...Aborting...\00"
define noalias i32* @open_test_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i32* %2
}
int strcmp(const char *str1, const char *str2) {
  int s1;
  int s2;
  do {
    s1 = *str1++;
    s2 = *str2++;
    if (s1 == 0) {
      break;
    }
  } while (s1 == s2);
  return (s1 < s2) ? -1 : (s1 > s2 ? 1 : 0);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1145 <strcmp+0x45>
jmp    1156 <strcmp+0x56>
jmp    114a <strcmp+0x4a>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     110c <strcmp+0xc>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    116f <strcmp+0x6f>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1184 <strcmp+0x84>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
movzbl (%rsi,%rax,1),%edx
test   %cl,%cl
je     1124 <strcmp+0x24>
add    $0x1,%rax
cmp    %dl,%cl
je     1110 <strcmp+0x10>
xor    %esi,%esi
cmp    %dl,%cl
setg   %sil
mov    $0xffffffff,%eax
cmovge %esi,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %7
7: ; preds = %20, %2
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %3
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
%14 = load i8, i8* %12
%15 = sext i8 %14 to i32
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %7
br label %24
19: ; preds = %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp eq i32 %21, %22
br i1 %23, label %7, label %24
24: ; preds = %20, %18
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %24
br label %35
29: ; preds = %24
%30 = load i32, i32* %5
%31 = load i32, i32* %6
%32 = icmp sgt i32 %30, %31
%33 = zext i1 %32 to i64
%34 = select i1 %32, i32 1, i32 0
br label %35
35: ; preds = %29, %28
%36 = phi i32 [ -1, %28 ], [ %34, %29 ]
ret i32 %36
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %10, %3 ]
%6 = load i8, i8* %5
%7 = load i8, i8* %4
%8 = icmp ne i8 %6, 0
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = icmp eq i8 %6, %7
%12 = select i1 %8, i1 %11, i1 false
br i1 %12, label %3, label %13
13: ; preds = %3
%14 = icmp slt i8 %6, %7
%15 = icmp sgt i8 %6, %7
%16 = zext i1 %15 to i32
%17 = select i1 %14, i32 -1, i32 %16
ret i32 %17
}
f(int __attribute((noderef)) * p) {
  int *local = p;
  int __attribute((noderef)) *x = p;
  __auto_type abc = &*p;
  return *p + *local;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    (%rdi),%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
store i32* %6, i32** %3
%7 = load i32*, i32** %2
store i32* %7, i32** %4
%8 = load i32*, i32** %2
store i32* %8, i32** %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
scalar_t__ sfd_fix_indentation(char *);
scalar_t__ sfd_fix_line_endings(char *);
int fix_code_style(char *fname) {
  return !((sfd_fix_line_endings(fname) == 0) &&
           (sfd_fix_indentation(fname) == 0));
}


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

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

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

LLVM IR (-O2):
define i32 @fix_code_style(i8* %0) {
%2 = tail call i64 @sfd_fix_line_endings(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @sfd_fix_indentation(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
short __iiqnnt(long double);
short intr_wrap_411(long double p1) { return __iiqnnt(p1); }


x86 assembly (clang, -O0):
<intr_wrap_411>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__iiqnnt@plt>
cwtl
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_411>:
jmp    1030 <__iiqnnt@plt>

LLVM IR (-O0):
define signext i16 @intr_wrap_411(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call signext i16 @__iiqnnt(x86_fp80 %3)
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @intr_wrap_411(x86_fp80 %0) {
%2 = tail call signext i16 @__iiqnnt(x86_fp80 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ studly(char *);
int main() {
  char str[100];
  printf("Please type in a word: ");
  scanf("%s", str);
  studly(str);
  printf("The word is %s.\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <studly@plt>
lea    -0x70(%rbp),%rsi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <studly@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Please type in a word: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [17 x i8] c"The word is %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @studly(i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Please type in a word: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [17 x i8] c"The word is %s.\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call i32 @studly(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void fatal(char *message) {
  fprintf(stderr, "!!! Fatal: %s\n", message);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"!!! Fatal: %s\0A\00"
define void @fatal(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"!!! Fatal: %s\0A\00"
define void @fatal(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void posix_class2posix_class_neg() {}


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

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

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

LLVM IR (-O2):
define void @posix_class2posix_class_neg() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ build_l2s_rights();
int /*<<< orphan*/ build_s2l();
void oil_global_init() {
  build_s2l();
  build_l2s_rights();
}


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

x86 assembly (clang, -O2):
<oil_global_init>:
push   %rax
xor    %eax,%eax
call   1040 <build_s2l@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <build_l2s_rights@plt>

LLVM IR (-O0):
define void @oil_global_init() {
%1 = call i32 (...) @build_s2l()
%2 = call i32 (...) @build_l2s_rights()
ret void
}

LLVM IR (-O2):
define void @oil_global_init() {
%1 = tail call i32 (...) @build_s2l()
%2 = tail call i32 (...) @build_l2s_rights()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printPrivate(char *);
void cannotBeClosed(void) { printPrivate("That cannot be closed.\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"That cannot be closed.\0A\00"
define void @cannotBeClosed() {
%1 = call i32 @printPrivate(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"That cannot be closed.\0A\00"
define void @cannotBeClosed() {
%1 = tail call i32 @printPrivate(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
int __attribute__((no)) ypit_year(int j1) {
  j1 -= j1 * 43 >> 16;
  return (unsigned)j1 / 365;
}


x86 assembly (clang, -O0):
<ypit_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x2b,-0x4(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x16d,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ypit_year>:
imul   $0x2b,%edi,%eax
sar    $0x10,%eax
sub    %eax,%edi
imul   $0x6719f361,%rdi,%rax
shr    $0x20,%rax
sub    %eax,%edi
shr    %edi
add    %edi,%eax
shr    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @ypit_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 43
%5 = ashr i32 %4, 16
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, %5
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = udiv i32 %8, 365
ret i32 %9
}

LLVM IR (-O2):
define i32 @ypit_year(i32 %0) {
%2 = mul nsw i32 %0, 43
%3 = ashr i32 %2, 16
%4 = sub nsw i32 %0, %3
%5 = udiv i32 %4, 365
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
__attribute__((__unused__)) ptrdiff_t __nacl_tp_tls_offset(size_t tls_size) {
  return -(ptrdiff_t)tls_size;
}


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

x86 assembly (clang, -O2):
<__nacl_tp_tls_offset>:
mov    %rdi,%rax
neg    %eax
ret

LLVM IR (-O0):
define i32 @__nacl_tp_tls_offset(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = sub nsw i32 0, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @__nacl_tp_tls_offset(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_continue_for() {
  printf("\n===== test_continue_for\n");
  int result = 1;
  int alt_result = 1;
  for (int i = 1; i < 10; ++i) {
    ++result;
    if (result < 10)
      continue;
    ++alt_result;
  }
  assert(result == 10);
  assert(alt_result == 2);
}


x86 assembly (clang, -O0):
<test_continue_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1182 <test_continue_for+0x62>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    116b <test_continue_for+0x4b>
jmp    1174 <test_continue_for+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1149 <test_continue_for+0x29>
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_continue_for>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0A===== test_continue_for\0A\00"
define void @test_continue_for() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %8
br label %17
14: ; preds = %8
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %13
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32, i32* %1
%22 = icmp eq i32 %21, 10
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32, i32* %2
%26 = icmp eq i32 %25, 2
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0A===== test_continue_for\00"
define void @test_continue_for() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret void
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ vmbuf_rloc2(struct vmbuf *);
char *vmbuf_rloc(struct vmbuf *vmbuf) { return (char *)vmbuf_rloc2(vmbuf); }


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

x86 assembly (clang, -O2):
<vmbuf_rloc>:
jmp    1030 <vmbuf_rloc2@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_rloc(%struct.vmbuf* %0) {
%2 = alloca %struct.vmbuf*
store %struct.vmbuf* %0, %struct.vmbuf** %2
%3 = load %struct.vmbuf*, %struct.vmbuf** %2
%4 = call i64 @vmbuf_rloc2(%struct.vmbuf* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_rloc(%struct.vmbuf* %0) {
%2 = tail call i64 @vmbuf_rloc2(%struct.vmbuf* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void __mp_summary(void) {}


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

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

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

LLVM IR (-O2):
define void @__mp_summary() {
ret void
}
/* Variables and functions */
int munmap(void *, size_t);
int /*<<< orphan*/ perror(char *);
int munmap_file(void *p, size_t size) {
  if (munmap(p, size) == -1) {
    perror("munmap");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<munmap_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <munmap@plt>
cmp    $0xffffffff,%eax
jne    115e <munmap_file+0x3e>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    1165 <munmap_file+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap_file>:
push   %rax
call   1030 <munmap@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1134 <munmap_file+0x14>
pop    %rcx
ret
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_insert_epi16(int /*<<< orphan*/, int,
                                    int /*<<< orphan*/);
__m128i test_mm_insert_epi16(__m128i A, int B) {
  return _mm_insert_epi16(A, B, 0);
}


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

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

LLVM IR (-O0):
define i32 @test_mm_insert_epi16(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 @_mm_insert_epi16(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_insert_epi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_insert_epi16(i32 %0, i32 %1, i32 0)
ret i32 %3
}
int fb_hIn(unsigned short port) {
  unsigned char value;
  __asm__ volatile("inb %1, %0" : "=a"(value) : "d"(port));
  return (int)value;
}


x86 assembly (clang, -O0):
<fb_hIn>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_hIn>:
mov    %edi,%edx
in     (%dx),%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @fb_hIn(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @fb_hIn(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
%3 = zext i8 %2 to i32
ret i32 %3
}
void callee(void) { return; }


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

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

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

LLVM IR (-O2):
define void @callee() {
ret void
}