; LLVM IR from tangjz/acm-icpc :: loj (138)

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

@bin = external dso_local global [15 x [15 x i32]], align 16
@coeff = external dso_local global [15 x [15 x i32]], align 16
@tim = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 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: mustprogress uwtable
declare dso_local noundef i32 @_Z5solveiiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

18:                                               ; preds = %68, %0
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 15
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %18
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %24
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [15 x i32], ptr %25, i64 0, i64 %27
  store i32 1, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %30
  %32 = getelementptr inbounds [15 x i32], ptr %31, i64 0, i64 0
  store i32 1, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %64, %22
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

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

38:                                               ; preds = %33
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %41
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sub nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [15 x i32], ptr %42, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %50
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [15 x i32], ptr %51, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %47, %55
  %57 = srem i32 %56, 1000000007
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %59
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [15 x i32], ptr %60, i64 0, i64 %62
  store i32 %57, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %38
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !5
  br label %33, !llvm.loop !9

67:                                               ; preds = %37
  br label %68

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

71:                                               ; preds = %21
  store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @coeff, i64 0, i64 1), align 4, !tbaa !5
  store i32 1, ptr @coeff, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %192, %71
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = icmp slt i32 %73, 14
  br i1 %74, label %76, label %75

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

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %98, %76
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  %81 = icmp sle i32 %78, %80
  br i1 %81, label %83, label %82

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

83:                                               ; preds = %77
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %86
  %88 = load i32, ptr %6, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [15 x i32], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %5, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %93
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [15 x i32], ptr %94, i64 0, i64 %96
  store i32 %91, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %83
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %6, align 4, !tbaa !5
  br label %77, !llvm.loop !12

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

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

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

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

108:                                              ; preds = %150, %107
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = load i32, ptr %7, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  %112 = icmp sle i32 %109, %111
  br i1 %112, label %114, label %113

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

114:                                              ; preds = %108
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %116
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [15 x i32], ptr %117, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %125
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [15 x i32], ptr %126, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %133
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [15 x i32], ptr %134, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = mul nsw i64 %131, %139
  %141 = sub nsw i64 %122, %140
  %142 = srem i64 %141, 1000000007
  %143 = trunc i64 %142 to i32
  %144 = load i32, ptr %5, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %145
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [15 x i32], ptr %146, i64 0, i64 %148
  store i32 %143, ptr %149, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %114
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %8, align 4, !tbaa !5
  br label %108, !llvm.loop !13

153:                                              ; preds = %113
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %7, align 4, !tbaa !5
  br label %102, !llvm.loop !14

157:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  %160 = call noundef i32 @_Z7mod_powii(i32 noundef %159, i32 noundef 1000000005)
  store i32 %160, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %188, %157
  %162 = load i32, ptr %10, align 4, !tbaa !5
  %163 = load i32, ptr %5, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = icmp sle i32 %162, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %161
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %191

167:                                              ; preds = %161
  %168 = load i32, ptr %5, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %169
  %171 = load i32, ptr %10, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [15 x i32], ptr %170, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1000000007
  %176 = sext i32 %175 to i64
  %177 = load i32, ptr %9, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = mul nsw i64 %176, %178
  %180 = srem i64 %179, 1000000007
  %181 = trunc i64 %180 to i32
  %182 = load i32, ptr %5, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %183
  %185 = load i32, ptr %10, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [15 x i32], ptr %184, i64 0, i64 %186
  store i32 %181, ptr %187, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %167
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %10, align 4, !tbaa !5
  br label %161, !llvm.loop !15

191:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %5, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %5, align 4, !tbaa !5
  br label %72, !llvm.loop !16

195:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %196 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %11)
  br label %197

197:                                              ; preds = %201, %195
  %198 = load i32, ptr %11, align 4, !tbaa !5
  %199 = add nsw i32 %198, -1
  store i32 %199, ptr %11, align 4, !tbaa !5
  %200 = icmp ne i32 %198, 0
  br i1 %200, label %201, label %213

201:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %202 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %17)
  %203 = load i32, ptr @tim, align 4, !tbaa !5
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr @tim, align 4, !tbaa !5
  %205 = load i32, ptr %16, align 4, !tbaa !5
  %206 = load i32, ptr %17, align 4, !tbaa !5
  %207 = load i32, ptr %12, align 4, !tbaa !5
  %208 = load i32, ptr %13, align 4, !tbaa !5
  %209 = load i32, ptr %14, align 4, !tbaa !5
  %210 = load i32, ptr %15, align 4, !tbaa !5
  %211 = call noundef i32 @_Z5solveiiiiiii(i32 noundef %205, i32 noundef %206, i32 noundef %207, i32 noundef %208, i32 noundef %209, i32 noundef %210, i32 noundef 0)
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %211)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %197, !llvm.loop !17

213:                                              ; preds = %197
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %214 = load i32, ptr %1, align 4
  ret i32 %214
}

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

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

attributes #0 = { mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

@bin = external dso_local local_unnamed_addr global [15 x [15 x i32]], align 16
@coeff = external dso_local local_unnamed_addr global [15 x [15 x i32]], align 16
@tim = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powii(i32 noundef, i32 noundef) local_unnamed_addr #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: mustprogress uwtable
declare dso_local noundef i32 @_Z5solveiiiiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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
  br label %9

8:                                                ; preds = %._crit_edge
  store i32 1, ptr getelementptr inbounds (i8, ptr @coeff, i64 4), align 4, !tbaa !5
  store i32 1, ptr @coeff, align 16, !tbaa !5
  br label %.preheader60

9:                                                ; preds = %0, %._crit_edge
  %indvars.iv74 = phi i64 [ 0, %0 ], [ %indvars.iv.next75, %._crit_edge ]
  %10 = add nsw i64 %indvars.iv74, -1
  %11 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %indvars.iv74
  %12 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %indvars.iv74, i64 %indvars.iv74
  store i32 1, ptr %12, align 4, !tbaa !5
  store i32 1, ptr %11, align 4, !tbaa !5
  %13 = icmp ugt i64 %indvars.iv74, 1
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %14 = add nsw i64 %indvars.iv74, -1
  %.phi.trans.insert = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %14, i64 0
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %min.iters.check = icmp ult i64 %indvars.iv74, 9
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %.ph = phi i32 [ %.pre, %.lr.ph ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %10, -8
  %ind.end = or disjoint i64 %n.vec, 1
  %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load112, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %15 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %14, i64 %offset.idx
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5
  %wide.load112 = load <4 x i32>, ptr %16, align 4, !tbaa !5
  %17 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %18 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load112, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %19 = add nsw <4 x i32> %wide.load, %17
  %20 = add nsw <4 x i32> %wide.load112, %18
  %21 = srem <4 x i32> %19, <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>
  %22 = srem <4 x i32> %20, <i32 1000000007, i32 1000000007, i32 1000000007, i32 1000000007>
  %23 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %indvars.iv74, i64 %offset.idx
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  store <4 x i32> %21, ptr %23, align 4, !tbaa !5
  store <4 x i32> %22, ptr %24, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %25 = icmp eq i64 %index.next, %n.vec
  br i1 %25, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %vector.recur.extract = extractelement <4 x i32> %wide.load112, i64 3
  %cmp.n = icmp eq i64 %10, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %9
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond77.not = icmp eq i64 %indvars.iv.next75, 15
  br i1 %exitcond77.not, label %8, label %9, !llvm.loop !13

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %26 = phi i32 [ %28, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %27 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %14, i64 %indvars.iv
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %28, %26
  %30 = srem i32 %29, 1000000007
  %31 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %indvars.iv74, i64 %indvars.iv
  store i32 %30, ptr %31, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv74
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !14

.loopexit58.unr-lcssa:                            ; preds = %83
  %lcmp.mod115.not = icmp eq i64 %xtraiter114, 0
  br i1 %lcmp.mod115.not, label %.loopexit58, label %.loopexit58.epilog-lcssa

.loopexit58.epilog-lcssa:                         ; preds = %.loopexit58.unr-lcssa
  %32 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv105, i64 %indvars.iv.next98.1
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1000000007
  %35 = sext i32 %34 to i64
  %36 = mul nsw i64 %35, %61
  %37 = srem i64 %36, 1000000007
  %38 = trunc nsw i64 %37 to i32
  store i32 %38, ptr %32, align 4, !tbaa !5
  br label %.loopexit58

.loopexit58:                                      ; preds = %.loopexit58.unr-lcssa, %.loopexit58.epilog-lcssa
  %indvar.next = add nuw nsw i64 %indvar, 1
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond110.not = icmp eq i64 %indvar.next, 13
  br i1 %exitcond110.not, label %42, label %.preheader60, !llvm.loop !15

.preheader60:                                     ; preds = %8, %.loopexit58
  %indvars.iv105 = phi i64 [ 1, %8 ], [ %indvars.iv.next106, %.loopexit58 ]
  %indvars.iv103 = phi i64 [ 3, %8 ], [ %indvars.iv.next104, %.loopexit58 ]
  %indvar = phi i64 [ 0, %8 ], [ %indvar.next, %.loopexit58 ]
  %39 = mul nuw nsw i64 %indvar, 60
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @coeff, i64 60), i64 %39
  %gep111 = getelementptr i8, ptr getelementptr inbounds (i8, ptr @bin, i64 120), i64 %39
  %40 = shl nuw nsw i64 %indvar, 2
  %41 = add nuw nsw i64 %40, 12
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %gep, ptr noundef nonnull align 4 dereferenceable(1) %gep111, i64 %41, i1 false), !tbaa !5
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  br label %.preheader

42:                                               ; preds = %.loopexit58
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr %1, align 4, !tbaa !5
  %.not69 = icmp eq i32 %44, 0
  br i1 %.not69, label %._crit_edge72, label %.lr.ph71

.loopexit.unr-lcssa:                              ; preds = %62
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.loopexit.epilog-lcssa

.loopexit.epilog-lcssa:                           ; preds = %.loopexit.unr-lcssa
  %46 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv105, i64 %indvars.iv.next83.1
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv90, i64 %indvars.iv.next83.1
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = mul nsw i64 %51, %58
  %53 = sub nsw i64 %48, %52
  %54 = srem i64 %53, 1000000007
  %55 = trunc nsw i64 %54 to i32
  store i32 %55, ptr %46, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.unr-lcssa, %.loopexit.epilog-lcssa
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next91, %indvars.iv105
  br i1 %exitcond96.not, label %.new, label %.preheader, !llvm.loop !16

.preheader:                                       ; preds = %.preheader60, %.loopexit
  %indvars.iv90 = phi i64 [ 0, %.preheader60 ], [ %indvars.iv.next91, %.loopexit ]
  %indvars.iv88 = phi i64 [ 2, %.preheader60 ], [ %indvars.iv.next89, %.loopexit ]
  %56 = getelementptr inbounds [15 x [15 x i32]], ptr @bin, i64 0, i64 %indvars.iv.next106, i64 %indvars.iv90
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %xtraiter = and i64 %indvars.iv88, 1
  %unroll_iter = and i64 %indvars.iv88, 9223372036854775806
  br label %62

.new:                                             ; preds = %.loopexit
  %59 = trunc nuw nsw i64 %indvars.iv.next106 to i32
  %60 = tail call noundef i32 @_Z7mod_powii(i32 noundef %59, i32 noundef 1000000005)
  %61 = sext i32 %60 to i64
  %xtraiter114 = and i64 %indvars.iv103, 1
  %unroll_iter116 = and i64 %indvars.iv103, 9223372036854775806
  br label %83

62:                                               ; preds = %62, %.preheader
  %indvars.iv82 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next83.1, %62 ]
  %niter = phi i64 [ 0, %.preheader ], [ %niter.next.1, %62 ]
  %63 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv105, i64 %indvars.iv82
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv90, i64 %indvars.iv82
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = mul nsw i64 %68, %58
  %70 = sub nsw i64 %65, %69
  %71 = srem i64 %70, 1000000007
  %72 = trunc nsw i64 %71 to i32
  store i32 %72, ptr %63, align 4, !tbaa !5
  %indvars.iv.next83 = or disjoint i64 %indvars.iv82, 1
  %73 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv105, i64 %indvars.iv.next83
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv90, i64 %indvars.iv.next83
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = mul nsw i64 %78, %58
  %80 = sub nsw i64 %75, %79
  %81 = srem i64 %80, 1000000007
  %82 = trunc nsw i64 %81 to i32
  store i32 %82, ptr %73, align 4, !tbaa !5
  %indvars.iv.next83.1 = add nuw nsw i64 %indvars.iv82, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.unr-lcssa, label %62, !llvm.loop !17

83:                                               ; preds = %83, %.new
  %indvars.iv97 = phi i64 [ 0, %.new ], [ %indvars.iv.next98.1, %83 ]
  %niter117 = phi i64 [ 0, %.new ], [ %niter117.next.1, %83 ]
  %84 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv105, i64 %indvars.iv97
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1000000007
  %87 = sext i32 %86 to i64
  %88 = mul nsw i64 %87, %61
  %89 = srem i64 %88, 1000000007
  %90 = trunc nsw i64 %89 to i32
  store i32 %90, ptr %84, align 4, !tbaa !5
  %indvars.iv.next98 = or disjoint i64 %indvars.iv97, 1
  %91 = getelementptr inbounds [15 x [15 x i32]], ptr @coeff, i64 0, i64 %indvars.iv105, i64 %indvars.iv.next98
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1000000007
  %94 = sext i32 %93 to i64
  %95 = mul nsw i64 %94, %61
  %96 = srem i64 %95, 1000000007
  %97 = trunc nsw i64 %96 to i32
  store i32 %97, ptr %91, align 4, !tbaa !5
  %indvars.iv.next98.1 = add nuw nsw i64 %indvars.iv97, 2
  %niter117.next.1 = add nuw nsw i64 %niter117, 2
  %niter117.ncmp.1 = icmp eq i64 %niter117.next.1, %unroll_iter116
  br i1 %niter117.ncmp.1, label %.loopexit58.unr-lcssa, label %83, !llvm.loop !18

.lr.ph71:                                         ; preds = %42, %.lr.ph71
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %99 = load i32, ptr @tim, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr @tim, align 4, !tbaa !5
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = load i32, ptr %2, align 4, !tbaa !5
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = call noundef i32 @_Z5solveiiiiiii(i32 noundef %101, i32 noundef %102, i32 noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef %106, i32 noundef 0)
  %108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %107)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %109 = load i32, ptr %1, align 4, !tbaa !5
  %110 = add nsw i32 %109, -1
  store i32 %110, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %109, 0
  br i1 %.not, label %._crit_edge72, label %.lr.ph71, !llvm.loop !19

._crit_edge72:                                    ; preds = %.lr.ph71, %42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

attributes #0 = { mustprogress 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass