#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;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int char_to_code(char const);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
int /*<<< orphan*/ stderr;
int b64_to_bin_nopad(const char *in, int size, uint8_t *out, int max_len) {
  int i;
  int result_len;
  int full_blocks;
  int last_chars;
  int last_bytes;
  uint32_t b;
  ;
  if ((out == NULL) || (in == NULL)) {
    ;
    return -1;
  }
  if (size == 0) {
    return 0;
  }
  full_blocks = size / 4;
  last_chars = size % 4;
  switch (last_chars) {
  case 0:
    last_bytes = 0;
    break;
  case 1:;
    return -1;
  case 2:
    last_bytes = 1;
    break;
  case 3:
    last_bytes = 2;
    break;
  default:
    fprintf(stderr, "\nCRITICAL file:%s line:%u msg:%s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/futuritymmx/"
            "Single-Channel-LoRaWAN-Gateway/refs/heads/master/base64.c",
            207, "switch default that should not be possible");
    exit(EXIT_FAILURE);
  }
  result_len = (3 * full_blocks) + last_bytes;
  if (max_len < result_len) {
    ;
    return -1;
  }
  for (i = 0; i < full_blocks; ++i) {
    b = (0x3F & char_to_code(in[4 * i])) << 18;
    b |= (0x3F & char_to_code(in[4 * i + 1])) << 12;
    b |= (0x3F & char_to_code(in[4 * i + 2])) << 6;
    b |= 0x3F & char_to_code(in[4 * i + 3]);
    out[3 * i + 0] = (b >> 16) & 0xFF;
    out[3 * i + 1] = (b >> 8) & 0xFF;
    out[3 * i + 2] = b & 0xFF;
  }
  i = full_blocks;
  if (last_bytes == 1) {
    b = (0x3F & char_to_code(in[4 * i])) << 18;
    b |= (0x3F & char_to_code(in[4 * i + 1])) << 12;
    out[3 * i + 0] = (b >> 16) & 0xFF;
    if (((b >> 12) & 0x0F) != 0) {
      ;
    }
  } else if (last_bytes == 2) {
    b = (0x3F & char_to_code(in[4 * i])) << 18;
    b |= (0x3F & char_to_code(in[4 * i + 1])) << 12;
    b |= (0x3F & char_to_code(in[4 * i + 2])) << 6;
    out[3 * i + 0] = (b >> 16) & 0xFF;
    out[3 * i + 1] = (b >> 8) & 0xFF;
    if (((b >> 6) & 0x03) != 0) {
      ;
    }
  }
  return result_len;
}


x86 assembly (clang, -O0):
<b64_to_bin_nopad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115c <b64_to_bin_nopad+0x2c>
cmpq   $0x0,-0x10(%rbp)
jne    1168 <b64_to_bin_nopad+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <b64_to_bin_nopad+0x386>
cmpl   $0x0,-0x14(%rbp)
jne    117e <b64_to_bin_nopad+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    14b6 <b64_to_bin_nopad+0x386>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x3,%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x2,%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%edx
add    $0x3,%edx
test   %eax,%eax
mov    %eax,%ecx
cmovs  %edx,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %rax,-0x48(%rbp)
sub    $0x3,%rax
ja     11fd <b64_to_bin_nopad+0xcd>
mov    -0x48(%rbp),%rax
lea    0xe3c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x38(%rbp)
jmp    1233 <b64_to_bin_nopad+0x103>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <b64_to_bin_nopad+0x386>
movl   $0x1,-0x38(%rbp)
jmp    1233 <b64_to_bin_nopad+0x103>
movl   $0x2,-0x38(%rbp)
jmp    1233 <b64_to_bin_nopad+0x103>
mov    0x2ddc(%rip),%rax
mov    (%rax),%edi
lea    0xe03(%rip),%rsi
lea    0xe1e(%rip),%rdx
mov    $0xcf,%ecx
lea    0xeb2(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
imul   $0x3,-0x30(%rbp),%eax
add    -0x38(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1255 <b64_to_bin_nopad+0x125>
movl   $0xffffffff,-0x4(%rbp)
jmp    14b6 <b64_to_bin_nopad+0x386>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1355 <b64_to_bin_nopad+0x225>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0x12,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0xc,%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0x6,%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edx
sar    $0x10,%edx
and    $0xff,%edx
mov    -0x20(%rbp),%rax
imul   $0x3,-0x28(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
mov    -0x20(%rbp),%rax
imul   $0x3,-0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%edx
and    $0xff,%edx
mov    -0x20(%rbp),%rax
imul   $0x3,-0x28(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    125c <b64_to_bin_nopad+0x12c>
mov    -0x30(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x1,-0x38(%rbp)
jne    13e2 <b64_to_bin_nopad+0x2b2>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0x12,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0xc,%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edx
sar    $0x10,%edx
and    $0xff,%edx
mov    -0x20(%rbp),%rax
imul   $0x3,-0x28(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
sar    $0xc,%eax
and    $0xf,%eax
cmp    $0x0,%eax
je     13dd <b64_to_bin_nopad+0x2ad>
jmp    13dd <b64_to_bin_nopad+0x2ad>
jmp    14b0 <b64_to_bin_nopad+0x380>
cmpl   $0x2,-0x38(%rbp)
jne    14ab <b64_to_bin_nopad+0x37b>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0x12,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0xc,%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shl    $0x6,%eax
or     -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edx
sar    $0x10,%edx
and    $0xff,%edx
mov    -0x20(%rbp),%rax
imul   $0x3,-0x28(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%edx
sar    $0x8,%edx
and    $0xff,%edx
mov    -0x20(%rbp),%rax
imul   $0x3,-0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
sar    $0x6,%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     14a6 <b64_to_bin_nopad+0x376>
jmp    14a6 <b64_to_bin_nopad+0x376>
jmp    14ab <b64_to_bin_nopad+0x37b>
jmp    14b0 <b64_to_bin_nopad+0x380>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_to_bin_nopad>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1348 <b64_to_bin_nopad+0x218>
test   %rdx,%rdx
je     1348 <b64_to_bin_nopad+0x218>
test   %esi,%esi
je     1199 <b64_to_bin_nopad+0x69>
mov    %rdi,%r15
lea    0x3(%rsi),%ebp
test   %esi,%esi
cmovns %esi,%ebp
mov    %ebp,%edi
and    $0xfffffffc,%edi
mov    %esi,%ebx
sub    %edi,%ebx
cmp    $0x3,%ebx
ja     1357 <b64_to_bin_nopad+0x227>
xor    %r9d,%r9d
lea    0xe80(%rip),%r8
movslq (%r8,%rbx,4),%rdi
add    %r8,%rdi
xor    %r8d,%r8d
jmp    *%rdi
mov    $0x1,%ebx
mov    $0x1,%r9b
xor    %r8d,%r8d
jmp    11ab <b64_to_bin_nopad+0x7b>
xor    %eax,%eax
jmp    1348 <b64_to_bin_nopad+0x218>
mov    $0x2,%ebx
mov    $0x1,%r8b
xor    %r9d,%r9d
sar    $0x2,%ebp
lea    0x0(%rbp,%rbp,2),%edi
add    %edi,%ebx
cmp    %ecx,%ebx
jg     1348 <b64_to_bin_nopad+0x218>
mov    %r8d,0x10(%rsp)
mov    %r9d,0x14(%rsp)
mov    %rbp,(%rsp)
mov    %rdi,0x18(%rsp)
mov    %rbx,0x20(%rsp)
mov    %rdx,0x8(%rsp)
cmp    $0x4,%esi
jl     1292 <b64_to_bin_nopad+0x162>
mov    (%rsp),%eax
mov    %rax,0x30(%rsp)
mov    0x8(%rsp),%rax
lea    0x8(%rax),%r12
xor    %r13d,%r13d
mov    %r15,0x28(%rsp)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%r13,4),%edi
call   1030 <char_to_code@plt>
mov    %eax,%ebp
and    $0x3f,%ebp
shl    $0x12,%ebp
movsbl 0x1(%r15,%r13,4),%edi
call   1030 <char_to_code@plt>
mov    %eax,%r15d
shl    $0xc,%r15d
mov    %r15d,%r14d
and    $0x30000,%r14d
or     %ebp,%r14d
mov    0x28(%rsp),%rax
movsbl 0x2(%rax,%r13,4),%edi
call   1030 <char_to_code@plt>
mov    %eax,%ebp
shl    $0x6,%ebp
mov    %ebp,%ebx
and    $0xf00,%ebx
or     %r15d,%ebx
mov    0x28(%rsp),%r15
movsbl 0x3(%r15,%r13,4),%edi
call   1030 <char_to_code@plt>
and    $0x3f,%eax
shr    $0x10,%r14d
mov    %r14d,-0x8(%r12)
movzbl %bh,%ecx
mov    %ecx,-0x4(%r12)
movzbl %bpl,%ecx
or     %eax,%ecx
mov    %ecx,(%r12)
add    $0x1,%r13
add    $0xc,%r12
cmp    %r13,0x30(%rsp)
jne    1200 <b64_to_bin_nopad+0xd0>
cmpb   $0x0,0x14(%rsp)
je     12ce <b64_to_bin_nopad+0x19e>
movslq (%rsp),%rbp
movsbl (%r15,%rbp,4),%edi
call   1030 <char_to_code@plt>
mov    %eax,%ebx
shl    $0x12,%ebx
movsbl 0x1(%r15,%rbp,4),%edi
call   1030 <char_to_code@plt>
and    $0x30,%eax
shl    $0xc,%eax
or     %ebx,%eax
shr    $0x10,%eax
mov    0x8(%rsp),%r12
mov    0x18(%rsp),%rcx
jmp    1339 <b64_to_bin_nopad+0x209>
cmpb   $0x0,0x10(%rsp)
mov    0x8(%rsp),%r12
je     1343 <b64_to_bin_nopad+0x213>
movslq (%rsp),%r14
movsbl (%r15,%r14,4),%edi
call   1030 <char_to_code@plt>
mov    %eax,%ebx
and    $0x3f,%ebx
shl    $0x12,%ebx
movsbl 0x1(%r15,%r14,4),%edi
call   1030 <char_to_code@plt>
mov    %r15,%rcx
mov    %eax,%r15d
shl    $0xc,%r15d
mov    %r15d,%ebp
and    $0x30000,%ebp
or     %ebx,%ebp
movsbl 0x2(%rcx,%r14,4),%edi
call   1030 <char_to_code@plt>
and    $0x3c,%eax
shl    $0x6,%eax
or     %r15d,%eax
shr    $0x10,%ebp
mov    0x18(%rsp),%rcx
movslq %ecx,%rcx
mov    %ebp,(%r12,%rcx,4)
shr    $0x8,%eax
add    $0x1,%ecx
movzbl %al,%eax
movslq %ecx,%rcx
mov    %eax,(%r12,%rcx,4)
mov    0x20(%rsp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c82(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
lea    0xcc4(%rip),%rdx
lea    0xd5d(%rip),%r8
mov    $0xcf,%ecx
call   1040 <fprintf@plt>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"\0ACRITICAL file:%s line:%u msg:%s\0A\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/futuritymmx/Single-Channel-LoRaWAN-Gateway/refs/heads/master/base64.c\00"
@.str.2 = [43 x i8] c"switch default that should not be possible\00"
@EXIT_FAILURE = global i32 0
define i32 @b64_to_bin_nopad(i8* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
%16 = load i32*, i32** %8
%17 = icmp eq i32* %16, null
br i1 %17, label %21, label %18
18: ; preds = %4
%19 = load i8*, i8** %6
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %22
21: ; preds = %18, %4
store i32 -1, i32* %5
br label %234
22: ; preds = %18
%23 = load i32, i32* %7
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 0, i32* %5
br label %234
26: ; preds = %22
%27 = load i32, i32* %7
%28 = sdiv i32 %27, 4
store i32 %28, i32* %12
%29 = load i32, i32* %7
%30 = srem i32 %29, 4
store i32 %30, i32* %13
%31 = load i32, i32* %13
switch i32 %31, label %36 [
i32 0, label %32
i32 1, label %33
i32 2, label %34
i32 3, label %35
]
32: ; preds = %26
store i32 0, i32* %14
br label %41
33: ; preds = %26
store i32 -1, i32* %5
br label %234
34: ; preds = %26
store i32 1, i32* %14
br label %41
35: ; preds = %26
store i32 2, i32* %14
br label %41
36: ; preds = %26
%37 = load i32, i32* @stderr
%38 = call i32 @fprintf(i32 %37, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 207, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %35, %34, %32
%42 = load i32, i32* %12
%43 = mul nsw i32 3, %42
%44 = load i32, i32* %14
%45 = add nsw i32 %43, %44
store i32 %45, i32* %11
%46 = load i32, i32* %9
%47 = load i32, i32* %11
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %50
49: ; preds = %41
store i32 -1, i32* %5
br label %234
50: ; preds = %41
store i32 0, i32* %10
br label %51
51: ; preds = %126, %50
%52 = load i32, i32* %10
%53 = load i32, i32* %12
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %129
55: ; preds = %51
%56 = load i8*, i8** %6
%57 = load i32, i32* %10
%58 = mul nsw i32 4, %57
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %56, i64 %59
%61 = load i8, i8* %60
%62 = call i32 @char_to_code(i8 signext %61)
%63 = and i32 63, %62
%64 = shl i32 %63, 18
store i32 %64, i32* %15
%65 = load i8*, i8** %6
%66 = load i32, i32* %10
%67 = mul nsw i32 4, %66
%68 = add nsw i32 %67, 1
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %65, i64 %69
%71 = load i8, i8* %70
%72 = call i32 @char_to_code(i8 signext %71)
%73 = and i32 63, %72
%74 = shl i32 %73, 12
%75 = load i32, i32* %15
%76 = or i32 %75, %74
store i32 %76, i32* %15
%77 = load i8*, i8** %6
%78 = load i32, i32* %10
%79 = mul nsw i32 4, %78
%80 = add nsw i32 %79, 2
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %77, i64 %81
%83 = load i8, i8* %82
%84 = call i32 @char_to_code(i8 signext %83)
%85 = and i32 63, %84
%86 = shl i32 %85, 6
%87 = load i32, i32* %15
%88 = or i32 %87, %86
store i32 %88, i32* %15
%89 = load i8*, i8** %6
%90 = load i32, i32* %10
%91 = mul nsw i32 4, %90
%92 = add nsw i32 %91, 3
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %89, i64 %93
%95 = load i8, i8* %94
%96 = call i32 @char_to_code(i8 signext %95)
%97 = and i32 63, %96
%98 = load i32, i32* %15
%99 = or i32 %98, %97
store i32 %99, i32* %15
%100 = load i32, i32* %15
%101 = ashr i32 %100, 16
%102 = and i32 %101, 255
%103 = load i32*, i32** %8
%104 = load i32, i32* %10
%105 = mul nsw i32 3, %104
%106 = add nsw i32 %105, 0
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i32, i32* %103, i64 %107
store i32 %102, i32* %108
%109 = load i32, i32* %15
%110 = ashr i32 %109, 8
%111 = and i32 %110, 255
%112 = load i32*, i32** %8
%113 = load i32, i32* %10
%114 = mul nsw i32 3, %113
%115 = add nsw i32 %114, 1
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i32, i32* %112, i64 %116
store i32 %111, i32* %117
%118 = load i32, i32* %15
%119 = and i32 %118, 255
%120 = load i32*, i32** %8
%121 = load i32, i32* %10
%122 = mul nsw i32 3, %121
%123 = add nsw i32 %122, 2
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i32, i32* %120, i64 %124
store i32 %119, i32* %125
br label %126
126: ; preds = %55
%127 = load i32, i32* %10
%128 = add nsw i32 %127, 1
store i32 %128, i32* %10
br label %51
129: ; preds = %51
%130 = load i32, i32* %12
store i32 %130, i32* %10
%131 = load i32, i32* %14
%132 = icmp eq i32 %131, 1
br i1 %132, label %133, label %170
133: ; preds = %129
%134 = load i8*, i8** %6
%135 = load i32, i32* %10
%136 = mul nsw i32 4, %135
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %134, i64 %137
%139 = load i8, i8* %138
%140 = call i32 @char_to_code(i8 signext %139)
%141 = and i32 63, %140
%142 = shl i32 %141, 18
store i32 %142, i32* %15
%143 = load i8*, i8** %6
%144 = load i32, i32* %10
%145 = mul nsw i32 4, %144
%146 = add nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i8, i8* %143, i64 %147
%149 = load i8, i8* %148
%150 = call i32 @char_to_code(i8 signext %149)
%151 = and i32 63, %150
%152 = shl i32 %151, 12
%153 = load i32, i32* %15
%154 = or i32 %153, %152
store i32 %154, i32* %15
%155 = load i32, i32* %15
%156 = ashr i32 %155, 16
%157 = and i32 %156, 255
%158 = load i32*, i32** %8
%159 = load i32, i32* %10
%160 = mul nsw i32 3, %159
%161 = add nsw i32 %160, 0
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i32, i32* %158, i64 %162
store i32 %157, i32* %163
%164 = load i32, i32* %15
%165 = ashr i32 %164, 12
%166 = and i32 %165, 15
%167 = icmp ne i32 %166, 0
br i1 %167, label %168, label %169
168: ; preds = %133
br label %169
169: ; preds = %168, %133
br label %232
170: ; preds = %129
%171 = load i32, i32* %14
%172 = icmp eq i32 %171, 2
br i1 %172, label %173, label %231
173: ; preds = %170
%174 = load i8*, i8** %6
%175 = load i32, i32* %10
%176 = mul nsw i32 4, %175
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds i8, i8* %174, i64 %177
%179 = load i8, i8* %178
%180 = call i32 @char_to_code(i8 signext %179)
%181 = and i32 63, %180
%182 = shl i32 %181, 18
store i32 %182, i32* %15
%183 = load i8*, i8** %6
%184 = load i32, i32* %10
%185 = mul nsw i32 4, %184
%186 = add nsw i32 %185, 1
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %183, i64 %187
%189 = load i8, i8* %188
%190 = call i32 @char_to_code(i8 signext %189)
%191 = and i32 63, %190
%192 = shl i32 %191, 12
%193 = load i32, i32* %15
%194 = or i32 %193, %192
store i32 %194, i32* %15
%195 = load i8*, i8** %6
%196 = load i32, i32* %10
%197 = mul nsw i32 4, %196
%198 = add nsw i32 %197, 2
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds i8, i8* %195, i64 %199
%201 = load i8, i8* %200
%202 = call i32 @char_to_code(i8 signext %201)
%203 = and i32 63, %202
%204 = shl i32 %203, 6
%205 = load i32, i32* %15
%206 = or i32 %205, %204
store i32 %206, i32* %15
%207 = load i32, i32* %15
%208 = ashr i32 %207, 16
%209 = and i32 %208, 255
%210 = load i32*, i32** %8
%211 = load i32, i32* %10
%212 = mul nsw i32 3, %211
%213 = add nsw i32 %212, 0
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i32, i32* %210, i64 %214
store i32 %209, i32* %215
%216 = load i32, i32* %15
%217 = ashr i32 %216, 8
%218 = and i32 %217, 255
%219 = load i32*, i32** %8
%220 = load i32, i32* %10
%221 = mul nsw i32 3, %220
%222 = add nsw i32 %221, 1
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds i32, i32* %219, i64 %223
store i32 %218, i32* %224
%225 = load i32, i32* %15
%226 = ashr i32 %225, 6
%227 = and i32 %226, 3
%228 = icmp ne i32 %227, 0
br i1 %228, label %229, label %230
229: ; preds = %173
br label %230
230: ; preds = %229, %173
br label %231
231: ; preds = %230, %170
br label %232
232: ; preds = %231, %169
%233 = load i32, i32* %11
store i32 %233, i32* %5
br label %234
234: ; preds = %232, %49, %33, %25, %21
%235 = load i32, i32* %5
ret i32 %235
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"\0ACRITICAL file:%s line:%u msg:%s\0A\00"
@.str.1 = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/futuritymmx/Single-Channel-LoRaWAN-Gateway/refs/heads/master/base64.c\00"
@.str.2 = [43 x i8] c"switch default that should not be possible\00"
@EXIT_FAILURE = global i32 0
define i32 @b64_to_bin_nopad(i8* %0, i32 %1, i32* writeonly %2, i32 %3) {
%5 = icmp eq i32* %2, null
%6 = icmp eq i8* %0, null
%7 = or i1 %6, %5
br i1 %7, label %124, label %8
8: ; preds = %4
%9 = icmp eq i32 %1, 0
br i1 %9, label %124, label %10
10: ; preds = %8
%11 = sdiv i32 %1, 4
%12 = srem i32 %1, 4
switch i32 %12, label %15 [
i32 0, label %20
i32 1, label %124
i32 2, label %13
i32 3, label %14
]
13: ; preds = %10
br label %20
14: ; preds = %10
br label %20
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str.1, i64 0, i64 0), i32 207, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = tail call i32 @exit(i32 %18)
unreachable
20: ; preds = %10, %14, %13
%21 = phi i1 [ false, %14 ], [ true, %13 ], [ false, %10 ]
%22 = phi i1 [ true, %14 ], [ false, %13 ], [ false, %10 ]
%23 = phi i32 [ 2, %14 ], [ 1, %13 ], [ %12, %10 ]
%24 = mul nsw i32 %11, 3
%25 = add nsw i32 %23, %24
%26 = icmp sgt i32 %25, %3
br i1 %26, label %124, label %27
27: ; preds = %20
%28 = icmp sgt i32 %1, 3
br i1 %28, label %29, label %71
29: ; preds = %27
%30 = zext i32 %11 to i64
br label %31
31: ; preds = %29, %31
%32 = phi i64 [ 0, %29 ], [ %69, %31 ]
%33 = shl nsw i64 %32, 2
%34 = getelementptr inbounds i8, i8* %0, i64 %33
%35 = load i8, i8* %34
%36 = tail call i32 @char_to_code(i8 signext %35)
%37 = shl i32 %36, 18
%38 = and i32 %37, 16515072
%39 = or i64 %33, 1
%40 = getelementptr inbounds i8, i8* %0, i64 %39
%41 = load i8, i8* %40
%42 = tail call i32 @char_to_code(i8 signext %41)
%43 = shl i32 %42, 12
%44 = and i32 %43, 196608
%45 = or i32 %44, %38
%46 = or i64 %33, 2
%47 = getelementptr inbounds i8, i8* %0, i64 %46
%48 = load i8, i8* %47
%49 = tail call i32 @char_to_code(i8 signext %48)
%50 = shl i32 %49, 6
%51 = and i32 %50, 3840
%52 = or i32 %51, %43
%53 = or i64 %33, 3
%54 = getelementptr inbounds i8, i8* %0, i64 %53
%55 = load i8, i8* %54
%56 = tail call i32 @char_to_code(i8 signext %55)
%57 = and i32 %56, 63
%58 = lshr exact i32 %45, 16
%59 = mul nuw nsw i64 %32, 3
%60 = getelementptr inbounds i32, i32* %2, i64 %59
store i32 %58, i32* %60
%61 = lshr exact i32 %52, 8
%62 = and i32 %61, 255
%63 = add nuw nsw i64 %59, 1
%64 = getelementptr inbounds i32, i32* %2, i64 %63
store i32 %62, i32* %64
%65 = and i32 %50, 192
%66 = or i32 %57, %65
%67 = add nuw nsw i64 %59, 2
%68 = getelementptr inbounds i32, i32* %2, i64 %67
store i32 %66, i32* %68
%69 = add nuw nsw i64 %32, 1
%70 = icmp eq i64 %69, %30
br i1 %70, label %71, label %31
71: ; preds = %31, %27
br i1 %21, label %72, label %88
72: ; preds = %71
%73 = shl nsw i32 %11, 2
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %0, i64 %74
%76 = load i8, i8* %75
%77 = tail call i32 @char_to_code(i8 signext %76)
%78 = shl i32 %77, 18
%79 = or i32 %73, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8, i8* %0, i64 %80
%82 = load i8, i8* %81
%83 = tail call i32 @char_to_code(i8 signext %82)
%84 = shl i32 %83, 12
%85 = and i32 %84, 196608
%86 = or i32 %85, %78
%87 = lshr exact i32 %86, 16
br label %118
88: ; preds = %71
br i1 %22, label %89, label %124
89: ; preds = %88
%90 = shl nsw i32 %11, 2
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i8, i8* %0, i64 %91
%93 = load i8, i8* %92
%94 = tail call i32 @char_to_code(i8 signext %93)
%95 = shl i32 %94, 18
%96 = and i32 %95, 16515072
%97 = or i32 %90, 1
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8, i8* %0, i64 %98
%100 = load i8, i8* %99
%101 = tail call i32 @char_to_code(i8 signext %100)
%102 = shl i32 %101, 12
%103 = and i32 %102, 196608
%104 = or i32 %103, %96
%105 = or i32 %90, 2
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds i8, i8* %0, i64 %106
%108 = load i8, i8* %107
%109 = tail call i32 @char_to_code(i8 signext %108)
%110 = shl i32 %109, 6
%111 = and i32 %110, 3840
%112 = or i32 %111, %102
%113 = lshr exact i32 %104, 16
%114 = sext i32 %24 to i64
%115 = getelementptr inbounds i32, i32* %2, i64 %114
store i32 %113, i32* %115
%116 = lshr exact i32 %112, 8
%117 = add nsw i32 %24, 1
br label %118
118: ; preds = %89, %72
%119 = phi i32 [ %24, %72 ], [ %117, %89 ]
%120 = phi i32 [ %87, %72 ], [ %116, %89 ]
%121 = and i32 %120, 255
%122 = sext i32 %119 to i64
%123 = getelementptr inbounds i32, i32* %2, i64 %122
store i32 %121, i32* %123
br label %124
124: ; preds = %118, %88, %20, %10, %8, %4
%125 = phi i32 [ -1, %4 ], [ 0, %8 ], [ -1, %10 ], [ -1, %20 ], [ %25, %88 ], [ %25, %118 ]
ret i32 %125
}