#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 EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c1, c2, c3, c4, total = 0;
  while ((c1 = getchar()) != EOF) {
    c2 = getchar();
    if (c2 == EOF)
      c2 = 128;
    c3 = getchar();
    if (c3 == EOF)
      c2 = 128;
    c4 = getchar();
    if (c4 == EOF)
      c2 = 128;
    putchar(((c1) >> 6) * 64 + ((c2) >> 6) * 16 + ((c3) >> 6) * 4 +
            ((c4) >> 6));
    total++;
  }
  while (total % 128 > 0) {
    putchar(0xaa);
    total++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     11f2 <main+0xd2>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
jne    1172 <main+0x52>
movl   $0x80,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%eax
jne    1195 <main+0x75>
movl   $0x80,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e3f(%rip),%rcx
cmp    (%rcx),%eax
jne    11b8 <main+0x98>
movl   $0x80,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sar    $0x6,%edi
shl    $0x6,%edi
mov    -0xc(%rbp),%eax
sar    $0x6,%eax
shl    $0x4,%eax
add    %eax,%edi
mov    -0x10(%rbp),%eax
sar    $0x6,%eax
shl    $0x2,%eax
add    %eax,%edi
mov    -0x14(%rbp),%eax
sar    $0x6,%eax
add    %eax,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <main+0x16>
jmp    11f7 <main+0xd7>
mov    -0x18(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jle    1223 <main+0x103>
mov    $0xaa,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f7 <main+0xd7>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eaf(%rip),%r15
cmp    (%r15),%eax
je     11e6 <main+0xc6>
mov    %eax,%ebx
mov    $0x1,%r14d
jmp    1178 <main+0x58>
nopl   0x0(%rax)
sar    $0x4,%ebp
and    $0xfffffffc,%ebp
add    %ebx,%ebp
sar    $0x6,%eax
add    %ebp,%eax
add    %ecx,%eax
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
add    $0x1,%r14d
cmp    (%r15),%eax
je     11c3 <main+0xa3>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    $0x20,%r13d
cmp    (%r15),%eax
je     1193 <main+0x73>
sar    $0x2,%eax
and    $0xfffffff0,%eax
mov    %eax,%r13d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebp
mov    $0x20,%r12d
cmp    (%r15),%eax
je     11aa <main+0x8a>
mov    %r13d,%r12d
xor    %eax,%eax
call   1040 <getchar@plt>
and    $0xffffffc0,%ebx
cmp    (%r15),%eax
mov    $0x20,%ecx
je     1150 <main+0x30>
mov    %r12d,%ecx
jmp    1150 <main+0x30>
lea    -0x1(%r14),%eax
test   $0x7f,%al
je     11e6 <main+0xc6>
mov    %r14d,%ebx
xchg   %ax,%ax
mov    $0xaa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
test   $0x7f,%r14b
mov    %ebx,%r14d
jne    11d0 <main+0xb0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %7
7: ; preds = %29, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %2
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %47
11: ; preds = %7
%12 = call i32 (...) @getchar()
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 128, i32* %3
br label %17
17: ; preds = %16, %11
%18 = call i32 (...) @getchar()
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = load i32, i32* @EOF
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 128, i32* %3
br label %23
23: ; preds = %22, %17
%24 = call i32 (...) @getchar()
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = load i32, i32* @EOF
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 128, i32* %3
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %2
%31 = ashr i32 %30, 6
%32 = mul nsw i32 %31, 64
%33 = load i32, i32* %3
%34 = ashr i32 %33, 6
%35 = mul nsw i32 %34, 16
%36 = add nsw i32 %32, %35
%37 = load i32, i32* %4
%38 = ashr i32 %37, 6
%39 = mul nsw i32 %38, 4
%40 = add nsw i32 %36, %39
%41 = load i32, i32* %5
%42 = ashr i32 %41, 6
%43 = add nsw i32 %40, %42
%44 = call i32 @putchar(i32 %43)
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %7
47: ; preds = %7
br label %48
48: ; preds = %52, %47
%49 = load i32, i32* %6
%50 = srem i32 %49, 128
%51 = icmp sgt i32 %50, 0
br i1 %51, label %52, label %56
52: ; preds = %48
%53 = call i32 @putchar(i32 170)
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
br label %48
56: ; preds = %48
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %42, label %7
4: ; preds = %7
%5 = and i32 %32, 127
%6 = icmp eq i32 %5, 0
br i1 %6, label %42, label %36
7: ; preds = %0, %7
%8 = phi i32 [ %33, %7 ], [ %1, %0 ]
%9 = phi i32 [ %32, %7 ], [ 0, %0 ]
%10 = tail call i32 (...) @getchar()
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
%13 = tail call i32 (...) @getchar()
%14 = load i32, i32* @EOF
%15 = icmp eq i32 %13, %14
%16 = tail call i32 (...) @getchar()
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
%19 = select i1 %18, i1 true, i1 %15
%20 = select i1 %19, i1 true, i1 %12
%21 = and i32 %8, -64
%22 = ashr i32 %10, 2
%23 = and i32 %22, -16
%24 = select i1 %20, i32 32, i32 %23
%25 = ashr i32 %13, 4
%26 = and i32 %25, -4
%27 = ashr i32 %16, 6
%28 = add i32 %26, %21
%29 = add i32 %28, %27
%30 = add i32 %29, %24
%31 = tail call i32 @putchar(i32 %30)
%32 = add nuw nsw i32 %9, 1
%33 = tail call i32 (...) @getchar()
%34 = load i32, i32* @EOF
%35 = icmp eq i32 %33, %34
br i1 %35, label %4, label %7
36: ; preds = %4, %36
%37 = phi i32 [ %39, %36 ], [ %32, %4 ]
%38 = tail call i32 @putchar(i32 170)
%39 = add i32 %37, 1
%40 = trunc i32 %39 to i7
%41 = icmp eq i7 %40, 0
br i1 %41, label %42, label %36
42: ; preds = %36, %0, %4
ret i32 0
}