; LLVM IR from holzschu/ios_system :: shell_cmds/locate/locate (util)

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

@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @colon(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %23

17:                                               ; preds = %3
  %18 = call noalias ptr @malloc(i64 noundef 8) #8
  store ptr %18, ptr %5, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.1) #9
  unreachable

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr null, ptr %22, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %21, %3
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %30

28:                                               ; preds = %23
  call void (ptr, ...) @warnx(ptr noundef @.str.2)
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %29, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %127

30:                                               ; preds = %23
  store i32 0, ptr %8, align 4, !tbaa !10
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %31, ptr %13, align 8, !tbaa !5
  br label %32

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

36:                                               ; preds = %32
  br label %37

37:                                               ; preds = %36
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = getelementptr inbounds ptr, ptr %38, i32 1
  store ptr %39, ptr %13, align 8, !tbaa !5
  %40 = load i32, ptr %8, align 4, !tbaa !10
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %8, align 4, !tbaa !10
  br label %32, !llvm.loop !12

42:                                               ; preds = %32
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %43, ptr %10, align 8, !tbaa !5
  store ptr %43, ptr %11, align 8, !tbaa !5
  br label %44

44:                                               ; preds = %122, %42
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = sext i8 %46 to i32
  %48 = icmp eq i32 %47, 58
  br i1 %48, label %64, label %49

49:                                               ; preds = %44
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = load i8, ptr %50, align 1, !tbaa !9
  %52 = icmp ne i8 %51, 0
  br i1 %52, label %115, label %53

53:                                               ; preds = %49
  %54 = load ptr, ptr %11, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 -1
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 58
  br i1 %58, label %59, label %64

59:                                               ; preds = %53
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = icmp eq ptr %60, %62
  br i1 %63, label %115, label %64

64:                                               ; preds = %59, %53, %44
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load ptr, ptr %10, align 8, !tbaa !5
  %67 = icmp eq ptr %65, %66
  br i1 %67, label %68, label %70

68:                                               ; preds = %64
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %69, ptr %12, align 8, !tbaa !5
  br label %93

70:                                               ; preds = %64
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = ptrtoint ptr %71 to i64
  %74 = ptrtoint ptr %72 to i64
  %75 = sub i64 %73, %74
  %76 = trunc i64 %75 to i32
  store i32 %76, ptr %9, align 4, !tbaa !10
  %77 = load i32, ptr %9, align 4, !tbaa !10
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = mul i64 1, %79
  %81 = call noalias ptr @malloc(i64 noundef %80) #8
  store ptr %81, ptr %12, align 8, !tbaa !5
  %82 = icmp eq ptr %81, null
  br i1 %82, label %83, label %84

83:                                               ; preds = %70
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.1) #9
  unreachable

84:                                               ; preds = %70
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !10
  %88 = sext i32 %87 to i64
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %86, ptr align 1 %85, i64 %88, i1 false)
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !10
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  store i8 0, ptr %92, align 1, !tbaa !9
  br label %93

93:                                               ; preds = %84, %68
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !10
  %96 = add nsw i32 %95, 2
  %97 = sext i32 %96 to i64
  %98 = mul i64 8, %97
  %99 = call ptr @realloc(ptr noundef %94, i64 noundef %98) #10
  store ptr %99, ptr %5, align 8, !tbaa !5
  %100 = icmp eq ptr %99, null
  br i1 %100, label %101, label %102

101:                                              ; preds = %93
  call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef @.str.3) #9
  unreachable

102:                                              ; preds = %93
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = load i32, ptr %8, align 4, !tbaa !10
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds ptr, ptr %104, i64 %106
  store ptr %103, ptr %107, align 8, !tbaa !5
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load i32, ptr %8, align 4, !tbaa !10
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %8, align 4, !tbaa !10
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds ptr, ptr %108, i64 %111
  store ptr null, ptr %112, align 8, !tbaa !5
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 1
  store ptr %114, ptr %10, align 8, !tbaa !5
  br label %115

115:                                              ; preds = %102, %59, %49
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load i8, ptr %116, align 1, !tbaa !9
  %118 = sext i8 %117 to i32
  %119 = icmp eq i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %115
  br label %125

121:                                              ; preds = %115
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr %11, align 8, !tbaa !5
  %124 = getelementptr inbounds i8, ptr %123, i32 1
  store ptr %124, ptr %11, align 8, !tbaa !5
  br label %44

125:                                              ; preds = %120
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %126, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %127

127:                                              ; preds = %125, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  %128 = load ptr, ptr %4, align 8
  ret ptr %128
}

; 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: noreturn
declare void @err(i32 noundef, ptr noundef, ...) #3

declare void @warnx(ptr noundef, ...) #4

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

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

; 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 = { noreturn "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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { noreturn }
attributes #10 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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

@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @colon(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %5, label %10

5:                                                ; preds = %3
  %6 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #7
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %5
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.1) #8
  unreachable

9:                                                ; preds = %5
  store ptr null, ptr %6, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %9, %3
  %.042 = phi ptr [ %6, %9 ], [ %0, %3 ]
  %11 = load i8, ptr %1, align 1, !tbaa !9
  %12 = icmp eq i8 %11, 0
  br i1 %12, label %14, label %.preheader57

.preheader57:                                     ; preds = %10
  %13 = load ptr, ptr %.042, align 8, !tbaa !5
  %.not58 = icmp eq ptr %13, null
  br i1 %.not58, label %.preheader, label %.lr.ph

14:                                               ; preds = %10
  tail call void (ptr, ...) @warnx(ptr noundef nonnull @.str.2) #9
  br label %.loopexit

.preheader:                                       ; preds = %.lr.ph, %.preheader57
  %.040.lcssa = phi i32 [ 0, %.preheader57 ], [ %57, %.lr.ph ]
  switch i8 %11, label %.thread.peel [
    i8 58, label %15
    i8 0, label %15
  ]

15:                                               ; preds = %.preheader, %.preheader
  %16 = add nsw i32 %.040.lcssa, 2
  %17 = sext i32 %16 to i64
  %18 = shl nsw i64 %17, 3
  %19 = tail call ptr @realloc(ptr noundef nonnull %.042, i64 noundef %18) #10
  %20 = icmp eq ptr %19, null
  br i1 %20, label %.loopexit77, label %21

21:                                               ; preds = %15
  %22 = sext i32 %.040.lcssa to i64
  %23 = getelementptr inbounds ptr, ptr %19, i64 %22
  store ptr %2, ptr %23, align 8, !tbaa !5
  %24 = add nsw i32 %.040.lcssa, 1
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds ptr, ptr %19, i64 %25
  store ptr null, ptr %26, align 8, !tbaa !5
  %.pr.peel.pre = load i8, ptr %1, align 1, !tbaa !9
  %27 = icmp eq i8 %.pr.peel.pre, 0
  br i1 %27, label %.loopexit, label %.thread.peel

.thread.peel:                                     ; preds = %21, %.preheader
  %28 = phi i8 [ %.pr.peel.pre, %21 ], [ %11, %.preheader ]
  %29 = phi i1 [ true, %21 ], [ false, %.preheader ]
  %.156.peel.idx = phi i64 [ 1, %21 ], [ 0, %.preheader ]
  %.255.peel = phi i32 [ %24, %21 ], [ %.040.lcssa, %.preheader ]
  %.24454.peel = phi ptr [ %19, %21 ], [ %.042, %.preheader ]
  %.156.peel.ptr = getelementptr inbounds i8, ptr %1, i64 %.156.peel.idx
  %.037.ptr.peel62 = getelementptr inbounds i8, ptr %1, i64 1
  %30 = load i8, ptr %.037.ptr.peel62, align 1, !tbaa !9
  switch i8 %30, label %.thread.peel70.preheader [
    i8 58, label %33
    i8 0, label %31
  ]

.thread.peel70.preheader:                         ; preds = %48, %.thread.peel
  %.143.ph = phi ptr [ %.24454.peel, %.thread.peel ], [ %46, %48 ]
  %.141.ph = phi i32 [ %.255.peel, %.thread.peel ], [ %51, %48 ]
  %.038.ph = phi ptr [ %.156.peel.ptr, %.thread.peel ], [ %54, %48 ]
  br label %.thread.peel70

31:                                               ; preds = %.thread.peel
  %32 = icmp eq i8 %28, 58
  br i1 %32, label %.loopexit, label %33

33:                                               ; preds = %31, %.thread.peel
  br i1 %29, label %42, label %34

34:                                               ; preds = %33
  %gepdiff = shl nuw nsw i64 %.156.peel.idx, 32
  %35 = xor i64 %gepdiff, 4294967296
  %sext.peel64 = add nuw nsw i64 %35, 4294967296
  %36 = lshr exact i64 %sext.peel64, 32
  %37 = tail call noalias ptr @malloc(i64 noundef %36) #7
  %38 = icmp eq ptr %37, null
  br i1 %38, label %.loopexit76, label %39

39:                                               ; preds = %34
  %40 = lshr exact i64 %35, 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %37, ptr nonnull align 1 %.156.peel.ptr, i64 %40, i1 false)
  %41 = getelementptr inbounds i8, ptr %37, i64 %40
  store i8 0, ptr %41, align 1, !tbaa !9
  br label %42

42:                                               ; preds = %39, %33
  %.036.peel65 = phi ptr [ %37, %39 ], [ %2, %33 ]
  %43 = add nsw i32 %.255.peel, 2
  %44 = sext i32 %43 to i64
  %45 = shl nsw i64 %44, 3
  %46 = tail call ptr @realloc(ptr noundef nonnull %.24454.peel, i64 noundef %45) #10
  %47 = icmp eq ptr %46, null
  br i1 %47, label %.loopexit77, label %48

48:                                               ; preds = %42
  %49 = sext i32 %.255.peel to i64
  %50 = getelementptr inbounds ptr, ptr %46, i64 %49
  store ptr %.036.peel65, ptr %50, align 8, !tbaa !5
  %51 = add nsw i32 %.255.peel, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %46, i64 %52
  store ptr null, ptr %53, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %1, i64 2
  %.pr.peel69.pre = load i8, ptr %.037.ptr.peel62, align 1, !tbaa !9
  %55 = icmp eq i8 %.pr.peel69.pre, 0
  br i1 %55, label %.loopexit, label %.thread.peel70.preheader

.lr.ph:                                           ; preds = %.preheader57, %.lr.ph
  %.060 = phi ptr [ %56, %.lr.ph ], [ %.042, %.preheader57 ]
  %.04059 = phi i32 [ %57, %.lr.ph ], [ 0, %.preheader57 ]
  %56 = getelementptr inbounds i8, ptr %.060, i64 8
  %57 = add nuw nsw i32 %.04059, 1
  %58 = load ptr, ptr %56, align 8, !tbaa !5
  %.not = icmp eq ptr %58, null
  br i1 %.not, label %.preheader, label %.lr.ph, !llvm.loop !10

.thread.peel70:                                   ; preds = %.thread.peel70.preheader, %.thread
  %.143 = phi ptr [ %.24454, %.thread ], [ %.143.ph, %.thread.peel70.preheader ]
  %.141 = phi i32 [ %.255, %.thread ], [ %.141.ph, %.thread.peel70.preheader ]
  %.038 = phi ptr [ %.156, %.thread ], [ %.038.ph, %.thread.peel70.preheader ]
  %.037.idx = phi i64 [ %.037.add, %.thread ], [ 2, %.thread.peel70.preheader ]
  %.037.ptr = getelementptr inbounds i8, ptr %1, i64 %.037.idx
  %59 = load i8, ptr %.037.ptr, align 1, !tbaa !9
  switch i8 %59, label %.thread [
    i8 58, label %60
    i8 0, label %60
  ]

60:                                               ; preds = %.thread.peel70, %.thread.peel70
  %61 = icmp eq ptr %.037.ptr, %.038
  br i1 %61, label %73, label %62

62:                                               ; preds = %60
  %63 = ptrtoint ptr %.037.ptr to i64
  %64 = ptrtoint ptr %.038 to i64
  %65 = sub i64 %63, %64
  %66 = shl i64 %65, 32
  %sext = add i64 %66, 4294967296
  %67 = ashr exact i64 %sext, 32
  %68 = tail call noalias ptr @malloc(i64 noundef %67) #7
  %69 = icmp eq ptr %68, null
  br i1 %69, label %.loopexit76, label %70

.loopexit76:                                      ; preds = %62, %34
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.1) #8
  unreachable

70:                                               ; preds = %62
  %71 = ashr exact i64 %66, 32
  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %68, ptr align 1 %.038, i64 %71, i1 false)
  %72 = getelementptr inbounds i8, ptr %68, i64 %71
  store i8 0, ptr %72, align 1, !tbaa !9
  br label %73

73:                                               ; preds = %60, %70
  %.036 = phi ptr [ %68, %70 ], [ %2, %60 ]
  %74 = add nsw i32 %.141, 2
  %75 = sext i32 %74 to i64
  %76 = shl nsw i64 %75, 3
  %77 = tail call ptr @realloc(ptr noundef %.143, i64 noundef %76) #10
  %78 = icmp eq ptr %77, null
  br i1 %78, label %.loopexit77, label %79

.loopexit77:                                      ; preds = %73, %42, %15
  tail call void (i32, ptr, ...) @err(i32 noundef 1, ptr noundef nonnull @.str.3) #8
  unreachable

79:                                               ; preds = %73
  %80 = sext i32 %.141 to i64
  %81 = getelementptr inbounds ptr, ptr %77, i64 %80
  store ptr %.036, ptr %81, align 8, !tbaa !5
  %82 = add nsw i32 %.141, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %77, i64 %83
  store ptr null, ptr %84, align 8, !tbaa !5
  %.pr.pre = load i8, ptr %.037.ptr, align 1, !tbaa !9
  %85 = getelementptr inbounds i8, ptr %.037.ptr, i64 1
  %86 = icmp eq i8 %.pr.pre, 0
  br i1 %86, label %.loopexit, label %.thread

.thread:                                          ; preds = %.thread.peel70, %79
  %.156 = phi ptr [ %85, %79 ], [ %.038, %.thread.peel70 ]
  %.255 = phi i32 [ %82, %79 ], [ %.141, %.thread.peel70 ]
  %.24454 = phi ptr [ %77, %79 ], [ %.143, %.thread.peel70 ]
  %.037.add = add nuw nsw i64 %.037.idx, 1
  br label %.thread.peel70, !llvm.loop !12

.loopexit:                                        ; preds = %79, %31, %21, %48, %14
  %.039 = phi ptr [ %.042, %14 ], [ %19, %21 ], [ %46, %48 ], [ %.24454.peel, %31 ], [ %77, %79 ]
  ret ptr %.039
}

; 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: noreturn
declare void @err(i32 noundef, ptr noundef, ...) local_unnamed_addr #2

declare void @warnx(ptr noundef, ...) local_unnamed_addr #3

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

; 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 #5

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

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 = { noreturn "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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.peeled.count", i32 2}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass