; LLVM IR from t-dillon/tdoku :: other/fast_solv_9r2 (fast_solv_9r2)

; 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"

@verbose = external dso_local global i32, align 4
@SEARCH_LIMIT = external dso_local global i32, align 4
@matrix = external dso_local global [81 x i32], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @solve() #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 @fast_solv_9r2_main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [300 x i8], align 16
  %7 = alloca i8, align 1
  %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 i32, align 4
  %14 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 300, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %37, %2
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = call i32 @getopt(i32 noundef %16, ptr noundef %17, ptr noundef @.str) #6
  %19 = trunc i32 %18 to i8
  store i8 %19, ptr %7, align 1, !tbaa !11
  %20 = sext i8 %19 to i32
  %21 = icmp ne i32 %20, -1
  br i1 %21, label %22, label %38

22:                                               ; preds = %15
  %23 = load i8, ptr %7, align 1, !tbaa !11
  %24 = sext i8 %23 to i32
  switch i32 %24, label %36 [
    i32 115, label %25
    i32 113, label %31
    i32 118, label %32
    i32 104, label %35
  ]

25:                                               ; preds = %22
  %26 = load ptr, ptr @optarg, align 8, !tbaa !9
  %27 = call i32 @atoi(ptr noundef %26) #7
  store i32 %27, ptr @SEARCH_LIMIT, align 4, !tbaa !5
  %28 = icmp sgt i32 1, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %29, %25
  br label %37

31:                                               ; preds = %22
  store i32 0, ptr @verbose, align 4, !tbaa !5
  br label %37

32:                                               ; preds = %22
  %33 = load i32, ptr @verbose, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @verbose, align 4, !tbaa !5
  br label %37

35:                                               ; preds = %22
  br label %36

36:                                               ; preds = %35, %22
  call void @uso()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %168

37:                                               ; preds = %32, %31, %30
  br label %15, !llvm.loop !12

38:                                               ; preds = %15
  %39 = load i32, ptr %13, align 4, !tbaa !5
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %38
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %43 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %43, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %168

44:                                               ; preds = %38
  %45 = call i32 @make_links()
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  store i32 1, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %168

48:                                               ; preds = %44
  br label %49

49:                                               ; preds = %145, %113, %58, %48
  %50 = getelementptr inbounds [300 x i8], ptr %6, i64 0, i64 0
  %51 = load ptr, ptr @stdin, align 8, !tbaa !9
  %52 = call ptr @fgets(ptr noundef %50, i32 noundef 300, ptr noundef %51)
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %146

54:                                               ; preds = %49
  %55 = getelementptr inbounds [300 x i8], ptr %6, i64 0, i64 0
  %56 = call i64 @strlen(ptr noundef %55) #7
  %57 = icmp ult i64 %56, 81
  br i1 %57, label %58, label %59

58:                                               ; preds = %54
  br label %49, !llvm.loop !14

59:                                               ; preds = %54
  store i32 0, ptr %9, align 4, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %107, %59
  %61 = load i32, ptr %9, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [300 x i8], ptr %6, i64 0, i64 0
  %64 = call i64 @strlen(ptr noundef %63) #7
  %65 = icmp ult i64 %62, %64
  br i1 %65, label %66, label %110

66:                                               ; preds = %60
  %67 = load i32, ptr %8, align 4, !tbaa !5
  %68 = icmp slt i32 %67, 81
  br i1 %68, label %69, label %106

69:                                               ; preds = %66
  %70 = load i32, ptr %9, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [300 x i8], ptr %6, i64 0, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = sub nsw i32 %74, 46
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [81 x i32], ptr @matrix, i64 0, i64 %77
  store i32 %75, ptr %78, align 4, !tbaa !5
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [81 x i32], ptr @matrix, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %103

84:                                               ; preds = %69
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [81 x i32], ptr @matrix, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sub nsw i32 %88, 2
  store i32 %89, ptr %87, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [81 x i32], ptr @matrix, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp slt i32 %93, 0
  br i1 %94, label %101, label %95

95:                                               ; preds = %84
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [81 x i32], ptr @matrix, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp sgt i32 %99, 9
  br i1 %100, label %101, label %102

101:                                              ; preds = %95, %84
  store i32 -1, ptr %8, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %101, %95
  br label %103

103:                                              ; preds = %102, %69
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %8, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %103, %66
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %9, align 4, !tbaa !5
  br label %60, !llvm.loop !15

110:                                              ; preds = %60
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 81
  br i1 %112, label %113, label %114

113:                                              ; preds = %110
  br label %49, !llvm.loop !14

114:                                              ; preds = %110
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !5
  %117 = call i32 @solve()
  store i32 %117, ptr %13, align 4, !tbaa !5
  %118 = load i32, ptr %13, align 4, !tbaa !5
  %119 = icmp eq i32 %118, 1
  br i1 %119, label %120, label %125

120:                                              ; preds = %114
  %121 = load i32, ptr %12, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %12, align 4, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %11, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %120, %114
  %126 = load i32, ptr %13, align 4, !tbaa !5
  %127 = icmp sgt i32 %126, 1
  br i1 %127, label %128, label %133

128:                                              ; preds = %125
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = add nsw i32 %130, %129
  store i32 %131, ptr %11, align 4, !tbaa !5
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %133

133:                                              ; preds = %128, %125
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = icmp slt i32 %134, 0
  br i1 %135, label %136, label %139

136:                                              ; preds = %133
  %137 = load i32, ptr %10, align 4, !tbaa !5
  %138 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %137)
  br label %139

139:                                              ; preds = %136, %133
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = icmp eq i32 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %143)
  br label %145

145:                                              ; preds = %142, %139
  br label %49, !llvm.loop !14

146:                                              ; preds = %49
  %147 = load i32, ptr @verbose, align 4, !tbaa !5
  %148 = icmp sgt i32 %147, 1
  br i1 %148, label %149, label %161

149:                                              ; preds = %146
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %150, i32 noundef %151)
  %153 = load i32, ptr @SEARCH_LIMIT, align 4, !tbaa !5
  %154 = icmp sgt i32 %153, 1
  br i1 %154, label %155, label %158

155:                                              ; preds = %149
  %156 = load i32, ptr %12, align 4, !tbaa !5
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %156)
  br label %160

158:                                              ; preds = %149
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  br label %160

160:                                              ; preds = %158, %155
  br label %161

161:                                              ; preds = %160, %146
  %162 = load i32, ptr @verbose, align 4, !tbaa !5
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %167, label %164

164:                                              ; preds = %161
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %165)
  br label %167

167:                                              ; preds = %164, %161
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %168

168:                                              ; preds = %167, %47, %41, %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 300, ptr %6) #6
  %169 = load i32, ptr %3, align 4
  ret i32 %169
}

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @uso() #2

declare i32 @printf(ptr noundef, ...) #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @make_links() #2

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { 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 #5 = { "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 #6 = { nounwind }
attributes #7 = { 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 = !{!"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}


; 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"

@verbose = external dso_local local_unnamed_addr global i32, align 4
@SEARCH_LIMIT = external dso_local local_unnamed_addr global i32, align 4
@matrix = external dso_local local_unnamed_addr global [81 x i32], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @solve() local_unnamed_addr #2

; Function Attrs: mustprogress 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 range(i32 0, 2) i32 @fast_solv_9r2_main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca [300 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 300, ptr nonnull %3) #6
  %4 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #6
  %sext60 = shl i32 %4, 24
  %.not61 = icmp eq i32 %sext60, -16777216
  br i1 %.not61, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %2, %15
  %sext63 = phi i32 [ %sext, %15 ], [ %sext60, %2 ]
  %.062 = phi i32 [ %.1, %15 ], [ 0, %2 ]
  %5 = ashr exact i32 %sext63, 24
  switch i32 %5, label %14 [
    i32 115, label %6
    i32 113, label %10
    i32 118, label %11
  ]

6:                                                ; preds = %.lr.ph
  %7 = load ptr, ptr @optarg, align 8, !tbaa !5
  %8 = tail call i32 @atoi(ptr nocapture noundef %7) #7
  store i32 %8, ptr @SEARCH_LIMIT, align 4, !tbaa !9
  %9 = icmp slt i32 %8, 1
  %spec.select = select i1 %9, i32 1, i32 %.062
  br label %15

10:                                               ; preds = %.lr.ph
  store i32 0, ptr @verbose, align 4, !tbaa !9
  br label %15

11:                                               ; preds = %.lr.ph
  %12 = load i32, ptr @verbose, align 4, !tbaa !9
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr @verbose, align 4, !tbaa !9
  br label %15

14:                                               ; preds = %.lr.ph
  tail call void @uso()
  br label %74

15:                                               ; preds = %6, %11, %10
  %.1 = phi i32 [ %.062, %11 ], [ %.062, %10 ], [ %spec.select, %6 ]
  %16 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #6
  %sext = shl i32 %16, 24
  %.not = icmp eq i32 %sext, -16777216
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %15
  %17 = icmp eq i32 %.1, 0
  br i1 %17, label %._crit_edge.thread, label %18

18:                                               ; preds = %._crit_edge
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %74

._crit_edge.thread:                               ; preds = %2, %._crit_edge
  %20 = tail call i32 @make_links()
  %.not47 = icmp eq i32 %20, 0
  br i1 %.not47, label %.preheader58, label %74

.preheader58:                                     ; preds = %._crit_edge.thread
  %21 = load ptr, ptr @stdin, align 8, !tbaa !5
  %22 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 300, ptr noundef %21)
  %.not486675 = icmp eq ptr %22, null
  br i1 %.not486675, label %.outer._crit_edge, label %.lr.ph67

.lr.ph67:                                         ; preds = %.preheader58, %.thread55
  %.031.ph78 = phi i32 [ %.132, %.thread55 ], [ 0, %.preheader58 ]
  %.033.ph77 = phi i32 [ %.25457, %.thread55 ], [ 0, %.preheader58 ]
  %.035.ph76 = phi i32 [ %44, %.thread55 ], [ 0, %.preheader58 ]
  br label %23

23:                                               ; preds = %.lr.ph67, %.backedge
  %24 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #7
  %25 = icmp ult i64 %24, 81
  br i1 %25, label %.backedge, label %.preheader

.backedge:                                        ; preds = %23, %42
  %26 = load ptr, ptr @stdin, align 8, !tbaa !5
  %27 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 300, ptr noundef %26)
  %.not48 = icmp eq ptr %27, null
  br i1 %.not48, label %.outer._crit_edge, label %23, !llvm.loop !13

.preheader:                                       ; preds = %23, %41
  %indvars.iv = phi i64 [ %indvars.iv.next, %41 ], [ 0, %23 ]
  %.03764 = phi i32 [ %.239, %41 ], [ 0, %23 ]
  %28 = icmp slt i32 %.03764, 81
  br i1 %28, label %29, label %41

29:                                               ; preds = %.preheader
  %30 = getelementptr inbounds [300 x i8], ptr %3, i64 0, i64 %indvars.iv
  %31 = load i8, ptr %30, align 1, !tbaa !14
  %32 = sext i8 %31 to i32
  %33 = add nsw i32 %32, -46
  %34 = sext i32 %.03764 to i64
  %35 = getelementptr inbounds [81 x i32], ptr @matrix, i64 0, i64 %34
  store i32 %33, ptr %35, align 4, !tbaa !9
  %.not51 = icmp eq i32 %33, 0
  br i1 %.not51, label %39, label %36

36:                                               ; preds = %29
  %37 = add nsw i32 %32, -48
  store i32 %37, ptr %35, align 4, !tbaa !9
  %38 = add i8 %31, -58
  %or.cond = icmp ult i8 %38, -10
  %spec.select52 = select i1 %or.cond, i32 -1, i32 %.03764
  br label %39

39:                                               ; preds = %36, %29
  %.138 = phi i32 [ %.03764, %29 ], [ %spec.select52, %36 ]
  %40 = add nsw i32 %.138, 1
  br label %41

41:                                               ; preds = %.preheader, %39
  %.239 = phi i32 [ %40, %39 ], [ %.03764, %.preheader ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %24
  br i1 %exitcond.not, label %42, label %.preheader, !llvm.loop !15

42:                                               ; preds = %41
  %.not50 = icmp eq i32 %.239, 81
  br i1 %.not50, label %43, label %.backedge

43:                                               ; preds = %42
  %44 = add nuw nsw i32 %.035.ph76, 1
  %45 = call i32 @solve()
  %46 = icmp eq i32 %45, 1
  %47 = zext i1 %46 to i32
  %.132 = add nuw nsw i32 %.031.ph78, %47
  %48 = icmp sgt i32 %45, 1
  br i1 %48, label %.thread, label %50

.thread:                                          ; preds = %43
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.thread55

50:                                               ; preds = %43
  %51 = icmp slt i32 %45, 0
  br i1 %51, label %52, label %54

52:                                               ; preds = %50
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %44)
  br label %.thread55

54:                                               ; preds = %50
  %55 = icmp eq i32 %45, 0
  br i1 %55, label %56, label %.thread55

56:                                               ; preds = %54
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %44)
  br label %.thread55

.thread55:                                        ; preds = %52, %.thread, %56, %54
  %.pn = phi i32 [ %47, %56 ], [ %47, %54 ], [ %47, %52 ], [ %45, %.thread ]
  %.25457 = add nuw nsw i32 %.pn, %.033.ph77
  %58 = load ptr, ptr @stdin, align 8, !tbaa !5
  %59 = call ptr @fgets(ptr noundef nonnull %3, i32 noundef 300, ptr noundef %58)
  %.not4866 = icmp eq ptr %59, null
  br i1 %.not4866, label %.outer._crit_edge, label %.lr.ph67, !llvm.loop !13

.outer._crit_edge:                                ; preds = %.thread55, %.backedge, %.preheader58
  %.035.ph.lcssa = phi i32 [ 0, %.preheader58 ], [ %.035.ph76, %.backedge ], [ %44, %.thread55 ]
  %.033.ph.lcssa = phi i32 [ 0, %.preheader58 ], [ %.033.ph77, %.backedge ], [ %.25457, %.thread55 ]
  %.031.ph.lcssa = phi i32 [ 0, %.preheader58 ], [ %.031.ph78, %.backedge ], [ %.132, %.thread55 ]
  %60 = load i32, ptr @verbose, align 4, !tbaa !9
  %61 = icmp sgt i32 %60, 1
  br i1 %61, label %62, label %70

62:                                               ; preds = %.outer._crit_edge
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %.035.ph.lcssa, i32 noundef %.033.ph.lcssa)
  %64 = load i32, ptr @SEARCH_LIMIT, align 4, !tbaa !9
  %65 = icmp sgt i32 %64, 1
  br i1 %65, label %66, label %68

66:                                               ; preds = %62
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %.031.ph.lcssa)
  br label %thread-pre-split

68:                                               ; preds = %62
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %68, %66
  %.pr = load i32, ptr @verbose, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %thread-pre-split, %.outer._crit_edge
  %71 = phi i32 [ %.pr, %thread-pre-split ], [ %60, %.outer._crit_edge ]
  %.not49 = icmp eq i32 %71, 0
  br i1 %.not49, label %72, label %74

72:                                               ; preds = %70
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %.031.ph.lcssa)
  br label %74

74:                                               ; preds = %70, %72, %._crit_edge.thread, %18, %14
  %.040 = phi i32 [ 0, %14 ], [ 1, %18 ], [ 1, %._crit_edge.thread ], [ 0, %72 ], [ 0, %70 ]
  call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %3) #6
  ret i32 %.040
}

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @uso() local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @make_links() local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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 #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}


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