xunge/DecIR huggingface dataset:
/* Type definitions */
union bpf_attr {
  int map_fd;
  void *value;
  void *key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_LOOKUP_ELEM;
int /*<<< orphan*/ bzero(union bpf_attr *, int);
void *ptr_to_u64(void *);
int sys_bpf(int /*<<< orphan*/, union bpf_attr *, int);
int bpf_map_lookup_elem(int fd, const void *key, void *value) {
  union bpf_attr attr;
  bzero(&attr, sizeof(attr));
  attr.map_fd = fd;
  attr.key = ptr_to_u64(key);
  attr.value = ptr_to_u64(value);
  return sys_bpf(BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_map_lookup_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
call   1050 <bzero@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
mov    $0x8,%edx
call   1030 <sys_bpf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_lookup_elem>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%rdi
call   1040 <ptr_to_u64@plt>
mov    %rbx,%rdi
call   1040 <ptr_to_u64@plt>
mov    %rax,0x8(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    $0x8,%edx
call   1030 <sys_bpf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i8* }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_map_lookup_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i32 @bzero(%union.bpf_attr* %7, i32 8)
%9 = load i32, i32* %4
%10 = bitcast %union.bpf_attr* %7 to i32*
store i32 %9, i32* %10
%11 = load i8*, i8** %5
%12 = call i8* @ptr_to_u64(i8* %11)
%13 = bitcast %union.bpf_attr* %7 to i8**
store i8* %12, i8** %13
%14 = load i8*, i8** %6
%15 = call i8* @ptr_to_u64(i8* %14)
%16 = bitcast %union.bpf_attr* %7 to i8**
store i8* %15, i8** %16
%17 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%18 = call i32 @sys_bpf(i32 %17, %union.bpf_attr* %7, i32 8)
ret i32 %18
}

LLVM IR (-O2):
%union.bpf_attr = type { i8* }
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_map_lookup_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = tail call i8* @ptr_to_u64(i8* %1)
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%8 = tail call i8* @ptr_to_u64(i8* %2)
store i8* %8, i8** %7
%9 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%10 = call i32 @sys_bpf(i32 %9, %union.bpf_attr* %4, i32 8)
ret i32 %10
}
void glwin_destroy(void *voidhandle) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @glwin_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
void *freeipmi_memset(void *s, int c, size_t n) {
  while (0 <= --n)
    ((unsigned char *)s)[n] = (unsigned char)c;
  return s;
}


x86 assembly (clang, -O0):
<freeipmi_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
ja     113b <freeipmi_memset+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    110f <freeipmi_memset+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeipmi_memset>:
lea    (%rdx,%rdi,1),%rax
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax,%rax,1)
mov    %sil,(%rax)
add    $0xffffffffffffffff,%rax
jmp    1110 <freeipmi_memset+0x10>

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

LLVM IR (-O2):
define noalias i8* @freeipmi_memset(i8* nocapture writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %2, %3 ], [ %7, %5 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %4, i8* %8
br label %5
}
/* Variables and functions */
char *_ioctl_backing_file(char const *);
char *_sysfs_backing_file(char const *);
char *crypt_loop_backing_file(const char *loop) {
  char *bf = _sysfs_backing_file(loop);
  return bf ?: _ioctl_backing_file(loop);
}


x86 assembly (clang, -O0):
<crypt_loop_backing_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_sysfs_backing_file@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1158 <crypt_loop_backing_file+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1165 <crypt_loop_backing_file+0x45>
mov    -0x8(%rbp),%rdi
call   1030 <_ioctl_backing_file@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_loop_backing_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_sysfs_backing_file@plt>
test   %rax,%rax
je     1130 <crypt_loop_backing_file+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <_ioctl_backing_file@plt>

LLVM IR (-O0):
define i8* @crypt_loop_backing_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @_sysfs_backing_file(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i8* @_ioctl_backing_file(i8* %10)
br label %12
12: ; preds = %9, %8
%13 = phi i8* [ %6, %8 ], [ %11, %9 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @crypt_loop_backing_file(i8* %0) {
%2 = tail call i8* @_sysfs_backing_file(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @_ioctl_backing_file(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void parse(char token[], char *toktype) {
  printf("Token: %s Tokentype: %s\n", token, toktype);
}


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

x86 assembly (clang, -O2):
<parse>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Token: %s Tokentype: %s\0A\00"
define void @parse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Token: %s Tokentype: %s\0A\00"
define void @parse(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
long unsigned int yystrlen(const char *yystr) {
  const char *yys = yystr;
  while (*yys++ != '\0')
    continue;
  return yys - yystr - 1;
}


x86 assembly (clang, -O0):
<yystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <yystrlen+0x30>
jmp    1110 <yystrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yystrlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <yystrlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @yystrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
ret i64 %11
}
/* Variables and functions */
double cos(double);
double sin(double);
double tan(double x) {
  if (x == 90)
    return 4294967296.0;
  else if (x == -90)
    return -4294967296.0;
  return sin(x) / cos(x);
}


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    115c <tan+0x3c>
jp     115c <tan+0x3c>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ba <tan+0x9a>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    118b <tan+0x6b>
jp     118b <tan+0x6b>
movsd  0xe8f(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ba <tan+0x9a>
jmp    1190 <tan+0x70>
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
sub    $0x18,%rsp
ucomisd 0xedc(%rip),%xmm0
jne    113d <tan+0x1d>
jp     113d <tan+0x1d>
movsd  0xec8(%rip),%xmm0
add    $0x18,%rsp
ret
ucomisd 0xed3(%rip),%xmm0
jne    1156 <tan+0x36>
jp     1156 <tan+0x36>
movsd  0xebf(%rip),%xmm0
add    $0x18,%rsp
ret
movsd  %xmm0,0x8(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <cos@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 9.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0x41F0000000000000, double* %2
br label %18
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp oeq double %8, -9.000000e+01
br i1 %9, label %10, label %11
10: ; preds = %7
store double 0xC1F0000000000000, double* %2
br label %18
11: ; preds = %7
br label %12
12: ; preds = %11
%13 = load double, double* %3
%14 = call double @sin(double %13)
%15 = load double, double* %3
%16 = call double @cos(double %15)
%17 = fdiv double %14, %16
store double %17, double* %2
br label %18
18: ; preds = %12, %10, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = fcmp oeq double %0, 9.000000e+01
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = fcmp oeq double %0, -9.000000e+01
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call double @sin(double %0)
%7 = tail call double @cos(double %0)
%8 = fdiv double %6, %7
br label %9
9: ; preds = %3, %1, %5
%10 = phi double [ %8, %5 ], [ 0x41F0000000000000, %1 ], [ 0xC1F0000000000000, %3 ]
ret double %10
}
/* Variables and functions */
unsigned int const mus_char_to_ubint(unsigned char const *);
unsigned int const mus_char_to_ulint(unsigned char const *);
int equal_big_or_little_endian(const unsigned char *n1, const unsigned int n2) {
  return ((mus_char_to_ubint(n1) == n2) || (mus_char_to_ulint(n1) == n2));
}


x86 assembly (clang, -O0):
<equal_big_or_little_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mus_char_to_ubint@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
je     115a <equal_big_or_little_endian+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <mus_char_to_ulint@plt>
cmp    -0xc(%rbp),%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_big_or_little_endian>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <mus_char_to_ubint@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ebp,%ecx
je     1149 <equal_big_or_little_endian+0x29>
mov    %rbx,%rdi
call   1030 <mus_char_to_ulint@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @equal_big_or_little_endian(i8* %0, i32 %1) {
%3 = tail call i32 @mus_char_to_ubint(i8* %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @mus_char_to_ulint(i8* %0)
%7 = icmp eq i32 %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int _execve(char *name, char **argv, char **env) {
  (void)(name);
  (void)(argv);
  (void)(env);
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<_execve>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i8**, i8*** %6
%10 = load i32, i32* @ENOMEM
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @_execve(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = load i32, i32* @ENOMEM
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
char *str_sub(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ tripleDES_ECB_encrypt(char *, char *, char *);
int computeKCV(char *key, char *kcv) {
  char buf[8 * 2 + 1] = "", *kcv_temp;
  tripleDES_ECB_encrypt("0000000000000000", key, buf);
  kcv_temp = str_sub(buf, 0, 5);
  strncpy(kcv, kcv_temp, 6);
  return 1;
}


x86 assembly (clang, -O0):
<computeKCV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x11,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    0xe91(%rip),%rdi
call   1050 <tripleDES_ECB_encrypt@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1060 <str_sub@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0x6,%edx
call   1030 <strncpy@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeKCV>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
lea    0xeb0(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <tripleDES_ECB_encrypt@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <str_sub@plt>
mov    %r14,%rdi
mov    %rax,%rsi
mov    $0x6,%edx
call   1030 <strncpy@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0000000000000000\00"
define i32 @computeKCV(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [17 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = bitcast [17 x i8]* %5 to i8*
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 0
%10 = call i32 @tripleDES_ECB_encrypt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [17 x i8], [17 x i8]* %5, i64 0, i64 0
%12 = call i8* @str_sub(i8* %11, i32 0, i32 5)
store i8* %12, i8** %6
%13 = load i8*, i8** %4
%14 = load i8*, i8** %6
%15 = call i32 @strncpy(i8* %13, i8* %14, i32 6)
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"0000000000000000\00"
define i32 @computeKCV(i8* %0, i8* %1) {
%3 = alloca [17 x i8]
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%5 = call i32 @tripleDES_ECB_encrypt(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = call i8* @str_sub(i8* %4, i32 0, i32 5)
%7 = call i32 @strncpy(i8* %1, i8* %6, i32 6)
ret i32 1
}
int close_fail(int fd) {
  do {
    debug_printf("***** %s:%s() called. Something is probably wrong! Maybe "
                 "you forgot to call vfs_init().\n",
                 "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/BarrelfishOS/barrelfish/"
                 "refs/heads/master/lib/libc/sys/barrelfish/posix_syscalls.c",
                 __FUNCTION__);
    return -1;
  } while (0);
}


x86 assembly (clang, -O0):
<close_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xf30(%rip),%rsi
lea    0xfd6(%rip),%rdx
mov    $0x0,%al
call   1030 <debug_printf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_fail>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf3a(%rip),%rsi
lea    0xfe0(%rip),%rdx
xor    %eax,%eax
call   1030 <debug_printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [89 x i8] c"***** %s:%s() called. Something is probably wrong! Maybe you forgot to call vfs_init().\0A\00"
@.str.1 = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/BarrelfishOS/barrelfish/refs/heads/master/lib/libc/sys/barrelfish/posix_syscalls.c\00"
@__FUNCTION__.close_fail = [11 x i8] c"close_fail\00"
define i32 @close_fail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @debug_printf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.close_fail, i64 0, i64 0))
br label %5
5: ; preds = %3
ret i32 -1
}

LLVM IR (-O2):
@.str = [89 x i8] c"***** %s:%s() called. Something is probably wrong! Maybe you forgot to call vfs_init().\0A\00"
@.str.1 = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/BarrelfishOS/barrelfish/refs/heads/master/lib/libc/sys/barrelfish/posix_syscalls.c\00"
@__FUNCTION__.close_fail = [11 x i8] c"close_fail\00"
define i32 @close_fail(i32 %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @debug_printf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.close_fail, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_authkey_load() {
  printf("NOT IMPLEMENTED:"
         "pa_authkey_load"
         "\n");
}


x86 assembly (clang, -O0):
<pa_authkey_load>:
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):
<pa_authkey_load>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_authkey_load\00"
define i32 @pa_authkey_load() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free_ptr_array(void **ptr_array, int size) {
  for (int i = 0; i < size; i++) {
    free(ptr_array[i]);
  }
  free(ptr_array);
}


x86 assembly (clang, -O0):
<free_ptr_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_ptr_array+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_ptr_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ptr_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_ptr_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_ptr_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_ptr_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @free(i8** %0)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = bitcast i8** %10 to i8***
%12 = load i8**, i8*** %11
%13 = tail call i32 @free(i8** %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
void checkssym(sym) char *sym;
{ (void)checksym(sym, 0); }


x86 assembly (clang, -O0):
<checkssym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <checksym@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkssym>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <checksym@plt>

LLVM IR (-O0):
define void @checkssym(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @checksym to i32 (i8*, i32, ...)*)(i8* %3, i32 0)
ret void
}

LLVM IR (-O2):
define void @checkssym(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @checksym to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret void
}
/* Variables and functions */
int log2(int x) {
  int i;
  x--;
  for (i = 0; x != 0; i++)
    x >>= 1;
  return (i);
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1138 <log2+0x38>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1117 <log2+0x17>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
xor    %eax,%eax
add    $0xffffffff,%edi
je     111c <log2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = ashr i32 %6, 1
%8 = add nuw nsw i32 %5, 1
%9 = icmp ult i32 %6, 2
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Type definitions */
typedef int ulong;

/* Variables and functions */
ulong mhash(ulong h) { return h ^ (h >> 16); }


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

x86 assembly (clang, -O2):
<mhash>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @mhash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 16
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @mhash(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
ret i32 %3
}
double gamma(double x) { return 0.0; }


x86 assembly (clang, -O0):
<gamma>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamma>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @gamma(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @gamma(double %0) {
ret double 0.000000e+00
}
int fun(int i, int *a) { return a[0] + a[16] + a[1] + a[17]; }


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    0x40(%rcx),%eax
mov    -0x10(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
add    0x44(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
mov    0x40(%rsi),%eax
add    (%rsi),%eax
add    0x4(%rsi),%eax
add    0x44(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @fun(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 16
%10 = load i32, i32* %9
%11 = add nsw i32 %7, %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = add nsw i32 %11, %14
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i64 17
%18 = load i32, i32* %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @fun(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 16
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = getelementptr inbounds i32, i32* %1, i64 17
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
ret i32 %12
}
void DMA1_Channel5_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Channel5_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *dec2hex(int decimal) {
  static char hx[256];
  sprintf(hx, "%02x", decimal);
  return hx;
}


x86 assembly (clang, -O0):
<dec2hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec2hex>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@dec2hex.hx = internal global [256 x i8] zeroinitializer
@.str = [5 x i8] c"%02x\00"
define i8* @dec2hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dec2hex.hx, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dec2hex.hx, i64 0, i64 0)
}

LLVM IR (-O2):
@dec2hex.hx = internal global [256 x i8] zeroinitializer
@.str = [5 x i8] c"%02x\00"
define i8* @dec2hex(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @dec2hex.hx, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @dec2hex.hx, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ is_rotation(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *s1 = "waterbottle";
  char *s2 = "erbottlewat";
  if (is_rotation(s1, s2)) {
    printf("%s is a rotation of %s\n", s2, s1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <is_rotation@plt>
cmp    $0x0,%rax
je     1170 <main+0x50>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1040 <is_rotation@plt>
test   %rax,%rax
je     1153 <main+0x33>
lea    0xed8(%rip),%rdi
lea    0xec5(%rip),%rsi
lea    0xeb2(%rip),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"waterbottle\00"
@.str.1 = [12 x i8] c"erbottlewat\00"
@.str.2 = [24 x i8] c"%s is a rotation of %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i64 @is_rotation(i8* %4, i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %10)
br label %12
12: ; preds = %8, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"waterbottle\00"
@.str.1 = [12 x i8] c"erbottlewat\00"
@.str.2 = [24 x i8] c"%s is a rotation of %s\0A\00"
define i32 @main() {
%1 = tail call i64 @is_rotation(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ i2x(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  fprintf(stderr, "2");
  i2x(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <i2x@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <i2x@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"2\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @i2x(i32 2)
ret i32 0
}
void change_bit(int nr, volatile unsigned long *addr) {
  asm volatile("btc %1,%0" : "+m"(*(volatile long *)(addr)) : "Ir"(nr));
}


x86 assembly (clang, -O0):
<change_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
btc    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<change_bit>:
btc    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @change_bit(i32 %0, i64* %1) {
tail call void asm sideeffect "btc $1,$0", "=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_bytes(void *, int);
int /*<<< orphan*/ assert(int);
void tglt_secure_random(void *s, int l) {
  if (RAND_bytes(s, l) <= 0) {
    assert(0 && "End of random. If you want, you can start with -w");
  }
}


x86 assembly (clang, -O0):
<tglt_secure_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <RAND_bytes@plt>
cmp    $0x0,%rax
jg     114c <tglt_secure_random+0x2c>
xor    %edi,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tglt_secure_random>:
push   %rax
call   1030 <RAND_bytes@plt>
test   %rax,%rax
jle    112d <tglt_secure_random+0xd>
pop    %rax
ret
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @tglt_secure_random(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @RAND_bytes(i8* %5, i32 %6)
%8 = icmp sle i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @assert(i32 0)
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @tglt_secure_random(i8* %0, i32 %1) {
%3 = tail call i64 @RAND_bytes(i8* %0, i32 %1)
%4 = icmp slt i64 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @assert(i32 0)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap4(int *, int *);
int main(int argc, char **argv) {
  int u;
  int t;
  u = 17;
  t = -96;
  printf("before swap4: u = %d , t = %d \n", u, t);
  swap4(&u, &t);
  printf("after  swap4: u = %d , t = %d \n", u, t);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x11,-0x14(%rbp)
movl   $0xffffffa0,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <swap4@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x11,0x4(%rsp)
movl   $0xffffffa0,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x11,%esi
mov    $0xffffffa0,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap4@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"before swap4: u = %d , t = %d \0A\00"
@.str.1 = [32 x i8] c"after swap4: u = %d , t = %d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 17, i32* %6
store i32 -96, i32* %7
%8 = load i32, i32* %6
%9 = load i32, i32* %7
%10 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
%11 = call i32 @swap4(i32* %6, i32* %7)
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@.str = [32 x i8] c"before swap4: u = %d , t = %d \0A\00"
@.str.1 = [32 x i8] c"after swap4: u = %d , t = %d \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 17, i32* %3
store i32 -96, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 17, i32 -96)
%8 = call i32 @swap4(i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}
int equal_int(void *ip, void *jp) {
  int *ipI = (int *)ip;
  int *jpI = (int *)jp;
  if (*ipI == *jpI) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    113a <equal_int+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <equal_int+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
char byte(int bnum, unsigned int val) {
  char retval = ((val & (0xFF << (8 * bnum))) >> (8 * bnum));
  return (((retval < ' ') || (retval >= 0x7F)) ? '.' : retval);
}


x86 assembly (clang, -O0):
<byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xff,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
shr    %cl,%eax
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jl     1143 <byte+0x43>
movsbl -0x9(%rbp),%eax
cmp    $0x7f,%eax
jl     1150 <byte+0x50>
mov    $0x2e,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <byte+0x57>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte>:
lea    0x0(,%rdi,8),%ecx
mov    $0xff,%edx
shl    %cl,%edx
and    %esi,%edx
shr    %cl,%edx
mov    %edx,%eax
shl    $0x18,%eax
add    $0x81ffffff,%eax
cmp    $0xa1ffffff,%eax
mov    $0x2e,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = mul nsw i32 8, %7
%9 = shl i32 255, %8
%10 = and i32 %6, %9
%11 = load i32, i32* %3
%12 = mul nsw i32 8, %11
%13 = lshr i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %16, 32
br i1 %17, label %22, label %18
18: ; preds = %2
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 127
br i1 %21, label %22, label %23
22: ; preds = %18, %2
br label %26
23: ; preds = %18
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
br label %26
26: ; preds = %23, %22
%27 = phi i32 [ 46, %22 ], [ %25, %23 ]
%28 = trunc i32 %27 to i8
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @byte(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 3
%4 = shl i32 255, %3
%5 = and i32 %4, %1
%6 = lshr i32 %5, %3
%7 = shl i32 %6, 24
%8 = add i32 %7, -2113929217
%9 = icmp ult i32 %8, -1577058305
%10 = trunc i32 %6 to i8
%11 = select i1 %9, i8 46, i8 %10
ret i8 %11
}
/* Type definitions */
struct crk5_exl_pi {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct crk5_exl_pi *);
void crk5_exl_pi_delete(struct crk5_exl_pi *exl) {
  if (!exl)
    return;
  free(exl);
}


x86 assembly (clang, -O0):
<crk5_exl_pi_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <crk5_exl_pi_delete+0x1c>
jmp    1135 <crk5_exl_pi_delete+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crk5_exl_pi_delete>:
test   %rdi,%rdi
je     111a <crk5_exl_pi_delete+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.crk5_exl_pi = type { i32 }
define void @crk5_exl_pi_delete(%struct.crk5_exl_pi* %0) {
%2 = alloca %struct.crk5_exl_pi*
store %struct.crk5_exl_pi* %0, %struct.crk5_exl_pi** %2
%3 = load %struct.crk5_exl_pi*, %struct.crk5_exl_pi** %2
%4 = icmp ne %struct.crk5_exl_pi* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.crk5_exl_pi*, %struct.crk5_exl_pi** %2
%8 = call i32 @free(%struct.crk5_exl_pi* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.crk5_exl_pi = type { i32 }
define void @crk5_exl_pi_delete(%struct.crk5_exl_pi* %0) {
%2 = icmp eq %struct.crk5_exl_pi* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.crk5_exl_pi* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRCORE_N16_swap(char *, int, int);
void U_WMRLINETO_swap(char *record, int torev) {
  U_WMRCORE_N16_swap(record, 2, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRLINETO_swap>:
mov    %esi,%edx
mov    $0x2,%esi
jmp    1030 <U_WMRCORE_N16_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRLINETO_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRCORE_N16_swap(i8* %0, i32 2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TimerModel_UpdateTime(int /*<<< orphan*/);
int /*<<< orphan*/ Timer_GetSystemTime();
void TimerConductor_Run(void) { TimerModel_UpdateTime(Timer_GetSystemTime()); }


x86 assembly (clang, -O0):
<TimerConductor_Run>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Timer_GetSystemTime@plt>
mov    %eax,%edi
call   1030 <TimerModel_UpdateTime@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerConductor_Run>:
push   %rax
xor    %eax,%eax
call   1040 <Timer_GetSystemTime@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <TimerModel_UpdateTime@plt>

LLVM IR (-O0):
define void @TimerConductor_Run() {
%1 = call i32 (...) @Timer_GetSystemTime()
%2 = call i32 @TimerModel_UpdateTime(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TimerConductor_Run() {
%1 = tail call i32 (...) @Timer_GetSystemTime()
%2 = tail call i32 @TimerModel_UpdateTime(i32 %1)
ret void
}
void call(unsigned long faddr) {
  void (*func)();
  func = (void *)faddr;
  func();
}


x86 assembly (clang, -O0):
<call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call>:
xor    %eax,%eax
jmp    *%rdi

LLVM IR (-O0):
define void @call(i64 %0) {
%2 = alloca i64
%3 = alloca void (...)*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = inttoptr i64 %4 to i8*
%6 = bitcast i8* %5 to void (...)*
store void (...)* %6, void (...)** %3
%7 = load void (...)*, void (...)** %3
ret void
}

LLVM IR (-O2):
define void @call(i64 %0) {
%2 = inttoptr i64 %0 to void (...)*
tail call void (...) %2()
ret void
}