#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 */
typedef char it;
typedef int int_least32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ enc_fputc(char, int *, int /*<<< orphan*/ *);
void enc_dump(int_least32_t stack, int n, int *col, FILE *fOut) {
  int i, it;
  for (i = 3; (4 - n) <= i; --i) {
    it = (stack >> (6 * i)) & 63;
    enc_fputc(((it) < 26    ? (it) + 'A'
               : (it) < 52  ? (it) + 'a' - 26
               : (it) < 62  ? (it) + '0' - 52
               : (it) == 62 ? '+'
                            : '/'),
              col, fOut);
  }
}


x86 assembly (clang, -O0):
<enc_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
mov    $0x4,%eax
sub    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     11de <enc_dump+0xce>
mov    -0x4(%rbp),%eax
imul   $0x6,-0x1c(%rbp),%ecx
sar    %cl,%eax
and    $0x3f,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x1a,-0x20(%rbp)
jge    1165 <enc_dump+0x55>
mov    -0x20(%rbp),%eax
add    $0x41,%eax
mov    %eax,-0x24(%rbp)
jmp    11bd <enc_dump+0xad>
cmpl   $0x34,-0x20(%rbp)
jge    1180 <enc_dump+0x70>
mov    -0x20(%rbp),%eax
add    $0x61,%eax
sub    $0x1a,%eax
mov    %eax,-0x28(%rbp)
jmp    11b7 <enc_dump+0xa7>
cmpl   $0x3e,-0x20(%rbp)
jge    119b <enc_dump+0x8b>
mov    -0x20(%rbp),%eax
add    $0x30,%eax
sub    $0x34,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b1 <enc_dump+0xa1>
mov    -0x20(%rbp),%edx
mov    $0x2f,%eax
mov    $0x2b,%ecx
cmp    $0x3e,%edx
cmove  %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsbl %al,%edi
call   1030 <enc_fputc@plt>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <enc_dump+0x1d>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enc_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    119b <enc_dump+0x8b>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %edi,%r12d
mov    $0x4,%ebp
mov    $0x4,%r13d
sub    %esi,%r13d
mov    $0x12,%ebx
jmp    115c <enc_dump+0x4c>
nopl   (%rax)
add    $0x41,%eax
movsbl %al,%edi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <enc_fputc@plt>
add    $0xffffffff,%ebp
add    $0xfffffffa,%ebx
cmp    %ebp,%r13d
jge    119b <enc_dump+0x8b>
mov    %r12d,%eax
mov    %ebx,%ecx
sar    %cl,%eax
and    $0x3f,%eax
cmp    $0x19,%eax
jbe    1140 <enc_dump+0x30>
cmp    $0x33,%eax
ja     1180 <enc_dump+0x70>
add    $0x47,%eax
jmp    1143 <enc_dump+0x33>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x3d,%eax
ja     118a <enc_dump+0x7a>
add    $0xfffffffc,%eax
jmp    1143 <enc_dump+0x33>
xor    %ecx,%ecx
cmp    $0x3e,%eax
setne  %cl
lea    0x2b(,%rcx,4),%eax
jmp    1143 <enc_dump+0x33>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @enc_dump(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 3, i32* %9
br label %11
11: ; preds = %56, %4
%12 = load i32, i32* %6
%13 = sub nsw i32 4, %12
%14 = load i32, i32* %9
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %59
16: ; preds = %11
%17 = load i32, i32* %5
%18 = load i32, i32* %9
%19 = mul nsw i32 6, %18
%20 = ashr i32 %17, %19
%21 = and i32 %20, 63
store i32 %21, i32* %10
%22 = load i32, i32* %10
%23 = icmp slt i32 %22, 26
br i1 %23, label %24, label %27
24: ; preds = %16
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 65
br label %50
27: ; preds = %16
%28 = load i32, i32* %10
%29 = icmp slt i32 %28, 52
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 97
%33 = sub nsw i32 %32, 26
br label %48
34: ; preds = %27
%35 = load i32, i32* %10
%36 = icmp slt i32 %35, 62
br i1 %36, label %37, label %41
37: ; preds = %34
%38 = load i32, i32* %10
%39 = add nsw i32 %38, 48
%40 = sub nsw i32 %39, 52
br label %46
41: ; preds = %34
%42 = load i32, i32* %10
%43 = icmp eq i32 %42, 62
%44 = zext i1 %43 to i64
%45 = select i1 %43, i32 43, i32 47
br label %46
46: ; preds = %41, %37
%47 = phi i32 [ %40, %37 ], [ %45, %41 ]
br label %48
48: ; preds = %46, %30
%49 = phi i32 [ %33, %30 ], [ %47, %46 ]
br label %50
50: ; preds = %48, %24
%51 = phi i32 [ %26, %24 ], [ %49, %48 ]
%52 = trunc i32 %51 to i8
%53 = load i32*, i32** %7
%54 = load i32*, i32** %8
%55 = call i32 @enc_fputc(i8 signext %52, i32* %53, i32* %54)
br label %56
56: ; preds = %50
%57 = load i32, i32* %9
%58 = add nsw i32 %57, -1
store i32 %58, i32* %9
br label %11
59: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @enc_dump(i32 %0, i32 %1, i32* %2, i32* %3) {
%5 = sub nsw i32 4, %1
%6 = icmp slt i32 %1, 1
br i1 %6, label %32, label %7
7: ; preds = %4, %26
%8 = phi i32 [ %30, %26 ], [ 3, %4 ]
%9 = mul nsw i32 %8, 6
%10 = ashr i32 %0, %9
%11 = and i32 %10, 63
%12 = icmp ult i32 %11, 26
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = add nuw nsw i32 %11, 65
br label %26
15: ; preds = %7
%16 = icmp ult i32 %11, 52
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = add nuw nsw i32 %11, 71
br label %26
19: ; preds = %15
%20 = icmp ult i32 %11, 62
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = add nsw i32 %11, -4
br label %26
23: ; preds = %19
%24 = icmp eq i32 %11, 62
%25 = select i1 %24, i32 43, i32 47
br label %26
26: ; preds = %17, %23, %21, %13
%27 = phi i32 [ %14, %13 ], [ %18, %17 ], [ %22, %21 ], [ %25, %23 ]
%28 = trunc i32 %27 to i8
%29 = tail call i32 @enc_fputc(i8 signext %28, i32* %2, i32* %3)
%30 = add nsw i32 %8, -1
%31 = icmp slt i32 %5, %8
br i1 %31, label %7, label %32
32: ; preds = %26, %4
ret void
}