#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 char uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
scalar_t__ strstr(char *, char *);
int load_ccert() {
  int ret, len = 0, begin = 0, size = 0, str_len;
  FILE *fp = NULL;
  char buf[1024];
  char *cert = NULL;
  do {
    if (!(fp = fopen("client.crt", "r"))) {
      printf("Failed to open %s.", "client.crt");
      break;
    }
    if (fseek(fp, 0, SEEK_END) < 0 || (size = ftell(fp)) < 0) {
      printf("Failed to get file pos.");
      break;
    }
    if (!(cert = malloc(size))) {
      printf("Failed to allocate mem for ccert.");
      break;
    }
    begin = len = 0;
    fseek(fp, 0, SEEK_SET);
    while (fgets(buf, size, fp)) {
      if (!begin) {
        if (strstr(buf, "-----BEGIN CERTIFICATE-----")) {
          begin = 1;
        }
        continue;
      }
      if (!begin && strstr(buf, "-----BEGIN CERTIFICATE-----"))
        continue;
      if (strstr(buf, "-----END CERTIFICATE-----"))
        break;
      strcat(cert, buf);
      len += strlen(buf);
    }
    printf("cert = %s\n", cert);
    int out_len = 0;
    char *base64decode(const char *code_in, int *length, int place_in);
    uint8_t *decode = base64decode(cert, &len, 1);
    out_len = len;
    printf("len = %d\n", len);
    printf("len = %d\n", strlen(cert));
    printf("out_len = %d\n", out_len);
    printf("decode = %s\n", decode);
    for (int i = 0; i < out_len; i++) {
      printf("%02x ", (uint8_t)decode[i]);
      if (((i - 3) % 16) == 0)
        printf("\n");
    }
  } while (0);
  if (fp)
    fclose(fp);
  if (cert)
    free(cert);
  return 0;
}


x86 assembly (clang, -O0):
<load_ccert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x428(%rbp)
lea    0xe06(%rip),%rdi
lea    0xe0a(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    122e <load_ccert+0x6e>
lea    0xdf2(%rip),%rdi
lea    0xdde(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    14a6 <load_ccert+0x2e6>
mov    -0x20(%rbp),%rdi
mov    0x2daf(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
cmp    $0x0,%rax
jl     1261 <load_ccert+0xa1>
mov    -0x20(%rbp),%rdi
call   1090 <ftell@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1274 <load_ccert+0xb4>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    14a6 <load_ccert+0x2e6>
mov    -0x10(%rbp),%edi
call   10a0 <malloc@plt>
mov    %rax,-0x428(%rbp)
cmp    $0x0,%rax
jne    12a0 <load_ccert+0xe0>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    14a6 <load_ccert+0x2e6>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2d1f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1080 <fgets@plt>
cmp    $0x0,%rax
je     138a <load_ccert+0x1ca>
cmpl   $0x0,-0xc(%rbp)
jne    1312 <load_ccert+0x152>
lea    -0x420(%rbp),%rdi
lea    0xd63(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     130d <load_ccert+0x14d>
movl   $0x1,-0xc(%rbp)
jmp    12c2 <load_ccert+0x102>
cmpl   $0x0,-0xc(%rbp)
jne    133e <load_ccert+0x17e>
lea    -0x420(%rbp),%rdi
lea    0xd30(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     133e <load_ccert+0x17e>
jmp    12c2 <load_ccert+0x102>
lea    -0x420(%rbp),%rdi
lea    0xd2a(%rip),%rsi
call   10e0 <strstr@plt>
cmp    $0x0,%rax
je     1360 <load_ccert+0x1a0>
jmp    138a <load_ccert+0x1ca>
mov    -0x428(%rbp),%rdi
lea    -0x420(%rbp),%rsi
call   10d0 <strcat@plt>
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    12c2 <load_ccert+0x102>
mov    -0x428(%rbp),%rsi
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x42c(%rbp)
mov    -0x428(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1070 <base64decode@plt>
mov    %rax,-0x438(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x42c(%rbp)
mov    -0x8(%rbp),%esi
lea    0xcc7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x428(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%esi
lea    0xcab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x42c(%rbp),%esi
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x438(%rbp),%rsi
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x43c(%rbp)
mov    -0x43c(%rbp),%eax
cmp    -0x42c(%rbp),%eax
jge    14a1 <load_ccert+0x2e1>
mov    -0x438(%rbp),%rax
movslq -0x43c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xc5d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x43c(%rbp),%eax
sub    $0x3,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1488 <load_ccert+0x2c8>
lea    0xc26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    148d <load_ccert+0x2cd>
mov    -0x43c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x43c(%rbp)
jmp    142e <load_ccert+0x26e>
jmp    14a6 <load_ccert+0x2e6>
cmpq   $0x0,-0x20(%rbp)
je     14ba <load_ccert+0x2fa>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
cmpq   $0x0,-0x428(%rbp)
je     14d4 <load_ccert+0x314>
mov    -0x428(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_ccert>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
lea    0xe18(%rip),%rdi
lea    0xe1c(%rip),%rsi
call   10d0 <fopen@plt>
test   %rax,%rax
je     12f4 <load_ccert+0x124>
mov    %rax,%r15
mov    0x2de1(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
lea    0xe06(%rip),%rbx
test   %rax,%rax
js     13d5 <load_ccert+0x205>
mov    %r15,%rdi
call   10a0 <ftell@plt>
test   %eax,%eax
js     13d5 <load_ccert+0x205>
mov    %eax,%ebp
mov    %eax,%edi
call   10b0 <malloc@plt>
test   %rax,%rax
je     13ce <load_ccert+0x1fe>
mov    %rax,%r14
movl   $0x0,0xc(%rsp)
mov    0x2d81(%rip),%rax
mov    (%rax),%edx
xor    %r12d,%r12d
mov    %r15,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
lea    0x10(%rsp),%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     130e <load_ccert+0x13e>
lea    0x10(%rsp),%rbx
xor    %r13d,%r13d
jmp    12b8 <load_ccert+0xe8>
nopl   0x0(%rax,%rax,1)
lea    0xdc3(%rip),%rsi
call   10f0 <strstr@plt>
xor    %r13d,%r13d
test   %rax,%rax
setne  %r13b
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
call   1090 <fgets@plt>
test   %rax,%rax
je     130e <load_ccert+0x13e>
mov    %rbx,%rdi
test   %r13d,%r13d
je     1290 <load_ccert+0xc0>
lea    0xdaf(%rip),%rsi
call   10f0 <strstr@plt>
test   %rax,%rax
jne    130e <load_ccert+0x13e>
mov    %r14,%rdi
mov    %rbx,%rsi
call   10e0 <strcat@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
add    %eax,%r12d
mov    %r12d,0xc(%rsp)
mov    $0x1,%r13d
jmp    12a6 <load_ccert+0xd6>
lea    0xd12(%rip),%rdi
lea    0xcfe(%rip),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    13e7 <load_ccert+0x217>
lea    0xd7b(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
mov    $0x1,%edx
call   1080 <base64decode@plt>
mov    %rax,%r13
mov    0xc(%rsp),%ebx
lea    0xd60(%rip),%r12
mov    %r12,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd35(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd33(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
test   %ebx,%ebx
jle    13bc <load_ccert+0x1ec>
lea    0xd2b(%rip),%r12
xor    %ebp,%ebp
jmp    1399 <load_ccert+0x1c9>
nop
add    $0x1,%rbp
cmp    %rbp,%rbx
je     13bc <load_ccert+0x1ec>
movsbl 0x0(%r13,%rbp,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd(%rbp),%eax
test   $0xf,%al
jne    1390 <load_ccert+0x1c0>
mov    $0xa,%edi
call   1040 <putchar@plt>
jmp    1390 <load_ccert+0x1c0>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %r14,%rdi
call   1030 <free@plt>
jmp    13e7 <load_ccert+0x217>
lea    0xc63(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"client.crt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [19 x i8] c"Failed to open %s.\00"
@SEEK_END = global i32 0
@.str.3 = [24 x i8] c"Failed to get file pos.\00"
@.str.4 = [34 x i8] c"Failed to allocate mem for ccert.\00"
@SEEK_SET = global i32 0
@.str.5 = [28 x i8] c"-----BEGIN CERTIFICATE-----\00"
@.str.6 = [26 x i8] c"-----END CERTIFICATE-----\00"
@.str.7 = [11 x i8] c"cert = %s\0A\00"
@.str.8 = [10 x i8] c"len = %d\0A\00"
@.str.9 = [14 x i8] c"out_len = %d\0A\00"
@.str.10 = [13 x i8] c"decode = %s\0A\00"
@.str.11 = [6 x i8] c"%02x \00"
@.str.12 = [2 x i8] c"\0A\00"
define i32 @load_ccert() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [1024 x i8]
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32* null, i32** %6
store i8* null, i8** %8
br label %12
12: ; preds = %0
%13 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %6
%14 = icmp ne i32* %13, null
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %112
17: ; preds = %12
%18 = load i32*, i32** %6
%19 = load i32, i32* @SEEK_END
%20 = call i64 @fseek(i32* %18, i32 0, i32 %19)
%21 = icmp slt i64 %20, 0
br i1 %21, label %26, label %22
22: ; preds = %17
%23 = load i32*, i32** %6
%24 = call i32 @ftell(i32* %23)
store i32 %24, i32* %4
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22, %17
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %112
28: ; preds = %22
%29 = load i32, i32* %4
%30 = call i8* @malloc(i32 %29)
store i8* %30, i8** %8
%31 = icmp ne i8* %30, null
br i1 %31, label %34, label %32
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %112
34: ; preds = %28
store i32 0, i32* %2
store i32 0, i32* %3
%35 = load i32*, i32** %6
%36 = load i32, i32* @SEEK_SET
%37 = call i64 @fseek(i32* %35, i32 0, i32 %36)
br label %38
38: ; preds = %66, %60, %52, %34
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%40 = load i32, i32* %4
%41 = load i32*, i32** %6
%42 = call i64 @fgets(i8* %39, i32 %40, i32* %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %74
44: ; preds = %38
%45 = load i32, i32* %3
%46 = icmp ne i32 %45, 0
br i1 %46, label %53, label %47
47: ; preds = %44
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%49 = call i64 @strstr(i8* %48, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %47
store i32 1, i32* %3
br label %52
52: ; preds = %51, %47
br label %38
53: ; preds = %44
%54 = load i32, i32* %3
%55 = icmp ne i32 %54, 0
br i1 %55, label %61, label %56
56: ; preds = %53
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%58 = call i64 @strstr(i8* %57, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %56
br label %38
61: ; preds = %56, %53
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%63 = call i64 @strstr(i8* %62, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%64 = icmp ne i64 %63, 0
br i1 %64, label %65, label %66
65: ; preds = %61
br label %74
66: ; preds = %61
%67 = load i8*, i8** %8
%68 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%69 = call i32 @strcat(i8* %67, i8* %68)
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%71 = call i32 @strlen(i8* %70)
%72 = load i32, i32* %2
%73 = add nsw i32 %72, %71
store i32 %73, i32* %2
br label %38
74: ; preds = %65, %38
%75 = load i8*, i8** %8
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %75)
store i32 0, i32* %9
%77 = load i8*, i8** %8
%78 = call i8* @base64decode(i8* %77, i32* %2, i32 1)
store i8* %78, i8** %10
%79 = load i32, i32* %2
store i32 %79, i32* %9
%80 = load i32, i32* %2
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %80)
%82 = load i8*, i8** %8
%83 = call i32 @strlen(i8* %82)
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %83)
%85 = load i32, i32* %9
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %85)
%87 = load i8*, i8** %10
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %87)
store i32 0, i32* %11
br label %89
89: ; preds = %108, %74
%90 = load i32, i32* %11
%91 = load i32, i32* %9
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %111
93: ; preds = %89
%94 = load i8*, i8** %10
%95 = load i32, i32* %11
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8, i8* %94, i64 %96
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %11
%102 = sub nsw i32 %101, 3
%103 = srem i32 %102, 16
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %107
105: ; preds = %93
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %107
107: ; preds = %105, %93
br label %108
108: ; preds = %107
%109 = load i32, i32* %11
%110 = add nsw i32 %109, 1
store i32 %110, i32* %11
br label %89
111: ; preds = %89
br label %112
112: ; preds = %111, %32, %26, %15
%113 = load i32*, i32** %6
%114 = icmp ne i32* %113, null
br i1 %114, label %115, label %118
115: ; preds = %112
%116 = load i32*, i32** %6
%117 = call i32 @fclose(i32* %116)
br label %118
118: ; preds = %115, %112
%119 = load i8*, i8** %8
%120 = icmp ne i8* %119, null
br i1 %120, label %121, label %124
121: ; preds = %118
%122 = load i8*, i8** %8
%123 = call i32 @free(i8* %122)
br label %124
124: ; preds = %121, %118
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"client.crt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [19 x i8] c"Failed to open %s.\00"
@SEEK_END = global i32 0
@.str.3 = [24 x i8] c"Failed to get file pos.\00"
@.str.4 = [34 x i8] c"Failed to allocate mem for ccert.\00"
@SEEK_SET = global i32 0
@.str.5 = [28 x i8] c"-----BEGIN CERTIFICATE-----\00"
@.str.6 = [26 x i8] c"-----END CERTIFICATE-----\00"
@.str.7 = [11 x i8] c"cert = %s\0A\00"
@.str.8 = [10 x i8] c"len = %d\0A\00"
@.str.9 = [14 x i8] c"out_len = %d\0A\00"
@.str.10 = [13 x i8] c"decode = %s\0A\00"
@.str.11 = [6 x i8] c"%02x \00"
define i32 @load_ccert() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %78
9: ; preds = %0
%10 = load i32, i32* @SEEK_END
%11 = tail call i64 @fseek(i32* %5, i32 0, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %71, label %13
13: ; preds = %9
%14 = tail call i32 @ftell(i32* %5)
%15 = icmp slt i32 %14, 0
br i1 %15, label %71, label %16
16: ; preds = %13
%17 = tail call i8* @malloc(i32 %14)
%18 = icmp eq i8* %17, null
br i1 %18, label %71, label %19
19: ; preds = %16
store i32 0, i32* %1
%20 = load i32, i32* @SEEK_SET
%21 = tail call i64 @fseek(i32* %5, i32 0, i32 %20)
%22 = call i64 @fgets(i8* %4, i32 %14, i32* %5)
%23 = icmp eq i64 %22, 0
br i1 %23, label %44, label %24
24: ; preds = %19, %32
%25 = phi i32 [ %33, %32 ], [ 0, %19 ]
%26 = phi i32 [ %34, %32 ], [ 0, %19 ]
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0))
%30 = icmp ne i64 %29, 0
%31 = zext i1 %30 to i32
br label %32
32: ; preds = %28, %40
%33 = phi i32 [ %43, %40 ], [ %25, %28 ]
%34 = phi i32 [ 1, %40 ], [ %31, %28 ]
%35 = call i64 @fgets(i8* %4, i32 %14, i32* %5)
%36 = icmp eq i64 %35, 0
br i1 %36, label %44, label %24
37: ; preds = %24
%38 = call i64 @strstr(i8* %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = call i32 @strcat(i8* %17, i8* %4)
%42 = call i32 @strlen(i8* %4)
%43 = add nsw i32 %25, %42
store i32 %43, i32* %1
br label %32
44: ; preds = %32, %37, %19
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %17)
%46 = call i8* @base64decode(i8* %17, i32* %1, i32 1)
%47 = load i32, i32* %1
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %47)
%49 = call i32 @strlen(i8* %17)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %47)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %46)
%53 = icmp sgt i32 %47, 0
br i1 %53, label %54, label %75
54: ; preds = %44
%55 = zext i32 %47 to i64
br label %56
56: ; preds = %54, %68
%57 = phi i64 [ 0, %54 ], [ %69, %68 ]
%58 = getelementptr inbounds i8, i8* %46, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %60)
%62 = trunc i64 %57 to i32
%63 = add i32 %62, 13
%64 = and i32 %63, 15
%65 = icmp eq i32 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %56
%67 = call i32 @putchar(i32 10)
br label %68
68: ; preds = %56, %66
%69 = add nuw nsw i64 %57, 1
%70 = icmp eq i64 %69, %55
br i1 %70, label %75, label %56
71: ; preds = %16, %9, %13
%72 = phi i8* [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), %13 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), %9 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), %16 ]
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %72)
%74 = call i32 @fclose(i32* %5)
br label %78
75: ; preds = %68, %44
%76 = call i32 @fclose(i32* %5)
%77 = call i32 @free(i8* %17)
br label %78
78: ; preds = %71, %7, %75
ret i32 0
}