; LLVM IR from begeekmyfriend/leetcode :: 0130_surrounded_regions (surrounded_regions)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: nounwind uwtable
declare dso_local void @solve(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 uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 5, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %7 = load i32, ptr %4, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = mul i64 %8, 4
  %10 = call noalias ptr @malloc(i64 noundef %9) #5
  store ptr %10, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = mul i64 %12, 8
  %14 = call noalias ptr @malloc(i64 noundef %13) #5
  store ptr %14, ptr %6, align 8, !tbaa !9
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = call noalias ptr @malloc(i64 noundef %16) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 0
  store ptr %17, ptr %19, align 8, !tbaa !9
  %20 = load ptr, ptr %6, align 8, !tbaa !9
  %21 = getelementptr inbounds ptr, ptr %20, i64 0
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %22, i64 0
  store i8 88, ptr %23, align 1, !tbaa !11
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 1
  store i8 88, ptr %27, align 1, !tbaa !11
  %28 = load ptr, ptr %6, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %28, i64 0
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %30, i64 2
  store i8 88, ptr %31, align 1, !tbaa !11
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = getelementptr inbounds ptr, ptr %32, i64 0
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 3
  store i8 88, ptr %35, align 1, !tbaa !11
  %36 = load ptr, ptr %6, align 8, !tbaa !9
  %37 = getelementptr inbounds ptr, ptr %36, i64 0
  %38 = load ptr, ptr %37, align 8, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %38, i64 4
  store i8 88, ptr %39, align 1, !tbaa !11
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = call noalias ptr @malloc(i64 noundef %41) #5
  %43 = load ptr, ptr %6, align 8, !tbaa !9
  %44 = getelementptr inbounds ptr, ptr %43, i64 1
  store ptr %42, ptr %44, align 8, !tbaa !9
  %45 = load ptr, ptr %6, align 8, !tbaa !9
  %46 = getelementptr inbounds ptr, ptr %45, i64 1
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds i8, ptr %47, i64 0
  store i8 79, ptr %48, align 1, !tbaa !11
  %49 = load ptr, ptr %6, align 8, !tbaa !9
  %50 = getelementptr inbounds ptr, ptr %49, i64 1
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds i8, ptr %51, i64 1
  store i8 88, ptr %52, align 1, !tbaa !11
  %53 = load ptr, ptr %6, align 8, !tbaa !9
  %54 = getelementptr inbounds ptr, ptr %53, i64 1
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %55, i64 2
  store i8 79, ptr %56, align 1, !tbaa !11
  %57 = load ptr, ptr %6, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %57, i64 1
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %59, i64 3
  store i8 79, ptr %60, align 1, !tbaa !11
  %61 = load ptr, ptr %6, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %61, i64 1
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds i8, ptr %63, i64 4
  store i8 88, ptr %64, align 1, !tbaa !11
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = call noalias ptr @malloc(i64 noundef %66) #5
  %68 = load ptr, ptr %6, align 8, !tbaa !9
  %69 = getelementptr inbounds ptr, ptr %68, i64 2
  store ptr %67, ptr %69, align 8, !tbaa !9
  %70 = load ptr, ptr %6, align 8, !tbaa !9
  %71 = getelementptr inbounds ptr, ptr %70, i64 2
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  %73 = getelementptr inbounds i8, ptr %72, i64 0
  store i8 79, ptr %73, align 1, !tbaa !11
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = getelementptr inbounds ptr, ptr %74, i64 2
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds i8, ptr %76, i64 1
  store i8 79, ptr %77, align 1, !tbaa !11
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = getelementptr inbounds ptr, ptr %78, i64 2
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = getelementptr inbounds i8, ptr %80, i64 2
  store i8 88, ptr %81, align 1, !tbaa !11
  %82 = load ptr, ptr %6, align 8, !tbaa !9
  %83 = getelementptr inbounds ptr, ptr %82, i64 2
  %84 = load ptr, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds i8, ptr %84, i64 3
  store i8 79, ptr %85, align 1, !tbaa !11
  %86 = load ptr, ptr %6, align 8, !tbaa !9
  %87 = getelementptr inbounds ptr, ptr %86, i64 2
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %88, i64 4
  store i8 88, ptr %89, align 1, !tbaa !11
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = call noalias ptr @malloc(i64 noundef %91) #5
  %93 = load ptr, ptr %6, align 8, !tbaa !9
  %94 = getelementptr inbounds ptr, ptr %93, i64 3
  store ptr %92, ptr %94, align 8, !tbaa !9
  %95 = load ptr, ptr %6, align 8, !tbaa !9
  %96 = getelementptr inbounds ptr, ptr %95, i64 3
  %97 = load ptr, ptr %96, align 8, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %97, i64 0
  store i8 88, ptr %98, align 1, !tbaa !11
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  %100 = getelementptr inbounds ptr, ptr %99, i64 3
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %101, i64 1
  store i8 88, ptr %102, align 1, !tbaa !11
  %103 = load ptr, ptr %6, align 8, !tbaa !9
  %104 = getelementptr inbounds ptr, ptr %103, i64 3
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds i8, ptr %105, i64 2
  store i8 79, ptr %106, align 1, !tbaa !11
  %107 = load ptr, ptr %6, align 8, !tbaa !9
  %108 = getelementptr inbounds ptr, ptr %107, i64 3
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 3
  store i8 88, ptr %110, align 1, !tbaa !11
  %111 = load ptr, ptr %6, align 8, !tbaa !9
  %112 = getelementptr inbounds ptr, ptr %111, i64 3
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = getelementptr inbounds i8, ptr %113, i64 4
  store i8 88, ptr %114, align 1, !tbaa !11
  %115 = load i32, ptr %4, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = call noalias ptr @malloc(i64 noundef %116) #5
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %118, i64 4
  store ptr %117, ptr %119, align 8, !tbaa !9
  %120 = load ptr, ptr %6, align 8, !tbaa !9
  %121 = getelementptr inbounds ptr, ptr %120, i64 4
  %122 = load ptr, ptr %121, align 8, !tbaa !9
  %123 = getelementptr inbounds i8, ptr %122, i64 0
  store i8 88, ptr %123, align 1, !tbaa !11
  %124 = load ptr, ptr %6, align 8, !tbaa !9
  %125 = getelementptr inbounds ptr, ptr %124, i64 4
  %126 = load ptr, ptr %125, align 8, !tbaa !9
  %127 = getelementptr inbounds i8, ptr %126, i64 1
  store i8 88, ptr %127, align 1, !tbaa !11
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = getelementptr inbounds ptr, ptr %128, i64 4
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  %131 = getelementptr inbounds i8, ptr %130, i64 2
  store i8 79, ptr %131, align 1, !tbaa !11
  %132 = load ptr, ptr %6, align 8, !tbaa !9
  %133 = getelementptr inbounds ptr, ptr %132, i64 4
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %134, i64 3
  store i8 79, ptr %135, align 1, !tbaa !11
  %136 = load ptr, ptr %6, align 8, !tbaa !9
  %137 = getelementptr inbounds ptr, ptr %136, i64 4
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = getelementptr inbounds i8, ptr %138, i64 4
  store i8 88, ptr %139, align 1, !tbaa !11
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %175, %0
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %178

144:                                              ; preds = %140
  %145 = load i32, ptr %4, align 4, !tbaa !5
  %146 = load ptr, ptr %5, align 8, !tbaa !9
  %147 = load i32, ptr %2, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %146, i64 %148
  store i32 %145, ptr %149, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %170, %144
  %151 = load i32, ptr %3, align 4, !tbaa !5
  %152 = load ptr, ptr %5, align 8, !tbaa !9
  %153 = load i32, ptr %2, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds i32, ptr %152, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = icmp slt i32 %151, %156
  br i1 %157, label %158, label %173

158:                                              ; preds = %150
  %159 = load ptr, ptr %6, align 8, !tbaa !9
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds ptr, ptr %159, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = load i32, ptr %3, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %163, i64 %165
  %167 = load i8, ptr %166, align 1, !tbaa !11
  %168 = sext i8 %167 to i32
  %169 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %168)
  br label %170

170:                                              ; preds = %158
  %171 = load i32, ptr %3, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %3, align 4, !tbaa !5
  br label %150, !llvm.loop !12

173:                                              ; preds = %150
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %175

175:                                              ; preds = %173
  %176 = load i32, ptr %2, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %2, align 4, !tbaa !5
  br label %140, !llvm.loop !14

178:                                              ; preds = %140
  %179 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %180 = load ptr, ptr %6, align 8, !tbaa !9
  %181 = load i32, ptr %4, align 4, !tbaa !5
  %182 = load ptr, ptr %5, align 8, !tbaa !9
  call void @solve(ptr noundef %180, i32 noundef %181, ptr noundef %182)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %213, %178
  %184 = load i32, ptr %2, align 4, !tbaa !5
  %185 = load i32, ptr %4, align 4, !tbaa !5
  %186 = icmp slt i32 %184, %185
  br i1 %186, label %187, label %216

187:                                              ; preds = %183
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %208, %187
  %189 = load i32, ptr %3, align 4, !tbaa !5
  %190 = load ptr, ptr %5, align 8, !tbaa !9
  %191 = load i32, ptr %2, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %190, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = icmp slt i32 %189, %194
  br i1 %195, label %196, label %211

196:                                              ; preds = %188
  %197 = load ptr, ptr %6, align 8, !tbaa !9
  %198 = load i32, ptr %2, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds ptr, ptr %197, i64 %199
  %201 = load ptr, ptr %200, align 8, !tbaa !9
  %202 = load i32, ptr %3, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds i8, ptr %201, i64 %203
  %205 = load i8, ptr %204, align 1, !tbaa !11
  %206 = sext i8 %205 to i32
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %206)
  br label %208

208:                                              ; preds = %196
  %209 = load i32, ptr %3, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %3, align 4, !tbaa !5
  br label %188, !llvm.loop !15

211:                                              ; preds = %188
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %213

213:                                              ; preds = %211
  %214 = load i32, ptr %2, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %2, align 4, !tbaa !5
  br label %183, !llvm.loop !16

216:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %217 = load i32, ptr %1, align 4
  ret i32 %217
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare i32 @printf(ptr noundef, ...) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 }
attributes #5 = { nounwind allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !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"

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

; Function Attrs: nounwind uwtable
declare dso_local void @solve(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.lr.ph:
  %0 = tail call noalias dereferenceable_or_null(20) ptr @malloc(i64 noundef 20) #4
  %1 = tail call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #4
  %2 = tail call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #4
  store ptr %2, ptr %1, align 8, !tbaa !5
  %3 = tail call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #4
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %2, i8 88, i64 5, i1 false)
  store ptr %3, ptr %4, align 8, !tbaa !5
  store <4 x i8> <i8 79, i8 88, i8 79, i8 79>, ptr %3, align 1, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %3, i64 4
  store i8 88, ptr %5, align 1, !tbaa !9
  %6 = tail call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #4
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %6, ptr %7, align 8, !tbaa !5
  store <4 x i8> <i8 79, i8 79, i8 88, i8 79>, ptr %6, align 1, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %6, i64 4
  store i8 88, ptr %8, align 1, !tbaa !9
  %9 = tail call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #4
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr %9, ptr %10, align 8, !tbaa !5
  store <4 x i8> <i8 88, i8 88, i8 79, i8 88>, ptr %9, align 1, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %9, i64 4
  store i8 88, ptr %11, align 1, !tbaa !9
  %12 = tail call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #4
  %13 = getelementptr inbounds i8, ptr %1, i64 32
  store ptr %12, ptr %13, align 8, !tbaa !5
  store <4 x i8> <i8 88, i8 88, i8 79, i8 79>, ptr %12, align 1, !tbaa !9
  %14 = getelementptr inbounds i8, ptr %12, i64 4
  store i8 88, ptr %14, align 1, !tbaa !9
  store i32 5, ptr %0, align 4, !tbaa !10
  %15 = load i8, ptr %2, align 1, !tbaa !9
  %16 = sext i8 %15 to i32
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
  %18 = getelementptr inbounds i8, ptr %2, i64 1
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = sext i8 %19 to i32
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20)
  %22 = getelementptr inbounds i8, ptr %2, i64 2
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = sext i8 %23 to i32
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %24)
  %26 = getelementptr inbounds i8, ptr %2, i64 3
  %27 = load i8, ptr %26, align 1, !tbaa !9
  %28 = sext i8 %27 to i32
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28)
  %30 = getelementptr inbounds i8, ptr %2, i64 4
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %32)
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %35 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 5, ptr %35, align 4, !tbaa !10
  %36 = load i8, ptr %3, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %37)
  %39 = getelementptr inbounds i8, ptr %3, i64 1
  %40 = load i8, ptr %39, align 1, !tbaa !9
  %41 = sext i8 %40 to i32
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %41)
  %43 = getelementptr inbounds i8, ptr %3, i64 2
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = sext i8 %44 to i32
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %45)
  %47 = getelementptr inbounds i8, ptr %3, i64 3
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = sext i8 %48 to i32
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %49)
  %51 = getelementptr inbounds i8, ptr %3, i64 4
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %53)
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %56 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 5, ptr %56, align 4, !tbaa !10
  %57 = load i8, ptr %6, align 1, !tbaa !9
  %58 = sext i8 %57 to i32
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %58)
  %60 = getelementptr inbounds i8, ptr %6, i64 1
  %61 = load i8, ptr %60, align 1, !tbaa !9
  %62 = sext i8 %61 to i32
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %62)
  %64 = getelementptr inbounds i8, ptr %6, i64 2
  %65 = load i8, ptr %64, align 1, !tbaa !9
  %66 = sext i8 %65 to i32
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %66)
  %68 = getelementptr inbounds i8, ptr %6, i64 3
  %69 = load i8, ptr %68, align 1, !tbaa !9
  %70 = sext i8 %69 to i32
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %70)
  %72 = getelementptr inbounds i8, ptr %6, i64 4
  %73 = load i8, ptr %72, align 1, !tbaa !9
  %74 = sext i8 %73 to i32
  %75 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %74)
  %76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %77 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 5, ptr %77, align 4, !tbaa !10
  %78 = load i8, ptr %9, align 1, !tbaa !9
  %79 = sext i8 %78 to i32
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %79)
  %81 = getelementptr inbounds i8, ptr %9, i64 1
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = sext i8 %82 to i32
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %83)
  %85 = getelementptr inbounds i8, ptr %9, i64 2
  %86 = load i8, ptr %85, align 1, !tbaa !9
  %87 = sext i8 %86 to i32
  %88 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %87)
  %89 = getelementptr inbounds i8, ptr %9, i64 3
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = sext i8 %90 to i32
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %91)
  %93 = getelementptr inbounds i8, ptr %9, i64 4
  %94 = load i8, ptr %93, align 1, !tbaa !9
  %95 = sext i8 %94 to i32
  %96 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %95)
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %98 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 5, ptr %98, align 4, !tbaa !10
  %99 = load i8, ptr %12, align 1, !tbaa !9
  %100 = sext i8 %99 to i32
  %101 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %100)
  %102 = getelementptr inbounds i8, ptr %12, i64 1
  %103 = load i8, ptr %102, align 1, !tbaa !9
  %104 = sext i8 %103 to i32
  %105 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %104)
  %106 = getelementptr inbounds i8, ptr %12, i64 2
  %107 = load i8, ptr %106, align 1, !tbaa !9
  %108 = sext i8 %107 to i32
  %109 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %108)
  %110 = getelementptr inbounds i8, ptr %12, i64 3
  %111 = load i8, ptr %110, align 1, !tbaa !9
  %112 = sext i8 %111 to i32
  %113 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %112)
  %114 = getelementptr inbounds i8, ptr %12, i64 4
  %115 = load i8, ptr %114, align 1, !tbaa !9
  %116 = sext i8 %115 to i32
  %117 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %116)
  %118 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %119 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  tail call void @solve(ptr noundef nonnull %1, i32 noundef 5, ptr noundef nonnull %0)
  %120 = load i32, ptr %0, align 4, !tbaa !10
  %121 = icmp sgt i32 %120, 0
  br i1 %121, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %.lr.ph, %.lr.ph68
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph68 ], [ 0, %.lr.ph ]
  %122 = load ptr, ptr %1, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i64 %indvars.iv75
  %124 = load i8, ptr %123, align 1, !tbaa !9
  %125 = sext i8 %124 to i32
  %126 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %125)
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %127 = load i32, ptr %0, align 4, !tbaa !10
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next76, %128
  br i1 %129, label %.lr.ph68, label %._crit_edge69, !llvm.loop !12

._crit_edge69:                                    ; preds = %.lr.ph68, %.lr.ph
  %130 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %131 = load i32, ptr %35, align 4, !tbaa !10
  %132 = icmp sgt i32 %131, 0
  br i1 %132, label %.lr.ph68.1, label %._crit_edge69.1

.lr.ph68.1:                                       ; preds = %._crit_edge69, %.lr.ph68.1
  %indvars.iv75.1 = phi i64 [ %indvars.iv.next76.1, %.lr.ph68.1 ], [ 0, %._crit_edge69 ]
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 %indvars.iv75.1
  %135 = load i8, ptr %134, align 1, !tbaa !9
  %136 = sext i8 %135 to i32
  %137 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %136)
  %indvars.iv.next76.1 = add nuw nsw i64 %indvars.iv75.1, 1
  %138 = load i32, ptr %35, align 4, !tbaa !10
  %139 = sext i32 %138 to i64
  %140 = icmp slt i64 %indvars.iv.next76.1, %139
  br i1 %140, label %.lr.ph68.1, label %._crit_edge69.1, !llvm.loop !12

._crit_edge69.1:                                  ; preds = %.lr.ph68.1, %._crit_edge69
  %141 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %142 = load i32, ptr %56, align 4, !tbaa !10
  %143 = icmp sgt i32 %142, 0
  br i1 %143, label %.lr.ph68.2, label %._crit_edge69.2

.lr.ph68.2:                                       ; preds = %._crit_edge69.1, %.lr.ph68.2
  %indvars.iv75.2 = phi i64 [ %indvars.iv.next76.2, %.lr.ph68.2 ], [ 0, %._crit_edge69.1 ]
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds i8, ptr %144, i64 %indvars.iv75.2
  %146 = load i8, ptr %145, align 1, !tbaa !9
  %147 = sext i8 %146 to i32
  %148 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %147)
  %indvars.iv.next76.2 = add nuw nsw i64 %indvars.iv75.2, 1
  %149 = load i32, ptr %56, align 4, !tbaa !10
  %150 = sext i32 %149 to i64
  %151 = icmp slt i64 %indvars.iv.next76.2, %150
  br i1 %151, label %.lr.ph68.2, label %._crit_edge69.2, !llvm.loop !12

._crit_edge69.2:                                  ; preds = %.lr.ph68.2, %._crit_edge69.1
  %152 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %153 = load i32, ptr %77, align 4, !tbaa !10
  %154 = icmp sgt i32 %153, 0
  br i1 %154, label %.lr.ph68.3, label %._crit_edge69.3

.lr.ph68.3:                                       ; preds = %._crit_edge69.2, %.lr.ph68.3
  %indvars.iv75.3 = phi i64 [ %indvars.iv.next76.3, %.lr.ph68.3 ], [ 0, %._crit_edge69.2 ]
  %155 = load ptr, ptr %10, align 8, !tbaa !5
  %156 = getelementptr inbounds i8, ptr %155, i64 %indvars.iv75.3
  %157 = load i8, ptr %156, align 1, !tbaa !9
  %158 = sext i8 %157 to i32
  %159 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %158)
  %indvars.iv.next76.3 = add nuw nsw i64 %indvars.iv75.3, 1
  %160 = load i32, ptr %77, align 4, !tbaa !10
  %161 = sext i32 %160 to i64
  %162 = icmp slt i64 %indvars.iv.next76.3, %161
  br i1 %162, label %.lr.ph68.3, label %._crit_edge69.3, !llvm.loop !12

._crit_edge69.3:                                  ; preds = %.lr.ph68.3, %._crit_edge69.2
  %163 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %164 = load i32, ptr %98, align 4, !tbaa !10
  %165 = icmp sgt i32 %164, 0
  br i1 %165, label %.lr.ph68.4, label %._crit_edge69.4

.lr.ph68.4:                                       ; preds = %._crit_edge69.3, %.lr.ph68.4
  %indvars.iv75.4 = phi i64 [ %indvars.iv.next76.4, %.lr.ph68.4 ], [ 0, %._crit_edge69.3 ]
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = getelementptr inbounds i8, ptr %166, i64 %indvars.iv75.4
  %168 = load i8, ptr %167, align 1, !tbaa !9
  %169 = sext i8 %168 to i32
  %170 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %169)
  %indvars.iv.next76.4 = add nuw nsw i64 %indvars.iv75.4, 1
  %171 = load i32, ptr %98, align 4, !tbaa !10
  %172 = sext i32 %171 to i64
  %173 = icmp slt i64 %indvars.iv.next76.4, %172
  br i1 %173, label %.lr.ph68.4, label %._crit_edge69.4, !llvm.loop !12

._crit_edge69.4:                                  ; preds = %.lr.ph68.4, %._crit_edge69.3
  %174 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass