xunge/DecIR huggingface dataset:
/* Variables and functions */
int read(unsigned long, void *, unsigned long);
int OS_file_read(unsigned long file_handle, void *p_data,
                 unsigned long length) {
  if (-1 == read(file_handle, p_data, length))
    return 0x1004;
  return 0;
}


x86 assembly (clang, -O0):
<OS_file_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1150 <OS_file_read+0x40>
movl   $0x1004,-0x4(%rbp)
jmp    1157 <OS_file_read+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_file_read>:
push   %rax
call   1030 <read@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
mov    $0x1004,%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @OS_file_read(i64 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i64 %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, -1
%6 = select i1 %5, i32 4100, i32 0
ret i32 %6
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
uint32_t string_hash(const void *item) {
  unsigned long h;
  char *string = (char *)item;
  h = 0;
  while (*string) {
    h = h * 37UL + (char)*string++;
  }
  return h;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <string_hash+0x49>
imul   $0x25,-0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <string_hash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <string_hash+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,8),%rdx
lea    (%rax,%rdx,4),%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @string_hash(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* [ %9, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = mul i64 %7, 37
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = load i8, i8* %9
%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
}
int test_imm_00int64_midword_reg(long long val) {
  return ((val >> 16) & (0x00 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 0
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_00int64_midword_reg(i64 %0) {
ret i32 -40
}
int gbspos2col(pos)
int pos;
{ return (1 + (pos % 64)); }


x86 assembly (clang, -O0):
<gbspos2col>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gbspos2col>:
lea    0x3f(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xffffffc0,%eax
neg    %eax
add    %edi,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @gbspos2col(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 64
%5 = add nsw i32 1, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @gbspos2col(i32 %0) {
%2 = srem i32 %0, 64
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int getch();
int crl_get_ch(void) { return getch(); }


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

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

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

LLVM IR (-O2):
define i32 @crl_get_ch() {
%1 = tail call i32 (...) @getch()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *path, mode_t mode) {
  extern int creat_bits;
  return open(path, creat_bits, mode);
}


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

x86 assembly (clang, -O2):
<creat>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@creat_bits = external global i32
define i32 @creat(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* @creat_bits
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@creat_bits = external global i32
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @creat_bits
%4 = tail call i32 @open(i8* %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ yogrt_set_fudge_factor(int);
int iyogrt_set_fudge_factor_(int *seconds) {
  yogrt_set_fudge_factor(*seconds);
  return *seconds;
}


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

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

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

LLVM IR (-O2):
define i32 @iyogrt_set_fudge_factor_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @yogrt_set_fudge_factor(i32 %2)
%4 = load i32, i32* %0
ret i32 %4
}
void exchange_member(int *arr, int x, int y) {
  int tmp = arr[x];
  arr[x] = arr[y];
  arr[y] = tmp;
  return;
}


x86 assembly (clang, -O0):
<exchange_member>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exchange_member>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @exchange_member(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @exchange_member(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ mkdir(char *, int);
bool files_mkdir(char *path) {
  assert(path);
  return mkdir(path, 0755) == 0;
}


x86 assembly (clang, -O0):
<files_mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_mkdir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @files_mkdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @mkdir(i8* %5, i32 493)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @files_mkdir(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i64 @mkdir(i8* %0, i32 493)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ sprintf(char *, char *, char);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *copy_token(char *start, size_t size) {
  char *token = malloc(size + sizeof(char));
  strncpy(token, start, size);
  sprintf(token + size, "%c", '\0');
  return token;
}


x86 assembly (clang, -O0):
<copy_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rdi
add    -0x10(%rbp),%rdi
lea    0xe8f(%rip),%rsi
xor    %edx,%edx
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_token>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movw   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @copy_token(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
%7 = getelementptr i8, i8* %6, i64 1
store i8 0, i8* %7
ret i8* %4
}
extern unsigned int hweight16(unsigned short w) {
  unsigned short res = (w & 0x5555) + ((w >> 1) & 0x5555);
  res = (res & 0x3333) + ((res >> 2) & 0x3333);
  res = (res & 0x0F0F) + ((res >> 4) & 0x0F0F);
  return (res & 0x00FF) + ((res >> 8) & 0x00FF);
}


x86 assembly (clang, -O0):
<hweight16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x5555,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x1,%ecx
and    $0x5555,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0x3333,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x3333,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xf0f,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf0f,%ecx
add    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
movzwl -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight16>:
mov    %edi,%eax
mov    %edi,%ecx
and    $0x5555,%ecx
shr    %eax
and    $0x5555,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x3333,%ecx
shr    $0x2,%eax
and    $0x3333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x707,%ecx
shr    $0x4,%eax
and    $0x707,%eax
add    %ecx,%eax
movzbl %al,%ecx
movzbl %ah,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = and i32 %5, 21845
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 1
%10 = and i32 %9, 21845
%11 = add nsw i32 %6, %10
%12 = trunc i32 %11 to i16
store i16 %12, i16* %3
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = and i32 %14, 13107
%16 = load i16, i16* %3
%17 = zext i16 %16 to i32
%18 = ashr i32 %17, 2
%19 = and i32 %18, 13107
%20 = add nsw i32 %15, %19
%21 = trunc i32 %20 to i16
store i16 %21, i16* %3
%22 = load i16, i16* %3
%23 = zext i16 %22 to i32
%24 = and i32 %23, 3855
%25 = load i16, i16* %3
%26 = zext i16 %25 to i32
%27 = ashr i32 %26, 4
%28 = and i32 %27, 3855
%29 = add nsw i32 %24, %28
%30 = trunc i32 %29 to i16
store i16 %30, i16* %3
%31 = load i16, i16* %3
%32 = zext i16 %31 to i32
%33 = and i32 %32, 255
%34 = load i16, i16* %3
%35 = zext i16 %34 to i32
%36 = ashr i32 %35, 8
%37 = and i32 %36, 255
%38 = add nsw i32 %33, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @hweight16(i16 zeroext %0) {
%2 = and i16 %0, 21845
%3 = lshr i16 %0, 1
%4 = and i16 %3, 21845
%5 = add nuw i16 %4, %2
%6 = and i16 %5, 13107
%7 = lshr i16 %5, 2
%8 = and i16 %7, 13107
%9 = add nuw nsw i16 %8, %6
%10 = and i16 %9, 1799
%11 = lshr i16 %9, 4
%12 = and i16 %11, 1799
%13 = add nuw nsw i16 %12, %10
%14 = zext i16 %13 to i32
%15 = and i32 %14, 15
%16 = lshr i32 %14, 8
%17 = add nuw nsw i32 %15, %16
ret i32 %17
}
float angle_wise(float angle1, float angle2) {
  if (angle1 > angle2) {
    return angle1 - angle2;
  } else {
    return angle1 + 2 * 3.14159265358979323846f - angle2;
  }
}


x86 assembly (clang, -O0):
<angle_wise>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <angle_wise+0x31>
movss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1148 <angle_wise+0x48>
movss  0xec7(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_wise>:
movss  0xef8(%rip),%xmm2
addss  %xmm0,%xmm2
movaps %xmm1,%xmm3
cmpltss %xmm0,%xmm3
andps  %xmm3,%xmm0
andnps %xmm2,%xmm3
orps   %xmm3,%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @angle_wise(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load float, float* %4
%11 = load float, float* %5
%12 = fsub float %10, %11
store float %12, float* %3
br label %18
13: ; preds = %2
%14 = load float, float* %4
%15 = fadd float %14, 0x401921FB60000000
%16 = load float, float* %5
%17 = fsub float %15, %16
store float %17, float* %3
br label %18
18: ; preds = %13, %9
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @angle_wise(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = fadd float %0, 0x401921FB60000000
%5 = select i1 %3, float %0, float %4
%6 = fsub float %5, %1
ret float %6
}
void my_fn(void) {}


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

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

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

LLVM IR (-O2):
define void @my_fn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ lcd_data(unsigned char);
void write(unsigned char *A) {
  while (*A != '\0') {
    lcd_data(*A);
    A++;
    delay(10);
  }
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1163 <write+0x43>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <lcd_data@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <delay@plt>
jmp    112c <write+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114d <write+0x2d>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1040 <lcd_data@plt>
mov    $0xa,%edi
call   1030 <delay@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <write+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @lcd_data(i8 zeroext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = call i32 @delay(i32 10)
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @lcd_data(i8 zeroext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @delay(i32 10)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("passage-b.c\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"passage-b.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"passage-b.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char const *getenv(char *);
const char *cgi_server_software(void) { return (getenv("SERVER_SOFTWARE")); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"SERVER_SOFTWARE\00"
define i8* @cgi_server_software() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [16 x i8] c"SERVER_SOFTWARE\00"
define i8* @cgi_server_software() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int get_digital_root_v2(int num) {
  if (num <= 0) {
    return (0);
  }
  if ((num % 9) == 0) {
    return (9);
  } else {
    return (num % 9);
  }
}


x86 assembly (clang, -O0):
<get_digital_root_v2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     111d <get_digital_root_v2+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    114b <get_digital_root_v2+0x4b>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113d <get_digital_root_v2+0x3d>
movl   $0x9,-0x4(%rbp)
jmp    114b <get_digital_root_v2+0x4b>
mov    -0x8(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_digital_root_v2>:
test   %edi,%edi
jle    111f <get_digital_root_v2+0x1f>
mov    %edi,%eax
imul   $0x38e38e39,%rax,%rax
shr    $0x21,%rax
lea    (%rax,%rax,8),%eax
sub    %eax,%edi
mov    $0x9,%eax
cmovne %edi,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_digital_root_v2(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = urem i32 %0, 9
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 9, i32 %4
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
char *gssalloc_malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *gssalloc_strdup(const char *str) {
  size_t size = strlen(str) + 1;
  char *copy = gssalloc_malloc(size);
  if (copy) {
    memcpy(copy, str, size);
    copy[size - 1] = '\0';
  }
  return copy;
}


x86 assembly (clang, -O0):
<gssalloc_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <gssalloc_malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1187 <gssalloc_strdup+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gssalloc_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
call   1050 <gssalloc_malloc@plt>
mov    %rax,%r15
test   %rax,%rax
je     1168 <gssalloc_strdup+0x38>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,-0x1(%rbx,%r15,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @gssalloc_strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @gssalloc_malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
%9 = add nsw i64 %4, -1
%10 = getelementptr inbounds i8, i8* %5, i64 %9
store i8 0, i8* %10
br label %11
11: ; preds = %7, %1
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int __xmknodat(int, int /*<<< orphan*/, char const *, int /*<<< orphan*/,
               int /*<<< orphan*/ *);
int __xmknod(int vers, const char *file_name, mode_t mode, dev_t *dev) {
  return __xmknodat(vers, AT_FDCWD, file_name, mode, dev);
}


x86 assembly (clang, -O0):
<__xmknod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <__xmknodat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__xmknod>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <__xmknodat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @__xmknod(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* @AT_FDCWD
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = call i32 @__xmknodat(i32 %9, i32 %10, i8* %11, i32 %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @__xmknod(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = load i32, i32* @AT_FDCWD
%6 = tail call i32 @__xmknodat(i32 %0, i32 %5, i8* %1, i32 %2, i32* %3)
ret i32 %6
}
int main(int x) {}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 0
}
void border_ne_ext_corner_special_sand_short_hori(unsigned char *pic,
                                                  unsigned char *mirr) {
  *pic = 0x2B;
  *mirr = 0x02;
}


x86 assembly (clang, -O0):
<border_ne_ext_corner_special_sand_short_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2b,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x2,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_ne_ext_corner_special_sand_short_hori>:
movb   $0x2b,(%rdi)
movb   $0x2,(%rsi)
ret

LLVM IR (-O0):
define void @border_ne_ext_corner_special_sand_short_hori(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
store i8 43, i8* %5
%6 = load i8*, i8** %4
store i8 2, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_ne_ext_corner_special_sand_short_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 43, i8* %0
store i8 2, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
void displayArray(int *array, int count) {
  for (int tabIndex = 0; tabIndex < count; ++tabIndex) {
    printf("array[%d] = %d\n", tabIndex, *(array++));
  }
}


x86 assembly (clang, -O0):
<displayArray>:
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    1160 <displayArray+0x50>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <displayArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <displayArray+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    1130 <displayArray+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"array[%d] = %d\0A\00"
define void @displayArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 0, %2 ]
%7 = phi i32* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %7
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9)
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %1
br i1 %12, label %4, label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, long, char *);
void dump_hdf5_l(char *name, long val, char *desc) {
  printf("HDF5:{'name':'%s','value':%ld,'desc':'%s'}:5FDH\n", name, val, desc);
}


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

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

LLVM IR (-O0):
@.str = [49 x i8] c"HDF5:{'name':'%s','value':%ld,'desc':'%s'}:5FDH\0A\00"
define void @dump_hdf5_l(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %7, i64 %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [49 x i8] c"HDF5:{'name':'%s','value':%ld,'desc':'%s'}:5FDH\0A\00"
define void @dump_hdf5_l(i8* %0, i64 %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void printMag(char *str) { printf("%s%s%s", "\x1B[35m", str, "\x1B[0m"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%s%s%s\00"
@.str.1 = [6 x i8] c"\1B[35m\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define void @printMag(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int timer(double *ttime) {
  clock_t temp;
  temp = clock();
  *ttime = ((double)temp) / CLOCKS_PER_SEC;
  return 0;
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x10(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
mov    0x2eb4(%rip),%rax
divsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @timer(double* %0) {
%2 = alloca double*
%3 = alloca i64
store double* %0, double** %2
%4 = call i64 (...) @clock()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = sitofp i64 %5 to double
%7 = load double, double* @CLOCKS_PER_SEC
%8 = fdiv double %6, %7
%9 = load double*, double** %2
store double %8, double* %9
ret i32 0
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define i32 @timer(double* nocapture writeonly %0) {
%2 = tail call i64 (...) @clock()
%3 = sitofp i64 %2 to double
%4 = load double, double* @CLOCKS_PER_SEC
%5 = fdiv double %3, %4
store double %5, double* %0
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int memcmp(void *, void *, int);
int addrcmp(uint8_t fam1, void *addr1, uint8_t fam2, void *addr2, int alen) {
  if (fam1 != fam2) {
    return fam1 - fam2;
  }
  return memcmp(addr1, addr2, alen);
}


x86 assembly (clang, -O0):
<addrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     114a <addrcmp+0x3a>
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    115d <addrcmp+0x4d>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
call   1030 <memcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addrcmp>:
cmp    %rdx,%rdi
jne    1123 <addrcmp+0x13>
mov    %rsi,%rdi
mov    %rcx,%rsi
mov    %r8d,%edx
jmp    1030 <memcmp@plt>
sub    %edx,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @addrcmp(i64 %0, i8* %1, i64 %2, i8* %3, i32 %4) {
%6 = icmp eq i64 %0, %2
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = sub nsw i64 %0, %2
%9 = trunc i64 %8 to i32
br label %12
10: ; preds = %5
%11 = tail call i32 @memcmp(i8* %1, i8* %3, i32 %4)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %9, %7 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int syscall(int, int, int, unsigned int);
int read(int fd, void *buffer, unsigned int size) {
  return syscall(3, fd, (int)buffer, size);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x3,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x3,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @read(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @syscall(i32 3, i32 %0, i32 %5, i32 %2)
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char fhex(const uint8_t v) {
  if (v < 10) {
    return (char)(v + '0');
  } else {
    return (char)(v + 'a' - 10);
  }
}


x86 assembly (clang, -O0):
<fhex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <fhex+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <fhex+0x2b>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fhex>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

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

LLVM IR (-O2):
define signext i8 @fhex(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int __net_recv_data(int, void *, unsigned int);
int net_recv_data(int fd, void *buf, unsigned int len) {
  return __net_recv_data(fd, buf, len);
}


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

x86 assembly (clang, -O2):
<net_recv_data>:
jmp    1030 <__net_recv_data@plt>

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

LLVM IR (-O2):
define i32 @net_recv_data(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @__net_recv_data(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ swift_inv_insn_tag(unsigned long);
void swift_flush_icache(void) {
  unsigned long addr;
  for (addr = 0; addr < 0x4000; addr += 0x20)
    swift_inv_insn_tag(addr);
}


x86 assembly (clang, -O0):
<swift_flush_icache>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
cmpq   $0x4000,-0x8(%rbp)
jae    1148 <swift_flush_icache+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <swift_inv_insn_tag@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <swift_flush_icache+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swift_flush_icache>:
push   %rbx
mov    $0xffffffffffffffe0,%rbx
nopl   0x0(%rax,%rax,1)
add    $0x20,%rbx
mov    %rbx,%rdi
call   1030 <swift_inv_insn_tag@plt>
cmp    $0x3fe0,%rbx
jb     1120 <swift_flush_icache+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @swift_flush_icache() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %8, %0
%3 = load i64, i64* %1
%4 = icmp ult i64 %3, 16384
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i64, i64* %1
%7 = call i32 @swift_inv_insn_tag(i64 %6)
br label %8
8: ; preds = %5
%9 = load i64, i64* %1
%10 = add i64 %9, 32
store i64 %10, i64* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @swift_flush_icache() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @swift_inv_insn_tag(i64 %2)
%4 = add nuw nsw i64 %2, 32
%5 = icmp ult i64 %2, 16352
br i1 %5, label %1, label %6
6: ; preds = %1
ret void
}
int ata_sff_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @ata_sff_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ata_sff_init() {
ret i32 0
}
/* Variables and functions */
char *lispdir();
char *subcmddir(void) { return lispdir(); }


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

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

LLVM IR (-O0):
define i8* @subcmddir() {
%1 = call i8* (...) @lispdir()
ret i8* %1
}

LLVM IR (-O2):
define i8* @subcmddir() {
%1 = tail call i8* (...) @lispdir()
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ tm_isutcrepresentation(struct tm);
int /*<<< orphan*/ tm_normalizetolocal(struct tm *);
int /*<<< orphan*/ tm_normalizetoutc(struct tm *);
time_t tm_normalize(struct tm *date) {
  if (tm_isutcrepresentation(*date))
    return tm_normalizetoutc(date);
  else
    return tm_normalizetolocal(date);
}


x86 assembly (clang, -O0):
<tm_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <tm_isutcrepresentation@plt>
cmp    $0x0,%rax
je     1162 <tm_normalize+0x32>
mov    -0x10(%rbp),%rdi
call   1040 <tm_normalizetoutc@plt>
mov    %eax,-0x4(%rbp)
jmp    116e <tm_normalize+0x3e>
mov    -0x10(%rbp),%rdi
call   1050 <tm_normalizetolocal@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tm_normalize>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <tm_isutcrepresentation@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1149 <tm_normalize+0x19>
pop    %rbx
jmp    1040 <tm_normalizetoutc@plt>
pop    %rbx
jmp    1050 <tm_normalizetolocal@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_normalize(%struct.tm* %0) {
%2 = alloca i32
%3 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %3
%4 = load %struct.tm*, %struct.tm** %3
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = call i64 @tm_isutcrepresentation(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.tm*, %struct.tm** %3
%11 = call i32 @tm_normalizetoutc(%struct.tm* %10)
store i32 %11, i32* %2
br label %15
12: ; preds = %1
%13 = load %struct.tm*, %struct.tm** %3
%14 = call i32 @tm_normalizetolocal(%struct.tm* %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @tm_normalize(%struct.tm* %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i64 @tm_isutcrepresentation(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @tm_normalizetoutc(%struct.tm* %0)
br label %10
8: ; preds = %1
%9 = tail call i32 @tm_normalizetolocal(%struct.tm* %0)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ mt19937_genrand_int32();
double mt19937_genrand_real3(void) {
  return (((double)mt19937_genrand_int32()) + 0.5) * (1.0 / 4294967296.0);
}


x86 assembly (clang, -O0):
<mt19937_genrand_real3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mt19937_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt19937_genrand_real3>:
push   %rax
xor    %eax,%eax
call   1030 <mt19937_genrand_int32@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt19937_genrand_real3() {
%1 = call i64 (...) @mt19937_genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}

LLVM IR (-O2):
define double @mt19937_genrand_real3() {
%1 = tail call i64 (...) @mt19937_genrand_int32()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3DF0000000000000
ret double %4
}
int local_write_ok(int x, int y) {
  int k = x + y;
  k++;
  return k;
}


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

x86 assembly (clang, -O2):
<local_write_ok>:
lea    (%rdi,%rsi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @local_write_ok(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @local_write_ok(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
ret i32 %4
}
void notify(struct __ap_node *node) { return; }


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

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

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

LLVM IR (-O2):
%struct.__ap_node = type opaque
define void @notify(%struct.__ap_node* nocapture %0) {
ret void
}