xunge/DecIR huggingface dataset:
void mat_libera(int m, double **A) {
  for (m -= 1; m + 1; m--) {
    free(A[m]);
  }
  free(A);
}


x86 assembly (clang, -O0):
<mat_libera>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x0,%eax
je     1156 <mat_libera+0x46>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <mat_libera+0x18>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_libera>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
test   %edi,%edi
je     1152 <mat_libera+0x42>
mov    %edi,%r12d
movslq %edi,%rax
lea    (%r14,%rax,8),%r15
add    $0xfffffffffffffff8,%r15
neg    %r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r15,%rbx,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    %ebx,%r12d
jne    1140 <mat_libera+0x30>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mat_libera(i32 %0, double** nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds double*, double** %1, i64 %8
%10 = bitcast double** %9 to i8**
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = trunc i64 %8 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = bitcast double** %1 to i8*
tail call void @free(i8* %15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int64_t ll_atol(int8_t *s) {
  int64_t i = atoi((char *)s);
  return i;
}


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

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

LLVM IR (-O0):
define i32 @ll_atol(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to i8*
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @ll_atol(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @atoi(i8* %2)
ret i32 %3
}
long nextTriang() {
  static long lasttriang = 0, num = 1;
  long triang;
  triang = lasttriang + num;
  lasttriang = triang;
  num++;
  return triang;
}


x86 assembly (clang, -O0):
<nextTriang>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f25(%rip),%rax
add    0x2f0e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,0x2f0f(%rip)
mov    0x2ef8(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2eed(%rip)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextTriang>:
mov    0x2f19(%rip),%rcx
mov    0x2f22(%rip),%rax
add    %rcx,%rax
mov    %rax,0x2f18(%rip)
add    $0x1,%rcx
mov    %rcx,0x2efd(%rip)
ret

LLVM IR (-O0):
@nextTriang.lasttriang = internal global i64 0
@nextTriang.num = internal global i64 1
define i64 @nextTriang() {
%1 = alloca i64
%2 = load i64, i64* @nextTriang.lasttriang
%3 = load i64, i64* @nextTriang.num
%4 = add nsw i64 %2, %3
store i64 %4, i64* %1
%5 = load i64, i64* %1
store i64 %5, i64* @nextTriang.lasttriang
%6 = load i64, i64* @nextTriang.num
%7 = add nsw i64 %6, 1
store i64 %7, i64* @nextTriang.num
%8 = load i64, i64* %1
ret i64 %8
}

LLVM IR (-O2):
@nextTriang.lasttriang = internal unnamed_addr global i64 0
@nextTriang.num = internal unnamed_addr global i64 1
define i64 @nextTriang() {
%1 = load i64, i64* @nextTriang.lasttriang
%2 = load i64, i64* @nextTriang.num
%3 = add nsw i64 %2, %1
store i64 %3, i64* @nextTriang.lasttriang
%4 = add nsw i64 %2, 1
store i64 %4, i64* @nextTriang.num
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ logUnsupportedFeature(char *);
int removeService(const char *name) {
  logUnsupportedFeature("service removal");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"service removal\00"
define i32 @removeService(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @logUnsupportedFeature(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"service removal\00"
define i32 @removeService(i8* nocapture readnone %0) {
%2 = tail call i32 @logUnsupportedFeature(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ header;

/* Variables and functions */
int /*<<< orphan*/ kannotate_write(char const *, int);
int strlen(char const *);
void gator_annotate_marker_str(const char *str) {
  int str_size = strlen(str) & 0xffff;
  int header = 0x1c | (0x05 << 8) | (str_size << 16);
  kannotate_write((char *)&header, sizeof(header));
  kannotate_write(str, str_size);
}


x86 assembly (clang, -O0):
<gator_annotate_marker_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
or     $0x51c,%eax
mov    %eax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1040 <kannotate_write@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <kannotate_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gator_annotate_marker_str>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
movzwl %ax,%ebp
shl    $0x10,%eax
or     $0x51c,%eax
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1040 <kannotate_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <kannotate_write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @gator_annotate_marker_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = and i32 %6, 65535
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 16
%10 = or i32 1308, %9
store i32 %10, i32* %4
%11 = bitcast i32* %4 to i8*
%12 = call i32 @kannotate_write(i8* %11, i32 4)
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = call i32 @kannotate_write(i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @gator_annotate_marker_str(i8* %0) {
%2 = alloca i32
%3 = tail call i32 @strlen(i8* %0)
%4 = and i32 %3, 65535
%5 = bitcast i32* %2 to i8*
%6 = shl i32 %3, 16
%7 = or i32 %6, 1308
store i32 %7, i32* %2
%8 = call i32 @kannotate_write(i8* %5, i32 4)
%9 = call i32 @kannotate_write(i8* %0, i32 %4)
ret void
}
int main() {
  char str[] = "abc";
  int s = foo(str, "abc");
  if (str == &str)
    s += 8;
  if (str == &str[0])
    s += 16;
  return s;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x636261,0x4(%rsp)
lea    0xee0(%rip),%rsi
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x18,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [4 x i8] c"abc\00"
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @foo to i32 (i8*, i8*, ...)*)(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 8
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 16
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 6513249, i32* %1
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @foo to i32 (i8*, i8*, ...)*)(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = add nsw i32 %3, 24
ret i32 %4
}
void m_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @m_shutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core1_swap(char *, int);
void U_EMRPOLYGON_swap(char *record, int torev) { core1_swap(record, torev); }


x86 assembly (clang, -O0):
<U_EMRPOLYGON_swap>:
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   1030 <core1_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @U_EMRPOLYGON_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core1_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ Get32BitVal(unsigned int *);
void GenerateNoiseVector(int *coef, int *last, int nVals) {
  int i;
  for (i = 0; i < nVals; i++)
    coef[i] = ((signed int)Get32BitVal((unsigned int *)last)) >> 16;
}


x86 assembly (clang, -O0):
<GenerateNoiseVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115d <GenerateNoiseVector+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <Get32BitVal@plt>
mov    %eax,%edx
sar    $0x10,%edx
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <GenerateNoiseVector+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerateNoiseVector>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1148 <GenerateNoiseVector+0x38>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <Get32BitVal@plt>
sar    $0x10,%eax
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <GenerateNoiseVector+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @GenerateNoiseVector(i32* nocapture writeonly %0, i32* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %13, %7 ]
%9 = tail call i64 @Get32BitVal(i32* %1)
%10 = trunc i64 %9 to i32
%11 = ashr i32 %10, 16
%12 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %11, i32* %12
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ libb_func();
int main(void) {
  libb_func();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <libb_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @libb_func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @libb_func()
ret i32 0
}
int xyzzy0(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @xyzzy0(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ setcurs(int, int);
int inp_setcurs(int x, int y, int i) {
  if (i >= 6) {
    x += 12;
    i -= 6;
  }
  setcurs(x, y + i);
  return x;
}


x86 assembly (clang, -O0):
<inp_setcurs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jl     113d <inp_setcurs+0x2d>
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
call   1030 <setcurs@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inp_setcurs>:
push   %rbx
lea    0xc(%rdi),%ebx
cmp    $0x6,%edx
cmovl  %edi,%ebx
lea    -0x6(%rdx),%eax
cmovl  %edx,%eax
add    %eax,%esi
mov    %ebx,%edi
call   1030 <setcurs@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @inp_setcurs(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 5
%5 = add nsw i32 %0, 12
%6 = add nsw i32 %2, -6
%7 = select i1 %4, i32 %5, i32 %0
%8 = select i1 %4, i32 %6, i32 %2
%9 = add nsw i32 %8, %1
%10 = tail call i32 @setcurs(i32 %7, i32 %9)
ret i32 %7
}
/* Variables and functions */
int O_CREAT;
int O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int, int);
int main() {
  int i = open("./f\nret.txt", O_CREAT | O_WRONLY, 0644);
  close(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    0x2e91(%rip),%rax
or     (%rax),%esi
lea    0xeb8(%rip),%rdi
mov    $0x1a4,%edx
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xec6(%rip),%rdi
mov    $0x1a4,%edx
call   1040 <open@plt>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"./f\0Aret.txt\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 420)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @close(i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"./f\0Aret.txt\00"
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_CREAT
%2 = load i32, i32* @O_WRONLY
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 420)
%5 = tail call i32 @close(i32 %4)
ret i32 0
}
void fd71(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  a : {
    typedef int(*d)[n];
  p013A:
    goto p013A;
    goto a;
  P013A:
    goto P013A;
    0;
  }
  P01C:
    goto P01C;
    ;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd71>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd71+0x7>

x86 assembly (clang, -O2):
<fd71>:
jmp    1100 <fd71>

LLVM IR (-O0):
define void @fd71(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %11, %8
br label %11
12: ; No predecessors!
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %12
br label %15
16: ; preds = %16
br label %16
17: ; preds = %17
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd71(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int GLOB_LLD_Flash_Release();
int GLOB_FTL_Flash_Release(void) { return GLOB_LLD_Flash_Release(); }


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

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

LLVM IR (-O0):
define i32 @GLOB_FTL_Flash_Release() {
%1 = call i32 (...) @GLOB_LLD_Flash_Release()
ret i32 %1
}

LLVM IR (-O2):
define i32 @GLOB_FTL_Flash_Release() {
%1 = tail call i32 (...) @GLOB_LLD_Flash_Release()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ scan_str(char *);
int str_to_int(char *, int *);
int scan_int(int *num) {
  char str[250];
  scan_str(str);
  return str_to_int(str, num);
}


x86 assembly (clang, -O0):
<scan_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
call   1040 <scan_str@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <str_to_int@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan_int>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <scan_str@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <str_to_int@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @scan_int(i32* %0) {
%2 = alloca i32*
%3 = alloca [250 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%5 = call i32 @scan_str(i8* %4)
%6 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32 @str_to_int(i8* %6, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @scan_int(i32* %0) {
%2 = alloca [250 x i8]
%3 = getelementptr inbounds [250 x i8], [250 x i8]* %2, i64 0, i64 0
%4 = call i32 @scan_str(i8* %3)
%5 = call i32 @str_to_int(i8* %3, i32* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void __lock_modules(void *state) { assert(state); }


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

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

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

LLVM IR (-O2):
define void @__lock_modules(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
ret void
}
IR0IR1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (*p0) = (*p1); }


x86 assembly (clang, -O0):
<IR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0IR1>:
mov    (%r9),%al
mov    %al,(%r8)
ret

LLVM IR (-O0):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %13
%17 = load i8, i8* %16
%18 = load i8*, i8** %12
store i8 %17, i8* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture %5) {
%7 = load i8, i8* %5
store i8 %7, i8* %4
ret i32 undef
}
void RTTimeLocalNow(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTimeLocalNow() {
ret void
}
int recode_0_1(int c) { return c - '0'; }


x86 assembly (clang, -O0):
<recode_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<recode_0_1>:
lea    -0x30(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @recode_0_1(i32 %0) {
%2 = add nsw i32 %0, -48
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ctest1(int arg) { printf("ctest1 got arg %d\n", arg); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"ctest1 got arg %d\0A\00"
define void @ctest1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int recv(int, void *, int, int /*<<< orphan*/);
int fwd_ipc_recvmsg(int fd, void *buf, int len) {
  return recv(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<fwd_ipc_recvmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fwd_ipc_recvmsg>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

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

LLVM IR (-O2):
define i32 @fwd_ipc_recvmsg(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
void testfunc_01(volatile const short *ap, volatile short *bp) {
  bp[100] = ap[15];
  bp[200] = ap[50];
  bp[900] = ap[71];
  bp[0] = ap[25];
}


x86 assembly (clang, -O0):
<testfunc_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0xc8(%rax)
mov    -0x8(%rbp),%rax
mov    0x64(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x190(%rax)
mov    -0x8(%rbp),%rax
mov    0x8e(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x708(%rax)
mov    -0x8(%rbp),%rax
mov    0x32(%rax),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc_01>:
movzwl 0x1e(%rdi),%eax
mov    %ax,0xc8(%rsi)
movzwl 0x64(%rdi),%eax
mov    %ax,0x190(%rsi)
movzwl 0x8e(%rdi),%eax
mov    %ax,0x708(%rsi)
movzwl 0x32(%rdi),%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @testfunc_01(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = getelementptr inbounds i16, i16* %5, i64 15
%7 = load volatile i16, i16* %6
%8 = load i16*, i16** %4
%9 = getelementptr inbounds i16, i16* %8, i64 100
store volatile i16 %7, i16* %9
%10 = load i16*, i16** %3
%11 = getelementptr inbounds i16, i16* %10, i64 50
%12 = load volatile i16, i16* %11
%13 = load i16*, i16** %4
%14 = getelementptr inbounds i16, i16* %13, i64 200
store volatile i16 %12, i16* %14
%15 = load i16*, i16** %3
%16 = getelementptr inbounds i16, i16* %15, i64 71
%17 = load volatile i16, i16* %16
%18 = load i16*, i16** %4
%19 = getelementptr inbounds i16, i16* %18, i64 900
store volatile i16 %17, i16* %19
%20 = load i16*, i16** %3
%21 = getelementptr inbounds i16, i16* %20, i64 25
%22 = load volatile i16, i16* %21
%23 = load i16*, i16** %4
%24 = getelementptr inbounds i16, i16* %23, i64 0
store volatile i16 %22, i16* %24
ret void
}

LLVM IR (-O2):
define void @testfunc_01(i16* %0, i16* %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 15
%4 = load volatile i16, i16* %3
%5 = getelementptr inbounds i16, i16* %1, i64 100
store volatile i16 %4, i16* %5
%6 = getelementptr inbounds i16, i16* %0, i64 50
%7 = load volatile i16, i16* %6
%8 = getelementptr inbounds i16, i16* %1, i64 200
store volatile i16 %7, i16* %8
%9 = getelementptr inbounds i16, i16* %0, i64 71
%10 = load volatile i16, i16* %9
%11 = getelementptr inbounds i16, i16* %1, i64 900
store volatile i16 %10, i16* %11
%12 = getelementptr inbounds i16, i16* %0, i64 25
%13 = load volatile i16, i16* %12
store volatile i16 %13, i16* %1
ret void
}
void versionCheckClose(void) {}


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

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

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

LLVM IR (-O2):
define void @versionCheckClose() {
ret void
}
void willusgui_start_browser(char *link) {}


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

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

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

LLVM IR (-O2):
define void @willusgui_start_browser(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_initial_ssthresh(void) {
  record_linux_param_description("tcp_bic.c", "initial_ssthresh",
                                 "initial value of slow start threshold");
}


x86 assembly (clang, -O0):
<module_param_desc_initial_ssthresh>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xef2(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_initial_ssthresh>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xef6(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [17 x i8] c"initial_ssthresh\00"
@.str.2 = [38 x i8] c"initial value of slow start threshold\00"
define void @module_param_desc_initial_ssthresh() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [17 x i8] c"initial_ssthresh\00"
@.str.2 = [38 x i8] c"initial value of slow start threshold\00"
define void @module_param_desc_initial_ssthresh() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int rand();
double rand_double() {
  long long c0 = rand() & 0xffff;
  long long c1 = rand() & 0xffff;
  long long c2 = rand() & 0xffff;
  long long c3 = rand() & 0xffff;
  long long c = ((c3 << 48) | (c2 << 32) | (c1 << 16) | c0);
  return *(double *)&c;
}


x86 assembly (clang, -O0):
<rand_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xffff,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x30,%rax
mov    -0x18(%rbp),%rcx
shl    $0x20,%rcx
or     %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
or     %rcx,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_double>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%r14d
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
movzwl %ax,%r15d
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x30,%rax
shl    $0x20,%r15
or     %rax,%r15
shl    $0x10,%ebx
or     %r15,%rbx
or     %r14,%rbx
movq   %rbx,%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @rand_double() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = call i32 (...) @rand()
%7 = and i32 %6, 65535
%8 = sext i32 %7 to i64
store i64 %8, i64* %1
%9 = call i32 (...) @rand()
%10 = and i32 %9, 65535
%11 = sext i32 %10 to i64
store i64 %11, i64* %2
%12 = call i32 (...) @rand()
%13 = and i32 %12, 65535
%14 = sext i32 %13 to i64
store i64 %14, i64* %3
%15 = call i32 (...) @rand()
%16 = and i32 %15, 65535
%17 = sext i32 %16 to i64
store i64 %17, i64* %4
%18 = load i64, i64* %4
%19 = shl i64 %18, 48
%20 = load i64, i64* %3
%21 = shl i64 %20, 32
%22 = or i64 %19, %21
%23 = load i64, i64* %2
%24 = shl i64 %23, 16
%25 = or i64 %22, %24
%26 = load i64, i64* %1
%27 = or i64 %25, %26
store i64 %27, i64* %5
%28 = bitcast i64* %5 to double*
%29 = load double, double* %28
ret double %29
}

LLVM IR (-O2):
define double @rand_double() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 65535
%3 = zext i32 %2 to i64
%4 = tail call i32 (...) @rand()
%5 = tail call i32 (...) @rand()
%6 = and i32 %5, 65535
%7 = zext i32 %6 to i64
%8 = tail call i32 (...) @rand()
%9 = zext i32 %8 to i64
%10 = shl i64 %9, 48
%11 = shl nuw nsw i64 %7, 32
%12 = or i64 %10, %11
%13 = shl i32 %4, 16
%14 = zext i32 %13 to i64
%15 = or i64 %12, %14
%16 = or i64 %15, %3
%17 = bitcast i64 %16 to double
ret double %17
}
unsigned invert(unsigned x, int p, int n) {
  return (x ^ ~(~0 << n) << (p + 1 - n));
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %6
%14 = sub nsw i32 %12, %13
%15 = shl i32 %10, %14
%16 = xor i32 %7, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %1, 1
%7 = sub i32 %6, %2
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ AbEnd(char *, char const *);
void NeedArg(const char *Opt) { AbEnd("Option requires an argument: %s", Opt); }


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

x86 assembly (clang, -O2):
<NeedArg>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <AbEnd@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Option requires an argument: %s\00"
define void @NeedArg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @AbEnd(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Option requires an argument: %s\00"
define void @NeedArg(i8* %0) {
%2 = tail call i32 @AbEnd(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int _do_nothing_on_ht_for_lambda(void *data, void *extra) {
  int result = 0;
  ((void)(data));
  ((void)(extra));
  return result;
}


x86 assembly (clang, -O0):
<_do_nothing_on_ht_for_lambda>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_do_nothing_on_ht_for_lambda(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ endwin();
void screen_end() {
  clear();
  curs_set(1);
  endwin();
}


x86 assembly (clang, -O0):
<screen_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear@plt>
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0x0,%al
call   1030 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_end>:
push   %rax
xor    %eax,%eax
call   1040 <clear@plt>
mov    $0x1,%edi
call   1050 <curs_set@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <endwin@plt>

LLVM IR (-O0):
define void @screen_end() {
%1 = call i32 (...) @clear()
%2 = call i32 @curs_set(i32 1)
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @screen_end() {
%1 = tail call i32 (...) @clear()
%2 = tail call i32 @curs_set(i32 1)
%3 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
double str_double(const char *d) {
  if (d[0] > '0' + 8)
    printf("%s\n", d);
  return 1.0;
}


x86 assembly (clang, -O0):
<str_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x38,%eax
jle    113c <str_double+0x2c>
mov    -0x8(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xebc(%rip),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_double>:
push   %rax
cmpb   $0x39,(%rdi)
jl     1125 <str_double+0x15>
mov    %rdi,%rsi
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
movsd  0xed3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define double @str_double(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 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 56
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
ret double 1.000000e+00
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define double @str_double(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, 56
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret double 1.000000e+00
}
void answer_variant(void) {}


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

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

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

LLVM IR (-O2):
define void @answer_variant() {
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void quickSort(int *A, int p, int r) {
  int q;
  if (p < r) {
    q = partition(A, p, r);
    quickSort(A, p, q - 1);
    quickSort(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int count = 10, *temp, sum = 0;
  temp = &count;
  *temp = 20;
  temp = &sum;
  *temp = count;
  printf("count = %d, *temp = %d, sum = %d\n", count, *temp, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x14,(%rax)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    -0x14(%rbp),%ecx
lea    0xe9d(%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    $0x14,%esi
mov    $0x14,%edx
mov    $0x14,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [34 x i8] c"count = %d, *temp = %d, sum = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 20, i32 20, i32 20)
ret i32 0
}
int cmsfs_remount(struct super_block *sb, int *flags, char *data) {}


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

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

LLVM IR (-O0):
%struct.super_block = type opaque
define i32 @cmsfs_remount(%struct.super_block* %0, i32* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.super_block*
%6 = alloca i32*
%7 = alloca i8*
store %struct.super_block* %0, %struct.super_block** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @cmsfs_remount(%struct.super_block* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ find(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char haystack[401];
  char needle;
  scanf("%[^\n]s", haystack);
  scanf("%s", &needle);
  find(haystack, needle);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    0xebb(%rip),%rdi
lea    -0x1a1(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
movsbl -0x1a1(%rbp),%esi
call   1030 <find@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1b0,%rsp
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1030 <find@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [401 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = getelementptr inbounds [401 x i8], [401 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = getelementptr inbounds [401 x i8], [401 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %3
%9 = call i32 @find(i8* %7, i8 signext %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [401 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [401 x i8], [401 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = call i32 @find(i8* %3, i8 signext %6)
ret i32 0
}