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

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

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

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

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

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

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

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

29:                                               ; preds = %7
  br label %30

30:                                               ; preds = %29
  %31 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %31, align 8, !tbaa !15
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %32, ptr %33, align 8, !tbaa !17
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %34, ptr %35, align 8, !tbaa !18
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 426, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %213

36:                                               ; No predecessors!
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37, %7
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.asn_CHOICE_specifics_s, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !19
  %43 = load ptr, ptr %14, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.asn_CHOICE_specifics_s, ptr %43, i32 0, i32 3
  %45 = load i32, ptr %44, align 4, !tbaa !21
  %46 = call i32 @_fetch_present_idx(ptr noundef %39, i32 noundef %42, i32 noundef %45)
  store i32 %46, ptr %19, align 4, !tbaa !9
  %47 = load i32, ptr %19, align 4, !tbaa !9
  %48 = icmp sle i32 %47, 0
  br i1 %48, label %55, label %49

49:                                               ; preds = %38
  %50 = load i32, ptr %19, align 4, !tbaa !9
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %51, i32 0, i32 18
  %53 = load i32, ptr %52, align 8, !tbaa !22
  %54 = icmp sgt i32 %50, %53
  br i1 %54, label %55, label %79

55:                                               ; preds = %49, %38
  %56 = load i32, ptr %19, align 4, !tbaa !9
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %70

58:                                               ; preds = %55
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %59, i32 0, i32 18
  %61 = load i32, ptr %60, align 8, !tbaa !22
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %70

63:                                               ; preds = %58
  %64 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  store i64 0, ptr %64, align 8, !tbaa !15
  br label %65

65:                                               ; preds = %63
  %66 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 2
  store ptr null, ptr %66, align 8, !tbaa !18
  %67 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 1
  store ptr null, ptr %67, align 8, !tbaa !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 1, ptr %20, align 4
  br label %213

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68
  br label %70

70:                                               ; preds = %69, %58, %55
  br label %71

71:                                               ; preds = %70
  %72 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %72, align 8, !tbaa !15
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %73, ptr %74, align 8, !tbaa !17
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %75, ptr %76, align 8, !tbaa !18
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 445, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %213

77:                                               ; No predecessors!
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78, %49
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %80, i32 0, i32 17
  %82 = load ptr, ptr %81, align 8, !tbaa !24
  %83 = load i32, ptr %19, align 4, !tbaa !9
  %84 = sub nsw i32 %83, 1
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %82, i64 %85
  store ptr %86, ptr %15, align 8, !tbaa !5
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !25
  %90 = and i32 %89, 1
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %124

92:                                               ; preds = %79
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %94, i32 0, i32 2
  %96 = load i32, ptr %95, align 8, !tbaa !27
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i8, ptr %93, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  store ptr %99, ptr %17, align 8, !tbaa !5
  %100 = load ptr, ptr %17, align 8, !tbaa !5
  %101 = icmp eq ptr %100, null
  br i1 %101, label %102, label %123

102:                                              ; preds = %92
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !28
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %114

107:                                              ; preds = %102
  %108 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  store i64 0, ptr %108, align 8, !tbaa !15
  br label %109

109:                                              ; preds = %107
  %110 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 2
  store ptr null, ptr %110, align 8, !tbaa !18
  %111 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 1
  store ptr null, ptr %111, align 8, !tbaa !17
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 1, ptr %20, align 4
  br label %213

112:                                              ; No predecessors!
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113, %102
  br label %115

115:                                              ; preds = %114
  %116 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %116, align 8, !tbaa !15
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %117, ptr %118, align 8, !tbaa !17
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %119, ptr %120, align 8, !tbaa !18
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 460, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %213

121:                                              ; No predecessors!
  br label %122

122:                                              ; preds = %121
  br label %123

123:                                              ; preds = %122, %92
  br label %131

124:                                              ; preds = %79
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 8, !tbaa !27
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %125, i64 %129
  store ptr %130, ptr %17, align 8, !tbaa !5
  br label %131

131:                                              ; preds = %124, %123
  %132 = load i32, ptr %10, align 4, !tbaa !9
  %133 = icmp eq i32 %132, 1
  br i1 %133, label %139, label %134

134:                                              ; preds = %131
  %135 = load ptr, ptr %8, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %135, i32 0, i32 13
  %137 = load i32, ptr %136, align 8, !tbaa !29
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %186

139:                                              ; preds = %134, %131
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #4
  %140 = load ptr, ptr %15, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %140, i32 0, i32 5
  %142 = load ptr, ptr %141, align 8, !tbaa !30
  %143 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %142, i32 0, i32 6
  %144 = load ptr, ptr %143, align 8, !tbaa !31
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %145, i32 0, i32 5
  %147 = load ptr, ptr %146, align 8, !tbaa !30
  %148 = load ptr, ptr %17, align 8, !tbaa !5
  %149 = load ptr, ptr %15, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %149, i32 0, i32 4
  %151 = load i32, ptr %150, align 8, !tbaa !32
  %152 = load ptr, ptr %15, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %152, i32 0, i32 3
  %154 = load i32, ptr %153, align 4, !tbaa !33
  call void %144(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %22, ptr noundef %147, ptr noundef %148, i32 noundef %151, i32 noundef %154, ptr noundef null, ptr noundef null)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %22, i64 24, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #4
  %155 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  %156 = load i64, ptr %155, align 8, !tbaa !15
  %157 = icmp eq i64 %156, -1
  br i1 %157, label %158, label %159

158:                                              ; preds = %139
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 1, ptr %20, align 4
  br label %183

159:                                              ; preds = %139
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  %162 = load i64, ptr %161, align 8, !tbaa !15
  %163 = load i32, ptr %10, align 4, !tbaa !9
  %164 = load i32, ptr %11, align 4, !tbaa !9
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = call i64 @der_write_tags(ptr noundef %160, i64 noundef %162, i32 noundef %163, i32 noundef 1, i32 noundef %164, ptr noundef %165, ptr noundef %166)
  store i64 %167, ptr %21, align 8, !tbaa !13
  %168 = load i64, ptr %21, align 8, !tbaa !13
  %169 = icmp eq i64 %168, -1
  br i1 %169, label %170, label %179

170:                                              ; preds = %159
  br label %171

171:                                              ; preds = %170
  %172 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %172, align 8, !tbaa !15
  %173 = load ptr, ptr %8, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %173, ptr %174, align 8, !tbaa !17
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %175, ptr %176, align 8, !tbaa !18
  call void @stacktrace_create(ptr noundef @.str, i64 noundef 488, i32 noundef 101, ptr noundef null)
  store i32 1, ptr %20, align 4
  br label %183

177:                                              ; No predecessors!
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178, %159
  %180 = load i64, ptr %21, align 8, !tbaa !13
  %181 = load i64, ptr %18, align 8, !tbaa !13
  %182 = add i64 %181, %180
  store i64 %182, ptr %18, align 8, !tbaa !13
  store i32 0, ptr %20, align 4
  br label %183

183:                                              ; preds = %179, %171, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  %184 = load i32, ptr %20, align 4
  switch i32 %184, label %213 [
    i32 0, label %185
  ]

185:                                              ; preds = %183
  br label %186

186:                                              ; preds = %185, %134
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #4
  %187 = load ptr, ptr %15, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %187, i32 0, i32 5
  %189 = load ptr, ptr %188, align 8, !tbaa !30
  %190 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %189, i32 0, i32 6
  %191 = load ptr, ptr %190, align 8, !tbaa !31
  %192 = load ptr, ptr %15, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %192, i32 0, i32 5
  %194 = load ptr, ptr %193, align 8, !tbaa !30
  %195 = load ptr, ptr %17, align 8, !tbaa !5
  %196 = load ptr, ptr %15, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %196, i32 0, i32 4
  %198 = load i32, ptr %197, align 8, !tbaa !32
  %199 = load ptr, ptr %15, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %199, i32 0, i32 3
  %201 = load i32, ptr %200, align 4, !tbaa !33
  %202 = load ptr, ptr %12, align 8, !tbaa !5
  %203 = load ptr, ptr %13, align 8, !tbaa !5
  call void %191(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %23, ptr noundef %194, ptr noundef %195, i32 noundef %198, i32 noundef %201, ptr noundef %202, ptr noundef %203)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %23, i64 24, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  %204 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  %205 = load i64, ptr %204, align 8, !tbaa !15
  %206 = icmp eq i64 %205, -1
  br i1 %206, label %207, label %208

207:                                              ; preds = %186
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 1, ptr %20, align 4
  br label %213

208:                                              ; preds = %186
  %209 = load i64, ptr %18, align 8, !tbaa !13
  %210 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %16, i32 0, i32 0
  %211 = load i64, ptr %210, align 8, !tbaa !15
  %212 = add i64 %211, %209
  store i64 %212, ptr %210, align 8, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %16, i64 24, i1 false), !tbaa.struct !23
  store i32 1, ptr %20, align 4
  br label %213

213:                                              ; preds = %208, %207, %183, %115, %109, %71, %65, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  ret void
}

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

declare i64 @der_write_tags(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, ptr 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 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CHOICE_encode_der(ptr dead_on_unwind noalias nocapture writable writeonly 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 = alloca %struct.asn_enc_rval_s, align 8
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %10, label %13

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

13:                                               ; preds = %7
  %14 = getelementptr inbounds i8, ptr %1, i64 152
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %15, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = tail call i32 @_fetch_present_idx(ptr noundef nonnull %2, i32 noundef %17, i32 noundef %19)
  %21 = icmp slt i32 %20, 1
  br i1 %21, label %26, label %22

22:                                               ; preds = %13
  %23 = getelementptr inbounds i8, ptr %1, i64 144
  %24 = load i32, ptr %23, align 8, !tbaa !19
  %25 = icmp sgt i32 %20, %24
  br i1 %25, label %.thread, label %35

26:                                               ; preds = %13
  %27 = icmp eq i32 %20, 0
  br i1 %27, label %28, label %.thread

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %1, i64 144
  %30 = load i32, ptr %29, align 8, !tbaa !19
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %.thread

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

.thread:                                          ; preds = %22, %26, %28
  store i64 -1, ptr %0, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %33, align 8, !tbaa !11
  %34 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %34, align 8, !tbaa !12
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 445, i32 noundef 101, ptr noundef null) #4
  br label %.thread93

35:                                               ; preds = %22
  %36 = getelementptr inbounds i8, ptr %1, i64 136
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  %38 = zext nneg i32 %20 to i64
  %39 = getelementptr %struct.asn_TYPE_member_s, ptr %37, i64 %38
  %40 = getelementptr i8, ptr %39, i64 -64
  %41 = load i32, ptr %40, align 8, !tbaa !21
  %42 = and i32 %41, 1
  %.not90 = icmp eq i32 %42, 0
  %43 = getelementptr i8, ptr %39, i64 -56
  %44 = load i32, ptr %43, align 8, !tbaa !23
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %2, i64 %45
  br i1 %.not90, label %57, label %47

47:                                               ; preds = %35
  %48 = load ptr, ptr %46, align 8, !tbaa !24
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %57

50:                                               ; preds = %47
  %51 = getelementptr i8, ptr %39, i64 -60
  %52 = load i32, ptr %51, align 4, !tbaa !25
  %.not92 = icmp eq i32 %52, 0
  br i1 %.not92, label %54, label %53

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

54:                                               ; preds = %50
  store i64 -1, ptr %0, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %1, ptr %55, align 8, !tbaa !11
  %56 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %56, align 8, !tbaa !12
  tail call void @stacktrace_create(ptr noundef nonnull @.str, i64 noundef 460, i32 noundef 101, ptr noundef null) #4
  br label %.thread93

57:                                               ; preds = %35, %47
  %.084 = phi ptr [ %48, %47 ], [ %46, %35 ]
  %58 = icmp eq i32 %3, 1
  br i1 %58, label %62, label %59

59:                                               ; preds = %57
  %60 = getelementptr inbounds i8, ptr %1, i64 104
  %61 = load i32, ptr %60, align 8, !tbaa !26
  %.not91 = icmp eq i32 %61, 0
  br i1 %.not91, label %80, label %62

62:                                               ; preds = %59, %57
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  %63 = getelementptr i8, ptr %39, i64 -40
  %64 = load ptr, ptr %63, align 8, !tbaa !27
  %65 = getelementptr inbounds i8, ptr %64, i64 48
  %66 = load ptr, ptr %65, align 8, !tbaa !28
  %67 = getelementptr i8, ptr %39, i64 -48
  %68 = load i32, ptr %67, align 8, !tbaa !29
  %69 = getelementptr i8, ptr %39, i64 -52
  %70 = load i32, ptr %69, align 4, !tbaa !30
  call void %66(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %8, ptr noundef %64, ptr noundef %.084, i32 noundef %68, i32 noundef %70, ptr noundef null, ptr noundef null) #4
  %.sroa.0.0.copyload15 = load i64, ptr %8, align 8, !tbaa !31
  %.sroa.16.0..sroa_idx22 = getelementptr inbounds i8, ptr %8, i64 8
  %71 = load <2 x ptr>, ptr %.sroa.16.0..sroa_idx22, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  %72 = icmp eq i64 %.sroa.0.0.copyload15, -1
  br i1 %72, label %73, label %74

73:                                               ; preds = %62
  store i64 -1, ptr %0, align 8, !tbaa !31
  %.sroa.16.0..sroa_idx24 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x ptr> %71, ptr %.sroa.16.0..sroa_idx24, align 8, !tbaa !24
  br label %.thread93

74:                                               ; preds = %62
  %75 = call i64 @der_write_tags(ptr noundef nonnull %1, i64 noundef %.sroa.0.0.copyload15, i32 noundef %3, i32 noundef 1, i32 noundef %4, ptr noundef %5, ptr noundef %6) #4
  %76 = icmp eq i64 %75, -1
  br i1 %76, label %77, label %80

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

80:                                               ; preds = %74, %59
  %.1 = phi i64 [ 0, %59 ], [ %75, %74 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  %81 = getelementptr i8, ptr %39, i64 -40
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  %83 = getelementptr inbounds i8, ptr %82, i64 48
  %84 = load ptr, ptr %83, align 8, !tbaa !28
  %85 = getelementptr i8, ptr %39, i64 -48
  %86 = load i32, ptr %85, align 8, !tbaa !29
  %87 = getelementptr i8, ptr %39, i64 -52
  %88 = load i32, ptr %87, align 4, !tbaa !30
  call void %84(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %9, ptr noundef %82, ptr noundef %.084, i32 noundef %86, i32 noundef %88, ptr noundef %5, ptr noundef %6) #4
  %.sroa.0.0.copyload17 = load i64, ptr %9, align 8, !tbaa !31
  %.sroa.16.0..sroa_idx26 = getelementptr inbounds i8, ptr %9, i64 8
  %.sroa.16.0.copyload27 = load ptr, ptr %.sroa.16.0..sroa_idx26, align 8, !tbaa !24
  %.sroa.18.0..sroa_idx38 = getelementptr inbounds i8, ptr %9, i64 16
  %.sroa.18.0.copyload39 = load ptr, ptr %.sroa.18.0..sroa_idx38, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  %89 = icmp eq i64 %.sroa.0.0.copyload17, -1
  br i1 %89, label %90, label %91

90:                                               ; preds = %80
  store i64 -1, ptr %0, align 8, !tbaa !31
  %.sroa.16.0..sroa_idx28 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %.sroa.16.0.copyload27, ptr %.sroa.16.0..sroa_idx28, align 8, !tbaa !24
  %.sroa.18.0..sroa_idx40 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %.sroa.18.0.copyload39, ptr %.sroa.18.0..sroa_idx40, align 8, !tbaa !24
  br label %.thread93

91:                                               ; preds = %80
  %92 = add i64 %.sroa.0.0.copyload17, %.1
  store i64 %92, ptr %0, align 8, !tbaa !31
  %.sroa.16.0..sroa_idx30 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %.sroa.16.0.copyload27, ptr %.sroa.16.0..sroa_idx30, align 8, !tbaa !24
  %.sroa.18.0..sroa_idx42 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %.sroa.18.0.copyload39, ptr %.sroa.18.0..sroa_idx42, align 8, !tbaa !24
  br label %.thread93

.thread93:                                        ; preds = %77, %73, %91, %90, %54, %53, %.thread, %32, %10
  ret void
}

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

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

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

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

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

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


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