; LLVM IR from DimitrisJim/leetcode_solutions :: C/Algorithms (1078)

; 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"

; Function Attrs: nounwind uwtable
define dso_local ptr @findOcurrences(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %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 i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 5, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = mul i64 %18, 8
  %20 = call noalias ptr @malloc(i64 noundef %19) #6
  store ptr %20, ptr %12, align 8, !tbaa !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 8, ptr %15) #5
  br label %21

21:                                               ; preds = %174, %133, %79, %4
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = load i8, ptr %22, align 1, !tbaa !11
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %25, label %204

25:                                               ; preds = %21
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %26, ptr %13, align 8, !tbaa !5
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %27, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %67, %25
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i8, ptr %29, align 1, !tbaa !11
  %31 = sext i8 %30 to i32
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %38

33:                                               ; preds = %28
  %34 = load ptr, ptr %13, align 8, !tbaa !5
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  %37 = icmp ne i32 %36, 0
  br label %38

38:                                               ; preds = %33, %28
  %39 = phi i1 [ false, %28 ], [ %37, %33 ]
  br i1 %39, label %40, label %68

40:                                               ; preds = %38
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i32 1
  store ptr %42, ptr %5, align 8, !tbaa !5
  %43 = load i8, ptr %41, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i32 1
  store ptr %46, ptr %13, align 8, !tbaa !5
  %47 = load i8, ptr %45, align 1, !tbaa !11
  %48 = sext i8 %47 to i32
  %49 = icmp ne i32 %44, %48
  br i1 %49, label %50, label %67

50:                                               ; preds = %40
  br label %51

51:                                               ; preds = %63, %50
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = load i8, ptr %52, align 1, !tbaa !11
  %54 = sext i8 %53 to i32
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %61

56:                                               ; preds = %51
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load i8, ptr %57, align 1, !tbaa !11
  %59 = sext i8 %58 to i32
  %60 = icmp ne i32 %59, 32
  br label %61

61:                                               ; preds = %56, %51
  %62 = phi i1 [ false, %51 ], [ %60, %56 ]
  br i1 %62, label %63, label %66

63:                                               ; preds = %61
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i32 1
  store ptr %65, ptr %5, align 8, !tbaa !5
  br label %51, !llvm.loop !12

66:                                               ; preds = %61
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %68

67:                                               ; preds = %40
  br label %28, !llvm.loop !14

68:                                               ; preds = %66, %38
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load i8, ptr %69, align 1, !tbaa !11
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %68
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i32 1
  store ptr %74, ptr %5, align 8, !tbaa !5
  br label %76

75:                                               ; preds = %68
  br label %204

76:                                               ; preds = %72
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %80

79:                                               ; preds = %76
  br label %21, !llvm.loop !15

80:                                               ; preds = %76
  store i32 0, ptr %11, align 4, !tbaa !9
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %81, ptr %15, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %121, %80
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %92

87:                                               ; preds = %82
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = load i8, ptr %88, align 1, !tbaa !11
  %90 = sext i8 %89 to i32
  %91 = icmp ne i32 %90, 0
  br label %92

92:                                               ; preds = %87, %82
  %93 = phi i1 [ false, %82 ], [ %91, %87 ]
  br i1 %93, label %94, label %122

94:                                               ; preds = %92
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i32 1
  store ptr %96, ptr %5, align 8, !tbaa !5
  %97 = load i8, ptr %95, align 1, !tbaa !11
  %98 = sext i8 %97 to i32
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %99, i32 1
  store ptr %100, ptr %14, align 8, !tbaa !5
  %101 = load i8, ptr %99, align 1, !tbaa !11
  %102 = sext i8 %101 to i32
  %103 = icmp ne i32 %98, %102
  br i1 %103, label %104, label %121

104:                                              ; preds = %94
  br label %105

105:                                              ; preds = %117, %104
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i8, ptr %106, align 1, !tbaa !11
  %108 = sext i8 %107 to i32
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %115

110:                                              ; preds = %105
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = load i8, ptr %111, align 1, !tbaa !11
  %113 = sext i8 %112 to i32
  %114 = icmp ne i32 %113, 32
  br label %115

115:                                              ; preds = %110, %105
  %116 = phi i1 [ false, %105 ], [ %114, %110 ]
  br i1 %116, label %117, label %120

117:                                              ; preds = %115
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i32 1
  store ptr %119, ptr %5, align 8, !tbaa !5
  br label %105, !llvm.loop !16

120:                                              ; preds = %115
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %122

121:                                              ; preds = %94
  br label %82, !llvm.loop !17

122:                                              ; preds = %120, %92
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i8, ptr %123, align 1, !tbaa !11
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %126, label %129

126:                                              ; preds = %122
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds i8, ptr %127, i32 1
  store ptr %128, ptr %5, align 8, !tbaa !5
  br label %130

129:                                              ; preds = %122
  br label %204

130:                                              ; preds = %126
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %135

133:                                              ; preds = %130
  %134 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %134, ptr %5, align 8, !tbaa !5
  br label %21, !llvm.loop !15

135:                                              ; preds = %130
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %136, ptr %15, align 8, !tbaa !5
  br label %137

137:                                              ; preds = %149, %135
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = load i8, ptr %138, align 1, !tbaa !11
  %140 = sext i8 %139 to i32
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %147

142:                                              ; preds = %137
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = load i8, ptr %143, align 1, !tbaa !11
  %145 = sext i8 %144 to i32
  %146 = icmp ne i32 %145, 32
  br label %147

147:                                              ; preds = %142, %137
  %148 = phi i1 [ false, %137 ], [ %146, %142 ]
  br i1 %148, label %149, label %152

149:                                              ; preds = %147
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds i8, ptr %150, i32 1
  store ptr %151, ptr %5, align 8, !tbaa !5
  br label %137, !llvm.loop !18

152:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = load ptr, ptr %15, align 8, !tbaa !5
  %155 = ptrtoint ptr %153 to i64
  %156 = ptrtoint ptr %154 to i64
  %157 = sub i64 %155, %156
  %158 = add nsw i64 %157, 1
  %159 = trunc i64 %158 to i32
  store i32 %159, ptr %16, align 4, !tbaa !9
  %160 = load i32, ptr %10, align 4, !tbaa !9
  %161 = add nsw i32 %160, 1
  %162 = load i32, ptr %9, align 4, !tbaa !9
  %163 = icmp sge i32 %161, %162
  br i1 %163, label %164, label %174

164:                                              ; preds = %152
  %165 = load i32, ptr %9, align 4, !tbaa !9
  %166 = sitofp i32 %165 to double
  %167 = fmul double %166, 1.500000e+00
  %168 = fptosi double %167 to i32
  store i32 %168, ptr %9, align 4, !tbaa !9
  %169 = load ptr, ptr %12, align 8, !tbaa !5
  %170 = load i32, ptr %9, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = mul i64 %171, 8
  %173 = call ptr @realloc(ptr noundef %169, i64 noundef %172) #7
  store ptr %173, ptr %12, align 8, !tbaa !5
  br label %174

174:                                              ; preds = %164, %152
  %175 = load i32, ptr %16, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = mul i64 %176, 1
  %178 = call noalias ptr @malloc(i64 noundef %177) #6
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = load i32, ptr %10, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds ptr, ptr %179, i64 %181
  store ptr %178, ptr %182, align 8, !tbaa !5
  %183 = load ptr, ptr %12, align 8, !tbaa !5
  %184 = load i32, ptr %10, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds ptr, ptr %183, i64 %185
  %187 = load ptr, ptr %186, align 8, !tbaa !5
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = load i32, ptr %16, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  %191 = sext i32 %190 to i64
  %192 = call ptr @strncpy(ptr noundef %187, ptr noundef %188, i64 noundef %191) #5
  %193 = load ptr, ptr %12, align 8, !tbaa !5
  %194 = load i32, ptr %10, align 4, !tbaa !9
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %10, align 4, !tbaa !9
  %196 = sext i32 %194 to i64
  %197 = getelementptr inbounds ptr, ptr %193, i64 %196
  %198 = load ptr, ptr %197, align 8, !tbaa !5
  %199 = load i32, ptr %16, align 4, !tbaa !9
  %200 = sub nsw i32 %199, 1
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds i8, ptr %198, i64 %201
  store i8 0, ptr %202, align 1, !tbaa !11
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %203, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %21, !llvm.loop !15

204:                                              ; preds = %129, %75, %21
  %205 = load i32, ptr %10, align 4, !tbaa !9
  %206 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %205, ptr %206, align 4, !tbaa !9
  %207 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret ptr %207
}

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

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #3

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #4

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

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

!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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}


; 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"

; Function Attrs: nounwind uwtable
define dso_local noalias ptr @findOcurrences(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = tail call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #4
  %6 = load i8, ptr %0, align 1, !tbaa !5
  %.not120127 = icmp eq i8 %6, 0
  br i1 %.not120127, label %.critedge4.thread, label %.preheader105.lr.ph

.preheader105.lr.ph:                              ; preds = %4, %.outer
  %indvars.iv = phi i64 [ %indvars.iv.next, %.outer ], [ 0, %4 ]
  %7 = phi i8 [ %51, %.outer ], [ %6, %4 ]
  %.0.ph131 = phi ptr [ %23, %.outer ], [ %0, %4 ]
  %.060.ph130 = phi ptr [ %.161, %.outer ], [ %5, %4 ]
  %.065.ph128 = phi i32 [ %.166, %.outer ], [ 5, %4 ]
  br label %.preheader105

thread-pre-split:                                 ; preds = %12
  %8 = getelementptr inbounds i8, ptr %.059118, i64 1
  %.pr = load i8, ptr %11, align 1, !tbaa !5
  %.not74 = icmp eq i8 %.pr, 0
  br i1 %.not74, label %.critedge4.thread.loopexit161, label %.preheader105.backedge

.preheader105.backedge:                           ; preds = %thread-pre-split, %.backedge
  %.1119.be = phi ptr [ %11, %thread-pre-split ], [ %18, %.backedge ]
  %.059118.be = phi ptr [ %8, %thread-pre-split ], [ %1, %.backedge ]
  %.be = phi i8 [ %.pr, %thread-pre-split ], [ %19, %.backedge ]
  br label %.preheader105, !llvm.loop !8

.preheader105:                                    ; preds = %.preheader105.backedge, %.preheader105.lr.ph
  %.1119 = phi ptr [ %.0.ph131, %.preheader105.lr.ph ], [ %.1119.be, %.preheader105.backedge ]
  %.059118 = phi ptr [ %1, %.preheader105.lr.ph ], [ %.059118.be, %.preheader105.backedge ]
  %9 = phi i8 [ %7, %.preheader105.lr.ph ], [ %.be, %.preheader105.backedge ]
  %10 = load i8, ptr %.059118, align 1, !tbaa !5
  %.not75 = icmp eq i8 %10, 0
  %11 = getelementptr inbounds i8, ptr %.1119, i64 1
  br i1 %.not75, label %.preheader102, label %12

12:                                               ; preds = %.preheader105
  %.not76 = icmp eq i8 %9, %10
  br i1 %.not76, label %thread-pre-split, label %.preheader104, !llvm.loop !10

.preheader104:                                    ; preds = %12, %14
  %.2 = phi ptr [ %15, %14 ], [ %11, %12 ]
  %13 = load i8, ptr %.2, align 1, !tbaa !5
  switch i8 %13, label %14 [
    i8 0, label %.critedge4.thread.loopexit162
    i8 32, label %16
  ]

14:                                               ; preds = %.preheader104
  %15 = getelementptr inbounds i8, ptr %.2, i64 1
  br label %.preheader104, !llvm.loop !11

16:                                               ; preds = %.preheader104
  %17 = getelementptr inbounds i8, ptr %.2, i64 1
  br label %.backedge

.backedge:                                        ; preds = %.preheader, %16
  %18 = phi ptr [ %17, %16 ], [ %11, %.preheader ]
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %.not = icmp eq i8 %19, 0
  br i1 %.not, label %.critedge4.thread.loopexit162, label %.preheader105.backedge

.preheader102:                                    ; preds = %.preheader105, %24
  %.058 = phi ptr [ %25, %24 ], [ %2, %.preheader105 ]
  %.4 = phi ptr [ %23, %24 ], [ %11, %.preheader105 ]
  %20 = load i8, ptr %.4, align 1, !tbaa !5
  %.not81 = icmp eq i8 %20, 0
  br i1 %.not81, label %.critedge4.thread.loopexit160, label %21

21:                                               ; preds = %.preheader102
  %22 = load i8, ptr %.058, align 1, !tbaa !5
  %.not82 = icmp eq i8 %22, 0
  %23 = getelementptr inbounds i8, ptr %.4, i64 1
  br i1 %.not82, label %.critedge4.thread96, label %24, !llvm.loop !8

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %.058, i64 1
  %.not83 = icmp eq i8 %20, %22
  br i1 %.not83, label %.preheader102, label %.preheader, !llvm.loop !12

.preheader:                                       ; preds = %24, %27
  %.5 = phi ptr [ %28, %27 ], [ %23, %24 ]
  %26 = load i8, ptr %.5, align 1, !tbaa !5
  switch i8 %26, label %27 [
    i8 0, label %.critedge4.thread.loopexit
    i8 32, label %.backedge
  ]

27:                                               ; preds = %.preheader
  %28 = getelementptr inbounds i8, ptr %.5, i64 1
  br label %.preheader, !llvm.loop !13

.critedge4.thread96:                              ; preds = %21, %30
  %.7 = phi ptr [ %31, %30 ], [ %23, %21 ]
  %29 = load i8, ptr %.7, align 1, !tbaa !5
  switch i8 %29, label %30 [
    i8 0, label %.critedge8
    i8 32, label %.critedge8
  ]

30:                                               ; preds = %.critedge4.thread96
  %31 = getelementptr inbounds i8, ptr %.7, i64 1
  br label %.critedge4.thread96, !llvm.loop !14

.critedge8:                                       ; preds = %.critedge4.thread96, %.critedge4.thread96
  %32 = ptrtoint ptr %.7 to i64
  %33 = ptrtoint ptr %23 to i64
  %34 = sub i64 %32, %33
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = trunc nuw i64 %indvars.iv.next to i32
  %.not90 = icmp sgt i32 %.065.ph128, %35
  br i1 %.not90, label %.outer, label %36

36:                                               ; preds = %.critedge8
  %37 = sitofp i32 %.065.ph128 to double
  %38 = fmul double %37, 1.500000e+00
  %39 = fptosi double %38 to i32
  %40 = sext i32 %39 to i64
  %41 = shl nsw i64 %40, 3
  %42 = tail call ptr @realloc(ptr noundef %.060.ph130, i64 noundef %41) #5
  br label %.outer

.outer:                                           ; preds = %36, %.critedge8
  %.166 = phi i32 [ %39, %36 ], [ %.065.ph128, %.critedge8 ]
  %.161 = phi ptr [ %42, %36 ], [ %.060.ph130, %.critedge8 ]
  %43 = shl i64 %34, 32
  %sext = add i64 %43, 4294967296
  %44 = ashr exact i64 %sext, 32
  %45 = tail call noalias ptr @malloc(i64 noundef %44) #4
  %46 = getelementptr inbounds ptr, ptr %.161, i64 %indvars.iv
  store ptr %45, ptr %46, align 8, !tbaa !15
  %47 = ashr exact i64 %43, 32
  %48 = tail call ptr @strncpy(ptr noundef %45, ptr noundef nonnull %23, i64 noundef %47) #6
  %49 = load ptr, ptr %46, align 8, !tbaa !15
  %50 = getelementptr inbounds i8, ptr %49, i64 %47
  store i8 0, ptr %50, align 1, !tbaa !5
  %51 = load i8, ptr %23, align 1, !tbaa !5
  %.not120 = icmp eq i8 %51, 0
  br i1 %.not120, label %.critedge4.thread, label %.preheader105.lr.ph, !llvm.loop !8

.critedge4.thread.loopexit:                       ; preds = %.preheader
  %52 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.critedge4.thread

.critedge4.thread.loopexit160:                    ; preds = %.preheader102
  %53 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.critedge4.thread

.critedge4.thread.loopexit161:                    ; preds = %thread-pre-split
  %54 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.critedge4.thread

.critedge4.thread.loopexit162:                    ; preds = %.backedge, %.preheader104
  %55 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.critedge4.thread

.critedge4.thread:                                ; preds = %.outer, %.critedge4.thread.loopexit162, %.critedge4.thread.loopexit161, %.critedge4.thread.loopexit160, %.critedge4.thread.loopexit, %4
  %.064.ph117 = phi i32 [ 0, %4 ], [ %52, %.critedge4.thread.loopexit ], [ %53, %.critedge4.thread.loopexit160 ], [ %54, %.critedge4.thread.loopexit161 ], [ %55, %.critedge4.thread.loopexit162 ], [ %35, %.outer ]
  %.060.ph114 = phi ptr [ %5, %4 ], [ %.060.ph130, %.critedge4.thread.loopexit ], [ %.060.ph130, %.critedge4.thread.loopexit160 ], [ %.060.ph130, %.critedge4.thread.loopexit161 ], [ %.060.ph130, %.critedge4.thread.loopexit162 ], [ %.161, %.outer ]
  store i32 %.064.ph117, ptr %3, align 4, !tbaa !17
  ret ptr %.060.ph114
}

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind allocsize(0) }
attributes #5 = { nounwind allocsize(1) }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !6, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !6, i64 0}


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