xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ UINT64_C(int);
scalar_t__ rgph_t1ha64s_mux(int /*<<< orphan*/, int /*<<< orphan*/);
void rgph_t1ha64s_fmix4(uint64_t k, uint64_t h[]) {
  h[1] += rgph_t1ha64s_mux(k, UINT64_C(0x9c06faf4d023e3ab));
}


x86 assembly (clang, -O0):
<rgph_t1ha64s_fmix4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0xd023e3ab,%edi
call   1030 <UINT64_C@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <rgph_t1ha64s_mux@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rcx
add    %rdx,%rcx
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_t1ha64s_fmix4>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0xd023e3ab,%edi
call   1030 <UINT64_C@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <rgph_t1ha64s_mux@plt>
add    %eax,0x4(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @rgph_t1ha64s_fmix4(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 = call i32 @UINT64_C(i32 -802954325)
%7 = call i64 @rgph_t1ha64s_mux(i32 %5, i32 %6)
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %7
%13 = trunc i64 %12 to i32
store i32 %13, i32* %9
ret void
}

LLVM IR (-O2):
define void @rgph_t1ha64s_fmix4(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @UINT64_C(i32 -802954325)
%4 = tail call i64 @rgph_t1ha64s_mux(i32 %0, i32 %3)
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = trunc i64 %4 to i32
%8 = add i32 %6, %7
store i32 %8, i32* %5
ret void
}
/* Variables and functions */
int copy_file_loop_unlinking(char const *, char const *);
int copy_file(const char *from, const char *to) {
  return copy_file_loop_unlinking(from, to);
}


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

x86 assembly (clang, -O2):
<copy_file>:
jmp    1030 <copy_file_loop_unlinking@plt>

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

LLVM IR (-O2):
define i32 @copy_file(i8* %0, i8* %1) {
%3 = tail call i32 @copy_file_loop_unlinking(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print(char *s) { printf(s); }


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

x86 assembly (clang, -O2):
<print>:
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
define void @print(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret void
}
int foo() {
  int k = 0;
  while (k < 100) {
    int i = 0;
    int j = k;
    while (i < j) {
      i = i + 1;
      j = j - 1;
    }
    k = k + 1;
  }
  return k;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1153 <foo+0x53>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1145 <foo+0x45>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <foo+0x22>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 100
}
void testfunc_00(const short *ap, short *bp, short val) {
  bp[0] = ap[15];
  bp[2] = ap[5];
  bp[9] = ap[7];
  bp[0] = ap[15];
  bp[4] = val;
  bp[14] = val;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x12(%rax)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x8(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
movzwl 0xa(%rdi),%eax
mov    %ax,0x4(%rsi)
movzwl 0xe(%rdi),%eax
mov    %ax,0x12(%rsi)
movzwl 0x1e(%rdi),%eax
mov    %ax,(%rsi)
mov    %dx,0x8(%rsi)
mov    %dx,0x1c(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_00(i16* %0, i16* %1, i16 signext %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16 %2, i16* %6
%7 = load i16*, i16** %4
%8 = getelementptr inbounds i16, i16* %7, i64 15
%9 = load i16, i16* %8
%10 = load i16*, i16** %5
%11 = getelementptr inbounds i16, i16* %10, i64 0
store i16 %9, i16* %11
%12 = load i16*, i16** %4
%13 = getelementptr inbounds i16, i16* %12, i64 5
%14 = load i16, i16* %13
%15 = load i16*, i16** %5
%16 = getelementptr inbounds i16, i16* %15, i64 2
store i16 %14, i16* %16
%17 = load i16*, i16** %4
%18 = getelementptr inbounds i16, i16* %17, i64 7
%19 = load i16, i16* %18
%20 = load i16*, i16** %5
%21 = getelementptr inbounds i16, i16* %20, i64 9
store i16 %19, i16* %21
%22 = load i16*, i16** %4
%23 = getelementptr inbounds i16, i16* %22, i64 15
%24 = load i16, i16* %23
%25 = load i16*, i16** %5
%26 = getelementptr inbounds i16, i16* %25, i64 0
store i16 %24, i16* %26
%27 = load i16, i16* %6
%28 = load i16*, i16** %5
%29 = getelementptr inbounds i16, i16* %28, i64 4
store i16 %27, i16* %29
%30 = load i16, i16* %6
%31 = load i16*, i16** %5
%32 = getelementptr inbounds i16, i16* %31, i64 14
store i16 %30, i16* %32
ret void
}

LLVM IR (-O2):
define void @testfunc_00(i16* nocapture %0, i16* nocapture writeonly %1, i16 signext %2) {
%4 = getelementptr inbounds i16, i16* %0, i64 15
%5 = load i16, i16* %4
store i16 %5, i16* %1
%6 = getelementptr inbounds i16, i16* %0, i64 5
%7 = load i16, i16* %6
%8 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %7, i16* %8
%9 = getelementptr inbounds i16, i16* %0, i64 7
%10 = load i16, i16* %9
%11 = getelementptr inbounds i16, i16* %1, i64 9
store i16 %10, i16* %11
%12 = load i16, i16* %4
store i16 %12, i16* %1
%13 = getelementptr inbounds i16, i16* %1, i64 4
store i16 %2, i16* %13
%14 = getelementptr inbounds i16, i16* %1, i64 14
store i16 %2, i16* %14
ret void
}
void printString(void *value) {}


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

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

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

LLVM IR (-O2):
define void @printString(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/"
             "heads/master/src/.libs/lt-virt-viewer.c",
             332, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x14c,%esi
lea    0xf4d(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf68(%rip),%rdx
mov    $0x14c,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/heads/master/src/.libs/lt-virt-viewer.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JosenChareles/os-virt-viewer/refs/heads/master/src/.libs/lt-virt-viewer.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 332, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
void yy_1_pExtWsAtom(char *yytext, int yyleng) {
  ;
  ;
}


x86 assembly (clang, -O0):
<yy_1_pExtWsAtom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @yy_1_pExtWsAtom(i8* nocapture %0, i32 %1) {
ret void
}
unsigned int_len(unsigned n) {
  unsigned len = 1;
  while (n >= 10) {
    n /= 10;
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<int_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jb     1135 <int_len+0x35>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <int_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_len>:
mov    $0x1,%eax
cmp    $0xa,%edi
jb     1134 <int_len+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <int_len+0x20>
ret

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

LLVM IR (-O2):
define i32 @int_len(i32 %0) {
%2 = icmp ugt i32 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i32 %5, 10
%7 = add i32 %4, 1
%8 = icmp ugt i32 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetws(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *);
void uninitvar_fgetws(void) {
  wchar_t *buffer;
  int n;
  FILE *stream;
  (void)fgetws(buffer, n, stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_fgetws>:
jmp    1030 <fgetws@plt>

LLVM IR (-O0):
define void @uninitvar_fgetws() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32*
%4 = load i32*, i32** %1
%5 = load i32, i32* %2
%6 = load i32*, i32** %3
%7 = call i32 @fgetws(i32* %4, i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fgetws() {
%1 = tail call i32 @fgetws(i32* undef, i32 undef, i32* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Object_destroy(void *this) { printf("Object::destroy()\n"); }


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

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

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

LLVM IR (-O2):
@str = [18 x i8] c"Object::destroy()\00"
define void @Object_destroy(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dup(int);
int fd_safer(int /*<<< orphan*/);
int dup_safer(int fd) { return fd_safer(dup(fd)); }


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

x86 assembly (clang, -O2):
<dup_safer>:
push   %rax
call   1030 <dup@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fd_safer@plt>

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

LLVM IR (-O2):
define i32 @dup_safer(i32 %0) {
%2 = tail call i32 @dup(i32 %0)
%3 = tail call i32 @fd_safer(i32 %2)
ret i32 %3
}
/* Variables and functions */
unsigned char GetGreen89(unsigned long);
unsigned char getgreen(unsigned long c) { return GetGreen89(c); }


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

x86 assembly (clang, -O2):
<getgreen>:
jmp    1030 <GetGreen89@plt>

LLVM IR (-O0):
define zeroext i8 @getgreen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call zeroext i8 @GetGreen89(i64 %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @getgreen(i64 %0) {
%2 = tail call zeroext i8 @GetGreen89(i64 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ subfunc();
int main(int argc, char **argv) {
  ;
  subfunc();
  ;
  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    $0x0,%al
call   1030 <subfunc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <subfunc@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 = call i32 (...) @subfunc()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @subfunc()
ret i32 0
}
int fun1374() { return 1374; }


x86 assembly (clang, -O0):
<fun1374>:
push   %rbp
mov    %rsp,%rbp
mov    $0x55e,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1374() {
ret i32 1374
}

LLVM IR (-O2):
define i32 @fun1374() {
ret i32 1374
}
/* Variables and functions */
int fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    char const *);
int fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_79_ch_98_ch_106_ch_101_ch_99_ch_116_ch_69_ch_120_ch_97_ch_99_ch_116_ch_67_ch_97_ch_114_ch_100_ch_105_ch_110_ch_97_ch_108_ch_105_ch_116_ch_121(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ malloc_count_current();
int /*<<< orphan*/ malloc_count_peak();
int /*<<< orphan*/ malloc_count_total();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
extern void malloc_pasl_report(void) {
  printf("malloc_total\t%lld\n", malloc_count_total());
  printf("malloc_peak\t%lld\n", malloc_count_peak());
  printf("malloc_current\t%lld\n", malloc_count_current());
}


x86 assembly (clang, -O0):
<malloc_pasl_report>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <malloc_count_total@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <malloc_count_peak@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <malloc_count_current@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1050 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_pasl_report>:
push   %rax
xor    %eax,%eax
call   1040 <malloc_count_total@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <malloc_count_peak@plt>
lea    0xeaf(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <malloc_count_current@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"malloc_total\09%lld\0A\00"
@.str.1 = [18 x i8] c"malloc_peak\09%lld\0A\00"
@.str.2 = [21 x i8] c"malloc_current\09%lld\0A\00"
define void @malloc_pasl_report() {
%1 = call i32 (...) @malloc_count_total()
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @malloc_count_peak()
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @malloc_count_current()
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"malloc_total\09%lld\0A\00"
@.str.1 = [18 x i8] c"malloc_peak\09%lld\0A\00"
@.str.2 = [21 x i8] c"malloc_current\09%lld\0A\00"
define void @malloc_pasl_report() {
%1 = tail call i32 (...) @malloc_count_total()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @malloc_count_peak()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @malloc_count_current()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strlen(char *);
int gao() {
  int i = 12;
  char buffer[4] = {0};
  gets(buffer);
  printf("%d\n", i);
  printf("%d\n", (int)strlen(buffer));
  return 0;
}


x86 assembly (clang, -O0):
<gao>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1050 <memset@plt>
lea    -0x8(%rbp),%rdi
call   1060 <gets@plt>
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gao>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeb0(%rip),%r14
mov    %r14,%rdi
mov    $0xc,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @gao() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @gets(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 12)
%5 = call i64 @strlen(i8* %2)
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
char *_strlwr(char *);
char *strlwr(char *str) { return _strlwr(str); }


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

x86 assembly (clang, -O2):
<strlwr>:
jmp    1030 <_strlwr@plt>

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

LLVM IR (-O2):
define i8* @strlwr(i8* %0) {
%2 = tail call i8* @_strlwr(i8* %0)
ret i8* %2
}
/* Variables and functions */
size_t strlen(const char *str) {
  register const char *s;
  for (s = str; *s; ++s)
    ;
  return (s - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <strlen+0x33>
jmp    1122 <strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/
db_move_all_process_from_active_to_shutdown_list(char const *);
int /*<<< orphan*/ db_move_all_process_from_init_to_shutdown_list(char const *);
void qgis_shutdown_add_all_process(const char *project_name) {
  db_move_all_process_from_init_to_shutdown_list(project_name);
  db_move_all_process_from_active_to_shutdown_list(project_name);
}


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

x86 assembly (clang, -O2):
<qgis_shutdown_add_all_process>:
push   %rbx
mov    %rdi,%rbx
call   1030 <db_move_all_process_from_init_to_shutdown_list@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <db_move_all_process_from_active_to_shutdown_list@plt>

LLVM IR (-O0):
define void @qgis_shutdown_add_all_process(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @db_move_all_process_from_init_to_shutdown_list(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @db_move_all_process_from_active_to_shutdown_list(i8* %5)
ret void
}

LLVM IR (-O2):
define void @qgis_shutdown_add_all_process(i8* %0) {
%2 = tail call i32 @db_move_all_process_from_init_to_shutdown_list(i8* %0)
%3 = tail call i32 @db_move_all_process_from_active_to_shutdown_list(i8* %0)
ret void
}
int TestBigEndian(void) {
  unsigned long test = 0x000000FF;
  char *temp = (char *)&test;
  return (temp[0] == 0);
}


x86 assembly (clang, -O0):
<TestBigEndian>:
push   %rbp
mov    %rsp,%rbp
movq   $0xff,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @TestBigEndian() {
%1 = alloca i64
%2 = alloca i8*
store i64 255, i64* %1
%3 = bitcast i64* %1 to i8*
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @TestBigEndian() {
ret i32 0
}
void __mutex_fastpath_lock_retval(int *i, int __attribute__((regparm(3))) j) {}


x86 assembly (clang, -O0):
<__mutex_fastpath_lock_retval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @__mutex_fastpath_lock_retval(i32* nocapture %0, i32 %1) {
ret void
}
int basic_isort2(a, b)
int *a, *b;
{
  int swaps = 0, aux;
  if (*a > *b)
    do {
      aux = *a;
      *a = *b;
      *b = aux;
      swaps++;
    } while (0);
  return (swaps);
}


x86 assembly (clang, -O0):
<basic_isort2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    1156 <basic_isort2+0x56>
jmp    112a <basic_isort2+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <basic_isort2+0x56>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basic_isort2>:
mov    (%rdi),%ecx
mov    (%rsi),%edx
xor    %eax,%eax
cmp    %edx,%ecx
jle    1113 <basic_isort2+0x13>
mov    %edx,(%rdi)
mov    %ecx,(%rsi)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @basic_isort2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store i32 %4, i32* %0
store i32 %3, i32* %1
br label %7
7: ; preds = %6, %2
%8 = phi i32 [ 1, %6 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ arg_exists(char const **, int);
int /*<<< orphan*/ futhark_panic(int, char *);
const char *get_arg(const char *args[], int i) {
  if (!arg_exists(args, i)) {
    futhark_panic(1, "Insufficient command args.\n");
  }
  return args[i];
}


x86 assembly (clang, -O0):
<get_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <arg_exists@plt>
cmp    $0x0,%eax
jne    1155 <get_arg+0x35>
mov    $0x1,%edi
lea    0xeb0(%rip),%rsi
call   1030 <futhark_panic@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arg>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <arg_exists@plt>
test   %eax,%eax
jne    1142 <get_arg+0x22>
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <futhark_panic@plt>
movslq %ebp,%rax
mov    (%rbx,%rax,8),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Insufficient command args.\0A\00"
define i8* @get_arg(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = call i32 @arg_exists(i8** %5, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @futhark_panic(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = load i8**, i8*** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
ret i8* %16
}

LLVM IR (-O2):
@.str = [28 x i8] c"Insufficient command args.\0A\00"
define i8* @get_arg(i8** %0, i32 %1) {
%3 = tail call i32 @arg_exists(i8** %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @futhark_panic(i32 1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
ret i8* %10
}
int flt_negate(a, b)
double *a;
double *b;
{
  ((unsigned int *)a)[0] = ((unsigned int *)b)[0] ^ 0x80000000;
  ((unsigned int *)a)[1] = ((unsigned int *)b)[1];
  return 1;
}


x86 assembly (clang, -O0):
<flt_negate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
xor    $0x80000000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flt_negate>:
mov    $0x80000000,%eax
xor    (%rsi),%eax
mov    %eax,(%rdi)
mov    0x4(%rsi),%eax
mov    %eax,0x4(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @flt_negate(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = bitcast double* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = xor i32 %8, -2147483648
%10 = load double*, double** %3
%11 = bitcast double* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 0
store i32 %9, i32* %12
%13 = load double*, double** %4
%14 = bitcast double* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = load double*, double** %3
%18 = bitcast double* %17 to i32*
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %16, i32* %19
ret i32 1
}

LLVM IR (-O2):
define i32 @flt_negate(double* nocapture writeonly %0, double* nocapture %1) {
%3 = bitcast double* %1 to i32*
%4 = load i32, i32* %3
%5 = xor i32 %4, -2147483648
%6 = bitcast double* %0 to i32*
store i32 %5, i32* %6
%7 = getelementptr inbounds i32, i32* %3, i64 1
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %6, i64 1
store i32 %8, i32* %9
ret i32 1
}
int getParent(int i, int *path) {
  if (i == path[i]) {
    return i;
  }
  return (path[i] = getParent(path[i], path));
}


x86 assembly (clang, -O0):
<getParent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x8(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    113e <getParent+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <getParent+0x50>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rsi
call   1030 <getParent@plt>
mov    -0x10(%rbp),%rcx
movslq -0x8(%rbp),%rdx
mov    %eax,(%rcx,%rdx,4)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getParent>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%eax
movslq %edi,%rbx
mov    (%rsi,%rbx,4),%edi
cmp    %ebx,%edi
je     112c <getParent+0x1c>
mov    %rsi,%r14
call   1030 <getParent@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @getParent(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %7, label %9
7: ; preds = %2, %9
%8 = phi i32 [ %10, %9 ], [ %0, %2 ]
ret i32 %8
9: ; preds = %2
%10 = tail call i32 @getParent(i32 %5, i32* %1)
store i32 %10, i32* %4
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float corriente = 10;
  float voltaje = 5;
  float potencia = corriente * voltaje;
  printf("potencia= %0.1f\n", potencia);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"potencia= %0.1f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 5.000000e+01)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_digit(char const *);
scalar_t__ is_double_digit(char const *);
int peek_val_type(const char *str) {
  if (is_digit(str))
    return (1);
  if (is_double_digit(str))
    return (2);
  return (3);
}


x86 assembly (clang, -O0):
<peek_val_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
je     114b <peek_val_type+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1171 <peek_val_type+0x51>
mov    -0x10(%rbp),%rdi
call   1040 <is_double_digit@plt>
cmp    $0x0,%rax
je     116a <peek_val_type+0x4a>
movl   $0x2,-0x4(%rbp)
jmp    1171 <peek_val_type+0x51>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek_val_type>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_digit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <peek_val_type+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_double_digit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
or     $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @peek_val_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @is_digit(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @is_double_digit(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 2, i32* %2
br label %14
13: ; preds = %8
store i32 3, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @peek_val_type(i8* %0) {
%2 = tail call i64 @is_digit(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_double_digit(i8* %0)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 3, i32 2
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  while (1) {
    printf("Hello world... from hello1.c\n");
    for (int i = 0; i < 100000000; i++) {
    };
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
jmp    111f <main+0xf>

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

LLVM IR (-O0):
@.str = [30 x i8] c"Hello world... from hello1.c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %12
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %5
5: ; preds = %9, %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100000000
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
br label %3
}

LLVM IR (-O2):
@str = [29 x i8] c"Hello world... from hello1.c\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %1
}
int tpa6130a2_add_controls(struct snd_soc_codec *codec) { return 0; }


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

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

LLVM IR (-O0):
%struct.snd_soc_codec = type opaque
define i32 @tpa6130a2_add_controls(%struct.snd_soc_codec* %0) {
%2 = alloca %struct.snd_soc_codec*
store %struct.snd_soc_codec* %0, %struct.snd_soc_codec** %2
ret i32 0
}

LLVM IR (-O2):
%struct.snd_soc_codec = type opaque
define i32 @tpa6130a2_add_controls(%struct.snd_soc_codec* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cio_printc(char);
void cio_print(char *line) {
  int i = 0;
  while (line[i] != 0) {
    cio_printc(line[i++]);
  }
}


x86 assembly (clang, -O0):
<cio_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <cio_print+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <cio_printc@plt>
jmp    1123 <cio_print+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @cio_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @cio_printc(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int iFunII(int a, int b) {
  a++;
  b++;
  return a + b;
}


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

x86 assembly (clang, -O2):
<iFunII>:
lea    (%rdi,%rsi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @iFunII(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 = add nsw i32 %5, 1
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @iFunII(i32 %0, i32 %1) {
%3 = add i32 %0, 2
%4 = add i32 %3, %1
ret i32 %4
}