#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*/ _base64_check_decode(char const *, int /*<<< orphan*/,
                                        char const *);
int /*<<< orphan*/ strlen(char const *);
void test_base64_invalid(void) {
  const char **plainp, **base64p;
  static const char *base64_vector[] = {
      "", "/=", "", "//=", "", "\\/=", "", "\\//=",  "", "=",
      "", "==", "", "===", "", "====", "", "Zm9vYg", 0,  0,
  };
  plainp = base64_vector;
  base64p = base64_vector + 1;
  while (*plainp && *base64p) {
    _base64_check_decode(*plainp, strlen(*plainp), *base64p);
    plainp += 2;
    base64p += 2;
  }
}


x86 assembly (clang, -O0):
<test_base64_invalid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0x2f11(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0x2f06(%rip),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x11(%rbp)
je     1163 <test_base64_invalid+0x43>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1173 <test_base64_invalid+0x53>
jmp    11b9 <test_base64_invalid+0x99>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
call   1040 <_base64_check_decode@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
jmp    1142 <test_base64_invalid+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_base64_invalid>:
push   %rbx
lea    0xee0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xecf(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeb5(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe97(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe82(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe6c(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe57(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe3d(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe23(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <_base64_check_decode@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xe0f(%rip),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <_base64_check_decode@plt>

LLVM IR (-O0):
@test_base64_invalid.base64_vector = internal global [20 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i8* null, i8* null]
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"/=\00"
@.str.2 = [4 x i8] c"//=\00"
@.str.3 = [4 x i8] c"\\/=\00"
@.str.4 = [5 x i8] c"\\//=\00"
@.str.5 = [2 x i8] c"=\00"
@.str.6 = [3 x i8] c"==\00"
@.str.7 = [4 x i8] c"===\00"
@.str.8 = [5 x i8] c"====\00"
@.str.9 = [7 x i8] c"Zm9vYg\00"
define void @test_base64_invalid() {
%1 = alloca i8**
%2 = alloca i8**
store i8** getelementptr inbounds ([20 x i8*], [20 x i8*]* @test_base64_invalid.base64_vector, i64 0, i64 0), i8*** %1
store i8** getelementptr inbounds ([20 x i8*], [20 x i8*]* @test_base64_invalid.base64_vector, i64 0, i64 1), i8*** %2
br label %3
3: ; preds = %13, %0
%4 = load i8**, i8*** %1
%5 = load i8*, i8** %4
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = icmp ne i8* %9, null
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %26
13: ; preds = %11
%14 = load i8**, i8*** %1
%15 = load i8*, i8** %14
%16 = load i8**, i8*** %1
%17 = load i8*, i8** %16
%18 = call i32 @strlen(i8* %17)
%19 = load i8**, i8*** %2
%20 = load i8*, i8** %19
%21 = call i32 @_base64_check_decode(i8* %15, i32 %18, i8* %20)
%22 = load i8**, i8*** %1
%23 = getelementptr inbounds i8*, i8** %22, i64 2
store i8** %23, i8*** %1
%24 = load i8**, i8*** %2
%25 = getelementptr inbounds i8*, i8** %24, i64 2
store i8** %25, i8*** %2
br label %3
26: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"/=\00"
@.str.2 = [4 x i8] c"//=\00"
@.str.3 = [4 x i8] c"\\/=\00"
@.str.4 = [5 x i8] c"\\//=\00"
@.str.5 = [2 x i8] c"=\00"
@.str.6 = [3 x i8] c"==\00"
@.str.7 = [4 x i8] c"===\00"
@.str.8 = [5 x i8] c"====\00"
@.str.9 = [7 x i8] c"Zm9vYg\00"
define void @test_base64_invalid() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%17 = tail call i32 @strlen(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 @_base64_check_decode(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
ret void
}