#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*/ l64a(long);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  long x = 0;
  int i = 0;
  for (i = 0; i <= 512; i++) {
    printf("l64a(%ld %ld)=[%s] ", x / 64, x % 64, l64a(x));
    if ((i + 1) % 4 == 0) {
      printf("\n");
    }
    x++;
  }
  x = 1 << 26;
  for (i = 0; i < 64; i++) {
    printf("l64a(%ld %ld)=[%s] ", x / 64, x % 64, l64a(x));
    if ((i + 1) % 4 == 0) {
      printf("\n");
    }
    x++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x200,-0x14(%rbp)
jg     11d6 <main+0xb6>
mov    -0x10(%rbp),%rax
mov    $0x40,%ecx
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x40,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <l64a@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11bc <main+0x9c>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <main+0x25>
movq   $0x4000000,-0x10(%rbp)
04
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1273 <main+0x153>
mov    -0x10(%rbp),%rax
mov    $0x40,%ecx
cqto
idiv   %rcx
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x40,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <l64a@plt>
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1259 <main+0x139>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e5 <main+0xc5>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%r14
xor    %ebx,%ebx
jmp    1159 <main+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x201,%rbx
je     1196 <main+0x66>
mov    %rbx,%r15
shr    $0x6,%r15
mov    %ebx,%r12d
and    $0x3f,%r12d
mov    %rbx,%rdi
call   1050 <l64a@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
test   $0x3,%bl
jne    1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1150 <main+0x20>
mov    $0x4000000,%ebx
lea    0xe5e(%rip),%r14
jmp    11c2 <main+0x92>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x4000001,%r15
cmp    $0x400003f,%ebx
mov    %r15,%rbx
je     1200 <main+0xd0>
mov    %rbx,%r12
shr    $0x6,%r12
mov    %rbx,%rdi
call   1050 <l64a@plt>
lea    -0x4000000(%rbx),%r15
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0x3ffffff(%rbx),%eax
test   $0x3,%al
jne    11b0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11b0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"l64a(%ld %ld)=[%s] \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %2
store i32 0, i32* %3
store i32 0, i32* %3
br label %4
4: ; preds = %24, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 512
br i1 %6, label %7, label %27
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sdiv i64 %8, 64
%10 = load i64, i64* %2
%11 = srem i64 %10, 64
%12 = load i64, i64* %2
%13 = call i32 @l64a(i64 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %11, i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
%17 = srem i32 %16, 4
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %7
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %7
%22 = load i64, i64* %2
%23 = add nsw i64 %22, 1
store i64 %23, i64* %2
br label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %4
27: ; preds = %4
store i64 67108864, i64* %2
store i32 0, i32* %3
br label %28
28: ; preds = %48, %27
%29 = load i32, i32* %3
%30 = icmp slt i32 %29, 64
br i1 %30, label %31, label %51
31: ; preds = %28
%32 = load i64, i64* %2
%33 = sdiv i64 %32, 64
%34 = load i64, i64* %2
%35 = srem i64 %34, 64
%36 = load i64, i64* %2
%37 = call i32 @l64a(i64 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %33, i64 %35, i32 %37)
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
%41 = srem i32 %40, 4
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %45
45: ; preds = %43, %31
%46 = load i64, i64* %2
%47 = add nsw i64 %46, 1
store i64 %47, i64* %2
br label %48
48: ; preds = %45
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %28
51: ; preds = %28
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"l64a(%ld %ld)=[%s] \00"
define i32 @main() {
br label %1
1: ; preds = %0, %12
%2 = phi i64 [ 0, %0 ], [ %7, %12 ]
%3 = lshr i64 %2, 6
%4 = and i64 %2, 63
%5 = tail call i32 @l64a(i64 %2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %3, i64 %4, i32 %5)
%7 = add nuw nsw i64 %2, 1
%8 = and i64 %7, 3
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = tail call i32 @putchar(i32 10)
br label %12
12: ; preds = %10, %1
%13 = icmp eq i64 %7, 513
br i1 %13, label %14, label %1
14: ; preds = %12, %26
%15 = phi i32 [ %21, %26 ], [ 0, %12 ]
%16 = phi i64 [ %27, %26 ], [ 67108864, %12 ]
%17 = lshr i64 %16, 6
%18 = and i64 %16, 63
%19 = tail call i32 @l64a(i64 %16)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %17, i64 %18, i32 %19)
%21 = add nuw nsw i32 %15, 1
%22 = and i32 %21, 3
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %14
%25 = tail call i32 @putchar(i32 10)
br label %26
26: ; preds = %24, %14
%27 = add nuw nsw i64 %16, 1
%28 = icmp eq i32 %21, 64
br i1 %28, label %29, label %14
29: ; preds = %26
ret i32 0
}