; LLVM IR from tangjz/acm-icpc :: Summer_Training/2016-07-19 (G - Rigid Frameworks - tjz)

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

@c = external dso_local global [11 x [11 x i32]], align 16
@pw = external dso_local global [121 x i32], align 16
@f = external dso_local global [11 x [11 x i32]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef 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 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 i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %72, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = icmp slt i32 %13, 11
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %75

16:                                               ; preds = %12
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %18
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [11 x i32], ptr %19, i64 0, i64 %21
  store i32 1, ptr %22, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %24
  %26 = getelementptr inbounds [11 x i32], ptr %25, i64 0, i64 0
  store i32 1, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %68, %16
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %71

32:                                               ; preds = %27
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sub nsw i32 %33, 1
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [11 x i32], ptr %36, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [11 x i32], ptr %45, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %41, %49
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %52
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [11 x i32], ptr %53, i64 0, i64 %55
  store i32 %50, ptr %56, align 4, !tbaa !5
  %57 = icmp sge i32 %50, 1000000007
  br i1 %57, label %58, label %67

58:                                               ; preds = %32
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %60
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [11 x i32], ptr %61, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1000000007
  store i32 %66, ptr %64, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %58, %32
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !9

71:                                               ; preds = %31
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !11

75:                                               ; preds = %15
  store i32 1, ptr @pw, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %93, %75
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = icmp slt i32 %77, 121
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %96

80:                                               ; preds = %76
  %81 = load i32, ptr %5, align 4, !tbaa !5
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = mul nsw i64 %86, 3
  %88 = srem i64 %87, 1000000007
  %89 = trunc i64 %88 to i32
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %80
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %5, align 4, !tbaa !5
  br label %76, !llvm.loop !12

96:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %216, %96
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 11
  br i1 %99, label %101, label %100

100:                                              ; preds = %97
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %219

101:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %212, %101
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = icmp slt i32 %103, 11
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %215

106:                                              ; preds = %102
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = mul nsw i32 %107, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %114
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [11 x i32], ptr %115, i64 0, i64 %117
  store i32 %112, ptr %118, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %208, %106
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = icmp sle i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %211

124:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %204, %124
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = icmp sle i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %207

130:                                              ; preds = %125
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = icmp eq i32 %131, %132
  br i1 %133, label %134, label %139

134:                                              ; preds = %130
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = icmp eq i32 %135, %136
  br i1 %137, label %138, label %139

138:                                              ; preds = %134
  br label %204

139:                                              ; preds = %134, %130
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %142
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [11 x i32], ptr %143, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %151
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [11 x i32], ptr %152, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = mul nsw i64 %149, %157
  %159 = srem i64 %158, 1000000007
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %161
  %163 = load i32, ptr %9, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [11 x i32], ptr %162, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = mul nsw i64 %159, %167
  %169 = srem i64 %168, 1000000007
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = sub nsw i32 %170, %171
  %173 = load i32, ptr %7, align 4, !tbaa !5
  %174 = load i32, ptr %9, align 4, !tbaa !5
  %175 = sub nsw i32 %173, %174
  %176 = mul nsw i32 %172, %175
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = mul nsw i64 %169, %180
  %182 = srem i64 %181, 1000000007
  %183 = load i32, ptr %6, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %184
  %186 = load i32, ptr %7, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [11 x i32], ptr %185, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = sub nsw i64 %190, %182
  %192 = trunc i64 %191 to i32
  store i32 %192, ptr %188, align 4, !tbaa !5
  %193 = icmp slt i32 %192, 0
  br i1 %193, label %194, label %203

194:                                              ; preds = %139
  %195 = load i32, ptr %6, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %196
  %198 = load i32, ptr %7, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [11 x i32], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1000000007
  store i32 %202, ptr %200, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %194, %139
  br label %204

204:                                              ; preds = %203, %138
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %9, align 4, !tbaa !5
  br label %125, !llvm.loop !13

207:                                              ; preds = %129
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr %8, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr %8, align 4, !tbaa !5
  br label %119, !llvm.loop !14

211:                                              ; preds = %123
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr %7, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %7, align 4, !tbaa !5
  br label %102, !llvm.loop !15

215:                                              ; preds = %105
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr %6, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %6, align 4, !tbaa !5
  br label %97, !llvm.loop !16

219:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  br label %220

220:                                              ; preds = %223, %219
  %221 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %10, ptr noundef %11)
  %222 = icmp eq i32 %221, 2
  br i1 %222, label %223, label %232

223:                                              ; preds = %220
  %224 = load i32, ptr %10, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %225
  %227 = load i32, ptr %11, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [11 x i32], ptr %226, i64 0, i64 %228
  %230 = load i32, ptr %229, align 4, !tbaa !5
  %231 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %230)
  br label %220, !llvm.loop !17

232:                                              ; preds = %220
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %233 = load i32, ptr %1, align 4
  ret i32 %233
}

; 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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

attributes #0 = { mustprogress norecurse 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 = { "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 }

!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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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

@c = external dso_local local_unnamed_addr global [11 x [11 x i32]], align 16
@pw = external dso_local local_unnamed_addr global [121 x i32], align 16
@f = external dso_local local_unnamed_addr global [11 x [11 x i32]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
._crit_edge.10:
  %0 = alloca i32, align 4
  %1 = alloca i32, align 4
  store i32 1, ptr @c, align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 48), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 44), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 96), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 88), align 8, !tbaa !5
  store i32 2, ptr getelementptr inbounds (i8, ptr @c, i64 92), align 4, !tbaa !5
  store <4 x i32> <i32 1, i32 3, i32 3, i32 1>, ptr getelementptr inbounds (i8, ptr @c, i64 132), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 192), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 4, i32 6, i32 4>, ptr getelementptr inbounds (i8, ptr @c, i64 176), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 240), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 5, i32 10, i32 10>, ptr getelementptr inbounds (i8, ptr @c, i64 220), align 4, !tbaa !5
  store i32 5, ptr getelementptr inbounds (i8, ptr @c, i64 236), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 288), align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 6, i32 15, i32 20>, ptr getelementptr inbounds (i8, ptr @c, i64 264), align 8, !tbaa !5
  store i32 15, ptr getelementptr inbounds (i8, ptr @c, i64 280), align 8, !tbaa !5
  store i32 6, ptr getelementptr inbounds (i8, ptr @c, i64 284), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 336), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 308), align 4, !tbaa !5
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 268), align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 1000000005
  %spec.select.7.v = select i1 %3, i32 -1000000006, i32 1
  %spec.select.7 = add nsw i32 %2, %spec.select.7.v
  store i32 %spec.select.7, ptr getelementptr inbounds (i8, ptr @c, i64 312), align 8, !tbaa !5
  %4 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c, i64 272), align 16, !tbaa !5
  %5 = insertelement <4 x i32> poison, i32 %2, i64 0
  %6 = shufflevector <4 x i32> %5, <4 x i32> %4, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
  %7 = add nsw <4 x i32> %4, %6
  %8 = icmp sgt <4 x i32> %7, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %9 = add nsw <4 x i32> %7, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %10 = select <4 x i1> %8, <4 x i32> %9, <4 x i32> %7
  store <4 x i32> %10, ptr getelementptr inbounds (i8, ptr @c, i64 316), align 4, !tbaa !5
  %11 = extractelement <4 x i32> %4, i64 3
  %12 = icmp sgt i32 %11, 1000000005
  %spec.select.7.5.v = select i1 %12, i32 -1000000006, i32 1
  %spec.select.7.5 = add nsw i32 %11, %spec.select.7.5.v
  store i32 %spec.select.7.5, ptr getelementptr inbounds (i8, ptr @c, i64 332), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 384), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 352), align 16, !tbaa !5
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 312), align 8, !tbaa !5
  %14 = icmp sgt i32 %13, 1000000005
  %spec.select.8.v = select i1 %14, i32 -1000000006, i32 1
  %spec.select.8 = add nsw i32 %13, %spec.select.8.v
  store i32 %spec.select.8, ptr getelementptr inbounds (i8, ptr @c, i64 356), align 4, !tbaa !5
  %15 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c, i64 316), align 4, !tbaa !5
  %16 = insertelement <4 x i32> poison, i32 %13, i64 0
  %17 = shufflevector <4 x i32> %16, <4 x i32> %15, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
  %18 = add nsw <4 x i32> %15, %17
  %19 = icmp sgt <4 x i32> %18, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %20 = add nsw <4 x i32> %18, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %21 = select <4 x i1> %19, <4 x i32> %20, <4 x i32> %18
  store <4 x i32> %21, ptr getelementptr inbounds (i8, ptr @c, i64 360), align 8, !tbaa !5
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 332), align 4, !tbaa !5
  %23 = extractelement <4 x i32> %15, i64 3
  %24 = add nsw i32 %22, %23
  %25 = icmp sgt i32 %24, 1000000006
  %26 = add nsw i32 %24, -1000000007
  %spec.select.8.5 = select i1 %25, i32 %26, i32 %24
  store i32 %spec.select.8.5, ptr getelementptr inbounds (i8, ptr @c, i64 376), align 8, !tbaa !5
  %27 = icmp sgt i32 %22, 1000000005
  %spec.select.8.6.v = select i1 %27, i32 -1000000006, i32 1
  %spec.select.8.6 = add nsw i32 %22, %spec.select.8.6.v
  store i32 %spec.select.8.6, ptr getelementptr inbounds (i8, ptr @c, i64 380), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 432), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 396), align 4, !tbaa !5
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 356), align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 1000000005
  %spec.select.9.v = select i1 %29, i32 -1000000006, i32 1
  %spec.select.9 = add nsw i32 %28, %spec.select.9.v
  store i32 %spec.select.9, ptr getelementptr inbounds (i8, ptr @c, i64 400), align 16, !tbaa !5
  %30 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c, i64 360), align 8, !tbaa !5
  %31 = insertelement <4 x i32> poison, i32 %28, i64 0
  %32 = shufflevector <4 x i32> %31, <4 x i32> %30, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
  %33 = add nsw <4 x i32> %30, %32
  %34 = icmp sgt <4 x i32> %33, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %35 = add nsw <4 x i32> %33, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %36 = select <4 x i1> %34, <4 x i32> %35, <4 x i32> %33
  store <4 x i32> %36, ptr getelementptr inbounds (i8, ptr @c, i64 404), align 4, !tbaa !5
  %37 = load <2 x i32>, ptr getelementptr inbounds (i8, ptr @c, i64 376), align 8, !tbaa !5
  %38 = shufflevector <4 x i32> %30, <4 x i32> poison, <2 x i32> <i32 3, i32 poison>
  %39 = shufflevector <2 x i32> %38, <2 x i32> %37, <2 x i32> <i32 0, i32 2>
  %40 = add nsw <2 x i32> %37, %39
  %41 = icmp sgt <2 x i32> %40, <i32 1000000006, i32 1000000006>
  %42 = add nsw <2 x i32> %40, <i32 -1000000007, i32 -1000000007>
  %43 = select <2 x i1> %41, <2 x i32> %42, <2 x i32> %40
  store <2 x i32> %43, ptr getelementptr inbounds (i8, ptr @c, i64 420), align 4, !tbaa !5
  %44 = extractelement <2 x i32> %37, i64 1
  %45 = icmp sgt i32 %44, 1000000005
  %spec.select.9.7.v = select i1 %45, i32 -1000000006, i32 1
  %spec.select.9.7 = add nsw i32 %44, %spec.select.9.7.v
  store i32 %spec.select.9.7, ptr getelementptr inbounds (i8, ptr @c, i64 428), align 4, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 480), align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @c, i64 440), align 8, !tbaa !5
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 400), align 16, !tbaa !5
  %47 = icmp sgt i32 %46, 1000000005
  %spec.select.10.v = select i1 %47, i32 -1000000006, i32 1
  %spec.select.10 = add nsw i32 %46, %spec.select.10.v
  store i32 %spec.select.10, ptr getelementptr inbounds (i8, ptr @c, i64 444), align 4, !tbaa !5
  %48 = load <4 x i32>, ptr getelementptr inbounds (i8, ptr @c, i64 404), align 4, !tbaa !5
  %49 = insertelement <4 x i32> poison, i32 %46, i64 0
  %50 = shufflevector <4 x i32> %49, <4 x i32> %48, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
  %51 = add nsw <4 x i32> %48, %50
  %52 = icmp sgt <4 x i32> %51, <i32 1000000006, i32 1000000006, i32 1000000006, i32 1000000006>
  %53 = add nsw <4 x i32> %51, <i32 -1000000007, i32 -1000000007, i32 -1000000007, i32 -1000000007>
  %54 = select <4 x i1> %52, <4 x i32> %53, <4 x i32> %51
  store <4 x i32> %54, ptr getelementptr inbounds (i8, ptr @c, i64 448), align 16, !tbaa !5
  %55 = load <2 x i32>, ptr getelementptr inbounds (i8, ptr @c, i64 420), align 4, !tbaa !5
  %56 = shufflevector <4 x i32> %48, <4 x i32> poison, <2 x i32> <i32 3, i32 poison>
  %57 = shufflevector <2 x i32> %56, <2 x i32> %55, <2 x i32> <i32 0, i32 2>
  %58 = add nsw <2 x i32> %55, %57
  %59 = icmp sgt <2 x i32> %58, <i32 1000000006, i32 1000000006>
  %60 = add nsw <2 x i32> %58, <i32 -1000000007, i32 -1000000007>
  %61 = select <2 x i1> %59, <2 x i32> %60, <2 x i32> %58
  store <2 x i32> %61, ptr getelementptr inbounds (i8, ptr @c, i64 464), align 16, !tbaa !5
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @c, i64 428), align 4, !tbaa !5
  %63 = extractelement <2 x i32> %55, i64 1
  %64 = add nsw i32 %62, %63
  %65 = icmp sgt i32 %64, 1000000006
  %66 = add nsw i32 %64, -1000000007
  %spec.select.10.7 = select i1 %65, i32 %66, i32 %64
  store i32 %spec.select.10.7, ptr getelementptr inbounds (i8, ptr @c, i64 472), align 8, !tbaa !5
  %67 = icmp sgt i32 %62, 1000000005
  %spec.select.10.8.v = select i1 %67, i32 -1000000006, i32 1
  %spec.select.10.8 = add nsw i32 %62, %spec.select.10.8.v
  store i32 %spec.select.10.8, ptr getelementptr inbounds (i8, ptr @c, i64 476), align 4, !tbaa !5
  store i32 1, ptr @pw, align 16, !tbaa !5
  br label %68

68:                                               ; preds = %68, %._crit_edge.10
  %69 = phi i64 [ 1, %._crit_edge.10 ], [ %79, %68 ]
  %indvars.iv = phi i64 [ 1, %._crit_edge.10 ], [ %indvars.iv.next.2, %68 ]
  %70 = mul nsw i64 %69, 3
  %71 = srem i64 %70, 1000000007
  %72 = trunc nsw i64 %71 to i32
  %73 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %indvars.iv
  store i32 %72, ptr %73, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = mul nsw i64 %71, 3
  %75 = srem i64 %74, 1000000007
  %76 = trunc nsw i64 %75 to i32
  %77 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %indvars.iv.next
  store i32 %76, ptr %77, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %78 = mul nsw i64 %75, 3
  %79 = srem i64 %78, 1000000007
  %80 = trunc nsw i64 %79 to i32
  %81 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %indvars.iv.next.1
  store i32 %80, ptr %81, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %exitcond.not.2 = icmp eq i64 %indvars.iv.next.2, 121
  br i1 %exitcond.not.2, label %.preheader62, label %68, !llvm.loop !9

.preheader62:                                     ; preds = %68, %86
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %86 ], [ 1, %68 ]
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %86 ], [ 2, %68 ]
  %82 = add nsw i64 %indvars.iv109, -1
  br label %87

83:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  %84 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0, ptr noundef nonnull %1)
  %85 = icmp eq i32 %84, 2
  br i1 %85, label %.lr.ph72, label %._crit_edge73

86:                                               ; preds = %121
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond114.not = icmp eq i64 %indvars.iv.next110, 11
  br i1 %exitcond114.not, label %83, label %.preheader62, !llvm.loop !11

87:                                               ; preds = %.preheader62, %121
  %indvars.iv101 = phi i64 [ 0, %.preheader62 ], [ %indvars.iv.next102, %121 ]
  %indvars.iv99 = phi i64 [ 1, %.preheader62 ], [ %indvars.iv.next100, %121 ]
  %88 = mul nuw nsw i64 %indvars.iv101, %indvars.iv109
  %89 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %indvars.iv109, i64 %indvars.iv101
  store i32 %90, ptr %91, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %87, %.split.us
  %.promoted = phi i32 [ %90, %87 ], [ %.promoted115, %.split.us ]
  %indvars.iv92 = phi i64 [ 1, %87 ], [ %indvars.iv.next93, %.split.us ]
  %92 = icmp eq i64 %indvars.iv92, %indvars.iv109
  %93 = add nsw i64 %indvars.iv92, -1
  %94 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %82, i64 %93
  %95 = sub nsw i64 %indvars.iv109, %indvars.iv92
  %.fr = freeze i1 %92
  br i1 %.fr, label %.preheader.split, label %.preheader.split.us

.preheader.split.us:                              ; preds = %.preheader
  %96 = load i32, ptr %94, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  br label %98

98:                                               ; preds = %98, %.preheader.split.us
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %98 ], [ 0, %.preheader.split.us ]
  %99 = phi i32 [ %spec.select, %98 ], [ %.promoted, %.preheader.split.us ]
  %100 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %indvars.iv101, i64 %indvars.iv81
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = mul nsw i64 %102, %97
  %104 = srem i64 %103, 1000000007
  %105 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %indvars.iv92, i64 %indvars.iv81
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = mul nsw i64 %104, %107
  %109 = srem i64 %108, 1000000007
  %110 = sub nsw i64 %indvars.iv101, %indvars.iv81
  %111 = mul nsw i64 %110, %95
  %112 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = mul nsw i64 %109, %114
  %116 = srem i64 %115, 1000000007
  %117 = trunc nsw i64 %116 to i32
  %118 = sub i32 %99, %117
  %119 = icmp slt i32 %118, 0
  %120 = add nsw i32 %118, 1000000007
  %spec.select = select i1 %119, i32 %120, i32 %118
  store i32 %spec.select, ptr %91, align 4, !tbaa !5
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next82, %indvars.iv99
  br i1 %exitcond86.not, label %.split.us, label %98, !llvm.loop !12

121:                                              ; preds = %.split.us
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next102, 11
  br i1 %exitcond106.not, label %86, label %87, !llvm.loop !13

.split.us:                                        ; preds = %98, %149
  %.promoted115 = phi i32 [ %.promoted116, %149 ], [ %spec.select, %98 ]
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next93, %indvars.iv107
  br i1 %exitcond98.not, label %121, label %.preheader, !llvm.loop !14

.preheader.split:                                 ; preds = %.preheader, %149
  %122 = phi i32 [ %.promoted116, %149 ], [ %.promoted, %.preheader ]
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %149 ], [ 0, %.preheader ]
  %123 = icmp eq i64 %indvars.iv87, %indvars.iv101
  br i1 %123, label %149, label %124

124:                                              ; preds = %.preheader.split
  %125 = load i32, ptr %94, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [11 x [11 x i32]], ptr @c, i64 0, i64 %indvars.iv101, i64 %indvars.iv87
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = mul nsw i64 %129, %126
  %131 = srem i64 %130, 1000000007
  %132 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %indvars.iv92, i64 %indvars.iv87
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = mul nsw i64 %131, %134
  %136 = srem i64 %135, 1000000007
  %137 = sub nsw i64 %indvars.iv101, %indvars.iv87
  %138 = mul nsw i64 %137, %95
  %139 = getelementptr inbounds [121 x i32], ptr @pw, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = mul nsw i64 %136, %141
  %143 = srem i64 %142, 1000000007
  %144 = trunc nsw i64 %143 to i32
  %145 = sub i32 %122, %144
  store i32 %145, ptr %91, align 4, !tbaa !5
  %146 = icmp slt i32 %145, 0
  br i1 %146, label %147, label %149

147:                                              ; preds = %124
  %148 = add nsw i32 %145, 1000000007
  store i32 %148, ptr %91, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %.preheader.split, %124, %147
  %.promoted116 = phi i32 [ %122, %.preheader.split ], [ %145, %124 ], [ %148, %147 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next88, %indvars.iv99
  br i1 %exitcond91.not, label %.split.us, label %.preheader.split, !llvm.loop !12

.lr.ph72:                                         ; preds = %83, %.lr.ph72
  %150 = load i32, ptr %0, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = load i32, ptr %1, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [11 x [11 x i32]], ptr @f, i64 0, i64 %151, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %155)
  %157 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %0, ptr noundef nonnull %1)
  %158 = icmp eq i32 %157, 2
  br i1 %158, label %.lr.ph72, label %._crit_edge73, !llvm.loop !15

._crit_edge73:                                    ; preds = %.lr.ph72, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #3
  ret i32 0
}

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

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

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

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

attributes #0 = { mustprogress nofree norecurse 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }

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

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass