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

; 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 }
%struct.asn_anonymous_set_ = type { ptr, i32, i32, ptr }
%struct._el_buffer = type { ptr, i64, i64 }

; 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 @SET_OF_encode_ber(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 ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %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
  %31 = alloca ptr, 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) #6
  %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 !11
  store ptr %34, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %35, i32 0, i32 5
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  store ptr %37, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %38 = load ptr, ptr %15, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %38, i32 0, i32 6
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  store ptr %40, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %41, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store i64 0, ptr %18, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  store i64 0, ptr %21, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  store i64 1, ptr %22, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %86, %7
  %43 = load i32, ptr %24, align 4, !tbaa !9
  %44 = load ptr, ptr %17, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.asn_anonymous_set_, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 8, !tbaa !18
  %47 = icmp slt i32 %43, %46
  br i1 %47, label %48, label %89

48:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %49 = load ptr, ptr %17, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.asn_anonymous_set_, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  %52 = load i32, ptr %24, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds ptr, ptr %51, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  store ptr %55, ptr %25, align 8, !tbaa !5
  %56 = load ptr, ptr %25, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %48
  store i32 4, ptr %26, align 4
  br label %83

59:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #6
  %60 = load ptr, ptr %16, align 8, !tbaa !5
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = load ptr, ptr %25, align 8, !tbaa !5
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 4, !tbaa !21
  call void %60(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %27, ptr noundef %61, ptr noundef %62, i32 noundef 0, i32 noundef %65, ptr noundef null, ptr noundef null)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %27, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  %66 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %67 = load i64, ptr %66, align 8, !tbaa !23
  %68 = icmp eq i64 %67, -1
  br i1 %68, label %69, label %70

69:                                               ; preds = %59
  store i32 1, ptr %26, align 4
  br label %83

70:                                               ; preds = %59
  %71 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %72 = load i64, ptr %71, align 8, !tbaa !23
  %73 = load i64, ptr %18, align 8, !tbaa !16
  %74 = add i64 %73, %72
  store i64 %74, ptr %18, align 8, !tbaa !16
  %75 = load i64, ptr %22, align 8, !tbaa !16
  %76 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !23
  %78 = icmp ult i64 %75, %77
  br i1 %78, label %79, label %82

79:                                               ; preds = %70
  %80 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %81 = load i64, ptr %80, align 8, !tbaa !23
  store i64 %81, ptr %22, align 8, !tbaa !16
  br label %82

82:                                               ; preds = %79, %70
  store i32 0, ptr %26, align 4
  br label %83

83:                                               ; preds = %82, %69, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  %84 = load i32, ptr %26, align 4
  switch i32 %84, label %305 [
    i32 0, label %85
    i32 4, label %86
  ]

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85, %83
  %87 = load i32, ptr %24, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %24, align 4, !tbaa !9
  br label %42, !llvm.loop !25

89:                                               ; preds = %42
  %90 = load ptr, ptr %8, align 8, !tbaa !5
  %91 = load i64, ptr %18, align 8, !tbaa !16
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = call i64 @der_write_tags(ptr noundef %90, i64 noundef %91, i32 noundef %92, i32 noundef 1, i32 noundef %93, ptr noundef %94, ptr noundef %95)
  store i64 %96, ptr %19, align 8, !tbaa !16
  %97 = load i64, ptr %19, align 8, !tbaa !16
  %98 = icmp eq i64 %97, -1
  br i1 %98, label %99, label %105

99:                                               ; preds = %89
  %100 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %100, align 8, !tbaa !23
  %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 !27
  %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 !28
  store i32 1, ptr %26, align 4
  br label %305

105:                                              ; preds = %89
  %106 = load i64, ptr %19, align 8, !tbaa !16
  %107 = load i64, ptr %18, align 8, !tbaa !16
  %108 = add i64 %107, %106
  store i64 %108, ptr %18, align 8, !tbaa !16
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %116

111:                                              ; preds = %105
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.asn_anonymous_set_, ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 8, !tbaa !18
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %124

116:                                              ; preds = %111, %105
  %117 = load i64, ptr %18, align 8, !tbaa !16
  %118 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 %117, ptr %118, align 8, !tbaa !23
  br label %119

119:                                              ; preds = %116
  %120 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr null, ptr %120, align 8, !tbaa !28
  %121 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr null, ptr %121, align 8, !tbaa !27
  store i32 1, ptr %26, align 4
  br label %305

122:                                              ; No predecessors!
  br label %123

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123, %111
  %125 = load ptr, ptr %17, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.asn_anonymous_set_, ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 8, !tbaa !18
  %128 = sext i32 %127 to i64
  %129 = mul i64 %128, 24
  %130 = call noalias ptr @malloc(i64 noundef %129) #7
  store ptr %130, ptr %20, align 8, !tbaa !5
  %131 = load ptr, ptr %20, align 8, !tbaa !5
  %132 = icmp eq ptr %131, null
  br i1 %132, label %133, label %139

133:                                              ; preds = %124
  %134 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %134, align 8, !tbaa !23
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %135, ptr %136, align 8, !tbaa !27
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %137, ptr %138, align 8, !tbaa !28
  store i32 1, ptr %26, align 4
  br label %305

139:                                              ; preds = %124
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %140

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

146:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.asn_anonymous_set_, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !20
  %150 = load i32, ptr %24, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds ptr, ptr %149, i64 %151
  %153 = load ptr, ptr %152, align 8, !tbaa !5
  store ptr %153, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %154 = load ptr, ptr %20, align 8, !tbaa !5
  %155 = load i64, ptr %21, align 8, !tbaa !16
  %156 = getelementptr inbounds %struct._el_buffer, ptr %154, i64 %155
  store ptr %156, ptr %29, align 8, !tbaa !5
  %157 = load ptr, ptr %28, align 8, !tbaa !5
  %158 = icmp ne ptr %157, null
  br i1 %158, label %160, label %159

159:                                              ; preds = %146
  store i32 9, ptr %26, align 4
  br label %242

160:                                              ; preds = %146
  %161 = load i64, ptr %22, align 8, !tbaa !16
  %162 = call noalias ptr @malloc(i64 noundef %161) #7
  %163 = load ptr, ptr %29, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._el_buffer, ptr %163, i32 0, i32 0
  store ptr %162, ptr %164, align 8, !tbaa !29
  %165 = load ptr, ptr %29, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._el_buffer, ptr %165, i32 0, i32 0
  %167 = load ptr, ptr %166, align 8, !tbaa !29
  %168 = icmp ne ptr %167, null
  br i1 %168, label %169, label %175

169:                                              ; preds = %160
  %170 = load ptr, ptr %29, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct._el_buffer, ptr %170, i32 0, i32 1
  store i64 0, ptr %171, align 8, !tbaa !31
  %172 = load i64, ptr %22, align 8, !tbaa !16
  %173 = load ptr, ptr %29, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._el_buffer, ptr %173, i32 0, i32 2
  store i64 %172, ptr %174, align 8, !tbaa !32
  br label %203

175:                                              ; preds = %160
  %176 = load i32, ptr %24, align 4, !tbaa !9
  %177 = add nsw i32 %176, -1
  store i32 %177, ptr %24, align 4, !tbaa !9
  br label %178

178:                                              ; preds = %193, %175
  %179 = load i32, ptr %24, align 4, !tbaa !9
  %180 = icmp sge i32 %179, 0
  br i1 %180, label %181, label %196

181:                                              ; preds = %178
  %182 = load ptr, ptr %20, align 8, !tbaa !5
  %183 = load i32, ptr %24, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds %struct._el_buffer, ptr %182, i64 %184
  %186 = getelementptr inbounds %struct._el_buffer, ptr %185, i32 0, i32 0
  %187 = load ptr, ptr %186, align 8, !tbaa !29
  call void @free(ptr noundef %187) #6
  %188 = load ptr, ptr %20, align 8, !tbaa !5
  %189 = load i32, ptr %24, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds %struct._el_buffer, ptr %188, i64 %190
  %192 = getelementptr inbounds %struct._el_buffer, ptr %191, i32 0, i32 0
  store ptr null, ptr %192, align 8, !tbaa !29
  br label %193

193:                                              ; preds = %181
  %194 = load i32, ptr %24, align 4, !tbaa !9
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr %24, align 4, !tbaa !9
  br label %178, !llvm.loop !33

196:                                              ; preds = %178
  %197 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %197) #6
  store ptr null, ptr %20, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %198, align 8, !tbaa !23
  %199 = load ptr, ptr %8, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %199, ptr %200, align 8, !tbaa !27
  %201 = load ptr, ptr %9, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %201, ptr %202, align 8, !tbaa !28
  store i32 1, ptr %26, align 4
  br label %242

203:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 24, ptr %30) #6
  %204 = load ptr, ptr %16, align 8, !tbaa !5
  %205 = load ptr, ptr %15, align 8, !tbaa !5
  %206 = load ptr, ptr %28, align 8, !tbaa !5
  %207 = load ptr, ptr %14, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %207, i32 0, i32 3
  %209 = load i32, ptr %208, align 4, !tbaa !21
  %210 = load ptr, ptr %29, align 8, !tbaa !5
  call void %204(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %30, ptr noundef %205, ptr noundef %206, i32 noundef 0, i32 noundef %209, ptr noundef @_el_addbytes, ptr noundef %210)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %30, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %30) #6
  %211 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %212 = load i64, ptr %211, align 8, !tbaa !23
  %213 = icmp eq i64 %212, -1
  br i1 %213, label %214, label %235

214:                                              ; preds = %203
  br label %215

215:                                              ; preds = %230, %214
  %216 = load i32, ptr %24, align 4, !tbaa !9
  %217 = icmp sge i32 %216, 0
  br i1 %217, label %218, label %233

218:                                              ; preds = %215
  %219 = load ptr, ptr %20, align 8, !tbaa !5
  %220 = load i32, ptr %24, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds %struct._el_buffer, ptr %219, i64 %221
  %223 = getelementptr inbounds %struct._el_buffer, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !29
  call void @free(ptr noundef %224) #6
  %225 = load ptr, ptr %20, align 8, !tbaa !5
  %226 = load i32, ptr %24, align 4, !tbaa !9
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds %struct._el_buffer, ptr %225, i64 %227
  %229 = getelementptr inbounds %struct._el_buffer, ptr %228, i32 0, i32 0
  store ptr null, ptr %229, align 8, !tbaa !29
  br label %230

230:                                              ; preds = %218
  %231 = load i32, ptr %24, align 4, !tbaa !9
  %232 = add nsw i32 %231, -1
  store i32 %232, ptr %24, align 4, !tbaa !9
  br label %215, !llvm.loop !34

233:                                              ; preds = %215
  %234 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %234) #6
  store ptr null, ptr %20, align 8, !tbaa !5
  store i32 1, ptr %26, align 4
  br label %242

235:                                              ; preds = %203
  %236 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %237 = load i64, ptr %236, align 8, !tbaa !23
  %238 = load i64, ptr %19, align 8, !tbaa !16
  %239 = add nsw i64 %238, %237
  store i64 %239, ptr %19, align 8, !tbaa !16
  %240 = load i64, ptr %21, align 8, !tbaa !16
  %241 = add nsw i64 %240, 1
  store i64 %241, ptr %21, align 8, !tbaa !16
  store i32 0, ptr %26, align 4
  br label %242

242:                                              ; preds = %235, %233, %196, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  %243 = load i32, ptr %26, align 4
  switch i32 %243, label %305 [
    i32 0, label %244
    i32 9, label %245
  ]

244:                                              ; preds = %242
  br label %245

245:                                              ; preds = %244, %242
  %246 = load i32, ptr %24, align 4, !tbaa !9
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %24, align 4, !tbaa !9
  br label %140, !llvm.loop !35

248:                                              ; preds = %140
  store i32 0, ptr %23, align 4, !tbaa !9
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %249

249:                                              ; preds = %279, %248
  %250 = load i32, ptr %24, align 4, !tbaa !9
  %251 = sext i32 %250 to i64
  %252 = load i64, ptr %21, align 8, !tbaa !16
  %253 = icmp slt i64 %251, %252
  br i1 %253, label %254, label %282

254:                                              ; preds = %249
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  %255 = load ptr, ptr %20, align 8, !tbaa !5
  %256 = load i32, ptr %24, align 4, !tbaa !9
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds %struct._el_buffer, ptr %255, i64 %257
  store ptr %258, ptr %31, align 8, !tbaa !5
  %259 = load i32, ptr %23, align 4, !tbaa !9
  %260 = icmp eq i32 %259, 0
  br i1 %260, label %261, label %273

261:                                              ; preds = %254
  %262 = load ptr, ptr %12, align 8, !tbaa !5
  %263 = load ptr, ptr %31, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct._el_buffer, ptr %263, i32 0, i32 0
  %265 = load ptr, ptr %264, align 8, !tbaa !29
  %266 = load ptr, ptr %31, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct._el_buffer, ptr %266, i32 0, i32 1
  %268 = load i64, ptr %267, align 8, !tbaa !31
  %269 = load ptr, ptr %13, align 8, !tbaa !5
  %270 = call i32 %262(ptr noundef %265, i64 noundef %268, ptr noundef %269)
  %271 = icmp slt i32 %270, 0
  br i1 %271, label %272, label %273

272:                                              ; preds = %261
  store i32 -1, ptr %23, align 4, !tbaa !9
  br label %273

273:                                              ; preds = %272, %261, %254
  %274 = load ptr, ptr %31, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct._el_buffer, ptr %274, i32 0, i32 0
  %276 = load ptr, ptr %275, align 8, !tbaa !29
  call void @free(ptr noundef %276) #6
  %277 = load ptr, ptr %31, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct._el_buffer, ptr %277, i32 0, i32 0
  store ptr null, ptr %278, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  br label %279

279:                                              ; preds = %273
  %280 = load i32, ptr %24, align 4, !tbaa !9
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %24, align 4, !tbaa !9
  br label %249, !llvm.loop !36

282:                                              ; preds = %249
  %283 = load ptr, ptr %20, align 8, !tbaa !5
  call void @free(ptr noundef %283) #6
  store ptr null, ptr %20, align 8, !tbaa !5
  %284 = load i32, ptr %23, align 4, !tbaa !9
  %285 = icmp ne i32 %284, 0
  br i1 %285, label %290, label %286

286:                                              ; preds = %282
  %287 = load i64, ptr %18, align 8, !tbaa !16
  %288 = load i64, ptr %19, align 8, !tbaa !16
  %289 = icmp ne i64 %287, %288
  br i1 %289, label %290, label %296

290:                                              ; preds = %286, %282
  %291 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %291, align 8, !tbaa !23
  %292 = load ptr, ptr %8, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %292, ptr %293, align 8, !tbaa !27
  %294 = load ptr, ptr %9, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %294, ptr %295, align 8, !tbaa !28
  br label %299

296:                                              ; preds = %286
  %297 = load i64, ptr %18, align 8, !tbaa !16
  %298 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 %297, ptr %298, align 8, !tbaa !23
  br label %299

299:                                              ; preds = %296, %290
  br label %300

300:                                              ; preds = %299
  %301 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr null, ptr %301, align 8, !tbaa !28
  %302 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr null, ptr %302, align 8, !tbaa !27
  store i32 1, ptr %26, align 4
  br label %305

303:                                              ; No predecessors!
  br label %304

304:                                              ; preds = %303
  store i32 0, ptr %26, align 4
  br label %305

305:                                              ; preds = %304, %300, %242, %133, %119, %99, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %306 = load i32, ptr %26, align 4
  switch i32 %306, label %308 [
    i32 0, label %307
    i32 1, label %307
  ]

307:                                              ; preds = %305, %305
  ret void

308:                                              ; preds = %305
  unreachable
}

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @_el_addbytes(ptr noundef, i64 noundef, ptr noundef) #2

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 allocsize(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 #5 = { nounwind "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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 136}
!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, !6, i64 24}
!14 = !{!"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}
!15 = !{!12, !6, i64 48}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!19, !10, i64 8}
!19 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!20 = !{!19, !6, i64 0}
!21 = !{!14, !10, i64 12}
!22 = !{i64 0, i64 8, !16, i64 8, i64 8, !5, i64 16, i64 8, !5}
!23 = !{!24, !17, i64 0}
!24 = !{!"asn_enc_rval_s", !17, i64 0, !6, i64 8, !6, i64 16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!24, !6, i64 8}
!28 = !{!24, !6, i64 16}
!29 = !{!30, !6, i64 0}
!30 = !{!"_el_buffer", !6, i64 0, !17, i64 8, !17, i64 16}
!31 = !{!30, !17, i64 8}
!32 = !{!30, !17, i64 16}
!33 = distinct !{!33, !26}
!34 = distinct !{!34, !26}
!35 = distinct !{!35, !26}
!36 = distinct !{!36, !26}


; 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._el_buffer = type { ptr, i64, i64 }

; 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 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: 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 @SET_OF_encode_ber(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 #2 {
  %8 = alloca %struct.asn_enc_rval_s, align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 136
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %12, i64 48
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %2, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !14
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %18 = getelementptr inbounds i8, ptr %10, i64 12
  br label %19

19:                                               ; preds = %.lr.ph, %30
  %20 = phi i32 [ %16, %.lr.ph ], [ %31, %30 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %30 ]
  %.0149 = phi i64 [ 0, %.lr.ph ], [ %.1.ph, %30 ]
  %.0104147 = phi i64 [ 1, %.lr.ph ], [ %.2106.ph, %30 ]
  %21 = load ptr, ptr %2, align 8, !tbaa !16
  %22 = getelementptr inbounds ptr, ptr %21, i64 %indvars.iv
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %.not121 = icmp eq ptr %23, null
  br i1 %.not121, label %30, label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %18, align 4, !tbaa !18
  tail call void %14(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %12, ptr noundef nonnull %23, i32 noundef 0, i32 noundef %25, ptr noundef null, ptr noundef null) #8
  %26 = load i64, ptr %0, align 8, !tbaa !19
  %27 = icmp eq i64 %26, -1
  br i1 %27, label %.thread129, label %28

28:                                               ; preds = %24
  %29 = add i64 %26, %.0149
  %spec.select = tail call i64 @llvm.umax.i64(i64 %.0104147, i64 %26)
  %.pre = load i32, ptr %15, align 8, !tbaa !14
  br label %30

30:                                               ; preds = %28, %19
  %31 = phi i32 [ %20, %19 ], [ %.pre, %28 ]
  %.2106.ph = phi i64 [ %.0104147, %19 ], [ %spec.select, %28 ]
  %.1.ph = phi i64 [ %.0149, %19 ], [ %29, %28 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %19, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %30, %7
  %.0104.lcssa = phi i64 [ 1, %7 ], [ %.2106.ph, %30 ]
  %.0.lcssa = phi i64 [ 0, %7 ], [ %.1.ph, %30 ]
  %34 = tail call i64 @der_write_tags(ptr noundef %1, i64 noundef %.0.lcssa, i32 noundef %3, i32 noundef 1, i32 noundef %4, ptr noundef %5, ptr noundef %6) #8
  %35 = icmp eq i64 %34, -1
  br i1 %35, label %36, label %39

36:                                               ; preds = %._crit_edge
  store i64 -1, ptr %0, align 8, !tbaa !19
  %37 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %37, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %38, align 8, !tbaa !25
  br label %.thread129

39:                                               ; preds = %._crit_edge
  %40 = add i64 %34, %.0.lcssa
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %44, label %41

41:                                               ; preds = %39
  %42 = load i32, ptr %15, align 8, !tbaa !14
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %41, %39
  store i64 %40, ptr %0, align 8, !tbaa !19
  %45 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %45, i8 0, i64 16, i1 false)
  br label %.thread129

46:                                               ; preds = %41
  %47 = sext i32 %42 to i64
  %48 = mul nsw i64 %47, 24
  %49 = tail call noalias ptr @malloc(i64 noundef %48) #9
  %50 = icmp eq ptr %49, null
  br i1 %50, label %53, label %.preheader137

.preheader137:                                    ; preds = %46
  %51 = icmp sgt i32 %42, 0
  br i1 %51, label %.lr.ph154, label %._crit_edge160

.lr.ph154:                                        ; preds = %.preheader137
  %52 = getelementptr inbounds i8, ptr %10, i64 12
  br label %57

53:                                               ; preds = %46
  store i64 -1, ptr %0, align 8, !tbaa !19
  %54 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %54, align 8, !tbaa !24
  %55 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %55, align 8, !tbaa !25
  br label %.thread129

.preheader136:                                    ; preds = %83
  %56 = icmp sgt i64 %.199, 0
  br i1 %56, label %.lr.ph159, label %._crit_edge160

57:                                               ; preds = %.lr.ph154, %83
  %58 = phi i32 [ %42, %.lr.ph154 ], [ %84, %83 ]
  %indvars.iv172 = phi i64 [ 0, %.lr.ph154 ], [ %indvars.iv.next173, %83 ]
  %.092153 = phi i64 [ %34, %.lr.ph154 ], [ %.193, %83 ]
  %.098152 = phi i64 [ 0, %.lr.ph154 ], [ %.199, %83 ]
  %59 = load ptr, ptr %2, align 8, !tbaa !16
  %60 = getelementptr inbounds ptr, ptr %59, i64 %indvars.iv172
  %61 = load ptr, ptr %60, align 8, !tbaa !17
  %62 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %.098152
  %.not119 = icmp eq ptr %61, null
  br i1 %.not119, label %83, label %63

63:                                               ; preds = %57
  %64 = call noalias ptr @malloc(i64 noundef %.0104.lcssa) #9
  store ptr %64, ptr %62, align 8, !tbaa !26
  %.not120 = icmp eq ptr %64, null
  br i1 %.not120, label %.preheader, label %65

.preheader:                                       ; preds = %63
  %.not168 = icmp eq i64 %indvars.iv172, 0
  br i1 %.not168, label %._crit_edge167, label %.lr.ph166

65:                                               ; preds = %63
  %66 = getelementptr inbounds i8, ptr %62, i64 8
  store i64 0, ptr %66, align 8, !tbaa !28
  %67 = getelementptr inbounds i8, ptr %62, i64 16
  store i64 %.0104.lcssa, ptr %67, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  %68 = load i32, ptr %52, align 4, !tbaa !18
  call void %14(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %8, ptr noundef %12, ptr noundef nonnull %61, i32 noundef 0, i32 noundef %68, ptr noundef nonnull @_el_addbytes, ptr noundef nonnull %62) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 24, i1 false), !tbaa.struct !30
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  %69 = load i64, ptr %0, align 8, !tbaa !19
  %70 = icmp eq i64 %69, -1
  br i1 %70, label %.lr.ph163, label %80

.lr.ph166:                                        ; preds = %.preheader, %.lr.ph166
  %indvars.iv182 = phi i64 [ %indvars.iv.next183, %.lr.ph166 ], [ %indvars.iv172, %.preheader ]
  %indvars.iv.next183 = add nsw i64 %indvars.iv182, -1
  %71 = and i64 %indvars.iv.next183, 4294967295
  %72 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !26
  call void @free(ptr noundef %73) #8
  store ptr null, ptr %72, align 8, !tbaa !26
  %74 = icmp sgt i64 %indvars.iv182, 1
  br i1 %74, label %.lr.ph166, label %._crit_edge167, !llvm.loop !32

._crit_edge167:                                   ; preds = %.lr.ph166, %.preheader
  call void @free(ptr noundef nonnull %49) #8
  store i64 -1, ptr %0, align 8, !tbaa !19
  %75 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %75, align 8, !tbaa !24
  %76 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %76, align 8, !tbaa !25
  br label %.thread129

.lr.ph163:                                        ; preds = %65, %.lr.ph163
  %indvars.iv177 = phi i64 [ %indvars.iv.next178, %.lr.ph163 ], [ %indvars.iv172, %65 ]
  %77 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %indvars.iv177
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  call void @free(ptr noundef %78) #8
  store ptr null, ptr %77, align 8, !tbaa !26
  %indvars.iv.next178 = add nsw i64 %indvars.iv177, -1
  %79 = icmp sgt i64 %indvars.iv177, 0
  br i1 %79, label %.lr.ph163, label %._crit_edge164, !llvm.loop !33

._crit_edge164:                                   ; preds = %.lr.ph163
  call void @free(ptr noundef nonnull %49) #8
  br label %.thread129

80:                                               ; preds = %65
  %81 = add nsw i64 %69, %.092153
  %82 = add nsw i64 %.098152, 1
  %.pre189 = load i32, ptr %15, align 8, !tbaa !14
  br label %83

83:                                               ; preds = %80, %57
  %84 = phi i32 [ %.pre189, %80 ], [ %58, %57 ]
  %.199 = phi i64 [ %82, %80 ], [ %.098152, %57 ]
  %.193 = phi i64 [ %81, %80 ], [ %.092153, %57 ]
  %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
  %85 = sext i32 %84 to i64
  %86 = icmp slt i64 %indvars.iv.next173, %85
  br i1 %86, label %57, label %.preheader136, !llvm.loop !34

.lr.ph159:                                        ; preds = %.preheader136, %93
  %indvars.iv185 = phi i64 [ %indvars.iv.next186, %93 ], [ 0, %.preheader136 ]
  %.0102157 = phi i32 [ %.1103, %93 ], [ 0, %.preheader136 ]
  %87 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %indvars.iv185
  %88 = icmp eq i32 %.0102157, 0
  %.pre191 = load ptr, ptr %87, align 8, !tbaa !26
  br i1 %88, label %89, label %93

89:                                               ; preds = %.lr.ph159
  %90 = getelementptr inbounds i8, ptr %87, i64 8
  %91 = load i64, ptr %90, align 8, !tbaa !28
  %92 = call i32 %5(ptr noundef %.pre191, i64 noundef %91, ptr noundef %6) #8
  %.lobit = ashr i32 %92, 31
  %.pre190 = load ptr, ptr %87, align 8, !tbaa !26
  br label %93

93:                                               ; preds = %89, %.lr.ph159
  %94 = phi ptr [ %.pre191, %.lr.ph159 ], [ %.pre190, %89 ]
  %.1103 = phi i32 [ -1, %.lr.ph159 ], [ %.lobit, %89 ]
  call void @free(ptr noundef %94) #8
  store ptr null, ptr %87, align 8, !tbaa !26
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next186, %.199
  br i1 %exitcond.not, label %._crit_edge160.loopexit, label %.lr.ph159, !llvm.loop !35

._crit_edge160.loopexit:                          ; preds = %93
  %95 = icmp eq i32 %.1103, 0
  br label %._crit_edge160

._crit_edge160:                                   ; preds = %.preheader137, %._crit_edge160.loopexit, %.preheader136
  %.092.lcssa194 = phi i64 [ %.193, %.preheader136 ], [ %.193, %._crit_edge160.loopexit ], [ %34, %.preheader137 ]
  %.0102.lcssa = phi i1 [ true, %.preheader136 ], [ %95, %._crit_edge160.loopexit ], [ true, %.preheader137 ]
  call void @free(ptr noundef nonnull %49) #8
  %.not118 = icmp eq i64 %40, %.092.lcssa194
  %or.cond = select i1 %.0102.lcssa, i1 %.not118, i1 false
  %spec.select197 = select i1 %or.cond, i64 %40, i64 -1
  store i64 %spec.select197, ptr %0, align 8
  %96 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %96, i8 0, i64 16, i1 false)
  br label %.thread129

.thread129:                                       ; preds = %24, %._crit_edge167, %._crit_edge164, %._crit_edge160, %53, %44, %36
  ret void
}

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden i32 @_el_addbytes(ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #6

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }

!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 136}
!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, !7, i64 24}
!12 = !{!"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}
!13 = !{!6, !7, i64 48}
!14 = !{!15, !10, i64 8}
!15 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16}
!16 = !{!15, !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!12, !10, i64 12}
!19 = !{!20, !21, i64 0}
!20 = !{!"asn_enc_rval_s", !21, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!"long", !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!20, !7, i64 8}
!25 = !{!20, !7, i64 16}
!26 = !{!27, !7, i64 0}
!27 = !{!"_el_buffer", !7, i64 0, !21, i64 8, !21, i64 16}
!28 = !{!27, !21, i64 8}
!29 = !{!27, !21, i64 16}
!30 = !{i64 0, i64 8, !31, i64 8, i64 8, !17, i64 16, i64 8, !17}
!31 = !{!21, !21, i64 0}
!32 = distinct !{!32, !23}
!33 = distinct !{!33, !23}
!34 = distinct !{!34, !23}
!35 = distinct !{!35, !23}


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