xunge/DecIR huggingface dataset:
int scale_to_percentage(int val, int max_val) {
  int half = max_val / 2;
  if (max_val <= 0)
    return 100;
  if (val < 0)
    return (val * 100 - half) / max_val;
  return (val * 100 + half) / max_val;
}


x86 assembly (clang, -O0):
<scale_to_percentage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     112e <scale_to_percentage+0x2e>
movl   $0x64,-0x4(%rbp)
jmp    1159 <scale_to_percentage+0x59>
cmpl   $0x0,-0x8(%rbp)
jge    114b <scale_to_percentage+0x4b>
imul   $0x64,-0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1159 <scale_to_percentage+0x59>
imul   $0x64,-0x8(%rbp),%eax
add    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_to_percentage>:
test   %esi,%esi
jle    111f <scale_to_percentage+0x1f>
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %esi,%ecx
sar    %ecx
imul   $0x64,%edi,%edx
mov    %ecx,%eax
neg    %eax
test   %edi,%edi
cmovns %ecx,%eax
add    %edx,%eax
cltd
idiv   %esi
ret
mov    $0x64,%eax
ret

LLVM IR (-O0):
define i32 @scale_to_percentage(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = sdiv i32 %7, 2
store i32 %8, i32* %6
%9 = load i32, i32* %5
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 100, i32* %3
br label %29
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 100
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = sdiv i32 %19, %20
store i32 %21, i32* %3
br label %29
22: ; preds = %12
%23 = load i32, i32* %4
%24 = mul nsw i32 %23, 100
%25 = load i32, i32* %6
%26 = add nsw i32 %24, %25
%27 = load i32, i32* %5
%28 = sdiv i32 %26, %27
store i32 %28, i32* %3
br label %29
29: ; preds = %22, %15, %11
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @scale_to_percentage(i32 %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = icmp slt i32 %1, 1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = icmp slt i32 %0, 0
%7 = mul nsw i32 %0, 100
%8 = sub nsw i32 0, %3
%9 = select i1 %6, i32 %8, i32 %3
%10 = add i32 %7, %9
%11 = sdiv i32 %10, %1
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 100, %2 ], [ %11, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit_shell_with_status(int);
void exit_shell(void) { exit_shell_with_status(-1); }


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

x86 assembly (clang, -O2):
<exit_shell>:
mov    $0xffffffff,%edi
jmp    1030 <exit_shell_with_status@plt>

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

LLVM IR (-O2):
define void @exit_shell() {
%1 = tail call i32 @exit_shell_with_status(i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int *arr, int len) {
  while (len-- > 0) {
    printf("%d, ", *(arr++));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1157 <print_arr+0x47>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    111f <print_arr+0xf>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1158 <print_arr+0x38>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x4,%rbx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1140 <print_arr+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32* [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i32, i32* %6, i64 1
%9 = load i32, i32* %6
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = icmp ugt i32 %5, 1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
int longitud_string(char *s) {
  int i = 0;
  while (*(s++) != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<longitud_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <longitud_string+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <longitud_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud_string>:
cmpb   $0x0,(%rdi)
je     111c <longitud_string+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <longitud_string+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @longitud_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ XSetWindowAttributes;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XSetWindowAttributes(void) {
  XSetWindowAttributes *_p =
      (XSetWindowAttributes *)malloc(sizeof(XSetWindowAttributes));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XSetWindowAttributes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XSetWindowAttributes+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XSetWindowAttributes>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XSetWindowAttributes+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XSetWindowAttributes() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XSetWindowAttributes() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void skipSpace(const char **str) {
  while (**str == ' ' || **str == '\n')
    (*str)++;
}


x86 assembly (clang, -O0):
<skipSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x9(%rbp)
je     1133 <skipSpace+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <skipSpace+0x43>
jmp    1156 <skipSpace+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skipSpace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpace>:
mov    (%rdi),%rax
jmp    1113 <skipSpace+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,(%rdi)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
cmp    $0x20,%cl
je     1110 <skipSpace+0x10>
cmp    $0xa,%cl
je     1110 <skipSpace+0x10>
ret

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

LLVM IR (-O2):
define void @skipSpace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 32, label %6
i8 10, label %6
]
6: ; preds = %3, %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *name) {
  printf("%s source_file target_file\n", name);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s source_file target_file\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s source_file target_file\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
main() {
  int t;
  t = t + 4;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
float elapsed_time(long long start_time, long long end_time) {
  return (float)(end_time - start_time) / (1000 * 1000);
}


x86 assembly (clang, -O0):
<elapsed_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
movss  0xedf(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<elapsed_time>:
sub    %rdi,%rsi
cvtsi2ss %rsi,%xmm0
divss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @elapsed_time(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to float
%9 = fdiv float %8, 1.000000e+06
ret float %9
}

LLVM IR (-O2):
define float @elapsed_time(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 1.000000e+06
ret float %5
}
int index_of(int bitset) {
  int j = 0;
  bitset &= (-bitset);
  for (;;) {
    bitset >>= 1;
    if (bitset == 0)
      return j;
    ++j;
  }
}


x86 assembly (clang, -O0):
<index_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <index_of+0x31>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <index_of+0x19>

x86 assembly (clang, -O2):
<index_of>:
mov    %edi,%ecx
neg    %ecx
and    %edi,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
jb     112c <index_of+0x2c>
xor    %eax,%eax
mov    %ecx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
sar    %edx
add    $0x1,%eax
cmp    $0x4,%ecx
mov    %edx,%ecx
jae    1120 <index_of+0x20>
ret

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

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

/* Variables and functions */
__attribute__((__weak__)) void os_tmr_call(uint16_t info
                                           __attribute__((unused))) {
  (void)info;
}


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

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

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

LLVM IR (-O2):
define weak void @os_tmr_call(i32 %0) {
ret void
}
char *version_get_git_commit_short() { return "Unknown git short commit hash"; }


x86 assembly (clang, -O0):
<version_get_git_commit_short>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_get_git_commit_short>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Unknown git short commit hash\00"
define i8* @version_get_git_commit_short() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [30 x i8] c"Unknown git short commit hash\00"
define i8* @version_get_git_commit_short() {
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  fprintf(stdout, "Hello World\n");
  fprintf(stderr, "Hello World\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rbx
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"Hello World\0A\00"
@stderr = global i32 0
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* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"Hello World\0A\00"
@stderr = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int *ptr = NULL;
  if (ptr == 0)
    printf("Ptr e 0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113e <main+0x2e>
lea    0xec7(%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 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Ptr e 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Ptr e 0\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x86() {
  Assert_real((isalpha(134) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              675, ("isalpha should be 0 for 0x86"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x86>:
push   %rbp
mov    %rsp,%rbp
mov    $0x86,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2a3,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x86>:
push   %rax
mov    $0x86,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2a3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x86\00"
define void @t_isalpha_0x86() {
%1 = call i64 @isalpha(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x86\00"
define void @t_isalpha_0x86() {
%1 = tail call i64 @isalpha(i32 134)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
size_t int8ReadFromFP(FILE *fp, int8_t *data) {
  return read_FP(fp, data, sizeof(int8_t));
}


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

x86 assembly (clang, -O2):
<int8ReadFromFP>:
mov    $0x4,%edx
jmp    1030 <read_FP@plt>

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

LLVM IR (-O2):
define i64 @int8ReadFromFP(i32* %0, i32* %1) {
%3 = tail call i64 @read_FP(i32* %0, i32* %1, i32 4)
ret i64 %3
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, char *argv[]) {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
}


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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x3c>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %7
7: ; preds = %11, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i32 @putchar(i32 %12)
br label %7
14: ; preds = %7
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void objc_free(void *mem) { free(mem); }


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

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

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

LLVM IR (-O2):
define void @objc_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int f2u(float);
scalar_t__ isnan(float);
float u2f(unsigned int);
unsigned test_float_times64(unsigned uf) {
  float f = u2f(uf);
  float tenf = 64 * f;
  if (isnan(f))
    return uf;
  else
    return f2u(tenf);
}


x86 assembly (clang, -O0):
<test_float_times64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <u2f@plt>
movss  %xmm0,-0xc(%rbp)
movss  0xeb0(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     1179 <test_float_times64+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <test_float_times64+0x56>
movss  -0x10(%rbp),%xmm0
call   1050 <f2u@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float_times64>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1030 <u2f@plt>
movss  %xmm0,0xc(%rsp)
call   1040 <isnan@plt>
test   %rax,%rax
je     1154 <test_float_times64+0x24>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
movss  0xc(%rsp),%xmm0
mulss  0xe9e(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1050 <f2u@plt>

LLVM IR (-O0):
define i32 @test_float_times64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call float @u2f(i32 %6)
store float %7, float* %4
%8 = load float, float* %4
%9 = fmul float 6.400000e+01, %8
store float %9, float* %5
%10 = load float, float* %4
%11 = call i64 @isnan(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %18
15: ; preds = %1
%16 = load float, float* %5
%17 = call i32 @f2u(float %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_float_times64(i32 %0) {
%2 = tail call float @u2f(i32 %0)
%3 = tail call i64 @isnan(float %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = fmul float %2, 6.400000e+01
%7 = tail call i32 @f2u(float %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ %0, %1 ]
ret i32 %9
}
/* Type definitions */
struct sde_rot_sync_fence {
  int dummy;
};

/* Variables and functions */
int EBADF;
int sde_rotator_get_sync_fence_fd(struct sde_rot_sync_fence *fence) {
  return -EBADF;
}


x86 assembly (clang, -O0):
<sde_rotator_get_sync_fence_fd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sde_rotator_get_sync_fence_fd>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.sde_rot_sync_fence = type { i32 }
@EBADF = global i32 0
define i32 @sde_rotator_get_sync_fence_fd(%struct.sde_rot_sync_fence* %0) {
%2 = alloca %struct.sde_rot_sync_fence*
store %struct.sde_rot_sync_fence* %0, %struct.sde_rot_sync_fence** %2
%3 = load i32, i32* @EBADF
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.sde_rot_sync_fence = type { i32 }
@EBADF = global i32 0
define i32 @sde_rotator_get_sync_fence_fd(%struct.sde_rot_sync_fence* nocapture readnone %0) {
%2 = load i32, i32* @EBADF
%3 = sub nsw i32 0, %2
ret i32 %3
}
void left(int a[]) {
  int temp = *a, *p;
  for (p = a; p < a + 9; p++)
    *p = *(p + 1);
  *p = temp;
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x24,%rcx
cmp    %rcx,%rax
jae    114c <left+0x4c>
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
jmp    1119 <left+0x19>
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
mov    (%rdi),%eax
movups 0x4(%rdi),%xmm0
movups 0x14(%rdi),%xmm1
movups %xmm1,0x10(%rdi)
mov    0x24(%rdi),%ecx
mov    %ecx,0x20(%rdi)
movups %xmm0,(%rdi)
mov    %eax,0x24(%rdi)
ret

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

LLVM IR (-O2):
define void @left(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i32, i32* %0
%4 = getelementptr i32, i32* %0, i64 1
%5 = bitcast i32* %4 to i8*
%6 = getelementptr i32, i32* %0, i64 9
store i32 %3, i32* %6
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR77_set(void) { return U_WMRCORENONE_set("U_WMR77"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR77\00"
define i8* @U_WMR77_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int main(int argc, char const *argv[]) { return 0; }


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

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

LLVM IR (-O0):
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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ deg2rad(double);
double greenwich_sidereal_time(double nu0, double delta_psi, double epsilon) {
  return nu0 + delta_psi * cos(deg2rad(epsilon));
}


x86 assembly (clang, -O0):
<greenwich_sidereal_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <cos@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greenwich_sidereal_time>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <deg2rad@plt>
mov    %eax,%edi
call   1040 <cos@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @greenwich_sidereal_time(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call i32 @deg2rad(double %9)
%11 = call double @cos(i32 %10)
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @greenwich_sidereal_time(double %0, double %1, double %2) {
%4 = tail call i32 @deg2rad(double %2)
%5 = tail call double @cos(i32 %4)
%6 = tail call double @llvm.fmuladd.f64(double %1, double %5, double %0)
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ enumerate_object(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ enumerate_string(int, int /*<<< orphan*/ *);
void enumerate_objects_raw(int indent, void *data) {
  if (((uintptr_t)data) & 1) {
    uint8_t *ptr = (uint8_t *)(((uintptr_t)data) & ~1);
    enumerate_string(indent, ptr);
  } else {
    enumerate_object(indent, (uint8_t *)data);
  }
}


x86 assembly (clang, -O0):
<enumerate_objects_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     115e <enumerate_objects_raw+0x3e>
mov    -0x10(%rbp),%rax
and    $0xfffffffffffffffe,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <enumerate_string@plt>
jmp    116a <enumerate_objects_raw+0x4a>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <enumerate_object@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enumerate_objects_raw>:
test   $0x1,%sil
jne    112b <enumerate_objects_raw+0xb>
jmp    1030 <enumerate_object@plt>
and    $0xfffffffffffffffe,%rsi
jmp    1040 <enumerate_string@plt>

LLVM IR (-O0):
define void @enumerate_objects_raw(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = and i64 %7, 1
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = ptrtoint i8* %11 to i64
%13 = and i64 %12, -2
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %5
%15 = load i32, i32* %3
%16 = load i32*, i32** %5
%17 = call i32 @enumerate_string(i32 %15, i32* %16)
br label %23
18: ; preds = %2
%19 = load i32, i32* %3
%20 = load i8*, i8** %4
%21 = bitcast i8* %20 to i32*
%22 = call i32 @enumerate_object(i32 %19, i32* %21)
br label %23
23: ; preds = %18, %10
ret void
}

LLVM IR (-O2):
define void @enumerate_objects_raw(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = and i64 %3, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = and i64 %3, -2
%8 = inttoptr i64 %7 to i32*
%9 = tail call i32 @enumerate_string(i32 %0, i32* %8)
br label %13
10: ; preds = %2
%11 = bitcast i8* %1 to i32*
%12 = tail call i32 @enumerate_object(i32 %0, i32* %11)
br label %13
13: ; preds = %10, %6
ret void
}
/* Variables and functions */
int NewClass(int);
int foo2(void) { return (NewClass(2)); }


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

x86 assembly (clang, -O2):
<foo2>:
mov    $0x2,%edi
jmp    1030 <NewClass@plt>

LLVM IR (-O0):
define i32 @foo2() {
%1 = call i32 @NewClass(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo2() {
%1 = tail call i32 @NewClass(i32 2)
ret i32 %1
}
/* Variables and functions */
int main(void) {
  char *c = NULL;
  c[0] = 'a';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 97, i8* %4
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int ArgNum();
int GetFlag(int);
int Cnd_Lt(void) {
  int v = ArgNum();
  return (GetFlag(v) < ArgNum());
}


x86 assembly (clang, -O0):
<Cnd_Lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <GetFlag@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <ArgNum@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cnd_Lt>:
push   %rbx
xor    %eax,%eax
call   1040 <ArgNum@plt>
mov    %eax,%edi
call   1030 <GetFlag@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgNum@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setl   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Cnd_Lt() {
%1 = alloca i32
%2 = call i32 (...) @ArgNum()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @GetFlag(i32 %3)
%5 = call i32 (...) @ArgNum()
%6 = icmp slt i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @Cnd_Lt() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i32 @GetFlag(i32 %1)
%3 = tail call i32 (...) @ArgNum()
%4 = icmp slt i32 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int strlen(const char *s) {
  int len;
  if (!s)
    return 0;
  len = 0;
  while (*s++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <strlen+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1152 <strlen+0x52>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     114c <strlen+0x4c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <strlen+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
test   %rdi,%rdi
je     111b <strlen+0x1b>
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
xor    %eax,%eax
xchg   %ax,%ax
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = phi i8* [ %9, %6 ], [ %0, %3 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = add nuw nsw i32 %7, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ IfFacingWall();
int /*<<< orphan*/ TurnLeft();
int /*<<< orphan*/ TurnRight();
char LeftIsWall(void) {
  TurnLeft();
  if (IfFacingWall()) {
    TurnRight();
    return 1;
  } else {
    TurnRight();
    return 0;
  }
}


x86 assembly (clang, -O0):
<LeftIsWall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <TurnLeft@plt>
mov    $0x0,%al
call   1050 <IfFacingWall@plt>
cmp    $0x0,%rax
je     1160 <LeftIsWall+0x30>
mov    $0x0,%al
call   1030 <TurnRight@plt>
movb   $0x1,-0x1(%rbp)
jmp    116b <LeftIsWall+0x3b>
mov    $0x0,%al
call   1030 <TurnRight@plt>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeftIsWall>:
push   %rbx
xor    %eax,%eax
call   1040 <TurnLeft@plt>
xor    %eax,%eax
call   1050 <IfFacingWall@plt>
test   %rax,%rax
setne  %bl
xor    %eax,%eax
call   1030 <TurnRight@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @LeftIsWall() {
%1 = tail call i32 (...) @TurnLeft()
%2 = tail call i64 (...) @IfFacingWall()
%3 = icmp ne i64 %2, 0
%4 = tail call i32 (...) @TurnRight()
%5 = zext i1 %3 to i8
ret i8 %5
}
int foo(int i) {
  if (i < 0 || i >= 5)
    return i == 1;
  return 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111b <foo+0x1b>
cmpl   $0x5,-0x8(%rbp)
jl     112f <foo+0x2f>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <foo+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
cmp    $0x5,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = icmp ult i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ output_hashes(char *, char *);
int main(int argc, char *argv[]) {
  output_hashes("passfile.dat", "4534");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"passfile.dat\00"
@.str.1 = [5 x i8] c"4534\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @output_hashes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"passfile.dat\00"
@.str.1 = [5 x i8] c"4534\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @output_hashes(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sio_mask(int, int, int, int);
int board_hp_dl165_g6_enable(void) {
  sio_mask(0xcd6, 0x44, 0x80, 0x80);
  sio_mask(0xcd6, 0x46, 0x04, 0x04);
  return 0;
}


x86 assembly (clang, -O0):
<board_hp_dl165_g6_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcd6,%edi
mov    $0x44,%esi
mov    $0x80,%ecx
mov    %ecx,%edx
call   1030 <sio_mask@plt>
mov    $0xcd6,%edi
mov    $0x46,%esi
mov    $0x4,%ecx
mov    %ecx,%edx
call   1030 <sio_mask@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_hp_dl165_g6_enable>:
push   %rax
mov    $0xcd6,%edi
mov    $0x44,%esi
mov    $0x80,%edx
mov    $0x80,%ecx
call   1030 <sio_mask@plt>
mov    $0xcd6,%edi
mov    $0x46,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
call   1030 <sio_mask@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @board_hp_dl165_g6_enable() {
%1 = call i32 @sio_mask(i32 3286, i32 68, i32 128, i32 128)
%2 = call i32 @sio_mask(i32 3286, i32 70, i32 4, i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @board_hp_dl165_g6_enable() {
%1 = tail call i32 @sio_mask(i32 3286, i32 68, i32 128, i32 128)
%2 = tail call i32 @sio_mask(i32 3286, i32 70, i32 4, i32 4)
ret i32 0
}
/* Variables and functions */
char *strchr(char const *const, char);
char *toc_internal_split_name(const char *const string) {
  return (strchr(string, ':') + 1);
}


x86 assembly (clang, -O0):
<toc_internal_split_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toc_internal_split_name>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
add    $0x1,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @toc_internal_split_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strchr(i8* %3, i8 signext 58)
%5 = getelementptr inbounds i8, i8* %4, i64 1
ret i8* %5
}

LLVM IR (-O2):
define i8* @toc_internal_split_name(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = getelementptr inbounds i8, i8* %2, i64 1
ret i8* %3
}