#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 ListImage(char *source, char *dest, int size) {
  char Gif[1300];
  char temp[1300];
  int size2;
  if (!source || !dest || !size) {
    return (0);
  }
  strncpy(Gif,
          "R0lGODlhEAAQAIcAAAAAAB8seiUtWSMuYyMwaD1CX1oVFkkjI00yM2I/"
          "P0tPaFFSY1hcd3RKSn9M"
          "SG1ufxo/"
          "mwc1pCQ5tzpJiDxNkQ5J0yhWzjp24khTlllclktXokpWqUlTuktts2dpsGdot2RovGhp"
          "tlhnwUZ55COC/ymE/1uDzUyQ+Eyc/06d/1SM81CN/1id/1mc/1yY+1+b/F2c/12g/"
          "2KN1Wab82Ke"
          "/3+u7HWq/3bC/33B/5YqK5czMp03NphRUZtTUZpvb8cXGdkbHPQNC/"
          "oPDf89NNpGPP9ANt1RR/9N"
          "Sv9PTY6OjpGRkZWVmpiYmbWWlruYmaCgoKqqqqurq6yrq7CwsLm5vry8vJub0bCw2oDC"
          "/4nG/7rg"
          "/8utrM+xsc/P1M/P1tfX19rZ2dra2t7e38rK5cvV8dHR6dfe88Ti/8rl/97r/+ba2v/"
          "NxP/Rx+Li"
          "4+np6e7r6/Pt7fX19ff39/Pz+////"
          "wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
          "AAAAAAAA"
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAMAAHQALAAA"
          "AAAQABAA"
          "AAibAOkIHEhQIAgrGQoqpMNhhpYRDBYS3HDixoUCEp00odOFQocBTBb24LLFgcAlVRby"
          "MMJmDZEE"
          "EgXmEFJkSBADMen4AILkyA8EBceE+"
          "ODBC50GO3QcmELwiggzc8hooEJHihKFEl6gSXNmRYCYFUrQ"
          "sAGDRIQoEi2kaBGDBQoITyRicIElCw4VAmJ2mSCjhgkCSXLSeaBgAZScAQEAOw==",
          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):
<ListImage>:
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 <ListImage+0x36>
cmpq   $0x0,-0x18(%rbp)
je     1166 <ListImage+0x36>
cmpl   $0x0,-0x1c(%rbp)
jne    1172 <ListImage+0x42>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <ListImage+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 <ListImage+0x8d>
movl   $0x514,-0xa54(%rbp)
mov    -0xa54(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11d8 <ListImage+0xa8>
movl   $0x0,-0x4(%rbp)
jmp    11f7 <ListImage+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):
<ListImage>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa40,%rsp
xor    %r14d,%r14d
test   %rdi,%rdi
je     119d <ListImage+0x6d>
mov    %rsi,%r15
test   %rsi,%rsi
je     119d <ListImage+0x6d>
mov    %edx,%ebp
test   %edx,%edx
je     119d <ListImage+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 <ListImage+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 = [1281 x i8] c"R0lGODlhEAAQAIcAAAAAAB8seiUtWSMuYyMwaD1CX1oVFkkjI00yM2I/P0tPaFFSY1hcd3RKSn9MSG1ufxo/mwc1pCQ5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AILkyA8EBceE+ODBC50GO3QcmELwiggzc8hooEJHihKFEl6gSXNmRYCYFUrQsAGDRIQoEi2kaBGDBQoITyRicIElCw4VAmJ2mSCjhgkCSXLSeaBgAZScAQEAOw==\00"
define i32 @ListImage(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 ([1281 x i8], [1281 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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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAMAAHQALAAAAAAQABAAAAibAOkIHEhQIAgrGQoqpMNhhpYRDBYS3HDixoUCEp00odOFQocBTBb24LLFgcAlVRbyMMJmDZEEEgXmEFJkSBADMen4AILkyA8EBceE+ODBC50GO3QcmELwiggzc8hooEJHihKFEl6gSXNmRYCYFUrQsAGDRIQoEi2kaBGDBQoITyRicIElCw4VAmJ2mSCjhgkCSXLSeaBgAZScAQEAOw==\00"
define i32 @ListImage(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 ([1281 x i8], [1281 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
}