; LLVM IR from specinfo-ua/UAPKI :: library/uapkif/src/asn1 (constr_SEQUENCE)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.asn_enc_rval_s = type { i64, ptr, ptr }
%struct.asn_TYPE_descriptor_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, i32, ptr }
%struct.asn_TYPE_member_s = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @SEQUENCE_encode_der(ptr dead_on_unwind noalias writable sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6) #2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca %struct.asn_enc_rval_s, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %struct.asn_enc_rval_s, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %struct.asn_enc_rval_s, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  store ptr %6, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store i64 0, ptr %14, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %104, %7
  %26 = load i32, ptr %17, align 4, !tbaa !9
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %27, i32 0, i32 18
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = icmp slt i32 %26, %29
  br i1 %30, label %31, label %107

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %32, i32 0, i32 17
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = load i32, ptr %17, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %34, i64 %36
  store ptr %37, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %38 = load ptr, ptr %18, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !16
  %41 = and i32 %40, 1
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %69

43:                                               ; preds = %31
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %18, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !18
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %44, i64 %48
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  store ptr %50, ptr %19, align 8, !tbaa !5
  %51 = load ptr, ptr %19, align 8, !tbaa !5
  %52 = icmp ne ptr %51, null
  br i1 %52, label %68, label %53

53:                                               ; preds = %43
  %54 = load ptr, ptr %18, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %54, i32 0, i32 1
  %56 = load i32, ptr %55, align 4, !tbaa !19
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %53
  store i32 4, ptr %20, align 4
  br label %101

59:                                               ; preds = %53
  br label %60

60:                                               ; preds = %59
  %61 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %61, align 8, !tbaa !20
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %62, ptr %63, align 8, !tbaa !22
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %64, ptr %65, align 8, !tbaa !23
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 600, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %101

66:                                               ; No predecessors!
  br label %67

67:                                               ; preds = %66
  br label %68

68:                                               ; preds = %67, %43
  br label %76

69:                                               ; preds = %31
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  %71 = load ptr, ptr %18, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %71, i32 0, i32 2
  %73 = load i32, ptr %72, align 8, !tbaa !18
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %70, i64 %74
  store ptr %75, ptr %19, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %69, %68
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  %77 = load ptr, ptr %18, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %77, i32 0, i32 5
  %79 = load ptr, ptr %78, align 8, !tbaa !24
  %80 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %79, i32 0, i32 6
  %81 = load ptr, ptr %80, align 8, !tbaa !25
  %82 = load ptr, ptr %18, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %82, i32 0, i32 5
  %84 = load ptr, ptr %83, align 8, !tbaa !24
  %85 = load ptr, ptr %19, align 8, !tbaa !5
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %86, i32 0, i32 4
  %88 = load i32, ptr %87, align 8, !tbaa !26
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %89, i32 0, i32 3
  %91 = load i32, ptr %90, align 4, !tbaa !27
  call void %81(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %21, ptr noundef %84, ptr noundef %85, i32 noundef %88, i32 noundef %91, ptr noundef null, ptr noundef null)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %21, i64 24, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  %92 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !20
  %94 = icmp eq i64 %93, -1
  br i1 %94, label %95, label %96

95:                                               ; preds = %76
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %15, i64 24, i1 false), !tbaa.struct !28
  store i32 1, ptr %20, align 4
  br label %101

96:                                               ; preds = %76
  %97 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 0
  %98 = load i64, ptr %97, align 8, !tbaa !20
  %99 = load i64, ptr %14, align 8, !tbaa !11
  %100 = add i64 %99, %98
  store i64 %100, ptr %14, align 8, !tbaa !11
  store i32 0, ptr %20, align 4
  br label %101

101:                                              ; preds = %96, %95, %60, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  %102 = load i32, ptr %20, align 4
  switch i32 %102, label %228 [
    i32 0, label %103
    i32 4, label %104
  ]

103:                                              ; preds = %101
  br label %104

104:                                              ; preds = %103, %101
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %17, align 4, !tbaa !9
  br label %25, !llvm.loop !29

107:                                              ; preds = %25
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = load i64, ptr %14, align 8, !tbaa !11
  %110 = load i32, ptr %10, align 4, !tbaa !9
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = call i64 @der_write_tags(ptr noundef %108, i64 noundef %109, i32 noundef %110, i32 noundef 1, i32 noundef %111, ptr noundef %112, ptr noundef %113)
  store i64 %114, ptr %16, align 8, !tbaa !11
  %115 = load i64, ptr %16, align 8, !tbaa !11
  %116 = icmp eq i64 %115, -1
  br i1 %116, label %117, label %126

117:                                              ; preds = %107
  br label %118

118:                                              ; preds = %117
  %119 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %119, align 8, !tbaa !20
  %120 = load ptr, ptr %8, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %120, ptr %121, align 8, !tbaa !22
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %122, ptr %123, align 8, !tbaa !23
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 622, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %228

124:                                              ; No predecessors!
  br label %125

125:                                              ; preds = %124
  br label %126

126:                                              ; preds = %125, %107
  %127 = load i64, ptr %14, align 8, !tbaa !11
  %128 = load i64, ptr %16, align 8, !tbaa !11
  %129 = add i64 %127, %128
  %130 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 0
  store i64 %129, ptr %130, align 8, !tbaa !20
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = icmp ne ptr %131, null
  br i1 %132, label %139, label %133

133:                                              ; preds = %126
  br label %134

134:                                              ; preds = %133
  %135 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 2
  store ptr null, ptr %135, align 8, !tbaa !23
  %136 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 1
  store ptr null, ptr %136, align 8, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %15, i64 24, i1 false), !tbaa.struct !28
  store i32 1, ptr %20, align 4
  br label %228

137:                                              ; No predecessors!
  br label %138

138:                                              ; preds = %137
  br label %139

139:                                              ; preds = %138, %126
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %207, %139
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %142, i32 0, i32 18
  %144 = load i32, ptr %143, align 8, !tbaa !13
  %145 = icmp slt i32 %141, %144
  br i1 %145, label %146, label %210

146:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %147 = load ptr, ptr %8, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %147, i32 0, i32 17
  %149 = load ptr, ptr %148, align 8, !tbaa !15
  %150 = load i32, ptr %17, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %149, i64 %151
  store ptr %152, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %153 = load ptr, ptr %22, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 8, !tbaa !16
  %156 = and i32 %155, 1
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %170

158:                                              ; preds = %146
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = load ptr, ptr %22, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %160, i32 0, i32 2
  %162 = load i32, ptr %161, align 8, !tbaa !18
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds i8, ptr %159, i64 %163
  %165 = load ptr, ptr %164, align 8, !tbaa !5
  store ptr %165, ptr %23, align 8, !tbaa !5
  %166 = load ptr, ptr %23, align 8, !tbaa !5
  %167 = icmp ne ptr %166, null
  br i1 %167, label %169, label %168

168:                                              ; preds = %158
  store i32 13, ptr %20, align 4
  br label %204

169:                                              ; preds = %158
  br label %177

170:                                              ; preds = %146
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = load ptr, ptr %22, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 8, !tbaa !18
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i8, ptr %171, i64 %175
  store ptr %176, ptr %23, align 8, !tbaa !5
  br label %177

177:                                              ; preds = %170, %169
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #4
  %178 = load ptr, ptr %22, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %178, i32 0, i32 5
  %180 = load ptr, ptr %179, align 8, !tbaa !24
  %181 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %180, i32 0, i32 6
  %182 = load ptr, ptr %181, align 8, !tbaa !25
  %183 = load ptr, ptr %22, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %183, i32 0, i32 5
  %185 = load ptr, ptr %184, align 8, !tbaa !24
  %186 = load ptr, ptr %23, align 8, !tbaa !5
  %187 = load ptr, ptr %22, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %187, i32 0, i32 4
  %189 = load i32, ptr %188, align 8, !tbaa !26
  %190 = load ptr, ptr %22, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %190, i32 0, i32 3
  %192 = load i32, ptr %191, align 4, !tbaa !27
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  call void %182(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %24, ptr noundef %185, ptr noundef %186, i32 noundef %189, i32 noundef %192, ptr noundef %193, ptr noundef %194)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %24, i64 24, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #4
  %195 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %196 = load i64, ptr %195, align 8, !tbaa !20
  %197 = icmp eq i64 %196, -1
  br i1 %197, label %198, label %199

198:                                              ; preds = %177
  store i32 1, ptr %20, align 4
  br label %204

199:                                              ; preds = %177
  %200 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %201 = load i64, ptr %200, align 8, !tbaa !20
  %202 = load i64, ptr %14, align 8, !tbaa !11
  %203 = sub i64 %202, %201
  store i64 %203, ptr %14, align 8, !tbaa !11
  store i32 0, ptr %20, align 4
  br label %204

204:                                              ; preds = %199, %198, %168
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  %205 = load i32, ptr %20, align 4
  switch i32 %205, label %228 [
    i32 0, label %206
    i32 13, label %207
  ]

206:                                              ; preds = %204
  br label %207

207:                                              ; preds = %206, %204
  %208 = load i32, ptr %17, align 4, !tbaa !9
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %17, align 4, !tbaa !9
  br label %140, !llvm.loop !31

210:                                              ; preds = %140
  %211 = load i64, ptr %14, align 8, !tbaa !11
  %212 = icmp ne i64 %211, 0
  br i1 %212, label %213, label %222

213:                                              ; preds = %210
  br label %214

214:                                              ; preds = %213
  %215 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %215, align 8, !tbaa !20
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %216, ptr %217, align 8, !tbaa !22
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %218, ptr %219, align 8, !tbaa !23
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 662, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %228

220:                                              ; No predecessors!
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221, %210
  br label %223

223:                                              ; preds = %222
  %224 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 2
  store ptr null, ptr %224, align 8, !tbaa !23
  %225 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %15, i32 0, i32 1
  store ptr null, ptr %225, align 8, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %15, i64 24, i1 false), !tbaa.struct !28
  store i32 1, ptr %20, align 4
  br label %228

226:                                              ; No predecessors!
  br label %227

227:                                              ; preds = %226
  store i32 0, ptr %20, align 4
  br label %228

228:                                              ; preds = %227, %223, %214, %204, %134, %118, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %229 = load i32, ptr %20, align 4
  switch i32 %229, label %231 [
    i32 0, label %230
    i32 1, label %230
  ]

230:                                              ; preds = %228, %228
  ret void

231:                                              ; preds = %228
  unreachable
}

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #3

declare i64 @der_write_tags(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !10, i64 144}
!14 = !{!"asn_TYPE_descriptor_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !10, i64 104, !6, i64 112, !10, i64 120, !6, i64 128, !6, i64 136, !10, i64 144, !6, i64 152}
!15 = !{!14, !6, i64 136}
!16 = !{!17, !10, i64 0}
!17 = !{!"asn_TYPE_member_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!18 = !{!17, !10, i64 8}
!19 = !{!17, !10, i64 4}
!20 = !{!21, !12, i64 0}
!21 = !{!"asn_enc_rval_s", !12, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!21, !6, i64 8}
!23 = !{!21, !6, i64 16}
!24 = !{!17, !6, i64 24}
!25 = !{!14, !6, i64 48}
!26 = !{!17, !10, i64 16}
!27 = !{!17, !10, i64 12}
!28 = !{i64 0, i64 8, !11, i64 8, i64 8, !5, i64 16, i64 8, !5}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = distinct !{!31, !30}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.asn_enc_rval_s = type { i64, ptr, ptr }
%struct.asn_TYPE_member_s = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [30 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
define dso_local void @SEQUENCE_encode_der(ptr dead_on_unwind noalias nocapture writable sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = alloca %struct.asn_enc_rval_s, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 144
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %12 = getelementptr inbounds i8, ptr %1, i64 136
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  br label %13

13:                                               ; preds = %.lr.ph, %45
  %14 = phi i32 [ %10, %.lr.ph ], [ %46, %45 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %45 ]
  %.071102 = phi i64 [ 0, %.lr.ph ], [ %.1, %45 ]
  %15 = load ptr, ptr %12, align 8, !tbaa !11
  %16 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %15, i64 %indvars.iv
  %17 = load i32, ptr %16, align 8, !tbaa !12
  %18 = and i32 %17, 1
  %.not85 = icmp eq i32 %18, 0
  %19 = getelementptr inbounds i8, ptr %16, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !14
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i8, ptr %2, i64 %21
  br i1 %.not85, label %31, label %23

23:                                               ; preds = %13
  %24 = load ptr, ptr %22, align 8, !tbaa !15
  %.not86 = icmp eq ptr %24, null
  br i1 %.not86, label %25, label %31

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %16, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %.not87 = icmp eq i32 %27, 0
  br i1 %.not87, label %28, label %45

28:                                               ; preds = %25
  store i64 -1, ptr %0, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %29, align 8, !tbaa !20
  %30 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %30, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 600, i32 noundef 101, ptr noundef null) #4
  br label %.thread

31:                                               ; preds = %13, %23
  %.074 = phi ptr [ %24, %23 ], [ %22, %13 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  %32 = getelementptr inbounds i8, ptr %16, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %33, i64 48
  %35 = load ptr, ptr %34, align 8, !tbaa !23
  %36 = getelementptr inbounds i8, ptr %16, i64 16
  %37 = load i32, ptr %36, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %16, i64 12
  %39 = load i32, ptr %38, align 4, !tbaa !25
  call void %35(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %8, ptr noundef %33, ptr noundef %.074, i32 noundef %37, i32 noundef %39, ptr noundef null, ptr noundef null) #4
  %.sroa.0.0.copyload = load i64, ptr %8, align 8, !tbaa !26
  %40 = load <2 x ptr>, ptr %.sroa.9.0..sroa_idx, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  %41 = icmp eq i64 %.sroa.0.0.copyload, -1
  br i1 %41, label %42, label %43

42:                                               ; preds = %31
  store i64 -1, ptr %0, align 8, !tbaa !26
  %.sroa.9.0..sroa_idx32 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x ptr> %40, ptr %.sroa.9.0..sroa_idx32, align 8, !tbaa !15
  br label %.thread

43:                                               ; preds = %31
  %44 = add i64 %.sroa.0.0.copyload, %.071102
  %.pre = load i32, ptr %9, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %43, %25
  %46 = phi i32 [ %.pre, %43 ], [ %14, %25 ]
  %.1 = phi i64 [ %44, %43 ], [ %.071102, %25 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next, %47
  br i1 %48, label %13, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %45, %7
  %.071.lcssa = phi i64 [ 0, %7 ], [ %.1, %45 ]
  %49 = call i64 @der_write_tags(ptr noundef nonnull %1, i64 noundef %.071.lcssa, i32 noundef %3, i32 noundef 1, i32 noundef %4, ptr noundef %5, ptr noundef %6) #4
  %50 = icmp eq i64 %49, -1
  br i1 %50, label %51, label %54

51:                                               ; preds = %._crit_edge
  store i64 -1, ptr %0, align 8, !tbaa !17
  %52 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %52, align 8, !tbaa !20
  %53 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %53, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 622, i32 noundef 101, ptr noundef null) #4
  br label %.thread

54:                                               ; preds = %._crit_edge
  %55 = add i64 %49, %.071.lcssa
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %59, label %.preheader

.preheader:                                       ; preds = %54
  %56 = load i32, ptr %9, align 8, !tbaa !5
  %57 = icmp sgt i32 %56, 0
  br i1 %57, label %.lr.ph105, label %._crit_edge106

.lr.ph105:                                        ; preds = %.preheader
  %58 = getelementptr inbounds i8, ptr %1, i64 136
  br label %60

59:                                               ; preds = %54
  store i64 %55, ptr %0, align 8, !tbaa !26
  %.sroa.9.0..sroa_idx34 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.9.0..sroa_idx34, i8 0, i64 16, i1 false)
  br label %.thread

60:                                               ; preds = %.lr.ph105, %84
  %61 = phi i32 [ %56, %.lr.ph105 ], [ %85, %84 ]
  %indvars.iv109 = phi i64 [ 0, %.lr.ph105 ], [ %indvars.iv.next110, %84 ]
  %.2104 = phi i64 [ %.071.lcssa, %.lr.ph105 ], [ %.3.ph, %84 ]
  %62 = load ptr, ptr %58, align 8, !tbaa !11
  %63 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %62, i64 %indvars.iv109
  %64 = load i32, ptr %63, align 8, !tbaa !12
  %65 = and i32 %64, 1
  %.not83 = icmp eq i32 %65, 0
  %66 = getelementptr inbounds i8, ptr %63, i64 8
  %67 = load i32, ptr %66, align 8, !tbaa !14
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i8, ptr %2, i64 %68
  br i1 %.not83, label %72, label %70

70:                                               ; preds = %60
  %71 = load ptr, ptr %69, align 8, !tbaa !15
  %.not84 = icmp eq ptr %71, null
  br i1 %.not84, label %84, label %72

72:                                               ; preds = %60, %70
  %.0 = phi ptr [ %71, %70 ], [ %69, %60 ]
  %73 = getelementptr inbounds i8, ptr %63, i64 24
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = getelementptr inbounds i8, ptr %74, i64 48
  %76 = load ptr, ptr %75, align 8, !tbaa !23
  %77 = getelementptr inbounds i8, ptr %63, i64 16
  %78 = load i32, ptr %77, align 8, !tbaa !24
  %79 = getelementptr inbounds i8, ptr %63, i64 12
  %80 = load i32, ptr %79, align 4, !tbaa !25
  call void %76(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %74, ptr noundef %.0, i32 noundef %78, i32 noundef %80, ptr noundef nonnull %5, ptr noundef %6) #4
  %81 = load i64, ptr %0, align 8, !tbaa !17
  %82 = icmp eq i64 %81, -1
  br i1 %82, label %.thread, label %._crit_edge112

._crit_edge112:                                   ; preds = %72
  %83 = sub i64 %.2104, %81
  %.pre113 = load i32, ptr %9, align 8, !tbaa !5
  br label %84

84:                                               ; preds = %._crit_edge112, %70
  %85 = phi i32 [ %.pre113, %._crit_edge112 ], [ %61, %70 ]
  %.3.ph = phi i64 [ %83, %._crit_edge112 ], [ %.2104, %70 ]
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next110, %86
  br i1 %87, label %60, label %._crit_edge106, !llvm.loop !29

._crit_edge106:                                   ; preds = %84, %.preheader
  %.2.lcssa = phi i64 [ %.071.lcssa, %.preheader ], [ %.3.ph, %84 ]
  %.not82 = icmp eq i64 %.2.lcssa, 0
  %.sroa.9.0..sroa_idx36 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %.not82, label %90, label %88

88:                                               ; preds = %._crit_edge106
  store i64 -1, ptr %0, align 8, !tbaa !17
  store ptr %1, ptr %.sroa.9.0..sroa_idx36, align 8, !tbaa !20
  %89 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %89, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 662, i32 noundef 101, ptr noundef null) #4
  br label %.thread

90:                                               ; preds = %._crit_edge106
  store i64 %55, ptr %0, align 8, !tbaa !26
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.9.0..sroa_idx36, i8 0, i64 16, i1 false)
  br label %.thread

.thread:                                          ; preds = %72, %28, %42, %90, %88, %59, %51
  ret void
}

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

declare i64 @der_write_tags(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 144}
!6 = !{!"asn_TYPE_descriptor_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !10, i64 104, !7, i64 112, !10, i64 120, !7, i64 128, !7, i64 136, !10, i64 144, !7, i64 152}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 136}
!12 = !{!13, !10, i64 0}
!13 = !{!"asn_TYPE_member_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!14 = !{!13, !10, i64 8}
!15 = !{!7, !7, i64 0}
!16 = !{!13, !10, i64 4}
!17 = !{!18, !19, i64 0}
!18 = !{!"asn_enc_rval_s", !19, i64 0, !7, i64 8, !7, i64 16}
!19 = !{!"long", !8, i64 0}
!20 = !{!18, !7, i64 8}
!21 = !{!18, !7, i64 16}
!22 = !{!13, !7, i64 24}
!23 = !{!6, !7, i64 48}
!24 = !{!13, !10, i64 16}
!25 = !{!13, !10, i64 12}
!26 = !{!19, !19, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass