; LLVM IR from FRC-Utilities/LibDS :: src (string)

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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__.DS_StrResize = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @DS_StrResize(ptr noundef %0, i64 noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  br label %14

13:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 132, ptr noundef @__PRETTY_FUNCTION__.DS_StrResize) #5
  unreachable

14:                                               ; preds = %12
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.DS_String, ptr %15, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %14
  br label %21

20:                                               ; preds = %14
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 133, ptr noundef @__PRETTY_FUNCTION__.DS_StrResize) #5
  unreachable

21:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.DS_String, ptr %22, i32 0, i32 1
  %24 = load i64, ptr %23, align 8, !tbaa !13
  %25 = trunc i64 %24 to i32
  store i32 %25, ptr %7, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %26 = load i32, ptr %7, align 4, !tbaa !14
  %27 = sext i32 %26 to i64
  %28 = call noalias ptr @calloc(i64 noundef %27, i64 noundef 1) #7
  store ptr %28, ptr %8, align 8, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %29

29:                                               ; preds = %45, %21
  %30 = load i32, ptr %6, align 4, !tbaa !14
  %31 = load i32, ptr %7, align 4, !tbaa !14
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %48

33:                                               ; preds = %29
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.DS_String, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = load i32, ptr %6, align 4, !tbaa !14
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %36, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !16
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !14
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %41, i64 %43
  store i8 %40, ptr %44, align 1, !tbaa !16
  br label %45

45:                                               ; preds = %33
  %46 = load i32, ptr %6, align 4, !tbaa !14
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %6, align 4, !tbaa !14
  br label %29, !llvm.loop !17

48:                                               ; preds = %29
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.DS_String, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !11
  call void @free(ptr noundef %51) #6
  %52 = load i64, ptr %5, align 8, !tbaa !9
  %53 = call noalias ptr @calloc(i64 noundef %52, i64 noundef 1) #7
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.DS_String, ptr %54, i32 0, i32 0
  store ptr %53, ptr %55, align 8, !tbaa !11
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.DS_String, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !11
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %85

60:                                               ; preds = %48
  %61 = load i64, ptr %5, align 8, !tbaa !9
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.DS_String, ptr %62, i32 0, i32 1
  store i64 %61, ptr %63, align 8, !tbaa !13
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %64

64:                                               ; preds = %80, %60
  %65 = load i32, ptr %6, align 4, !tbaa !14
  %66 = load i32, ptr %7, align 4, !tbaa !14
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %68, label %83

68:                                               ; preds = %64
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = load i32, ptr %6, align 4, !tbaa !14
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %69, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !16
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.DS_String, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = load i32, ptr %6, align 4, !tbaa !14
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %76, i64 %78
  store i8 %73, ptr %79, align 1, !tbaa !16
  br label %80

80:                                               ; preds = %68
  %81 = load i32, ptr %6, align 4, !tbaa !14
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !14
  br label %64, !llvm.loop !19

83:                                               ; preds = %64
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %84) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %89

85:                                               ; preds = %48
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.DS_String, ptr %87, i32 0, i32 0
  store ptr %86, ptr %88, align 8, !tbaa !11
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %89

89:                                               ; preds = %85, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %90 = load i32, ptr %3, align 4
  ret i32 %90
}

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

attributes #0 = { noreturn 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 allocsize(0,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 #5 = { noreturn nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !6, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


; 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 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@__PRETTY_FUNCTION__.DS_StrResize = external hidden unnamed_addr constant [38 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @DS_StrResize(ptr noundef %0, i64 noundef %1) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 132, ptr noundef nonnull @__PRETTY_FUNCTION__.DS_StrResize) #4
  unreachable

4:                                                ; preds = %2
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = ptrtoint ptr %5 to i64
  %.not30 = icmp eq ptr %5, null
  br i1 %.not30, label %7, label %8

7:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 133, ptr noundef nonnull @__PRETTY_FUNCTION__.DS_StrResize) #4
  unreachable

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load i64, ptr %9, align 8, !tbaa !11
  %11 = trunc i64 %10 to i32
  %sext = shl i64 %10, 32
  %12 = ashr exact i64 %sext, 32
  %13 = tail call noalias ptr @calloc(i64 noundef %12, i64 noundef 1) #5
  %14 = icmp sgt i32 %11, 0
  br i1 %14, label %iter.check, label %._crit_edge

iter.check:                                       ; preds = %8
  %15 = ptrtoint ptr %13 to i64
  %wide.trip.count = and i64 %10, 2147483647
  %min.iters.check = icmp ult i64 %wide.trip.count, 8
  %16 = sub i64 %15, %6
  %diff.check = icmp ult i64 %16, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check43 = icmp ult i64 %wide.trip.count, 32
  br i1 %min.iters.check43, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.mod.vf = and i64 %10, 31
  %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %17 = getelementptr inbounds i8, ptr %5, i64 %index
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %wide.load = load <16 x i8>, ptr %17, align 1, !tbaa !12
  %wide.load44 = load <16 x i8>, ptr %18, align 1, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %13, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  store <16 x i8> %wide.load, ptr %19, align 1, !tbaa !12
  store <16 x i8> %wide.load44, ptr %20, align 1, !tbaa !12
  %index.next = add nuw i64 %index, 32
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %._crit_edge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.mod.vf45 = and i64 %10, 7
  %n.vec46 = sub nsw i64 %wide.trip.count, %n.mod.vf45
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index47 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next49, %vec.epilog.vector.body ]
  %22 = getelementptr inbounds i8, ptr %5, i64 %index47
  %wide.load48 = load <8 x i8>, ptr %22, align 1, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %13, i64 %index47
  store <8 x i8> %wide.load48, ptr %23, align 1, !tbaa !12
  %index.next49 = add nuw i64 %index47, 8
  %24 = icmp eq i64 %index.next49, %n.vec46
  br i1 %24, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !17

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n50 = icmp eq i64 %n.mod.vf45, 0
  br i1 %cmp.n50, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec46, %vec.epilog.middle.block ]
  %25 = sub i64 %10, %indvars.iv.ph
  %xtraiter = and i64 %25, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %26 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv.prol
  %27 = load i8, ptr %26, align 1, !tbaa !12
  %28 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.prol
  store i8 %27, ptr %28, align 1, !tbaa !12
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !18

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %29 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %30 = icmp ugt i64 %29, -4
  br i1 %30, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %31 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv
  %32 = load i8, ptr %31, align 1, !tbaa !12
  %33 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv
  store i8 %32, ptr %33, align 1, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %34 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv.next
  %35 = load i8, ptr %34, align 1, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.next
  store i8 %35, ptr %36, align 1, !tbaa !12
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %37 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv.next.1
  %38 = load i8, ptr %37, align 1, !tbaa !12
  %39 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.next.1
  store i8 %38, ptr %39, align 1, !tbaa !12
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %40 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv.next.2
  %41 = load i8, ptr %40, align 1, !tbaa !12
  %42 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.next.2
  store i8 %41, ptr %42, align 1, !tbaa !12
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %vec.epilog.middle.block, %8
  tail call void @free(ptr noundef nonnull %5) #6
  %43 = tail call noalias ptr @calloc(i64 noundef %1, i64 noundef 1) #5
  store ptr %43, ptr %0, align 8, !tbaa !5
  %.not31 = icmp eq ptr %43, null
  br i1 %.not31, label %67, label %44

44:                                               ; preds = %._crit_edge
  store i64 %1, ptr %9, align 8, !tbaa !11
  br i1 %14, label %.lr.ph35.preheader, label %._crit_edge36

.lr.ph35.preheader:                               ; preds = %44
  %wide.trip.count41 = and i64 %10, 2147483647
  %45 = add nsw i64 %wide.trip.count41, -1
  %xtraiter51 = and i64 %10, 3
  %46 = icmp ult i64 %45, 3
  br i1 %46, label %._crit_edge36.loopexit.unr-lcssa, label %.lr.ph35.preheader.new

.lr.ph35.preheader.new:                           ; preds = %.lr.ph35.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count41, %xtraiter51
  br label %.lr.ph35

.lr.ph35:                                         ; preds = %.lr.ph35, %.lr.ph35.preheader.new
  %indvars.iv38 = phi i64 [ 0, %.lr.ph35.preheader.new ], [ %indvars.iv.next39.3, %.lr.ph35 ]
  %niter = phi i64 [ 0, %.lr.ph35.preheader.new ], [ %niter.next.3, %.lr.ph35 ]
  %47 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv38
  %48 = load i8, ptr %47, align 1, !tbaa !12
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %49, i64 %indvars.iv38
  store i8 %48, ptr %50, align 1, !tbaa !12
  %indvars.iv.next39 = or disjoint i64 %indvars.iv38, 1
  %51 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.next39
  %52 = load i8, ptr %51, align 1, !tbaa !12
  %53 = load ptr, ptr %0, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 %indvars.iv.next39
  store i8 %52, ptr %54, align 1, !tbaa !12
  %indvars.iv.next39.1 = or disjoint i64 %indvars.iv38, 2
  %55 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.next39.1
  %56 = load i8, ptr %55, align 1, !tbaa !12
  %57 = load ptr, ptr %0, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 %indvars.iv.next39.1
  store i8 %56, ptr %58, align 1, !tbaa !12
  %indvars.iv.next39.2 = or disjoint i64 %indvars.iv38, 3
  %59 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv.next39.2
  %60 = load i8, ptr %59, align 1, !tbaa !12
  %61 = load ptr, ptr %0, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 %indvars.iv.next39.2
  store i8 %60, ptr %62, align 1, !tbaa !12
  %indvars.iv.next39.3 = add nuw nsw i64 %indvars.iv38, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge36.loopexit.unr-lcssa, label %.lr.ph35, !llvm.loop !21

._crit_edge36.loopexit.unr-lcssa:                 ; preds = %.lr.ph35, %.lr.ph35.preheader
  %indvars.iv38.unr = phi i64 [ 0, %.lr.ph35.preheader ], [ %indvars.iv.next39.3, %.lr.ph35 ]
  %lcmp.mod52.not = icmp eq i64 %xtraiter51, 0
  br i1 %lcmp.mod52.not, label %._crit_edge36, label %.lr.ph35.epil

.lr.ph35.epil:                                    ; preds = %._crit_edge36.loopexit.unr-lcssa, %.lr.ph35.epil
  %indvars.iv38.epil = phi i64 [ %indvars.iv.next39.epil, %.lr.ph35.epil ], [ %indvars.iv38.unr, %._crit_edge36.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph35.epil ], [ 0, %._crit_edge36.loopexit.unr-lcssa ]
  %63 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv38.epil
  %64 = load i8, ptr %63, align 1, !tbaa !12
  %65 = load ptr, ptr %0, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %65, i64 %indvars.iv38.epil
  store i8 %64, ptr %66, align 1, !tbaa !12
  %indvars.iv.next39.epil = add nuw nsw i64 %indvars.iv38.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter51
  br i1 %epil.iter.cmp.not, label %._crit_edge36, label %.lr.ph35.epil, !llvm.loop !22

._crit_edge36:                                    ; preds = %._crit_edge36.loopexit.unr-lcssa, %.lr.ph35.epil, %44
  tail call void @free(ptr noundef %13) #6
  br label %68

67:                                               ; preds = %._crit_edge
  store ptr %13, ptr %0, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %67, %._crit_edge36
  %.0 = phi i32 [ 1, %._crit_edge36 ], [ 0, %67 ]
  ret i32 %.0
}

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

attributes #0 = { noreturn 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 #1 = { mustprogress nounwind willreturn allockind("free") 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 #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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 #4 = { noreturn nounwind }
attributes #5 = { nounwind allocsize(0,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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !15, !16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !14, !15}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !19}


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