#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*/ der;

/* Variables and functions */
scalar_t__ INT_MAX;
scalar_t__ LONG_MAX;
scalar_t__ UINT_MAX;
long asn1_get_length_der(unsigned char *, int, int *);
int /*<<< orphan*/ asn1_length_der(unsigned long, unsigned char *, int *);
int /*<<< orphan*/ printf(char *, long, int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  int verbose = 0;
  if (argc > 1)
    verbose = 1;
  {
    unsigned char der[] = "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF";
    long l;
    int len;
    l = asn1_get_length_der(der, sizeof der, &len);
    if (l == -2L) {
      if (verbose)
        puts("OK: asn1_get_length_der bignum");
    } else {
      printf("ERROR: asn1_get_length_der bignum (l %ld len %d)\n", l, len);
      return 1;
    }
  }
  if (LONG_MAX > INT_MAX) {
    unsigned long num = ((long)UINT_MAX) << 2;
    unsigned char der[20];
    int der_len;
    long l;
    int len;
    asn1_length_der(num, der, &der_len);
    l = asn1_get_length_der(der, der_len, &len);
    if (l == -2L) {
      if (verbose)
        puts("OK: asn1_get_length_der intnum");
    } else {
      printf("ERROR: asn1_get_length_der intnum (l %ld len %d)\n", l, len);
      return 1;
    }
  }
  {
    unsigned long num = 64;
    unsigned char der[20];
    int der_len;
    long l;
    int len;
    asn1_length_der(num, der, &der_len);
    der_len = sizeof(der);
    l = asn1_get_length_der(der, der_len, &len);
    if (l == -4L) {
      if (verbose)
        puts("OK: asn1_get_length_der overflow-small");
    } else {
      printf("ERROR: asn1_get_length_der overflow-small (l %ld len %d)\n", l,
             len);
      return 1;
    }
  }
  {
    unsigned long num = 1073741824;
    unsigned char der[20];
    int der_len;
    long l;
    int len;
    asn1_length_der(num, der, &der_len);
    der_len = sizeof(der);
    l = asn1_get_length_der(der, der_len, &len);
    if (l == -4L) {
      if (verbose)
        puts("OK: asn1_get_length_der overflow-large1");
    } else {
      printf("ERROR: asn1_get_length_der overflow-large1 (l %ld len %d)\n", l,
             len);
      return 1;
    }
  }
  {
    unsigned long num = 2147483649;
    unsigned char der[20];
    int der_len;
    long l;
    int len;
    asn1_length_der(num, der, &der_len);
    der_len = sizeof(der);
    l = asn1_get_length_der(der, der_len, &len);
    if (l == -2L) {
      if (verbose)
        puts("OK: asn1_get_length_der overflow-large2");
    } else {
      printf("ERROR: asn1_get_length_der overflow-large2 (l %ld len %d)\n", l,
             len);
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1171 <main+0x31>
movl   $0x1,-0x14(%rbp)
mov    0xe88(%rip),%rax
mov    %rax,-0x1f(%rbp)
mov    0xe85(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xe7d(%rip),%al
mov    %al,-0x15(%rbp)
lea    -0x1f(%rbp),%rdi
mov    $0xb,%esi
lea    -0x2c(%rbp),%rdx
call   1050 <asn1_get_length_der@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0xfffffffffffffffe,-0x28(%rbp)
jne    11cc <main+0x8c>
cmpl   $0x0,-0x14(%rbp)
je     11c7 <main+0x87>
lea    0xe49(%rip),%rdi
call   1030 <puts@plt>
jmp    11eb <main+0xab>
mov    -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    0xe50(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145f <main+0x31f>
mov    0x2dde(%rip),%rax
mov    (%rax),%rax
mov    0x2dec(%rip),%rcx
cmp    (%rcx),%rax
jle    1286 <main+0x146>
mov    0x2dd4(%rip),%rax
mov    (%rax),%rax
shl    $0x2,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x54(%rbp),%rdx
call   1060 <asn1_length_der@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
lea    -0x64(%rbp),%rdx
call   1050 <asn1_get_length_der@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0xfffffffffffffffe,-0x60(%rbp)
jne    1262 <main+0x122>
cmpl   $0x0,-0x14(%rbp)
je     125d <main+0x11d>
lea    0xe04(%rip),%rdi
call   1030 <puts@plt>
jmp    1281 <main+0x141>
mov    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145f <main+0x31f>
jmp    1286 <main+0x146>
movq   $0x40,-0x70(%rbp)
mov    -0x70(%rbp),%rdi
lea    -0x90(%rbp),%rsi
lea    -0x94(%rbp),%rdx
call   1060 <asn1_length_der@plt>
movl   $0x14,-0x94(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x94(%rbp),%esi
lea    -0xa4(%rbp),%rdx
call   1050 <asn1_get_length_der@plt>
mov    %rax,-0xa0(%rbp)
cmpq   $0xfffffffffffffffc,-0xa0(%rbp)
fc
jne    12f8 <main+0x1b8>
cmpl   $0x0,-0x14(%rbp)
je     12f3 <main+0x1b3>
lea    0xdbf(%rip),%rdi
call   1030 <puts@plt>
jmp    131d <main+0x1dd>
mov    -0xa0(%rbp),%rsi
mov    -0xa4(%rbp),%edx
lea    0xdc8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145f <main+0x31f>
movq   $0x40000000,-0xb0(%rbp)
mov    -0xb0(%rbp),%rdi
lea    -0xd0(%rbp),%rsi
lea    -0xd4(%rbp),%rdx
call   1060 <asn1_length_der@plt>
movl   $0x14,-0xd4(%rbp)
lea    -0xd0(%rbp),%rdi
mov    -0xd4(%rbp),%esi
lea    -0xe4(%rbp),%rdx
call   1050 <asn1_get_length_der@plt>
mov    %rax,-0xe0(%rbp)
cmpq   $0xfffffffffffffffc,-0xe0(%rbp)
fc
jne    1395 <main+0x255>
cmpl   $0x0,-0x14(%rbp)
je     1390 <main+0x250>
lea    0xd83(%rip),%rdi
call   1030 <puts@plt>
jmp    13ba <main+0x27a>
mov    -0xe0(%rbp),%rsi
mov    -0xe4(%rbp),%edx
lea    0xd8d(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145f <main+0x31f>
mov    $0x80000001,%eax
mov    %rax,-0xf0(%rbp)
mov    -0xf0(%rbp),%rdi
lea    -0x110(%rbp),%rsi
lea    -0x114(%rbp),%rdx
call   1060 <asn1_length_der@plt>
movl   $0x14,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
lea    -0x124(%rbp),%rdx
call   1050 <asn1_get_length_der@plt>
mov    %rax,-0x120(%rbp)
cmpq   $0xfffffffffffffffe,-0x120(%rbp)
fe
jne    1433 <main+0x2f3>
cmpl   $0x0,-0x14(%rbp)
je     142e <main+0x2ee>
lea    0xd48(%rip),%rdi
call   1030 <puts@plt>
jmp    1458 <main+0x318>
mov    -0x120(%rbp),%rsi
mov    -0x124(%rbp),%edx
lea    0xd52(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    145f <main+0x31f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %edi,%ebx
movl   $0xffffff,0x17(%rsp)
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0xb,%esi
call   1050 <asn1_get_length_der@plt>
cmp    $0xfffffffffffffffe,%rax
jne    12ce <main+0x18e>
cmp    $0x2,%ebx
jl     1188 <main+0x48>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%rax
mov    0x2e4f(%rip),%rcx
cmp    (%rcx),%rax
jle    11ea <main+0xaa>
mov    0x2e3b(%rip),%rax
mov    (%rax),%rdi
shl    $0x2,%rdi
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%rdx
mov    %rbp,%rsi
call   1060 <asn1_length_der@plt>
mov    0x8(%rsp),%esi
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
call   1050 <asn1_get_length_der@plt>
cmp    $0xfffffffffffffffe,%rax
jne    12e8 <main+0x1a8>
cmp    $0x2,%ebx
jl     11ea <main+0xaa>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%rdx
mov    $0x40,%edi
mov    %rbp,%rsi
call   1060 <asn1_length_der@plt>
movl   $0x14,0x8(%rsp)
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
mov    $0x14,%esi
call   1050 <asn1_get_length_der@plt>
cmp    $0xfffffffffffffffc,%rax
jne    12db <main+0x19b>
cmp    $0x2,%ebx
jl     1236 <main+0xf6>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%rdx
mov    $0x40000000,%edi
mov    %rbp,%rsi
call   1060 <asn1_length_der@plt>
movl   $0x14,0x8(%rsp)
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
mov    $0x14,%esi
call   1050 <asn1_get_length_der@plt>
cmp    $0xfffffffffffffffc,%rax
jne    12f5 <main+0x1b5>
cmp    $0x2,%ebx
jl     1282 <main+0x142>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%rdx
mov    $0x80000001,%edi
mov    %rbp,%rsi
call   1060 <asn1_length_der@plt>
movl   $0x14,0x8(%rsp)
lea    0xc(%rsp),%rdx
mov    %rbp,%rdi
mov    $0x14,%esi
call   1050 <asn1_get_length_der@plt>
cmp    $0xfffffffffffffffe,%rax
jne    1302 <main+0x1c2>
xor    %ebp,%ebp
cmp    $0x2,%ebx
jl     131a <main+0x1da>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
jmp    131a <main+0x1da>
mov    0x8(%rsp),%edx
lea    0xd51(%rip),%rdi
jmp    130d <main+0x1cd>
mov    0xc(%rsp),%edx
lea    0xdee(%rip),%rdi
jmp    130d <main+0x1cd>
mov    0xc(%rsp),%edx
lea    0xd88(%rip),%rdi
jmp    130d <main+0x1cd>
mov    0xc(%rsp),%edx
lea    0xe36(%rip),%rdi
jmp    130d <main+0x1cd>
mov    0xc(%rsp),%edx
lea    0xe8c(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.der = [11 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\00"
@.str = [31 x i8] c"OK: asn1_get_length_der bignum\00"
@.str.1 = [50 x i8] c"ERROR: asn1_get_length_der bignum (l %ld len %d)\0A\00"
@LONG_MAX = global i64 0
@INT_MAX = global i64 0
@UINT_MAX = global i64 0
@.str.2 = [31 x i8] c"OK: asn1_get_length_der intnum\00"
@.str.3 = [50 x i8] c"ERROR: asn1_get_length_der intnum (l %ld len %d)\0A\00"
@.str.4 = [39 x i8] c"OK: asn1_get_length_der overflow-small\00"
@.str.5 = [58 x i8] c"ERROR: asn1_get_length_der overflow-small (l %ld len %d)\0A\00"
@.str.6 = [40 x i8] c"OK: asn1_get_length_der overflow-large1\00"
@.str.7 = [59 x i8] c"ERROR: asn1_get_length_der overflow-large1 (l %ld len %d)\0A\00"
@.str.8 = [40 x i8] c"OK: asn1_get_length_der overflow-large2\00"
@.str.9 = [59 x i8] c"ERROR: asn1_get_length_der overflow-large2 (l %ld len %d)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [11 x i8]
%8 = alloca i64
%9 = alloca i32
%10 = alloca i64
%11 = alloca [20 x i8]
%12 = alloca i32
%13 = alloca i64
%14 = alloca i32
%15 = alloca i64
%16 = alloca [20 x i8]
%17 = alloca i32
%18 = alloca i64
%19 = alloca i32
%20 = alloca i64
%21 = alloca [20 x i8]
%22 = alloca i32
%23 = alloca i64
%24 = alloca i32
%25 = alloca i64
%26 = alloca [20 x i8]
%27 = alloca i32
%28 = alloca i64
%29 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%30 = load i32, i32* %4
%31 = icmp sgt i32 %30, 1
br i1 %31, label %32, label %33
32: ; preds = %2
store i32 1, i32* %6
br label %33
33: ; preds = %32, %2
%34 = bitcast [11 x i8]* %7 to i8*
%35 = getelementptr inbounds [11 x i8], [11 x i8]* %7, i64 0, i64 0
%36 = call i64 @asn1_get_length_der(i8* %35, i32 11, i32* %9)
store i64 %36, i64* %8
%37 = load i64, i64* %8
%38 = icmp eq i64 %37, -2
br i1 %38, label %39, label %45
39: ; preds = %33
%40 = load i32, i32* %6
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %44
44: ; preds = %42, %39
br label %49
45: ; preds = %33
%46 = load i64, i64* %8
%47 = load i32, i32* %9
%48 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i64 %46, i32 %47)
store i32 1, i32* %3
br label %133
49: ; preds = %44
%50 = load i64, i64* @LONG_MAX
%51 = load i64, i64* @INT_MAX
%52 = icmp sgt i64 %50, %51
br i1 %52, label %53, label %75
53: ; preds = %49
%54 = load i64, i64* @UINT_MAX
%55 = shl i64 %54, 2
store i64 %55, i64* %10
%56 = load i64, i64* %10
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 0
%58 = call i32 @asn1_length_der(i64 %56, i8* %57, i32* %12)
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 0
%60 = load i32, i32* %12
%61 = call i64 @asn1_get_length_der(i8* %59, i32 %60, i32* %14)
store i64 %61, i64* %13
%62 = load i64, i64* %13
%63 = icmp eq i64 %62, -2
br i1 %63, label %64, label %70
64: ; preds = %53
%65 = load i32, i32* %6
%66 = icmp ne i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %69
69: ; preds = %67, %64
br label %74
70: ; preds = %53
%71 = load i64, i64* %13
%72 = load i32, i32* %14
%73 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i64 %71, i32 %72)
store i32 1, i32* %3
br label %133
74: ; preds = %69
br label %75
75: ; preds = %74, %49
store i64 64, i64* %15
%76 = load i64, i64* %15
%77 = getelementptr inbounds [20 x i8], [20 x i8]* %16, i64 0, i64 0
%78 = call i32 @asn1_length_der(i64 %76, i8* %77, i32* %17)
store i32 20, i32* %17
%79 = getelementptr inbounds [20 x i8], [20 x i8]* %16, i64 0, i64 0
%80 = load i32, i32* %17
%81 = call i64 @asn1_get_length_der(i8* %79, i32 %80, i32* %19)
store i64 %81, i64* %18
%82 = load i64, i64* %18
%83 = icmp eq i64 %82, -4
br i1 %83, label %84, label %90
84: ; preds = %75
%85 = load i32, i32* %6
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %89
87: ; preds = %84
%88 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %89
89: ; preds = %87, %84
br label %94
90: ; preds = %75
%91 = load i64, i64* %18
%92 = load i32, i32* %19
%93 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i64 %91, i32 %92)
store i32 1, i32* %3
br label %133
94: ; preds = %89
store i64 1073741824, i64* %20
%95 = load i64, i64* %20
%96 = getelementptr inbounds [20 x i8], [20 x i8]* %21, i64 0, i64 0
%97 = call i32 @asn1_length_der(i64 %95, i8* %96, i32* %22)
store i32 20, i32* %22
%98 = getelementptr inbounds [20 x i8], [20 x i8]* %21, i64 0, i64 0
%99 = load i32, i32* %22
%100 = call i64 @asn1_get_length_der(i8* %98, i32 %99, i32* %24)
store i64 %100, i64* %23
%101 = load i64, i64* %23
%102 = icmp eq i64 %101, -4
br i1 %102, label %103, label %109
103: ; preds = %94
%104 = load i32, i32* %6
%105 = icmp ne i32 %104, 0
br i1 %105, label %106, label %108
106: ; preds = %103
%107 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %108
108: ; preds = %106, %103
br label %113
109: ; preds = %94
%110 = load i64, i64* %23
%111 = load i32, i32* %24
%112 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0), i64 %110, i32 %111)
store i32 1, i32* %3
br label %133
113: ; preds = %108
store i64 2147483649, i64* %25
%114 = load i64, i64* %25
%115 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%116 = call i32 @asn1_length_der(i64 %114, i8* %115, i32* %27)
store i32 20, i32* %27
%117 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%118 = load i32, i32* %27
%119 = call i64 @asn1_get_length_der(i8* %117, i32 %118, i32* %29)
store i64 %119, i64* %28
%120 = load i64, i64* %28
%121 = icmp eq i64 %120, -2
br i1 %121, label %122, label %128
122: ; preds = %113
%123 = load i32, i32* %6
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %122
%126 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
br label %127
127: ; preds = %125, %122
br label %132
128: ; preds = %113
%129 = load i64, i64* %28
%130 = load i32, i32* %29
%131 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i64 %129, i32 %130)
store i32 1, i32* %3
br label %133
132: ; preds = %127
store i32 0, i32* %3
br label %133
133: ; preds = %132, %128, %109, %90, %70, %45
%134 = load i32, i32* %3
ret i32 %134
}

LLVM IR (-O2):
@__const.main.der = [11 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\00"
@.str = [31 x i8] c"OK: asn1_get_length_der bignum\00"
@.str.1 = [50 x i8] c"ERROR: asn1_get_length_der bignum (l %ld len %d)\0A\00"
@LONG_MAX = global i64 0
@INT_MAX = global i64 0
@UINT_MAX = global i64 0
@.str.2 = [31 x i8] c"OK: asn1_get_length_der intnum\00"
@.str.3 = [50 x i8] c"ERROR: asn1_get_length_der intnum (l %ld len %d)\0A\00"
@.str.4 = [39 x i8] c"OK: asn1_get_length_der overflow-small\00"
@.str.5 = [58 x i8] c"ERROR: asn1_get_length_der overflow-small (l %ld len %d)\0A\00"
@.str.6 = [40 x i8] c"OK: asn1_get_length_der overflow-large1\00"
@.str.7 = [59 x i8] c"ERROR: asn1_get_length_der overflow-large1 (l %ld len %d)\0A\00"
@.str.8 = [40 x i8] c"OK: asn1_get_length_der overflow-large2\00"
@.str.9 = [59 x i8] c"ERROR: asn1_get_length_der overflow-large2 (l %ld len %d)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [11 x i8]
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca [20 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca [20 x i8]
%15 = alloca i32
%16 = alloca i32
%17 = icmp sgt i32 %0, 1
%18 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%19 = bitcast i32* %4 to i8*
%20 = call i64 @asn1_get_length_der(i8* %18, i32 11, i32* %4)
%21 = icmp eq i64 %20, -2
br i1 %21, label %22, label %25
22: ; preds = %2
br i1 %17, label %23, label %28
23: ; preds = %22
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %28
25: ; preds = %2
%26 = load i32, i32* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i64 %20, i32 %26)
br label %90
28: ; preds = %23, %22
%29 = load i64, i64* @LONG_MAX
%30 = load i64, i64* @INT_MAX
%31 = icmp sgt i64 %29, %30
br i1 %31, label %32, label %49
32: ; preds = %28
%33 = load i64, i64* @UINT_MAX
%34 = shl i64 %33, 2
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%36 = bitcast i32* %6 to i8*
%37 = bitcast i32* %7 to i8*
%38 = call i32 @asn1_length_der(i64 %34, i8* %35, i32* %6)
%39 = load i32, i32* %6
%40 = call i64 @asn1_get_length_der(i8* %35, i32 %39, i32* %7)
%41 = icmp eq i64 %40, -2
br i1 %41, label %42, label %46
42: ; preds = %32
br i1 %17, label %43, label %45
43: ; preds = %42
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %45
45: ; preds = %43, %42
br label %49
46: ; preds = %32
%47 = load i32, i32* %7
%48 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i64 %40, i32 %47)
br label %90
49: ; preds = %45, %28
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%51 = bitcast i32* %9 to i8*
%52 = bitcast i32* %10 to i8*
%53 = call i32 @asn1_length_der(i64 64, i8* %50, i32* %9)
store i32 20, i32* %9
%54 = call i64 @asn1_get_length_der(i8* %50, i32 20, i32* %10)
%55 = icmp eq i64 %54, -4
br i1 %55, label %56, label %59
56: ; preds = %49
br i1 %17, label %57, label %62
57: ; preds = %56
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
br label %62
59: ; preds = %49
%60 = load i32, i32* %10
%61 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i64 %54, i32 %60)
br label %90
62: ; preds = %57, %56
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 0
%64 = bitcast i32* %12 to i8*
%65 = bitcast i32* %13 to i8*
%66 = call i32 @asn1_length_der(i64 1073741824, i8* %63, i32* %12)
store i32 20, i32* %12
%67 = call i64 @asn1_get_length_der(i8* %63, i32 20, i32* %13)
%68 = icmp eq i64 %67, -4
br i1 %68, label %69, label %72
69: ; preds = %62
br i1 %17, label %70, label %75
70: ; preds = %69
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %75
72: ; preds = %62
%73 = load i32, i32* %13
%74 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.7, i64 0, i64 0), i64 %67, i32 %73)
br label %90
75: ; preds = %70, %69
%76 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%77 = bitcast i32* %15 to i8*
%78 = bitcast i32* %16 to i8*
%79 = call i32 @asn1_length_der(i64 2147483649, i8* %76, i32* %15)
store i32 20, i32* %15
%80 = call i64 @asn1_get_length_der(i8* %76, i32 20, i32* %16)
%81 = icmp eq i64 %80, -2
br i1 %81, label %82, label %85
82: ; preds = %75
br i1 %17, label %83, label %88
83: ; preds = %82
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
br label %88
85: ; preds = %75
%86 = load i32, i32* %16
%87 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i64 %80, i32 %86)
br label %88
88: ; preds = %83, %82, %85
%89 = phi i32 [ 0, %83 ], [ 0, %82 ], [ 1, %85 ]
br label %90
90: ; preds = %72, %59, %46, %25, %88
%91 = phi i32 [ 1, %72 ], [ 1, %59 ], [ 1, %46 ], [ 1, %25 ], [ %89, %88 ]
ret i32 %91
}