xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int strlen(const char *s) {
  unsigned int len = 0;
  while (*s++ != '\0')
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <strlen+0x38>
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>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
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 = %10, %1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
unsigned long gds_hash_sdbm(const char *s) {
  unsigned long hash = 0;
  int c;
  if (!s)
    return 0;
  while ((c = *s++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<gds_hash_sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <gds_hash_sdbm+0x28>
movq   $0x0,-0x8(%rbp)
jmp    117a <gds_hash_sdbm+0x7a>
jmp    112d <gds_hash_sdbm+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1172 <gds_hash_sdbm+0x72>
movslq -0x1c(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112d <gds_hash_sdbm+0x2d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gds_hash_sdbm>:
test   %rdi,%rdi
je     113a <gds_hash_sdbm+0x3a>
mov    (%rdi),%cl
test   %cl,%cl
je     113a <gds_hash_sdbm+0x3a>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <gds_hash_sdbm+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @gds_hash_sdbm(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %14, %6 ], [ %4, %3 ]
%8 = phi i64 [ %13, %6 ], [ 0, %3 ]
%9 = phi i8* [ %10, %6 ], [ %0, %3 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = sext i8 %7 to i64
%12 = mul i64 %8, 65599
%13 = add i64 %12, %11
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %6
16: ; preds = %6, %3, %1
%17 = phi i64 [ 0, %1 ], [ 0, %3 ], [ %13, %6 ]
ret i64 %17
}
void ata_sff_port_init(struct ata_port *ap) {}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_sff_port_init(%struct.ata_port* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
int ENR_free(float *array) {
  if (array != NULL)
    free(array);
  return 0;
}


x86 assembly (clang, -O0):
<ENR_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ENR_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENR_free>:
test   %rdi,%rdi
je     111f <ENR_free+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ENR_free(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = icmp ne float* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float*, float** %2
%7 = call i32 @free(float* %6)
br label %8
8: ; preds = %5, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @ENR_free(float* %0) {
%2 = icmp eq float* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(float* %0)
br label %5
5: ; preds = %3, %1
ret i32 0
}
void SWARM_Barrier_tree_destroy(void) { return; }


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

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

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

LLVM IR (-O2):
define void @SWARM_Barrier_tree_destroy() {
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *dll_readdir(int /*<<< orphan*/ *);
struct dirent *__wrap_readdir64(DIR *dirp) {
  return dll_readdir(dirp);
}


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

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

LLVM IR (-O0):
%struct.dirent = type { i32 }
define %struct.dirent* @__wrap_readdir64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.dirent* @dll_readdir(i32* %3)
ret %struct.dirent* %4
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define %struct.dirent* @__wrap_readdir64(i32* %0) {
%2 = tail call %struct.dirent* @dll_readdir(i32* %0)
ret %struct.dirent* %2
}
/* Variables and functions */
size_t retro_serialize_size(void) { return 2; }


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

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

LLVM IR (-O0):
define i64 @retro_serialize_size() {
ret i64 2
}

LLVM IR (-O2):
define i64 @retro_serialize_size() {
ret i64 2
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int, int, int);
void C67_OR(int r, int v) { C67_asm("OR.L", v, r, v); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"OR.L\00"
define void @C67_OR(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t func16for(uint16_t x) {
  uint16_t n = 0;
  for (int i = 0; i < 16; i++) {
    if (x & 0x1) {
      n = (n << 1) | 0x01;
    } else {
      n = (n << 1);
    }
    x = x >> 1;
  }
  return n;
}


x86 assembly (clang, -O0):
<func16for>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    115f <func16for+0x5f>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113f <func16for+0x3f>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1148 <func16for+0x48>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <func16for+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func16for>:
rol    $0x8,%di
mov    %edi,%eax
and    $0xf0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x3333,%eax
shr    $0x2,%edi
and    $0x3333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
lea    (%rax,%rcx,2),%eax
ret

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

LLVM IR (-O2):
define i32 @func16for(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = call i16 @llvm.bitreverse.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ static_variable_func();
int main(void) {
  static_variable_func();
  static_variable_func();
  static_variable_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 <static_variable_func@plt>
mov    $0x0,%al
call   1030 <static_variable_func@plt>
mov    $0x0,%al
call   1030 <static_variable_func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @static_variable_func()
%2 = tail call i32 (...) @static_variable_func()
%3 = tail call i32 (...) @static_variable_func()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ mkstemp(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void get_temporary_filename(char *filen) {
  strcpy(filen, "/tmp/appmakechainXXXXXXXX");
  close(mkstemp(filen));
}


x86 assembly (clang, -O0):
<get_temporary_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
call   1050 <mkstemp@plt>
mov    %eax,%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_temporary_filename>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <mkstemp@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"/tmp/appmakechainXXXXXXXX\00"
define void @get_temporary_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @mkstemp(i8* %5)
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"/tmp/appmakechainXXXXXXXX\00"
define void @get_temporary_filename(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @mkstemp(i8* %0)
%4 = tail call i32 @close(i32 %3)
ret void
}
void modmodulate(void *state, unsigned int txdelay) {
  struct txstate *tx = (struct txstate *)state;
}


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

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

LLVM IR (-O0):
%struct.txstate = type opaque
define void @modmodulate(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.txstate*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.txstate*
store %struct.txstate* %7, %struct.txstate** %5
ret void
}

LLVM IR (-O2):
define void @modmodulate(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, void *);
int lisp_gettimeofday(struct timeval *tp, void *tzp) {
  return gettimeofday(tp, tzp);
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @lisp_gettimeofday(%struct.timeval* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @gettimeofday(%struct.timeval* %0, i8* %1)
ret i32 %3
}
long __fixunssfsi(float a) {
  if (a >= (float)32768L)
    return (long)(a - 32768L) + 32768L;
  return (long)a;
}


x86 assembly (clang, -O0):
<__fixunssfsi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     1144 <__fixunssfsi+0x44>
movss  -0xc(%rbp),%xmm0
movss  0xed4(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
add    $0x8000,%rax
mov    %rax,-0x8(%rbp)
jmp    114e <__fixunssfsi+0x4e>
cvttss2si -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fixunssfsi>:
movss  0xef8(%rip),%xmm1
addss  %xmm0,%xmm1
cvttss2si %xmm1,%rcx
add    $0x8000,%rcx
ucomiss 0xee5(%rip),%xmm0
cvttss2si %xmm0,%rax
cmovae %rcx,%rax
ret

LLVM IR (-O0):
define i64 @__fixunssfsi(float %0) {
%2 = alloca i64
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 3.276800e+04
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %3
%8 = fsub float %7, 3.276800e+04
%9 = fptosi float %8 to i64
%10 = add nsw i64 %9, 32768
store i64 %10, i64* %2
br label %14
11: ; preds = %1
%12 = load float, float* %3
%13 = fptosi float %12 to i64
store i64 %13, i64* %2
br label %14
14: ; preds = %11, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @__fixunssfsi(float %0) {
%2 = fcmp ult float %0, 3.276800e+04
%3 = fadd float %0, -3.276800e+04
%4 = fptosi float %3 to i64
%5 = add nsw i64 %4, 32768
%6 = fptosi float %0 to i64
%7 = select i1 %2, i64 %6, i64 %5
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pkt;

/* Variables and functions */
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int ret = 0;
  char *fifopath = "/tmp/metapipe";
  int fd = 0;
  char *pkt = "AAAAAA";
  fd = open(fifopath, O_WRONLY);
  write(fd, pkt, sizeof(pkt));
  close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <write@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xebf(%rip),%rsi
mov    %eax,%edi
mov    $0x8,%edx
call   1030 <write@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"/tmp/metapipe\00"
@.str.1 = [7 x i8] c"AAAAAA\00"
@O_WRONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
store i32 0, i32* %4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %3
%7 = load i32, i32* @O_WRONLY
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = call i32 @write(i32 %9, i8* %10, i32 8)
%12 = load i32, i32* %4
%13 = call i32 @close(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"/tmp/metapipe\00"
@.str.1 = [7 x i8] c"AAAAAA\00"
@O_WRONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_WRONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @write(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 8)
%4 = tail call i32 @close(i32 %2)
ret i32 0
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) * 67330564296145686UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      state[0UL] = state[local1] + state[0UL];
      local1++;
    }
    output[0UL] = (state[0UL] + 238420169UL) * 1151155071UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
movabs $0xef34ca9f65fb16,%rcx
imul   %rcx,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1160 <RandomFunc+0x60>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1133 <RandomFunc+0x33>
mov    -0x18(%rbp),%rax
add    $0xe3600c9,%rax
imul   $0x449d3b7f,%rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movabs $0xca70bb7e68f3a1ea,%rax
bb 70 ca
imul   (%rdi),%rax
movabs $0xe1b1e1b2dd03bb9b,%rcx
e1 b1 e1
add    %rax,%rcx
mov    %rcx,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, 914778474
%11 = mul i64 %10, 67330564296145686
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %6
br label %13
13: ; preds = %16, %2
%14 = load i64, i64* %6
%15 = icmp ult i64 %14, 0
br i1 %15, label %16, label %26
16: ; preds = %13
%17 = load i64, i64* %6
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %17
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = add i64 %19, %21
%23 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %22, i64* %23
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %6
br label %13
26: ; preds = %13
%27 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%28 = load i64, i64* %27
%29 = add i64 %28, 238420169
%30 = mul i64 %29, 1151155071
%31 = load i64*, i64** %4
%32 = getelementptr inbounds i64, i64* %31, i64 0
store i64 %30, i64* %32
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = mul i64 %3, -3859378729055444502
%5 = add i64 %4, -2183716185969542245
store i64 %5, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sink();
int /*<<< orphan*/ waitall();
int main(void) {
  sink();
  sink();
  sink();
  sink();
  waitall();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sink()
%3 = call i32 (...) @sink()
%4 = call i32 (...) @sink()
%5 = call i32 (...) @sink()
%6 = call i32 (...) @waitall()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sink()
%2 = tail call i32 (...) @sink()
%3 = tail call i32 (...) @sink()
%4 = tail call i32 (...) @sink()
%5 = tail call i32 (...) @waitall()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ crt_scroll_up();
void console_scroll_up() { crt_scroll_up(); }


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

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

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

LLVM IR (-O2):
define void @console_scroll_up() {
%1 = tail call i32 (...) @crt_scroll_up()
ret void
}
long long zzsz() { return 0x00000000ffff0000LL; }


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

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

LLVM IR (-O0):
define i64 @zzsz() {
ret i64 4294901760
}

LLVM IR (-O2):
define i64 @zzsz() {
ret i64 4294901760
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int readEventFromMessageQueue() {
  int num;
  printf("Enter DOWN(1), UP(2), INIT(3), TMR(4)\n");
  scanf("%d", &num);
  ;
  printf("You entered %d\n", num);
  return num;
}


x86 assembly (clang, -O0):
<readEventFromMessageQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readEventFromMessageQueue>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Enter DOWN(1), UP(2), INIT(3), TMR(4)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"You entered %d\0A\00"
define i32 @readEventFromMessageQueue() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [16 x i8] c"You entered %d\0A\00"
@str = [38 x i8] c"Enter DOWN(1), UP(2), INIT(3), TMR(4)\00"
define i32 @readEventFromMessageQueue() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
ret i32 %7
}
void scroll_back(void) {}


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

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

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

LLVM IR (-O2):
define void @scroll_back() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ puts(char *);
int main() {
  char str[50];
  memset(str, 'a', 10);
  str[10] = '\0';
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
movb   $0x0,-0x36(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x61,%esi
mov    $0xa,%edx
call   1040 <memset@plt>
movb   $0x0,0xa(%rsp)
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i8 signext 97, i32 10)
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 10
store i8 0, i8* %5
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [50 x i8]
%2 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 97, i32 10)
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 10
store i8 0, i8* %4
%5 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
double RAND_MAX;
double rand();
unsigned int ranged_urand(unsigned int low, unsigned int high) {
  return low + (rand() * (1.0 / (RAND_MAX + 1.0)) * (high - low));
}


x86 assembly (clang, -O0):
<ranged_urand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
movsd  -0x10(%rbp),%xmm1
mov    0x2eaa(%rip),%rax
movsd  (%rax),%xmm3
movsd  0xeb6(%rip),%xmm2
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    %ecx,%eax
cvtsi2sd %rax,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ranged_urand>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb7(%rip),%rax
movsd  0xec7(%rip),%xmm1
movsd  (%rax),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
sub    %ebp,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %rbx,%xmm0
mulsd  %xmm1,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @ranged_urand(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = uitofp i32 %5 to double
%7 = call double (...) @rand()
%8 = load double, double* @RAND_MAX
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
%11 = fmul double %7, %10
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub i32 %12, %13
%15 = uitofp i32 %14 to double
%16 = call double @llvm.fmuladd.f64(double %11, double %15, double %6)
%17 = fptoui double %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @ranged_urand(i32 %0, i32 %1) {
%3 = uitofp i32 %0 to double
%4 = tail call double (...) @rand()
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double 1.000000e+00, %6
%8 = fmul double %4, %7
%9 = sub i32 %1, %0
%10 = uitofp i32 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %8, double %10, double %3)
%12 = fptoui double %11 to i32
ret i32 %12
}
int *return_array() {
  int x[10] = {23, 4, 3, 1, 4, 5, 6, 2, 4, 3};
  int *p = x;
  return p;
}


x86 assembly (clang, -O0):
<return_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_array>:
lea    -0x28(%rsp),%rax
ret

LLVM IR (-O0):
@__const.return_array.x = [10 x i32] [i32 23, i32 4, i32 3, i32 1, i32 4, i32 5, i32 6, i32 2, i32 4, i32 3]
define i32* @return_array() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = bitcast [10 x i32]* %1 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
ret i32* %5
}

LLVM IR (-O2):
define noalias i32* @return_array() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, ...);
void printwc1(const char *filepath, size_t *cols) {
  if (filepath == NULL) {
    (void)printf("%d\n", cols[0]);
  } else {
    (void)printf("%d"
                 " "
                 "%s\n",
                 cols[0], filepath);
  }
}


x86 assembly (clang, -O0):
<printwc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <printwc1+0x35>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115e <printwc1+0x4e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rdx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printwc1>:
mov    (%rsi),%rsi
test   %rdi,%rdi
je     1129 <printwc1+0x19>
mov    %rdi,%rdx
lea    0xee2(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [7 x i8] c"%d %s\0A\00"
define void @printwc1(i8* %0, i64* nocapture %1) {
%3 = icmp eq i8* %0, null
%4 = load i64, i64* %1
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
br label %9
7: ; preds = %2
%8 = tail call i32 (i8*, i64, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 %4, i8* %0)
br label %9
9: ; preds = %7, %5
ret void
}
int pop(int *stack, int top, int *x) {
  if (top == -1)
    return top;
  *x = stack[top];
  return --top;
}


x86 assembly (clang, -O0):
<pop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1124 <pop+0x24>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <pop+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pop>:
cmp    $0xffffffff,%esi
je     1113 <pop+0x13>
mov    %esi,%eax
movslq %esi,%rcx
mov    (%rdi,%rcx,4),%ecx
mov    %ecx,(%rdx)
add    $0xffffffff,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @pop(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp eq i32 %1, -1
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
store i32 %8, i32* %2
%9 = add nsw i32 %1, -1
br label %10
10: ; preds = %3, %5
%11 = phi i32 [ %9, %5 ], [ -1, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printarr(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quick_Sort(int *, int /*<<< orphan*/, int);
int main() {
  int arr[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
  int n = 10;
  quick_Sort(arr, 0, n - 1);
  printf("Sorted array: n");
  printarr(arr, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0xa,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quick_Sort@plt>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1060 <printarr@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xee4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <quick_Sort@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1050 <printarr@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.arr = [10 x i32] [i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1]
@.str = [16 x i8] c"Sorted array: n\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @quick_Sort(i32* %3, i32 0, i32 9)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printarr(i32* %3, i32 10)
ret i32 0
}
int test_imm_D6int16_mem(short *val) {
  return ((*val) & (-0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xffffff2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D6int16_mem>:
movzwl (%rdi),%eax
test   $0xff2a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D6int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -214
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fun529() { return 529; }


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

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

LLVM IR (-O0):
define i32 @fun529() {
ret i32 529
}

LLVM IR (-O2):
define i32 @fun529() {
ret i32 529
}
void acc_parallel() {
  int i, j, k;
#pragma acc parallel num_gangs(i)
  ;
#pragma acc parallel num_workers(j)
  ;
#pragma acc parallel vector_length(k)
  ;
}


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

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

LLVM IR (-O0):
define void @acc_parallel() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ glRotatef(int /*<<< orphan*/, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ glTranslatef(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void PolarLookFrom(GLfloat dist, GLfloat elevation, GLfloat azimuth) {
  glTranslatef(0, 0, -dist);
  glRotatef(elevation, 1, 0, 0);
  glRotatef(azimuth, 0, 1, 0);
}


x86 assembly (clang, -O0):
<PolarLookFrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %edx,%edx
sub    -0x4(%rbp),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glTranslatef@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1040 <glRotatef@plt>
mov    -0xc(%rbp),%edi
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
call   1040 <glRotatef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PolarLookFrom>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%edx
neg    %edx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <glTranslatef@plt>
mov    %ebp,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <glRotatef@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <glRotatef@plt>

LLVM IR (-O0):
define void @PolarLookFrom(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 = sub nsw i32 0, %7
%9 = call i32 @glTranslatef(i32 0, i32 0, i32 %8)
%10 = load i32, i32* %5
%11 = call i32 @glRotatef(i32 %10, i32 1, i32 0, i32 0)
%12 = load i32, i32* %6
%13 = call i32 @glRotatef(i32 %12, i32 0, i32 1, i32 0)
ret void
}

LLVM IR (-O2):
define void @PolarLookFrom(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 0, %0
%5 = tail call i32 @glTranslatef(i32 0, i32 0, i32 %4)
%6 = tail call i32 @glRotatef(i32 %1, i32 1, i32 0, i32 0)
%7 = tail call i32 @glRotatef(i32 %2, i32 0, i32 1, i32 0)
ret void
}
float func1(float x) {
  float s;
  s = 1 + x;
  return s;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
addss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @func1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fadd float 1.000000e+00, %4
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @func1(float %0) {
%2 = fadd float %0, 1.000000e+00
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ logData();
int /*<<< orphan*/ readSensors(char *);
int main(int __attribute__((__unused__)) argc,
         char __attribute__((__unused__)) * argv[],
         char __attribute__((__unused__)) * envp[]) {
  readSensors("/sys/bus/w1/devices");
  logData();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xebf(%rip),%rdi
call   1040 <readSensors@plt>
mov    $0x0,%al
call   1030 <logData@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"/sys/bus/w1/devices\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @readSensors(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @logData()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"/sys/bus/w1/devices\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @readSensors(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @logData()
ret i32 0
}
unsigned int hash(char *str) {
  unsigned h = 0;
  while (*str)
    h = (h << 1) + *str++;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <hash+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <hash+0x22>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ count(int *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qsort(int *, int /*<<< orphan*/, int /*<<< orphan*/);
void sort_list(int list[]) {
  printf("Sorting the list...\n");
  qsort(list, 0, count(list));
}


x86 assembly (clang, -O0):
<sort_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <count@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1040 <qsort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_list>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <count@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
pop    %rbx
jmp    1050 <qsort@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Sorting the list...\0A\00"
define void @sort_list(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @count(i32* %5)
%7 = call i32 @qsort(i32* %4, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"Sorting the list...\00"
define void @sort_list(i32* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @count(i32* %0)
%4 = tail call i32 @qsort(i32* %0, i32 0, i32 %3)
ret void
}