xunge/DecIR huggingface dataset:
/* Variables and functions */
int open(char *, int);
int /*<<< orphan*/ sys_error(char *, char *, int);
int open_file(char *file, int open_mode) {
  int file_desc;
  if ((file_desc = open(file, open_mode)) < 0)
    sys_error("open failed",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/CentOS/sig-core-t_ltp/refs/heads/"
              "master/testcases/kernel/sched/sched_stress/sched_tc6.c",
              265);
  return (file_desc);
}


x86 assembly (clang, -O0):
<open_file>:
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 <open@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    115f <open_file+0x3f>
lea    0xeb2(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x109,%edx
call   1030 <sys_error@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
call   1040 <open@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1144 <open_file+0x24>
lea    0xecd(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x109,%edx
call   1030 <sys_error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"open failed\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CentOS/sig-core-t_ltp/refs/heads/master/testcases/kernel/sched/sched_stress/sched_tc6.c\00"
define i32 @open_file(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @sys_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i32 265)
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"open failed\00"
@.str.1 = [178 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CentOS/sig-core-t_ltp/refs/heads/master/testcases/kernel/sched/sched_stress/sched_tc6.c\00"
define i32 @open_file(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @sys_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([178 x i8], [178 x i8]* @.str.1, i64 0, i64 0), i32 265)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
int wcspih_epoch(double *equinox, double epoch) {
  if ((*equinox == 987654321.0e99)) {
    *equinox = epoch;
  }
  return 0;
}


x86 assembly (clang, -O0):
<wcspih_epoch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xee3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    113a <wcspih_epoch+0x3a>
jp     113a <wcspih_epoch+0x3a>
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcspih_epoch>:
movsd  (%rdi),%xmm1
ucomisd 0xef4(%rip),%xmm1
jne    1114 <wcspih_epoch+0x14>
jp     1114 <wcspih_epoch+0x14>
movsd  %xmm0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @wcspih_epoch(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = fcmp oeq double %6, 0x565AEA1D6E56E1C8
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double, double* %4
%10 = load double*, double** %3
store double %9, double* %10
br label %11
11: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
define i32 @wcspih_epoch(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp oeq double %3, 0x565AEA1D6E56E1C8
br i1 %4, label %5, label %6
5: ; preds = %2
store double %1, double* %0
br label %6
6: ; preds = %5, %2
ret i32 0
}
int hidden_filter(const char *name, const struct stat *s) {
  if (name[0] == '.' && name[1] == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<hidden_filter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1139 <hidden_filter+0x39>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1139 <hidden_filter+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1140 <hidden_filter+0x40>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hidden_filter>:
cmpb   $0x2e,(%rdi)
jne    110b <hidden_filter+0xb>
cmpb   $0x0,0x1(%rdi)
je     1111 <hidden_filter+0x11>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @hidden_filter(i8* %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.stat*
store i8* %0, i8** %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 46
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 0, i32* %3
br label %19
18: ; preds = %11, %2
store i32 1, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @hidden_filter(i8* nocapture %0, %struct.stat* nocapture readnone %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 46
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %5, %2
br label %10
10: ; preds = %5, %9
%11 = phi i32 [ 1, %9 ], [ 0, %5 ]
ret i32 %11
}
int init_stub(int arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_stub(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int __u8;
typedef int const __u32;

/* Variables and functions */
__u32 __get_unaligned_le32(const __u8 *p) {
  return p[0] | p[1] << 8 | p[2] << 16 | p[3] << 24;
}


x86 assembly (clang, -O0):
<__get_unaligned_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_unaligned_le32>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__get_unaligned_le32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @__get_unaligned_le32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ gmx_rama(int, char **);
int main(int argc, char *argv[]) {
  gmx_rama(argc, argv);
  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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_rama@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_rama(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ parse_error(char *);
int sscanf(char const *, char *, int *);
int parse_int(char const *str) {
  int value;
  if (sscanf(str, "%d", &value) != 1)
    parse_error("expected decimal value");
  return value;
}


x86 assembly (clang, -O0):
<parse_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1155 <parse_int+0x35>
lea    0xeb3(%rip),%rdi
call   1040 <parse_error@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int>:
push   %rax
lea    0xed8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1143 <parse_int+0x23>
lea    0xec5(%rip),%rdi
call   1040 <parse_error@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"expected decimal value\00"
define i32 @parse_int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @parse_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [23 x i8] c"expected decimal value\00"
define i32 @parse_int(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @parse_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void talloc_abort_unknown_value(void) { abort(); }


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

x86 assembly (clang, -O2):
<talloc_abort_unknown_value>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @talloc_abort_unknown_value() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @talloc_abort_unknown_value() {
%1 = tail call i32 (...) @abort()
unreachable
}
unsigned long zig_zag_fixl(long inp) {
  return ((((unsigned long)(inp) >> ((sizeof(unsigned long) << 3) - 1))
               ? ((~(unsigned long)(inp)) << 1)
               : ((unsigned long)(inp) << 1)) ^
          ((unsigned long)(inp) >> ((sizeof(unsigned long) << 3) - 1)));
}


x86 assembly (clang, -O0):
<zig_zag_fixl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x3f,%rax
cmp    $0x0,%rax
je     112f <zig_zag_fixl+0x2f>
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <zig_zag_fixl+0x3b>
mov    -0x8(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x3f,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_zag_fixl>:
mov    %rdi,%rax
sar    $0x3f,%rax
xor    %rdi,%rax
shld   $0x1,%rdi,%rax
ret

LLVM IR (-O0):
define i64 @zig_zag_fixl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 63
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %2
%8 = xor i64 %7, -1
%9 = shl i64 %8, 1
br label %13
10: ; preds = %1
%11 = load i64, i64* %2
%12 = shl i64 %11, 1
br label %13
13: ; preds = %10, %6
%14 = phi i64 [ %9, %6 ], [ %12, %10 ]
%15 = load i64, i64* %2
%16 = lshr i64 %15, 63
%17 = xor i64 %14, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @zig_zag_fixl(i64 %0) {
%2 = ashr i64 %0, 63
%3 = xor i64 %2, %0
%4 = tail call i64 @llvm.fshl.i64(i64 %3, i64 %0, i64 1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(int argc, char **argv) {
  int tensu[4] = {100, 89, 93, 78};
  printf("TENSU:\n%d\n%d\n%d\n%d\n", tensu[0], tensu[1], tensu[2], tensu[3]);
  return 0;
}


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)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.tensu = [4 x i32] [i32 100, i32 89, i32 93, i32 78]
@.str = [20 x i8] c"TENSU:\0A%d\0A%d\0A%d\0A%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [4 x i32]* %6 to i8*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 1
%11 = load i32, i32* %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 2
%13 = load i32, i32* %12
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 3
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %11, i32 %13, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"TENSU:\0A%d\0A%d\0A%d\0A%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 100, i32 89, i32 93, i32 78)
ret i32 0
}
int Next_Par(char *s, int pos) {
  int curr;
  curr = pos + 1;
  while (*(s + curr) != ')') {
    if (*(s + curr) == '(')
      curr = Next_Par(s, curr);
    curr++;
  }
  return curr;
}


x86 assembly (clang, -O0):
<Next_Par>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x29,%eax
je     116f <Next_Par+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x28,%eax
jne    1161 <Next_Par+0x51>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <Next_Par@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <Next_Par+0x18>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Next_Par>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
jmp    112a <Next_Par+0x1a>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <Next_Par@plt>
cltq
movzbl 0x1(%rbx,%rax,1),%ecx
add    $0x1,%rax
cmp    $0x28,%cl
je     1120 <Next_Par+0x10>
cmp    $0x29,%cl
jne    112a <Next_Par+0x1a>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Next_Par(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i32 [ %1, %2 ], [ %10, %9 ]
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
switch i8 %8, label %9 [
i8 41, label %13
i8 40, label %11
]
9: ; preds = %3, %11
%10 = phi i32 [ %12, %11 ], [ %5, %3 ]
br label %3
11: ; preds = %3
%12 = tail call i32 @Next_Par(i8* %0, i32 %5)
br label %9
13: ; preds = %3
ret i32 %5
}
int main() {
  int a, b;
  int c;
  c = a + b;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int fesetenv(const fenv_t *__envp) {
  fenv_t _fcsr = *__envp;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @fesetenv(i32* nocapture readnone %0) {
ret i32 0
}
int fnargfn(int f(void)) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fnargfn(i32 ()* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
void ki_elojeles_egesz(int szam) { fprintf(stdout, "%d\n", szam); }


x86 assembly (clang, -O0):
<ki_elojeles_egesz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ki_elojeles_egesz>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define void @ki_elojeles_egesz(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int getshstr(int *, int *, char **, size_t *, int /*<<< orphan*/ *, char, char,
             char, int /*<<< orphan*/);
int getshline(char **lineptr, size_t *n, FILE *stream) {
  int firstline, lastline;
  return getshstr(&firstline, &lastline, lineptr, n, stream, '\n', '\\', '#',
                  0);
}


x86 assembly (clang, -O0):
<getshline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    -0x1c(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%r9d
xor    %eax,%eax
movl   $0x5c,(%rsp)
movl   $0x23,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <getshstr@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getshline>:
push   %rax
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
sub    $0x8,%rsp
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0xa,%r9d
push   $0x0
push   $0x23
push   $0x5c
call   1030 <getshstr@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getshline(i8** %0, i64* %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%9 = load i8**, i8*** %4
%10 = load i64*, i64** %5
%11 = load i32*, i32** %6
%12 = call i32 @getshstr(i32* %7, i32* %8, i8** %9, i64* %10, i32* %11, i8 signext 10, i8 signext 92, i8 signext 35, i32 0)
ret i32 %12
}

LLVM IR (-O2):
define i32 @getshline(i8** %0, i64* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 @getshstr(i32* %4, i32* %5, i8** %0, i64* %1, i32* %2, i8 signext 10, i8 signext 92, i8 signext 35, i32 0)
ret i32 %8
}
unsigned long read_cr4(void) {
  unsigned long val;
  asm volatile("mov %%cr4,%0\n\t" : "=r"(val) : : "memory");
  return val;
}


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

x86 assembly (clang, -O2):
<read_cr4>:
mov    %cr4,%rax
ret

LLVM IR (-O0):
define i64 @read_cr4() {
%1 = alloca i64
%2 = call i64 asm sideeffect "mov %cr4,$0\0A\09", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @read_cr4() {
%1 = tail call i64 asm sideeffect "mov %cr4,$0\0A\09", "=r,~{memory},~{dirflag},~{fpsr},~{flags}"()
ret i64 %1
}
void set_732(void *pnt, unsigned int i) {
  unsigned char *p = (unsigned char *)pnt;
  p[3] = i & 0xff;
  p[2] = (i >> 8) & 0xff;
  p[1] = (i >> 16) & 0xff;
  p[0] = (i >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<set_732>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_732>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @set_732(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 3
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = lshr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 2
store i8 %15, i8* %17
%18 = load i32, i32* %4
%19 = lshr i32 %18, 16
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
%24 = load i32, i32* %4
%25 = lshr i32 %24, 24
%26 = and i32 %25, 255
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 0
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @set_732(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %3, i8* %4
%5 = lshr i32 %1, 8
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = lshr i32 %1, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %1, 24
%12 = trunc i32 %11 to i8
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remote_process();
void loop_process(void) { remote_process(); }


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

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

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

LLVM IR (-O2):
define void @loop_process() {
%1 = tail call i32 (...) @remote_process()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemonize();
int /*<<< orphan*/ sleep(int);
int main() {
  daemonize();
  int i = 0;
  for (i = 0; i < 300; i++)
    sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <daemonize@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x12c,-0x8(%rbp)
jge    1169 <main+0x49>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <daemonize@plt>
mov    $0x12c,%ebx
nopl   (%rax)
mov    $0x1,%edi
call   1040 <sleep@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @daemonize()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @sleep(i32 1)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 300
br i1 %6, label %7, label %2
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
size_t round4(size_t num) {
  size_t a = num % 4;
  if (a == 0) {
    return num;
  } else {
    return (num + (4 - a));
  }
}


x86 assembly (clang, -O0):
<round4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    112c <round4+0x2c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <round4+0x40>
mov    -0x10(%rbp),%rax
mov    $0x4,%ecx
sub    -0x18(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round4>:
mov    %edi,%ecx
and    $0x3,%ecx
mov    $0x4,%eax
sub    %rcx,%rax
test   %rcx,%rcx
cmove  %rcx,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @round4(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = urem i64 %5, 4
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i64, i64* %3
store i64 %10, i64* %2
br label %16
11: ; preds = %1
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = sub i64 4, %13
%15 = add i64 %12, %14
store i64 %15, i64* %2
br label %16
16: ; preds = %11, %9
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
define i64 @round4(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = sub nuw nsw i64 4, %2
%5 = select i1 %3, i64 0, i64 %4
%6 = add i64 %5, %0
ret i64 %6
}
/* Variables and functions */
void stub1(double, double);
void testClosureDDrV(void (*closure)(double, double), double a1, double a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureDDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <testClosureDDrV+0x31>
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testClosureDDrV(void (double, double)* %0, double %1, double %2) {
%4 = icmp eq void (double, double)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(double %1, double %2)
br label %6
6: ; preds = %5, %3
ret void
}
int test05(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == 0;
  return x != y;
}


x86 assembly (clang, -O0):
<test05>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test05>:
cmp    %esi,%edi
sete   %al
test   %edx,%edx
sete   %cl
xor    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test05(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = icmp ne i32 %18, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @test05(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = icmp eq i32 %2, 0
%7 = xor i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void iface1_func1(void) { printf("B - version 0 func1\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"B - version 0 func1\00"
define void @iface1_func1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
double *arrayElementOne(double array[]) { return &array[1]; }


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

x86 assembly (clang, -O2):
<arrayElementOne>:
lea    0x8(%rdi),%rax
ret

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

LLVM IR (-O2):
define double* @arrayElementOne(double* readnone %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
ret double* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_get_sample_spec() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_get_sample_spec"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_sample_spec\0A\00"
define i32 @pa_tagstruct_get_sample_spec() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_tagstruct_get_sample_spec\00"
define i32 @pa_tagstruct_get_sample_spec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void checkarg(arg) char *arg;
{
  if (arg == 0)
    fatal("syntax error, argument expected", "");
}


x86 assembly (clang, -O0):
<checkarg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <checkarg+0x2c>
lea    0xed2(%rip),%rdi
lea    0xeea(%rip),%rsi
mov    $0x0,%al
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkarg>:
test   %rdi,%rdi
je     1116 <checkarg+0x6>
ret
lea    0xee3(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"syntax error, argument expected\00"
@.str.1 = [1 x i8] zeroinitializer
define void @checkarg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"syntax error, argument expected\00"
@.str.1 = [1 x i8] zeroinitializer
define void @checkarg(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
const char *dyad_getVersion(void) { return "0.2.0"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"0.2.0\00"
define i8* @dyad_getVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void aks_menu_display_prompt() { printf("> "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @aks_menu_display_prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
float powInt(int x, int y) {
  int i;
  float ret = 1.0;
  for (i = 0; i < y; ++i) {
    ret *= x;
  }
  return ret;
}


x86 assembly (clang, -O0):
<powInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  0xeee(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <powInt+0x47>
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <powInt+0x1e>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<powInt>:
test   %esi,%esi
jle    111f <powInt+0x1f>
cvtsi2ss %edi,%xmm1
lea    -0x1(%rsi),%ecx
mov    %esi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1128 <powInt+0x28>
movss  0xee3(%rip),%xmm0
jmp    1165 <powInt+0x65>
movss  0xed9(%rip),%xmm0
ret
and    $0xfffffff8,%esi
movss  0xecd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
add    $0xfffffff8,%esi
jne    1140 <powInt+0x40>
test   %eax,%eax
je     1179 <powInt+0x79>
nopl   0x0(%rax)
mulss  %xmm1,%xmm0
add    $0xffffffff,%eax
jne    1170 <powInt+0x70>
ret

LLVM IR (-O0):
define float @powInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
store float 1.000000e+00, float* %6
store i32 0, i32* %5
br label %7
7: ; preds = %16, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %19
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to float
%14 = load float, float* %6
%15 = fmul float %14, %13
store float %15, float* %6
br label %16
16: ; preds = %11
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load float, float* %6
ret float %20
}

LLVM IR (-O2):
define float @powInt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = sitofp i32 %0 to float
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi float [ 1.000000e+00, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = fmul float %12, %5
%15 = fmul float %14, %5
%16 = fmul float %15, %5
%17 = fmul float %16, %5
%18 = fmul float %17, %5
%19 = fmul float %18, %5
%20 = fmul float %19, %5
%21 = fmul float %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi float [ undef, %4 ], [ %21, %11 ]
%26 = phi float [ 1.000000e+00, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi float [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = fmul float %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi float [ 1.000000e+00, %2 ], [ %25, %24 ], [ %31, %28 ]
ret float %35
}
/* Variables and functions */
size_t strlen(char const *);
scalar_t__ strncmp(char const *, char const *, size_t);
int startsWith(const char *pre, const char *str) {
  size_t lenpre = strlen(pre), lenstr = strlen(str);
  return lenstr < lenpre ? false : strncmp(pre, str, lenpre) == 0;
}


x86 assembly (clang, -O0):
<startsWith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <startsWith+0x42>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1182 <startsWith+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startsWith>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jb     115e <startsWith+0x3e>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
br label %22
15: ; preds = %2
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = load i64, i64* %5
%19 = call i64 @strncmp(i8* %16, i8* %17, i64 %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %15, %14
%23 = phi i32 [ 0, %14 ], [ %21, %15 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @startsWith(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
struct rusage {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_CHILDREN;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getrusage(int /*<<< orphan*/, struct rusage *);
int /*<<< orphan*/ print_rusage(struct rusage *);
int system(char *);
void with_system(int argc, char **argv) {
  int ret = system(argv[1]);
  struct rusage ru;
  getrusage(RUSAGE_CHILDREN, &ru);
  print_rusage(&ru);
  if (ret != 0) {
    exit(ret);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<with_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1050 <getrusage@plt>
lea    -0x18(%rbp),%rdi
call   1040 <print_rusage@plt>
cmpl   $0x0,-0x14(%rbp)
je     118c <with_system+0x4c>
mov    -0x14(%rbp),%edi
call   1060 <exit@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<with_system>:
push   %r14
push   %rbx
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%r14
mov    %r14,%rsi
call   1050 <getrusage@plt>
mov    %r14,%rdi
call   1040 <print_rusage@plt>
test   %ebx,%ebx
jne    1176 <with_system+0x36>
xor    %edi,%edi
call   1060 <exit@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
@RUSAGE_CHILDREN = global i32 0
define void @with_system(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca %struct.rusage
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @system(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* @RUSAGE_CHILDREN
%12 = call i32 @getrusage(i32 %11, %struct.rusage* %6)
%13 = call i32 @print_rusage(%struct.rusage* %6)
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load i32, i32* %5
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %2
%20 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
@RUSAGE_CHILDREN = global i32 0
define void @with_system(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.rusage
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @system(i8* %5)
%7 = bitcast %struct.rusage* %3 to i8*
%8 = load i32, i32* @RUSAGE_CHILDREN
%9 = call i32 @getrusage(i32 %8, %struct.rusage* %3)
%10 = call i32 @print_rusage(%struct.rusage* %3)
%11 = icmp eq i32 %6, 0
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 @exit(i32 %6)
unreachable
14: ; preds = %2
%15 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, unsigned long);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  ptr = realloc(ptr, size);
  if (!ptr)
    die("Failure to reallocate %lu bytes\n", (unsigned long)size);
  return ptr;
}


x86 assembly (clang, -O0):
<xrealloc>:
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 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115c <xrealloc+0x3c>
mov    -0x10(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <die@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xrealloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [33 x i8] c"Failure to reallocate %lu bytes\0A\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void __gcj_personality_v0() {}


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

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

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

LLVM IR (-O2):
define void @__gcj_personality_v0() {
ret void
}
double f(double a) {}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @f(double %0) {
ret double undef
}