#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 int uint8_t;

/* Variables and functions */
char uu_decode_char8(char);
void uu_decode_word24(char *dest, char *src_uu) {
  uint8_t i;
  char uu_dec[4];
  ;
  for (i = 0; i < 4; i++)
    uu_dec[i] = uu_decode_char8(src_uu[i]);
  ;
  dest[0] = ((uu_dec[0] & 0x3F) << 2) + ((uu_dec[1] & 0x30) >> 4);
  dest[1] = ((uu_dec[1] & 0x0F) << 4) + ((uu_dec[2] & 0x3C) >> 2);
  dest[2] = ((uu_dec[2] & 0x03) << 6) + (uu_dec[3] & 0x3F);
  ;
}


x86 assembly (clang, -O0):
<uu_decode_word24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    115a <uu_decode_word24+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uu_decode_char8@plt>
mov    %al,%cl
movslq -0x14(%rbp),%rax
mov    %cl,-0x18(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <uu_decode_word24+0x17>
movsbl -0x18(%rbp),%eax
and    $0x3f,%eax
shl    $0x2,%eax
movsbl -0x17(%rbp),%ecx
and    $0x30,%ecx
sar    $0x4,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
movsbl -0x17(%rbp),%eax
and    $0xf,%eax
shl    $0x4,%eax
movsbl -0x16(%rbp),%ecx
and    $0x3c,%ecx
sar    $0x2,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
movsbl -0x16(%rbp),%eax
and    $0x3,%eax
shl    $0x6,%eax
movsbl -0x15(%rbp),%ecx
and    $0x3f,%ecx
add    %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uu_decode_word24>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1030 <uu_decode_char8@plt>
mov    %eax,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <uu_decode_char8@plt>
mov    %eax,%r15d
movsbl 0x2(%rbx),%edi
call   1030 <uu_decode_char8@plt>
mov    %eax,%r12d
movsbl 0x3(%rbx),%edi
call   1030 <uu_decode_char8@plt>
shl    $0x2,%bpl
mov    %r15d,%ecx
shr    $0x4,%cl
and    $0x3,%cl
or     %bpl,%cl
mov    %cl,(%r14)
shl    $0x4,%r15b
mov    %r12d,%ecx
shr    $0x2,%cl
and    $0xf,%cl
or     %r15b,%cl
mov    %cl,0x1(%r14)
shl    $0x6,%r12b
and    $0x3f,%al
or     %r12b,%al
mov    %al,0x2(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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