xunge/DecIR huggingface dataset:
/* Variables and functions */
int count_sub_asns(unsigned char **);
int count_asns(unsigned char *from) { return (1 + count_sub_asns(&from)); }


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

x86 assembly (clang, -O2):
<count_asns>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <count_sub_asns@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @count_asns(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @count_sub_asns(i8** %2)
%4 = add nsw i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @count_asns(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @count_sub_asns(i8** %2)
%4 = add nsw i32 %3, 1
ret i32 %4
}
int in2(int n, const int *arr, int len) {
  for (int i = 0; i < len; ++i)
    if (arr[i] == n)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<in2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <in2+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <in2+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <in2+0x5b>
jmp    1146 <in2+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <in2+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in2>:
test   %edx,%edx
jle    113a <in2+0x3a>
mov    $0x1,%eax
cmp    %edi,(%rsi)
je     1139 <in2+0x39>
mov    %edx,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%rdx
cmp    %rax,%rcx
je     1131 <in2+0x31>
lea    0x1(%rdx),%rax
cmp    %edi,(%rsi,%rdx,4)
jne    1120 <in2+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @in2(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = zext i32 %2 to i64
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, %0
br i1 %9, label %21, label %10
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %1, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %0
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %18, label %10
18: ; preds = %10, %13
%19 = icmp ult i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 0, %3 ], [ 1, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void html_putc(int ch, FILE *fp) {
  if (ch == '&')
    fputs("&amp;", fp);
  else if (ch == '<')
    fputs("&lt;", fp);
  else
    putc(ch, fp);
}


x86 assembly (clang, -O0):
<html_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x26,-0x4(%rbp)
jne    114e <html_putc+0x2e>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <fputs@plt>
jmp    117e <html_putc+0x5e>
cmpl   $0x3c,-0x4(%rbp)
jne    116d <html_putc+0x4d>
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <fputs@plt>
jmp    1179 <html_putc+0x59>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <putc@plt>
jmp    117e <html_putc+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_putc>:
mov    %rsi,%rcx
cmp    $0x3c,%edi
je     1143 <html_putc+0x23>
cmp    $0x26,%edi
jne    1159 <html_putc+0x39>
lea    0xecc(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
lea    0xebc(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
mov    %rcx,%rsi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"&amp;\00"
@.str.1 = [5 x i8] c"&lt;\00"
define void @html_putc(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 = icmp eq i32 %5, 38
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %8)
br label %21
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 60
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %14)
br label %20
16: ; preds = %10
%17 = load i32, i32* %3
%18 = load i32*, i32** %4
%19 = call i32 @putc(i32 %17, i32* %18)
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %20, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"&amp;\00"
@.str.1 = [5 x i8] c"&lt;\00"
define void @html_putc(i32 %0, i32* nocapture %1) {
switch i32 %0, label %7 [
i32 38, label %3
i32 60, label %5
]
3: ; preds = %2
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %1)
br label %9
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 1, i32* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @putc(i32 %0, i32* %1)
br label %9
9: ; preds = %5, %7, %3
ret void
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t get_uint16_be(unsigned char *buf) { return ((buf[0] << 8) | buf[1]); }


x86 assembly (clang, -O0):
<get_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16_be>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_uint16_be(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @get_uint16_be(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
/* Variables and functions */
int output();
int feature_function(void) { return output() * 2; }


x86 assembly (clang, -O0):
<feature_function>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <output@plt>
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<feature_function>:
push   %rax
xor    %eax,%eax
call   1030 <output@plt>
add    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @feature_function() {
%1 = call i32 (...) @output()
%2 = mul nsw i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @feature_function() {
%1 = tail call i32 (...) @output()
%2 = shl nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int foo(int *);
int main() {
  int x[100];
  x[0] = 1000;
  return foo(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x1a0(%rbp)
lea    -0x1a0(%rbp),%rdi
call   1030 <foo@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
movl   $0x3e8,(%rsp)
mov    %rsp,%rdi
call   1030 <foo@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
store i32 1000, i32* %3
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
store i32 1000, i32* %3
%4 = call i32 @foo(i32* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void pthread_exit(void *value_ptr) { _unsupported(); }


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

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

LLVM IR (-O0):
define void @pthread_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @_unsupported()
ret void
}

LLVM IR (-O2):
define void @pthread_exit(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @_unsupported()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ write_array_ui32(int /*<<< orphan*/ *, unsigned int const *,
                                    unsigned int const);
void write_named_array_ui32(FILE *f, const char *name, const unsigned int *x,
                            const unsigned int len) {
  fprintf(f, "\"%s\":[", name);
  write_array_ui32(f, x, len);
  fprintf(f, "]");
}


x86 assembly (clang, -O0):
<write_named_array_ui32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <write_array_ui32@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_named_array_ui32>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rbp
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write_array_ui32@plt>
mov    $0x5d,%edi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\22%s\22:[\00"
@.str.1 = [2 x i8] c"]\00"
define void @write_named_array_ui32(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %5
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @write_array_ui32(i32* %12, i32* %13, i32 %14)
%16 = load i32*, i32** %5
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\22%s\22:[\00"
define void @write_named_array_ui32(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @write_array_ui32(i32* %0, i32* %2, i32 %3)
%7 = tail call i32 @fputc(i32 93, i32* %0)
ret void
}
void nand_cmd(unsigned char cmd) {
  (*((volatile unsigned long *)0x70200008)) = cmd;
}


x86 assembly (clang, -O0):
<nand_cmd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    $0x70200008,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_cmd>:
mov    %edi,%eax
mov    %rax,0x70200008
70
ret

LLVM IR (-O0):
define void @nand_cmd(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1881145352 to i64*)
ret void
}

LLVM IR (-O2):
define void @nand_cmd(i8 zeroext %0) {
%2 = zext i8 %0 to i64
store volatile i64 %2, i64* inttoptr (i64 1881145352 to i64*)
ret void
}
unsigned short get_uint16(unsigned char *buf) {
  unsigned short ret;
  ret = buf[0] * 256 + buf[1];
  return (ret);
}


x86 assembly (clang, -O0):
<get_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
add    %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @get_uint16(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = mul nsw i32 %7, 256
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = add nsw i32 %8, %12
%14 = trunc i32 %13 to i16
store i16 %14, i16* %3
%15 = load i16, i16* %3
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @get_uint16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ grisu2(double, char *, int *, int *);
int /*<<< orphan*/ prettify_string(char *, int /*<<< orphan*/, int, int);
bool fill_double(double v, char *buffer) {
  int length, K;
  grisu2(v, buffer, &length, &K);
  prettify_string(buffer, 0, length, K);
  return 1;
}


x86 assembly (clang, -O0):
<fill_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <grisu2@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %esi,%esi
call   1030 <prettify_string@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_double>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <grisu2@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <prettify_string@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fill_double(double %0, i8* %1) {
%3 = alloca double
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store double %0, double* %3
store i8* %1, i8** %4
%7 = load double, double* %3
%8 = load i8*, i8** %4
%9 = call i32 @grisu2(double %7, i8* %8, i32* %5, i32* %6)
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @prettify_string(i8* %10, i32 0, i32 %11, i32 %12)
ret i32 1
}

LLVM IR (-O2):
define i32 @fill_double(double %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @grisu2(double %0, i8* %1, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @prettify_string(i8* %1, i32 0, i32 %8, i32 %9)
ret i32 1
}
/* Variables and functions */
char *malloc(size_t);
char *memcpy(char *, char const *, size_t);
size_t vs_strnlen(char const *, size_t);
char *vs_strndup(const char *s, size_t n) {
  size_t len = vs_strnlen(s, n);
  char *new = malloc(len + 1);
  if (new == NULL) {
    return NULL;
  }
  new[len] = '\0';
  return memcpy(new, s, len);
}


x86 assembly (clang, -O0):
<vs_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <vs_strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    117a <vs_strndup+0x4a>
movq   $0x0,-0x8(%rbp)
jmp    119b <vs_strndup+0x6b>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vs_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <vs_strnlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1164 <vs_strndup+0x34>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @vs_strndup(i8* %0, i64 %1) {
%3 = tail call i64 @vs_strnlen(i8* %0, i64 %1)
%4 = add i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 %3
store i8 0, i8* %8
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %3, i1 false)
br label %9
9: ; preds = %2, %7
ret i8* %5
}
/* Variables and functions */
int abs(int);
int BLSCheck(int *dBuf, int dbPtr, int *maxder) {
  int max, min, maxt, mint, t, x;
  max = min = 0;
  return (0);
  for (t = 0; t < ((int)(220 / ((double)1000 / (double)300) + 0.5)); ++t) {
    x = dBuf[dbPtr];
    if (x > max) {
      maxt = t;
      max = x;
    } else if (x < min) {
      mint = t;
      min = x;
    }
    if (++dbPtr ==
        ((int)(80 / ((double)1000 / (double)300) + 0.5)) +
            (int)(((double)((int)(10 / ((double)1000 / (double)300) + 0.5)) /
                   2) +
                  ((double)((int)(2 * ((int)(25 / ((double)1000 / (double)300) +
                                             0.5)))) /
                       2 -
                   1) +
                  (((double)((int)(125 / ((double)1000 / (double)300) + 0.5)) -
                    1) /
                   2) +
                  ((int)(200 / ((double)1000 / (double)300) + 0.5))) +
            ((int)(100 / ((double)1000 / (double)300) + 0.5)))
      dbPtr = 0;
  }
  *maxder = max;
  min = -min;
  if ((max > (min >> 3)) && (min > (max >> 3)) &&
      (abs(maxt - mint) < ((int)(150 / ((double)1000 / (double)300) + 0.5))))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<BLSCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BLSCheck(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %8
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @BLSCheck(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int umount(char *);
int crn_aufs_umount(char *target) { return umount(target); }


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

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

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

LLVM IR (-O2):
define i32 @crn_aufs_umount(i8* %0) {
%2 = tail call i32 @umount(i8* %0)
ret i32 %2
}
/* Variables and functions */
int erase(int fd, size_t count, unsigned long offset) { return 0; }


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

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

LLVM IR (-O0):
define i32 @erase(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 %0, i32* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @erase(i32 %0, i64 %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fizz_buzz(int);
int main() {
  int i;
  for (i = 0; i <= 100; i++) {
    fizz_buzz(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <fizz_buzz@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <fizz_buzz@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @fizz_buzz(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 101
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
void EC_GROUP_free(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_GROUP_free() {
ret void
}
int test_imm_1Eint64_lowword_reg(long long val) {
  return ((val) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Eint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x1e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Eint64_lowword_reg>:
test   $0x1e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_1Eint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 30
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_1Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 30
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int _open(const char *buf, int flags, int mode) {
  (void)buf;
  (void)flags;
  (void)mode;
  errno = EIO;
  return (-1);
}


x86 assembly (clang, -O0):
<_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ecb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EIO = global i32 0
@errno = global i32 0
define i32 @_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @EIO
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EIO = global i32 0
@errno = global i32 0
define i32 @_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EIO
store i32 %4, i32* @errno
ret i32 -1
}
void border_nesw_double_diagonal_generic(unsigned char *pic,
                                         unsigned char *mirr) {
  *mirr = 0x02;
  *pic = 0x28;
}


x86 assembly (clang, -O0):
<border_nesw_double_diagonal_generic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x28,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nesw_double_diagonal_generic>:
movb   $0x2,(%rsi)
movb   $0x28,(%rdi)
ret

LLVM IR (-O0):
define void @border_nesw_double_diagonal_generic(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
store i8 2, i8* %5
%6 = load i8*, i8** %3
store i8 40, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nesw_double_diagonal_generic(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 2, i8* %1
store i8 40, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_AND(int r, int v) { C67_asm("AND.L", v, r, v); }


x86 assembly (clang, -O0):
<C67_AND>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed2(%rip),%rdi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_AND>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
mov    %esi,%ecx
jmp    1030 <C67_asm@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"AND.L\00"
define void @C67_AND(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"AND.L\00"
define void @C67_AND(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
void fileerror(char *msg) {
  printf("\n");
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<fileerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fileerror>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define void @fileerror(i8* nocapture %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int just_check_status(unsigned char *);
int op_lock_recv(unsigned char *packet) { return just_check_status(packet); }


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

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

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

LLVM IR (-O2):
define i32 @op_lock_recv(i8* %0) {
%2 = tail call i32 @just_check_status(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_error(char *errorMsg) { puts(errorMsg); }


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

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

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

LLVM IR (-O2):
define void @print_error(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fatal(char *);
scalar_t__ fseek(int /*<<< orphan*/ *, long const, int /*<<< orphan*/);
void file_seek(FILE *file, const long int offset) {
  if (fseek(file, offset, SEEK_SET) != 0) {
    fatal("File seek error.");
  }
}


x86 assembly (clang, -O0):
<file_seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
cmp    $0x0,%rax
je     115c <file_seek+0x3c>
lea    0xea9(%rip),%rdi
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_seek>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <fseek@plt>
test   %rax,%rax
je     1141 <file_seek+0x21>
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1040 <fatal@plt>
pop    %rax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [17 x i8] c"File seek error.\00"
define void @file_seek(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i32*, i32** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i64 @fseek(i32* %5, i64 %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @fatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [17 x i8] c"File seek error.\00"
define void @file_seek(i32* nocapture %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i64 @fseek(i32* %0, i64 %1, i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ errno;
int foo(void) {
  errno = 0;
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2ed9(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
ret

LLVM IR (-O0):
@errno = global i64 0
define i32 @foo() {
store i64 0, i64* @errno
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
define i32 @foo() {
store i64 0, i64* @errno
ret i32 0
}
void clInitStaticClass(void) {
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @clInitStaticClass() {
ret void
}
/* Variables and functions */
scalar_t__ CLOCKS_PER_SEC;
scalar_t__ clock();
double get_elapsed_time() {
  return (((double)clock() / (double)CLOCKS_PER_SEC));
}


x86 assembly (clang, -O0):
<get_elapsed_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_elapsed_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i64 0
define double @get_elapsed_time() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i64 0
define double @get_elapsed_time() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @CLOCKS_PER_SEC
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
unsigned howMany(char c, const char *s) {
  static unsigned retVal;
  if (*s) {
    if (*s == c)
      retVal++;
    howMany(c, (s + 1));
  }
  return retVal;
}


x86 assembly (clang, -O0):
<howMany>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1164 <howMany+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    1151 <howMany+0x41>
mov    0x2ee4(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2edb(%rip)
mov    -0x1(%rbp),%al
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
movsbl %al,%edi
call   1030 <howMany@plt>
mov    0x2ec2(%rip),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<howMany>:
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1130 <howMany+0x20>
cmp    %dil,%al
jne    1123 <howMany+0x13>
addl   $0x1,0x2f09(%rip)
add    $0x1,%rsi
movsbl %dil,%edi
call   1030 <howMany@plt>
mov    0x2ef6(%rip),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@howMany.retVal = internal unnamed_addr global i32 0
define i32 @howMany(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2
%6 = icmp eq i8 %3, %0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = load i32, i32* @howMany.retVal
%9 = add i32 %8, 1
store i32 %9, i32* @howMany.retVal
br label %10
10: ; preds = %7, %5
%11 = getelementptr inbounds i8, i8* %1, i64 1
%12 = tail call i32 @howMany(i8 signext %0, i8* %11)
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* @howMany.retVal
ret i32 %14
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void error(char *msg) {
  if (errno)
    perror(msg);
  else
    fprintf(stderr, "%s\n", msg);
  if (errno == 0)
    exit(1);
  else
    exit(errno);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpl   $0x0,(%rax)
je     115a <error+0x2a>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1173 <error+0x43>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e5e(%rip),%rax
cmpl   $0x0,(%rax)
jne    118d <error+0x5d>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rbx
cmpl   $0x0,(%rbx)
je     1158 <error+0x28>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    (%rbx),%edi
test   %edi,%edi
jne    1153 <error+0x23>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1148 <error+0x18>

LLVM IR (-O0):
@errno = global i32 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @errno
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %5
%13 = load i32, i32* @errno
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %12
%18 = load i32, i32* @errno
%19 = call i32 @exit(i32 %18)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @errno
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
%10 = load i32, i32* @errno
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %9
%15 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int fnc(int, int);
int main(int argc, char **argv) {
  int i = 10;
  return fnc(i = i + 1, 20);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x14(%rbp)
mov    $0x14,%esi
call   1030 <fnc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xb,%edi
mov    $0x14,%esi
jmp    1030 <fnc@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
store i32 %8, i32* %6
%9 = call i32 @fnc(i32 %8, i32 20)
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fnc(i32 11, i32 20)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
void checkIntInput(int *a) {
  if ((scanf("%d", a) != 1)) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checkIntInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     116f <checkIntInput+0x3f>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIntInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <checkIntInput+0x17>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @checkIntInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void RTDbgAsModuleByAddr(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgAsModuleByAddr() {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void EPIIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000210))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<EPIIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    0x210(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x210(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x210(%rcx)
ret

LLVM IR (-O0):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 528
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @EPIIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add i64 %6, 528
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
void SplitUVRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SplitUVRow_NEON() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
int peek(FILE *stream) {
  int c = getc(stream);
  ungetc(c, stream);
  return c;
}


x86 assembly (clang, -O0):
<peek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <ungetc@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<peek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <ungetc@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @peek(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @getc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i32 %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @peek(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
ret i32 %2
}
void ff_hevc_put_hevc_epel_h8_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h8_10_sse4() {
ret void
}
int gt_it(int suc, int value) { return suc > value; }


x86 assembly (clang, -O0):
<gt_it>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_it>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @gt_it(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 = icmp sgt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @gt_it(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}