#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 base64decode(char *, char *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int CfgImage(char *source, char *dest, int size) {
  char Gif[1300];
  char temp[1300];
  int size2;
  if (!source || !dest || !size) {
    return (0);
  }
  strncpy(Gif,
          "R0lGODlhEAAQAIcAAAAAAEYqImVJOXhILndPMnRTN0FBQEJER0REQ0dISE5OTlFKS1dM"
          "S1BQUFBR"
          "UVlZWVtcXWRNRGtUSm9dV3FWS3ddVmJhYmVlZWlpaWtsbG1tbmxub21ub3NoaHNrbXxu"
          "bnZwb3xx"
          "bnBwcHNzc3Byen1wcXx8f39/"
          "gZJKHZZMGYBNL75WFaJfMK9nJbRoILhwK712Oax9Trl0TN5tFb2d"
          "csmVU9+YTtuYUteocuOiXOCyduO1fPe+ev/Cav/"
          "NfoCAg4eHiIuDgomJiY+JiY6Pjo6Pk5OFhpeX"
          "m56Wl5iZmZ6enpucoKCgoKCjpKamp6anqKepqqmprKusrKytr6qwtrCwsbCxs7e3t7K0"
          "uLG3vrm5"
          "ubi5u73Awr/Bxdi5lc++tP/TgP3Ql/7bn/3ftv/fvv/hm//mqP/"
          "nrcPDw8PGzcfKzMrJy87Ozs3P"
          "0c3P1tLS0tHT1tPS19XV1dvb297e3v/zx//83eHj5uXl5ejm6Onp6evr6+3s7O/"
          "u7vPz8/f39/v7"
          "+/39/f///"
          "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAMAAIIALAAA"
          "AAAQABAA"
          "AAimAAUJFAjkxJElRUwwGcgQTQYucKI8mbIliQiGAjm0uWNlQwIEDR4o0MJwRBM1XdKQ"
          "sIBRIBsM"
          "QqRAyUKFRoGWgn7EWUPkAIgaYHREaKnBDRYDSkK46GEmxpCWEBxcEFiihQ8xBHBeYfjh"
          "RZkdAnBi"
          "pHDjDA4JYhmq4FHHy4S0Ao3ACGPniwe4ggbkGENGRhC4SFjYmLGCAd4KKVAEcIJXUIcF"
          "VQQFBAA7",
          1300);
  size2 = base64decode(temp, Gif);
  if (size2 < 1300) {
    size2 = 1300;
  }
  if (size2 > size) {
    return (0);
  }
  memcpy(dest, temp, size2);
  return (size2);
}


x86 assembly (clang, -O0):
<CfgImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <CfgImage+0x36>
cmpq   $0x0,-0x18(%rbp)
je     1166 <CfgImage+0x36>
cmpl   $0x0,-0x1c(%rbp)
jne    1172 <CfgImage+0x42>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <CfgImage+0xc7>
lea    -0x530(%rbp),%rdi
lea    0xe80(%rip),%rsi
mov    $0x514,%edx
call   1030 <strncpy@plt>
lea    -0xa50(%rbp),%rdi
lea    -0x530(%rbp),%rsi
call   1040 <base64decode@plt>
mov    %eax,-0xa54(%rbp)
cmpl   $0x514,-0xa54(%rbp)
jge    11bd <CfgImage+0x8d>
movl   $0x514,-0xa54(%rbp)
mov    -0xa54(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11d8 <CfgImage+0xa8>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <CfgImage+0xc7>
mov    -0x18(%rbp),%rdi
lea    -0xa50(%rbp),%rsi
mov    -0xa54(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0xa54(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CfgImage>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa40,%rsp
xor    %r14d,%r14d
test   %rdi,%rdi
je     119d <CfgImage+0x6d>
mov    %rsi,%r15
test   %rsi,%rsi
je     119d <CfgImage+0x6d>
mov    %edx,%ebp
test   %edx,%edx
je     119d <CfgImage+0x6d>
lea    0xea4(%rip),%rsi
lea    0x520(%rsp),%r12
mov    $0x514,%ebx
mov    %r12,%rdi
mov    $0x514,%edx
call   1030 <strncpy@plt>
mov    %rsp,%rdi
mov    %r12,%rsi
call   1040 <base64decode@plt>
cmp    $0x515,%eax
cmovge %eax,%ebx
cmp    %ebp,%ebx
jg     119d <CfgImage+0x6d>
mov    %rsp,%rsi
mov    %r15,%rdi
mov    %ebx,%edx
call   1050 <memcpy@plt>
mov    %ebx,%r14d
mov    %r14d,%eax
add    $0xa40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1293 x i8] c"R0lGODlhEAAQAIcAAAAAAEYqImVJOXhILndPMnRTN0FBQEJER0REQ0dISE5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o0MJwRBM1XdKQsIBRIBsMQqRAyUKFRoGWgn7EWUPkAIgaYHREaKnBDRYDSkK46GEmxpCWEBxcEFiihQ8xBHBeYfjhRZkdAnBipHDjDA4JYhmq4FHHy4S0Ao3ACGPniwe4ggbkGENGRhC4SFjYmLGCAd4KKVAEcIJXUIcFVQQFBAA7\00"
define i32 @CfgImage(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [1300 x i8]
%9 = alloca [1300 x i8]
%10 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32, i32* %7
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %16, %13, %3
store i32 0, i32* %4
br label %40
20: ; preds = %16
%21 = getelementptr inbounds [1300 x i8], [1300 x i8]* %8, i64 0, i64 0
%22 = call i32 @strncpy(i8* %21, i8* getelementptr inbounds ([1293 x i8], [1293 x i8]* @.str, i64 0, i64 0), i32 1300)
%23 = getelementptr inbounds [1300 x i8], [1300 x i8]* %9, i64 0, i64 0
%24 = getelementptr inbounds [1300 x i8], [1300 x i8]* %8, i64 0, i64 0
%25 = call i32 @base64decode(i8* %23, i8* %24)
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = icmp slt i32 %26, 1300
br i1 %27, label %28, label %29
28: ; preds = %20
store i32 1300, i32* %10
br label %29
29: ; preds = %28, %20
%30 = load i32, i32* %10
%31 = load i32, i32* %7
%32 = icmp sgt i32 %30, %31
br i1 %32, label %33, label %34
33: ; preds = %29
store i32 0, i32* %4
br label %40
34: ; preds = %29
%35 = load i8*, i8** %6
%36 = getelementptr inbounds [1300 x i8], [1300 x i8]* %9, i64 0, i64 0
%37 = load i32, i32* %10
%38 = call i32 @memcpy(i8* %35, i8* %36, i32 %37)
%39 = load i32, i32* %10
store i32 %39, i32* %4
br label %40
40: ; preds = %34, %33, %19
%41 = load i32, i32* %4
ret i32 %41
}

LLVM IR (-O2):
@.str = [1293 x i8] c"R0lGODlhEAAQAIcAAAAAAEYqImVJOXhILndPMnRTN0FBQEJER0REQ0dISE5OTlFKS1dMS1BQUFBRUVlZWVtcXWRNRGtUSm9dV3FWS3ddVmJhYmVlZWlpaWtsbG1tbmxub21ub3NoaHNrbXxubnZwb3xxbnBwcHNzc3Byen1wcXx8f39/gZJKHZZMGYBNL75WFaJfMK9nJbRoILhwK712Oax9Trl0TN5tFb2dcsmVU9+YTtuYUteocuOiXOCyduO1fPe+ev/Cav/NfoCAg4eHiIuDgomJiY+JiY6Pjo6Pk5OFhpeXm56Wl5iZmZ6enpucoKCgoKCjpKamp6anqKepqqmprKusrKytr6qwtrCwsbCxs7e3t7K0uLG3vrm5ubi5u73Awr/Bxdi5lc++tP/TgP3Ql/7bn/3ftv/fvv/hm//mqP/nrcPDw8PGzcfKzMrJy87Ozs3P0c3P1tLS0tHT1tPS19XV1dvb297e3v/zx//83eHj5uXl5ejm6Onp6evr6+3s7O/u7vPz8/f39/v7+/39/f///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAMAAIIALAAAAAAQABAAAAimAAUJFAjkxJElRUwwGcgQTQYucKI8mbIliQiGAjm0uWNlQwIEDR4o0MJwRBM1XdKQsIBRIBsMQqRAyUKFRoGWgn7EWUPkAIgaYHREaKnBDRYDSkK46GEmxpCWEBxcEFiihQ8xBHBeYfjhRZkdAnBipHDjDA4JYhmq4FHHy4S0Ao3ACGPniwe4ggbkGENGRhC4SFjYmLGCAd4KKVAEcIJXUIcFVQQFBAA7\00"
define i32 @CfgImage(i8* readnone %0, i8* %1, i32 %2) {
%4 = alloca [1300 x i8]
%5 = alloca [1300 x i8]
%6 = getelementptr inbounds [1300 x i8], [1300 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [1300 x i8], [1300 x i8]* %5, i64 0, i64 0
%8 = icmp ne i8* %0, null
%9 = icmp ne i8* %1, null
%10 = and i1 %8, %9
%11 = icmp ne i32 %2, 0
%12 = and i1 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %3
%14 = call i32 @strncpy(i8* %6, i8* getelementptr inbounds ([1293 x i8], [1293 x i8]* @.str, i64 0, i64 0), i32 1300)
%15 = call i32 @base64decode(i8* %7, i8* %6)
%16 = icmp sgt i32 %15, 1300
%17 = select i1 %16, i32 %15, i32 1300
%18 = icmp sgt i32 %17, %2
br i1 %18, label %21, label %19
19: ; preds = %13
%20 = call i32 @memcpy(i8* %1, i8* %7, i32 %17)
br label %21
21: ; preds = %13, %3, %19
%22 = phi i32 [ %17, %19 ], [ 0, %3 ], [ 0, %13 ]
ret i32 %22
}