xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("风\n林\n火\n山\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"\E9\A3\8E\0A\E6\9E\97\0A\E7\81\AB\0A\E5\B1\B1\0A\00"
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 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"\E9\A3\8E\0A\E6\9E\97\0A\E7\81\AB\0A\E5\B1\B1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct bfa_wc_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bfa_wc_down(struct bfa_wc_s *);
void bfa_wc_wait(struct bfa_wc_s *wc) { bfa_wc_down(wc); }


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

x86 assembly (clang, -O2):
<bfa_wc_wait>:
jmp    1030 <bfa_wc_down@plt>

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

LLVM IR (-O2):
%struct.bfa_wc_s = type { i32 }
define void @bfa_wc_wait(%struct.bfa_wc_s* %0) {
%2 = tail call i32 @bfa_wc_down(%struct.bfa_wc_s* %0)
ret void
}
void sym_delete(void *value) {}


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

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

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

LLVM IR (-O2):
define void @sym_delete(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_hour;
  int tm_min;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void display_start_time_to_stderr(char *key, time_t now) {
  struct tm *struct_tm;
  struct_tm = localtime(&now);
  fprintf(stderr, "Start time (%s):\t%d:%.2d\n", key, struct_tm->tm_hour,
          struct_tm->tm_min);
}


x86 assembly (clang, -O0):
<display_start_time_to_stderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%r8d
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_start_time_to_stderr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%edi
mov    (%rax),%ecx
mov    0x4(%rax),%r8d
lea    0xeb4(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
@stderr = global i32 0
@.str = [26 x i8] c"Start time (%s):\09%d:%.2d\0A\00"
define void @display_start_time_to_stderr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.tm*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %6, %struct.tm** %5
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load %struct.tm*, %struct.tm** %5
%10 = getelementptr inbounds %struct.tm, %struct.tm* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load %struct.tm*, %struct.tm** %5
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 1
%14 = load i32, i32* %13
%15 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
@stderr = global i32 0
@.str = [26 x i8] c"Start time (%s):\09%d:%.2d\0A\00"
define void @display_start_time_to_stderr(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call %struct.tm* @localtime(i32* %3)
%5 = load i32, i32* @stderr
%6 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 1
%9 = load i32, i32* %8
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %7, i32 %9)
ret void
}
/* Variables and functions */
int vdrive_bam_set_disk_id(unsigned int, unsigned char *);
int file_system_bam_set_disk_id(unsigned int unit, unsigned char *id) {
  return vdrive_bam_set_disk_id(unit, id);
}


x86 assembly (clang, -O0):
<file_system_bam_set_disk_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <vdrive_bam_set_disk_id@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_system_bam_set_disk_id>:
jmp    1030 <vdrive_bam_set_disk_id@plt>

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

LLVM IR (-O2):
define i32 @file_system_bam_set_disk_id(i32 %0, i8* %1) {
%3 = tail call i32 @vdrive_bam_set_disk_id(i32 %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wins_wch(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wins_wch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wins_wch+0x2a>
jmp    1170 <cmd_wins_wch+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wins_wch>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wins_wch+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wins_wch(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wins_wch(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
void f(int *p) { (int __attribute__((foo))) p; }


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

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

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i32
ret void
}

LLVM IR (-O2):
define void @f(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2line(int, float *, float *, float *);
void s2line_(int *n, float *xpts, float *ypts, float *zpts) {
  s2line(*n, xpts, ypts, zpts);
}


x86 assembly (clang, -O0):
<s2line_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <s2line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2line_>:
mov    (%rdi),%edi
jmp    1030 <s2line@plt>

LLVM IR (-O0):
define void @s2line_(i32* %0, float* %1, float* %2, float* %3) {
%5 = alloca i32*
%6 = alloca float*
%7 = alloca float*
%8 = alloca float*
store i32* %0, i32** %5
store float* %1, float** %6
store float* %2, float** %7
store float* %3, float** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load float*, float** %8
%14 = call i32 @s2line(i32 %10, float* %11, float* %12, float* %13)
ret void
}

LLVM IR (-O2):
define void @s2line_(i32* nocapture %0, float* %1, float* %2, float* %3) {
%5 = load i32, i32* %0
%6 = tail call i32 @s2line(i32 %5, float* %1, float* %2, float* %3)
ret void
}
void g_value_type_transformable() {}


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

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

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

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

/* Variables and functions */
int FD_ISSET(int, int /*<<< orphan*/ *);
int llio_fd_isset(int fd, fd_set *set) { return FD_ISSET(fd, set); }


x86 assembly (clang, -O0):
<llio_fd_isset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <FD_ISSET@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llio_fd_isset>:
jmp    1030 <FD_ISSET@plt>

LLVM IR (-O0):
define i32 @llio_fd_isset(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 = load i32*, i32** %4
%7 = call i32 @FD_ISSET(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @llio_fd_isset(i32 %0, i32* %1) {
%3 = tail call i32 @FD_ISSET(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ G_Z_Free(void *, char const *, int);
void _G_LevelFree(void *data, const char *filename, int fileline) {
  G_Z_Free(data, filename, fileline);
}


x86 assembly (clang, -O0):
<_G_LevelFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <G_Z_Free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_G_LevelFree>:
jmp    1030 <G_Z_Free@plt>

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

LLVM IR (-O2):
define void @_G_LevelFree(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @G_Z_Free(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int ft_strlen(char *);
void ft_strclr(char *s) {
  int length;
  int counter;
  counter = 0;
  length = ft_strlen(s);
  while (counter < length) {
    *s = '\0';
    s++;
    counter++;
  }
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115c <ft_strclr+0x4c>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112f <ft_strclr+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ft_strlen@plt>
test   %eax,%eax
jle    1139 <ft_strclr+0x19>
mov    %eax,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %1
ret void
}
int __attribute__((always_)) arith_shift_left(int x, int shift) {
  return (int)(((unsigned int)x) << shift);
}


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

x86 assembly (clang, -O2):
<arith_shift_left>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @arith_shift_left(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 = load i32, i32* %4
%7 = shl i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @arith_shift_left(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  char word[200];
  fgets(word, 200, stdin);
  printf("%li", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0xc8,%esi
call   1050 <fgets@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%li\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 200, i32 %4)
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%li\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 200, i32 %3)
%5 = call i32 @hash(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int g_DUMMY_scrollbar_store(int win_id) {
  win_id = win_id;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_scrollbar_store(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ assert_perror(int);
void assert1(void) { assert_perror(1); }


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

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

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

LLVM IR (-O2):
define void @assert1() {
%1 = tail call i32 @assert_perror(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ play_hangman(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char enteredword[6];
  printf("Enter a word (up to 6 letters): ");
  gets(enteredword);
  printf("\n");
  printf("Welcome to H A N G M A N\n");
  play_hangman(enteredword);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xea4(%rip),%rdi
call   1050 <printf@plt>
lea    0xa(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1070 <play_hangman@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter a word (up to 6 letters): \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [26 x i8] c"Welcome to H A N G M A N\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%9 = call i32 @play_hangman(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter a word (up to 6 letters): \00"
@str = [25 x i8] c"Welcome to H A N G M A N\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 @putchar(i32 10)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%7 = call i32 @play_hangman(i8* %2)
ret i32 0
}
int f(int i) { return i == 600; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x258,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x258,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 600
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp eq i32 %0, 600
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int cos(double);
double EDtan(double x) {
  double y = 1. / cos(x);
  return (y * y);
}


x86 assembly (clang, -O0):
<EDtan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDtan>:
push   %rax
call   1030 <cos@plt>
cvtsi2sd %eax,%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @EDtan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @cos(double %4)
%6 = sitofp i32 %5 to double
%7 = fdiv double 1.000000e+00, %6
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = fmul double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @EDtan(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = sitofp i32 %2 to double
%4 = fdiv double 1.000000e+00, %3
%5 = fmul double %4, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void ncurses_uninit() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @ncurses_uninit() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ unknown_uint();
void minus_one_Bad() {
  uint64_t x = unknown_uint();
  if (x >= 0) {
    uint64_t y = x - 1;
  }
}


x86 assembly (clang, -O0):
<minus_one_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <unknown_uint@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     113a <minus_one_Bad+0x2a>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @minus_one_Bad() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @unknown_uint()
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = icmp sge i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i64, i64* %1
%8 = sub nsw i64 %7, 1
store i64 %8, i64* %2
br label %9
9: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @minus_one_Bad() {
%1 = tail call i64 (...) @unknown_uint()
ret void
}
const char *CRGetCrashLogMessage(void) { return 0; }


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

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

LLVM IR (-O0):
define i8* @CRGetCrashLogMessage() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @CRGetCrashLogMessage() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ InsertTail(char *);
void LoadToList(int *count, char *dtgr) {
  for (int i = 0; i != *count; i++)
    InsertTail(dtgr);
}


x86 assembly (clang, -O0):
<LoadToList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
je     114d <LoadToList+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <InsertTail@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <LoadToList+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoadToList>:
push   %rbp
push   %r14
push   %rbx
cmpl   $0x0,(%rdi)
je     113f <LoadToList+0x2f>
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <InsertTail@plt>
add    $0x1,%ebp
cmp    (%rbx),%ebp
jne    1130 <LoadToList+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @LoadToList(i32* nocapture %0, i8* %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @InsertTail(i8* %1)
%9 = add nuw nsw i32 %7, 1
%10 = load i32, i32* %0
%11 = icmp eq i32 %9, %10
br i1 %11, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver8_putbox(int, int, int, int, void *, int);
void __svgalib_driver32_putbox(int x, int y, int w, int h, void *b, int bw) {
  __svgalib_driver8_putbox(x * 4, y, w * 4, h, b, bw * 4);
}


x86 assembly (clang, -O0):
<__svgalib_driver32_putbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x2,%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
shl    $0x2,%r9d
call   1030 <__svgalib_driver8_putbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver32_putbox>:
shl    $0x2,%edi
shl    $0x2,%edx
shl    $0x2,%r9d
jmp    1030 <__svgalib_driver8_putbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver32_putbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = mul nsw i32 %13, 4
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = mul nsw i32 %16, 4
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load i32, i32* %12
%21 = mul nsw i32 %20, 4
%22 = call i32 @__svgalib_driver8_putbox(i32 %14, i32 %15, i32 %17, i32 %18, i8* %19, i32 %21)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver32_putbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = shl nsw i32 %0, 2
%8 = shl nsw i32 %2, 2
%9 = shl nsw i32 %5, 2
%10 = tail call i32 @__svgalib_driver8_putbox(i32 %7, i32 %1, i32 %8, i32 %3, i8* %4, i32 %9)
ret void
}
int main() {
  int a[5] = {1, 2, 3, 4, 5};
  printf("%u\n", &a);
  printf("%d\n", a);
  printf("%d\n", *a);
  printf("%d\n", a[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    0xed6(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0xef3(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str = [4 x i8] c"%u\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), [5 x i32]* %1)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%6 = load i32, i32* %4
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
unsigned long rint(double);
unsigned long feet_to_mm(double feet) { return rint(feet * 304.8); }


x86 assembly (clang, -O0):
<feet_to_mm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <rint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feet_to_mm>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <rint@plt>

LLVM IR (-O0):
define i64 @feet_to_mm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.048000e+02
%5 = call i64 @rint(double %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @feet_to_mm(double %0) {
%2 = fmul double %0, 3.048000e+02
%3 = tail call i64 @rint(double %2)
ret i64 %3
}
/* Variables and functions */
int TKMM_AllocPages(int);
void *TKMM_PageToPointer(int);
void *TKMM_PageAlloc(int sz) {
  void *p;
  int pg;
  pg = TKMM_AllocPages((sz + 4095) >> 12);
  if (pg < 0)
    return (((void *)0));
  p = TKMM_PageToPointer(pg);
  return (p);
}


x86 assembly (clang, -O0):
<TKMM_PageAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0xfff,%edi
sar    $0xc,%edi
call   1030 <TKMM_AllocPages@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1156 <TKMM_PageAlloc+0x36>
movq   $0x0,-0x8(%rbp)
jmp    116a <TKMM_PageAlloc+0x4a>
mov    -0x1c(%rbp),%edi
call   1040 <TKMM_PageToPointer@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TKMM_PageAlloc>:
push   %rax
add    $0xfff,%edi
sar    $0xc,%edi
call   1030 <TKMM_AllocPages@plt>
test   %eax,%eax
js     113b <TKMM_PageAlloc+0x1b>
mov    %eax,%edi
pop    %rax
jmp    1040 <TKMM_PageToPointer@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @TKMM_PageAlloc(i32 %0) {
%2 = add nsw i32 %0, 4095
%3 = ashr i32 %2, 12
%4 = tail call i32 @TKMM_AllocPages(i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @TKMM_PageToPointer(i32 %4)
br label %8
8: ; preds = %1, %6
%9 = phi i8* [ %7, %6 ], [ null, %1 ]
ret i8* %9
}
/* Type definitions */
typedef int GLint;
typedef int GLenum;

/* Variables and functions */
#define GL_CONVOLUTION_BORDER_COLOR 131
#define GL_CONVOLUTION_BORDER_MODE 130
#define GL_CONVOLUTION_FILTER_BIAS 129
#define GL_CONVOLUTION_FILTER_SCALE 128
GLint __glConvolutionParameterfv_size(GLenum pname) {
  switch (pname) {
  case GL_CONVOLUTION_BORDER_MODE:
    return 1;
  case GL_CONVOLUTION_BORDER_COLOR:
  case GL_CONVOLUTION_FILTER_SCALE:
  case GL_CONVOLUTION_FILTER_BIAS:
    return 4;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<__glConvolutionParameterfv_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff80,%eax
sub    $0x2,%eax
jb     1150 <__glConvolutionParameterfv_size+0x50>
jmp    111e <__glConvolutionParameterfv_size+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
je     1144 <__glConvolutionParameterfv_size+0x44>
jmp    1131 <__glConvolutionParameterfv_size+0x31>
mov    -0xc(%rbp),%eax
sub    $0x83,%eax
je     1150 <__glConvolutionParameterfv_size+0x50>
jmp    115c <__glConvolutionParameterfv_size+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <__glConvolutionParameterfv_size+0x63>
movl   $0x4,-0x4(%rbp)
jmp    1163 <__glConvolutionParameterfv_size+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glConvolutionParameterfv_size>:
add    $0xffffff80,%edi
mov    $0xffffffff,%eax
cmp    $0x3,%edi
ja     111a <__glConvolutionParameterfv_size+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @__glConvolutionParameterfv_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 130, label %5
i32 131, label %6
i32 128, label %6
i32 129, label %6
]
5: ; preds = %1
store i32 1, i32* %2
br label %8
6: ; preds = %1, %1, %1
store i32 4, i32* %2
br label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.__glConvolutionParameterfv_size = [4 x i32] [i32 4, i32 4, i32 1, i32 4]
define i32 @__glConvolutionParameterfv_size(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.__glConvolutionParameterfv_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
void *set(char *a) {
  void *p;
  p = a;
  return p;
}


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

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

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

LLVM IR (-O2):
define i8* @set(i8* readnone returned %0) {
ret i8* %0
}
double bar_to_atm(double bar) { return bar / 1013 * 1000; }


x86 assembly (clang, -O0):
<bar_to_atm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar_to_atm>:
divsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @bar_to_atm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.013000e+03
%5 = fmul double %4, 1.000000e+03
ret double %5
}

LLVM IR (-O2):
define double @bar_to_atm(double %0) {
%2 = fdiv double %0, 1.013000e+03
%3 = fmul double %2, 1.000000e+03
ret double %3
}
void analyze_msk_list(struct sock *sk) {}


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

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

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

LLVM IR (-O2):
%struct.sock = type opaque
define void @analyze_msk_list(%struct.sock* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check(void *);
void *malloc(size_t);
void *malloc_check(size_t size) {
  void *ptr = malloc(size);
  check(ptr);
  return ptr;
}


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

x86 assembly (clang, -O2):
<malloc_check>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <check@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @malloc_check(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @check(i8* %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @malloc_check(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @check(i8* %2)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void webidl_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<webidl_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @webidl_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int int8_t;

/* Variables and functions */
int random_byte_lfsr32();
int8_t random_byte_in(int8_t min, int8_t max) {
  uint16_t a_random_byte = random_byte_lfsr32();
  a_random_byte *= (max - min + 1);
  return (int8_t)((a_random_byte >> 8) + min);
}


x86 assembly (clang, -O0):
<random_byte_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random_byte_lfsr32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_byte_in>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random_byte_lfsr32@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
imul   %ebx,%eax
sar    $0x8,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_byte_in(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @random_byte_lfsr32()
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = ashr i32 %13, 8
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @random_byte_in(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random_byte_lfsr32()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = ashr i32 %6, 8
%8 = add nsw i32 %7, %0
ret i32 %8
}
__float128 from_double(double a) { return (__float128)a; }


x86 assembly (clang, -O0):
<from_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1120 <__extenddftf2>
add    $0x10,%rsp
pop    %rbp
ret
nopl   (%rax)

x86 assembly (clang, -O2):
<from_double>:
jmp    1110 <__extenddftf2>
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define fp128 @from_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fpext double %3 to fp128
ret fp128 %4
}

LLVM IR (-O2):
define fp128 @from_double(double %0) {
%2 = fpext double %0 to fp128
ret fp128 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ temp;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
char *strchr(char *, char);
int /*<<< orphan*/ strncpy(char *, char *, int);
char *getparam(char *s) {
  char *temp = malloc(255), *c;
  memset(temp, 0, sizeof(temp));
  if ((c = strchr(s, '=')) != NULL) {
    strncpy(temp, s, c - s);
  }
  return temp;
}


x86 assembly (clang, -O0):
<getparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xff,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11a0 <getparam+0x60>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getparam>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0xff,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    $0x3d,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1185 <getparam+0x45>
sub    %r14d,%eax
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getparam(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i8* @malloc(i32 255)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @memset(i8* %6, i32 0, i32 8)
%8 = load i8*, i8** %2
%9 = call i8* @strchr(i8* %8, i8 signext 61)
store i8* %9, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %21
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @strncpy(i8* %12, i8* %13, i32 %19)
br label %21
21: ; preds = %11, %1
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @getparam(i8* %0) {
%2 = tail call dereferenceable_or_null(255) i8* @malloc(i32 255)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 8)
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 61)
%5 = icmp eq i8* %4, null
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = ptrtoint i8* %4 to i64
%8 = ptrtoint i8* %0 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = tail call i32 @strncpy(i8* %2, i8* %0, i32 %10)
br label %12
12: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pr_array(int a[], int alen) {
  int k;
  for (k = 0; k < alen; k++)
    printf("%d,", a[k]);
  printf("\n");
}


x86 assembly (clang, -O0):
<pr_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <pr_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pr_array+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <pr_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <pr_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d,\00"
define void @pr_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int wkd_write() {}


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

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

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

LLVM IR (-O2):
define i32 @wkd_write() {
ret i32 undef
}
int add_int(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<add_int>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @add_int(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 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @add_int(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}