#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 /*<<< orphan*/ src3;
typedef int /*<<< orphan*/ src2;
typedef int /*<<< orphan*/ src1;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ validate(char const *, unsigned char const *, int);
int main(int argc, char *argv[]) {
  const unsigned char src1[] = {0x14, 0xfb, 0x9c, 0x03, 0xd9, 0x7e};
  const unsigned char src2[] = {0x14, 0xfb, 0x9c, 0x03, 0xd9};
  const unsigned char src3[] = {0x14, 0xfb, 0x9c, 0x03};
  const char dst1[] = "FPucA9l+";
  const char dst2[] = "FPucA9k=";
  const char dst3[] = "FPucAw==";
  if (validate(dst1, src1, sizeof(src1)) < 0) {
    exit(EXIT_FAILURE);
  }
  if (validate(dst2, src2, sizeof(src2)) < 0) {
    exit(EXIT_FAILURE);
  }
  if (validate(dst3, src3, sizeof(src3)) < 0) {
    exit(EXIT_FAILURE);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    0xeb6(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xeb1(%rip),%al
mov    %al,-0x17(%rbp)
mov    0xea9(%rip),%eax
mov    %eax,-0x1f(%rbp)
mov    0xea3(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xea1(%rip),%al
mov    %al,-0x20(%rbp)
mov    0xe98(%rip),%rax
mov    %rax,-0x31(%rbp)
mov    0xe96(%rip),%al
mov    %al,-0x29(%rbp)
mov    0xe8d(%rip),%rax
mov    %rax,-0x3a(%rbp)
mov    0xe8b(%rip),%al
mov    %al,-0x32(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x16(%rbp),%rsi
mov    $0x6,%edx
call   1030 <validate@plt>
cmp    $0x0,%rax
jge    11cb <main+0xab>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
lea    -0x31(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
mov    $0x5,%edx
call   1030 <validate@plt>
cmp    $0x0,%rax
jge    11f5 <main+0xd5>
mov    0x2df2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
lea    -0x3a(%rbp),%rdi
lea    -0x1f(%rbp),%rsi
mov    $0x4,%edx
call   1030 <validate@plt>
cmp    $0x0,%rax
jge    121f <main+0xff>
mov    0x2dc8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movw   $0x7ed9,0x14(%rsp)
movl   $0x39cfb14,0x10(%rsp)
03
movb   $0xd9,0x8(%rsp)
movl   $0x39cfb14,0x4(%rsp)
03
movl   $0x39cfb14,0xc(%rsp)
03
movabs $0x2b6c394163755046,%rax
39 6c 2b
mov    %rax,0x38(%rsp)
movb   $0x0,0x40(%rsp)
movabs $0x3d6b394163755046,%rax
39 6b 3d
mov    %rax,0x28(%rsp)
movb   $0x0,0x30(%rsp)
movabs $0x3d3d774163755046,%rax
77 3d 3d
mov    %rax,0x18(%rsp)
movb   $0x0,0x20(%rsp)
lea    0x38(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x6,%edx
call   1030 <validate@plt>
test   %rax,%rax
js     11cf <main+0xaf>
lea    0x28(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x5,%edx
call   1030 <validate@plt>
test   %rax,%rax
js     11cf <main+0xaf>
lea    0x18(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <validate@plt>
test   %rax,%rax
jns    11dd <main+0xbd>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    0x2df4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@__const.main.src1 = [6 x i8] c"\14\FB\9C\03\D9~"
@__const.main.src2 = [5 x i8] c"\14\FB\9C\03\D9"
@__const.main.src3 = [4 x i8] c"\14\FB\9C\03"
@__const.main.dst1 = [9 x i8] c"FPucA9l+\00"
@__const.main.dst2 = [9 x i8] c"FPucA9k=\00"
@__const.main.dst3 = [9 x i8] c"FPucAw==\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i8]
%7 = alloca [5 x i8]
%8 = alloca [4 x i8]
%9 = alloca [9 x i8]
%10 = alloca [9 x i8]
%11 = alloca [9 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = bitcast [6 x i8]* %6 to i8*
%13 = bitcast [5 x i8]* %7 to i8*
%14 = bitcast [4 x i8]* %8 to i8*
%15 = bitcast [9 x i8]* %9 to i8*
%16 = bitcast [9 x i8]* %10 to i8*
%17 = bitcast [9 x i8]* %11 to i8*
%18 = getelementptr inbounds [9 x i8], [9 x i8]* %9, i64 0, i64 0
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%20 = call i64 @validate(i8* %18, i8* %19, i32 6)
%21 = icmp slt i64 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = load i32, i32* @EXIT_FAILURE
%24 = call i32 @exit(i32 %23)
unreachable
25: ; preds = %2
%26 = getelementptr inbounds [9 x i8], [9 x i8]* %10, i64 0, i64 0
%27 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%28 = call i64 @validate(i8* %26, i8* %27, i32 5)
%29 = icmp slt i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %25
%34 = getelementptr inbounds [9 x i8], [9 x i8]* %11, i64 0, i64 0
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %8, i64 0, i64 0
%36 = call i64 @validate(i8* %34, i8* %35, i32 4)
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i32, i32* @EXIT_FAILURE
%40 = call i32 @exit(i32 %39)
unreachable
41: ; preds = %33
%42 = load i32, i32* @EXIT_SUCCESS
%43 = call i32 @exit(i32 %42)
unreachable
}

LLVM IR (-O2):
@__const.main.src1 = [6 x i8] c"\14\FB\9C\03\D9~"
@__const.main.src2 = [5 x i8] c"\14\FB\9C\03\D9"
@__const.main.dst1 = [9 x i8] c"FPucA9l+\00"
@__const.main.dst2 = [9 x i8] c"FPucA9k=\00"
@__const.main.dst3 = [9 x i8] c"FPucAw==\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = alloca [5 x i8]
%5 = alloca i32
%6 = alloca [9 x i8]
%7 = alloca [9 x i8]
%8 = alloca [9 x i8]
%9 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%11 = bitcast i32* %5 to i8*
store i32 60619540, i32* %5
%12 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [9 x i8], [9 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [9 x i8], [9 x i8]* %8, i64 0, i64 0
%15 = call i64 @validate(i8* %12, i8* %9, i32 6)
%16 = icmp slt i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
%21 = call i64 @validate(i8* %13, i8* %10, i32 5)
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %20
%27 = call i64 @validate(i8* %14, i8* %11, i32 4)
%28 = icmp slt i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i32, i32* @EXIT_FAILURE
%31 = call i32 @exit(i32 %30)
unreachable
32: ; preds = %26
%33 = load i32, i32* @EXIT_SUCCESS
%34 = call i32 @exit(i32 %33)
unreachable
}