#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*/ uint8_t;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ EVP_MD_CTX;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int /*<<< orphan*/ EVP_DigestFinal_ex(int /*<<< orphan*/ *, unsigned char *,
                                      unsigned int *);
int /*<<< orphan*/ EVP_DigestInit_ex(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ EVP_DigestUpdate(int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ const *, int const);
int EVP_MAX_MD_SIZE;
int /*<<< orphan*/ *EVP_MD_CTX_create();
int /*<<< orphan*/ EVP_MD_CTX_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ *EVP_get_digestbyname(char *);
int /*<<< orphan*/ X509_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_print_fp(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ *d2i_X509(int /*<<< orphan*/ *, unsigned char const **,
                             int const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int print_x509(const uint8_t *cert, const int cert_size) {
  X509 *X509cert;
  EVP_MD_CTX *ctx;
  const EVP_MD *md;
  unsigned int md_len;
  const unsigned char *in = (const unsigned char *)cert;
  unsigned char fingerprint[EVP_MAX_MD_SIZE];
  X509cert = d2i_X509(NULL, &in, cert_size);
  if (X509cert == NULL) {
    fprintf(stderr, "Invalid X509 certificate\n");
    return -1;
  }
  md = EVP_get_digestbyname("SHA1");
  if (md == NULL) {
    fprintf(stderr, "Failed to get SHA1 digest\n");
    goto cleanup_cert;
  }
  ctx = EVP_MD_CTX_create();
  if (ctx == NULL) {
    fprintf(stderr, "Failed to create digest context\n");
    goto cleanup_cert;
  }
  if (!EVP_DigestInit_ex(ctx, md, NULL)) {
    fprintf(stderr, "Failed to initialize digest context\n");
    goto cleanup_ctx;
  }
  if (!EVP_DigestUpdate(ctx, cert, cert_size)) {
    fprintf(stderr, "Failed to hash into the digest context\n");
    goto cleanup_ctx;
  }
  if (!EVP_DigestFinal_ex(ctx, fingerprint, &md_len)) {
    fprintf(stderr, "Failed to get digest value\n");
    goto cleanup_ctx;
  }
  printf("SHA1 Fingerprint: ");
  for (unsigned int i = 0; i < md_len; i++) {
    printf("%02x", fingerprint[i]);
    if (i < md_len - 1)
      printf(":");
  }
  printf("\n");
  X509_print_fp(stdout, X509cert);
cleanup_ctx:
  EVP_MD_CTX_destroy(ctx);
cleanup_cert:
  X509_free(X509cert);
  return 0;
}


x86 assembly (clang, -O0):
<print_x509>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    0x2e1a(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    %eax,%edi
lea    -0x40(%rbp),%rsi
call   10c0 <d2i_X509@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    123a <print_x509+0x8a>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
call   1070 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    13e6 <print_x509+0x236>
lea    0xdd9(%rip),%rdi
call   10a0 <EVP_get_digestbyname@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    126f <print_x509+0xbf>
mov    0x2d7c(%rip),%rax
mov    (%rax),%edi
lea    0xdba(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13cf <print_x509+0x21f>
mov    $0x0,%al
call   10d0 <EVP_MD_CTX_create@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    129f <print_x509+0xef>
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
lea    0xda5(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13cf <print_x509+0x21f>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1060 <EVP_DigestInit_ex@plt>
cmp    $0x0,%eax
jne    12d3 <print_x509+0x123>
mov    0x2d18(%rip),%rax
mov    (%rax),%edi
lea    0xd92(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13c6 <print_x509+0x216>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1080 <EVP_DigestUpdate@plt>
cmp    $0x0,%eax
jne    1306 <print_x509+0x156>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
lea    0xd84(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13c6 <print_x509+0x216>
mov    -0x60(%rbp),%rsi
mov    -0x28(%rbp),%rdi
lea    -0x34(%rbp),%rdx
call   1040 <EVP_DigestFinal_ex@plt>
cmp    $0x0,%eax
jne    133a <print_x509+0x18a>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
lea    0xd78(%rip),%rsi
call   1070 <fprintf@plt>
jmp    13c6 <print_x509+0x216>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x34(%rbp),%eax
jae    13a6 <print_x509+0x1f6>
mov    -0x60(%rbp),%rax
mov    -0x58(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x58(%rbp),%eax
mov    -0x34(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    1393 <print_x509+0x1e3>
lea    0xd50(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1398 <print_x509+0x1e8>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    134f <print_x509+0x19f>
lea    0xc6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2c15(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rsi
call   1030 <X509_print_fp@plt>
mov    -0x28(%rbp),%rdi
call   1090 <EVP_MD_CTX_destroy@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <X509_free@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_x509>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,%r12d
mov    %rdi,%r13
mov    %rsp,%rbx
mov    %rdi,-0x48(%rbp)
mov    0x2e03(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
lea    -0x48(%rbp),%rsi
xor    %edi,%edi
mov    %r12d,%edx
call   10d0 <d2i_X509@plt>
test   %rax,%rax
je     12e8 <print_x509+0x128>
mov    %rax,-0x40(%rbp)
lea    0xe00(%rip),%rdi
call   10b0 <EVP_get_digestbyname@plt>
test   %rax,%rax
je     1307 <print_x509+0x147>
mov    %rax,%r14
xor    %eax,%eax
call   10e0 <EVP_MD_CTX_create@plt>
test   %rax,%rax
je     1321 <print_x509+0x161>
mov    %rbx,-0x38(%rbp)
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1070 <EVP_DigestInit_ex@plt>
test   %eax,%eax
je     1338 <print_x509+0x178>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
call   1090 <EVP_DigestUpdate@plt>
test   %eax,%eax
je     136e <print_x509+0x1ae>
lea    -0x2c(%rbp),%rdx
mov    %rbx,%r13
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <EVP_DigestFinal_ex@plt>
test   %eax,%eax
je     1388 <print_x509+0x1c8>
mov    -0x38(%rbp),%r14
lea    0xe32(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,-0x2c(%rbp)
je     134a <print_x509+0x18a>
lea    0xe2d(%rip),%r12
xor    %ebx,%ebx
jmp    12bf <print_x509+0xff>
xchg   %ax,%ax
add    $0x1,%rbx
mov    %eax,%eax
cmp    %rax,%rbx
jae    134a <print_x509+0x18a>
movzbl (%r15,%rbx,1),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    -0x2c(%rbp),%eax
lea    -0x1(%rax),%ecx
cmp    %rcx,%rbx
jae    12b0 <print_x509+0xf0>
mov    $0x3a,%edi
call   1030 <putchar@plt>
mov    -0x2c(%rbp),%eax
jmp    12b0 <print_x509+0xf0>
mov    0x2ce9(%rip),%rax
mov    (%rax),%edi
lea    0xd08(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    13b4 <print_x509+0x1f4>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
lea    0xd08(%rip),%rsi
call   1080 <fprintf@plt>
jmp    13a9 <print_x509+0x1e9>
mov    0x2cb0(%rip),%rax
mov    (%rax),%edi
lea    0xd09(%rip),%rsi
call   1080 <fprintf@plt>
jmp    13a9 <print_x509+0x1e9>
mov    0x2c99(%rip),%rax
mov    (%rax),%edi
lea    0xd13(%rip),%rsi
jmp    137e <print_x509+0x1be>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2c75(%rip),%rax
mov    (%rax),%edi
mov    -0x40(%rbp),%rsi
call   1040 <X509_print_fp@plt>
mov    %r14,%rbx
mov    %r13,%rdi
jmp    13a4 <print_x509+0x1e4>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
lea    0xd02(%rip),%rsi
call   1080 <fprintf@plt>
mov    %rbx,%rdi
jmp    13a0 <print_x509+0x1e0>
mov    0x2c49(%rip),%rax
mov    (%rax),%edi
lea    0xd10(%rip),%rsi
call   1080 <fprintf@plt>
mov    %r13,%rdi
mov    -0x38(%rbp),%rbx
call   10a0 <EVP_MD_CTX_destroy@plt>
mov    -0x40(%rbp),%rdi
call   10c0 <X509_free@plt>
xor    %eax,%eax
mov    %rbx,%rsp
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EVP_MAX_MD_SIZE = global i32 0
@stderr = global i32 0
@.str = [26 x i8] c"Invalid X509 certificate\0A\00"
@.str.1 = [5 x i8] c"SHA1\00"
@.str.2 = [27 x i8] c"Failed to get SHA1 digest\0A\00"
@.str.3 = [33 x i8] c"Failed to create digest context\0A\00"
@.str.4 = [37 x i8] c"Failed to initialize digest context\0A\00"
@.str.5 = [40 x i8] c"Failed to hash into the digest context\0A\00"
@.str.6 = [28 x i8] c"Failed to get digest value\0A\00"
@.str.7 = [19 x i8] c"SHA1 Fingerprint: \00"
@.str.8 = [5 x i8] c"%02x\00"
@.str.9 = [2 x i8] c":\00"
@.str.10 = [2 x i8] c"\0A\00"
@stdout = global i32 0
define i32 @print_x509(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%15 = load i32*, i32** %4
%16 = bitcast i32* %15 to i8*
store i8* %16, i8** %10
%17 = load i32, i32* @EVP_MAX_MD_SIZE
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %11
%20 = alloca i8, i64 %18
store i64 %18, i64* %12
%21 = load i32, i32* %5
%22 = call i32* @d2i_X509(i32* null, i8** %10, i32 %21)
store i32* %22, i32** %6
%23 = load i32*, i32** %6
%24 = icmp eq i32* %23, null
br i1 %24, label %25, label %28
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
store i32 1, i32* %13
br label %100
28: ; preds = %2
%29 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32* %29, i32** %8
%30 = load i32*, i32** %8
%31 = icmp eq i32* %30, null
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %97
35: ; preds = %28
%36 = call i32* (...) @EVP_MD_CTX_create()
store i32* %36, i32** %7
%37 = load i32*, i32** %7
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %97
42: ; preds = %35
%43 = load i32*, i32** %7
%44 = load i32*, i32** %8
%45 = call i32 @EVP_DigestInit_ex(i32* %43, i32* %44, i32* null)
%46 = icmp ne i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %42
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
br label %94
50: ; preds = %42
%51 = load i32*, i32** %7
%52 = load i32*, i32** %4
%53 = load i32, i32* %5
%54 = call i32 @EVP_DigestUpdate(i32* %51, i32* %52, i32 %53)
%55 = icmp ne i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %50
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %94
59: ; preds = %50
%60 = load i32*, i32** %7
%61 = call i32 @EVP_DigestFinal_ex(i32* %60, i8* %20, i32* %9)
%62 = icmp ne i32 %61, 0
br i1 %62, label %66, label %63
63: ; preds = %59
%64 = load i32, i32* @stderr
%65 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %94
66: ; preds = %59
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %14
br label %68
68: ; preds = %86, %66
%69 = load i32, i32* %14
%70 = load i32, i32* %9
%71 = icmp ult i32 %69, %70
br i1 %71, label %72, label %89
72: ; preds = %68
%73 = load i32, i32* %14
%74 = zext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %20, i64 %74
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %77)
%79 = load i32, i32* %14
%80 = load i32, i32* %9
%81 = sub i32 %80, 1
%82 = icmp ult i32 %79, %81
br i1 %82, label %83, label %85
83: ; preds = %72
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
br label %85
85: ; preds = %83, %72
br label %86
86: ; preds = %85
%87 = load i32, i32* %14
%88 = add i32 %87, 1
store i32 %88, i32* %14
br label %68
89: ; preds = %68
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%91 = load i32, i32* @stdout
%92 = load i32*, i32** %6
%93 = call i32 @X509_print_fp(i32 %91, i32* %92)
br label %94
94: ; preds = %89, %63, %56, %47
%95 = load i32*, i32** %7
%96 = call i32 @EVP_MD_CTX_destroy(i32* %95)
br label %97
97: ; preds = %94, %39, %32
%98 = load i32*, i32** %6
%99 = call i32 @X509_free(i32* %98)
store i32 0, i32* %3
store i32 1, i32* %13
br label %100
100: ; preds = %97, %25
%101 = load i8*, i8** %11
%102 = load i32, i32* %3
ret i32 %102
}

LLVM IR (-O2):
@EVP_MAX_MD_SIZE = global i32 0
@stderr = global i32 0
@.str = [26 x i8] c"Invalid X509 certificate\0A\00"
@.str.1 = [5 x i8] c"SHA1\00"
@.str.2 = [27 x i8] c"Failed to get SHA1 digest\0A\00"
@.str.3 = [33 x i8] c"Failed to create digest context\0A\00"
@.str.4 = [37 x i8] c"Failed to initialize digest context\0A\00"
@.str.5 = [40 x i8] c"Failed to hash into the digest context\0A\00"
@.str.6 = [28 x i8] c"Failed to get digest value\0A\00"
@.str.7 = [19 x i8] c"SHA1 Fingerprint: \00"
@.str.8 = [5 x i8] c"%02x\00"
@stdout = global i32 0
define i32 @print_x509(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i8** %4 to i8*
%7 = bitcast i8** %4 to i32**
store i32* %0, i32** %7
%8 = load i32, i32* @EVP_MAX_MD_SIZE
%9 = zext i32 %8 to i64
%10 = tail call i8* @llvm.stacksave()
%11 = alloca i8, i64 %9
%12 = call i32* @d2i_X509(i32* null, i8** %4, i32 %1)
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %77
17: ; preds = %2
%18 = call i32* @EVP_get_digestbyname(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %75
23: ; preds = %17
%24 = call i32* (...) @EVP_MD_CTX_create()
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
br label %75
29: ; preds = %23
%30 = call i32 @EVP_DigestInit_ex(i32* %24, i32* %18, i32* null)
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* @stderr
%34 = call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
br label %73
35: ; preds = %29
%36 = call i32 @EVP_DigestUpdate(i32* %24, i32* %0, i32 %1)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.5, i64 0, i64 0))
br label %73
41: ; preds = %35
%42 = call i32 @EVP_DigestFinal_ex(i32* %24, i8* %11, i32* %3)
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %73
47: ; preds = %41
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%49 = load i32, i32* %3
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %68, %47
%52 = call i32 @putchar(i32 10)
%53 = load i32, i32* @stdout
%54 = call i32 @X509_print_fp(i32 %53, i32* %12)
br label %73
55: ; preds = %47, %68
%56 = phi i64 [ %70, %68 ], [ 0, %47 ]
%57 = getelementptr inbounds i8, i8* %11, i64 %56
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %59)
%61 = load i32, i32* %3
%62 = add i32 %61, -1
%63 = zext i32 %62 to i64
%64 = icmp ult i64 %56, %63
br i1 %64, label %65, label %68
65: ; preds = %55
%66 = call i32 @putchar(i32 58)
%67 = load i32, i32* %3
br label %68
68: ; preds = %55, %65
%69 = phi i32 [ %61, %55 ], [ %67, %65 ]
%70 = add nuw nsw i64 %56, 1
%71 = zext i32 %69 to i64
%72 = icmp ult i64 %70, %71
br i1 %72, label %55, label %51
73: ; preds = %51, %44, %38, %32
%74 = call i32 @EVP_MD_CTX_destroy(i32* %24)
br label %75
75: ; preds = %73, %26, %20
%76 = call i32 @X509_free(i32* %12)
br label %77
77: ; preds = %75, %14
%78 = phi i32 [ -1, %14 ], [ 0, %75 ]
ret i32 %78
}