; 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.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 x i8], align 1

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

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

declare void @log_logf(i32 noundef, ptr noundef, ...) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @tsu_setup(ptr noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %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 double, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.TStoreUtil, ptr %13, i32 0, i32 3
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.TStoreUtil, ptr %15, i32 0, i32 0
  %17 = getelementptr inbounds %struct.TensorStore, ptr %16, i32 0, i32 4
  store ptr %14, ptr %17, align 8, !tbaa !11
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.TStoreUtil, ptr %18, i32 0, i32 4
  %20 = getelementptr inbounds %struct.anon, ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  %22 = call i32 @strcmp(ptr noundef %21, ptr noundef @.str.3) #6
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %52, label %24

24:                                               ; preds = %1
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.TStoreUtil, ptr %25, i32 0, i32 1
  %27 = call i32 @stream_open_std(ptr noundef %26, i32 noundef 0, i32 noundef 1)
  store i32 %27, ptr %5, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %29 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %29, ptr %6, align 4, !tbaa !9
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = icmp slt i32 %30, 0
  br i1 %31, label %32, label %46

32:                                               ; preds = %28
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  %35 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %35, label %36, label %37

36:                                               ; preds = %34
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.4)
  br label %37

37:                                               ; preds = %36, %34
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %41, ptr %4, align 4, !tbaa !9
  store i32 10, ptr %7, align 4
  br label %47

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  br label %46

46:                                               ; preds = %45, %28
  store i32 0, ptr %7, align 4
  br label %47

47:                                               ; preds = %46, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %48 = load i32, ptr %7, align 4
  switch i32 %48, label %218 [
    i32 0, label %49
    i32 10, label %216
  ]

49:                                               ; preds = %47
  br label %50

50:                                               ; preds = %49
  br label %51

51:                                               ; preds = %50
  br label %108

52:                                               ; preds = %1
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.TStoreUtil, ptr %53, i32 0, i32 4
  %55 = getelementptr inbounds %struct.anon, ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !20
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %94

58:                                               ; preds = %52
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.TStoreUtil, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.TStoreUtil, ptr %61, i32 0, i32 4
  %63 = getelementptr inbounds %struct.anon, ptr %62, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = call i32 @stream_posix_open_file(ptr noundef %60, ptr noundef %64, i32 noundef 65)
  store i32 %65, ptr %5, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %67 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %67, ptr %8, align 4, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = icmp slt i32 %68, 0
  br i1 %69, label %70, label %88

70:                                               ; preds = %66
  br label %71

71:                                               ; preds = %70
  br label %72

72:                                               ; preds = %71
  %73 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %73, label %74, label %79

74:                                               ; preds = %72
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.TStoreUtil, ptr %75, i32 0, i32 4
  %77 = getelementptr inbounds %struct.anon, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !20
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.5, ptr noundef %78)
  br label %79

79:                                               ; preds = %74, %72
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %83, ptr %4, align 4, !tbaa !9
  store i32 10, ptr %7, align 4
  br label %89

84:                                               ; No predecessors!
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87, %66
  store i32 0, ptr %7, align 4
  br label %89

89:                                               ; preds = %88, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %90 = load i32, ptr %7, align 4
  switch i32 %90, label %218 [
    i32 0, label %91
    i32 10, label %216
  ]

91:                                               ; preds = %89
  br label %92

92:                                               ; preds = %91
  br label %93

93:                                               ; preds = %92
  br label %107

94:                                               ; preds = %52
  br label %95

95:                                               ; preds = %94
  br label %96

96:                                               ; preds = %95
  %97 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %97, label %98, label %99

98:                                               ; preds = %96
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.6)
  br label %99

99:                                               ; preds = %98, %96
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  store i32 -1, ptr %4, align 4, !tbaa !9
  br label %216

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  br label %106

106:                                              ; preds = %105
  br label %107

107:                                              ; preds = %106, %93
  br label %108

108:                                              ; preds = %107, %51
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.TStoreUtil, ptr %109, i32 0, i32 4
  %111 = getelementptr inbounds %struct.anon, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !21
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %150

114:                                              ; preds = %108
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.TStoreUtil, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.TStoreUtil, ptr %117, i32 0, i32 4
  %119 = getelementptr inbounds %struct.anon, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !21
  %121 = call i32 @stream_posix_open_file(ptr noundef %116, ptr noundef %120, i32 noundef 4)
  store i32 %121, ptr %5, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %123 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %123, ptr %9, align 4, !tbaa !9
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = icmp slt i32 %124, 0
  br i1 %125, label %126, label %144

126:                                              ; preds = %122
  br label %127

127:                                              ; preds = %126
  br label %128

128:                                              ; preds = %127
  %129 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %129, label %130, label %135

130:                                              ; preds = %128
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.TStoreUtil, ptr %131, i32 0, i32 4
  %133 = getelementptr inbounds %struct.anon, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !21
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.5, ptr noundef %134)
  br label %135

135:                                              ; preds = %130, %128
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %139, ptr %4, align 4, !tbaa !9
  store i32 10, ptr %7, align 4
  br label %145

140:                                              ; No predecessors!
  br label %141

141:                                              ; preds = %140
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  br label %144

144:                                              ; preds = %143, %122
  store i32 0, ptr %7, align 4
  br label %145

145:                                              ; preds = %144, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %146 = load i32, ptr %7, align 4
  switch i32 %146, label %218 [
    i32 0, label %147
    i32 10, label %216
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  br label %178

150:                                              ; preds = %108
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.TStoreUtil, ptr %151, i32 0, i32 2
  %153 = call i32 @stream_open_std(ptr noundef %152, i32 noundef 1, i32 noundef 2)
  store i32 %153, ptr %5, align 4, !tbaa !9
  br label %154

154:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %155 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %155, ptr %10, align 4, !tbaa !9
  %156 = load i32, ptr %10, align 4, !tbaa !9
  %157 = icmp slt i32 %156, 0
  br i1 %157, label %158, label %172

158:                                              ; preds = %154
  br label %159

159:                                              ; preds = %158
  br label %160

160:                                              ; preds = %159
  %161 = call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %161, label %162, label %163

162:                                              ; preds = %160
  call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef @.str.7)
  br label %163

163:                                              ; preds = %162, %160
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %167, ptr %4, align 4, !tbaa !9
  store i32 10, ptr %7, align 4
  br label %173

168:                                              ; No predecessors!
  br label %169

169:                                              ; preds = %168
  br label %170

170:                                              ; preds = %169
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171, %154
  store i32 0, ptr %7, align 4
  br label %173

173:                                              ; preds = %172, %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %174 = load i32, ptr %7, align 4
  switch i32 %174, label %218 [
    i32 0, label %175
    i32 10, label %216
  ]

175:                                              ; preds = %173
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177, %149
  br label %179

179:                                              ; preds = %178
  %180 = call zeroext i1 @log_level_check(i32 noundef 50)
  br i1 %180, label %181, label %182

181:                                              ; preds = %179
  call void (i32, ptr, ...) @log_logf(i32 noundef 50, ptr noundef @.str.8)
  br label %182

182:                                              ; preds = %181, %179
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  %185 = call double (...) @timing_time()
  store double %185, ptr %11, align 8, !tbaa !22
  br label %186

186:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %187 = load ptr, ptr %3, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.TStoreUtil, ptr %187, i32 0, i32 0
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.TStoreUtil, ptr %189, i32 0, i32 1
  %191 = call i32 @tstore_read(ptr noundef %188, ptr noundef %190, ptr noundef null, ptr noundef null)
  store i32 %191, ptr %12, align 4, !tbaa !9
  %192 = load i32, ptr %12, align 4, !tbaa !9
  %193 = icmp slt i32 %192, 0
  br i1 %193, label %194, label %199

194:                                              ; preds = %186
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %196, ptr %4, align 4, !tbaa !9
  store i32 10, ptr %7, align 4
  br label %200

197:                                              ; No predecessors!
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198, %186
  store i32 0, ptr %7, align 4
  br label %200

200:                                              ; preds = %199, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %201 = load i32, ptr %7, align 4
  switch i32 %201, label %218 [
    i32 0, label %202
    i32 10, label %216
  ]

202:                                              ; preds = %200
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  %205 = call double (...) @timing_time()
  %206 = load double, ptr %11, align 8, !tbaa !22
  %207 = fsub double %205, %206
  store double %207, ptr %11, align 8, !tbaa !22
  br label %208

208:                                              ; preds = %204
  %209 = call zeroext i1 @log_level_check(i32 noundef 30)
  br i1 %209, label %210, label %213

210:                                              ; preds = %208
  %211 = load double, ptr %11, align 8, !tbaa !22
  %212 = fmul double %211, 1.000000e+03
  call void (i32, ptr, ...) @log_logf(i32 noundef 30, ptr noundef @.str.9, double noundef %212)
  br label %213

213:                                              ; preds = %210, %208
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215, %200, %173, %145, %102, %89, %47
  %217 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %217, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %218

218:                                              ; preds = %216, %200, %173, %145, %89, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %219 = load i32, ptr %2, align 4
  ret i32 %219
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

declare i32 @stream_open_std(ptr noundef, i32 noundef, i32 noundef) #2

declare i32 @stream_posix_open_file(ptr noundef, ptr noundef, i32 noundef) #2

declare double @timing_time(...) #2

declare i32 @tstore_read(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 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 #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, !6, i64 32}
!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 = !{!12, !6, i64 248}
!21 = !{!12, !6, i64 256}
!22 = !{!23, !23, i64 0}
!23 = !{!"double", !7, i64 0}


; 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.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [21 x i8], align 1

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

declare void @log_logf(i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @tsu_setup(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 200
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %2, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 248
  %5 = load ptr, ptr %4, align 8, !tbaa !18
  %6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.3) #4
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %14

7:                                                ; preds = %1
  %8 = getelementptr inbounds i8, ptr %0, i64 40
  %9 = tail call i32 @stream_open_std(ptr noundef nonnull %8, i32 noundef 0, i32 noundef 1) #5
  %10 = icmp slt i32 %9, 0
  br i1 %10, label %11, label %26

11:                                               ; preds = %7
  %12 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %12, label %13, label %.thread

13:                                               ; preds = %11
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.4) #5
  br label %.thread

14:                                               ; preds = %1
  %.not50 = icmp eq ptr %5, null
  br i1 %.not50, label %23, label %15

15:                                               ; preds = %14
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  %17 = tail call i32 @stream_posix_open_file(ptr noundef nonnull %16, ptr noundef nonnull %5, i32 noundef 65) #5
  %18 = icmp slt i32 %17, 0
  br i1 %18, label %19, label %26

19:                                               ; preds = %15
  %20 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %20, label %21, label %.thread

21:                                               ; preds = %19
  %22 = load ptr, ptr %4, align 8, !tbaa !18
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.5, ptr noundef %22) #5
  br label %.thread

23:                                               ; preds = %14
  %24 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %24, label %25, label %.thread

25:                                               ; preds = %23
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.6) #5
  br label %.thread

26:                                               ; preds = %15, %7
  %27 = getelementptr inbounds i8, ptr %0, i64 256
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %.not51 = icmp eq ptr %28, null
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  br i1 %.not51, label %37, label %30

30:                                               ; preds = %26
  %31 = tail call i32 @stream_posix_open_file(ptr noundef nonnull %29, ptr noundef nonnull %28, i32 noundef 4) #5
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %43

33:                                               ; preds = %30
  %34 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %34, label %35, label %.thread

35:                                               ; preds = %33
  %36 = load ptr, ptr %27, align 8, !tbaa !19
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.5, ptr noundef %36) #5
  br label %.thread

37:                                               ; preds = %26
  %38 = tail call i32 @stream_open_std(ptr noundef nonnull %29, i32 noundef 1, i32 noundef 2) #5
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %37
  %41 = tail call zeroext i1 @log_level_check(i32 noundef 10)
  br i1 %41, label %42, label %.thread

42:                                               ; preds = %40
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 10, ptr noundef nonnull @.str.7) #5
  br label %.thread

43:                                               ; preds = %37, %30
  %44 = tail call zeroext i1 @log_level_check(i32 noundef 50)
  br i1 %44, label %45, label %46

45:                                               ; preds = %43
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 50, ptr noundef nonnull @.str.8) #5
  br label %46

46:                                               ; preds = %45, %43
  %47 = tail call double (...) @timing_time() #5
  %48 = getelementptr inbounds i8, ptr %0, i64 40
  %49 = tail call i32 @tstore_read(ptr noundef nonnull %0, ptr noundef nonnull %48, ptr noundef null, ptr noundef null) #5
  %50 = icmp sgt i32 %49, -1
  br i1 %50, label %51, label %.thread

51:                                               ; preds = %46
  %52 = tail call double (...) @timing_time() #5
  %53 = tail call zeroext i1 @log_level_check(i32 noundef 30)
  br i1 %53, label %54, label %.thread

54:                                               ; preds = %51
  %55 = fsub double %52, %47
  %56 = fmul double %55, 1.000000e+03
  tail call void (i32, ptr, ...) @log_logf(i32 noundef 30, ptr noundef nonnull @.str.9, double noundef %56) #5
  br label %.thread

.thread:                                          ; preds = %42, %40, %35, %33, %21, %19, %13, %11, %46, %54, %51, %23, %25
  %.0 = phi i32 [ %49, %46 ], [ 1, %54 ], [ 1, %51 ], [ -1, %23 ], [ -1, %25 ], [ %9, %11 ], [ %9, %13 ], [ %17, %19 ], [ %17, %21 ], [ %31, %33 ], [ %31, %35 ], [ %38, %40 ], [ %38, %42 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

declare i32 @stream_open_std(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @stream_posix_open_file(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare double @timing_time(...) local_unnamed_addr #1

declare i32 @tstore_read(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

attributes #0 = { 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 #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 #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 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 #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, !8, i64 32}
!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 = !{!6, !8, i64 248}
!19 = !{!6, !8, i64 256}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass