#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 */
char uu_encode_char6(char);
void uu_encode_word24(char *dest_uu, char *src) {
  int i;
  char b[4];
  ;
  b[0] = (src[0] & 0xFC) >> 2;
  b[1] = ((src[0] & 0x03) << 4) + ((src[1] & 0xF0) >> 4);
  b[2] = ((src[1] & 0x0F) << 2) + ((src[2] & 0xC0) >> 6);
  b[3] = (src[2] & 0x3F);
  for (i = 0; i < 4; i++) {
    dest_uu[i] = uu_encode_char6(b[i]);
  };
}


x86 assembly (clang, -O0):
<uu_encode_word24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xfc,%eax
sar    $0x2,%eax
mov    %al,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0x3,%eax
shl    $0x4,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    %al,-0x17(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xf,%eax
shl    $0x2,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
and    $0xc0,%ecx
sar    $0x6,%ecx
add    %ecx,%eax
mov    %al,-0x16(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
and    $0x3f,%eax
mov    %al,-0x15(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11c1 <uu_encode_word24+0xb1>
movslq -0x14(%rbp),%rax
movsbl -0x18(%rbp,%rax,1),%edi
call   1030 <uu_encode_char6@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118e <uu_encode_word24+0x7e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uu_encode_word24>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%r15b
mov    0x1(%rsi),%al
mov    %r15d,%ecx
shr    $0x2,%cl
mov    %eax,%edx
shr    $0x4,%dl
shl    $0x4,%r15b
or     %dl,%r15b
and    $0x3f,%r15b
movsbl 0x2(%rsi),%ebp
shl    $0x2,%al
mov    %ebp,%ebx
shr    $0x6,%bl
or     %al,%bl
and    $0x3f,%bl
movzbl %cl,%edi
call   1030 <uu_encode_char6@plt>
mov    %al,(%r14)
movzbl %r15b,%edi
call   1030 <uu_encode_char6@plt>
mov    %al,0x1(%r14)
movzbl %bl,%edi
call   1030 <uu_encode_char6@plt>
mov    %al,0x2(%r14)
and    $0x3f,%ebp
mov    %ebp,%edi
call   1030 <uu_encode_char6@plt>
mov    %al,0x3(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @uu_encode_word24(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [4 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 252
%12 = ashr i32 %11, 2
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
store i8 %13, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = and i32 %18, 3
%20 = shl i32 %19, 4
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = and i32 %24, 240
%26 = ashr i32 %25, 4
%27 = add nsw i32 %20, %26
%28 = trunc i32 %27 to i8
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
store i8 %28, i8* %29
%30 = load i8*, i8** %4
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = and i32 %33, 15
%35 = shl i32 %34, 2
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i64 2
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = and i32 %39, 192
%41 = ashr i32 %40, 6
%42 = add nsw i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
store i8 %43, i8* %44
%45 = load i8*, i8** %4
%46 = getelementptr inbounds i8, i8* %45, i64 2
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = and i32 %48, 63
%50 = trunc i32 %49 to i8
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
store i8 %50, i8* %51
store i32 0, i32* %5
br label %52
52: ; preds = %65, %2
%53 = load i32, i32* %5
%54 = icmp slt i32 %53, 4
br i1 %54, label %55, label %68
55: ; preds = %52
%56 = load i32, i32* %5
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = call signext i8 @uu_encode_char6(i8 signext %59)
%61 = load i8*, i8** %3
%62 = load i32, i32* %5
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8, i8* %61, i64 %63
store i8 %60, i8* %64
br label %65
65: ; preds = %55
%66 = load i32, i32* %5
%67 = add nsw i32 %66, 1
store i32 %67, i32* %5
br label %52
68: ; preds = %52
ret void
}

LLVM IR (-O2):
define void @uu_encode_word24(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = lshr i8 %3, 2
%5 = shl i8 %3, 4
%6 = and i8 %5, 48
%7 = getelementptr inbounds i8, i8* %1, i64 1
%8 = load i8, i8* %7
%9 = lshr i8 %8, 4
%10 = or i8 %9, %6
%11 = shl i8 %8, 2
%12 = and i8 %11, 60
%13 = getelementptr inbounds i8, i8* %1, i64 2
%14 = load i8, i8* %13
%15 = lshr i8 %14, 6
%16 = or i8 %15, %12
%17 = and i8 %14, 63
%18 = tail call signext i8 @uu_encode_char6(i8 signext %4)
store i8 %18, i8* %0
%19 = tail call signext i8 @uu_encode_char6(i8 signext %10)
%20 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %19, i8* %20
%21 = tail call signext i8 @uu_encode_char6(i8 signext %16)
%22 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %21, i8* %22
%23 = tail call signext i8 @uu_encode_char6(i8 signext %17)
%24 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %23, i8* %24
ret void
}