#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ foo(char *, char *);
int main() {
  char a[64], b[64];
  int i;
  foo(a, b);
  for (i = 0; i < 64; i++)
    if (a[i] != i || b[i] != i)
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <foo@plt>
movl   $0x0,-0x94(%rbp)
cmpl   $0x40,-0x94(%rbp)
jge    11ac <main+0x8c>
movslq -0x94(%rbp),%rax
movsbl -0x50(%rbp,%rax,1),%eax
cmp    -0x94(%rbp),%eax
jne    118c <main+0x6c>
movslq -0x94(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%eax
ff
cmp    -0x94(%rbp),%eax
je     1193 <main+0x73>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1198 <main+0x78>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    114c <main+0x2c>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
lea    0x40(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <foo@plt>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbq 0x40(%rsp,%rax,1),%rcx
mov    %ecx,%ecx
cmp    %rcx,%rax
jne    118e <main+0x6e>
movsbq (%rsp,%rax,1),%rcx
mov    %ecx,%ecx
cmp    %rcx,%rax
jne    118e <main+0x6e>
movsbq 0x41(%rsp,%rax,1),%rcx
mov    %ecx,%edx
lea    0x1(%rax),%rcx
cmp    %rdx,%rcx
jne    118e <main+0x6e>
movsbq 0x1(%rsp,%rax,1),%rax
mov    %eax,%eax
cmp    %rax,%rcx
jne    118e <main+0x6e>
add    $0x1,%rcx
mov    %rcx,%rax
cmp    $0x40,%rcx
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x88,%rsp
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [64 x i8]
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%5 = call i32 @foo(i8* %3, i8* %4)
br label %22
6: ; preds = %29
%7 = or i64 %23, 1
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = and i64 %10, 4294967295
%12 = icmp eq i64 %7, %11
br i1 %12, label %13, label %35
13: ; preds = %6
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %7
%15 = load i8, i8* %14
%16 = sext i8 %15 to i64
%17 = and i64 %16, 4294967295
%18 = icmp eq i64 %7, %17
br i1 %18, label %19, label %35
19: ; preds = %13
%20 = add nuw nsw i64 %23, 2
%21 = icmp eq i64 %20, 64
br i1 %21, label %37, label %22
22: ; preds = %19, %0
%23 = phi i64 [ 0, %0 ], [ %20, %19 ]
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i64
%27 = and i64 %26, 4294967295
%28 = icmp eq i64 %23, %27
br i1 %28, label %29, label %35
29: ; preds = %22
%30 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 %23
%31 = load i8, i8* %30
%32 = sext i8 %31 to i64
%33 = and i64 %32, 4294967295
%34 = icmp eq i64 %23, %33
br i1 %34, label %6, label %35
35: ; preds = %13, %6, %29, %22
%36 = call i32 (...) @abort()
unreachable
37: ; preds = %19
ret i32 0
}