xunge/DecIR huggingface dataset:
/* Variables and functions */
int min2elem(int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x[8] = {10, 7, 4, 12, 9, 5, 13, 8};
  printf("Min2 = %d\n", min2elem(8, x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rsi
mov    $0x8,%edi
call   1040 <min2elem@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@__const.main.x = [8 x i32] [i32 10, i32 7, i32 4, i32 12, i32 9, i32 5, i32 13, i32 8]
@.str = [11 x i8] c"Min2 = %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @min2elem(i32 8, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ta_oom_b(int /*<<< orphan*/);
int /*<<< orphan*/ ta_strdup_append_buffer(char **, char const *);
char *ta_talloc_strdup_append_buffer(char *s, const char *a) {
  ta_oom_b(ta_strdup_append_buffer(&s, a));
  return s;
}


x86 assembly (clang, -O0):
<ta_talloc_strdup_append_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1040 <ta_strdup_append_buffer@plt>
mov    %eax,%edi
call   1030 <ta_oom_b@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ta_talloc_strdup_append_buffer>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1040 <ta_strdup_append_buffer@plt>
mov    %eax,%edi
call   1030 <ta_oom_b@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @ta_talloc_strdup_append_buffer(i8* %0, i8* %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @ta_strdup_append_buffer(i8** %3, i8* %1)
%5 = call i32 @ta_oom_b(i32 %4)
%6 = load i8*, i8** %3
ret i8* %6
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *, int);
int main() {
  char s[1000];
  char t[1000];
  int k, len;
  while ((len = getline(s, 1000)) > 0) {
    if (len >= 1) {
      reverse(s, len);
    }
  }
  printf("%s", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
mov    %eax,-0x7e8(%rbp)
cmp    $0x0,%eax
jle    1186 <main+0x56>
cmpl   $0x1,-0x7e8(%rbp)
jl     1181 <main+0x51>
lea    -0x3f0(%rbp),%rdi
mov    -0x7e8(%rbp),%esi
call   1030 <reverse@plt>
jmp    1142 <main+0x12>
lea    -0x3f0(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jle    116b <main+0x3b>
mov    %rsp,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <reverse@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getline@plt>
test   %eax,%eax
jg     1150 <main+0x20>
lea    0xe8e(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %3, %0 ]
%7 = call i32 @reverse(i8* %2, i32 %6)
%8 = call i32 @getline(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_fcollect32(void *target, const void *source, size_t nlong,
                             int PE_start, int logPE_stride, int PE_size,
                             long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_fcollect32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_fcollect32(i8* %0, i8* %1, i64 %2, i32 %3, i32 %4, i32 %5, i64* %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i64*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i64 %2, i64* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i64* %6, i64** %14
%15 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_fcollect32(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3, i32 %4, i32 %5, i64* nocapture readnone %6) {
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int f() {
  struct {
    int i;
  } s, *sp;
  int *ip = &s.i;
  s.i = 1;
  sp = self(&s);
  *ip = 0;
  return sp->i + 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <self@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movl   $0x1,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <self@plt>
cltq
movl   $0x0,(%rsp)
mov    (%rax),%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @f() {
%1 = alloca %struct.anon
%2 = alloca %struct.anon*
%3 = alloca i32*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32* %4, i32** %3
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i32 0, i32 0
store i32 1, i32* %5
%6 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @self to i32 (%struct.anon*, ...)*)(%struct.anon* %1)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.anon*
store %struct.anon* %8, %struct.anon** %2
%9 = load i32*, i32** %3
store i32 0, i32* %9
%10 = load %struct.anon*, %struct.anon** %2
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
ret i32 %13
}

LLVM IR (-O2):
%struct.anon = type { i32 }
define i32 @f() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 0
store i32 1, i32* %3
%4 = call i32 (%struct.anon*, ...) bitcast (i32 (...)* @self to i32 (%struct.anon*, ...)*)(%struct.anon* %1)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.anon*
store i32 0, i32* %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ stb_free(void *);
void stbi_image_free(void *retval_from_stbi_load) {
  stb_free(retval_from_stbi_load);
}


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

x86 assembly (clang, -O2):
<stbi_image_free>:
jmp    1030 <stb_free@plt>

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

LLVM IR (-O2):
define void @stbi_image_free(i8* %0) {
%2 = tail call i32 @stb_free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_PRINTABLESTRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_PRINTABLESTRING_it;
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
ASN1_PRINTABLESTRING *ASN1_PRINTABLESTRING_new(void) {
  return (ASN1_PRINTABLESTRING *)ASN1_item_new(&ASN1_PRINTABLESTRING_it);
}


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

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

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

LLVM IR (-O2):
@ASN1_PRINTABLESTRING_it = global i32 0
define i32* @ASN1_PRINTABLESTRING_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ASN1_PRINTABLESTRING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int intcmp(int const, int const);
int intpcmp(const void *a, const void *b) {
  return intcmp(*(const int *)a, *(const int *)b);
}


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

x86 assembly (clang, -O2):
<intpcmp>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <intcmp@plt>

LLVM IR (-O0):
define i32 @intpcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @intcmp(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @intpcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @intcmp(i32 %4, i32 %6)
ret i32 %7
}
int mintaka_get_state_() { return mintaka_get_state_(); }


x86 assembly (clang, -O0):
<mintaka_get_state_>:
push   %rbp
mov    %rsp,%rbp
call   1030 <mintaka_get_state_@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mintaka_get_state_() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *);
char *get_app_log_directory(const char *log_root, const char *app_id) {
  return concatenate("%s/%s", "app log dir", 2, log_root, app_id);
}


x86 assembly (clang, -O0):
<get_app_log_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x2,%edx
call   1030 <concatenate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_app_log_directory>:
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
lea    0xee2(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <concatenate@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [12 x i8] c"app log dir\00"
define i8* @get_app_log_directory(i8* %0, i8* %1) {
%3 = tail call i8* @concatenate(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_25519_from_bytes(uintptr_t, uintptr_t);
void fiat_25519_from_bytes(uint32_t out1[10], const uint8_t arg1[32]) {
  internal_fiat_25519_from_bytes((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_25519_from_bytes>:
jmp    1030 <internal_fiat_25519_from_bytes@plt>

LLVM IR (-O0):
define void @fiat_25519_from_bytes(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 = ptrtoint i32* %5 to i64
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = call i32 @internal_fiat_25519_from_bytes(i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
define void @fiat_25519_from_bytes(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_25519_from_bytes(i64 %3, i64 %4)
ret void
}
/* Variables and functions */
size_t freelist_index(size_t bytes) { return ((bytes + 8 - 1) / 8 - 1); }


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

x86 assembly (clang, -O2):
<freelist_index>:
lea    0x7(%rdi),%rax
shr    $0x3,%rax
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @freelist_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = sub i64 %4, 1
%6 = udiv i64 %5, 8
%7 = sub i64 %6, 1
ret i64 %7
}

LLVM IR (-O2):
define i64 @freelist_index(i64 %0) {
%2 = add i64 %0, 7
%3 = lshr i64 %2, 3
%4 = add nsw i64 %3, -1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int);
int main(int argc, char *argv[]) {
  test(0, 0);
  test(-1, 0);
  test(0, -1);
  test(-1, -1);
  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)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <test@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <test@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <test@plt>
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1030 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <test@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <test@plt>
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <test@plt>
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
call   1030 <test@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(i32 0, i32 0)
%7 = call i32 @test(i32 -1, i32 0)
%8 = call i32 @test(i32 0, i32 -1)
%9 = call i32 @test(i32 -1, i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test(i32 0, i32 0)
%4 = tail call i32 @test(i32 -1, i32 0)
%5 = tail call i32 @test(i32 0, i32 -1)
%6 = tail call i32 @test(i32 -1, i32 -1)
ret i32 0
}
unsigned char verifySum(unsigned short sum) {
  unsigned short all = 0, i = 1;
  for (; i < 0xf; i++) {
    all = i * 0x100 + 0xff;
    if (sum == all)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<verifySum>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movw   $0x1,-0x8(%rbp)
movzwl -0x8(%rbp),%eax
cmp    $0xf,%eax
jge    1163 <verifySum+0x63>
movzwl -0x8(%rbp),%eax
shl    $0x8,%eax
add    $0xff,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
movzwl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jne    114d <verifySum+0x4d>
movb   $0x1,-0x1(%rbp)
jmp    1167 <verifySum+0x67>
jmp    1152 <verifySum+0x52>
mov    -0x8(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x8(%rbp)
jmp    1117 <verifySum+0x17>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifySum>:
add    $0xfffffe01,%edi
rol    $0x8,%di
cmp    $0xe,%di
setb   %al
ret

LLVM IR (-O0):
define zeroext i8 @verifySum(i16 zeroext %0) {
%2 = alloca i8
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 0, i16* %4
store i16 1, i16* %5
br label %6
6: ; preds = %23, %1
%7 = load i16, i16* %5
%8 = zext i16 %7 to i32
%9 = icmp slt i32 %8, 15
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = load i16, i16* %5
%12 = zext i16 %11 to i32
%13 = mul nsw i32 %12, 256
%14 = add nsw i32 %13, 255
%15 = trunc i32 %14 to i16
store i16 %15, i16* %4
%16 = load i16, i16* %3
%17 = zext i16 %16 to i32
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = icmp eq i32 %17, %19
br i1 %20, label %21, label %22
21: ; preds = %10
store i8 1, i8* %2
br label %27
22: ; preds = %10
br label %23
23: ; preds = %22
%24 = load i16, i16* %5
%25 = add i16 %24, 1
store i16 %25, i16* %5
br label %6
26: ; preds = %6
store i8 0, i8* %2
br label %27
27: ; preds = %26, %21
%28 = load i8, i8* %2
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @verifySum(i16 zeroext %0) {
%2 = add i16 %0, -511
%3 = call i16 @llvm.bswap.i16(i16 %2)
%4 = icmp ult i16 %3, 14
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t osmo_revbytebits_32(uint32_t x) {
  x = (x & 0x55555555) << 1 | (x & 0xAAAAAAAA) >> 1;
  x = (x & 0x33333333) << 2 | (x & 0xCCCCCCCC) >> 2;
  x = (x & 0x0F0F0F0F) << 4 | (x & 0xF0F0F0F0) >> 4;
  return x;
}


x86 assembly (clang, -O0):
<osmo_revbytebits_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0xaaaaaaaa,%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0xcccccccc,%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<osmo_revbytebits_32>:
mov    %edi,%eax
and    $0xd5555555,%eax
shr    %edi
and    $0x55555555,%edi
lea    (%rdi,%rax,2),%eax
mov    %eax,%ecx
and    $0xf3333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
lea    (%rax,%rcx,4),%eax
mov    %eax,%ecx
shl    $0x4,%ecx
and    $0xf0f0f0f0,%ecx
shr    $0x4,%eax
and    $0xf0f0f0f,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @osmo_revbytebits_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = shl i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, -1431655766
%8 = lshr i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 858993459
%12 = shl i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, -858993460
%15 = lshr i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, 252645135
%19 = shl i32 %18, 4
%20 = load i32, i32* %2
%21 = and i32 %20, -252645136
%22 = lshr i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @osmo_revbytebits_32(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, -1431655766
%4 = lshr i32 %0, 1
%5 = and i32 %4, 1431655765
%6 = or i32 %3, %5
%7 = shl i32 %6, 2
%8 = and i32 %7, -858993460
%9 = lshr i32 %6, 2
%10 = and i32 %9, 858993459
%11 = or i32 %8, %10
%12 = shl i32 %11, 4
%13 = and i32 %12, -252645136
%14 = lshr i32 %11, 4
%15 = and i32 %14, 252645135
%16 = or i32 %13, %15
ret i32 %16
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int gettimeofday(struct timeval *tv, void *tzvp) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<gettimeofday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimeofday>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @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 i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @gettimeofday(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
void foo091() {}


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

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

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

LLVM IR (-O2):
define void @foo091() {
ret void
}
/* Type definitions */
struct timex {
  long tick;
};

/* Variables and functions */
long getter_tick(const struct timex *txc) { return txc->tick; }


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

x86 assembly (clang, -O2):
<getter_tick>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timex = type { i64 }
define i64 @getter_tick(%struct.timex* %0) {
%2 = alloca %struct.timex*
store %struct.timex* %0, %struct.timex** %2
%3 = load %struct.timex*, %struct.timex** %2
%4 = getelementptr inbounds %struct.timex, %struct.timex* %3, i32 0, i32 0
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
%struct.timex = type { i64 }
define i64 @getter_tick(%struct.timex* nocapture %0) {
%2 = getelementptr inbounds %struct.timex, %struct.timex* %0, i64 0, i32 0
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
scalar_t__ rand();
size_t randomize_buffer(char *, size_t);
size_t randomize(char *buffer, size_t len) {
  size_t no_chars = ((size_t)rand() % (len / 2)) + (len / 4);
  return randomize_buffer(buffer, no_chars);
}


x86 assembly (clang, -O0):
<randomize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x10(%rbp),%rcx
shr    $0x1,%rcx
xor    %edx,%edx
div    %rcx
mov    -0x10(%rbp),%rax
shr    $0x2,%rax
add    %rax,%rdx
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <randomize_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <rand@plt>
mov    %rbx,%rcx
shr    %rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     114a <randomize+0x2a>
xor    %edx,%edx
div    %rcx
jmp    114e <randomize+0x2e>
xor    %edx,%edx
div    %ecx
shr    $0x2,%rbx
add    %rdx,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <randomize_buffer@plt>

LLVM IR (-O0):
define i64 @randomize(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i64 (...) @rand()
%7 = load i64, i64* %4
%8 = udiv i64 %7, 2
%9 = urem i64 %6, %8
%10 = load i64, i64* %4
%11 = udiv i64 %10, 4
%12 = add i64 %9, %11
store i64 %12, i64* %5
%13 = load i8*, i8** %3
%14 = load i64, i64* %5
%15 = call i64 @randomize_buffer(i8* %13, i64 %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @randomize(i8* %0, i64 %1) {
%3 = tail call i64 (...) @rand()
%4 = lshr i64 %1, 1
%5 = urem i64 %3, %4
%6 = lshr i64 %1, 2
%7 = add nuw i64 %5, %6
%8 = tail call i64 @randomize_buffer(i8* %0, i64 %7)
ret i64 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ ascent;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
int get_XFontStruct_ascent(void *_p) {
  return (int)((XFontStruct *)_p)->ascent;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XFontStruct_ascent(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int fibo_r(int n) {
  if (n < 2)
    return n;
  else
    return (fibo_r(n - 1) + fibo_r(n - 2));
}


x86 assembly (clang, -O0):
<fibo_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1130 <fibo_r+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fibo_r+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fibo_r@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fibo_r@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo_r>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fibo_r+0x10>
mov    %ebx,%ecx
jmp    1144 <fibo_r+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fibo_r@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fibo_r+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fibo_r(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fibo_r(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ %8, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) { fputs("usage: kill [-SIG] PID\n", stderr); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"usage: kill [-SIG] PID\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"usage: kill [-SIG] PID\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t make_ip(uint8_t a, uint8_t b, uint8_t c, uint8_t d) {
  return (a << 24) | (b << 16) | (c << 8) | d;
}


x86 assembly (clang, -O0):
<make_ip>:
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
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_ip>:
mov    %edx,%eax
shl    $0x18,%edi
shl    $0x10,%esi
or     %edi,%esi
shl    $0x8,%eax
or     %ecx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @make_ip(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = or i32 %6, %5
%8 = shl i32 %2, 8
%9 = or i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Type definitions */
typedef int uint_fast16_t;

/* Variables and functions */
uint_fast16_t grad_to_dnt(float grad) {
  return (uint_fast16_t)grad / (360 / 300);
}


x86 assembly (clang, -O0):
<grad_to_dnt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    $0x1,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<grad_to_dnt>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @grad_to_dnt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sdiv i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @grad_to_dnt(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int read(int *ip) {
  scanf("&d", ip);
  return *ip;
}


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

x86 assembly (clang, -O2):
<read>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"&d\00"
define i32 @read(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = load i32, i32* %0
ret i32 %3
}
/* Type definitions */
struct tms {
  int dummy;
};

/* Variables and functions */
struct tms *malloc(int);
struct tms *new_tms() {
  return malloc(sizeof(struct tms));
}


x86 assembly (clang, -O0):
<new_tms>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_tms>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
%struct.tms = type { i32 }
define %struct.tms* @new_tms() {
%1 = call %struct.tms* @malloc(i32 4)
ret %struct.tms* %1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define noalias %struct.tms* @new_tms() {
%1 = tail call %struct.tms* @malloc(i32 4)
ret %struct.tms* %1
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ err(int, char *, size_t, size_t);
void *xcalloc(size_t c, size_t n) {
  void *p;
  if ((p = calloc(c, n)) == NULL)
    err(1, "calloc(%zu, %zu)", c, n);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1164 <xcalloc+0x44>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%edi
lea    0xea1(%rip),%rsi
call   1040 <err@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <xcalloc+0x2f>
lea    0xec1(%rip),%rsi
mov    $0x1,%edi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"calloc(%zu, %zu)\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ pixel_avg_weight_wxh(int /*<<< orphan*/ *, int,
                                        int /*<<< orphan*/ *, int, int, int,
                                        int);
void pixel_avg_weight_4x8(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                          int i_stride_pix2, int i_weight1) {
  pixel_avg_weight_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 4, 8,
                       i_weight1);
}


x86 assembly (clang, -O0):
<pixel_avg_weight_4x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
mov    $0x4,%r8d
mov    $0x8,%r9d
mov    %eax,(%rsp)
call   1030 <pixel_avg_weight_wxh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_weight_4x8>:
push   %rax
mov    %r8d,(%rsp)
mov    $0x4,%r8d
mov    $0x8,%r9d
call   1030 <pixel_avg_weight_wxh@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pixel_avg_weight_4x8(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @pixel_avg_weight_wxh(i32* %11, i32 %12, i32* %13, i32 %14, i32 4, i32 8, i32 %15)
ret void
}

LLVM IR (-O2):
define void @pixel_avg_weight_4x8(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @pixel_avg_weight_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 4, i32 8, i32 %4)
ret void
}
int pbit(unsigned int nbloque) {
  int i = nbloque % 8;
  return (i);
}


x86 assembly (clang, -O0):
<pbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbit>:
mov    %edi,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @pbit(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}
void moudrv_init(void) {}


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

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

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

LLVM IR (-O2):
define void @moudrv_init() {
ret void
}
char *my_str_mk(char *dst, const char *src) {
  while ((*dst = *src++))
    ++dst;
  return dst;
}


x86 assembly (clang, -O0):
<my_str_mk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     113c <my_str_mk+0x3c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <my_str_mk+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_mk>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
test   %cl,%cl
je     1122 <my_str_mk+0x22>
add    $0x1,%rsi
nop
movzbl (%rsi),%ecx
mov    %cl,0x1(%rax)
add    $0x1,%rax
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <my_str_mk+0x10>
ret

LLVM IR (-O0):
define i8* @my_str_mk(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 = %11, %2
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
%8 = load i8, i8* %6
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = icmp ne i8 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
br label %5
14: ; preds = %5
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @my_str_mk(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %1, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %8
store i8 %10, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pool_destroy(void **pool) {
  void *temp, *next;
  next = pool;
  while (next) {
    temp = next;
    next = *(void **)temp;
    free(temp);
  }
}


x86 assembly (clang, -O0):
<pool_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1150 <pool_destroy+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1124 <pool_destroy+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_destroy>:
push   %rbx
test   %rdi,%rdi
je     1130 <pool_destroy+0x20>
cs nopw 0x0(%rax,%rax,1)
mov    (%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <pool_destroy+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @pool_destroy(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = bitcast i8** %0 to i8*
br label %5
5: ; preds = %3, %5
%6 = phi i8* [ %8, %5 ], [ %4, %3 ]
%7 = bitcast i8* %6 to i8**
%8 = load i8*, i8** %7
%9 = tail call i32 @free(i8* %6)
%10 = icmp eq i8* %8, null
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
void KeccakP400_ExtractBytes(const void *state, unsigned char *data,
                             unsigned int offset, unsigned int length) {
  assert(offset < 50);
  assert(offset + length <= 50);
  memcpy(data, (unsigned char *)state + offset, length);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x32,-0x14(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x32,%eax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r12
xor    %edi,%edi
cmp    $0x32,%edx
setb   %dil
call   1030 <assert@plt>
lea    (%r14,%rbx,1),%eax
xor    %edi,%edi
cmp    $0x33,%eax
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%esi
add    %r12,%rsi
mov    %r15,%rdi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @KeccakP400_ExtractBytes(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = icmp ult i32 %9, 50
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = add i32 %13, %14
%16 = icmp ule i32 %15, 50
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load i8*, i8** %6
%20 = load i8*, i8** %5
%21 = load i32, i32* %7
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i32, i32* %8
%25 = call i32 @memcpy(i8* %19, i8* %23, i32 %24)
ret void
}

LLVM IR (-O2):
define void @KeccakP400_ExtractBytes(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp ult i32 %2, 50
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = add i32 %3, %2
%9 = icmp ult i32 %8, 51
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = zext i32 %2 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = tail call i32 @memcpy(i8* %1, i8* %13, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ app_exit(int /*<<< orphan*/);
void promptcmd_quit(char *args[], int arg_num) { app_exit(0); }


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

x86 assembly (clang, -O2):
<promptcmd_quit>:
xor    %edi,%edi
jmp    1030 <app_exit@plt>

LLVM IR (-O0):
define void @promptcmd_quit(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = call i32 @app_exit(i32 0)
ret void
}

LLVM IR (-O2):
define void @promptcmd_quit(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @app_exit(i32 0)
ret void
}
double dot_product_3d(a1, a2, a3, b1, b2, b3)
double a1, a2, a3, b1, b2, b3;
{ return (a1 * b1 + a2 * b2 + a3 * b3); }


x86 assembly (clang, -O0):
<dot_product_3d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_product_3d>:
mulsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dot_product_3d(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = load double, double* %8
%16 = load double, double* %11
%17 = fmul double %15, %16
%18 = call double @llvm.fmuladd.f64(double %13, double %14, double %17)
%19 = load double, double* %9
%20 = load double, double* %12
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %18)
ret double %21
}

LLVM IR (-O2):
define double @dot_product_3d(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %1, %4
%8 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double %5, double %8)
ret double %9
}