xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strcpy(char *, char const *);
char *strcpy_back(char *, char const *);
char *strcpy_safe(char *to, const char *from) {
  if (!to || !from)
    return (to);
  if (to > from)
    return (strcpy_back(to, from));
  else
    return (strcpy(to, from));
}


x86 assembly (clang, -O0):
<strcpy_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <strcpy_safe+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1153 <strcpy_safe+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1188 <strcpy_safe+0x68>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1177 <strcpy_safe+0x57>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy_back@plt>
mov    %rax,-0x8(%rbp)
jmp    1188 <strcpy_safe+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_safe>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1144 <strcpy_safe+0x24>
test   %rsi,%rsi
je     1144 <strcpy_safe+0x24>
cmp    %rsi,%rbx
jbe    113c <strcpy_safe+0x1c>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcpy_back@plt>
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @strcpy_safe(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = icmp ugt i8* %0, %1
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i8* @strcpy_back(i8* %0, i8* %1)
br label %12
10: ; preds = %6
%11 = tail call i8* @strcpy(i8* %0, i8* %1)
br label %12
12: ; preds = %2, %10, %8
%13 = phi i8* [ %9, %8 ], [ %0, %10 ], [ %0, %2 ]
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char const *);
void rt_hw_console_output(const char *str) { uart_puts(str); }


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

x86 assembly (clang, -O2):
<rt_hw_console_output>:
jmp    1030 <uart_puts@plt>

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

LLVM IR (-O2):
define void @rt_hw_console_output(i8* %0) {
%2 = tail call i32 @uart_puts(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintError(unsigned long, char *);
scalar_t__ isalpha(char);
scalar_t__ islower(char);
void CheckID_Lowercase(char *p) {
  while (isalpha(*p)) {
    if (islower(*p)) {
      PrintError((16UL | 0x20000000UL | 0x00020000UL), p);
      break;
    }
    p++;
  }
}


x86 assembly (clang, -O0):
<CheckID_Lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%rax
je     118c <CheckID_Lowercase+0x5c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     117b <CheckID_Lowercase+0x4b>
mov    -0x8(%rbp),%rsi
mov    $0x20020010,%edi
call   1050 <PrintError@plt>
jmp    118c <CheckID_Lowercase+0x5c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <CheckID_Lowercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckID_Lowercase>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1040 <isalpha@plt>
test   %rax,%rax
je     1161 <CheckID_Lowercase+0x31>
movsbl (%rbx),%edi
call   1030 <islower@plt>
test   %rax,%rax
jne    1163 <CheckID_Lowercase+0x33>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1140 <CheckID_Lowercase+0x10>
pop    %rbx
ret
mov    $0x20020010,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1050 <PrintError@plt>

LLVM IR (-O0):
define void @CheckID_Lowercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isalpha(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @islower(i8 signext %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = call i32 @PrintError(i64 537002000, i8* %14)
br label %19
16: ; preds = %8
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
define void @CheckID_Lowercase(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isalpha(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %1, %12
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = tail call i64 @islower(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = tail call i32 @PrintError(i64 537002000, i8* %6)
br label %17
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = tail call i64 @isalpha(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %1, %10
ret void
}
long to32bit(c1, c2, c3, c4)
int c1, c2, c3, c4;
{
  long value = 0L;
  value = (c1 & 0xff);
  value = (value << 8) + (c2 & 0xff);
  value = (value << 8) + (c3 & 0xff);
  value = (value << 8) + (c4 & 0xff);
  return (value);
}


x86 assembly (clang, -O0):
<to32bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x8,%rax
mov    -0x10(%rbp),%ecx
and    $0xff,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to32bit>:
shl    $0x18,%edi
movzbl %sil,%eax
shl    $0x10,%eax
or     %edi,%eax
shl    $0x8,%edx
movzwl %dx,%edx
or     %eax,%edx
movzbl %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i64 @to32bit(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i64 0, i64* %9
%10 = load i32, i32* %5
%11 = and i32 %10, 255
%12 = sext i32 %11 to i64
store i64 %12, i64* %9
%13 = load i64, i64* %9
%14 = shl i64 %13, 8
%15 = load i32, i32* %6
%16 = and i32 %15, 255
%17 = sext i32 %16 to i64
%18 = add nsw i64 %14, %17
store i64 %18, i64* %9
%19 = load i64, i64* %9
%20 = shl i64 %19, 8
%21 = load i32, i32* %7
%22 = and i32 %21, 255
%23 = sext i32 %22 to i64
%24 = add nsw i64 %20, %23
store i64 %24, i64* %9
%25 = load i64, i64* %9
%26 = shl i64 %25, 8
%27 = load i32, i32* %8
%28 = and i32 %27, 255
%29 = sext i32 %28 to i64
%30 = add nsw i64 %26, %29
store i64 %30, i64* %9
%31 = load i64, i64* %9
ret i64 %31
}

LLVM IR (-O2):
define i64 @to32bit(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 24
%6 = shl i32 %1, 16
%7 = and i32 %6, 16711680
%8 = or i32 %7, %5
%9 = shl i32 %2, 8
%10 = and i32 %9, 65280
%11 = or i32 %8, %10
%12 = and i32 %3, 255
%13 = or i32 %11, %12
%14 = zext i32 %13 to i64
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int *malloc(int);
int /*<<< orphan*/ stderr;
__attribute__((no)) int t4(void) {
  int *ptr_to_undef_int = malloc(sizeof(int) + 1);
  int undef_unaligned_int = *(int *)((long)ptr_to_undef_int + 1);
  fprintf(stderr, "\nUndef 4 of 8 (32 bit undef, unaligned)\n");
  return (undef_unaligned_int == 0x12345678 ? 14 : 25);
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edx
mov    $0x19,%eax
mov    $0xe,%ecx
cmp    $0x12345678,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    0x1(%rax),%ebx
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
cmp    $0x12345678,%ebx
mov    $0xe,%ecx
mov    $0x19,%eax
cmove  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"\0AUndef 4 of 8 (32 bit undef, unaligned)\0A\00"
define i32 @t4() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @malloc(i32 5)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = ptrtoint i32* %4 to i64
%6 = add nsw i64 %5, 1
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 305419896
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 14, i32 25
ret i32 %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"\0AUndef 4 of 8 (32 bit undef, unaligned)\0A\00"
define i32 @t4() {
%1 = tail call i32* @malloc(i32 5)
%2 = ptrtoint i32* %1 to i64
%3 = add nsw i64 %2, 1
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %5, 305419896
%9 = select i1 %8, i32 14, i32 25
ret i32 %9
}
int nosymbol(char *name, unsigned long long *addrp) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @nosymbol(i8* nocapture readnone %0, i64* nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ atomic_int;

/* Variables and functions */
int /*<<< orphan*/ atomic_store_explicit(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ memory_order_acq_rel;
int /*<<< orphan*/ memory_order_acquire;
int /*<<< orphan*/ memory_order_consume;
void store(atomic_int *i) {
  atomic_store_explicit(i, 0, memory_order_consume);
  atomic_store_explicit(i, 0, memory_order_acquire);
  atomic_store_explicit(i, 0, memory_order_acq_rel);
}


x86 assembly (clang, -O0):
<store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <atomic_store_explicit@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <atomic_store_explicit@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <atomic_store_explicit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <atomic_store_explicit@plt>
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <atomic_store_explicit@plt>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <atomic_store_explicit@plt>

LLVM IR (-O0):
@memory_order_consume = global i32 0
@memory_order_acquire = global i32 0
@memory_order_acq_rel = global i32 0
define void @store(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @memory_order_consume
%5 = call i32 @atomic_store_explicit(i32* %3, i32 0, i32 %4)
%6 = load i32*, i32** %2
%7 = load i32, i32* @memory_order_acquire
%8 = call i32 @atomic_store_explicit(i32* %6, i32 0, i32 %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* @memory_order_acq_rel
%11 = call i32 @atomic_store_explicit(i32* %9, i32 0, i32 %10)
ret void
}

LLVM IR (-O2):
@memory_order_consume = global i32 0
@memory_order_acquire = global i32 0
@memory_order_acq_rel = global i32 0
define void @store(i32* %0) {
%2 = load i32, i32* @memory_order_consume
%3 = tail call i32 @atomic_store_explicit(i32* %0, i32 0, i32 %2)
%4 = load i32, i32* @memory_order_acquire
%5 = tail call i32 @atomic_store_explicit(i32* %0, i32 0, i32 %4)
%6 = load i32, i32* @memory_order_acq_rel
%7 = tail call i32 @atomic_store_explicit(i32* %0, i32 0, i32 %6)
ret void
}
/* Variables and functions */
int __udivsi3(int, int);
int __divsi3(int a, int b) {
  int s_a = a >> 31;
  int s_b = b >> 31;
  a = (a ^ s_a) - s_a;
  b = (b ^ s_b) - s_b;
  s_a ^= s_b;
  return (__udivsi3(a, b) ^ s_a) - s_a;
}


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

x86 assembly (clang, -O2):
<__divsi3>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
neg    %esi
cmovs  %ebx,%esi
xor    %edi,%ebx
sar    $0x1f,%ebx
mov    %eax,%edi
call   1030 <__udivsi3@plt>
xor    %ebx,%eax
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__divsi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = ashr i32 %7, 31
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = ashr i32 %9, 31
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = xor i32 %11, %12
%14 = load i32, i32* %5
%15 = sub nsw i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = xor i32 %16, %17
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
store i32 %20, i32* %4
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = xor i32 %22, %21
store i32 %23, i32* %5
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 @__udivsi3(i32 %24, i32 %25)
%27 = load i32, i32* %5
%28 = xor i32 %26, %27
%29 = load i32, i32* %5
%30 = sub nsw i32 %28, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @__divsi3(i32 %0, i32 %1) {
%3 = ashr i32 %0, 31
%4 = ashr i32 %1, 31
%5 = xor i32 %3, %0
%6 = sub nsw i32 %5, %3
%7 = xor i32 %4, %1
%8 = sub nsw i32 %7, %4
%9 = xor i32 %4, %3
%10 = tail call i32 @__udivsi3(i32 %6, i32 %8)
%11 = xor i32 %10, %9
%12 = sub nsw i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x9c() {
  Assert_real((isspace(156) == 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_isspace.c",
              785, ("isspace should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x311,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x9c\00"
define void @t_isspace_0x9c() {
%1 = call i64 @isspace(i32 156)
%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 785, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x9c\00"
define void @t_isspace_0x9c() {
%1 = tail call i64 @isspace(i32 156)
%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 785, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main() {
  int tmp;
  int p_9 = 60;
  tmp = (p_9 + 1) % 0;
  if ((p_9 + 1) % 0) {
    tmp = 1;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3c,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113b <main+0x3b>
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
long __syscall3(long n, long a1, long a2, long a3) {
  unsigned long ret;
  __asm__ __volatile__("syscall"
                       : "=a"(ret)
                       : "a"(n), "D"(a1), "S"(a2), "d"(a3)
                       : "rcx", "r11", "memory");
  return ret;
}


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

x86 assembly (clang, -O2):
<__syscall3>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
syscall
ret

LLVM IR (-O0):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i64 %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @__syscall3(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3)
ret i64 %5
}
/* Variables and functions */
scalar_t__ malloc(size_t);
__attribute__((visibility("default"))) char *trio_create(size_t size) {
  return (char *)malloc(size);
}


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

x86 assembly (clang, -O2):
<trio_create>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define i8* @trio_create(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void se_undo_move(long pstr, long old_posi) { return; }


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

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

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

LLVM IR (-O2):
define void @se_undo_move(i64 %0, i64 %1) {
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int gethostbyname2_r(char const *, int /*<<< orphan*/, struct hostent *, char *,
                     size_t, struct hostent **, int *);
int gethostbyname_r(const char *name, struct hostent *h, char *buf,
                    size_t buflen, struct hostent **res, int *err) {
  return gethostbyname2_r(name, AF_INET, h, buf, buflen, res, err);
}


x86 assembly (clang, -O0):
<gethostbyname_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <gethostbyname2_r@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostbyname_r>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    0x2ec4(%rip),%rsi
mov    (%rsi),%esi
mov    %r9,(%rsp)
mov    %rax,%r9
call   1030 <gethostbyname2_r@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca %struct.hostent**
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store %struct.hostent** %4, %struct.hostent*** %11
store i32* %5, i32** %12
%13 = load i8*, i8** %7
%14 = load i32, i32* @AF_INET
%15 = load %struct.hostent*, %struct.hostent** %8
%16 = load i8*, i8** %9
%17 = load i64, i64* %10
%18 = load %struct.hostent**, %struct.hostent*** %11
%19 = load i32*, i32** %12
%20 = call i32 @gethostbyname2_r(i8* %13, i32 %14, %struct.hostent* %15, i8* %16, i64 %17, %struct.hostent** %18, i32* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@AF_INET = global i32 0
define i32 @gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5) {
%7 = load i32, i32* @AF_INET
%8 = tail call i32 @gethostbyname2_r(i8* %0, i32 %7, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int sudp_pck(u_char *data, int len) { return (len); }


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

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

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

LLVM IR (-O2):
define i32 @sudp_pck(i32* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
/* Variables and functions */
int mkdir(char *, int);
int /*<<< orphan*/ perror(char *);
int main(int argc, char *argv[]) {
  int res;
  if (argc >= 2) {
    res = mkdir(argv[1], 0755);
    if (-1 == res) {
      perror("mkdir");
      return 1;
    }
  }
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     1180 <main+0x60>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
mov    %eax,-0x14(%rbp)
mov    $0xffffffff,%eax
cmp    -0x14(%rbp),%eax
jne    117b <main+0x5b>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    1187 <main+0x67>
jmp    1180 <main+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cmp    $0x2,%edi
jl     113b <main+0x1b>
mov    0x8(%rsi),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
je     113f <main+0x1f>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%ebx
jmp    113b <main+0x1b>

LLVM IR (-O0):
@.str = [6 x i8] c"mkdir\00"
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
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @mkdir(i8* %12, i32 493)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = icmp eq i32 -1, %14
br i1 %15, label %16, label %18
16: ; preds = %9
%17 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %20
18: ; preds = %9
br label %19
19: ; preds = %18, %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %16
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [6 x i8] c"mkdir\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @mkdir(i8* %6, i32 493)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %2, %4, %9
%12 = phi i32 [ 1, %9 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %12
}
void computation_cleanup() {}


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

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

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

LLVM IR (-O2):
define void @computation_cleanup() {
ret void
}
float vec2_norm(const float a[2]) { return sqrt(vec2_norm2(a)); }


x86 assembly (clang, -O0):
<vec2_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <vec2_norm2@plt>
cvtsi2sd %eax,%xmm0
call   1040 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_norm>:
push   %rax
xor    %eax,%eax
call   1030 <vec2_norm2@plt>
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     113c <vec2_norm+0x1c>
sqrtsd %xmm0,%xmm0
jmp    1141 <vec2_norm+0x21>
call   1040 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @vec2_norm(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 (float*, ...) bitcast (i32 (...)* @vec2_norm2 to i32 (float*, ...)*)(float* %3)
%5 = sitofp i32 %4 to double
%6 = call double @sqrt(double %5)
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @vec2_norm(float* %0) {
%2 = tail call i32 (float*, ...) bitcast (i32 (...)* @vec2_norm2 to i32 (float*, ...)*)(float* %0)
%3 = sitofp i32 %2 to double
%4 = tail call double @sqrt(double %3)
%5 = fptrunc double %4 to float
ret float %5
}
void inc(a) int *a;
{ (*a)++; }


x86 assembly (clang, -O0):
<inc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc>:
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @inc(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\n The world is a vampir.\n\n\n\n");
  return EXIT_SUCCESS;
}


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>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"\0A The world is a vampir.\0A\0A\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [28 x i8] c"\0A The world is a vampir.\0A\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int find_line_indentation_depth(const char *line) {
  int depth = 0;
  for (int i = 0; line[i]; i++)
    if (line[i] == '\t')
      depth++;
    else
      return depth;
  return depth;
}


x86 assembly (clang, -O0):
<find_line_indentation_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1169 <find_line_indentation_depth+0x69>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x9,%eax
jne    114b <find_line_indentation_depth+0x4b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <find_line_indentation_depth+0x56>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116f <find_line_indentation_depth+0x6f>
jmp    115b <find_line_indentation_depth+0x5b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <find_line_indentation_depth+0x16>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @find_line_indentation_depth(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 9
br i1 %3, label %4, label %12
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 9
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %6 to i32
br label %12
12: ; preds = %10, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ]
ret i32 %13
}
const char *commonBeaconDeviceGetName() { return "commonBeacon"; }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"commonBeacon\00"
define i8* @commonBeaconDeviceGetName() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"commonBeacon\00"
define i8* @commonBeaconDeviceGetName() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int fnCheckIdentical(int *p, int *q, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (*(p + i) != *(q + i))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fnCheckIdentical>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <fnCheckIdentical+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <fnCheckIdentical+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <fnCheckIdentical+0x64>
jmp    114f <fnCheckIdentical+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <fnCheckIdentical+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnCheckIdentical>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <fnCheckIdentical+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <fnCheckIdentical+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <fnCheckIdentical+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @fnCheckIdentical(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
double(wcheck_double)(double to_check) { return to_check; }


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

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

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

LLVM IR (-O2):
define double @wcheck_double(double returned %0) {
ret double %0
}
float add_f(float x, float y) {
  __asm__ __volatile__("addss %1, %0" : "+x"(x) : "x"(y));
  return x;
}


x86 assembly (clang, -O0):
<add_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_f>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @add_f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float asm sideeffect "addss $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(float %6, float %5)
store float %7, float* %3
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @add_f(float %0, float %1) {
%3 = tail call float asm sideeffect "addss $1, $0", "=x,x,0,~{dirflag},~{fpsr},~{flags}"(float %1, float %0)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void fprime_copy(uint8_t *x, const uint8_t *a) { memcpy(x, a, 32); }


x86 assembly (clang, -O0):
<fprime_copy>:
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    $0x20,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprime_copy>:
mov    $0x20,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @fprime_copy(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 32)
ret void
}
long sqr(long eax) { return (eax) * (eax); }


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

x86 assembly (clang, -O2):
<sqr>:
mov    %rdi,%rax
imul   %rdi,%rax
ret

LLVM IR (-O0):
define i64 @sqr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = mul nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @sqr(i64 %0) {
%2 = mul nsw i64 %0, %0
ret i64 %2
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  char *x;
  write(1, "A\n", 2);
  x = malloc(8);
  write(1, "B\n", 2);
  *x = 10;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
movb   $0xa,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
lea    0xed5(%rip),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"A\0A\00"
@.str.1 = [3 x i8] c"B\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
ret i32 0
}
unsigned short swap_ushort(unsigned short lt) {
  return ((lt << 8) | (lt >> 8));
}


x86 assembly (clang, -O0):
<swap_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_ushort>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @swap_ushort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @swap_ushort(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
double sin(double);
double u_exact(double x, double y) {
  double pi = 3.141592653589793;
  double value;
  value = sin(pi * x * y);
  return value;
}


x86 assembly (clang, -O0):
<u_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_exact>:
mulsd  0xee8(%rip),%xmm0
mulsd  %xmm1,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @u_exact(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0x400921FB54442D18, double* %5
%7 = load double, double* %5
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = call double @sin(double %11)
store double %12, double* %6
%13 = load double, double* %6
ret double %13
}

LLVM IR (-O2):
define double @u_exact(double %0, double %1) {
%3 = fmul double %0, 0x400921FB54442D18
%4 = fmul double %3, %1
%5 = tail call double @sin(double %4)
ret double %5
}
/* Variables and functions */
int allocate_interrupts(int /*<<< orphan*/);
int allocate_interrupt(void) { return allocate_interrupts(0); }


x86 assembly (clang, -O0):
<allocate_interrupt>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <allocate_interrupts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_interrupt>:
xor    %edi,%edi
jmp    1030 <allocate_interrupts@plt>

LLVM IR (-O0):
define i32 @allocate_interrupt() {
%1 = call i32 @allocate_interrupts(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @allocate_interrupt() {
%1 = tail call i32 @allocate_interrupts(i32 0)
ret i32 %1
}
void INT_Excep_SECURITY_ERR(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SECURITY_ERR() {
ret void
}
void SwapUVRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @SwapUVRow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_uart0(char *);
void c_entry() { print_uart0("Hello World\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define void @c_entry() {
%1 = call i32 @print_uart0(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World\0A\00"
define void @c_entry() {
%1 = tail call i32 @print_uart0(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintRTF(char *);
void TabularEndRow(void) { fprintRTF("\\row}\n"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"\\row}\0A\00"
define void @TabularEndRow() {
%1 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}