#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*/ assert(int /*<<< orphan*/);
size_t base64_find_decoded_data_size(unsigned int encoded_size) {
  unsigned int mod = encoded_size % 4;
  if (mod == 0)
    return 3 * (encoded_size / 4);
  else if (mod == 2)
    return 3 * (encoded_size / 4) + 1;
  else if (mod == 3)
    return 3 * (encoded_size / 4) + 2;
  else
    assert(0);
}


x86 assembly (clang, -O0):
<base64_find_decoded_data_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1142 <base64_find_decoded_data_size+0x32>
mov    -0xc(%rbp),%eax
shr    $0x2,%eax
imul   $0x3,%eax,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
jmp    1195 <base64_find_decoded_data_size+0x85>
cmpl   $0x2,-0x10(%rbp)
jne    1163 <base64_find_decoded_data_size+0x53>
mov    -0xc(%rbp),%eax
shr    $0x2,%eax
imul   $0x3,%eax,%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
jmp    1195 <base64_find_decoded_data_size+0x85>
cmpl   $0x3,-0x10(%rbp)
jne    1184 <base64_find_decoded_data_size+0x74>
mov    -0xc(%rbp),%eax
shr    $0x2,%eax
imul   $0x3,%eax,%eax
add    $0x2,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
jmp    1195 <base64_find_decoded_data_size+0x85>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    1190 <base64_find_decoded_data_size+0x80>
jmp    1195 <base64_find_decoded_data_size+0x85>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_find_decoded_data_size>:
mov    %edi,%eax
and    $0x3,%eax
cmp    $0x3,%eax
je     112a <base64_find_decoded_data_size+0x1a>
cmp    $0x2,%eax
je     1134 <base64_find_decoded_data_size+0x24>
test   %eax,%eax
jne    113e <base64_find_decoded_data_size+0x2e>
shr    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
ret
shr    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
add    $0x2,%eax
ret
shr    $0x2,%edi
lea    (%rdi,%rdi,2),%eax
add    $0x1,%eax
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i64 @base64_find_decoded_data_size(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = urem i32 %5, 4
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* %3
%11 = udiv i32 %10, 4
%12 = mul i32 3, %11
%13 = zext i32 %12 to i64
store i64 %13, i64* %2
br label %36
14: ; preds = %1
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 2
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %3
%19 = udiv i32 %18, 4
%20 = mul i32 3, %19
%21 = add i32 %20, 1
%22 = zext i32 %21 to i64
store i64 %22, i64* %2
br label %36
23: ; preds = %14
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %3
%28 = udiv i32 %27, 4
%29 = mul i32 3, %28
%30 = add i32 %29, 2
%31 = zext i32 %30 to i64
store i64 %31, i64* %2
br label %36
32: ; preds = %23
%33 = call i32 @assert(i32 0)
br label %34
34: ; preds = %32
br label %35
35: ; preds = %34
br label %36
36: ; preds = %9, %17, %26, %35
%37 = load i64, i64* %2
ret i64 %37
}

LLVM IR (-O2):
define i64 @base64_find_decoded_data_size(i32 %0) {
%2 = and i32 %0, 3
switch i32 %2, label %17 [
i32 0, label %3
i32 2, label %7
i32 3, label %12
]
3: ; preds = %1
%4 = lshr i32 %0, 2
%5 = mul nuw i32 %4, 3
%6 = zext i32 %5 to i64
br label %19
7: ; preds = %1
%8 = lshr i32 %0, 2
%9 = mul nuw i32 %8, 3
%10 = add nuw i32 %9, 1
%11 = zext i32 %10 to i64
br label %19
12: ; preds = %1
%13 = lshr i32 %0, 2
%14 = mul nuw i32 %13, 3
%15 = add nuw i32 %14, 2
%16 = zext i32 %15 to i64
br label %19
17: ; preds = %1
%18 = tail call i32 @assert(i32 0)
br label %19
19: ; preds = %17, %12, %7, %3
%20 = phi i64 [ %6, %3 ], [ %11, %7 ], [ %16, %12 ], [ undef, %17 ]
ret i64 %20
}