xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *string_dup(const char *str) {
  size_t len = strlen(str) + 1;
  char *new_str = malloc(len * sizeof(char));
  if (new_str) {
    memcpy(new_str, str, len);
  }
  return new_str;
}


x86 assembly (clang, -O0):
<string_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117b <string_dup+0x4b>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <string_dup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @string_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 %9, 1
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %1
%15 = load i8*, i8** %4
%16 = load i8*, i8** %2
%17 = load i64, i64* %3
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
br label %19
19: ; preds = %14, %1
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @string_dup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void gtk_text_view_get_indent() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_indent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EnterRelocMode();
void DoReloc(void) { EnterRelocMode(); }


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

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

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

LLVM IR (-O2):
define void @DoReloc() {
%1 = tail call i32 (...) @EnterRelocMode()
ret void
}
/* Type definitions */
typedef int u_int8_t;
struct sockaddr_in6 {
  int dummy;
};
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 129
#define AF_INET6 128
u_int8_t sysdep_sa_len(const struct sockaddr *sa) {
  switch (sa->sa_family) {
  case AF_INET:
    return sizeof(struct sockaddr_in);
  case AF_INET6:
    return sizeof(struct sockaddr_in6);
  }
  return sizeof(struct sockaddr_in);
}


x86 assembly (clang, -O0):
<sysdep_sa_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x80,%eax
je     1140 <sysdep_sa_len+0x40>
jmp    1121 <sysdep_sa_len+0x21>
mov    -0x14(%rbp),%eax
sub    $0x81,%eax
jne    114c <sysdep_sa_len+0x4c>
jmp    1134 <sysdep_sa_len+0x34>
movl   $0x4,-0x4(%rbp)
jmp    1153 <sysdep_sa_len+0x53>
movl   $0x4,-0x4(%rbp)
jmp    1153 <sysdep_sa_len+0x53>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @sysdep_sa_len(%struct.sockaddr* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %9 [
i32 129, label %7
i32 128, label %8
]
7: ; preds = %1
store i32 4, i32* %2
br label %10
8: ; preds = %1
store i32 4, i32* %2
br label %10
9: ; preds = %1
store i32 4, i32* %2
br label %10
10: ; preds = %9, %8, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @sysdep_sa_len(%struct.sockaddr* nocapture %0) {
ret i32 4
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *path_getextension(const char *path) {
  const char *ptr = strrchr(path, '.');
  return ptr;
}


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

x86 assembly (clang, -O2):
<path_getextension>:
mov    $0x2e,%esi
jmp    1030 <strrchr@plt>

LLVM IR (-O0):
define i8* @path_getextension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @path_getextension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
ret i8* %2
}
/* Variables and functions */
int EOF;
int getch();
scalar_t__ isspace(unsigned char);
int /*<<< orphan*/ ungetch(int);
void skipblanks(void) {
  int c;
  while ((c = getch()) != EOF && isspace((unsigned char)c))
    ;
  ungetch(c);
}


x86 assembly (clang, -O0):
<skipblanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getch@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
mov    0x2e9b(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     116d <skipblanks+0x3d>
mov    -0x4(%rbp),%eax
movzbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    117d <skipblanks+0x4d>
jmp    1182 <skipblanks+0x52>
jmp    1138 <skipblanks+0x8>
mov    -0x4(%rbp),%edi
call   1040 <ungetch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipblanks>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getch@plt>
mov    %eax,%ebx
cmp    (%r14),%eax
je     115b <skipblanks+0x2b>
movzbl %bl,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <skipblanks+0x10>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ungetch@plt>

LLVM IR (-O0):
@EOF = global i32 0
define void @skipblanks() {
%1 = alloca i32
br label %2
2: ; preds = %13, %0
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* %1
%8 = trunc i32 %7 to i8
%9 = call i64 @isspace(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %6, %2
%12 = phi i1 [ false, %2 ], [ %10, %6 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %2
14: ; preds = %11
%15 = load i32, i32* %1
%16 = call i32 @ungetch(i32 %15)
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skipblanks() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getch()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = trunc i32 %2 to i8
%7 = tail call i64 @isspace(i8 zeroext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %1
9: ; preds = %1, %5
%10 = tail call i32 @ungetch(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 7, 5);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0x5,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x7,%ecx
mov    $0x5,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 5)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 7, i32 5)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}
/* Type definitions */
struct memkind {
  int dummy;
};

/* Variables and functions */
int MAP_ANONYMOUS;
int MAP_PRIVATE;
int memkind_hugetlb_get_mmap_flags(struct memkind *kind, int *flags) {
  *flags = MAP_PRIVATE | MAP_ANONYMOUS | 0x40000 | (21 << 26);
  return 0;
}


x86 assembly (clang, -O0):
<memkind_hugetlb_get_mmap_flags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ecc(%rip),%rax
or     (%rax),%ecx
or     $0x40000,%ecx
or     $0x54000000,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memkind_hugetlb_get_mmap_flags>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed8(%rip),%rcx
or     (%rcx),%eax
or     $0x54040000,%eax
mov    %eax,(%rsi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.memkind = type { i32 }
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
define i32 @memkind_hugetlb_get_mmap_flags(%struct.memkind* %0, i32* %1) {
%3 = alloca %struct.memkind*
%4 = alloca i32*
store %struct.memkind* %0, %struct.memkind** %3
store i32* %1, i32** %4
%5 = load i32, i32* @MAP_PRIVATE
%6 = load i32, i32* @MAP_ANONYMOUS
%7 = or i32 %5, %6
%8 = or i32 %7, 262144
%9 = or i32 %8, 1409286144
%10 = load i32*, i32** %4
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.memkind = type { i32 }
@MAP_PRIVATE = global i32 0
@MAP_ANONYMOUS = global i32 0
define i32 @memkind_hugetlb_get_mmap_flags(%struct.memkind* nocapture readnone %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* @MAP_PRIVATE
%4 = load i32, i32* @MAP_ANONYMOUS
%5 = or i32 %3, %4
%6 = or i32 %5, 1409548288
store i32 %6, i32* %1
ret i32 0
}
char *concatenate(string1, string2)
char *string1, *string2;
{
  char *new_string = check_malloc(strlen(string1) + strlen(string2) + 1);
  strcpy(new_string, string1);
  strcat(new_string, string2);
  return (new_string);
}


x86 assembly (clang, -O0):
<concatenate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1050 <check_malloc@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<concatenate>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
xor    %eax,%eax
call   1050 <check_malloc@plt>
movslq %eax,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
define i8* @concatenate(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 1
%12 = call i32 (i64, ...) bitcast (i32 (...)* @check_malloc to i32 (i64, ...)*)(i64 %11)
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = call i8* @strcpy(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %4
%20 = call i8* @strcat(i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
define i8* @concatenate(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i32 (i64, ...) bitcast (i32 (...)* @check_malloc to i32 (i64, ...)*)(i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i8* @strcpy(i8* dereferenceable(1) %9, i8* dereferenceable(1) %0)
%11 = tail call i8* @strcat(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
ret i8* %9
}
int request_module_nowait(const char *name, ...) { return -38; }


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

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

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

LLVM IR (-O2):
define i32 @request_module_nowait(i8* nocapture readnone %0, ...) {
ret i32 -38
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
float vec3_length(float *);
__attribute__((always_)) float psvec3_length(struct vec3 *a) {
  return vec3_length((float *)a);
}


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

x86 assembly (clang, -O2):
<psvec3_length>:
jmp    1030 <vec3_length@plt>

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define float @psvec3_length(%struct.vec3* %0) {
%2 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %2
%3 = load %struct.vec3*, %struct.vec3** %2
%4 = bitcast %struct.vec3* %3 to float*
%5 = call float @vec3_length(float* %4)
ret float %5
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define float @psvec3_length(%struct.vec3* %0) {
%2 = bitcast %struct.vec3* %0 to float*
%3 = tail call float @vec3_length(float* %2)
ret float %3
}
long long suus() { return 0xffff7fff7fffffffLL; }


x86 assembly (clang, -O0):
<suus>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fff7fffffff,%rax
7f ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<suus>:
movabs $0xffff7fff7fffffff,%rax
7f ff ff
ret

LLVM IR (-O0):
define i64 @suus() {
ret i64 -140739635838977
}

LLVM IR (-O2):
define i64 @suus() {
ret i64 -140739635838977
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t hash_str_hash(void *v) {
  uint32_t hash = 5381;
  const char *text = v;
  for (; *text; text++) {
    hash *= 33;
    hash += *text;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_str_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <hash_str_hash+0x49>
imul   $0x21,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hash_str_hash+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_str_hash+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_str_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 i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = mul nsw i32 %7, 33
%9 = sext i8 %5 to i32
%10 = add nsw i32 %8, %9
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ test_example_case();
int main(int argc, char **argv) {
  test_example_case();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_example_case()
ret i32 0
}
void memcpy_2(char *source, char *target) {
  while (*source != '\0') {
    *target++ = *source++;
  }
}


x86 assembly (clang, -O0):
<memcpy_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <memcpy_2+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <memcpy_2+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_2>:
mov    (%rdi),%al
test   %al,%al
je     1120 <memcpy_2+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rsi,%rcx,1)
movzbl 0x1(%rdi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <memcpy_2+0x10>
ret

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

LLVM IR (-O2):
define void @memcpy_2(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int read(int const, scalar_t__ *, int);
bool read_int(const int fd, int32_t *value, int *bytes_read) {
  *bytes_read = read(fd, value, 4);
  if (*bytes_read != 4 || *value < 0) {
    *value = 0;
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
cmpl   $0x4,(%rax)
jne    1157 <read_int+0x47>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jge    116e <read_int+0x5e>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1175 <read_int+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    $0x4,%edx
call   1030 <read@plt>
mov    %eax,(%r14)
cmp    $0x4,%eax
jne    1137 <read_int+0x27>
mov    $0x1,%eax
cmpq   $0x0,(%rbx)
jns    1140 <read_int+0x30>
movq   $0x0,(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @read_int(i32 %0, i64* nocapture %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @read(i32 %0, i64* %1, i32 4)
store i32 %4, i32* %2
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i64, i64* %1
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6, %3
store i64 0, i64* %1
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ draw_message();
int /*<<< orphan*/ draw_particles();
int /*<<< orphan*/ refresh();
void draw_frame() {
  clear_screen();
  draw_particles();
  draw_message();
  refresh();
}


x86 assembly (clang, -O0):
<draw_frame>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <clear_screen@plt>
mov    $0x0,%al
call   1030 <draw_particles@plt>
mov    $0x0,%al
call   1060 <draw_message@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_frame>:
push   %rax
xor    %eax,%eax
call   1050 <clear_screen@plt>
xor    %eax,%eax
call   1030 <draw_particles@plt>
xor    %eax,%eax
call   1060 <draw_message@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
define void @draw_frame() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 (...) @draw_particles()
%3 = call i32 (...) @draw_message()
%4 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
define void @draw_frame() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 (...) @draw_particles()
%3 = tail call i32 (...) @draw_message()
%4 = tail call i32 (...) @refresh()
ret void
}
unsigned int f(unsigned int b, unsigned int c) {
  unsigned int a = (b >> 16) * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x10,%eax
mov    -0xc(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1132 <f+0x32>
movl   $0xa,-0x4(%rbp)
jmp    1138 <f+0x38>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
shr    $0x10,%edi
shr    $0x10,%esi
imul   %edi,%esi
test   %esi,%esi
mov    $0xa,%eax
cmovne %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 16
%9 = load i32, i32* %5
%10 = lshr i32 %9, 16
%11 = mul i32 %8, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %2
store i32 10, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = lshr i32 %0, 16
%4 = lshr i32 %1, 16
%5 = mul nuw i32 %4, %3
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 10, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foo();
int main() {
  foo();
  bar();
  baz();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @baz()
ret i32 0
}
void foo285(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo285(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ char_freq(char *);
int main(void) {
  char_freq("-");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
define i32 @main() {
%1 = tail call i32 @char_freq(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzUnaryFunc_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_ACKUP(int);
void BrzUnaryFuncPush_ackup(struct comp *comp, int port) {
  struct BrzUnaryFunc_ *c = (struct BrzUnaryFunc_ *)comp;
  SEND_ACKUP(1);
}


x86 assembly (clang, -O0):
<BrzUnaryFuncPush_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <SEND_ACKUP@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzUnaryFuncPush_ackup>:
mov    $0x1,%edi
jmp    1030 <SEND_ACKUP@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzUnaryFunc_ = type { i32 }
define void @BrzUnaryFuncPush_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzUnaryFunc_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzUnaryFunc_*
store %struct.BrzUnaryFunc_* %7, %struct.BrzUnaryFunc_** %5
%8 = call i32 @SEND_ACKUP(i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzUnaryFuncPush_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_ACKUP(i32 1)
ret void
}
int cycle_is_update_rc(unsigned int flags) {
  return (flags & 0x00800000) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cycle_is_update_rc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x800000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_is_update_rc>:
mov    %edi,%eax
shr    $0x17,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @cycle_is_update_rc(i32 %0) {
%2 = lshr i32 %0, 23
%3 = and i32 %2, 1
ret i32 %3
}
void gtk_clipboard_request_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_request_image() {
ret void
}
int __nv_popcll(long long a) {
  int i = 0;
  int count = 0;
  while (i < 64) {
    if (a & (1ull << i))
      count++;
    i++;
  }
  return count;
}


x86 assembly (clang, -O0):
<__nv_popcll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0xc(%rbp)
jge    1156 <__nv_popcll+0x56>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1148 <__nv_popcll+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <__nv_popcll+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__nv_popcll>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
bt     %rcx,%rdi
adc    $0x0,%eax
lea    0x1(%rcx),%edx
movzbl %dl,%edx
bt     %rdx,%rdi
adc    $0x0,%eax
lea    0x2(%rcx),%edx
movzbl %dl,%edx
bt     %rdx,%rdi
adc    $0x0,%eax
lea    0x3(%rcx),%edx
movzbl %dl,%edx
bt     %rdx,%rdi
adc    $0x0,%eax
add    $0x4,%rcx
cmp    $0x40,%rcx
jne    1110 <__nv_popcll+0x10>
ret

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

LLVM IR (-O2):
define i32 @__nv_popcll(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %28, %2 ]
%4 = phi i32 [ 0, %1 ], [ %27, %2 ]
%5 = shl nuw i64 1, %3
%6 = and i64 %5, %0
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = or i64 %3, 1
%11 = shl nuw i64 1, %10
%12 = and i64 %11, %0
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %9, %14
%16 = or i64 %3, 2
%17 = shl nuw i64 1, %16
%18 = and i64 %17, %0
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
%21 = add nuw nsw i32 %15, %20
%22 = or i64 %3, 3
%23 = shl nuw i64 1, %22
%24 = and i64 %23, %0
%25 = icmp ne i64 %24, 0
%26 = zext i1 %25 to i32
%27 = add nuw nsw i32 %21, %26
%28 = add nuw nsw i64 %3, 4
%29 = icmp eq i64 %28, 64
br i1 %29, label %30, label %2
30: ; preds = %2
ret i32 %27
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int pthread_self();
void thr_print(const char *s) {
  printf("hey I'm %s thread, my tid is [%d].\n", s, pthread_self());
}


x86 assembly (clang, -O0):
<thr_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thr_print>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"hey I'm %s thread, my tid is [%d].\0A\00"
define void @thr_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"hey I'm %s thread, my tid is [%d].\0A\00"
define void @thr_print(i8* %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
unsigned int foo(unsigned int a, unsigned int b, unsigned int c,
                 unsigned int d) {
  unsigned int e = a + 3;
  unsigned int f = c + 5;
  unsigned int g = e + f;
  return g;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdx,1),%eax
add    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add i32 %0, 8
%6 = add i32 %5, %2
ret i32 %6
}
/* Variables and functions */
float add1(float);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float n;
  float result;
  scanf("%d", &n);
  result = add1(n);
  printf("Sum = %ld\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
call   1040 <add1@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1040 <add1@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = call float @add1(float %5)
store float %6, float* %3
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"Sum = %ld\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = call float @add1(float %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), float %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ setgid(int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
int srv_unixid_become(uid_t uid, gid_t gid) {
  (void)setuid(uid);
  (void)setgid(gid);
  return 0;
}


x86 assembly (clang, -O0):
<srv_unixid_become>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <setuid@plt>
mov    -0x8(%rbp),%edi
call   1030 <setgid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srv_unixid_become>:
push   %rbx
mov    %esi,%ebx
call   1040 <setuid@plt>
mov    %ebx,%edi
call   1030 <setgid@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @srv_unixid_become(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 = call i32 @setuid(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @setgid(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @srv_unixid_become(i32 %0, i32 %1) {
%3 = tail call i32 @setuid(i32 %0)
%4 = tail call i32 @setgid(i32 %1)
ret i32 0
}
OP(ed, e0) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t roundUp4(uint32_t input) { return (input + 3) & 0xFFFFFFFCu; }


x86 assembly (clang, -O0):
<roundUp4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
and    $0xfffffffc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundUp4>:
lea    0x3(%rdi),%eax
and    $0xfffffffc,%eax
ret

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

LLVM IR (-O2):
define i32 @roundUp4(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = and i32 %2, -4
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ init_data_blocks();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ run_basic_tests_a();
int /*<<< orphan*/ run_basic_tests_b();
int /*<<< orphan*/ run_basic_tests_c();
int /*<<< orphan*/ run_basic_tests_d();
void run_tests() {
  init_data_blocks();
  run_basic_tests_a();
  run_basic_tests_b();
  run_basic_tests_c();
  run_basic_tests_d();
  puts("TESTS COMPLETE");
}


x86 assembly (clang, -O0):
<run_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <init_data_blocks@plt>
mov    $0x0,%al
call   1080 <run_basic_tests_a@plt>
mov    $0x0,%al
call   1050 <run_basic_tests_b@plt>
mov    $0x0,%al
call   1070 <run_basic_tests_c@plt>
mov    $0x0,%al
call   1040 <run_basic_tests_d@plt>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests>:
push   %rax
xor    %eax,%eax
call   1060 <init_data_blocks@plt>
xor    %eax,%eax
call   1080 <run_basic_tests_a@plt>
xor    %eax,%eax
call   1050 <run_basic_tests_b@plt>
xor    %eax,%eax
call   1070 <run_basic_tests_c@plt>
xor    %eax,%eax
call   1040 <run_basic_tests_d@plt>
lea    0xe75(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"TESTS COMPLETE\00"
define void @run_tests() {
%1 = call i32 (...) @init_data_blocks()
%2 = call i32 (...) @run_basic_tests_a()
%3 = call i32 (...) @run_basic_tests_b()
%4 = call i32 (...) @run_basic_tests_c()
%5 = call i32 (...) @run_basic_tests_d()
%6 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"TESTS COMPLETE\00"
define void @run_tests() {
%1 = tail call i32 (...) @init_data_blocks()
%2 = tail call i32 (...) @run_basic_tests_a()
%3 = tail call i32 (...) @run_basic_tests_b()
%4 = tail call i32 (...) @run_basic_tests_c()
%5 = tail call i32 (...) @run_basic_tests_d()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_dec_locator_events(char const *, int,
                                           int /*<<< orphan*/);
int test_dec_locator_event(const char *the_title) {
  show_dec_locator_events(the_title, 2, (0));
  return 1;
}


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

x86 assembly (clang, -O2):
<test_dec_locator_event>:
push   %rax
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <show_dec_locator_events@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_dec_locator_event(i8* %0) {
%2 = tail call i32 @show_dec_locator_events(i8* %0, i32 2, i32 0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort_report(char *, ...);
scalar_t__ close(int);
void fifo_close(int fd) {
  if ((close(fd)) < 0)
    (1 == 1) ? abort_report("daemon: Could not close fifo", "")
             : abort_report("daemon: Could not close fifo");
}


x86 assembly (clang, -O0):
<fifo_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
jge    1152 <fifo_close+0x32>
lea    0xebc(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x0,%al
call   1030 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_close>:
push   %rax
call   1040 <close@plt>
test   %rax,%rax
js     112d <fifo_close+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
lea    0xee1(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1030 <abort_report@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"daemon: Could not close fifo\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @close(i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"daemon: Could not close fifo\00"
@.str.1 = [1 x i8] zeroinitializer
define void @fifo_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ access(char const *, int /*<<< orphan*/);
int mc_path_exist(const char *filename) { return 0 == access(filename, 0); }


x86 assembly (clang, -O0):
<mc_path_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_path_exist>:
push   %rax
xor    %esi,%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mc_path_exist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @access(i8* %3, i32 0)
%5 = icmp eq i64 0, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @mc_path_exist(i8* nocapture %0) {
%2 = tail call i64 @access(i8* %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int report(char *);
int /*<<< orphan*/ test_basic();
int run_tests() {
  test_basic();
  return report("Run");
}


x86 assembly (clang, -O0):
<run_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_basic@plt>
lea    0xece(%rip),%rdi
call   1030 <report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_tests>:
push   %rax
xor    %eax,%eax
call   1040 <test_basic@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <report@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"Run\00"
define i32 @run_tests() {
%1 = call i32 (...) @test_basic()
%2 = call i32 @report(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"Run\00"
define i32 @run_tests() {
%1 = tail call i32 (...) @test_basic()
%2 = tail call i32 @report(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ getstr(char **, size_t *, int /*<<< orphan*/ *, char,
                          int /*<<< orphan*/);
ssize_t getline(char **lineptr, size_t *n, FILE *stream) {
  return getstr(lineptr, n, stream, '\n', 0);
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xa,%ecx
xor    %r8d,%r8d
call   1030 <getstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
mov    $0xa,%ecx
xor    %r8d,%r8d
jmp    1030 <getstr@plt>

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

LLVM IR (-O2):
define i32 @getline(i8** %0, i64* %1, i32* %2) {
%4 = tail call i32 @getstr(i8** %0, i64* %1, i32* %2, i8 signext 10, i32 0)
ret i32 %4
}