; 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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @SET_OF_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) #5 {
  %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 %307 [
    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 %307

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 %307

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 %307

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 %307 [
    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
  %249 = load ptr, ptr %20, align 8, !tbaa !5
  %250 = load i64, ptr %21, align 8, !tbaa !16
  call void @qsort(ptr noundef %249, i64 noundef %250, i64 noundef 24, ptr noundef @_el_buf_cmp)
  store i32 0, ptr %23, align 4, !tbaa !9
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %251

251:                                              ; preds = %281, %248
  %252 = load i32, ptr %24, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = load i64, ptr %21, align 8, !tbaa !16
  %255 = icmp slt i64 %253, %254
  br i1 %255, label %256, label %284

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

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

274:                                              ; preds = %263
  store i32 -1, ptr %23, align 4, !tbaa !9
  br label %275

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

281:                                              ; preds = %275
  %282 = load i32, ptr %24, align 4, !tbaa !9
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %24, align 4, !tbaa !9
  br label %251, !llvm.loop !36

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

288:                                              ; preds = %284
  %289 = load i64, ptr %18, align 8, !tbaa !16
  %290 = load i64, ptr %19, align 8, !tbaa !16
  %291 = icmp ne i64 %289, %290
  br i1 %291, label %292, label %298

292:                                              ; preds = %288, %284
  %293 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %293, align 8, !tbaa !23
  %294 = load ptr, ptr %8, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %294, ptr %295, align 8, !tbaa !27
  %296 = load ptr, ptr %9, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %296, ptr %297, align 8, !tbaa !28
  br label %301

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

301:                                              ; preds = %298, %292
  br label %302

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

305:                                              ; No predecessors!
  br label %306

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

307:                                              ; preds = %306, %302, %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
  %308 = load i32, ptr %26, align 4
  switch i32 %308, label %310 [
    i32 0, label %309
    i32 1, label %309
  ]

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

310:                                              ; preds = %307
  unreachable
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @_el_buf_cmp(ptr noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @SET_OF_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 #5 {
  %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 ]
  %.0150 = phi i64 [ 0, %.lr.ph ], [ %.1.ph, %30 ]
  %.0106148 = phi i64 [ 1, %.lr.ph ], [ %.2108.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
  %.not123 = icmp eq ptr %23, null
  br i1 %.not123, 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) #9
  %26 = load i64, ptr %0, align 8, !tbaa !19
  %27 = icmp eq i64 %26, -1
  br i1 %27, label %.thread131, label %28

28:                                               ; preds = %24
  %29 = add i64 %26, %.0150
  %spec.select = tail call i64 @llvm.umax.i64(i64 %.0106148, 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 ]
  %.2108.ph = phi i64 [ %.0106148, %19 ], [ %spec.select, %28 ]
  %.1.ph = phi i64 [ %.0150, %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
  %.0106.lcssa = phi i64 [ 1, %7 ], [ %.2108.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) #9
  %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 %.thread131

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 %.thread131

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

.preheader138:                                    ; preds = %46
  %51 = icmp sgt i32 %42, 0
  br i1 %51, label %.lr.ph155, label %._crit_edge156.thread

._crit_edge156.thread:                            ; preds = %.preheader138
  tail call void @qsort(ptr noundef nonnull %49, i64 noundef 0, i64 noundef 24, ptr noundef nonnull @_el_buf_cmp) #9
  br label %._crit_edge163

.lr.ph155:                                        ; preds = %.preheader138
  %52 = getelementptr inbounds i8, ptr %10, i64 12
  br label %56

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 %.thread131

56:                                               ; preds = %.lr.ph155, %82
  %57 = phi i32 [ %42, %.lr.ph155 ], [ %83, %82 ]
  %indvars.iv175 = phi i64 [ 0, %.lr.ph155 ], [ %indvars.iv.next176, %82 ]
  %.094154 = phi i64 [ %34, %.lr.ph155 ], [ %.195, %82 ]
  %.0100153 = phi i64 [ 0, %.lr.ph155 ], [ %.1101, %82 ]
  %58 = load ptr, ptr %2, align 8, !tbaa !16
  %59 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv175
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %.0100153
  %.not121 = icmp eq ptr %60, null
  br i1 %.not121, label %82, label %62

62:                                               ; preds = %56
  %63 = call noalias ptr @malloc(i64 noundef %.0106.lcssa) #10
  store ptr %63, ptr %61, align 8, !tbaa !26
  %.not122 = icmp eq ptr %63, null
  br i1 %.not122, label %.preheader, label %64

.preheader:                                       ; preds = %62
  %.not171 = icmp eq i64 %indvars.iv175, 0
  br i1 %.not171, label %._crit_edge170, label %.lr.ph169

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %61, i64 8
  store i64 0, ptr %65, align 8, !tbaa !28
  %66 = getelementptr inbounds i8, ptr %61, i64 16
  store i64 %.0106.lcssa, ptr %66, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #9
  %67 = 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 %60, i32 noundef 0, i32 noundef %67, ptr noundef nonnull @_el_addbytes, ptr noundef nonnull %61) #9
  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) #9
  %68 = load i64, ptr %0, align 8, !tbaa !19
  %69 = icmp eq i64 %68, -1
  br i1 %69, label %.lr.ph166, label %79

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

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

.lr.ph166:                                        ; preds = %64, %.lr.ph166
  %indvars.iv180 = phi i64 [ %indvars.iv.next181, %.lr.ph166 ], [ %indvars.iv175, %64 ]
  %76 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %indvars.iv180
  %77 = load ptr, ptr %76, align 8, !tbaa !26
  call void @free(ptr noundef %77) #9
  store ptr null, ptr %76, align 8, !tbaa !26
  %indvars.iv.next181 = add nsw i64 %indvars.iv180, -1
  %78 = icmp sgt i64 %indvars.iv180, 0
  br i1 %78, label %.lr.ph166, label %._crit_edge167, !llvm.loop !33

._crit_edge167:                                   ; preds = %.lr.ph166
  call void @free(ptr noundef nonnull %49) #9
  br label %.thread131

79:                                               ; preds = %64
  %80 = add nsw i64 %68, %.094154
  %81 = add nsw i64 %.0100153, 1
  %.pre192 = load i32, ptr %15, align 8, !tbaa !14
  br label %82

82:                                               ; preds = %79, %56
  %83 = phi i32 [ %.pre192, %79 ], [ %57, %56 ]
  %.1101 = phi i64 [ %81, %79 ], [ %.0100153, %56 ]
  %.195 = phi i64 [ %80, %79 ], [ %.094154, %56 ]
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %84 = sext i32 %83 to i64
  %85 = icmp slt i64 %indvars.iv.next176, %84
  br i1 %85, label %56, label %._crit_edge156, !llvm.loop !34

._crit_edge156:                                   ; preds = %82
  call void @qsort(ptr noundef nonnull %49, i64 noundef %.1101, i64 noundef 24, ptr noundef nonnull @_el_buf_cmp) #9
  %86 = icmp sgt i64 %.1101, 0
  br i1 %86, label %.lr.ph162, label %._crit_edge163

.lr.ph162:                                        ; preds = %._crit_edge156, %94
  %indvars.iv188 = phi i64 [ %indvars.iv.next189, %94 ], [ 0, %._crit_edge156 ]
  %.0104159 = phi i32 [ %.1105, %94 ], [ 0, %._crit_edge156 ]
  %87 = getelementptr inbounds %struct._el_buffer, ptr %49, i64 %indvars.iv188
  %88 = icmp eq i32 %.0104159, 0
  br i1 %88, label %89, label %94

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

94:                                               ; preds = %89, %.lr.ph162
  %.1105 = phi i32 [ -1, %.lr.ph162 ], [ %.lobit, %89 ]
  %95 = load ptr, ptr %87, align 8, !tbaa !26
  call void @free(ptr noundef %95) #9
  store ptr null, ptr %87, align 8, !tbaa !26
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next189, %.1101
  br i1 %exitcond.not, label %._crit_edge163.loopexit, label %.lr.ph162, !llvm.loop !35

._crit_edge163.loopexit:                          ; preds = %94
  %96 = icmp eq i32 %.1105, 0
  br label %._crit_edge163

._crit_edge163:                                   ; preds = %._crit_edge156.thread, %._crit_edge163.loopexit, %._crit_edge156
  %.094.lcssa195 = phi i64 [ %.195, %._crit_edge156 ], [ %.195, %._crit_edge163.loopexit ], [ %34, %._crit_edge156.thread ]
  %.0104.lcssa = phi i1 [ true, %._crit_edge156 ], [ %96, %._crit_edge163.loopexit ], [ true, %._crit_edge156.thread ]
  call void @free(ptr noundef nonnull %49) #9
  %.not120 = icmp eq i64 %40, %.094.lcssa195
  %or.cond = select i1 %.0104.lcssa, i1 %.not120, i1 false
  %spec.select198 = select i1 %or.cond, i64 %40, i64 -1
  store i64 %spec.select198, ptr %0, align 8
  %97 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %97, i8 0, i64 16, i1 false)
  br label %.thread131

.thread131:                                       ; preds = %24, %._crit_edge170, %._crit_edge167, %._crit_edge163, %53, %44, %36
  ret void
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @_el_buf_cmp(ptr noundef, ptr noundef) #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { 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