xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int lstat(char const *, struct stat *);
int check_file(const char *f) {
  struct stat cst;
  return lstat(f, &cst);
}


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

x86 assembly (clang, -O2):
<check_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @check_file(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @lstat(i8* %4, %struct.stat* %3)
ret i32 %5
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @check_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @lstat(i8* %0, %struct.stat* %2)
ret i32 %4
}
/* Variables and functions */
float logf(scalar_t__);
scalar_t__ sqrtf(float);
float acoshf(float x) { return logf(x + sqrtf(x * x - 1.f)); }


x86 assembly (clang, -O0):
<acoshf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xeb3(%rip),%xmm1
addss  %xmm1,%xmm0
call   1040 <sqrtf@plt>
movss  -0x8(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
call   1030 <logf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acoshf>:
push   %rax
movss  %xmm0,0x4(%rsp)
mulss  %xmm0,%xmm0
addss  0xecd(%rip),%xmm0
call   1040 <sqrtf@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%rdi
pop    %rax
jmp    1030 <logf@plt>

LLVM IR (-O0):
define float @acoshf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = call float @llvm.fmuladd.f32(float %4, float %5, float -1.000000e+00)
%7 = call i64 @sqrtf(float %6)
%8 = sitofp i64 %7 to float
%9 = fadd float %3, %8
%10 = fptosi float %9 to i64
%11 = call float @logf(i64 %10)
ret float %11
}

LLVM IR (-O2):
define float @acoshf(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float %0, float -1.000000e+00)
%3 = tail call i64 @sqrtf(float %2)
%4 = sitofp i64 %3 to float
%5 = fadd float %4, %0
%6 = fptosi float %5 to i64
%7 = tail call float @logf(i64 %6)
ret float %7
}
/* Type definitions */
struct uevent {
  int dummy;
};

/* Variables and functions */
char *uevent_get_dm_str(struct uevent const *, char *);
char *uevent_get_dm_path(const struct uevent *uev) {
  return uevent_get_dm_str(uev, "DM_PATH");
}


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

x86 assembly (clang, -O2):
<uevent_get_dm_path>:
lea    0xee9(%rip),%rsi
jmp    1030 <uevent_get_dm_str@plt>

LLVM IR (-O0):
%struct.uevent = type { i32 }
@.str = [8 x i8] c"DM_PATH\00"
define i8* @uevent_get_dm_path(%struct.uevent* %0) {
%2 = alloca %struct.uevent*
store %struct.uevent* %0, %struct.uevent** %2
%3 = load %struct.uevent*, %struct.uevent** %2
%4 = call i8* @uevent_get_dm_str(%struct.uevent* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.uevent = type { i32 }
@.str = [8 x i8] c"DM_PATH\00"
define i8* @uevent_get_dm_path(%struct.uevent* %0) {
%2 = tail call i8* @uevent_get_dm_str(%struct.uevent* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
int emac2_ifinucastpkts_set(unsigned int dev_id,
                            union emac2_ifinucastpkts_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac2_ifinucastpkts_u = type opaque
define i32 @emac2_ifinucastpkts_set(i32 %0, %union.emac2_ifinucastpkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_ifinucastpkts_u*
store i32 %0, i32* %3
store %union.emac2_ifinucastpkts_u* %1, %union.emac2_ifinucastpkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_ifinucastpkts_u = type opaque
define i32 @emac2_ifinucastpkts_set(i32 %0, %union.emac2_ifinucastpkts_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
unsigned long ERR_get_error();
char const *ERR_reason_error_string(unsigned long);
const char *openssl_error_string(void) {
  unsigned long error_code = ERR_get_error();
  return ERR_reason_error_string(error_code);
}


x86 assembly (clang, -O0):
<openssl_error_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ERR_get_error@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ERR_reason_error_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_error_string>:
push   %rax
xor    %eax,%eax
call   1040 <ERR_get_error@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <ERR_reason_error_string@plt>

LLVM IR (-O0):
define i8* @openssl_error_string() {
%1 = alloca i64
%2 = call i64 (...) @ERR_get_error()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i8* @ERR_reason_error_string(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @openssl_error_string() {
%1 = tail call i64 (...) @ERR_get_error()
%2 = tail call i8* @ERR_reason_error_string(i64 %1)
ret i8* %2
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
int8_t return_int8() { return 42; }


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

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

LLVM IR (-O0):
define i32 @return_int8() {
ret i32 42
}

LLVM IR (-O2):
define i32 @return_int8() {
ret i32 42
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, long long, long long);
long long thirt(long long);
void testequal(long long n, long long exp) {
  long long act = thirt(n);
  if (act != exp)
    printf("Error. Expected %lld but got %lld\n", exp, act);
  assert(exp == act);
}


x86 assembly (clang, -O0):
<testequal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <thirt@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     116f <testequal+0x3f>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testequal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <thirt@plt>
mov    %rax,%rbx
cmp    %r14,%rax
je     1156 <testequal+0x26>
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %edi,%edi
cmp    %r14,%rbx
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Error. Expected %lld but got %lld\0A\00"
define void @testequal(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i64 @thirt(i64 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i64, i64* %4
%17 = load i64, i64* %5
%18 = icmp eq i64 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"Error. Expected %lld but got %lld\0A\00"
define void @testequal(i64 %0, i64 %1) {
%3 = tail call i64 @thirt(i64 %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %3)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
int main() {
  int x, y, z;
  x = 0;
  if (x == 5) {
    x++;
    x++;
    if (y > 10) {
      z++;
    }
    z += x + y;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jne    114d <main+0x4d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0xc(%rbp)
jle    1141 <main+0x41>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int a() { printf("in a\n"); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"in a\0A\00"
define i32 @a() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [5 x i8] c"in a\00"
define i32 @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void put_disk(struct gendisk *disk) { return; }


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

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

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

LLVM IR (-O2):
%struct.gendisk = type opaque
define void @put_disk(%struct.gendisk* nocapture %0) {
ret void
}
int norel(id)
char *id;
{
  if (isequ(id))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<norel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <isequ@plt>
cmp    $0x0,%eax
je     113c <norel+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <norel+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norel>:
push   %rax
xor    %eax,%eax
call   1030 <isequ@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @norel(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @isequ to i32 (i8*, ...)*)(i8* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @norel(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @isequ to i32 (i8*, ...)*)(i8* %0)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
__float128 from_uns_long_load(unsigned long *a) { return (__float128)*a; }


x86 assembly (clang, -O0):
<from_uns_long_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1120 <__floatunditf>
add    $0x10,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<from_uns_long_load>:
push   %rax
mov    (%rdi),%rdi
call   1110 <__floatunditf>
pop    %rax
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @from_uns_long_load(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = uitofp i64 %4 to fp128
ret fp128 %5
}

LLVM IR (-O2):
define fp128 @from_uns_long_load(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = uitofp i64 %2 to fp128
ret fp128 %3
}
/* Variables and functions */
int u_set_mbps(int, char **);
int u_set_full_speed(int fd, char **argv) {
  char *hundred = "100";
  argv = argv;
  return u_set_mbps(fd, &hundred);
}


x86 assembly (clang, -O0):
<u_set_full_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <u_set_mbps@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_set_full_speed>:
push   %rax
lea    0xee8(%rip),%rax
mov    %rax,(%rsp)
mov    %rsp,%rsi
call   1030 <u_set_mbps@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"100\00"
define i32 @u_set_full_speed(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = call i32 @u_set_mbps(i32 %0, i8** %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __dump_line(int, unsigned char *, int *);
void __dump_char(int level, unsigned char *buf, int *cp, int ch) {
  int cnt = (*cp)++;
  buf[cnt] = ch;
  if (cnt == 15)
    __dump_line(level, buf, cp);
}


x86 assembly (clang, -O0):
<__dump_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
cmpl   $0xf,-0x20(%rbp)
jne    1160 <__dump_char+0x50>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__dump_line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dump_char>:
movslq (%rdx),%r8
lea    0x1(%r8),%eax
mov    %eax,(%rdx)
mov    %cl,(%rsi,%r8,1)
cmp    $0xf,%r8
jne    1128 <__dump_char+0x18>
jmp    1030 <__dump_line@plt>
ret

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

LLVM IR (-O2):
define void @__dump_char(i32 %0, i8* %1, i32* %2, i32 %3) {
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = trunc i32 %3 to i8
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 %7, i8* %9
%10 = icmp eq i32 %5, 15
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = tail call i32 @__dump_line(i32 %0, i8* %1, i32* %2)
br label %13
13: ; preds = %11, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int calculate(int value) {
  int r = value + 1;
  printf("calculate(%d): %d\n", value, r);
  return r;
}


x86 assembly (clang, -O0):
<calculate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate>:
push   %rbx
mov    %edi,%esi
lea    0x1(%rsi),%ebx
lea    0xee3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"calculate(%d): %d\0A\00"
define i32 @calculate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [19 x i8] c"calculate(%d): %d\0A\00"
define i32 @calculate(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret i32 %2
}
int cairo_code_draw_envOutLabel_get_height() { return 12; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envOutLabel_get_height() {
ret i32 12
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envOutLabel_get_height() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGetKeyboardMapping() {
  printf("XGetKeyboardMapping called\n");
  return 0;
}


x86 assembly (clang, -O0):
<XGetKeyboardMapping>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [28 x i8] c"XGetKeyboardMapping called\0A\00"
define i32 @XGetKeyboardMapping() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"XGetKeyboardMapping called\00"
define i32 @XGetKeyboardMapping() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int ls_cost_nm5_n_in(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm5_n_in() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm5_n_in() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sig_fpe() { printf("calls sig_fpe...\n"); }


x86 assembly (clang, -O0):
<sig_fpe>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [18 x i8] c"calls sig_fpe...\0A\00"
define void @sig_fpe() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"calls sig_fpe...\00"
define void @sig_fpe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int sltu(int register2, int register3) {
  if (register2 < register3) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<sltu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <sltu+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <sltu+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sltu>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @sltu(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @sltu(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lgen2(char *, int, int);
void cgcase(int v, int l) { lgen2("dw\t%d,%c%d", v, l); }


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

x86 assembly (clang, -O2):
<cgcase>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <lgen2@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"dw\09%d,%c%d\00"
define void @cgcase(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 @lgen2(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"dw\09%d,%c%d\00"
define void @cgcase(i32 %0, i32 %1) {
%3 = tail call i32 @lgen2(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int getDelay(int level) {
  switch (level) {
  case 2:
    return 10;
  case 3:
    return 7;
  case 4:
    return 5;
  default:
    return 2;
  }
}


x86 assembly (clang, -O0):
<getDelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2,%eax
je     113d <getDelay+0x3d>
jmp    111b <getDelay+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1149 <getDelay+0x49>
jmp    112c <getDelay+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1155 <getDelay+0x55>
jmp    1161 <getDelay+0x61>
movl   $0xa,-0x4(%rbp)
jmp    1168 <getDelay+0x68>
movl   $0x7,-0x4(%rbp)
jmp    1168 <getDelay+0x68>
movl   $0x5,-0x4(%rbp)
jmp    1168 <getDelay+0x68>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@switch.table.getDelay = [3 x i32] [i32 10, i32 7, i32 5]
define i32 @getDelay(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.getDelay, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 2, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
int16_t clearBit_fun_int16_t(int16_t x, uint32_t i) { return x & ~(1 << i); }


x86 assembly (clang, -O0):
<clearBit_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBit_fun_int16_t>:
mov    %edi,%eax
btr    %esi,%eax
ret

LLVM IR (-O0):
define i32 @clearBit_fun_int16_t(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 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @clearBit_fun_int16_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
int g_is_not_equal_f(float s, float d) { return (s != d); }


x86 assembly (clang, -O0):
<g_is_not_equal_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_is_not_equal_f>:
cmpneqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @g_is_not_equal_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp une float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @g_is_not_equal_f(float %0, float %1) {
%3 = fcmp une float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint64_t value_rescale(uint32_t value, uint32_t old_unit_reversal,
                       uint16_t new_unit_reversal) {
  return (uint64_t)((((uint64_t)value * new_unit_reversal) +
                     ((old_unit_reversal) / 2)) /
                    (old_unit_reversal));
}


x86 assembly (clang, -O0):
<value_rescale>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_rescale>:
imul   %edx,%edi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
add    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @value_rescale(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 2
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @value_rescale(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %0
%5 = sdiv i32 %1, 2
%6 = add nsw i32 %4, %5
%7 = sdiv i32 %6, %1
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
int /*<<< orphan*/ DoLayout(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ False;
void RefigureLocations(Widget w) { DoLayout(w, False); }


x86 assembly (clang, -O0):
<RefigureLocations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <DoLayout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RefigureLocations>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <DoLayout@plt>

LLVM IR (-O0):
@False = global i32 0
define void @RefigureLocations(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @False
%5 = call i32 @DoLayout(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@False = global i32 0
define void @RefigureLocations(i32 %0) {
%2 = load i32, i32* @False
%3 = tail call i32 @DoLayout(i32 %0, i32 %2)
ret void
}
void vdoa_context_destroy(struct vdoa_ctx *ctx) {}


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

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

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

LLVM IR (-O2):
%struct.vdoa_ctx = type opaque
define void @vdoa_context_destroy(%struct.vdoa_ctx* nocapture %0) {
ret void
}
unsigned long __arch_copy_from_user(void *x, void *y, unsigned long z) {
  unsigned long a;
  return a;
}


x86 assembly (clang, -O0):
<__arch_copy_from_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @__arch_copy_from_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("You must pass the name .path file as an argument\n");
  printf("./run_analysis filename.path\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"You must pass the name .path file as an argument\0A\00"
@.str.1 = [30 x i8] c"./run_analysis filename.path\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [49 x i8] c"You must pass the name .path file as an argument\00"
@str.2 = [29 x i8] c"./run_analysis filename.path\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_map_hint_chr(long, long);
int /*<<< orphan*/ show_map_hint_obj(long, long);
void show_map_hint(long x, long y) {
  show_map_hint_chr(x, y);
  show_map_hint_obj(x, y);
}


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

x86 assembly (clang, -O2):
<show_map_hint>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <show_map_hint_chr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <show_map_hint_obj@plt>

LLVM IR (-O0):
define void @show_map_hint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @show_map_hint_chr(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @show_map_hint_obj(i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @show_map_hint(i64 %0, i64 %1) {
%3 = tail call i32 @show_map_hint_chr(i64 %0, i64 %1)
%4 = tail call i32 @show_map_hint_obj(i64 %0, i64 %1)
ret void
}
int compare_short(const void *s1, const void *s2) {
  short a, b;
  a = (long)s1;
  b = (long)s2;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<compare_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    %ax,-0x14(%rbp)
movswl -0x12(%rbp),%eax
movswl -0x14(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movswl -0x12(%rbp),%ecx
movswl -0x14(%rbp),%edx
cmp    %edx,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_short>:
movswl %di,%ecx
movswl %si,%edx
xor    %eax,%eax
xor    %esi,%esi
cmp    %edx,%ecx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @compare_short(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i16
store i16 %9, i16* %5
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
%12 = trunc i64 %11 to i16
store i16 %12, i16* %6
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = load i16, i16* %6
%16 = sext i16 %15 to i32
%17 = icmp sgt i32 %14, %16
%18 = zext i1 %17 to i32
%19 = load i16, i16* %5
%20 = sext i16 %19 to i32
%21 = load i16, i16* %6
%22 = sext i16 %21 to i32
%23 = icmp slt i32 %20, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %18, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_short(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = shl i32 %4, 16
%8 = ashr exact i32 %7, 16
%9 = shl i32 %6, 16
%10 = ashr exact i32 %9, 16
%11 = icmp sgt i32 %8, %10
%12 = zext i1 %11 to i32
%13 = icmp slt i32 %8, %10
%14 = sext i1 %13 to i32
%15 = add nsw i32 %14, %12
ret i32 %15
}
long hash_sdbm(const char *str) {
  long hash = 0;
  int c;
  while ((c = *str++))
    hash = c + (hash << 6) + (hash << 16) - hash;
  return hash;
}


x86 assembly (clang, -O0):
<hash_sdbm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1155 <hash_sdbm+0x55>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_sdbm+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sdbm>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <hash_sdbm+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_sdbm+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_sdbm(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ compare_results(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ printf(char *, unsigned char *);
int check_KAT(unsigned char *result, unsigned char *expected_result, int length,
              unsigned char *testname) {
  if (!compare_results(result, expected_result, length)) {
    printf("%s failed!\n", testname);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_KAT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <compare_results@plt>
cmp    $0x0,%eax
jne    116c <check_KAT+0x4c>
mov    -0x28(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1173 <check_KAT+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_KAT>:
push   %rbx
mov    %rcx,%rbx
call   1040 <compare_results@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1133 <check_KAT+0x13>
pop    %rbx
ret
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s failed!\0A\00"
define i32 @check_KAT(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @compare_results(i8* %0, i8* %1, i32 %2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, double);
void print_len_sides(double *sides) {
  for (int i = 0; i < 3; i++) {
    printf("The len of the side %d is %.2lf\n", i + 1, sides[i]);
  }
}


x86 assembly (clang, -O0):
<print_len_sides>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    115a <print_len_sides+0x4a>
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_len_sides+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_len_sides>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
lea    0xede(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
movsd  0x8(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
movsd  0x10(%rbx),%xmm0
mov    %r14,%rdi
mov    $0x3,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"The len of the side %d is %.2lf\0A\00"
define void @print_len_sides(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 1, double %2)
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 2, double %5)
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 3, double %8)
ret void
}
/* Variables and functions */
scalar_t__ memcmp(void const *, void const *, int);
int gfarm_hash_key_equal_default(const void *key1, int key1len,
                                 const void *key2, int key2len) {
  return (key1len == key2len && memcmp(key1, key2, key1len) == 0);
}


x86 assembly (clang, -O0):
<gfarm_hash_key_equal_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x1c(%rbp),%ecx
mov    %al,-0x1d(%rbp)
jne    1151 <gfarm_hash_key_equal_default+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfarm_hash_key_equal_default>:
xor    %eax,%eax
cmp    %ecx,%esi
jne    1134 <gfarm_hash_key_equal_default+0x24>
push   %rax
mov    %esi,%r8d
mov    %rdx,%rsi
mov    %r8d,%edx
call   1030 <memcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @gfarm_hash_key_equal_default(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %7
%15 = load i32, i32* %6
%16 = call i64 @memcmp(i8* %13, i8* %14, i32 %15)
%17 = icmp eq i64 %16, 0
br label %18
18: ; preds = %12, %4
%19 = phi i1 [ false, %4 ], [ %17, %12 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @gfarm_hash_key_equal_default(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = icmp eq i32 %1, %3
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i64 @memcmp(i8* %0, i8* %2, i32 %1)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ 0, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ **);
int /*<<< orphan*/ ustringClear(int /*<<< orphan*/ **);
void ustringDestroy(wchar_t **data) {
  ustringClear(data);
  free(data);
}


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

x86 assembly (clang, -O2):
<ustringDestroy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ustringClear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ustringDestroy(i32** %0) {
%2 = tail call i32 @ustringClear(i32** %0)
%3 = tail call i32 @free(i32** %0)
ret void
}
void primitive_fixnum_not_impl(void) {
  drepl(tag_fixnum(~untag_fixnum_fast(dpeek())));
}


x86 assembly (clang, -O0):
<primitive_fixnum_not_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <untag_fixnum_fast@plt>
mov    %eax,%edi
xor    $0xffffffff,%edi
mov    $0x0,%al
call   1050 <tag_fixnum@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1060 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_fixnum_not_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1040 <untag_fixnum_fast@plt>
not    %eax
mov    %eax,%edi
xor    %eax,%eax
call   1050 <tag_fixnum@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1060 <drepl@plt>

LLVM IR (-O0):
define void @primitive_fixnum_not_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 (i32, ...) bitcast (i32 (...)* @untag_fixnum_fast to i32 (i32, ...)*)(i32 %1)
%3 = xor i32 %2, -1
%4 = call i32 (i32, ...) bitcast (i32 (...)* @tag_fixnum to i32 (i32, ...)*)(i32 %3)
%5 = call i32 (i32, ...) bitcast (i32 (...)* @drepl to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @primitive_fixnum_not_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @untag_fixnum_fast to i32 (i32, ...)*)(i32 %1)
%3 = xor i32 %2, -1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @tag_fixnum to i32 (i32, ...)*)(i32 %3)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @drepl to i32 (i32, ...)*)(i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ _leak_malloc(int, scalar_t__, char const *, int);
char *strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *_new_string(const char *s, const char *fname, int l_nmb) {
  return strcpy((char *)(_leak_malloc(1, strlen(s) + 1, fname, l_nmb)), s);
}


x86 assembly (clang, -O0):
<_new_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%edi
call   1050 <_leak_malloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_new_string>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1050 <_leak_malloc@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @_new_string(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 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i64 @_leak_malloc(i32 1, i64 %9, i8* %10, i32 %11)
%13 = inttoptr i64 %12 to i8*
%14 = load i8*, i8** %4
%15 = call i8* @strcpy(i8* %13, i8* %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @_new_string(i8* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @_leak_malloc(i32 1, i64 %5, i8* %1, i32 %2)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* dereferenceable(1) %0)
ret i8* %7
}