#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*/ t9;
typedef int /*<<< orphan*/ t8;
typedef int /*<<< orphan*/ t7;
typedef int /*<<< orphan*/ t6;
typedef int /*<<< orphan*/ t5;
typedef int /*<<< orphan*/ t4;
typedef int /*<<< orphan*/ t3;
typedef int /*<<< orphan*/ t2;
typedef int /*<<< orphan*/ t17;
typedef int /*<<< orphan*/ t16;
typedef int /*<<< orphan*/ t15;
typedef int /*<<< orphan*/ t14;
typedef int /*<<< orphan*/ t13;
typedef int /*<<< orphan*/ t12;
typedef int /*<<< orphan*/ t11;
typedef int /*<<< orphan*/ t10;
typedef int /*<<< orphan*/ t1;

/* Variables and functions */
int asn1Validate(unsigned char *, int);
int /*<<< orphan*/ assert(int);
void testASN1() {
  unsigned char t1[] = {0x04, 0x00};
  unsigned char t2[] = {0x1F, 0x80};
  unsigned char t3[] = {0x1F, 0x80, 0x80, 0x80};
  unsigned char t4[] = {0x1F, 0x80, 0x80, 0x00};
  unsigned char t5[] = {0x1F, 0x80, 0x80, 0x00, 0x80};
  unsigned char t6[] = {0x1F, 0x80, 0x80, 0x00, 0x84};
  unsigned char t7[] = {0x1F, 0x80, 0x80, 0x00, 0x81};
  unsigned char t8[] = {0x04, 0x01, 0x00};
  unsigned char t9[] = {0x04, 0x81, 0x01, 0x00};
  unsigned char t10[] = {0x04, 0x82, 0x01};
  unsigned char t11[] = {0x04, 0x81, 0x01};
  unsigned char t12[] = {0x04, 0x02, 0x01};
  unsigned char t13[] = {0x24, 0x03, 0x01, 0x01, 0x01};
  unsigned char t14[] = {0x24, 0x00};
  unsigned char t15[] = {0x24, 0x01, 0x01};
  unsigned char t16[] = {0x24, 0x02, 0x01, 0x01};
  unsigned char t17[] = {0x24, 0x06, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01};
  assert(asn1Validate(t1, 0) == 1);
  assert(asn1Validate(t1, 1) == 1);
  assert(asn1Validate(t1, sizeof(t1)) == 0);
  assert(asn1Validate(t2, sizeof(t2)) == 2);
  assert(asn1Validate(t3, sizeof(t3)) == 4);
  assert(asn1Validate(t4, sizeof(t4)) == 4);
  assert(asn1Validate(t5, sizeof(t5)) == 0);
  assert(asn1Validate(t6, sizeof(t6)) == 4);
  assert(asn1Validate(t7, sizeof(t7)) == 5);
  assert(asn1Validate(t8, sizeof(t8)) == 0);
  assert(asn1Validate(t9, sizeof(t9)) == 0);
  assert(asn1Validate(t10, sizeof(t10)) == 3);
  assert(asn1Validate(t11, sizeof(t11)) == 3);
  assert(asn1Validate(t12, sizeof(t12)) == 3);
  assert(asn1Validate(t13, sizeof(t13)) == 0);
  assert(asn1Validate(t14, sizeof(t14)) == 0);
  assert(asn1Validate(t15, sizeof(t15)) == 3);
  assert(asn1Validate(t16, sizeof(t16)) == 4);
  assert(asn1Validate(t17, sizeof(t17)) == 0);
}


x86 assembly (clang, -O0):
<testASN1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xed1(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xed5(%rip),%ax
mov    %ax,-0x4(%rbp)
mov    0xeed(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xeb6(%rip),%al
mov    %al,-0xd(%rbp)
mov    0xeae(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xea9(%rip),%al
mov    %al,-0x12(%rbp)
mov    0xea1(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xe9c(%rip),%al
mov    %al,-0x17(%rbp)
mov    0xe79(%rip),%ax
mov    %ax,-0x1e(%rbp)
mov    0xe71(%rip),%al
mov    %al,-0x1c(%rbp)
mov    0xe69(%rip),%eax
mov    %eax,-0x22(%rbp)
mov    0xe76(%rip),%ax
mov    %ax,-0x25(%rbp)
mov    0xe6e(%rip),%al
mov    %al,-0x23(%rbp)
mov    0xe65(%rip),%ax
mov    %ax,-0x28(%rbp)
mov    0xe5d(%rip),%al
mov    %al,-0x26(%rbp)
mov    0xe54(%rip),%ax
mov    %ax,-0x2b(%rbp)
mov    0xe4c(%rip),%al
mov    %al,-0x29(%rbp)
mov    0xe44(%rip),%eax
mov    %eax,-0x30(%rbp)
mov    0xe3f(%rip),%al
mov    %al,-0x2c(%rbp)
mov    0xe15(%rip),%ax
mov    %ax,-0x32(%rbp)
mov    0xe2b(%rip),%ax
mov    %ax,-0x35(%rbp)
mov    0xe23(%rip),%al
mov    %al,-0x33(%rbp)
mov    0xe1f(%rip),%eax
mov    %eax,-0x39(%rbp)
mov    0xe19(%rip),%rax
mov    %rax,-0x41(%rbp)
lea    -0x2(%rbp),%rdi
xor    %esi,%esi
call   1030 <asn1Validate@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
call   1030 <asn1Validate@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x4(%rbp),%rdi
mov    $0x2,%esi
call   1030 <asn1Validate@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0xc(%rbp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x11(%rbp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x16(%rbp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x1b(%rbp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x1e(%rbp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x22(%rbp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x25(%rbp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x28(%rbp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x2b(%rbp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x32(%rbp),%rdi
mov    $0x2,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x35(%rbp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x39(%rbp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x41(%rbp),%rdi
mov    $0x8,%esi
call   1030 <asn1Validate@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testASN1>:
push   %rbx
sub    $0x60,%rsp
movw   $0x4,0x26(%rsp)
movw   $0x801f,0x24(%rsp)
movl   $0x8080801f,0x54(%rsp)
80
movl   $0x80801f,0x50(%rsp)
movb   $0x80,0x44(%rsp)
movl   $0x80801f,0x40(%rsp)
movb   $0x84,0x3c(%rsp)
movl   $0x80801f,0x38(%rsp)
movb   $0x81,0x34(%rsp)
movl   $0x80801f,0x30(%rsp)
movb   $0x0,0x22(%rsp)
movw   $0x104,0x20(%rsp)
movl   $0x18104,0x4c(%rsp)
movb   $0x1,0x1e(%rsp)
movw   $0x8204,0x1c(%rsp)
movb   $0x1,0x1a(%rsp)
movw   $0x8104,0x18(%rsp)
movb   $0x1,0x16(%rsp)
movw   $0x204,0x14(%rsp)
movb   $0x1,0x2c(%rsp)
movl   $0x1010324,0x28(%rsp)
01
movw   $0x24,0x12(%rsp)
movb   $0x1,0x10(%rsp)
movw   $0x124,0xe(%rsp)
movl   $0x1010224,0x48(%rsp)
01
movabs $0x101020101010624,%rax
02 01 01
mov    %rax,0x58(%rsp)
lea    0x26(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x24(%rsp),%rdi
mov    $0x2,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x54(%rsp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x50(%rsp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x40(%rsp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x38(%rsp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x30(%rsp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x20(%rsp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x4c(%rsp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x1c(%rsp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x18(%rsp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x14(%rsp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x28(%rsp),%rdi
mov    $0x5,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x12(%rsp),%rdi
mov    $0x2,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe(%rsp),%rdi
mov    $0x3,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x48(%rsp),%rdi
mov    $0x4,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1040 <assert@plt>
lea    0x58(%rsp),%rdi
mov    $0x8,%esi
call   1030 <asn1Validate@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.testASN1.t1 = [2 x i8] c"\04\00"
@__const.testASN1.t2 = [2 x i8] c"\1F\80"
@__const.testASN1.t3 = [4 x i8] c"\1F\80\80\80"
@__const.testASN1.t4 = [4 x i8] c"\1F\80\80\00"
@__const.testASN1.t5 = [5 x i8] c"\1F\80\80\00\80"
@__const.testASN1.t6 = [5 x i8] c"\1F\80\80\00\84"
@__const.testASN1.t7 = [5 x i8] c"\1F\80\80\00\81"
@__const.testASN1.t8 = [3 x i8] c"\04\01\00"
@__const.testASN1.t9 = [4 x i8] c"\04\81\01\00"
@__const.testASN1.t10 = [3 x i8] c"\04\82\01"
@__const.testASN1.t11 = [3 x i8] c"\04\81\01"
@__const.testASN1.t12 = [3 x i8] c"\04\02\01"
@__const.testASN1.t13 = [5 x i8] c"$\03\01\01\01"
@__const.testASN1.t14 = [2 x i8] c"$\00"
@__const.testASN1.t15 = [3 x i8] c"$\01\01"
@__const.testASN1.t16 = [4 x i8] c"$\02\01\01"
@__const.testASN1.t17 = [8 x i8] c"$\06\01\01\01\02\01\01"
define void @testASN1() {
%1 = alloca [2 x i8]
%2 = alloca [2 x i8]
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = alloca [5 x i8]
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
%8 = alloca [3 x i8]
%9 = alloca [4 x i8]
%10 = alloca [3 x i8]
%11 = alloca [3 x i8]
%12 = alloca [3 x i8]
%13 = alloca [5 x i8]
%14 = alloca [2 x i8]
%15 = alloca [3 x i8]
%16 = alloca [4 x i8]
%17 = alloca [8 x i8]
%18 = bitcast [2 x i8]* %1 to i8*
%19 = bitcast [2 x i8]* %2 to i8*
%20 = bitcast [4 x i8]* %3 to i8*
%21 = bitcast [4 x i8]* %4 to i8*
%22 = bitcast [5 x i8]* %5 to i8*
%23 = bitcast [5 x i8]* %6 to i8*
%24 = bitcast [5 x i8]* %7 to i8*
%25 = bitcast [3 x i8]* %8 to i8*
%26 = bitcast [4 x i8]* %9 to i8*
%27 = bitcast [3 x i8]* %10 to i8*
%28 = bitcast [3 x i8]* %11 to i8*
%29 = bitcast [3 x i8]* %12 to i8*
%30 = bitcast [5 x i8]* %13 to i8*
%31 = bitcast [2 x i8]* %14 to i8*
%32 = bitcast [3 x i8]* %15 to i8*
%33 = bitcast [4 x i8]* %16 to i8*
%34 = bitcast [8 x i8]* %17 to i8*
%35 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%36 = call i32 @asn1Validate(i8* %35, i32 0)
%37 = icmp eq i32 %36, 1
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%41 = call i32 @asn1Validate(i8* %40, i32 1)
%42 = icmp eq i32 %41, 1
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%46 = call i32 @asn1Validate(i8* %45, i32 2)
%47 = icmp eq i32 %46, 0
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%51 = call i32 @asn1Validate(i8* %50, i32 2)
%52 = icmp eq i32 %51, 2
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%56 = call i32 @asn1Validate(i8* %55, i32 4)
%57 = icmp eq i32 %56, 4
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%61 = call i32 @asn1Validate(i8* %60, i32 4)
%62 = icmp eq i32 %61, 4
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%66 = call i32 @asn1Validate(i8* %65, i32 5)
%67 = icmp eq i32 %66, 0
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%71 = call i32 @asn1Validate(i8* %70, i32 5)
%72 = icmp eq i32 %71, 4
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%76 = call i32 @asn1Validate(i8* %75, i32 5)
%77 = icmp eq i32 %76, 5
%78 = zext i1 %77 to i32
%79 = call i32 @assert(i32 %78)
%80 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%81 = call i32 @asn1Validate(i8* %80, i32 3)
%82 = icmp eq i32 %81, 0
%83 = zext i1 %82 to i32
%84 = call i32 @assert(i32 %83)
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%86 = call i32 @asn1Validate(i8* %85, i32 4)
%87 = icmp eq i32 %86, 0
%88 = zext i1 %87 to i32
%89 = call i32 @assert(i32 %88)
%90 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%91 = call i32 @asn1Validate(i8* %90, i32 3)
%92 = icmp eq i32 %91, 3
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
%95 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%96 = call i32 @asn1Validate(i8* %95, i32 3)
%97 = icmp eq i32 %96, 3
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%101 = call i32 @asn1Validate(i8* %100, i32 3)
%102 = icmp eq i32 %101, 3
%103 = zext i1 %102 to i32
%104 = call i32 @assert(i32 %103)
%105 = getelementptr inbounds [5 x i8], [5 x i8]* %13, i64 0, i64 0
%106 = call i32 @asn1Validate(i8* %105, i32 5)
%107 = icmp eq i32 %106, 0
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = getelementptr inbounds [2 x i8], [2 x i8]* %14, i64 0, i64 0
%111 = call i32 @asn1Validate(i8* %110, i32 2)
%112 = icmp eq i32 %111, 0
%113 = zext i1 %112 to i32
%114 = call i32 @assert(i32 %113)
%115 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%116 = call i32 @asn1Validate(i8* %115, i32 3)
%117 = icmp eq i32 %116, 3
%118 = zext i1 %117 to i32
%119 = call i32 @assert(i32 %118)
%120 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%121 = call i32 @asn1Validate(i8* %120, i32 4)
%122 = icmp eq i32 %121, 4
%123 = zext i1 %122 to i32
%124 = call i32 @assert(i32 %123)
%125 = getelementptr inbounds [8 x i8], [8 x i8]* %17, i64 0, i64 0
%126 = call i32 @asn1Validate(i8* %125, i32 8)
%127 = icmp eq i32 %126, 0
%128 = zext i1 %127 to i32
%129 = call i32 @assert(i32 %128)
ret void
}

LLVM IR (-O2):
@__const.testASN1.t5 = [5 x i8] c"\1F\80\80\00\80"
@__const.testASN1.t6 = [5 x i8] c"\1F\80\80\00\84"
@__const.testASN1.t7 = [5 x i8] c"\1F\80\80\00\81"
@__const.testASN1.t8 = [3 x i8] c"\04\01\00"
@__const.testASN1.t10 = [3 x i8] c"\04\82\01"
@__const.testASN1.t11 = [3 x i8] c"\04\81\01"
@__const.testASN1.t12 = [3 x i8] c"\04\02\01"
@__const.testASN1.t13 = [5 x i8] c"$\03\01\01\01"
@__const.testASN1.t15 = [3 x i8] c"$\01\01"
define void @testASN1() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca [5 x i8]
%7 = alloca [5 x i8]
%8 = alloca [3 x i8]
%9 = alloca i32
%10 = alloca [3 x i8]
%11 = alloca [3 x i8]
%12 = alloca [3 x i8]
%13 = alloca [5 x i8]
%14 = alloca i16
%15 = alloca [3 x i8]
%16 = alloca i32
%17 = alloca i64
%18 = bitcast i16* %1 to i8*
store i16 4, i16* %1
%19 = bitcast i16* %2 to i8*
store i16 -32737, i16* %2
%20 = bitcast i32* %3 to i8*
store i32 -2139062241, i32* %3
%21 = bitcast i32* %4 to i8*
store i32 8421407, i32* %4
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%23 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [5 x i8], [5 x i8]* %7, i64 0, i64 0
%25 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%26 = bitcast i32* %9 to i8*
store i32 98564, i32* %9
%27 = getelementptr inbounds [3 x i8], [3 x i8]* %10, i64 0, i64 0
%28 = getelementptr inbounds [3 x i8], [3 x i8]* %11, i64 0, i64 0
%29 = getelementptr inbounds [3 x i8], [3 x i8]* %12, i64 0, i64 0
%30 = getelementptr inbounds [5 x i8], [5 x i8]* %13, i64 0, i64 0
%31 = bitcast i16* %14 to i8*
store i16 36, i16* %14
%32 = getelementptr inbounds [3 x i8], [3 x i8]* %15, i64 0, i64 0
%33 = bitcast i32* %16 to i8*
store i32 16843300, i32* %16
%34 = bitcast i64* %17 to i8*
store i64 72341272349705764, i64* %17
%35 = call i32 @asn1Validate(i8* %18, i32 0)
%36 = icmp eq i32 %35, 1
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = call i32 @asn1Validate(i8* %18, i32 1)
%40 = icmp eq i32 %39, 1
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = call i32 @asn1Validate(i8* %18, i32 2)
%44 = icmp eq i32 %43, 0
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = call i32 @asn1Validate(i8* %19, i32 2)
%48 = icmp eq i32 %47, 2
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @asn1Validate(i8* %20, i32 4)
%52 = icmp eq i32 %51, 4
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 @asn1Validate(i8* %21, i32 4)
%56 = icmp eq i32 %55, 4
%57 = zext i1 %56 to i32
%58 = call i32 @assert(i32 %57)
%59 = call i32 @asn1Validate(i8* %22, i32 5)
%60 = icmp eq i32 %59, 0
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = call i32 @asn1Validate(i8* %23, i32 5)
%64 = icmp eq i32 %63, 4
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = call i32 @asn1Validate(i8* %24, i32 5)
%68 = icmp eq i32 %67, 5
%69 = zext i1 %68 to i32
%70 = call i32 @assert(i32 %69)
%71 = call i32 @asn1Validate(i8* %25, i32 3)
%72 = icmp eq i32 %71, 0
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = call i32 @asn1Validate(i8* %26, i32 4)
%76 = icmp eq i32 %75, 0
%77 = zext i1 %76 to i32
%78 = call i32 @assert(i32 %77)
%79 = call i32 @asn1Validate(i8* %27, i32 3)
%80 = icmp eq i32 %79, 3
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = call i32 @asn1Validate(i8* %28, i32 3)
%84 = icmp eq i32 %83, 3
%85 = zext i1 %84 to i32
%86 = call i32 @assert(i32 %85)
%87 = call i32 @asn1Validate(i8* %29, i32 3)
%88 = icmp eq i32 %87, 3
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = call i32 @asn1Validate(i8* %30, i32 5)
%92 = icmp eq i32 %91, 0
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
%95 = call i32 @asn1Validate(i8* %31, i32 2)
%96 = icmp eq i32 %95, 0
%97 = zext i1 %96 to i32
%98 = call i32 @assert(i32 %97)
%99 = call i32 @asn1Validate(i8* %32, i32 3)
%100 = icmp eq i32 %99, 3
%101 = zext i1 %100 to i32
%102 = call i32 @assert(i32 %101)
%103 = call i32 @asn1Validate(i8* %33, i32 4)
%104 = icmp eq i32 %103, 4
%105 = zext i1 %104 to i32
%106 = call i32 @assert(i32 %105)
%107 = call i32 @asn1Validate(i8* %34, i32 8)
%108 = icmp eq i32 %107, 0
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
ret void
}