xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(unsigned long);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, unsigned long);
char *strrchr(char const *, char);
char *get_path_to_file(const char *file) {
  char *file_name = strrchr(file, '/');
  unsigned long size = strlen(file) - strlen(file_name) + 1;
  char *file_path = malloc(size);
  strncpy(file_path, file, size);
  return file_path;
}


x86 assembly (clang, -O0):
<get_path_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1050 <strrchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
sub    %ecx,%eax
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_path_to_file>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
mov    $0x2f,%esi
call   1050 <strrchr@plt>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
sub    %eax,%ebp
add    $0x1,%ebp
movslq %ebp,%rbp
mov    %rbp,%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @get_path_to_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strrchr(i8* %6, i8 signext 47)
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %9, %11
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = call i8* @malloc(i64 %15)
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %2
%19 = load i64, i64* %4
%20 = call i32 @strncpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @get_path_to_file(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %2)
%5 = add i32 %3, 1
%6 = sub i32 %5, %4
%7 = sext i32 %6 to i64
%8 = tail call i8* @malloc(i64 %7)
%9 = tail call i32 @strncpy(i8* %8, i8* %0, i64 %7)
ret i8* %8
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_ssumkbn(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_ssumkbn(N, x, stride);
  printf("sum: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1030 <stdlib_strided_ssumkbn@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_ssumkbn@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_ssumkbn(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [9 x i8] c"sum: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_ssumkbn(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
unsigned char one() { return 1; }


x86 assembly (clang, -O0):
<one>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @one() {
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @one() {
ret i8 1
}
/* Variables and functions */
char *strrchr(char *, char);
char *get_filename_ext(char *filename) {
  char *dot = strrchr(filename, '.');
  if (!dot || dot == filename) {
    return "";
  }
  return dot + 1;
}


x86 assembly (clang, -O0):
<get_filename_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1147 <get_filename_ext+0x37>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1157 <get_filename_ext+0x47>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <get_filename_ext+0x53>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filename_ext>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
cmp    %rbx,%rax
lea    0xed4(%rip),%rdx
cmove  %rdx,%rcx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 46)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %9, %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %17
14: ; preds = %9
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8* %16, i8** %2
br label %17
17: ; preds = %14, %13
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_filename_ext(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = icmp eq i8* %2, %0
%5 = or i1 %3, %4
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = select i1 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 17;
  int width;
  printf("I'm %d years old.\n");
  printf("And %d inches wide.\n", width);
  printf("Which is %f inches/year.\n", (double)width / age);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
lea    0xece(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
xorps  %xmm0,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"I'm %d years old.\0A\00"
@.str.1 = [21 x i8] c"And %d inches wide.\0A\00"
@.str.2 = [26 x i8] c"Which is %f inches/year.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 17, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"I'm %d years old.\0A\00"
@.str.1 = [21 x i8] c"And %d inches wide.\0A\00"
@.str.2 = [26 x i8] c"Which is %f inches/year.\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 undef)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void define(FILE *f, const char *str) { fprintf(f, "#define %s ", str); }


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

x86 assembly (clang, -O2):
<define>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"#define %s \00"
define void @define(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void myprint1(char *print_str) {
  printf("Thi1s is mytool1 print %s\n", print_str);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Thi1s is mytool1 print %s\0A\00"
define void @myprint1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Thi1s is mytool1 print %s\0A\00"
define void @myprint1(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((always_)) void clear_page(void *page) {
  __builtin_memset(page, 0, ((1UL) << 12));
}


x86 assembly (clang, -O0):
<clear_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_page>:
mov    $0x1000,%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clear_page(i8* nocapture writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(4096) %0, i8 0, i64 4096, i1 false)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ISSUING_DIST_POINT;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ ISSUING_DIST_POINT_it;
ISSUING_DIST_POINT *ISSUING_DIST_POINT_new(void) {
  return (ISSUING_DIST_POINT *)ASN1_item_new(&ISSUING_DIST_POINT_it);
}


x86 assembly (clang, -O0):
<ISSUING_DIST_POINT_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISSUING_DIST_POINT_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@ISSUING_DIST_POINT_it = global i32 0
define i32* @ISSUING_DIST_POINT_new() {
%1 = call i64 @ASN1_item_new(i32* @ISSUING_DIST_POINT_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@ISSUING_DIST_POINT_it = global i32 0
define i32* @ISSUING_DIST_POINT_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ISSUING_DIST_POINT_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
void prune_constant_value_Ok(int x) {
  int a[1];
  if (-1 < x && x < 1) {
    if (x) {
      a[1] = 0;
    } else {
      a[0] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<prune_constant_value_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
cmp    -0x4(%rbp),%eax
jge    1141 <prune_constant_value_Ok+0x41>
cmpl   $0x1,-0x4(%rbp)
jge    1141 <prune_constant_value_Ok+0x41>
cmpl   $0x0,-0x4(%rbp)
je     1135 <prune_constant_value_Ok+0x35>
movl   $0x0,-0x4(%rbp)
jmp    113c <prune_constant_value_Ok+0x3c>
movl   $0x0,-0x8(%rbp)
jmp    1141 <prune_constant_value_Ok+0x41>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @prune_constant_value_Ok(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f18(long j) {
  if ((j & ((1UL << (18)) - 1)) >= ((1UL << ((18) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3ffff,%rax
cmp    $0x20002,%rax
jb     1139 <f18+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f18>:
and    $0x3fffe,%edi
cmp    $0x20002,%edi
jae    111f <f18+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f18(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 262143
%5 = icmp uge i64 %4, 131074
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f18(i64 %0) {
%2 = and i64 %0, 262142
%3 = icmp ugt i64 %2, 131073
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merging(int, int, int);
void sort(int low, int high) {
  int mid;
  if (low < high) {
    mid = (low + high) / 2;
    sort(low, mid);
    sort(mid + 1, high);
    merging(low, mid, high);
  } else {
    return;
  }
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1177 <sort+0x57>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <sort@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1030 <sort@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <merging@plt>
jmp    117c <sort+0x5c>
jmp    117c <sort+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    %esi,%edi
jge    1160 <sort+0x40>
push   %r15
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%r15d
lea    (%r14,%r15,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%esi
call   1030 <sort@plt>
lea    0x1(%rbx),%edi
mov    %r14d,%esi
call   1030 <sort@plt>
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <merging@plt>
ret

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

LLVM IR (-O2):
define void @sort(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = add nsw i32 %1, %0
%7 = sdiv i32 %6, 2
tail call void @sort(i32 %0, i32 %7)
%8 = add nsw i32 %7, 1
tail call void @sort(i32 %8, i32 %1)
%9 = tail call i32 @merging(i32 %0, i32 %7, i32 %1)
br label %4
}
oldstyle4(a, b) double b;
{ return a + b; }


x86 assembly (clang, -O0):
<oldstyle4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oldstyle4>:
cvtsi2sd %edi,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @oldstyle4(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 = sitofp i32 %5 to double
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @oldstyle4(i32 %0, double %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, %1
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Type definitions */
struct rtattr {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;

/* Variables and functions */
__u8 rta_getattr_u8(const struct rtattr *rta) {
  return *(
      __u8 *)((void *)(((char *)(rta)) +
                       ((((sizeof(struct rtattr)) + 4 - 1) & ~(4 - 1)) + (0))));
}


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

x86 assembly (clang, -O2):
<rta_getattr_u8>:
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u8(%struct.rtattr* %0) {
%2 = alloca %struct.rtattr*
store %struct.rtattr* %0, %struct.rtattr** %2
%3 = load %struct.rtattr*, %struct.rtattr** %2
%4 = bitcast %struct.rtattr* %3 to i8*
%5 = getelementptr inbounds i8, i8* %4, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define i32 @rta_getattr_u8(%struct.rtattr* nocapture %0) {
%2 = getelementptr inbounds %struct.rtattr, %struct.rtattr* %0, i64 1, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef char uint8_t;

/* Variables and functions */
char nibble_to_ascii(uint8_t n) {
  const uint8_t nibble[16] = {'0', '1', '2', '3', '4', '5', '6', '7',
                              '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
  return nibble[n];
}


x86 assembly (clang, -O0):
<nibble_to_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x18(%rbp)
movsbq -0x1(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_to_ascii>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret

LLVM IR (-O0):
@__const.nibble_to_ascii.nibble = [16 x i8] c"0123456789ABCDEF"
define signext i8 @nibble_to_ascii(i8 signext %0) {
%2 = alloca i8
%3 = alloca [16 x i8]
store i8 %0, i8* %2
%4 = bitcast [16 x i8]* %3 to i8*
%5 = load i8, i8* %2
%6 = sext i8 %5 to i64
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@__const.nibble_to_ascii.nibble = [16 x i8] c"0123456789ABCDEF"
define signext i8 @nibble_to_ascii(i8 signext %0) {
%2 = sext i8 %0 to i64
%3 = getelementptr inbounds [16 x i8], [16 x i8]* @__const.nibble_to_ascii.nibble, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_nothing();
void test_single_call() { do_nothing(); }


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

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

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

LLVM IR (-O2):
define void @test_single_call() {
%1 = tail call i32 (...) @do_nothing()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_colon_square();
int /*<<< orphan*/ glMyPopMatrix();
int /*<<< orphan*/ glMyPushMatrix();
int /*<<< orphan*/ glTranslated(int /*<<< orphan*/, double, int /*<<< orphan*/);
void draw_colon(void) {
  glMyPushMatrix();
  glTranslated(0, -0.2, 0);
  draw_colon_square();
  glTranslated(0, -0.36, 0);
  draw_colon_square();
  glMyPopMatrix();
}


x86 assembly (clang, -O0):
<draw_colon>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <glMyPushMatrix@plt>
xor    %esi,%esi
movsd  0xeb3(%rip),%xmm0
mov    %esi,%edi
call   1050 <glTranslated@plt>
mov    $0x0,%al
call   1040 <draw_colon_square@plt>
xor    %esi,%esi
movsd  0xe93(%rip),%xmm0
mov    %esi,%edi
call   1050 <glTranslated@plt>
mov    $0x0,%al
call   1040 <draw_colon_square@plt>
mov    $0x0,%al
call   1060 <glMyPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_colon>:
push   %rax
xor    %eax,%eax
call   1030 <glMyPushMatrix@plt>
movsd  0xeb0(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1050 <glTranslated@plt>
xor    %eax,%eax
call   1040 <draw_colon_square@plt>
movsd  0xea0(%rip),%xmm0
xor    %edi,%edi
xor    %esi,%esi
call   1050 <glTranslated@plt>
xor    %eax,%eax
call   1040 <draw_colon_square@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <glMyPopMatrix@plt>

LLVM IR (-O0):
define void @draw_colon() {
%1 = call i32 (...) @glMyPushMatrix()
%2 = call i32 @glTranslated(i32 0, double -2.000000e-01, i32 0)
%3 = call i32 (...) @draw_colon_square()
%4 = call i32 @glTranslated(i32 0, double -3.600000e-01, i32 0)
%5 = call i32 (...) @draw_colon_square()
%6 = call i32 (...) @glMyPopMatrix()
ret void
}

LLVM IR (-O2):
define void @draw_colon() {
%1 = tail call i32 (...) @glMyPushMatrix()
%2 = tail call i32 @glTranslated(i32 0, double -2.000000e-01, i32 0)
%3 = tail call i32 (...) @draw_colon_square()
%4 = tail call i32 @glTranslated(i32 0, double -3.600000e-01, i32 0)
%5 = tail call i32 (...) @draw_colon_square()
%6 = tail call i32 (...) @glMyPopMatrix()
ret void
}
/* Type definitions */
typedef enum xprt_stat { ____Placeholder_xprt_stat } xprt_stat;
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int XPRT_IDLE;
enum xprt_stat byz_stat(SVCXPRT *xpt) { return (XPRT_IDLE); }


x86 assembly (clang, -O0):
<byz_stat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byz_stat>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@XPRT_IDLE = global i32 0
define i32 @byz_stat(i32* nocapture readnone %0) {
%2 = load i32, i32* @XPRT_IDLE
ret i32 %2
}
unsigned int *alloc(void) {}


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

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

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

LLVM IR (-O2):
define noalias i32* @alloc() {
ret i32* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
int printDoubleTree(const void *data, void *arg) {
  FILE *f = (FILE *)arg;
  fprintf(f, "%g ", *(double *)data);
  return 0;
}


x86 assembly (clang, -O0):
<printDoubleTree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDoubleTree>:
push   %rax
mov    %rsi,%rax
movsd  (%rdi),%xmm0
lea    0xee1(%rip),%rsi
mov    %rax,%rdi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%g \00"
define i32 @printDoubleTree(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};
struct event {
  int dummy;
};

/* Variables and functions */
int event_add(struct event *, struct timeval const *);
int AMCEvent_Add(struct event *event, const struct timeval *timeout) {
  return event_add(event, timeout);
}


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

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

LLVM IR (-O0):
%struct.event = type { i32 }
%struct.timeval = type { i32 }
define i32 @AMCEvent_Add(%struct.event* %0, %struct.timeval* %1) {
%3 = alloca %struct.event*
%4 = alloca %struct.timeval*
store %struct.event* %0, %struct.event** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.event*, %struct.event** %3
%6 = load %struct.timeval*, %struct.timeval** %4
%7 = call i32 @event_add(%struct.event* %5, %struct.timeval* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.event = type { i32 }
%struct.timeval = type { i32 }
define i32 @AMCEvent_Add(%struct.event* %0, %struct.timeval* %1) {
%3 = tail call i32 @event_add(%struct.event* %0, %struct.timeval* %1)
ret i32 %3
}
void gtk_font_selection_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_font_selection_new() {
ret void
}
void MPUEnable(unsigned long ulMPUConfig) {

  ;
  (*((volatile unsigned long *)(0xE000ED94))) = ulMPUConfig | 0x00000001;
}


x86 assembly (clang, -O0):
<MPUEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
or     $0x1,%rcx
mov    $0xe000ed94,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPUEnable>:
or     $0x1,%rdi
mov    $0xe000ed94,%eax
mov    %rdi,(%rax)
ret

LLVM IR (-O0):
define void @MPUEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 1
store volatile i64 %4, i64* inttoptr (i64 3758157204 to i64*)
ret void
}

LLVM IR (-O2):
define void @MPUEnable(i64 %0) {
%2 = or i64 %0, 1
store volatile i64 %2, i64* inttoptr (i64 3758157204 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
double foo(int arg) {
  if (arg != 116)
    abort();
  return arg + 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x74,-0x4(%rbp)
je     112c <foo+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
cmp    $0x74,%edi
jne    1120 <foo+0x10>
movsd  0xee2(%rip),%xmm0
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define double @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 116
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @foo(i32 %0) {
%2 = icmp eq i32 %0, 116
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret double 1.170000e+02
}
__attribute__((unused)) __attribute__((__always___)) int xbegin(void) {
  int ret = 0xFFFFFFFF;
  asm volatile(".byte 0xc7,0xf8 ; .long 0" : "+a"(ret)::"memory");
  return ret;
}


x86 assembly (clang, -O0):
<xbegin>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xbegin 1114 <xbegin+0x14>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbegin>:
mov    $0xffffffff,%eax
xbegin 110b <xbegin+0xb>
ret

LLVM IR (-O0):
define i32 @xbegin() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @xbegin() {
%1 = tail call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 -1)
ret i32 %1
}
void SSMR3GetIOPort(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetIOPort() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pixel(int, int, char);
void hline(int x1, int x2, int y, char c) {
  int i;
  for (i = x1; i < (x2 + 1); i++) {
    pixel(i, y, c);
  }
}


x86 assembly (clang, -O0):
<hline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    115a <hline+0x4a>
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
movsbl -0xd(%rbp),%edx
call   1030 <pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112c <hline+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %esi,%edi
jg     1144 <hline+0x34>
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
add    $0x1,%r15d
movsbl %cl,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
call   1030 <pixel@plt>
add    $0x1,%ebx
cmp    %ebx,%r15d
jne    1130 <hline+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @hline(i32 %0, i32 %1, i32 %2, i8 signext %3) {
%5 = icmp sgt i32 %0, %1
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %0, %4 ]
%8 = tail call i32 @pixel(i32 %7, i32 %2, i8 signext %3)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %1
br i1 %10, label %11, label %6
11: ; preds = %6, %4
ret void
}
int main(int argc, char *argv[]) {
  int a[] = {10, 11, 7, 10, 6};
  int size = sizeof(a) / sizeof(a[0]);
  int l = 3;
  int max = -1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee2(%rip),%eax
mov    %eax,-0x20(%rbp)
movl   $0x5,-0x34(%rbp)
movl   $0x3,-0x38(%rbp)
movl   $0xffffffff,-0x3c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 10, i32 11, i32 7, i32 10, i32 6]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [5 x i32]* %6 to i8*
store i32 5, i32* %7
store i32 3, i32* %8
store i32 -1, i32* %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void ft_striter(char *s, void (*f)(char *)) {
  if (s && f) {
    while (*s != '\0') {
      f(s);
      s++;
    }
  }
}


x86 assembly (clang, -O0):
<ft_striter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115b <ft_striter+0x5b>
cmpq   $0x0,-0x10(%rbp)
je     115b <ft_striter+0x5b>
jmp    112b <ft_striter+0x2b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1156 <ft_striter+0x56>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112b <ft_striter+0x2b>
jmp    115b <ft_striter+0x5b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_striter>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1130 <ft_striter+0x30>
mov    %rsi,%r14
test   %rsi,%rsi
je     1130 <ft_striter+0x30>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1130 <ft_striter+0x30>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   *%r14
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_striter+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ft_striter(i8* %0, void (i8*)* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne void (i8*)* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6, %9
%10 = phi i8* [ %11, %9 ], [ %0, %6 ]
tail call void %1(i8* %10)
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9, %6, %2
ret void
}
unsigned short RdFwVr_lc898122_sharp(void) { return (0x0007); }


x86 assembly (clang, -O0):
<RdFwVr_lc898122_sharp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RdFwVr_lc898122_sharp>:
mov    $0x7,%ax
ret

LLVM IR (-O0):
define zeroext i16 @RdFwVr_lc898122_sharp() {
ret i16 7
}

LLVM IR (-O2):
define zeroext i16 @RdFwVr_lc898122_sharp() {
ret i16 7
}
double min_double(double a, double b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min_double+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min_double+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_double>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min_double(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* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @min_double(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, char *, int /*<<< orphan*/ *);
int main(int argc, char **argv) { execlp("ls", "ls", "-l", NULL); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rsi
lea    0xed6(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1030 <execlp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}
int bar() { return 44; }


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

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

LLVM IR (-O0):
define i32 @bar() {
ret i32 44
}

LLVM IR (-O2):
define i32 @bar() {
ret i32 44
}
void SSMR3PutUInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3PutUInt() {
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int);
int ssds_item_id(int fd, int class_num, int item_num, char *sp) {
  int ret;
  ret = sprintf(sp, "%d", item_num + 1);
  return ret;
}


x86 assembly (clang, -O0):
<ssds_item_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_item_id>:
add    $0x1,%edx
lea    0xee6(%rip),%rsi
mov    %rcx,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @ssds_item_id(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 1
%13 = call i32 @sprintf(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 %13, i32* %9
%14 = load i32, i32* %9
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @ssds_item_id(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = add nsw i32 %2, 1
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void KeccakF200_StateInitialize(void *state) { memset(state, 0, 200 / 8); }


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

x86 assembly (clang, -O2):
xor    %esi,%esi
mov    $0x19,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @KeccakF200_StateInitialize(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 25)
ret void
}
/* Variables and functions */
unsigned int strlen(const char *str) {
  unsigned int i = 0;
  while (str[i]) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     112e <strlen+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %8, %2 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ restore_term();
void do_exit(void) {
  restore_term();
  exit(0);
}


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <restore_term@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<do_exit>:
push   %rax
xor    %eax,%eax
call   1030 <restore_term@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @do_exit() {
%1 = call i32 (...) @restore_term()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @do_exit() {
%1 = tail call i32 (...) @restore_term()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float a, b, area;
  scanf("%f %f", &a, &b);
  area = a * b / 2;
  printf("The area of (%.4f,%.4f), (%.4f,0) and (0,%.4f) is %.4f.", a, b, a, b,
         area);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  0xeab(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
movss  -0x10(%rbp),%xmm4
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
movaps %xmm0,%xmm4
mulss  %xmm1,%xmm4
mulss  0xeb1(%rip),%xmm4
lea    0xeb4(%rip),%rdi
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [56 x i8] c"The area of (%.4f,%.4f), (%.4f,0) and (0,%.4f) is %.4f.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
%6 = load float, float* %2
%7 = load float, float* %3
%8 = fmul float %6, %7
%9 = fdiv float %8, 2.000000e+00
store float %9, float* %4
%10 = load float, float* %2
%11 = load float, float* %3
%12 = load float, float* %2
%13 = load float, float* %3
%14 = load float, float* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), float %10, float %11, float %12, float %13, float %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [56 x i8] c"The area of (%.4f,%.4f), (%.4f,0) and (0,%.4f) is %.4f.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fmul float %6, %7
%9 = fmul float %8, 5.000000e-01
%10 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), float %6, float %7, float %6, float %7, float %9)
ret i32 0
}