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

; 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_SET_specifics_s = type { i32, i32, i32, ptr, i32, ptr, i32, i32, ptr }
%struct.asn_TYPE_member_s = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.asn_TYPE_tag2member_s = type { i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [25 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

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

; 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) #2

; 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
declare hidden i32 @_t2e_cmp(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @SET_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) #3 {
  %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 ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca %struct.asn_enc_rval_s, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca %struct.asn_enc_rval_s, align 8
  %26 = alloca ptr, align 8
  %27 = alloca %struct.asn_enc_rval_s, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = 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
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %31, i32 0, i32 19
  %33 = load ptr, ptr %32, align 8, !tbaa !11
  store ptr %33, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 0, ptr %15, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %34 = load ptr, ptr %14, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.asn_SET_specifics_s, ptr %34, i32 0, i32 4
  %36 = load i32, ptr %35, align 8, !tbaa !15
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %37, i32 0, i32 18
  %39 = load i32, ptr %38, align 8, !tbaa !17
  %40 = icmp ne i32 %36, %39
  %41 = zext i1 %40 to i32
  store i32 %41, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %42 = load i32, ptr %17, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %63

44:                                               ; preds = %7
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %45, i32 0, i32 18
  %47 = load i32, ptr %46, align 8, !tbaa !17
  %48 = sext i32 %47 to i64
  %49 = mul i64 %48, 16
  %50 = alloca i8, i64 %49, align 16
  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 %62, label %53

53:                                               ; preds = %44
  br label %54

54:                                               ; preds = %53
  %55 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %55, align 8, !tbaa !18
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %56, ptr %57, align 8, !tbaa !20
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %58, ptr %59, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 518, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %23, align 4
  br label %334

60:                                               ; No predecessors!
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61, %44
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %64

63:                                               ; preds = %7
  store ptr null, ptr %19, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %63, %62
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %190, %64
  %66 = load i32, ptr %22, align 4, !tbaa !9
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %67, i32 0, i32 18
  %69 = load i32, ptr %68, align 8, !tbaa !17
  %70 = icmp slt i32 %66, %69
  br i1 %70, label %71, label %193

71:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %72, i32 0, i32 17
  %74 = load ptr, ptr %73, align 8, !tbaa !22
  %75 = load i32, ptr %22, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %74, i64 %76
  store ptr %77, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %78 = load ptr, ptr %24, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !23
  %81 = and i32 %80, 1
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %126

83:                                               ; preds = %71
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %24, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 8, !tbaa !25
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %84, i64 %88
  %90 = load ptr, ptr %89, align 8, !tbaa !5
  store ptr %90, ptr %26, align 8, !tbaa !5
  %91 = load ptr, ptr %26, align 8, !tbaa !5
  %92 = icmp ne ptr %91, null
  br i1 %92, label %125, label %93

93:                                               ; preds = %83
  %94 = load ptr, ptr %24, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !26
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %107, label %98

98:                                               ; preds = %93
  br label %99

99:                                               ; preds = %98
  %100 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %100, align 8, !tbaa !18
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %101, ptr %102, align 8, !tbaa !20
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %103, ptr %104, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 546, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %23, align 4
  br label %187

105:                                              ; No predecessors!
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106, %93
  %108 = load i32, ptr %17, align 4, !tbaa !9
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %124

110:                                              ; preds = %107
  %111 = load i32, ptr %22, align 4, !tbaa !9
  %112 = load ptr, ptr %19, align 8, !tbaa !5
  %113 = load i32, ptr %20, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %112, i64 %114
  %116 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %115, i32 0, i32 1
  store i32 %111, ptr %116, align 4, !tbaa !27
  %117 = load ptr, ptr %19, align 8, !tbaa !5
  %118 = load i32, ptr %20, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %117, i64 %119
  %121 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %120, i32 0, i32 0
  store i32 0, ptr %121, align 4, !tbaa !29
  %122 = load i32, ptr %20, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %20, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %110, %107
  store i32 6, ptr %23, align 4
  br label %187

125:                                              ; preds = %83
  br label %133

126:                                              ; preds = %71
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = load ptr, ptr %24, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %128, i32 0, i32 2
  %130 = load i32, ptr %129, align 8, !tbaa !25
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds i8, ptr %127, i64 %131
  store ptr %132, ptr %26, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %126, %125
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #4
  %134 = load ptr, ptr %24, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %134, i32 0, i32 5
  %136 = load ptr, ptr %135, align 8, !tbaa !30
  %137 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %136, i32 0, i32 6
  %138 = load ptr, ptr %137, align 8, !tbaa !31
  %139 = load ptr, ptr %24, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %139, i32 0, i32 5
  %141 = load ptr, ptr %140, align 8, !tbaa !30
  %142 = load ptr, ptr %26, align 8, !tbaa !5
  %143 = load ptr, ptr %24, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %143, i32 0, i32 4
  %145 = load i32, ptr %144, align 8, !tbaa !32
  %146 = load ptr, ptr %24, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %146, i32 0, i32 3
  %148 = load i32, ptr %147, align 4, !tbaa !33
  call void %138(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %27, ptr noundef %141, ptr noundef %142, i32 noundef %145, i32 noundef %148, ptr noundef null, ptr noundef null)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %27, i64 24, i1 false), !tbaa.struct !34
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #4
  %149 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %25, i32 0, i32 0
  %150 = load i64, ptr %149, align 8, !tbaa !18
  %151 = icmp eq i64 %150, -1
  br i1 %151, label %152, label %153

152:                                              ; preds = %133
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %25, i64 24, i1 false), !tbaa.struct !34
  store i32 1, ptr %23, align 4
  br label %187

153:                                              ; preds = %133
  %154 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %25, i32 0, i32 0
  %155 = load i64, ptr %154, align 8, !tbaa !18
  %156 = load i64, ptr %15, align 8, !tbaa !13
  %157 = add i64 %156, %155
  store i64 %157, ptr %15, align 8, !tbaa !13
  %158 = load i32, ptr %17, align 4, !tbaa !9
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %185

160:                                              ; preds = %153
  %161 = load i32, ptr %22, align 4, !tbaa !9
  %162 = load ptr, ptr %19, align 8, !tbaa !5
  %163 = load i32, ptr %20, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %162, i64 %164
  %166 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %165, i32 0, i32 1
  store i32 %161, ptr %166, align 4, !tbaa !27
  %167 = load ptr, ptr %24, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %167, i32 0, i32 5
  %169 = load ptr, ptr %168, align 8, !tbaa !30
  %170 = load ptr, ptr %26, align 8, !tbaa !5
  %171 = load ptr, ptr %24, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %171, i32 0, i32 4
  %173 = load i32, ptr %172, align 8, !tbaa !32
  %174 = load ptr, ptr %24, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %174, i32 0, i32 3
  %176 = load i32, ptr %175, align 4, !tbaa !33
  %177 = call i32 @asn_TYPE_outmost_tag(ptr noundef %169, ptr noundef %170, i32 noundef %173, i32 noundef %176)
  %178 = load ptr, ptr %19, align 8, !tbaa !5
  %179 = load i32, ptr %20, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %178, i64 %180
  %182 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %181, i32 0, i32 0
  store i32 %177, ptr %182, align 4, !tbaa !29
  %183 = load i32, ptr %20, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %20, align 4, !tbaa !9
  br label %186

185:                                              ; preds = %153
  br label %186

186:                                              ; preds = %185, %160
  store i32 0, ptr %23, align 4
  br label %187

187:                                              ; preds = %186, %152, %124, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  %188 = load i32, ptr %23, align 4
  switch i32 %188, label %334 [
    i32 0, label %189
    i32 6, label %190
  ]

189:                                              ; preds = %187
  br label %190

190:                                              ; preds = %189, %187
  %191 = load i32, ptr %22, align 4, !tbaa !9
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %22, align 4, !tbaa !9
  br label %65, !llvm.loop !35

193:                                              ; preds = %65
  %194 = load i32, ptr %17, align 4, !tbaa !9
  %195 = icmp ne i32 %194, 0
  br i1 %195, label %196, label %201

196:                                              ; preds = %193
  %197 = load ptr, ptr %19, align 8, !tbaa !5
  %198 = load i32, ptr %20, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  call void @qsort(ptr noundef %197, i64 noundef %199, i64 noundef 16, ptr noundef @_t2e_cmp)
  %200 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %200, ptr %18, align 8, !tbaa !5
  br label %208

201:                                              ; preds = %193
  %202 = load ptr, ptr %14, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.asn_SET_specifics_s, ptr %202, i32 0, i32 3
  %204 = load ptr, ptr %203, align 8, !tbaa !37
  store ptr %204, ptr %18, align 8, !tbaa !5
  %205 = load ptr, ptr %14, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.asn_SET_specifics_s, ptr %205, i32 0, i32 4
  %207 = load i32, ptr %206, align 8, !tbaa !15
  store i32 %207, ptr %20, align 4, !tbaa !9
  br label %208

208:                                              ; preds = %201, %196
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = load i64, ptr %15, align 8, !tbaa !13
  %211 = load i32, ptr %10, align 4, !tbaa !9
  %212 = load i32, ptr %11, align 4, !tbaa !9
  %213 = load ptr, ptr %12, align 8, !tbaa !5
  %214 = load ptr, ptr %13, align 8, !tbaa !5
  %215 = call i64 @der_write_tags(ptr noundef %209, i64 noundef %210, i32 noundef %211, i32 noundef 1, i32 noundef %212, ptr noundef %213, ptr noundef %214)
  store i64 %215, ptr %21, align 8, !tbaa !13
  %216 = load i64, ptr %21, align 8, !tbaa !13
  %217 = icmp eq i64 %216, -1
  br i1 %217, label %218, label %227

218:                                              ; preds = %208
  br label %219

219:                                              ; preds = %218
  %220 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %220, align 8, !tbaa !18
  %221 = load ptr, ptr %8, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %221, ptr %222, align 8, !tbaa !20
  %223 = load ptr, ptr %9, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %223, ptr %224, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 605, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %23, align 4
  br label %334

225:                                              ; No predecessors!
  br label %226

226:                                              ; preds = %225
  br label %227

227:                                              ; preds = %226, %208
  %228 = load i64, ptr %15, align 8, !tbaa !13
  %229 = load i64, ptr %21, align 8, !tbaa !13
  %230 = add i64 %228, %229
  %231 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  store i64 %230, ptr %231, align 8, !tbaa !18
  %232 = load ptr, ptr %12, align 8, !tbaa !5
  %233 = icmp ne ptr %232, null
  br i1 %233, label %240, label %234

234:                                              ; preds = %227
  br label %235

235:                                              ; preds = %234
  %236 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 2
  store ptr null, ptr %236, align 8, !tbaa !21
  %237 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 1
  store ptr null, ptr %237, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !34
  store i32 1, ptr %23, align 4
  br label %334

238:                                              ; No predecessors!
  br label %239

239:                                              ; preds = %238
  br label %240

240:                                              ; preds = %239, %227
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %241

241:                                              ; preds = %313, %240
  %242 = load i32, ptr %22, align 4, !tbaa !9
  %243 = load ptr, ptr %8, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %243, i32 0, i32 18
  %245 = load i32, ptr %244, align 8, !tbaa !17
  %246 = icmp slt i32 %242, %245
  br i1 %246, label %247, label %316

247:                                              ; preds = %241
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %248 = load ptr, ptr %8, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %248, i32 0, i32 17
  %250 = load ptr, ptr %249, align 8, !tbaa !22
  %251 = load ptr, ptr %18, align 8, !tbaa !5
  %252 = load i32, ptr %22, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %251, i64 %253
  %255 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %254, i32 0, i32 1
  %256 = load i32, ptr %255, align 4, !tbaa !27
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %250, i64 %257
  store ptr %258, ptr %28, align 8, !tbaa !5
  %259 = load ptr, ptr %28, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %259, i32 0, i32 0
  %261 = load i32, ptr %260, align 8, !tbaa !23
  %262 = and i32 %261, 1
  %263 = icmp ne i32 %262, 0
  br i1 %263, label %264, label %276

264:                                              ; preds = %247
  %265 = load ptr, ptr %9, align 8, !tbaa !5
  %266 = load ptr, ptr %28, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %266, i32 0, i32 2
  %268 = load i32, ptr %267, align 8, !tbaa !25
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds i8, ptr %265, i64 %269
  %271 = load ptr, ptr %270, align 8, !tbaa !5
  store ptr %271, ptr %29, align 8, !tbaa !5
  %272 = load ptr, ptr %29, align 8, !tbaa !5
  %273 = icmp ne ptr %272, null
  br i1 %273, label %275, label %274

274:                                              ; preds = %264
  store i32 15, ptr %23, align 4
  br label %310

275:                                              ; preds = %264
  br label %283

276:                                              ; preds = %247
  %277 = load ptr, ptr %9, align 8, !tbaa !5
  %278 = load ptr, ptr %28, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %278, i32 0, i32 2
  %280 = load i32, ptr %279, align 8, !tbaa !25
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds i8, ptr %277, i64 %281
  store ptr %282, ptr %29, align 8, !tbaa !5
  br label %283

283:                                              ; preds = %276, %275
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #4
  %284 = load ptr, ptr %28, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %284, i32 0, i32 5
  %286 = load ptr, ptr %285, align 8, !tbaa !30
  %287 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %286, i32 0, i32 6
  %288 = load ptr, ptr %287, align 8, !tbaa !31
  %289 = load ptr, ptr %28, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %289, i32 0, i32 5
  %291 = load ptr, ptr %290, align 8, !tbaa !30
  %292 = load ptr, ptr %29, align 8, !tbaa !5
  %293 = load ptr, ptr %28, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %293, i32 0, i32 4
  %295 = load i32, ptr %294, align 8, !tbaa !32
  %296 = load ptr, ptr %28, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %296, i32 0, i32 3
  %298 = load i32, ptr %297, align 4, !tbaa !33
  %299 = load ptr, ptr %12, align 8, !tbaa !5
  %300 = load ptr, ptr %13, align 8, !tbaa !5
  call void %288(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %30, ptr noundef %291, ptr noundef %292, i32 noundef %295, i32 noundef %298, ptr noundef %299, ptr noundef %300)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %30, i64 24, i1 false), !tbaa.struct !34
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #4
  %301 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %302 = load i64, ptr %301, align 8, !tbaa !18
  %303 = icmp eq i64 %302, -1
  br i1 %303, label %304, label %305

304:                                              ; preds = %283
  store i32 1, ptr %23, align 4
  br label %310

305:                                              ; preds = %283
  %306 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %307 = load i64, ptr %306, align 8, !tbaa !18
  %308 = load i64, ptr %15, align 8, !tbaa !13
  %309 = sub i64 %308, %307
  store i64 %309, ptr %15, align 8, !tbaa !13
  store i32 0, ptr %23, align 4
  br label %310

310:                                              ; preds = %305, %304, %274
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  %311 = load i32, ptr %23, align 4
  switch i32 %311, label %334 [
    i32 0, label %312
    i32 15, label %313
  ]

312:                                              ; preds = %310
  br label %313

313:                                              ; preds = %312, %310
  %314 = load i32, ptr %22, align 4, !tbaa !9
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %22, align 4, !tbaa !9
  br label %241, !llvm.loop !38

316:                                              ; preds = %241
  %317 = load i64, ptr %15, align 8, !tbaa !13
  %318 = icmp ne i64 %317, 0
  br i1 %318, label %319, label %328

319:                                              ; preds = %316
  br label %320

320:                                              ; preds = %319
  %321 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %321, align 8, !tbaa !18
  %322 = load ptr, ptr %8, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %322, ptr %323, align 8, !tbaa !20
  %324 = load ptr, ptr %9, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %324, ptr %325, align 8, !tbaa !21
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 645, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %23, align 4
  br label %334

326:                                              ; No predecessors!
  br label %327

327:                                              ; preds = %326
  br label %328

328:                                              ; preds = %327, %316
  br label %329

329:                                              ; preds = %328
  %330 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 2
  store ptr null, ptr %330, align 8, !tbaa !21
  %331 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 1
  store ptr null, ptr %331, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !34
  store i32 1, ptr %23, align 4
  br label %334

332:                                              ; No predecessors!
  br label %333

333:                                              ; preds = %332
  store i32 0, ptr %23, align 4
  br label %334

334:                                              ; preds = %333, %329, %320, %310, %235, %219, %187, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %335 = load i32, ptr %23, align 4
  switch i32 %335, label %337 [
    i32 0, label %336
    i32 1, label %336
  ]

336:                                              ; preds = %334, %334
  ret void

337:                                              ; preds = %334
  unreachable
}

declare i32 @asn_TYPE_outmost_tag(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #1

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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, !6, i64 152}
!12 = !{!"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}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 24}
!16 = !{!"asn_SET_specifics_s", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !6, i64 48}
!17 = !{!12, !10, i64 144}
!18 = !{!19, !14, i64 0}
!19 = !{!"asn_enc_rval_s", !14, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!19, !6, i64 8}
!21 = !{!19, !6, i64 16}
!22 = !{!12, !6, i64 136}
!23 = !{!24, !10, i64 0}
!24 = !{!"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}
!25 = !{!24, !10, i64 8}
!26 = !{!24, !10, i64 4}
!27 = !{!28, !10, i64 4}
!28 = !{!"asn_TYPE_tag2member_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!29 = !{!28, !10, i64 0}
!30 = !{!24, !6, i64 24}
!31 = !{!12, !6, i64 48}
!32 = !{!24, !10, i64 16}
!33 = !{!24, !10, i64 12}
!34 = !{i64 0, i64 8, !13, i64 8, i64 8, !5, i64 16, i64 8, !5}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}
!37 = !{!16, !6, i64 16}
!38 = distinct !{!38, !36}


; 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 }
%struct.asn_TYPE_tag2member_s = type { i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [25 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

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

; Function Attrs: mustprogress 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) #2

; 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
declare hidden i32 @_t2e_cmp(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @SET_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 #3 {
  %.sroa.6 = alloca { ptr, ptr }, align 8
  %8 = alloca %struct.asn_enc_rval_s, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 152
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = load i32, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %1, i64 144
  %14 = load i32, ptr %13, align 8, !tbaa !13
  %.not = icmp eq i32 %12, %14
  br i1 %.not, label %15, label %.thread

15:                                               ; preds = %7
  %16 = icmp sgt i32 %14, 0
  br i1 %16, label %.lr.ph.split.us.preheader, label %._crit_edge

.thread:                                          ; preds = %7
  %17 = sext i32 %14 to i64
  %18 = shl nsw i64 %17, 4
  %19 = alloca i8, i64 %18, align 16
  %20 = icmp sgt i32 %14, 0
  br i1 %20, label %.lr.ph.split.preheader, label %._crit_edge.thread

.lr.ph.split.preheader:                           ; preds = %.thread
  %21 = getelementptr inbounds i8, ptr %1, i64 136
  %.sroa.6.0..sroa_idx169 = getelementptr inbounds i8, ptr %8, i64 8
  br label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %15
  %22 = getelementptr inbounds i8, ptr %1, i64 136
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %49
  %23 = phi i32 [ %12, %.lr.ph.split.us.preheader ], [ %50, %49 ]
  %indvars.iv156 = phi i64 [ 0, %.lr.ph.split.us.preheader ], [ %indvars.iv.next157, %49 ]
  %.097140.us = phi i64 [ 0, %.lr.ph.split.us.preheader ], [ %.1.ph.us, %49 ]
  %24 = load ptr, ptr %22, align 8, !tbaa !14
  %25 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %24, i64 %indvars.iv156
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %.sroa.6)
  %26 = load i32, ptr %25, align 8, !tbaa !15
  %27 = and i32 %26, 1
  %.not119.us = icmp eq i32 %27, 0
  %28 = getelementptr inbounds i8, ptr %25, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !17
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %2, i64 %30
  br i1 %.not119.us, label %37, label %32

32:                                               ; preds = %.lr.ph.split.us
  %33 = load ptr, ptr %31, align 8, !tbaa !18
  %.not120.us = icmp eq ptr %33, null
  br i1 %.not120.us, label %34, label %37

34:                                               ; preds = %32
  %35 = getelementptr inbounds i8, ptr %25, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !19
  %.not121.us = icmp eq i32 %36, 0
  br i1 %.not121.us, label %.split.us, label %49

37:                                               ; preds = %.lr.ph.split.us, %32
  %.098.us = phi ptr [ %33, %32 ], [ %31, %.lr.ph.split.us ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %38 = getelementptr inbounds i8, ptr %25, i64 24
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %39, i64 48
  %41 = load ptr, ptr %40, align 8, !tbaa !21
  %42 = getelementptr inbounds i8, ptr %25, i64 16
  %43 = load i32, ptr %42, align 8, !tbaa !22
  %44 = getelementptr inbounds i8, ptr %25, i64 12
  %45 = load i32, ptr %44, align 4, !tbaa !23
  call void %41(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %8, ptr noundef %39, ptr noundef %.098.us, i32 noundef %43, i32 noundef %45, ptr noundef null, ptr noundef null) #6
  %.sroa.0.0.copyload.us = load i64, ptr %8, align 8, !tbaa !24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.6, ptr noundef nonnull align 8 dereferenceable(16) %.sroa.6.0..sroa_idx, i64 16, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  %46 = icmp eq i64 %.sroa.0.0.copyload.us, -1
  br i1 %46, label %.split143.us, label %47

47:                                               ; preds = %37
  %48 = add i64 %.sroa.0.0.copyload.us, %.097140.us
  %.pre162 = load i32, ptr %13, align 8, !tbaa !13
  br label %49

49:                                               ; preds = %34, %47
  %50 = phi i32 [ %.pre162, %47 ], [ %23, %34 ]
  %.1.ph.us = phi i64 [ %48, %47 ], [ %.097140.us, %34 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %.sroa.6)
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %51 = sext i32 %50 to i64
  %52 = icmp slt i64 %indvars.iv.next157, %51
  br i1 %52, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !27

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %93
  %53 = phi i32 [ %14, %.lr.ph.split.preheader ], [ %94, %93 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph.split.preheader ], [ %indvars.iv.next, %93 ]
  %.097140 = phi i64 [ 0, %.lr.ph.split.preheader ], [ %.1.ph, %93 ]
  %54 = load ptr, ptr %21, align 8, !tbaa !14
  %55 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %54, i64 %indvars.iv
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %.sroa.6)
  %56 = load i32, ptr %55, align 8, !tbaa !15
  %57 = and i32 %56, 1
  %.not119 = icmp eq i32 %57, 0
  %58 = getelementptr inbounds i8, ptr %55, i64 8
  %59 = load i32, ptr %58, align 8, !tbaa !17
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %2, i64 %60
  br i1 %.not119, label %73, label %62

62:                                               ; preds = %.lr.ph.split
  %63 = load ptr, ptr %61, align 8, !tbaa !18
  %.not120 = icmp eq ptr %63, null
  br i1 %.not120, label %64, label %73

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %55, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %.not121 = icmp eq i32 %66, 0
  br i1 %.not121, label %.split.us, label %69

.split.us:                                        ; preds = %64, %34
  store i64 -1, ptr %0, align 8, !tbaa !29
  %67 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %67, align 8, !tbaa !31
  %68 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %68, align 8, !tbaa !32
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 546, i32 noundef 101, ptr noundef null) #6
  br label %92

69:                                               ; preds = %64
  %70 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %19, i64 %indvars.iv
  %71 = getelementptr inbounds i8, ptr %70, i64 4
  %72 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %72, ptr %71, align 4, !tbaa !33
  store i32 0, ptr %70, align 16, !tbaa !35
  br label %93

73:                                               ; preds = %.lr.ph.split, %62
  %.098 = phi ptr [ %63, %62 ], [ %61, %.lr.ph.split ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #6
  %74 = getelementptr inbounds i8, ptr %55, i64 24
  %75 = load ptr, ptr %74, align 8, !tbaa !20
  %76 = getelementptr inbounds i8, ptr %75, i64 48
  %77 = load ptr, ptr %76, align 8, !tbaa !21
  %78 = getelementptr inbounds i8, ptr %55, i64 16
  %79 = load i32, ptr %78, align 8, !tbaa !22
  %80 = getelementptr inbounds i8, ptr %55, i64 12
  %81 = load i32, ptr %80, align 4, !tbaa !23
  call void %77(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %8, ptr noundef %75, ptr noundef %.098, i32 noundef %79, i32 noundef %81, ptr noundef null, ptr noundef null) #6
  %.sroa.0.0.copyload = load i64, ptr %8, align 8, !tbaa !24
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.6, ptr noundef nonnull align 8 dereferenceable(16) %.sroa.6.0..sroa_idx169, i64 16, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #6
  %82 = icmp eq i64 %.sroa.0.0.copyload, -1
  br i1 %82, label %.split143.us, label %83

.split143.us:                                     ; preds = %73, %37
  store i64 -1, ptr %0, align 8, !tbaa !24
  %.sroa.6.0..sroa_idx14 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.6.0..sroa_idx14, ptr noundef nonnull align 8 dereferenceable(16) %.sroa.6, i64 16, i1 false), !tbaa.struct !26
  br label %92

83:                                               ; preds = %73
  %84 = add i64 %.sroa.0.0.copyload, %.097140
  %85 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %19, i64 %indvars.iv
  %86 = getelementptr inbounds i8, ptr %85, i64 4
  %87 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %87, ptr %86, align 4, !tbaa !33
  %88 = load ptr, ptr %74, align 8, !tbaa !20
  %89 = load i32, ptr %78, align 8, !tbaa !22
  %90 = load i32, ptr %80, align 4, !tbaa !23
  %91 = call i32 @asn_TYPE_outmost_tag(ptr noundef %88, ptr noundef %.098, i32 noundef %89, i32 noundef %90) #6
  store i32 %91, ptr %85, align 16, !tbaa !35
  %.pre = load i32, ptr %13, align 8, !tbaa !13
  br label %93

92:                                               ; preds = %.split143.us, %.split.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %.sroa.6)
  br label %.loopexit

93:                                               ; preds = %69, %83
  %94 = phi i32 [ %.pre, %83 ], [ %53, %69 ]
  %.1.ph = phi i64 [ %84, %83 ], [ %.097140, %69 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %.sroa.6)
  %95 = sext i32 %94 to i64
  %96 = icmp slt i64 %indvars.iv.next, %95
  br i1 %96, label %.lr.ph.split, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %93, %49, %15
  %.0108167 = phi ptr [ null, %15 ], [ null, %49 ], [ %19, %93 ]
  %.1105.lcssa = phi i64 [ 0, %15 ], [ 0, %49 ], [ %indvars.iv.next, %93 ]
  %.097.lcssa = phi i64 [ 0, %15 ], [ %.1.ph.us, %49 ], [ %.1.ph, %93 ]
  br i1 %.not, label %97, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.thread, %._crit_edge
  %.097.lcssa178 = phi i64 [ %.097.lcssa, %._crit_edge ], [ 0, %.thread ]
  %.1105.lcssa176 = phi i64 [ %.1105.lcssa, %._crit_edge ], [ 0, %.thread ]
  %.0108167175 = phi ptr [ %.0108167, %._crit_edge ], [ %19, %.thread ]
  call void @qsort(ptr noundef %.0108167175, i64 noundef %.1105.lcssa176, i64 noundef 16, ptr noundef nonnull @_t2e_cmp) #6
  br label %100

97:                                               ; preds = %._crit_edge
  %98 = getelementptr inbounds i8, ptr %10, i64 16
  %99 = load ptr, ptr %98, align 8, !tbaa !36
  br label %100

100:                                              ; preds = %97, %._crit_edge.thread
  %.097.lcssa177 = phi i64 [ %.097.lcssa178, %._crit_edge.thread ], [ %.097.lcssa, %97 ]
  %.0103 = phi ptr [ %.0108167175, %._crit_edge.thread ], [ %99, %97 ]
  %101 = call i64 @der_write_tags(ptr noundef nonnull %1, i64 noundef %.097.lcssa177, i32 noundef %3, i32 noundef 1, i32 noundef %4, ptr noundef %5, ptr noundef %6) #6
  %102 = icmp eq i64 %101, -1
  br i1 %102, label %103, label %106

103:                                              ; preds = %100
  store i64 -1, ptr %0, align 8, !tbaa !29
  %104 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %104, align 8, !tbaa !31
  %105 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %105, align 8, !tbaa !32
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 605, i32 noundef 101, ptr noundef null) #6
  br label %.loopexit

106:                                              ; preds = %100
  %107 = add i64 %101, %.097.lcssa177
  %.not115 = icmp eq ptr %5, null
  br i1 %.not115, label %111, label %.preheader

.preheader:                                       ; preds = %106
  %108 = load i32, ptr %13, align 8, !tbaa !13
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %.lr.ph147, label %._crit_edge148

.lr.ph147:                                        ; preds = %.preheader
  %110 = getelementptr inbounds i8, ptr %1, i64 136
  br label %112

111:                                              ; preds = %106
  store i64 %107, ptr %0, align 8, !tbaa !24
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.5.0..sroa_idx, i8 0, i64 16, i1 false)
  br label %.loopexit

112:                                              ; preds = %.lr.ph147, %139
  %113 = phi i32 [ %108, %.lr.ph147 ], [ %140, %139 ]
  %indvars.iv159 = phi i64 [ 0, %.lr.ph147 ], [ %indvars.iv.next160, %139 ]
  %.2146 = phi i64 [ %.097.lcssa177, %.lr.ph147 ], [ %.3.ph, %139 ]
  %114 = load ptr, ptr %110, align 8, !tbaa !14
  %115 = getelementptr inbounds %struct.asn_TYPE_tag2member_s, ptr %.0103, i64 %indvars.iv159, i32 1
  %116 = load i32, ptr %115, align 4, !tbaa !33
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %114, i64 %117
  %119 = load i32, ptr %118, align 8, !tbaa !15
  %120 = and i32 %119, 1
  %.not117 = icmp eq i32 %120, 0
  %121 = getelementptr inbounds i8, ptr %118, i64 8
  %122 = load i32, ptr %121, align 8, !tbaa !17
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %2, i64 %123
  br i1 %.not117, label %127, label %125

125:                                              ; preds = %112
  %126 = load ptr, ptr %124, align 8, !tbaa !18
  %.not118 = icmp eq ptr %126, null
  br i1 %.not118, label %139, label %127

127:                                              ; preds = %112, %125
  %.0 = phi ptr [ %126, %125 ], [ %124, %112 ]
  %128 = getelementptr inbounds i8, ptr %118, i64 24
  %129 = load ptr, ptr %128, align 8, !tbaa !20
  %130 = getelementptr inbounds i8, ptr %129, i64 48
  %131 = load ptr, ptr %130, align 8, !tbaa !21
  %132 = getelementptr inbounds i8, ptr %118, i64 16
  %133 = load i32, ptr %132, align 8, !tbaa !22
  %134 = getelementptr inbounds i8, ptr %118, i64 12
  %135 = load i32, ptr %134, align 4, !tbaa !23
  call void %131(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %129, ptr noundef %.0, i32 noundef %133, i32 noundef %135, ptr noundef nonnull %5, ptr noundef %6) #6
  %136 = load i64, ptr %0, align 8, !tbaa !29
  %137 = icmp eq i64 %136, -1
  br i1 %137, label %.loopexit, label %._crit_edge163

._crit_edge163:                                   ; preds = %127
  %138 = sub i64 %.2146, %136
  %.pre164 = load i32, ptr %13, align 8, !tbaa !13
  br label %139

139:                                              ; preds = %._crit_edge163, %125
  %140 = phi i32 [ %.pre164, %._crit_edge163 ], [ %113, %125 ]
  %.3.ph = phi i64 [ %138, %._crit_edge163 ], [ %.2146, %125 ]
  %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1
  %141 = sext i32 %140 to i64
  %142 = icmp slt i64 %indvars.iv.next160, %141
  br i1 %142, label %112, label %._crit_edge148, !llvm.loop !37

._crit_edge148:                                   ; preds = %139, %.preheader
  %.2.lcssa = phi i64 [ %.097.lcssa177, %.preheader ], [ %.3.ph, %139 ]
  %.not116 = icmp eq i64 %.2.lcssa, 0
  %.sroa.5.0..sroa_idx58 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %.not116, label %145, label %143

143:                                              ; preds = %._crit_edge148
  store i64 -1, ptr %0, align 8, !tbaa !29
  store ptr %1, ptr %.sroa.5.0..sroa_idx58, align 8, !tbaa !31
  %144 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %144, align 8, !tbaa !32
  call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 645, i32 noundef 101, ptr noundef null) #6
  br label %.loopexit

145:                                              ; preds = %._crit_edge148
  store i64 %107, ptr %0, align 8, !tbaa !24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.5.0..sroa_idx58, i8 0, i64 16, i1 false)
  br label %.loopexit

.loopexit:                                        ; preds = %127, %92, %145, %143, %111, %103
  ret void
}

declare i32 @asn_TYPE_outmost_tag(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nofree "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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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, !7, i64 152}
!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 = !{!12, !10, i64 24}
!12 = !{!"asn_SET_specifics_s", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !7, i64 48}
!13 = !{!6, !10, i64 144}
!14 = !{!6, !7, i64 136}
!15 = !{!16, !10, i64 0}
!16 = !{!"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}
!17 = !{!16, !10, i64 8}
!18 = !{!7, !7, i64 0}
!19 = !{!16, !10, i64 4}
!20 = !{!16, !7, i64 24}
!21 = !{!6, !7, i64 48}
!22 = !{!16, !10, i64 16}
!23 = !{!16, !10, i64 12}
!24 = !{!25, !25, i64 0}
!25 = !{!"long", !8, i64 0}
!26 = !{i64 0, i64 8, !18, i64 8, i64 8, !18}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!30, !25, i64 0}
!30 = !{!"asn_enc_rval_s", !25, i64 0, !7, i64 8, !7, i64 16}
!31 = !{!30, !7, i64 8}
!32 = !{!30, !7, i64 16}
!33 = !{!34, !10, i64 4}
!34 = !{!"asn_TYPE_tag2member_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!35 = !{!34, !10, i64 0}
!36 = !{!12, !7, i64 16}
!37 = distinct !{!37, !28}


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