; LLVM IR from specinfo-ua/UAPKI :: library/uapkif/src/asn1 (constr_SEQUENCE_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_anonymous_sequence_ = type { ptr, i32, i32, ptr }
%struct.asn_TYPE_member_s = type { i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @SEQUENCE_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) #0 {
  %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 i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %struct.asn_enc_rval_s, align 8
  %22 = alloca ptr, 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 17
  %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
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %27, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 0, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %70, %7
  %29 = load i32, ptr %18, align 4, !tbaa !9
  %30 = load ptr, ptr %15, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.asn_anonymous_sequence_, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 8, !tbaa !15
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %34, label %73

34:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %35 = load ptr, ptr %15, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.asn_anonymous_sequence_, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = load i32, ptr %18, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  store ptr %41, ptr %19, align 8, !tbaa !5
  %42 = load ptr, ptr %19, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %34
  store i32 4, ptr %20, align 4
  br label %67

45:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %46, i32 0, i32 5
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %48, i32 0, i32 6
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %51, i32 0, i32 5
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = load ptr, ptr %19, align 8, !tbaa !5
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %55, i32 0, i32 3
  %57 = load i32, ptr %56, align 4, !tbaa !21
  call void %50(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %21, ptr noundef %53, ptr noundef %54, i32 noundef 0, i32 noundef %57, ptr noundef null, ptr noundef null)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %21, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  %58 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %59 = load i64, ptr %58, align 8, !tbaa !23
  %60 = icmp eq i64 %59, -1
  br i1 %60, label %61, label %62

61:                                               ; preds = %45
  store i32 1, ptr %20, align 4
  br label %67

62:                                               ; preds = %45
  %63 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !23
  %65 = load i64, ptr %16, align 8, !tbaa !13
  %66 = add i64 %65, %64
  store i64 %66, ptr %16, align 8, !tbaa !13
  store i32 0, ptr %20, align 4
  br label %67

67:                                               ; preds = %62, %61, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  %68 = load i32, ptr %20, align 4
  switch i32 %68, label %167 [
    i32 0, label %69
    i32 4, label %70
  ]

69:                                               ; preds = %67
  br label %70

70:                                               ; preds = %69, %67
  %71 = load i32, ptr %18, align 4, !tbaa !9
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %18, align 4, !tbaa !9
  br label %28, !llvm.loop !25

73:                                               ; preds = %28
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = load i64, ptr %16, align 8, !tbaa !13
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = call i64 @der_write_tags(ptr noundef %74, i64 noundef %75, i32 noundef %76, i32 noundef 1, i32 noundef %77, ptr noundef %78, ptr noundef %79)
  store i64 %80, ptr %17, align 8, !tbaa !13
  %81 = load i64, ptr %17, align 8, !tbaa !13
  %82 = icmp eq i64 %81, -1
  br i1 %82, label %83, label %89

83:                                               ; preds = %73
  %84 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %84, align 8, !tbaa !23
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %85, ptr %86, align 8, !tbaa !27
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %87, ptr %88, align 8, !tbaa !28
  store i32 1, ptr %20, align 4
  br label %167

89:                                               ; preds = %73
  %90 = load i64, ptr %17, align 8, !tbaa !13
  %91 = load i64, ptr %16, align 8, !tbaa !13
  %92 = add i64 %91, %90
  store i64 %92, ptr %16, align 8, !tbaa !13
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = icmp ne ptr %93, null
  br i1 %94, label %103, label %95

95:                                               ; preds = %89
  %96 = load i64, ptr %16, align 8, !tbaa !13
  %97 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 %96, ptr %97, align 8, !tbaa !23
  br label %98

98:                                               ; preds = %95
  %99 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr null, ptr %99, align 8, !tbaa !28
  %100 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr null, ptr %100, align 8, !tbaa !27
  store i32 1, ptr %20, align 4
  br label %167

101:                                              ; No predecessors!
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102, %89
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %104

104:                                              ; preds = %148, %103
  %105 = load i32, ptr %18, align 4, !tbaa !9
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.asn_anonymous_sequence_, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 8, !tbaa !15
  %109 = icmp slt i32 %105, %108
  br i1 %109, label %110, label %151

110:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %111 = load ptr, ptr %15, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.asn_anonymous_sequence_, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !17
  %114 = load i32, ptr %18, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  store ptr %117, ptr %22, align 8, !tbaa !5
  %118 = load ptr, ptr %22, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %121, label %120

120:                                              ; preds = %110
  store i32 9, ptr %20, align 4
  br label %145

121:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #4
  %122 = load ptr, ptr %14, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !18
  %125 = getelementptr inbounds %struct.asn_TYPE_descriptor_s, ptr %124, i32 0, i32 6
  %126 = load ptr, ptr %125, align 8, !tbaa !20
  %127 = load ptr, ptr %14, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %127, i32 0, i32 5
  %129 = load ptr, ptr %128, align 8, !tbaa !18
  %130 = load ptr, ptr %22, align 8, !tbaa !5
  %131 = load ptr, ptr %14, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.asn_TYPE_member_s, ptr %131, i32 0, i32 3
  %133 = load i32, ptr %132, align 4, !tbaa !21
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  call void %126(ptr dead_on_unwind writable sret(%struct.asn_enc_rval_s) align 8 %23, ptr noundef %129, ptr noundef %130, i32 noundef 0, i32 noundef %133, ptr noundef %134, ptr noundef %135)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %0, ptr align 8 %23, i64 24, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #4
  %136 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %137 = load i64, ptr %136, align 8, !tbaa !23
  %138 = icmp eq i64 %137, -1
  br i1 %138, label %139, label %140

139:                                              ; preds = %121
  store i32 1, ptr %20, align 4
  br label %145

140:                                              ; preds = %121
  %141 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  %142 = load i64, ptr %141, align 8, !tbaa !23
  %143 = load i64, ptr %17, align 8, !tbaa !13
  %144 = add nsw i64 %143, %142
  store i64 %144, ptr %17, align 8, !tbaa !13
  store i32 0, ptr %20, align 4
  br label %145

145:                                              ; preds = %140, %139, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  %146 = load i32, ptr %20, align 4
  switch i32 %146, label %167 [
    i32 0, label %147
    i32 9, label %148
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147, %145
  %149 = load i32, ptr %18, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %18, align 4, !tbaa !9
  br label %104, !llvm.loop !29

151:                                              ; preds = %104
  %152 = load i64, ptr %16, align 8, !tbaa !13
  %153 = load i64, ptr %17, align 8, !tbaa !13
  %154 = icmp ne i64 %152, %153
  br i1 %154, label %155, label %161

155:                                              ; preds = %151
  %156 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 -1, ptr %156, align 8, !tbaa !23
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr %157, ptr %158, align 8, !tbaa !27
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr %159, ptr %160, align 8, !tbaa !28
  br label %166

161:                                              ; preds = %151
  %162 = load i64, ptr %16, align 8, !tbaa !13
  %163 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 0
  store i64 %162, ptr %163, align 8, !tbaa !23
  %164 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 2
  store ptr null, ptr %164, align 8, !tbaa !28
  %165 = getelementptr inbounds %struct.asn_enc_rval_s, ptr %0, i32 0, i32 1
  store ptr null, ptr %165, align 8, !tbaa !27
  br label %166

166:                                              ; preds = %161, %155
  store i32 1, ptr %20, align 4
  br label %167

167:                                              ; preds = %166, %145, %98, %83, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

!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, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16}
!17 = !{!16, !6, i64 0}
!18 = !{!19, !6, i64 24}
!19 = !{!"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}
!20 = !{!12, !6, i64 48}
!21 = !{!19, !10, i64 12}
!22 = !{i64 0, i64 8, !13, i64 8, i64 8, !5, i64 16, i64 8, !5}
!23 = !{!24, !14, i64 0}
!24 = !{!"asn_enc_rval_s", !14, 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 = distinct !{!29, !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 }

; Function Attrs: nounwind uwtable
define dso_local void @SEQUENCE_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 #0 {
  %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 %2, i64 8
  %12 = load i32, ptr %11, align 8, !tbaa !11
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %14 = getelementptr inbounds i8, ptr %10, i64 24
  %15 = getelementptr inbounds i8, ptr %10, i64 12
  br label %16

16:                                               ; preds = %.lr.ph, %29
  %17 = phi i32 [ %12, %.lr.ph ], [ %30, %29 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %29 ]
  %.078 = phi i64 [ 0, %.lr.ph ], [ %.1.ph, %29 ]
  %18 = load ptr, ptr %2, align 8, !tbaa !13
  %19 = getelementptr inbounds ptr, ptr %18, i64 %indvars.iv
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %.not60 = icmp eq ptr %20, null
  br i1 %.not60, label %29, label %21

21:                                               ; preds = %16
  %22 = load ptr, ptr %14, align 8, !tbaa !15
  %23 = getelementptr inbounds i8, ptr %22, i64 48
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %25 = load i32, ptr %15, align 4, !tbaa !18
  tail call void %24(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %0, ptr noundef %22, ptr noundef nonnull %20, i32 noundef 0, i32 noundef %25, ptr noundef null, ptr noundef null) #5
  %26 = load i64, ptr %0, align 8, !tbaa !19
  %27 = icmp eq i64 %26, -1
  br i1 %27, label %.loopexit, label %._crit_edge89

._crit_edge89:                                    ; preds = %21
  %28 = add i64 %26, %.078
  %.pre = load i32, ptr %11, align 8, !tbaa !11
  br label %29

29:                                               ; preds = %._crit_edge89, %16
  %30 = phi i32 [ %.pre, %._crit_edge89 ], [ %17, %16 ]
  %.1.ph = phi i64 [ %28, %._crit_edge89 ], [ %.078, %16 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %indvars.iv.next, %31
  br i1 %32, label %16, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %29, %7
  %.0.lcssa = phi i64 [ 0, %7 ], [ %.1.ph, %29 ]
  %33 = 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) #5
  %34 = icmp eq i64 %33, -1
  br i1 %34, label %35, label %38

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

38:                                               ; preds = %._crit_edge
  %39 = add i64 %33, %.0.lcssa
  %.not = icmp eq ptr %5, null
  br i1 %.not, label %44, label %.preheader

.preheader:                                       ; preds = %38
  %40 = load i32, ptr %11, align 8, !tbaa !11
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph81, label %._crit_edge82

.lr.ph81:                                         ; preds = %.preheader
  %42 = getelementptr inbounds i8, ptr %10, i64 24
  %43 = getelementptr inbounds i8, ptr %10, i64 12
  br label %46

44:                                               ; preds = %38
  store i64 %39, 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 %.loopexit

46:                                               ; preds = %.lr.ph81, %59
  %47 = phi i32 [ %40, %.lr.ph81 ], [ %60, %59 ]
  %indvars.iv86 = phi i64 [ 0, %.lr.ph81 ], [ %indvars.iv.next87, %59 ]
  %.04780 = phi i64 [ %33, %.lr.ph81 ], [ %.148.ph, %59 ]
  %48 = load ptr, ptr %2, align 8, !tbaa !13
  %49 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv86
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %.not59 = icmp eq ptr %50, null
  br i1 %.not59, label %59, label %51

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  %52 = load ptr, ptr %42, align 8, !tbaa !15
  %53 = getelementptr inbounds i8, ptr %52, i64 48
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = load i32, ptr %43, align 4, !tbaa !18
  call void %54(ptr dead_on_unwind nonnull writable sret(%struct.asn_enc_rval_s) align 8 %8, ptr noundef %52, ptr noundef nonnull %50, i32 noundef 0, i32 noundef %55, ptr noundef nonnull %5, ptr noundef %6) #5
  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 !26
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  %56 = load i64, ptr %0, align 8, !tbaa !19
  %57 = icmp eq i64 %56, -1
  br i1 %57, label %.loopexit, label %._crit_edge90

._crit_edge90:                                    ; preds = %51
  %58 = add nsw i64 %56, %.04780
  %.pre91 = load i32, ptr %11, align 8, !tbaa !11
  br label %59

59:                                               ; preds = %._crit_edge90, %46
  %60 = phi i32 [ %.pre91, %._crit_edge90 ], [ %47, %46 ]
  %.148.ph = phi i64 [ %58, %._crit_edge90 ], [ %.04780, %46 ]
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next87, %61
  br i1 %62, label %46, label %._crit_edge82, !llvm.loop !28

._crit_edge82:                                    ; preds = %59, %.preheader
  %.047.lcssa = phi i64 [ %33, %.preheader ], [ %.148.ph, %59 ]
  %.not58 = icmp eq i64 %39, %.047.lcssa
  %63 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %.not58, label %66, label %64

64:                                               ; preds = %._crit_edge82
  store i64 -1, ptr %0, align 8, !tbaa !19
  store ptr %1, ptr %63, align 8, !tbaa !24
  %65 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %2, ptr %65, align 8, !tbaa !25
  br label %.loopexit

66:                                               ; preds = %._crit_edge82
  store i64 %39, ptr %0, align 8, !tbaa !19
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %63, i8 0, i64 16, i1 false)
  br label %.loopexit

.loopexit:                                        ; preds = %21, %51, %64, %66, %44, %35
  ret void
}

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

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

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

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

; Function Attrs: 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 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, !10, i64 8}
!12 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16}
!13 = !{!12, !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !7, i64 24}
!16 = !{!"asn_TYPE_member_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56}
!17 = !{!6, !7, i64 48}
!18 = !{!16, !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 = !{i64 0, i64 8, !27, i64 8, i64 8, !14, i64 16, i64 8, !14}
!27 = !{!21, !21, i64 0}
!28 = distinct !{!28, !23}


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