; LLVM IR from aagdev/mlimgsynth :: src (main_tstore_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"

%struct.TStoreUtil = type { %struct.TensorStore, %struct.Stream, %struct.Stream, %struct.StringStore, %struct.anon }
%struct.TensorStore = type { ptr, ptr, ptr, ptr, ptr }
%struct.Stream = type { ptr, ptr, ptr, ptr, ptr, %struct.StreamInt, i64, i32 }
%struct.StreamInt = type { [3 x ptr] }
%struct.StringStore = type { ptr, ptr, %struct.AllocatorArena }
%struct.AllocatorArena = type { i64, ptr, ptr }
%struct.anon = type { ptr, ptr, ptr, ptr, ptr, i32 }

@.str = external hidden unnamed_addr constant [1 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @tsu_argv_load(ptr noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = icmp sle i32 %15, 1
  br i1 %16, label %17, label %18

17:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %180

18:                                               ; preds = %3
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.TStoreUtil, ptr %19, i32 0, i32 4
  %21 = getelementptr inbounds %struct.anon, ptr %20, i32 0, i32 5
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %29

24:                                               ; preds = %18
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.TStoreUtil, ptr %25, i32 0, i32 4
  %27 = getelementptr inbounds %struct.anon, ptr %26, i32 0, i32 5
  %28 = load i32, ptr %27, align 8, !tbaa !11
  br label %33

29:                                               ; preds = %18
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.TStoreUtil, ptr %30, i32 0, i32 4
  %32 = getelementptr inbounds %struct.anon, ptr %31, i32 0, i32 5
  store i32 4, ptr %32, align 8, !tbaa !11
  br label %33

33:                                               ; preds = %29, %24
  %34 = phi i32 [ %28, %24 ], [ 4, %29 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %173, %33
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %39, label %176

39:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  store ptr %44, ptr %12, align 8, !tbaa !5
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 0
  %47 = load i8, ptr %46, align 1, !tbaa !20
  %48 = sext i8 %47 to i32
  %49 = icmp eq i32 %48, 45
  br i1 %49, label %50, label %144

50:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i32 1, ptr %11, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %137, %50
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !20
  store i8 %56, ptr %13, align 1, !tbaa !20
  %57 = icmp ne i8 %56, 0
  br i1 %57, label %58, label %140

58:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %63, label %70

63:                                               ; preds = %58
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds ptr, ptr %64, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  br label %71

70:                                               ; preds = %58
  br label %71

71:                                               ; preds = %70, %63
  %72 = phi ptr [ %69, %63 ], [ @.str, %70 ]
  store ptr %72, ptr %14, align 8, !tbaa !5
  %73 = load i8, ptr %13, align 1, !tbaa !20
  %74 = sext i8 %73 to i32
  switch i32 %74, label %118 [
    i32 105, label %75
    i32 111, label %82
    i32 116, label %89
    i32 84, label %96
    i32 110, label %103
    i32 113, label %111
    i32 118, label %113
    i32 100, label %115
    i32 104, label %117
  ]

75:                                               ; preds = %71
  %76 = load ptr, ptr %14, align 8, !tbaa !5
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.TStoreUtil, ptr %77, i32 0, i32 4
  %79 = getelementptr inbounds %struct.anon, ptr %78, i32 0, i32 1
  store ptr %76, ptr %79, align 8, !tbaa !21
  %80 = load i32, ptr %10, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %10, align 4, !tbaa !9
  br label %133

82:                                               ; preds = %71
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.TStoreUtil, ptr %84, i32 0, i32 4
  %86 = getelementptr inbounds %struct.anon, ptr %85, i32 0, i32 2
  store ptr %83, ptr %86, align 8, !tbaa !22
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %10, align 4, !tbaa !9
  br label %133

89:                                               ; preds = %71
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.TStoreUtil, ptr %91, i32 0, i32 4
  %93 = getelementptr inbounds %struct.anon, ptr %92, i32 0, i32 3
  store ptr %90, ptr %93, align 8, !tbaa !23
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %10, align 4, !tbaa !9
  br label %133

96:                                               ; preds = %71
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = load ptr, ptr %5, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.TStoreUtil, ptr %98, i32 0, i32 4
  %100 = getelementptr inbounds %struct.anon, ptr %99, i32 0, i32 4
  store ptr %97, ptr %100, align 8, !tbaa !24
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %10, align 4, !tbaa !9
  br label %133

103:                                              ; preds = %71
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  %105 = call i32 @atoi(ptr noundef %104) #6
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.TStoreUtil, ptr %106, i32 0, i32 4
  %108 = getelementptr inbounds %struct.anon, ptr %107, i32 0, i32 5
  store i32 %105, ptr %108, align 8, !tbaa !11
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %10, align 4, !tbaa !9
  br label %133

111:                                              ; preds = %71
  %112 = call i32 @log_level_inc(i32 noundef -10)
  br label %133

113:                                              ; preds = %71
  %114 = call i32 @log_level_inc(i32 noundef 10)
  br label %133

115:                                              ; preds = %71
  %116 = call i32 @log_level_set(i32 noundef 50)
  br label %133

117:                                              ; preds = %71
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %134

118:                                              ; preds = %71
  br label %119

119:                                              ; preds = %118
  br label %120

120:                                              ; preds = %119
  %121 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %121, label %122, label %125

122:                                              ; preds = %120
  %123 = load i8, ptr %13, align 1, !tbaa !20
  %124 = sext i8 %123 to i32
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.1, i32 noundef %124)
  br label %125

125:                                              ; preds = %122, %120
  br label %126

126:                                              ; preds = %125
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  store i32 -1, ptr %8, align 4, !tbaa !9
  store i32 15, ptr %9, align 4
  br label %134

129:                                              ; No predecessors!
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132, %115, %113, %111, %103, %96, %89, %82, %75
  store i32 0, ptr %9, align 4
  br label %134

134:                                              ; preds = %133, %128, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  %135 = load i32, ptr %9, align 4
  switch i32 %135, label %141 [
    i32 0, label %136
  ]

136:                                              ; preds = %134
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %11, align 4, !tbaa !9
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %11, align 4, !tbaa !9
  br label %51, !llvm.loop !25

140:                                              ; preds = %51
  store i32 0, ptr %9, align 4
  br label %141

141:                                              ; preds = %140, %134
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  %142 = load i32, ptr %9, align 4
  switch i32 %142, label %170 [
    i32 0, label %143
  ]

143:                                              ; preds = %141
  br label %169

144:                                              ; preds = %39
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.TStoreUtil, ptr %145, i32 0, i32 4
  %147 = getelementptr inbounds %struct.anon, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !27
  %149 = icmp ne ptr %148, null
  br i1 %149, label %155, label %150

150:                                              ; preds = %144
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.TStoreUtil, ptr %152, i32 0, i32 4
  %154 = getelementptr inbounds %struct.anon, ptr %153, i32 0, i32 0
  store ptr %151, ptr %154, align 8, !tbaa !27
  br label %168

155:                                              ; preds = %144
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %158, label %159, label %160

159:                                              ; preds = %157
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.2)
  br label %160

160:                                              ; preds = %159, %157
  br label %161

161:                                              ; preds = %160
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  store i32 -1, ptr %8, align 4, !tbaa !9
  store i32 15, ptr %9, align 4
  br label %170

164:                                              ; No predecessors!
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  br label %167

167:                                              ; preds = %166
  br label %168

168:                                              ; preds = %167, %150
  br label %169

169:                                              ; preds = %168, %143
  store i32 0, ptr %9, align 4
  br label %170

170:                                              ; preds = %169, %163, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %171 = load i32, ptr %9, align 4
  switch i32 %171, label %179 [
    i32 0, label %172
    i32 15, label %177
  ]

172:                                              ; preds = %170
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %10, align 4, !tbaa !9
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %10, align 4, !tbaa !9
  br label %35, !llvm.loop !28

176:                                              ; preds = %35
  br label %177

177:                                              ; preds = %176, %170
  %178 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %178, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %179

179:                                              ; preds = %177, %170
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %180

180:                                              ; preds = %179, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %181 = load i32, ptr %4, align 4
  ret i32 %181
}

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @log_level_inc(i32 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @log_level_set(i32 noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @log_level_check(i32 noundef) #3

declare void @log_logf(i32 noundef, 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 = { inlinehint nounwind willreturn memory(read) 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 = { inlinehint 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 = { "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) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 280}
!12 = !{!"TStoreUtil", !13, i64 0, !14, i64 40, !14, i64 120, !17, i64 200, !19, i64 240}
!13 = !{!"TensorStore", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!"Stream", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !15, i64 40, !16, i64 64, !10, i64 72}
!15 = !{!"StreamInt", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"StringStore", !6, i64 0, !6, i64 8, !18, i64 16}
!18 = !{!"AllocatorArena", !16, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40}
!20 = !{!7, !7, i64 0}
!21 = !{!12, !6, i64 248}
!22 = !{!12, !6, i64 256}
!23 = !{!12, !6, i64 264}
!24 = !{!12, !6, i64 272}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!12, !6, i64 240}
!28 = distinct !{!28, !26}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [1 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @tsu_argv_load(ptr nocapture noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #0 {
  %4 = icmp slt i32 %1, 2
  br i1 %4, label %.thread88, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 240
  %7 = getelementptr inbounds i8, ptr %0, i64 280
  %8 = load i32, ptr %7, align 8, !tbaa !5
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph102, label %10

10:                                               ; preds = %5
  store i32 4, ptr %7, align 8, !tbaa !5
  br label %.lr.ph102

.lr.ph102:                                        ; preds = %10, %5
  %11 = getelementptr inbounds i8, ptr %0, i64 272
  %12 = getelementptr inbounds i8, ptr %0, i64 264
  %13 = getelementptr inbounds i8, ptr %0, i64 256
  %14 = getelementptr inbounds i8, ptr %0, i64 248
  br label %15

15:                                               ; preds = %.lr.ph102, %.loopexit
  %.053101 = phi i32 [ 1, %.lr.ph102 ], [ %56, %.loopexit ]
  %16 = sext i32 %.053101 to i64
  %17 = getelementptr inbounds ptr, ptr %2, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = load i8, ptr %18, align 1, !tbaa !19
  %20 = icmp eq i8 %19, 45
  br i1 %20, label %.preheader, label %51

.preheader:                                       ; preds = %15
  %21 = getelementptr inbounds i8, ptr %18, i64 1
  %22 = load i8, ptr %21, align 1, !tbaa !19
  %.not6398 = icmp eq i8 %22, 0
  br i1 %.not6398, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %48
  %indvars.iv = phi i64 [ %indvars.iv.next, %48 ], [ 1, %.preheader ]
  %23 = phi i8 [ %50, %48 ], [ %22, %.preheader ]
  %.15499 = phi i32 [ %.356.ph, %48 ], [ %.053101, %.preheader ]
  %24 = add nsw i32 %.15499, 1
  %25 = icmp slt i32 %24, %1
  br i1 %25, label %26, label %30

26:                                               ; preds = %.lr.ph
  %27 = sext i32 %24 to i64
  %28 = getelementptr inbounds ptr, ptr %2, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  br label %30

30:                                               ; preds = %.lr.ph, %26
  %31 = phi ptr [ %29, %26 ], [ @.str, %.lr.ph ]
  switch i8 %23, label %44 [
    i8 105, label %32
    i8 111, label %33
    i8 116, label %34
    i8 84, label %35
    i8 110, label %36
    i8 113, label %38
    i8 118, label %40
    i8 100, label %42
    i8 104, label %.thread88
  ]

32:                                               ; preds = %30
  store ptr %31, ptr %14, align 8, !tbaa !20
  br label %48

33:                                               ; preds = %30
  store ptr %31, ptr %13, align 8, !tbaa !21
  br label %48

34:                                               ; preds = %30
  store ptr %31, ptr %12, align 8, !tbaa !22
  br label %48

35:                                               ; preds = %30
  store ptr %31, ptr %11, align 8, !tbaa !23
  br label %48

36:                                               ; preds = %30
  %37 = tail call i32 @atoi(ptr nocapture noundef %31) #4
  store i32 %37, ptr %7, align 8, !tbaa !5
  br label %48

38:                                               ; preds = %30
  %39 = tail call i32 @log_level_inc(i32 noundef -10)
  br label %48

40:                                               ; preds = %30
  %41 = tail call i32 @log_level_inc(i32 noundef 10)
  br label %48

42:                                               ; preds = %30
  %43 = tail call i32 @log_level_set(i32 noundef 50)
  br label %48

44:                                               ; preds = %30
  %45 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %45, label %46, label %.thread88

46:                                               ; preds = %44
  %47 = sext i8 %23 to i32
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.1, i32 noundef %47) #5
  br label %.thread88

48:                                               ; preds = %42, %40, %38, %36, %35, %34, %33, %32
  %.356.ph = phi i32 [ %24, %32 ], [ %24, %33 ], [ %24, %34 ], [ %24, %35 ], [ %24, %36 ], [ %.15499, %38 ], [ %.15499, %40 ], [ %.15499, %42 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %49 = getelementptr inbounds i8, ptr %18, i64 %indvars.iv.next
  %50 = load i8, ptr %49, align 1, !tbaa !19
  %.not63 = icmp eq i8 %50, 0
  br i1 %.not63, label %.loopexit, label %.lr.ph, !llvm.loop !24

51:                                               ; preds = %15
  %52 = load ptr, ptr %6, align 8, !tbaa !26
  %.not = icmp eq ptr %52, null
  br i1 %.not, label %.thread76, label %53

.thread76:                                        ; preds = %51
  store ptr %18, ptr %6, align 8, !tbaa !26
  br label %.loopexit

53:                                               ; preds = %51
  %54 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %54, label %55, label %.thread88

55:                                               ; preds = %53
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.2) #5
  br label %.thread88

.loopexit:                                        ; preds = %48, %.preheader, %.thread76
  %.65980 = phi i32 [ %.053101, %.thread76 ], [ %.053101, %.preheader ], [ %.356.ph, %48 ]
  %56 = add nsw i32 %.65980, 1
  %57 = icmp slt i32 %56, %1
  br i1 %57, label %15, label %.thread88, !llvm.loop !27

.thread88:                                        ; preds = %.loopexit, %30, %46, %44, %55, %53, %3
  %.7 = phi i32 [ 0, %3 ], [ -1, %53 ], [ -1, %55 ], [ -1, %44 ], [ -1, %46 ], [ 0, %30 ], [ 1, %.loopexit ]
  ret i32 %.7
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @log_level_inc(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @log_level_set(i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @log_level_check(i32 noundef) local_unnamed_addr #2

declare void @log_logf(i32 noundef, ptr 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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #2 = { inlinehint 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 = { "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 }

!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, !14, i64 280}
!6 = !{!"TStoreUtil", !7, i64 0, !11, i64 40, !11, i64 120, !15, i64 200, !17, i64 240}
!7 = !{!"TensorStore", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"Stream", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !12, i64 40, !13, i64 64, !14, i64 72}
!12 = !{!"StreamInt", !9, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!"int", !9, i64 0}
!15 = !{!"StringStore", !8, i64 0, !8, i64 8, !16, i64 16}
!16 = !{!"AllocatorArena", !13, i64 0, !8, i64 8, !8, i64 16}
!17 = !{!"", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !14, i64 40}
!18 = !{!8, !8, i64 0}
!19 = !{!9, !9, i64 0}
!20 = !{!6, !8, i64 248}
!21 = !{!6, !8, i64 256}
!22 = !{!6, !8, i64 264}
!23 = !{!6, !8, i64 272}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!6, !8, i64 240}
!27 = distinct !{!27, !25}


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