; LLVM IR from tangjz/acm-icpc :: 51nod (1342)

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

%struct.Matrix = type { i32, i32, [2 x [1010 x i32]] }

@mod = external dso_local global i32, align 4
@A = external dso_local global %struct.Matrix, align 4
@n = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@f = external dso_local global [1010 x i32], align 16
@g = external dso_local global [1010 x i32], align 16
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = 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 %struct.Matrix, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.Matrix, align 4
  %9 = alloca %struct.Matrix, align 4
  %10 = alloca %struct.Matrix, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.Matrix, align 4
  %14 = alloca %struct.Matrix, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @L, ptr noundef @R, ptr noundef @b, ptr noundef @mod)
  %17 = load i32, ptr @mod, align 4, !tbaa !5
  %18 = load i32, ptr @b, align 4, !tbaa !5
  %19 = srem i32 %18, %17
  store i32 %19, ptr @b, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %36, %0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %39

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @f, i64 %27
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %28)
  %30 = load i32, ptr @mod, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = srem i32 %34, %30
  store i32 %35, ptr %33, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %25
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !9

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

40:                                               ; preds = %81, %39
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %45, label %44

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

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %46 = load i32, ptr @n, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  store i32 %47, ptr %5, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %77, %45
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = icmp sge i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %80

53:                                               ; preds = %48
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sub nsw i32 %62, %58
  store i32 %63, ptr %61, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %69, label %76

69:                                               ; preds = %53
  %70 = load i32, ptr @mod, align 4, !tbaa !5
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, %70
  store i32 %75, ptr %73, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %69, %53
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %5, align 4, !tbaa !5
  br label %48, !llvm.loop !11

80:                                               ; preds = %52
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %3, align 4, !tbaa !5
  br label %40, !llvm.loop !12

84:                                               ; preds = %44
  %85 = load i32, ptr @L, align 4, !tbaa !5
  %86 = icmp slt i32 %85, 0
  br i1 %86, label %87, label %113

87:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8088, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 4 %6, i8 0, i64 8088, i1 false)
  %88 = getelementptr inbounds %struct.Matrix, ptr %6, i32 0, i32 0
  store i32 1, ptr %88, align 4, !tbaa !13
  %89 = getelementptr inbounds %struct.Matrix, ptr %6, i32 0, i32 1
  %90 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %90, ptr %89, align 4, !tbaa !15
  %91 = getelementptr inbounds %struct.Matrix, ptr %6, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %6, i64 8088, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8088, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %106, %87
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %109

97:                                               ; preds = %92
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = and i32 %98, 1
  %100 = icmp ne i32 %99, 0
  %101 = zext i1 %100 to i64
  %102 = select i1 %100, i32 -1, i32 1
  %103 = load i32, ptr %7, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %104
  store i32 %102, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %97
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %7, align 4, !tbaa !5
  br label %92, !llvm.loop !18

109:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8088, ptr %8) #6
  %110 = load i32, ptr @L, align 4, !tbaa !5
  %111 = sub nsw i32 0, %110
  %112 = sext i32 %111 to i64
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %8, ptr noundef nonnull align 4 dereferenceable(8088) @A, i64 noundef %112)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %8, i64 8088, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8088, ptr %8) #6
  br label %124

113:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8088, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8088, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 4 %10, i8 0, i64 8088, i1 false)
  %114 = getelementptr inbounds %struct.Matrix, ptr %10, i32 0, i32 0
  store i32 1, ptr %114, align 4, !tbaa !13
  %115 = getelementptr inbounds %struct.Matrix, ptr %10, i32 0, i32 1
  %116 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %116, ptr %115, align 4, !tbaa !15
  %117 = getelementptr inbounds %struct.Matrix, ptr %10, i32 0, i32 2
  store i32 1, ptr %117, align 4, !tbaa !5
  %118 = getelementptr inbounds i32, ptr %117, i64 1
  %119 = load i32, ptr @n, align 4, !tbaa !5
  %120 = icmp sgt i32 %119, 1
  %121 = zext i1 %120 to i32
  store i32 %121, ptr %118, align 4, !tbaa !5
  %122 = load i32, ptr @L, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %9, ptr noundef nonnull align 4 dereferenceable(8088) %10, i64 noundef %123)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %9, i64 8088, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8088, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8088, ptr %9) #6
  br label %124

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

125:                                              ; preds = %168, %124
  %126 = load i32, ptr %11, align 4, !tbaa !5
  %127 = load i32, ptr @n, align 4, !tbaa !5
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %125
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %171

130:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %131 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %131, ptr %12, align 4, !tbaa !5
  br label %132

132:                                              ; preds = %164, %130
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = load i32, ptr @n, align 4, !tbaa !5
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %167

137:                                              ; preds = %132
  %138 = load i32, ptr %11, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = load i32, ptr %11, align 4, !tbaa !5
  %145 = sub nsw i32 %143, %144
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = load i32, ptr %12, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = mul nsw i64 %149, %154
  %156 = add nsw i64 %142, %155
  %157 = load i32, ptr @mod, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = srem i64 %156, %158
  %160 = trunc i64 %159 to i32
  %161 = load i32, ptr %11, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %162
  store i32 %160, ptr %163, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %137
  %165 = load i32, ptr %12, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %12, align 4, !tbaa !5
  br label %132, !llvm.loop !19

167:                                              ; preds = %136
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %11, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %11, align 4, !tbaa !5
  br label %125, !llvm.loop !20

171:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8088, ptr %13) #6
  call void @llvm.memset.p0.i64(ptr align 4 %13, i8 0, i64 8088, i1 false)
  %172 = getelementptr inbounds %struct.Matrix, ptr %13, i32 0, i32 0
  store i32 2, ptr %172, align 4, !tbaa !13
  %173 = getelementptr inbounds %struct.Matrix, ptr %13, i32 0, i32 1
  %174 = load i32, ptr @n, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %173, align 4, !tbaa !15
  %176 = getelementptr inbounds %struct.Matrix, ptr %13, i32 0, i32 2
  %177 = load i32, ptr @b, align 4, !tbaa !5
  store i32 %177, ptr %176, align 4, !tbaa !5
  %178 = getelementptr inbounds i32, ptr %176, i64 1
  %179 = load i32, ptr @b, align 4, !tbaa !5
  store i32 %179, ptr %178, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %13, i64 8088, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8088, ptr %13) #6
  store i32 1, ptr getelementptr inbounds ([1010 x i32], ptr getelementptr inbounds ([2 x [1010 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  %180 = load i32, ptr @n, align 4, !tbaa !5
  %181 = icmp sgt i32 %180, 1
  %182 = zext i1 %181 to i32
  store i32 %182, ptr getelementptr inbounds ([1010 x i32], ptr getelementptr inbounds ([2 x [1010 x i32]], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 1), i64 0, i64 2), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8088, ptr %14) #6
  %183 = load i32, ptr @R, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = load i32, ptr @L, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = sub nsw i64 %184, %186
  %188 = add nsw i64 %187, 1
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind writable sret(%struct.Matrix) align 4 %14, ptr noundef nonnull align 4 dereferenceable(8088) @A, i64 noundef %188)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @A, ptr align 4 %14, i64 8088, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 8088, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %189

189:                                              ; preds = %214, %171
  %190 = load i32, ptr %15, align 4, !tbaa !5
  %191 = load i32, ptr @n, align 4, !tbaa !5
  %192 = icmp slt i32 %190, %191
  br i1 %192, label %194, label %193

193:                                              ; preds = %189
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %217

194:                                              ; preds = %189
  %195 = load i32, ptr @ans, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = load i32, ptr %15, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (%struct.Matrix, ptr @A, i32 0, i32 2), i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = load i32, ptr %15, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = mul nsw i64 %202, %207
  %209 = add nsw i64 %196, %208
  %210 = load i32, ptr @mod, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = srem i64 %209, %211
  %213 = trunc i64 %212 to i32
  store i32 %213, ptr @ans, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %194
  %215 = load i32, ptr %15, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %15, align 4, !tbaa !5
  br label %189, !llvm.loop !21

217:                                              ; preds = %193
  %218 = load i32, ptr @ans, align 4, !tbaa !5
  %219 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %218)
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; 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) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6Matrix3powEx(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(8088), i64 noundef) #5 align 2

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

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!15 = !{!14, !6, i64 4}
!16 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 8080, !17}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !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"

%struct.Matrix = type { i32, i32, [2 x [1010 x i32]] }

@mod = external dso_local global i32, align 4
@A = external dso_local global %struct.Matrix, align 4
@n = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@f = external dso_local global [1010 x i32], align 16
@g = external dso_local local_unnamed_addr global [1010 x i32], align 16
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Matrix, align 4
  %2 = alloca %struct.Matrix, align 4
  %3 = alloca %struct.Matrix, align 4
  %4 = alloca %struct.Matrix, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @L, ptr noundef nonnull @R, ptr noundef nonnull @b, ptr noundef nonnull @mod)
  %6 = load i32, ptr @mod, align 4
  %7 = load i32, ptr @b, align 4, !tbaa !5
  %8 = srem i32 %7, %6
  store i32 %8, ptr @b, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.preheader44:                                     ; preds = %.lr.ph
  %11 = icmp sgt i32 %21, 1
  br i1 %11, label %.preheader43.lr.ph, label %._crit_edge

.preheader43.lr.ph:                               ; preds = %.preheader44
  %12 = zext nneg i32 %21 to i64
  %wide.trip.count = zext nneg i32 %21 to i64
  %13 = add nsw i64 %12, -1
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %18, i64 0
  %14 = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %15 = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %.preheader43

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %16 = getelementptr inbounds i32, ptr @f, i64 %indvars.iv
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %16)
  %18 = load i32, ptr @mod, align 4
  %19 = load i32, ptr %16, align 4, !tbaa !5
  %20 = srem i32 %19, %18
  store i32 %20, ptr %16, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %.preheader44, !llvm.loop !9

.preheader43:                                     ; preds = %.preheader43.lr.ph, %.loopexit
  %indvars.iv71 = phi i64 [ 1, %.preheader43.lr.ph ], [ %indvars.iv.next72, %.loopexit ]
  %smin = tail call i64 @llvm.smin.i64(i64 %indvars.iv71, i64 %13)
  %24 = sub i64 %12, %smin
  %min.iters.check = icmp ult i64 %24, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader43
  %indvars.iv68.ph = phi i64 [ %12, %.preheader43 ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader43
  %n.vec = and i64 %24, -8
  %ind.end = sub i64 %12, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %12, %index
  %25 = add nsw i64 %offset.idx, -1
  %26 = add nsw i64 %offset.idx, -2
  %27 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %26
  %28 = getelementptr inbounds i8, ptr %27, i64 -12
  %29 = getelementptr inbounds i8, ptr %27, i64 -28
  %wide.load = load <4 x i32>, ptr %28, align 4, !tbaa !5
  %wide.load102 = load <4 x i32>, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %25
  %31 = getelementptr inbounds i8, ptr %30, i64 -12
  %32 = getelementptr inbounds i8, ptr %30, i64 -28
  %wide.load104 = load <4 x i32>, ptr %31, align 4, !tbaa !5
  %wide.load106 = load <4 x i32>, ptr %32, align 4, !tbaa !5
  %33 = sub nsw <4 x i32> %wide.load104, %wide.load
  %34 = sub nsw <4 x i32> %wide.load106, %wide.load102
  %35 = icmp slt <4 x i32> %33, zeroinitializer
  %36 = select <4 x i1> %35, <4 x i32> %14, <4 x i32> zeroinitializer
  %reverse108 = add nsw <4 x i32> %33, %36
  store <4 x i32> %reverse108, ptr %31, align 4, !tbaa !5
  %37 = icmp slt <4 x i32> %34, zeroinitializer
  %38 = select <4 x i1> %37, <4 x i32> %15, <4 x i32> zeroinitializer
  %reverse109 = add nsw <4 x i32> %34, %38
  store <4 x i32> %reverse109, ptr %32, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %39 = icmp eq i64 %index.next, %n.vec
  br i1 %39, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %24, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

._crit_edge.loopexit:                             ; preds = %.loopexit
  %40 = zext i1 %11 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0, %.preheader44
  %41 = phi i32 [ 0, %.preheader44 ], [ 0, %0 ], [ %40, %._crit_edge.loopexit ]
  %.lcssa4595 = phi i32 [ %21, %.preheader44 ], [ %9, %0 ], [ %21, %._crit_edge.loopexit ]
  %42 = load i32, ptr @L, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %52, label %68

.loopexit:                                        ; preds = %scalar.ph, %middle.block
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.preheader43, !llvm.loop !14

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %scalar.ph ], [ %indvars.iv68.ph, %scalar.ph.preheader ]
  %indvars.iv.next69 = add nsw i64 %indvars.iv68, -1
  %44 = add nsw i64 %indvars.iv68, -2
  %45 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %indvars.iv.next69
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = sub nsw i32 %48, %46
  %50 = icmp slt i32 %49, 0
  %51 = select i1 %50, i32 %18, i32 0
  %spec.select = add nsw i32 %49, %51
  store i32 %spec.select, ptr %47, align 4, !tbaa !5
  %.not42.not = icmp sgt i64 %indvars.iv.next69, %indvars.iv71
  br i1 %.not42.not, label %scalar.ph, label %.loopexit, !llvm.loop !15

52:                                               ; preds = %._crit_edge
  store i32 1, ptr @A, align 4, !tbaa !5
  store i32 %.lcssa4595, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(8080) getelementptr inbounds (i8, ptr @A, i64 8), i8 0, i64 8080, i1 false)
  %53 = icmp sgt i32 %.lcssa4595, 0
  br i1 %53, label %.lr.ph53.preheader, label %._crit_edge54

.lr.ph53.preheader:                               ; preds = %52
  %wide.trip.count77 = zext nneg i32 %.lcssa4595 to i64
  %min.iters.check112 = icmp ult i32 %.lcssa4595, 8
  br i1 %min.iters.check112, label %.lr.ph53.preheader123, label %vector.ph113

.lr.ph53.preheader123:                            ; preds = %middle.block110, %.lr.ph53.preheader
  %indvars.iv74.ph = phi i64 [ 0, %.lr.ph53.preheader ], [ %n.vec115, %middle.block110 ]
  br label %.lr.ph53

vector.ph113:                                     ; preds = %.lr.ph53.preheader
  %n.vec115 = and i64 %wide.trip.count77, 2147483640
  br label %vector.body117

vector.body117:                                   ; preds = %vector.body117, %vector.ph113
  %index118 = phi i64 [ 0, %vector.ph113 ], [ %index.next120, %vector.body117 ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph113 ], [ %vec.ind.next, %vector.body117 ]
  %54 = and <4 x i64> %vec.ind, <i64 1, i64 1, i64 1, i64 1>
  %55 = and <4 x i64> %vec.ind, <i64 1, i64 1, i64 1, i64 1>
  %56 = icmp eq <4 x i64> %54, zeroinitializer
  %57 = icmp eq <4 x i64> %55, zeroinitializer
  %58 = select <4 x i1> %56, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
  %59 = select <4 x i1> %57, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
  %60 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %index118
  %61 = getelementptr inbounds i8, ptr %60, i64 16
  store <4 x i32> %58, ptr %60, align 4, !tbaa !5
  store <4 x i32> %59, ptr %61, align 4, !tbaa !5
  %index.next120 = add nuw i64 %index118, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %62 = icmp eq i64 %index.next120, %n.vec115
  br i1 %62, label %middle.block110, label %vector.body117, !llvm.loop !16

middle.block110:                                  ; preds = %vector.body117
  %cmp.n121 = icmp eq i64 %n.vec115, %wide.trip.count77
  br i1 %cmp.n121, label %._crit_edge54, label %.lr.ph53.preheader123

._crit_edge54:                                    ; preds = %.lr.ph53, %middle.block110, %52
  call void @llvm.lifetime.start.p0(i64 8088, ptr nonnull %1) #7
  %63 = sub nsw i32 0, %42
  %64 = zext nneg i32 %63 to i64
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %1, ptr noundef nonnull align 4 dereferenceable(8088) @A, i64 noundef %64)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(8088) @A, ptr noundef nonnull align 4 dereferenceable(8088) %1, i64 8088, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 8088, ptr nonnull %1) #7
  br label %74

.lr.ph53:                                         ; preds = %.lr.ph53.preheader123, %.lr.ph53
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph53 ], [ %indvars.iv74.ph, %.lr.ph53.preheader123 ]
  %65 = and i64 %indvars.iv74, 1
  %.not = icmp eq i64 %65, 0
  %66 = select i1 %.not, i32 1, i32 -1
  %67 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv74
  store i32 %66, ptr %67, align 4, !tbaa !5
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !19

68:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8088, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 8088, ptr nonnull %3) #7
  %69 = getelementptr inbounds i8, ptr %3, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(8088) %69, i8 0, i64 8072, i1 false)
  store i32 1, ptr %3, align 4, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %.lcssa4595, ptr %70, align 4, !tbaa !22
  %71 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 1, ptr %71, align 4, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 %41, ptr %72, align 4, !tbaa !5
  %73 = zext nneg i32 %42 to i64
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %2, ptr noundef nonnull align 4 dereferenceable(8088) %3, i64 noundef %73)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(8088) @A, ptr noundef nonnull align 4 dereferenceable(8088) %2, i64 8088, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 8088, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8088, ptr nonnull %2) #7
  br label %74

74:                                               ; preds = %68, %._crit_edge54
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.preheader.lr.ph, label %._crit_edge58

.preheader.lr.ph:                                 ; preds = %74
  %77 = load i32, ptr @mod, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %wide.trip.count87 = zext nneg i32 %75 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %95
  %indvars.iv79 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next80, %95 ]
  %79 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %indvars.iv79
  %.promoted = load i32, ptr %79, align 4, !tbaa !5
  br label %96

._crit_edge58:                                    ; preds = %95, %74
  %80 = add nsw i32 %75, 1
  %81 = load i32, ptr @b, align 4, !tbaa !5
  store i32 2, ptr @A, align 4, !tbaa !5
  store i32 %80, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4, !tbaa !5
  store i32 %81, ptr getelementptr inbounds (i8, ptr @A, i64 8), align 4
  store i32 %81, ptr getelementptr inbounds (i8, ptr @A, i64 12), align 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(8072) getelementptr inbounds (i8, ptr @A, i64 16), i8 0, i64 8072, i1 false)
  store i32 1, ptr getelementptr inbounds (i8, ptr @A, i64 4052), align 4, !tbaa !5
  %82 = icmp sgt i32 %75, 1
  %83 = zext i1 %82 to i32
  store i32 %83, ptr getelementptr inbounds (i8, ptr @A, i64 4056), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8088, ptr nonnull %4) #7
  %84 = load i32, ptr @R, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = load i32, ptr @L, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = add nsw i64 %85, 1
  %89 = sub nsw i64 %88, %87
  call void @_ZNK6Matrix3powEx(ptr dead_on_unwind nonnull writable sret(%struct.Matrix) align 4 %4, ptr noundef nonnull align 4 dereferenceable(8088) @A, i64 noundef %89)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(8088) @A, ptr noundef nonnull align 4 dereferenceable(8088) %4, i64 8088, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 8088, ptr nonnull %4) #7
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp sgt i32 %90, 0
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  br i1 %91, label %.lr.ph62, label %._crit_edge58._crit_edge

.lr.ph62:                                         ; preds = %._crit_edge58
  %92 = load i32, ptr @mod, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %wide.trip.count92 = zext nneg i32 %90 to i64
  %xtraiter = and i64 %wide.trip.count92, 1
  %94 = icmp eq i32 %90, 1
  br i1 %94, label %._crit_edge63.unr-lcssa, label %.lr.ph62.new

.lr.ph62.new:                                     ; preds = %.lr.ph62
  %unroll_iter = and i64 %wide.trip.count92, 2147483646
  br label %123

95:                                               ; preds = %96
  store i32 %109, ptr %79, align 4, !tbaa !5
  %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
  %exitcond88.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count87
  br i1 %exitcond88.not, label %._crit_edge58, label %.preheader, !llvm.loop !23

96:                                               ; preds = %.preheader, %96
  %indvars.iv81 = phi i64 [ %indvars.iv79, %.preheader ], [ %indvars.iv.next82, %96 ]
  %97 = phi i32 [ %.promoted, %.preheader ], [ %109, %96 ]
  %98 = sext i32 %97 to i64
  %99 = sub nuw nsw i64 %indvars.iv81, %indvars.iv79
  %100 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [1010 x i32], ptr @f, i64 0, i64 %indvars.iv81
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = mul nsw i64 %105, %102
  %107 = add nsw i64 %106, %98
  %108 = srem i64 %107, %78
  %109 = trunc nsw i64 %108 to i32
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count87
  br i1 %exitcond85.not, label %95, label %96, !llvm.loop !24

._crit_edge63.unr-lcssa:                          ; preds = %123, %.lr.ph62
  %.lcssa.ph = phi i32 [ poison, %.lr.ph62 ], [ %145, %123 ]
  %indvars.iv89.unr = phi i64 [ 0, %.lr.ph62 ], [ %indvars.iv.next90.1, %123 ]
  %.unr = phi i32 [ %ans.promoted, %.lr.ph62 ], [ %145, %123 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge63, label %._crit_edge63.epilog-lcssa

._crit_edge63.epilog-lcssa:                       ; preds = %._crit_edge63.unr-lcssa
  %110 = sext i32 %.unr to i64
  %indvars.iv.next90.epil = add nuw nsw i64 %indvars.iv89.unr, 1
  %111 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next90.epil
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %indvars.iv89.unr
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = mul nsw i64 %116, %113
  %118 = add nsw i64 %117, %110
  %119 = srem i64 %118, %93
  %120 = trunc nsw i64 %119 to i32
  br label %._crit_edge63

._crit_edge63:                                    ; preds = %._crit_edge63.unr-lcssa, %._crit_edge63.epilog-lcssa
  %.lcssa = phi i32 [ %.lcssa.ph, %._crit_edge63.unr-lcssa ], [ %120, %._crit_edge63.epilog-lcssa ]
  store i32 %.lcssa, ptr @ans, align 4, !tbaa !5
  br label %._crit_edge58._crit_edge

._crit_edge58._crit_edge:                         ; preds = %._crit_edge58, %._crit_edge63
  %121 = phi i32 [ %.lcssa, %._crit_edge63 ], [ %ans.promoted, %._crit_edge58 ]
  %122 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %121)
  ret i32 0

123:                                              ; preds = %123, %.lr.ph62.new
  %indvars.iv89 = phi i64 [ 0, %.lr.ph62.new ], [ %indvars.iv.next90.1, %123 ]
  %124 = phi i32 [ %ans.promoted, %.lr.ph62.new ], [ %145, %123 ]
  %niter = phi i64 [ 0, %.lr.ph62.new ], [ %niter.next.1, %123 ]
  %125 = sext i32 %124 to i64
  %indvars.iv.next90 = or disjoint i64 %indvars.iv89, 1
  %126 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next90
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %indvars.iv89
  %130 = load i32, ptr %129, align 8, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = mul nsw i64 %131, %128
  %133 = add nsw i64 %132, %125
  %134 = srem i64 %133, %93
  %sext = shl i64 %134, 32
  %135 = ashr exact i64 %sext, 32
  %indvars.iv.next90.1 = add nuw nsw i64 %indvars.iv89, 2
  %136 = getelementptr inbounds [1010 x i32], ptr getelementptr inbounds (i8, ptr @A, i64 8), i64 0, i64 %indvars.iv.next90.1
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [1010 x i32], ptr @g, i64 0, i64 %indvars.iv.next90
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = mul nsw i64 %141, %138
  %143 = add nsw i64 %142, %135
  %144 = srem i64 %143, %93
  %145 = trunc nsw i64 %144 to i32
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge63.unr-lcssa, label %123, !llvm.loop !25
}

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress 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) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6Matrix3powEx(ptr dead_on_unwind noalias writable sret(%struct.Matrix) align 4, ptr noundef nonnull align 4 dereferenceable(8088), i64 noundef) local_unnamed_addr #5 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10, !12, !13}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 8080, !18}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !10, !13, !12}
!20 = !{!21, !6, i64 0}
!21 = !{!"_ZTS6Matrix", !6, i64 0, !6, i64 4, !7, i64 8}
!22 = !{!21, !6, i64 4}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass