xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strlen(char const *);
size_t argvlen(size_t argc, const char **argv) {
  size_t l = 0;
  for (size_t i = 0; i < argc; i++) {
    l += strlen(argv[i]) + 1;
  }
  return l;
}


x86 assembly (clang, -O0):
<argvlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116c <argvlen+0x5c>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
add    $0x1,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <argvlen+0x20>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<argvlen>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     114b <argvlen+0x3b>
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <strlen@plt>
add    %rax,%r12
add    $0x1,%r12
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <argvlen+0x20>
jmp    114e <argvlen+0x3e>
xor    %r12d,%r12d
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @argvlen(i64 %0, i8** nocapture %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = phi i64 [ 0, %2 ], [ %13, %6 ]
ret i64 %5
6: ; preds = %2, %6
%7 = phi i64 [ %14, %6 ], [ 0, %2 ]
%8 = phi i64 [ %13, %6 ], [ 0, %2 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i64 @strlen(i8* dereferenceable(1) %10)
%12 = add i64 %8, 1
%13 = add i64 %12, %11
%14 = add nuw i64 %7, 1
%15 = icmp eq i64 %14, %0
br i1 %15, label %4, label %6
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int syscall_fstat(int, struct stat *);
int fstat(int file, struct stat *st) { return syscall_fstat(file, st); }


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

x86 assembly (clang, -O2):
<fstat>:
jmp    1030 <syscall_fstat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = tail call i32 @syscall_fstat(i32 %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int BMP_read_filesize(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main(void) {
  printf("BMP_read_filesize測試：%u", BMP_read_filesize("test"));
  system("pause");
  system("cls");
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed7(%rip),%rdi
call   1050 <BMP_read_filesize@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
call   1030 <system@plt>
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
lea    0xeaa(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee5(%rip),%rdi
call   1050 <BMP_read_filesize@plt>
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xed0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <system@plt>
lea    0xec7(%rip),%rdi
call   1030 <system@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"BMP_read_filesize\E6\B8\AC\E8\A9\A6\EF\BC\9A%u\00"
@.str.1 = [5 x i8] c"test\00"
@.str.2 = [6 x i8] c"pause\00"
@.str.3 = [4 x i8] c"cls\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @BMP_read_filesize(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"BMP_read_filesize\E6\B8\AC\E8\A9\A6\EF\BC\9A%u\00"
@.str.1 = [5 x i8] c"test\00"
@.str.2 = [6 x i8] c"pause\00"
@.str.3 = [4 x i8] c"cls\00"
define i32 @main() {
%1 = tail call i32 @BMP_read_filesize(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double _get_ushort(const char *data, size_t pos) {
  unsigned short *buf = (unsigned short *)data;
  return ((double)buf[pos]);
}


x86 assembly (clang, -O0):
<_get_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_ushort>:
movzwl (%rdi,%rsi,2),%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @_get_ushort(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i16*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i16*
store i16* %7, i16** %5
%8 = load i16*, i16** %5
%9 = load i64, i64* %4
%10 = getelementptr inbounds i16, i16* %8, i64 %9
%11 = load i16, i16* %10
%12 = uitofp i16 %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_get_ushort(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i16*
%4 = getelementptr inbounds i16, i16* %3, i64 %1
%5 = load i16, i16* %4
%6 = uitofp i16 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void function_b() {
  int input;
  exit(1);
}


x86 assembly (clang, -O0):
<function_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<function_b>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @function_b() {
%1 = alloca i32
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @function_b() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *ffnchomp(char *s, size_t len) {
  len = len > 1 ? len - 1 : 0;
  if (s[len] == '\n')
    s[len] = '\0';
  return s;
}


x86 assembly (clang, -O0):
<ffnchomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jbe    1128 <ffnchomp+0x28>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1133 <ffnchomp+0x33>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1133 <ffnchomp+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115c <ffnchomp+0x5c>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffnchomp>:
mov    %rdi,%rax
xor    %ecx,%ecx
sub    $0x1,%rsi
cmovae %rsi,%rcx
cmpb   $0xa,(%rdi,%rcx,1)
jne    1117 <ffnchomp+0x17>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ffnchomp(i8* returned %0, i64 %1) {
%3 = tail call i64 @llvm.usub.sat.i64(i64 %1, i64 1)
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %2
store i8 0, i8* %4
br label %8
8: ; preds = %7, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int);
int /*<<< orphan*/ usleep(int);
void write_one(void) {
  gpio_set(27, 1);
  usleep((12 * 80));
  gpio_set(27, 0);
  usleep((4 * 80));
  gpio_set(27, 1);
  usleep((12 * 80));
  gpio_set(27, 0);
  usleep((4 * 80));
}


x86 assembly (clang, -O0):
<write_one>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one>:
push   %rax
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
mov    $0x1,%esi
call   1030 <gpio_set@plt>
mov    $0x3c0,%edi
call   1040 <usleep@plt>
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x140,%edi
pop    %rax
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @write_one() {
%1 = call i32 @gpio_set(i32 27, i32 1)
%2 = call i32 @usleep(i32 960)
%3 = call i32 @gpio_set(i32 27, i32 0)
%4 = call i32 @usleep(i32 320)
%5 = call i32 @gpio_set(i32 27, i32 1)
%6 = call i32 @usleep(i32 960)
%7 = call i32 @gpio_set(i32 27, i32 0)
%8 = call i32 @usleep(i32 320)
ret void
}

LLVM IR (-O2):
define void @write_one() {
%1 = tail call i32 @gpio_set(i32 27, i32 1)
%2 = tail call i32 @usleep(i32 960)
%3 = tail call i32 @gpio_set(i32 27, i32 0)
%4 = tail call i32 @usleep(i32 320)
%5 = tail call i32 @gpio_set(i32 27, i32 1)
%6 = tail call i32 @usleep(i32 960)
%7 = tail call i32 @gpio_set(i32 27, i32 0)
%8 = tail call i32 @usleep(i32 320)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *, char const *);
char *name_get(unsigned int);
int /*<<< orphan*/ printf(char *, char const *);
int rmdir(char const *);
void do_rmdir(unsigned name) {
  const char *namestr;
  namestr = name_get(name);
  if (rmdir(namestr) == -1) {
    err(1, "%s: rmdir", namestr);
  }
  printf("rmdir %s\n", namestr);
}


x86 assembly (clang, -O0):
<do_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <name_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rmdir@plt>
cmp    $0xffffffff,%eax
jne    117e <do_rmdir+0x3e>
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
lea    0xe87(%rip),%rsi
call   1050 <err@plt>
mov    -0x10(%rbp),%rsi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rmdir>:
push   %rbx
call   1060 <name_get@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <rmdir@plt>
cmp    $0xffffffff,%eax
jne    116a <do_rmdir+0x2a>
lea    0xea3(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1050 <err@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"%s: rmdir\00"
@.str.1 = [10 x i8] c"rmdir %s\0A\00"
define void @do_rmdir(i32 %0) {
%2 = tail call i8* @name_get(i32 %0)
%3 = tail call i32 @rmdir(i8* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
double log10(double);
__attribute__((__weak__, __always___)) double softboundmpx_log10(double x) {
  return log10(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_log10>:
jmp    1030 <log10@plt>

LLVM IR (-O0):
define weak double @softboundmpx_log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundmpx_log10(double %0) {
%2 = tail call double @log10(double %0)
ret double %2
}
/* Variables and functions */
int u8isuppercyrilici(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isuppercyrilicc(char *c) { return u8isuppercyrilici(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isuppercyrilicc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isuppercyrilici@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isuppercyrilicc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isuppercyrilici@plt>

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

LLVM IR (-O2):
define i32 @u8isuppercyrilicc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isuppercyrilici(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char *s1, char *s2) {
  char p[50];
  strcpy(p, s1);
  strcpy(s1, s2);
  strcpy(s2, p);
}


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

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [50 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
/* Variables and functions */
scalar_t__ isprime(long, int);
long random(long, long);
long getprime(long lower, long upper) {
  long num;
  while (1) {
    num = random(lower, upper);
    if (isprime(num, 2))
      break;
  }
  return num;
}


x86 assembly (clang, -O0):
<getprime>:
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   1040 <random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1030 <isprime@plt>
cmp    $0x0,%rax
je     115e <getprime+0x3e>
jmp    1163 <getprime+0x43>
jmp    1130 <getprime+0x10>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getprime>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <random@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2,%esi
call   1030 <isprime@plt>
test   %rax,%rax
je     1130 <getprime+0x10>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @getprime(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @random(i64 %0, i64 %1)
%5 = tail call i64 @isprime(i64 %4, i32 2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret i64 %4
}
/* Type definitions */
typedef int u_char;

/* Variables and functions */
int __utf8_forbitten(u_char octet) {
  switch (octet) {
  case 0xc0:
  case 0xc1:
  case 0xf5:
  case 0xff:
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<__utf8_forbitten>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffff40,%eax
sub    $0x2,%eax
jb     1146 <__utf8_forbitten+0x46>
jmp    1120 <__utf8_forbitten+0x20>
mov    -0xc(%rbp),%eax
sub    $0xf5,%eax
je     1146 <__utf8_forbitten+0x46>
jmp    1133 <__utf8_forbitten+0x33>
mov    -0xc(%rbp),%eax
sub    $0xff,%eax
jne    1152 <__utf8_forbitten+0x52>
jmp    1146 <__utf8_forbitten+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <__utf8_forbitten+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__utf8_forbitten>:
add    $0xffffff40,%edi
cmp    $0x3f,%edi
ja     1121 <__utf8_forbitten+0x21>
mov    $0xffffffff,%eax
movabs $0x8020000000000003,%rcx
bt     %rdi,%rcx
jae    1121 <__utf8_forbitten+0x21>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__utf8_forbitten(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 192, label %5
i32 193, label %5
i32 245, label %5
i32 255, label %5
]
5: ; preds = %1, %1, %1, %1
store i32 -1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @__utf8_forbitten(i32 %0) {
switch i32 %0, label %2 [
i32 192, label %3
i32 193, label %3
i32 245, label %3
i32 255, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ -1, %1 ], [ -1, %1 ], [ -1, %1 ], [ -1, %1 ]
ret i32 %4
}
/* Variables and functions */
int japi_getmousebutton(int);
int j_getmousebutton(int arg0) { return (japi_getmousebutton(arg0)); }


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

x86 assembly (clang, -O2):
<j_getmousebutton>:
jmp    1030 <japi_getmousebutton@plt>

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

LLVM IR (-O2):
define i32 @j_getmousebutton(i32 %0) {
%2 = tail call i32 @japi_getmousebutton(i32 %0)
ret i32 %2
}
extern int _close(int file) {
  (void)file;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
char sdsReqType(size_t string_size) {
  if (string_size < 1 << 5)
    return 0;
  if (string_size < 1 << 8)
    return 1;
  if (string_size < 1 << 16)
    return 2;
  if (string_size < 1ll << 32)
    return 3;
  return 4;
}


x86 assembly (clang, -O0):
<sdsReqType>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x20,-0x10(%rbp)
jae    111c <sdsReqType+0x1c>
movb   $0x0,-0x1(%rbp)
jmp    116b <sdsReqType+0x6b>
cmpq   $0x100,-0x10(%rbp)
jae    1133 <sdsReqType+0x33>
movb   $0x1,-0x1(%rbp)
jmp    116b <sdsReqType+0x6b>
cmpq   $0x10000,-0x10(%rbp)
jae    114a <sdsReqType+0x4a>
movb   $0x2,-0x1(%rbp)
jmp    116b <sdsReqType+0x6b>
movabs $0x100000000,%rax
cmp    %rax,-0x10(%rbp)
jae    1167 <sdsReqType+0x67>
movb   $0x3,-0x1(%rbp)
jmp    116b <sdsReqType+0x6b>
movb   $0x4,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdsReqType>:
cmp    $0x20,%rdi
jae    1109 <sdsReqType+0x9>
xor    %eax,%eax
ret
mov    $0x1,%al
cmp    $0x100,%rdi
jb     112b <sdsReqType+0x2b>
mov    $0x2,%al
cmp    $0x10000,%rdi
jb     112b <sdsReqType+0x2b>
shr    $0x20,%rdi
cmp    $0x1,%rdi
mov    $0x4,%al
sbb    $0x0,%al
ret

LLVM IR (-O0):
define signext i8 @sdsReqType(i64 %0) {
%2 = alloca i8
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ult i64 %4, 32
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 0, i8* %2
br label %20
7: ; preds = %1
%8 = load i64, i64* %3
%9 = icmp ult i64 %8, 256
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 1, i8* %2
br label %20
11: ; preds = %7
%12 = load i64, i64* %3
%13 = icmp ult i64 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 2, i8* %2
br label %20
15: ; preds = %11
%16 = load i64, i64* %3
%17 = icmp ult i64 %16, 4294967296
br i1 %17, label %18, label %19
18: ; preds = %15
store i8 3, i8* %2
br label %20
19: ; preds = %15
store i8 4, i8* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i8, i8* %2
ret i8 %21
}

LLVM IR (-O2):
define signext i8 @sdsReqType(i64 %0) {
%2 = icmp ult i64 %0, 32
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i64 %0, 256
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i64 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i64 %0, 4294967296
%9 = select i1 %8, i8 3, i8 4
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i8 [ 0, %1 ], [ 1, %3 ], [ 2, %5 ], [ %9, %7 ]
ret i8 %11
}
void g_main_loop_new() {}


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

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

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

LLVM IR (-O2):
define void @g_main_loop_new() {
ret void
}
void lidt(struct pseudodesc *pd) {
  asm volatile("lidt (%0)" ::"r"(pd) : "memory");
}


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

x86 assembly (clang, -O2):
<lidt>:
lidt   (%rdi)
ret

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

LLVM IR (-O2):
%struct.pseudodesc = type opaque
define void @lidt(%struct.pseudodesc* %0) {
tail call void asm sideeffect "lidt ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(%struct.pseudodesc* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void ignore_this() {
  char shield[500];
  strcpy(shield, "Block");
  system("echo hi");
}


x86 assembly (clang, -O0):
<ignore_this>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xec1(%rip),%rdi
call   1040 <system@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_this>:
sub    $0x1f8,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
lea    0xec9(%rip),%rdi
call   1040 <system@plt>
add    $0x1f8,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Block\00"
@.str.1 = [8 x i8] c"echo hi\00"
define void @ignore_this() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Block\00"
@.str.1 = [8 x i8] c"echo hi\00"
define void @ignore_this() {
%1 = alloca [500 x i8]
%2 = getelementptr inbounds [500 x i8], [500 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
void write_nibble_or(unsigned long *w, int i, uint32_t v) {
  assert(i >= 0 && i < 16);
  unsigned long prom = v;
  prom <<= (i * 4);
  *w |= prom;
}


x86 assembly (clang, -O0):
<write_nibble_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x21(%rbp)
jl     113c <write_nibble_or+0x2c>
cmpl   $0x10,-0xc(%rbp)
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,%ecx
shl    %cl,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_nibble_or>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x10,%esi
setb   %dil
call   1030 <assert@plt>
shl    $0x2,%ebp
mov    %ebp,%ecx
shl    %cl,%rbx
or     %rbx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @write_nibble_or(i64* %0, i32 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 16
br label %13
13: ; preds = %10, %3
%14 = phi i1 [ false, %3 ], [ %12, %10 ]
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i64, i64* %6
store i64 %17, i64* %7
%18 = load i32, i32* %5
%19 = mul nsw i32 %18, 4
%20 = load i64, i64* %7
%21 = zext i32 %19 to i64
%22 = shl i64 %20, %21
store i64 %22, i64* %7
%23 = load i64, i64* %7
%24 = load i64*, i64** %4
%25 = load i64, i64* %24
%26 = or i64 %25, %23
store i64 %26, i64* %24
ret void
}

LLVM IR (-O2):
define void @write_nibble_or(i64* nocapture %0, i32 %1, i64 %2) {
%4 = icmp ult i32 %1, 16
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = shl nsw i32 %1, 2
%8 = zext i32 %7 to i64
%9 = shl i64 %2, %8
%10 = load i64, i64* %0
%11 = or i64 %10, %9
store i64 %11, i64* %0
ret void
}
void foo315() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ htobe32(int /*<<< orphan*/);
void knot_wire_write_u32(uint8_t *pos, uint32_t data) {
  *(uint32_t *)pos = htobe32(data);
}


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

x86 assembly (clang, -O2):
<knot_wire_write_u32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htobe32@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @knot_wire_write_u32(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @htobe32(i32 %1)
store i32 %3, i32* %0
ret void
}
int __ledf2(double a __attribute__((unused)),
            double b __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<__ledf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__ledf2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @__ledf2(double %0, double %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void dvmAbort(void) { exit(1); }


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

x86 assembly (clang, -O2):
<dvmAbort>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @dvmAbort() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @dvmAbort() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void vector_free(void *vp) {
  struct {
    char *elem;
    unsigned len, capacity;
  } *vect = vp;
  free(vect->elem);
  vect->len = vect->capacity = 0;
  vect->elem = 0;
}


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

x86 assembly (clang, -O2):
<vector_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i32 }
define void @vector_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i8*, i8** %7
%9 = call i32 @free(i8* %8)
%10 = load %struct.anon*, %struct.anon** %3
%11 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
store i32 0, i32* %11
%12 = load %struct.anon*, %struct.anon** %3
%13 = getelementptr inbounds %struct.anon, %struct.anon* %12, i32 0, i32 1
store i32 0, i32* %13
%14 = load %struct.anon*, %struct.anon** %3
%15 = getelementptr inbounds %struct.anon, %struct.anon* %14, i32 0, i32 0
store i8* null, i8** %15
ret void
}

LLVM IR (-O2):
define void @vector_free(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int test1_() {
  MAIN__();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test1_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @test1_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _MPI_checkMemAlloc(void *, char *);
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *_MPI_safeMalloc(int size, char *message) {
  void *temp;
  ;
  temp = malloc(size + 128);
  _MPI_checkMemAlloc(temp, message);
  memset(temp, 0, size);
  return temp;
}


x86 assembly (clang, -O0):
<_MPI_safeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <_MPI_checkMemAlloc@plt>
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MPI_safeMalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%r15d
lea    0x80(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <_MPI_checkMemAlloc@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15d,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_MPI_safeMalloc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 128
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = call i32 @_MPI_checkMemAlloc(i8* %9, i8* %10)
%12 = load i8*, i8** %5
%13 = load i32, i32* %3
%14 = call i32 @memset(i8* %12, i32 0, i32 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @_MPI_safeMalloc(i32 %0, i8* %1) {
%3 = add nsw i32 %0, 128
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @_MPI_checkMemAlloc(i8* %4, i8* %1)
%6 = tail call i32 @memset(i8* %4, i32 0, i32 %0)
ret i8* %4
}
unsigned int scif_isdata(void) {
  return (*(volatile unsigned short *)0xffe80010 & 0x2);
}


x86 assembly (clang, -O0):
<scif_isdata>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffe80010,%eax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scif_isdata>:
mov    $0xffe80010,%eax
movzwl (%rax),%eax
and    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @scif_isdata() {
%1 = load volatile i16, i16* inttoptr (i64 4293394448 to i16*)
%2 = zext i16 %1 to i32
%3 = and i32 %2, 2
ret i32 %3
}

LLVM IR (-O2):
define i32 @scif_isdata() {
%1 = load volatile i16, i16* inttoptr (i64 4293394448 to i16*)
%2 = and i16 %1, 2
%3 = zext i16 %2 to i32
ret i32 %3
}
unsigned precise_fraction_uexp(unsigned v) { return v << 16; }


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

x86 assembly (clang, -O2):
<precise_fraction_uexp>:
mov    %edi,%eax
shl    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @precise_fraction_uexp(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 16
ret i32 %4
}

LLVM IR (-O2):
define i32 @precise_fraction_uexp(i32 %0) {
%2 = shl i32 %0, 16
ret i32 %2
}
void ff_hevc_put_hevc_uni_w_pel_pixels12_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels12_10_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return (islower(c)) ? c & ~0x20 : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
and    $0xffffffdf,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @islower(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = and i32 %7, -33
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ stmt_seq();
void program() { stmt_seq(); }


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

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

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

LLVM IR (-O2):
define void @program() {
%1 = tail call i32 (...) @stmt_seq()
ret void
}
/* Variables and functions */
int tcm_decision(int, int);
int tcm_dist(int level, int sample) {
  int xs, e;
  xs = tcm_decision(level, sample);
  e = sample - xs;
  return (e * e) >> 8;
}


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

x86 assembly (clang, -O2):
<tcm_dist>:
push   %rbx
mov    %esi,%ebx
call   1030 <tcm_decision@plt>
sub    %eax,%ebx
imul   %ebx,%ebx
shr    $0x8,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @tcm_dist(i32 %0, i32 %1) {
%3 = tail call i32 @tcm_decision(i32 %0, i32 %1)
%4 = sub nsw i32 %1, %3
%5 = mul nsw i32 %4, %4
%6 = lshr i32 %5, 8
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ trace_printf(char *, void *, void *);
void print_ip_sym(unsigned long ip) {
  trace_printf("[<%p>] %pS\n", (void *)ip, (void *)ip);
}


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"[<%p>] %pS\0A\00"
define void @print_ip_sym(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
%5 = load i64, i64* %2
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @trace_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"[<%p>] %pS\0A\00"
define void @print_ip_sym(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @trace_printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void testdummy(void) { _exit(111); }


x86 assembly (clang, -O0):
<testdummy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6f,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<testdummy>:
push   %rax
mov    $0x6f,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @testdummy() {
%1 = call i32 @_exit(i32 111)
unreachable
}

LLVM IR (-O2):
define void @testdummy() {
%1 = tail call i32 @_exit(i32 111)
unreachable
}
int passes_loc_constraints_above_slope(int **walk_points, int curr_num_pts,
                                       double slope) {
  int x = walk_points[curr_num_pts - 1][0];
  int y = walk_points[curr_num_pts - 1][1];
  if (y >= slope * x - 1e-8)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<passes_loc_constraints_above_slope>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x28(%rbp)
cvtsi2sdl -0x28(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea8(%rip),%xmm2
addsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jb     1172 <passes_loc_constraints_above_slope+0x72>
movl   $0x1,-0x4(%rbp)
jmp    1179 <passes_loc_constraints_above_slope+0x79>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<passes_loc_constraints_above_slope>:
movslq %esi,%rax
mov    -0x8(%rdi,%rax,8),%rax
cvtsi2sdl 0x4(%rax),%xmm1
cvtsi2sdl (%rax),%xmm2
mulsd  %xmm0,%xmm2
addsd  0xee3(%rip),%xmm2
xor    %eax,%eax
ucomisd %xmm2,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @passes_loc_constraints_above_slope(i32** %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32**
%6 = alloca i32
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
store i32** %0, i32*** %5
store i32 %1, i32* %6
store double %2, double* %7
%10 = load i32**, i32*** %5
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %10, i64 %13
%15 = load i32*, i32** %14
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
store i32 %17, i32* %8
%18 = load i32**, i32*** %5
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32*, i32** %18, i64 %21
%23 = load i32*, i32** %22
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = sitofp i32 %26 to double
%28 = load double, double* %7
%29 = load i32, i32* %8
%30 = sitofp i32 %29 to double
%31 = call double @llvm.fmuladd.f64(double %28, double %30, double -1.000000e-08)
%32 = fcmp oge double %27, %31
br i1 %32, label %33, label %34
33: ; preds = %3
store i32 1, i32* %4
br label %35
34: ; preds = %3
store i32 0, i32* %4
br label %35
35: ; preds = %34, %33
%36 = load i32, i32* %4
ret i32 %36
}

LLVM IR (-O2):
define i32 @passes_loc_constraints_above_slope(i32** nocapture %0, i32 %1, double %2) {
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32*, i32** %0, i64 %5
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %7, i64 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = sitofp i32 %8 to double
%13 = tail call double @llvm.fmuladd.f64(double %2, double %12, double -1.000000e-08)
%14 = fcmp ole double %13, %11
%15 = zext i1 %14 to i32
ret i32 %15
}
long rclhdr(char *hdr) {
  static long l;
  l = (unsigned)(hdr[3] & 0377);
  l = (l << 8) | (unsigned)(hdr[2] & 0377);
  l = (l << 8) | (unsigned)(hdr[1] & 0377);
  l = (l << 8) | (unsigned)(hdr[0] & 0377);
  return l;
}


x86 assembly (clang, -O0):
<rclhdr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
and    $0xff,%eax
mov    %eax,%eax
mov    %rax,0x2f0a(%rip)
mov    0x2f03(%rip),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xff,%ecx
mov    %ecx,%ecx
or     %rcx,%rax
mov    %rax,0x2ee5(%rip)
mov    0x2ede(%rip),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xff,%ecx
mov    %ecx,%ecx
or     %rcx,%rax
mov    %rax,0x2ec0(%rip)
mov    0x2eb9(%rip),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
and    $0xff,%ecx
mov    %ecx,%ecx
or     %rcx,%rax
mov    %rax,0x2e9c(%rip)
mov    0x2e95(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@rclhdr.l = internal global i64 0
define i64 @rclhdr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = and i32 %6, 255
%8 = zext i32 %7 to i64
store i64 %8, i64* @rclhdr.l
%9 = load i64, i64* @rclhdr.l
%10 = shl i64 %9, 8
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = and i32 %14, 255
%16 = zext i32 %15 to i64
%17 = or i64 %10, %16
store i64 %17, i64* @rclhdr.l
%18 = load i64, i64* @rclhdr.l
%19 = shl i64 %18, 8
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = and i32 %23, 255
%25 = zext i32 %24 to i64
%26 = or i64 %19, %25
store i64 %26, i64* @rclhdr.l
%27 = load i64, i64* @rclhdr.l
%28 = shl i64 %27, 8
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = and i32 %32, 255
%34 = zext i32 %33 to i64
%35 = or i64 %28, %34
store i64 %35, i64* @rclhdr.l
%36 = load i64, i64* @rclhdr.l
ret i64 %36
}

LLVM IR (-O2):
define i64 @rclhdr(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}