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

; 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_INTEGER_enum_map_s = type { i64, i64, 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_per_constraints_s = type { %struct.asn_per_constraint_s, %struct.asn_per_constraint_s, ptr, ptr }
%struct.asn_per_constraint_s = type { i32, i32, i32, i64, i64 }
%struct.asn_INTEGER_specifics_s = type { ptr, ptr, i32, i32, i32, i32, i32 }

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

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

25:                                               ; preds = %5
  br label %26

26:                                               ; preds = %25
  %27 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %27, align 8, !tbaa !13
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %28, ptr %29, align 8, !tbaa !16
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %30, ptr %31, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 212, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33, %5
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %46, label %37

37:                                               ; preds = %34
  br label %38

38:                                               ; preds = %37
  %39 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %39, align 8, !tbaa !13
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %40, ptr %41, align 8, !tbaa !16
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %42, ptr %43, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 215, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45, %34
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.asn_per_constraints_s, ptr %50, i32 0, i32 0
  store ptr %51, ptr %14, align 8, !tbaa !5
  br label %72

52:                                               ; preds = %46
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %53, i32 0, i32 16
  %55 = load ptr, ptr %54, align 8, !tbaa !18
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %62

57:                                               ; preds = %52
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %58, i32 0, i32 16
  %60 = load ptr, ptr %59, align 8, !tbaa !18
  %61 = getelementptr inbounds %struct.asn_per_constraints_s, ptr %60, i32 0, i32 0
  store ptr %61, ptr %14, align 8, !tbaa !5
  br label %71

62:                                               ; preds = %52
  br label %63

63:                                               ; preds = %62
  %64 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %64, align 8, !tbaa !13
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %65, ptr %66, align 8, !tbaa !16
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %67, ptr %68, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 223, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

69:                                               ; No predecessors!
  br label %70

70:                                               ; preds = %69
  br label %71

71:                                               ; preds = %70, %57
  br label %72

72:                                               ; preds = %71, %49
  %73 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %11, i32 0, i32 0
  store i64 0, ptr %73, align 8, !tbaa !13
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = load i64, ptr %74, align 8, !tbaa !19
  store i64 %75, ptr %12, align 8, !tbaa !19
  %76 = load i64, ptr %12, align 8, !tbaa !19
  %77 = icmp slt i64 %76, 0
  br i1 %77, label %78, label %87

78:                                               ; preds = %72
  br label %79

79:                                               ; preds = %78
  %80 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %80, align 8, !tbaa !13
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %81, ptr %82, align 8, !tbaa !16
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %83, ptr %84, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 232, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

85:                                               ; No predecessors!
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86, %72
  %88 = load i64, ptr %12, align 8, !tbaa !19
  %89 = getelementptr inbounds %struct.asn_INTEGER_enum_map_s, ptr %16, i32 0, i32 0
  store i64 %88, ptr %89, align 8, !tbaa !20
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %90, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !22
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %93, i32 0, i32 2
  %95 = load i32, ptr %94, align 8, !tbaa !24
  %96 = sext i32 %95 to i64
  %97 = call ptr @bsearch(ptr noundef %16, ptr noundef %92, i64 noundef %96, i64 noundef 24, ptr noundef @NativeEnumerated__compar_value2enum)
  store ptr %97, ptr %17, align 8, !tbaa !5
  %98 = load ptr, ptr %17, align 8, !tbaa !5
  %99 = icmp ne ptr %98, null
  br i1 %99, label %109, label %100

100:                                              ; preds = %87
  br label %101

101:                                              ; preds = %100
  %102 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %102, align 8, !tbaa !13
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %103, ptr %104, align 8, !tbaa !16
  %105 = load ptr, ptr %8, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %105, ptr %106, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 240, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

107:                                              ; No predecessors!
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108, %87
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  %111 = load ptr, ptr %10, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !22
  %114 = ptrtoint ptr %110 to i64
  %115 = ptrtoint ptr %113 to i64
  %116 = sub i64 %114, %115
  %117 = sdiv exact i64 %116, 24
  store i64 %117, ptr %13, align 8, !tbaa !19
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.asn_per_constraint_s, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !25
  %121 = icmp sge i32 %120, 0
  br i1 %121, label %122, label %144

122:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %123, i32 0, i32 3
  %125 = load i32, ptr %124, align 4, !tbaa !27
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %132

127:                                              ; preds = %122
  %128 = load ptr, ptr %10, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %128, i32 0, i32 3
  %130 = load i32, ptr %129, align 4, !tbaa !27
  %131 = sub nsw i32 %130, 1
  br label %136

132:                                              ; preds = %122
  %133 = load ptr, ptr %10, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 8, !tbaa !24
  br label %136

136:                                              ; preds = %132, %127
  %137 = phi i32 [ %131, %127 ], [ %135, %132 ]
  store i32 %137, ptr %19, align 4, !tbaa !12
  %138 = load i64, ptr %13, align 8, !tbaa !19
  %139 = load i32, ptr %19, align 4, !tbaa !12
  %140 = sext i32 %139 to i64
  %141 = icmp sge i64 %138, %140
  br i1 %141, label %142, label %143

142:                                              ; preds = %136
  store i32 1, ptr %15, align 4, !tbaa !12
  br label %143

143:                                              ; preds = %142, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %144

144:                                              ; preds = %143, %109
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.asn_per_constraint_s, ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 8, !tbaa !28
  %148 = and i32 %147, 4
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %169

150:                                              ; preds = %144
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = load i32, ptr %15, align 4, !tbaa !12
  %153 = call i32 @per_put_few_bits(ptr noundef %151, i32 noundef %152, i32 noundef 1)
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %164

155:                                              ; preds = %150
  br label %156

156:                                              ; preds = %155
  %157 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %157, align 8, !tbaa !13
  %158 = load ptr, ptr %6, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %158, ptr %159, align 8, !tbaa !16
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %160, ptr %161, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 253, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

162:                                              ; No predecessors!
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163, %150
  %165 = load i32, ptr %15, align 4, !tbaa !12
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %168

167:                                              ; preds = %164
  store ptr null, ptr %14, align 8, !tbaa !5
  br label %168

168:                                              ; preds = %167, %164
  br label %182

169:                                              ; preds = %144
  %170 = load i32, ptr %15, align 4, !tbaa !12
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %181

172:                                              ; preds = %169
  br label %173

173:                                              ; preds = %172
  %174 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %174, align 8, !tbaa !13
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %175, ptr %176, align 8, !tbaa !16
  %177 = load ptr, ptr %8, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %177, ptr %178, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 259, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

179:                                              ; No predecessors!
  br label %180

180:                                              ; preds = %179
  br label %181

181:                                              ; preds = %180, %169
  br label %182

182:                                              ; preds = %181, %168
  %183 = load ptr, ptr %14, align 8, !tbaa !5
  %184 = icmp ne ptr %183, null
  br i1 %184, label %185, label %214

185:                                              ; preds = %182
  %186 = load ptr, ptr %14, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.asn_per_constraint_s, ptr %186, i32 0, i32 1
  %188 = load i32, ptr %187, align 4, !tbaa !25
  %189 = icmp sge i32 %188, 0
  br i1 %189, label %190, label %214

190:                                              ; preds = %185
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = load i64, ptr %13, align 8, !tbaa !19
  %193 = trunc i64 %192 to i32
  %194 = load ptr, ptr %14, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.asn_per_constraint_s, ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !25
  %197 = call i32 @per_put_few_bits(ptr noundef %191, i32 noundef %193, i32 noundef %196)
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %199, label %208

199:                                              ; preds = %190
  br label %200

200:                                              ; preds = %199
  %201 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %201, align 8, !tbaa !13
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %202, ptr %203, align 8, !tbaa !16
  %204 = load ptr, ptr %8, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %204, ptr %205, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 264, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

206:                                              ; No predecessors!
  br label %207

207:                                              ; preds = %206
  br label %208

208:                                              ; preds = %207, %190
  br label %209

209:                                              ; preds = %208
  %210 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %11, i32 0, i32 2
  store ptr null, ptr %210, align 8, !tbaa !17
  %211 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %11, i32 0, i32 1
  store ptr null, ptr %211, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !29
  store i32 1, ptr %18, align 4
  br label %261

212:                                              ; No predecessors!
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213, %185, %182
  %215 = load ptr, ptr %10, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %215, i32 0, i32 3
  %217 = load i32, ptr %216, align 4, !tbaa !27
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %228, label %219

219:                                              ; preds = %214
  br label %220

220:                                              ; preds = %219
  %221 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %221, align 8, !tbaa !13
  %222 = load ptr, ptr %6, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %222, ptr %223, align 8, !tbaa !16
  %224 = load ptr, ptr %8, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %224, ptr %225, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 270, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

226:                                              ; No predecessors!
  br label %227

227:                                              ; preds = %226
  br label %228

228:                                              ; preds = %227, %214
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = load i64, ptr %13, align 8, !tbaa !19
  %231 = load i32, ptr %15, align 4, !tbaa !12
  %232 = icmp ne i32 %231, 0
  br i1 %232, label %233, label %238

233:                                              ; preds = %228
  %234 = load ptr, ptr %10, align 8, !tbaa !5
  %235 = getelementptr inbounds %struct.asn_INTEGER_specifics_s, ptr %234, i32 0, i32 3
  %236 = load i32, ptr %235, align 4, !tbaa !27
  %237 = sub nsw i32 %236, 1
  br label %239

238:                                              ; preds = %228
  br label %239

239:                                              ; preds = %238, %233
  %240 = phi i32 [ %237, %233 ], [ 0, %238 ]
  %241 = sext i32 %240 to i64
  %242 = sub nsw i64 %230, %241
  %243 = trunc i64 %242 to i32
  %244 = call i32 @uper_put_nsnnwn(ptr noundef %229, i32 noundef %243)
  %245 = icmp ne i32 %244, 0
  br i1 %245, label %246, label %255

246:                                              ; preds = %239
  br label %247

247:                                              ; preds = %246
  %248 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %248, align 8, !tbaa !13
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %249, ptr %250, align 8, !tbaa !16
  %251 = load ptr, ptr %8, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %251, ptr %252, align 8, !tbaa !17
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 280, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %18, align 4
  br label %261

253:                                              ; No predecessors!
  br label %254

254:                                              ; preds = %253
  br label %255

255:                                              ; preds = %254, %239
  br label %256

256:                                              ; preds = %255
  %257 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %11, i32 0, i32 2
  store ptr null, ptr %257, align 8, !tbaa !17
  %258 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %11, i32 0, i32 1
  store ptr null, ptr %258, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %11, i64 24, i1 false), !tbaa.struct !29
  store i32 1, ptr %18, align 4
  br label %261

259:                                              ; No predecessors!
  br label %260

260:                                              ; preds = %259
  store i32 0, ptr %18, align 4
  br label %261

261:                                              ; preds = %260, %256, %247, %220, %209, %200, %173, %156, %101, %79, %63, %38, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %262 = load i32, ptr %18, align 4
  switch i32 %262, label %264 [
    i32 0, label %263
    i32 1, label %263
  ]

263:                                              ; preds = %261, %261
  ret void

264:                                              ; preds = %261
  unreachable
}

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

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare ptr @bsearch(ptr noundef nonnull, ptr noundef nonnull, i64 noundef, i64 noundef, ptr noundef nonnull) #4

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

declare i32 @per_put_few_bits(ptr noundef, i32 noundef, i32 noundef) #2

declare i32 @uper_put_nsnnwn(ptr noundef, i32 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #5 = { 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, !6, i64 152}
!10 = !{!"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, !11, i64 104, !6, i64 112, !11, i64 120, !6, i64 128, !6, i64 136, !11, i64 144, !6, i64 152}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"asn_enc_rval_s", !15, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !6, i64 8}
!17 = !{!14, !6, i64 16}
!18 = !{!10, !6, i64 128}
!19 = !{!15, !15, i64 0}
!20 = !{!21, !15, i64 0}
!21 = !{!"asn_INTEGER_enum_map_s", !15, i64 0, !15, i64 8, !6, i64 16}
!22 = !{!23, !6, i64 0}
!23 = !{!"asn_INTEGER_specifics_s", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!24 = !{!23, !11, i64 16}
!25 = !{!26, !11, i64 4}
!26 = !{!"asn_per_constraint_s", !11, i64 0, !11, i64 4, !11, i64 8, !15, i64 16, !15, i64 24}
!27 = !{!23, !11, i64 20}
!28 = !{!26, !11, i64 0}
!29 = !{i64 0, i64 8, !19, i64 8, i64 8, !5, i64 16, i64 8, !5}


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

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

; Function Attrs: nounwind uwtable
define dso_local void @NativeEnumerated_encode_uper(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %1, ptr noundef readonly %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca %struct.asn_INTEGER_enum_map_s, align 8
  %7 = getelementptr inbounds i8, ptr %1, i64 152
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %9, label %12

9:                                                ; preds = %5
  store i64 -1, ptr %0, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %10, align 8, !tbaa !14
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr null, ptr %11, align 8, !tbaa !15
  tail call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 212, i32 noundef 101, ptr noundef null) #5
  br label %98

12:                                               ; preds = %5
  %.not72 = icmp eq ptr %8, null
  br i1 %.not72, label %13, label %16

13:                                               ; preds = %12
  store i64 -1, ptr %0, align 8, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %14, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %15, align 8, !tbaa !15
  tail call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 215, i32 noundef 101, ptr noundef null) #5
  br label %98

16:                                               ; preds = %12
  %.not73 = icmp eq ptr %2, null
  br i1 %.not73, label %17, label %23

17:                                               ; preds = %16
  %18 = getelementptr inbounds i8, ptr %1, i64 128
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %.not74 = icmp eq ptr %19, null
  br i1 %.not74, label %20, label %23

20:                                               ; preds = %17
  store i64 -1, ptr %0, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %21, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %22, align 8, !tbaa !15
  tail call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 223, i32 noundef 101, ptr noundef null) #5
  br label %98

23:                                               ; preds = %17, %16
  %.060 = phi ptr [ %2, %16 ], [ %19, %17 ]
  %24 = load i64, ptr %3, align 8, !tbaa !17
  %25 = icmp slt i64 %24, 0
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  store i64 -1, ptr %0, align 8, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %27, align 8, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %28, align 8, !tbaa !15
  tail call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 232, i32 noundef 101, ptr noundef null) #5
  br label %98

29:                                               ; preds = %23
  store i64 %24, ptr %6, align 8, !tbaa !18
  %30 = load ptr, ptr %8, align 8, !tbaa !20
  %31 = getelementptr inbounds i8, ptr %8, i64 16
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = sext i32 %32 to i64
  %34 = call ptr @bsearch(ptr noundef %6, ptr noundef %30, i64 noundef %33, i64 noundef 24, ptr noundef @NativeEnumerated__compar_value2enum)
  %.not75 = icmp eq ptr %34, null
  br i1 %.not75, label %35, label %38

35:                                               ; preds = %29
  store i64 -1, ptr %0, align 8, !tbaa !11
  %36 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %36, align 8, !tbaa !14
  %37 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %37, align 8, !tbaa !15
  call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 240, i32 noundef 101, ptr noundef null) #5
  br label %98

38:                                               ; preds = %29
  %39 = load ptr, ptr %8, align 8, !tbaa !20
  %40 = ptrtoint ptr %34 to i64
  %41 = ptrtoint ptr %39 to i64
  %42 = sub i64 %40, %41
  %43 = sdiv exact i64 %42, 24
  %44 = getelementptr inbounds i8, ptr %.060, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !23
  %46 = icmp sgt i32 %45, -1
  br i1 %46, label %47, label %.thread

47:                                               ; preds = %38
  %48 = getelementptr inbounds i8, ptr %8, i64 20
  %49 = load i32, ptr %48, align 4, !tbaa !25
  %.not76 = icmp eq i32 %49, 0
  br i1 %.not76, label %52, label %50

50:                                               ; preds = %47
  %51 = add nsw i32 %49, -1
  br label %54

52:                                               ; preds = %47
  %53 = load i32, ptr %31, align 8, !tbaa !22
  br label %54

54:                                               ; preds = %50, %52
  %55 = phi i32 [ %51, %50 ], [ %53, %52 ]
  %56 = sext i32 %55 to i64
  %.not77 = icmp sge i64 %43, %56
  %57 = load i32, ptr %.060, align 8, !tbaa !26
  %58 = and i32 %57, 4
  %.not78 = icmp eq i32 %58, 0
  br i1 %.not78, label %68, label %61

.thread:                                          ; preds = %38
  %59 = load i32, ptr %.060, align 8, !tbaa !26
  %60 = and i32 %59, 4
  %.not7889 = icmp eq i32 %60, 0
  br i1 %.not7889, label %.thread93, label %.thread103

61:                                               ; preds = %54
  %spec.select = zext i1 %.not77 to i32
  %62 = call i32 @per_put_few_bits(ptr noundef %4, i32 noundef %spec.select, i32 noundef 1) #5
  %.not80 = icmp eq i32 %62, 0
  br i1 %.not80, label %67, label %64

.thread103:                                       ; preds = %.thread
  %63 = call i32 @per_put_few_bits(ptr noundef %4, i32 noundef 0, i32 noundef 1) #5
  %.not80105 = icmp eq i32 %63, 0
  br i1 %.not80105, label %.thread93, label %64

64:                                               ; preds = %.thread103, %61
  store i64 -1, ptr %0, align 8, !tbaa !11
  %65 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %65, align 8, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %66, align 8, !tbaa !15
  call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 253, i32 noundef 101, ptr noundef null) #5
  br label %98

67:                                               ; preds = %61
  br i1 %.not77, label %81, label %.thread93

68:                                               ; preds = %54
  br i1 %.not77, label %69, label %.thread93

69:                                               ; preds = %68
  store i64 -1, ptr %0, align 8, !tbaa !11
  %70 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %70, align 8, !tbaa !14
  %71 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %71, align 8, !tbaa !15
  call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 259, i32 noundef 101, ptr noundef null) #5
  br label %98

.thread93:                                        ; preds = %.thread103, %67, %.thread, %68
  %72 = load i32, ptr %44, align 4, !tbaa !23
  %73 = icmp sgt i32 %72, -1
  br i1 %73, label %74, label %81

74:                                               ; preds = %.thread93
  %75 = trunc i64 %43 to i32
  %76 = call i32 @per_put_few_bits(ptr noundef %4, i32 noundef %75, i32 noundef %72) #5
  %.not86 = icmp eq i32 %76, 0
  br i1 %.not86, label %80, label %77

77:                                               ; preds = %74
  store i64 -1, ptr %0, align 8, !tbaa !11
  %78 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %78, align 8, !tbaa !14
  %79 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %79, align 8, !tbaa !15
  call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 264, i32 noundef 101, ptr noundef null) #5
  br label %98

80:                                               ; preds = %74
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 0, i64 24, i1 false)
  br label %98

81:                                               ; preds = %67, %.thread93
  %.not84 = phi i1 [ true, %.thread93 ], [ false, %67 ]
  %82 = getelementptr inbounds i8, ptr %8, i64 20
  %83 = load i32, ptr %82, align 4, !tbaa !25
  %.not83 = icmp eq i32 %83, 0
  br i1 %.not83, label %84, label %87

84:                                               ; preds = %81
  store i64 -1, ptr %0, align 8, !tbaa !11
  %85 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %85, align 8, !tbaa !14
  %86 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %86, align 8, !tbaa !15
  call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 270, i32 noundef 101, ptr noundef null) #5
  br label %98

87:                                               ; preds = %81
  %88 = add nsw i32 %83, -1
  %89 = zext i32 %88 to i64
  %90 = select i1 %.not84, i64 0, i64 %89
  %91 = sub nsw i64 %43, %90
  %92 = trunc i64 %91 to i32
  %93 = call i32 @uper_put_nsnnwn(ptr noundef %4, i32 noundef %92) #5
  %.not85 = icmp eq i32 %93, 0
  br i1 %.not85, label %97, label %94

94:                                               ; preds = %87
  store i64 -1, ptr %0, align 8, !tbaa !11
  %95 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %95, align 8, !tbaa !14
  %96 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %3, ptr %96, align 8, !tbaa !15
  call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 280, i32 noundef 101, ptr noundef null) #5
  br label %98

97:                                               ; preds = %87
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 0, i64 24, i1 false)
  br label %98

98:                                               ; preds = %97, %94, %84, %80, %77, %69, %64, %35, %26, %20, %13, %9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  ret void
}

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare ptr @bsearch(ptr noundef nonnull, ptr noundef nonnull, i64 noundef, i64 noundef, ptr noundef nonnull) local_unnamed_addr #3

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

declare i32 @per_put_few_bits(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @uper_put_nsnnwn(ptr noundef, i32 noundef) local_unnamed_addr #2

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync 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 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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, !13, i64 0}
!12 = !{!"asn_enc_rval_s", !13, i64 0, !7, i64 8, !7, i64 16}
!13 = !{!"long", !8, i64 0}
!14 = !{!12, !7, i64 8}
!15 = !{!12, !7, i64 16}
!16 = !{!6, !7, i64 128}
!17 = !{!13, !13, i64 0}
!18 = !{!19, !13, i64 0}
!19 = !{!"asn_INTEGER_enum_map_s", !13, i64 0, !13, i64 8, !7, i64 16}
!20 = !{!21, !7, i64 0}
!21 = !{!"asn_INTEGER_specifics_s", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!22 = !{!21, !10, i64 16}
!23 = !{!24, !10, i64 4}
!24 = !{!"asn_per_constraint_s", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 16, !13, i64 24}
!25 = !{!21, !10, i64 20}
!26 = !{!24, !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass