; LLVM IR from wuzhouhui/leetcode :: 43_mult_str (multiply)

; 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 @multiply(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %22

19:                                               ; preds = %2
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %19, %2
  store ptr null, ptr %3, align 8
  br label %171

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #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
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i64 @strlen(ptr noundef %24) #6
  %26 = trunc i64 %25 to i32
  store i32 %26, ptr %6, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %33

28:                                               ; preds = %23
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call i64 @strlen(ptr noundef %29) #6
  %31 = trunc i64 %30 to i32
  store i32 %31, ptr %7, align 4, !tbaa !9
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %28, %23
  store ptr null, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %170

34:                                               ; preds = %28
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = call ptr @rev_str(ptr noundef %35, i32 noundef %36)
  store ptr %37, ptr %13, align 8, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load i32, ptr %7, align 4, !tbaa !9
  %40 = call ptr @rev_str(ptr noundef %38, i32 noundef %39)
  store ptr %40, ptr %14, align 8, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = add nsw i32 %41, %42
  %44 = sext i32 %43 to i64
  %45 = call noalias ptr @calloc(i64 noundef %44, i64 noundef 1) #7
  store ptr %45, ptr %15, align 8, !tbaa !5
  store i32 0, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %129, %34
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %6, align 4, !tbaa !9
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %132

50:                                               ; preds = %46
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %104, %50
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %107

55:                                               ; preds = %51
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds i8, ptr %56, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !11
  %61 = sext i8 %60 to i32
  %62 = sub nsw i32 %61, 48
  %63 = load ptr, ptr %14, align 8, !tbaa !5
  %64 = load i32, ptr %9, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %63, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !11
  %68 = sext i8 %67 to i32
  %69 = sub nsw i32 %68, 48
  %70 = mul nsw i32 %62, %69
  store i32 %70, ptr %10, align 4, !tbaa !9
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = add nsw i32 %72, %71
  store i32 %73, ptr %10, align 4, !tbaa !9
  %74 = load i32, ptr %10, align 4, !tbaa !9
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = add nsw i32 %76, %77
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %75, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !11
  %82 = sext i8 %81 to i32
  %83 = add nsw i32 %82, %74
  %84 = trunc i32 %83 to i8
  store i8 %84, ptr %80, align 1, !tbaa !11
  %85 = load ptr, ptr %15, align 8, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = add nsw i32 %86, %87
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %85, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !11
  %92 = sext i8 %91 to i32
  %93 = sdiv i32 %92, 10
  store i32 %93, ptr %11, align 4, !tbaa !9
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = add nsw i32 %95, %96
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i8, ptr %94, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !11
  %101 = sext i8 %100 to i32
  %102 = srem i32 %101, 10
  %103 = trunc i32 %102 to i8
  store i8 %103, ptr %99, align 1, !tbaa !11
  br label %104

104:                                              ; preds = %55
  %105 = load i32, ptr %9, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %9, align 4, !tbaa !9
  br label %51, !llvm.loop !12

107:                                              ; preds = %51
  %108 = load i32, ptr %11, align 4, !tbaa !9
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %123

110:                                              ; preds = %107
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = add nsw i32 %111, %112
  store i32 %113, ptr %12, align 4, !tbaa !9
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds i8, ptr %115, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !11
  %120 = sext i8 %119 to i32
  %121 = add nsw i32 %120, %114
  %122 = trunc i32 %121 to i8
  store i8 %122, ptr %118, align 1, !tbaa !11
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %128

123:                                              ; preds = %107
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = add nsw i32 %124, %125
  %127 = sub nsw i32 %126, 1
  store i32 %127, ptr %12, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %123, %110
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %8, align 4, !tbaa !9
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %8, align 4, !tbaa !9
  br label %46, !llvm.loop !14

132:                                              ; preds = %46
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %133) #5
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %134) #5
  %135 = load i32, ptr %12, align 4, !tbaa !9
  %136 = add nsw i32 %135, 2
  %137 = sext i32 %136 to i64
  %138 = call noalias ptr @calloc(i64 noundef %137, i64 noundef 1) #7
  store ptr %138, ptr %13, align 8, !tbaa !5
  %139 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %139, ptr %8, align 4, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %143, %132
  %141 = load i32, ptr %8, align 4, !tbaa !9
  %142 = icmp sge i32 %141, 0
  br i1 %142, label %143, label %158

143:                                              ; preds = %140
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = add nsw i32 %145, -1
  store i32 %146, ptr %8, align 4, !tbaa !9
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds i8, ptr %144, i64 %147
  %149 = load i8, ptr %148, align 1, !tbaa !11
  %150 = sext i8 %149 to i32
  %151 = add nsw i32 %150, 48
  %152 = trunc i32 %151 to i8
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = load i32, ptr %9, align 4, !tbaa !9
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %9, align 4, !tbaa !9
  %156 = sext i32 %154 to i64
  %157 = getelementptr inbounds i8, ptr %153, i64 %156
  store i8 %152, ptr %157, align 1, !tbaa !11
  br label %140, !llvm.loop !15

158:                                              ; preds = %140
  %159 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %159) #5
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = getelementptr inbounds i8, ptr %160, i64 0
  %162 = load i8, ptr %161, align 1, !tbaa !11
  %163 = sext i8 %162 to i32
  %164 = icmp eq i32 %163, 48
  br i1 %164, label %165, label %168

165:                                              ; preds = %158
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = getelementptr inbounds i8, ptr %166, i64 1
  store i8 0, ptr %167, align 1, !tbaa !11
  br label %168

168:                                              ; preds = %165, %158
  %169 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %169, ptr %3, align 8
  store i32 1, ptr %16, align 4
  br label %170

170:                                              ; preds = %168, %33
  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 4, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %171

171:                                              ; preds = %170, %22
  %172 = load ptr, ptr %3, align 8
  ret ptr %172
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

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

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

; Function Attrs: nounwind
declare void @free(ptr 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 willreturn memory(read) "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(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 #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 willreturn memory(read) }
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 = !{!"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}


; 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 noundef ptr @multiply(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = icmp ne ptr %0, null
  %4 = icmp ne ptr %1, null
  %or.cond = and i1 %3, %4
  br i1 %or.cond, label %5, label %72

5:                                                ; preds = %2
  %6 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #4
  %7 = trunc i64 %6 to i32
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %72, label %8

8:                                                ; preds = %5
  %9 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #4
  %10 = trunc i64 %9 to i32
  %.not66 = icmp eq i32 %10, 0
  br i1 %.not66, label %72, label %11

11:                                               ; preds = %8
  %12 = tail call ptr @rev_str(ptr noundef nonnull %0, i32 noundef %7)
  %13 = tail call ptr @rev_str(ptr noundef nonnull %1, i32 noundef %10)
  %14 = add i64 %9, %6
  %sext = shl i64 %14, 32
  %15 = ashr exact i64 %sext, 32
  %16 = tail call noalias ptr @calloc(i64 noundef %15, i64 noundef 1) #5
  %17 = icmp sgt i32 %7, 0
  br i1 %17, label %.preheader.lr.ph, label %._crit_edge74

.preheader.lr.ph:                                 ; preds = %11
  %18 = icmp sgt i32 %10, 0
  br i1 %18, label %.preheader.us.preheader, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %19 = add nsw i32 %7, -2
  br label %._crit_edge74

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count83 = and i64 %6, 2147483647
  %wide.trip.count = and i64 %9, 2147483647
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %34
  %indvars.iv80 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next81, %34 ]
  %20 = getelementptr inbounds i8, ptr %12, i64 %indvars.iv80
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = add i8 %21, -48
  %invariant.gep = getelementptr inbounds i8, ptr %16, i64 %indvars.iv80
  br label %35

23:                                               ; preds = %._crit_edge.us
  %24 = trunc nuw nsw i64 %indvars.iv80 to i32
  %25 = add nuw nsw i32 %10, %24
  %26 = zext nneg i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %16, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !5
  %29 = add i8 %28, %43
  store i8 %29, ptr %27, align 1, !tbaa !5
  br label %34

30:                                               ; preds = %._crit_edge.us
  %31 = trunc nuw nsw i64 %indvars.iv to i32
  %32 = trunc nuw nsw i64 %indvars.iv80 to i32
  %33 = add nuw nsw i32 %32, %31
  br label %34

34:                                               ; preds = %30, %23
  %.157.us = phi i32 [ %25, %23 ], [ %33, %30 ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge74, label %.preheader.us, !llvm.loop !8

35:                                               ; preds = %.preheader.us, %35
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %35 ]
  %.15971.us = phi i8 [ 0, %.preheader.us ], [ %43, %35 ]
  %36 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv
  %37 = load i8, ptr %36, align 1, !tbaa !5
  %38 = add i8 %37, -48
  %39 = mul i8 %38, %22
  %40 = add i8 %39, %.15971.us
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv
  %41 = load i8, ptr %gep, align 1, !tbaa !5
  %42 = add i8 %40, %41
  %43 = sdiv i8 %42, 10
  %44 = srem i8 %42, 10
  store i8 %44, ptr %gep, align 1, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %35, !llvm.loop !10

._crit_edge.us:                                   ; preds = %35
  %.off = add i8 %42, 9
  %.not67.us = icmp ult i8 %.off, 19
  br i1 %.not67.us, label %30, label %23

._crit_edge74:                                    ; preds = %34, %.preheader.preheader, %11
  %.056.lcssa = phi i32 [ 0, %11 ], [ %19, %.preheader.preheader ], [ %.157.us, %34 ]
  tail call void @free(ptr noundef %12) #6
  tail call void @free(ptr noundef %13) #6
  %45 = add nsw i32 %.056.lcssa, 2
  %46 = sext i32 %45 to i64
  %47 = tail call noalias ptr @calloc(i64 noundef %46, i64 noundef 1) #5
  %48 = icmp sgt i32 %.056.lcssa, -1
  br i1 %48, label %iter.check, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %._crit_edge74
  tail call void @free(ptr noundef %16) #6
  br label %72

iter.check:                                       ; preds = %._crit_edge74
  %49 = zext nneg i32 %.056.lcssa to i64
  %50 = add nuw i32 %.056.lcssa, 1
  %wide.trip.count92 = zext i32 %50 to i64
  %min.iters.check = icmp ult i32 %.056.lcssa, 7
  br i1 %min.iters.check, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check96 = icmp ult i32 %.056.lcssa, 31
  br i1 %min.iters.check96, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %wide.trip.count92, 4294967264
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %49, %index
  %51 = getelementptr inbounds i8, ptr %16, i64 %offset.idx
  %52 = getelementptr inbounds i8, ptr %51, i64 -15
  %53 = getelementptr inbounds i8, ptr %51, i64 -31
  %wide.load = load <16 x i8>, ptr %52, align 1, !tbaa !5
  %wide.load97 = load <16 x i8>, ptr %53, align 1, !tbaa !5
  %54 = add <16 x i8> %wide.load, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
  %55 = shufflevector <16 x i8> %54, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
  %56 = add <16 x i8> %wide.load97, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
  %57 = shufflevector <16 x i8> %56, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
  %58 = getelementptr inbounds i8, ptr %47, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <16 x i8> %55, ptr %58, align 1, !tbaa !5
  store <16 x i8> %57, ptr %59, align 1, !tbaa !5
  %index.next = add nuw i64 %index, 32
  %60 = icmp eq i64 %index.next, %n.vec
  br i1 %60, label %middle.block, label %vector.body, !llvm.loop !11

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

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end101 = sub nsw i64 %49, %n.vec
  %n.vec.remaining = and i64 %wide.trip.count92, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  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.vec100 = and i64 %wide.trip.count92, 4294967288
  %ind.end = sub nsw i64 %49, %n.vec100
  %invariant.gep111 = getelementptr i8, ptr %16, i64 -7
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index103 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next107, %vec.epilog.vector.body ]
  %offset.idx104 = sub i64 %49, %index103
  %gep112 = getelementptr i8, ptr %invariant.gep111, i64 %offset.idx104
  %wide.load105 = load <8 x i8>, ptr %gep112, align 1, !tbaa !5
  %61 = add <8 x i8> %wide.load105, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
  %62 = shufflevector <8 x i8> %61, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
  %63 = getelementptr inbounds i8, ptr %47, i64 %index103
  store <8 x i8> %62, ptr %63, align 1, !tbaa !5
  %index.next107 = add nuw i64 %index103, 8
  %64 = icmp eq i64 %index.next107, %n.vec100
  br i1 %64, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n108 = icmp eq i64 %n.vec100, %wide.trip.count92
  br i1 %cmp.n108, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %indvars.iv87.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec100, %vec.epilog.middle.block ]
  %indvars.iv85.ph = phi i64 [ %49, %iter.check ], [ %ind.end101, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.lr.ph ], [ %indvars.iv87.ph, %.lr.ph.preheader ]
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.lr.ph ], [ %indvars.iv85.ph, %.lr.ph.preheader ]
  %indvars.iv.next86 = add nsw i64 %indvars.iv85, -1
  %65 = getelementptr inbounds i8, ptr %16, i64 %indvars.iv85
  %66 = load i8, ptr %65, align 1, !tbaa !5
  %67 = add i8 %66, 48
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %68 = getelementptr inbounds i8, ptr %47, i64 %indvars.iv87
  store i8 %67, ptr %68, align 1, !tbaa !5
  %exitcond93.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count92
  br i1 %exitcond93.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph, %vec.epilog.middle.block, %middle.block
  %.pre = load i8, ptr %47, align 1, !tbaa !5
  %69 = icmp eq i8 %.pre, 48
  tail call void @free(ptr noundef nonnull %16) #6
  br i1 %69, label %70, label %72

70:                                               ; preds = %._crit_edge
  %71 = getelementptr inbounds i8, ptr %47, i64 1
  store i8 0, ptr %71, align 1, !tbaa !5
  br label %72

72:                                               ; preds = %._crit_edge.thread, %8, %5, %70, %._crit_edge, %2
  %.1 = phi ptr [ null, %2 ], [ null, %8 ], [ null, %5 ], [ %47, %70 ], [ %47, %._crit_edge ], [ %47, %._crit_edge.thread ]
  ret ptr %.1
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @rev_str(ptr noundef, i32 noundef) local_unnamed_addr #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 #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture 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 memory(argmem: read) "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 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 #3 = { 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 #4 = { nounwind willreturn memory(read) }
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, !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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !9, !12, !13}
!15 = distinct !{!15, !9, !13, !12}


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