; LLVM IR from tangjz/acm-icpc :: codeforces (177G1)

; 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.Fibonacci = type { i32, i32 }

@A = external dso_local global %struct.Fibonacci, align 4
@fib = external dso_local global [30 x i32], align 16
@m = external dso_local global i32, align 4
@tlen = external dso_local global i32, align 4
@f = external dso_local global [100010 x i32], align 16
@n = external dso_local global i64, align 8
@ans = external dso_local global i64, align 8
@str = external dso_local global [30 x [514239 x i8]], align 16
@tmp = external dso_local global [100010 x i8], align 16
@.str = external hidden unnamed_addr constant [8 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 nounwind uwtable
declare dso_local noundef i32 @_Z4calci(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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 %struct.Fibonacci, align 4
  %9 = alloca %struct.Fibonacci, align 4
  %10 = alloca %struct.Fibonacci, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([30 x i32], ptr @fib, i64 0, i64 2), align 8, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([30 x i32], ptr @fib, i64 0, i64 1), align 4, !tbaa !5
  store i8 97, ptr getelementptr inbounds ([30 x [514239 x i8]], ptr @str, i64 0, i64 1), align 1, !tbaa !9
  store i8 98, ptr getelementptr inbounds ([30 x [514239 x i8]], ptr @str, i64 0, i64 2), align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 3, ptr %2, align 4, !tbaa !5
  br label %11

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

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %53

15:                                               ; preds = %11
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sub nsw i32 %16, 1
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sub nsw i32 %21, 2
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %23
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %20, %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %31
  %33 = getelementptr inbounds [514239 x i8], ptr %32, i64 0, i64 0
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %36
  %38 = getelementptr inbounds [514239 x i8], ptr %37, i64 0, i64 0
  %39 = call ptr @strcpy(ptr noundef %33, ptr noundef %38) #7
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %41
  %43 = getelementptr inbounds [514239 x i8], ptr %42, i64 0, i64 0
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 2
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %46
  %48 = getelementptr inbounds [514239 x i8], ptr %47, i64 0, i64 0
  %49 = call ptr @strcat(ptr noundef %43, ptr noundef %48) #7
  br label %50

50:                                               ; preds = %15
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !10

53:                                               ; preds = %14
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  br label %55

55:                                               ; preds = %247, %53
  %56 = load i32, ptr @m, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr @m, align 4, !tbaa !5
  %58 = icmp ne i32 %56, 0
  br i1 %58, label %59, label %250

59:                                               ; preds = %55
  %60 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @tmp)
  %61 = call i64 @strlen(ptr noundef @tmp) #8
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr @tlen, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %112, %59
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = load i32, ptr @tlen, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %115

68:                                               ; preds = %63
  br label %69

69:                                               ; preds = %86, %68
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %84

72:                                               ; preds = %69
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !9
  %82 = sext i8 %81 to i32
  %83 = icmp ne i32 %77, %82
  br label %84

84:                                               ; preds = %72, %69
  %85 = phi i1 [ false, %69 ], [ %83, %72 ]
  br i1 %85, label %86, label %91

86:                                               ; preds = %84
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100010 x i32], ptr @f, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  store i32 %90, ptr %4, align 4, !tbaa !5
  br label %69, !llvm.loop !12

91:                                               ; preds = %84
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = sext i8 %95 to i32
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !9
  %101 = sext i8 %100 to i32
  %102 = icmp eq i32 %96, %101
  br i1 %102, label %103, label %106

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

106:                                              ; preds = %103, %91
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = load i32, ptr %3, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100010 x i32], ptr @f, i64 0, i64 %110
  store i32 %107, ptr %111, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %106
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %3, align 4, !tbaa !5
  br label %63, !llvm.loop !13

115:                                              ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %243, %115
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = icmp slt i32 %117, 30
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  store i32 12, ptr %6, align 4
  br label %246

120:                                              ; preds = %116
  %121 = load i32, ptr @tlen, align 4, !tbaa !5
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = icmp sge i32 %121, %125
  br i1 %126, label %127, label %242

127:                                              ; preds = %120
  %128 = load i32, ptr @tlen, align 4, !tbaa !5
  %129 = load i32, ptr %5, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = icmp slt i32 %128, %133
  br i1 %134, label %135, label %242

135:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %136 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %136, ptr %7, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %153, %135
  %138 = load i32, ptr %7, align 4, !tbaa !5
  %139 = icmp slt i32 %138, 30
  br i1 %139, label %140, label %145

140:                                              ; preds = %137
  %141 = load i32, ptr %7, align 4, !tbaa !5
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = add nsw i32 %142, 3
  %144 = icmp sle i32 %141, %143
  br label %145

145:                                              ; preds = %140, %137
  %146 = phi i1 [ false, %137 ], [ %144, %140 ]
  br i1 %146, label %147, label %156

147:                                              ; preds = %145
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = call noundef i32 @_Z4calci(i32 noundef %148)
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %152

151:                                              ; preds = %147
  br label %156

152:                                              ; preds = %147
  br label %153

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

156:                                              ; preds = %151, %145
  %157 = load i32, ptr @tlen, align 4, !tbaa !5
  %158 = icmp eq i32 %157, 1
  br i1 %158, label %159, label %167

159:                                              ; preds = %156
  %160 = load i8, ptr @tmp, align 16, !tbaa !9
  %161 = sext i8 %160 to i32
  %162 = icmp eq i32 %161, 97
  br i1 %162, label %163, label %167

163:                                              ; preds = %159
  %164 = load i64, ptr @n, align 8, !tbaa !15
  %165 = icmp eq i64 %164, 1
  br i1 %165, label %166, label %167

166:                                              ; preds = %163
  store i64 1, ptr @ans, align 8, !tbaa !15
  br label %241

167:                                              ; preds = %163, %159, %156
  %168 = load i32, ptr %7, align 4, !tbaa !5
  %169 = load i32, ptr %5, align 4, !tbaa !5
  %170 = add nsw i32 %169, 3
  %171 = icmp sgt i32 %168, %170
  br i1 %171, label %177, label %172

172:                                              ; preds = %167
  %173 = load i64, ptr @n, align 8, !tbaa !15
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = icmp slt i64 %173, %175
  br i1 %176, label %177, label %178

177:                                              ; preds = %172, %167
  store i64 0, ptr @ans, align 8, !tbaa !15
  br label %240

178:                                              ; preds = %172
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  %181 = call noundef i32 @_Z4calci(i32 noundef %180)
  %182 = icmp eq i32 %181, 2
  br i1 %182, label %183, label %200

183:                                              ; preds = %178
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %184 = load i64, ptr @n, align 8, !tbaa !15
  %185 = load i32, ptr %7, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = sub nsw i64 %184, %186
  %188 = add nsw i64 %187, 3
  %189 = call i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8) @A, i64 noundef %188)
  store i64 %189, ptr %8, align 4
  %190 = getelementptr inbounds %struct.Fibonacci, ptr %8, i32 0, i32 1
  %191 = load i32, ptr %190, align 4, !tbaa !17
  %192 = sub nsw i32 %191, 1
  %193 = sext i32 %192 to i64
  store i64 %193, ptr @ans, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %194 = load i64, ptr @ans, align 8, !tbaa !15
  %195 = icmp slt i64 %194, 0
  br i1 %195, label %196, label %199

196:                                              ; preds = %183
  %197 = load i64, ptr @ans, align 8, !tbaa !15
  %198 = add nsw i64 %197, 1000000007
  store i64 %198, ptr @ans, align 8, !tbaa !15
  br label %199

199:                                              ; preds = %196, %183
  br label %239

200:                                              ; preds = %178
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = add nsw i32 %201, 2
  %203 = call noundef i32 @_Z4calci(i32 noundef %202)
  %204 = icmp eq i32 %203, 2
  br i1 %204, label %205, label %215

205:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %206 = load i64, ptr @n, align 8, !tbaa !15
  %207 = load i32, ptr %7, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = sub nsw i64 %206, %208
  %210 = add nsw i64 %209, 1
  %211 = call i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8) @A, i64 noundef %210)
  store i64 %211, ptr %9, align 4
  %212 = getelementptr inbounds %struct.Fibonacci, ptr %9, i32 0, i32 1
  %213 = load i32, ptr %212, align 4, !tbaa !17
  %214 = sext i32 %213 to i64
  store i64 %214, ptr @ans, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %238

215:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %216 = load i64, ptr @n, align 8, !tbaa !15
  %217 = load i32, ptr %7, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = sub nsw i64 %216, %218
  %220 = add nsw i64 %219, 2
  %221 = call i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8) @A, i64 noundef %220)
  store i64 %221, ptr %10, align 4
  %222 = getelementptr inbounds %struct.Fibonacci, ptr %10, i32 0, i32 1
  %223 = load i32, ptr %222, align 4, !tbaa !17
  %224 = sext i32 %223 to i64
  %225 = load i64, ptr @n, align 8, !tbaa !15
  %226 = load i32, ptr %7, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = sub nsw i64 %225, %227
  %229 = add nsw i64 %228, 2
  %230 = and i64 %229, 1
  %231 = sub nsw i64 %224, %230
  store i64 %231, ptr @ans, align 8, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %232 = load i64, ptr @ans, align 8, !tbaa !15
  %233 = icmp slt i64 %232, 0
  br i1 %233, label %234, label %237

234:                                              ; preds = %215
  %235 = load i64, ptr @ans, align 8, !tbaa !15
  %236 = add nsw i64 %235, 1000000007
  store i64 %236, ptr @ans, align 8, !tbaa !15
  br label %237

237:                                              ; preds = %234, %215
  br label %238

238:                                              ; preds = %237, %205
  br label %239

239:                                              ; preds = %238, %199
  br label %240

240:                                              ; preds = %239, %177
  br label %241

241:                                              ; preds = %240, %166
  store i32 12, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %246

242:                                              ; preds = %127, %120
  br label %243

243:                                              ; preds = %242
  %244 = load i32, ptr %5, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %5, align 4, !tbaa !5
  br label %116, !llvm.loop !19

246:                                              ; preds = %241, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %247

247:                                              ; preds = %246
  %248 = load i64, ptr @ans, align 8, !tbaa !15
  %249 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %248)
  br label %55, !llvm.loop !20

250:                                              ; preds = %55
  ret i32 0
}

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8), i64 noundef) #6 align 2

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 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 #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

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


; 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.Fibonacci = type { i32, i32 }

@A = external dso_local global %struct.Fibonacci, align 4
@fib = external dso_local local_unnamed_addr global [30 x i32], align 16
@m = external dso_local global i32, align 4
@tlen = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [100010 x i32], align 16
@n = external dso_local global i64, align 8
@ans = external dso_local local_unnamed_addr global i64, align 8
@str = external dso_local global [30 x [514239 x i8]], align 16
@tmp = external dso_local global [100010 x i8], align 16
@.str = external hidden unnamed_addr constant [8 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 nounwind uwtable
declare dso_local noundef i32 @_Z4calci(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  store i32 1, ptr getelementptr inbounds (i8, ptr @fib, i64 8), align 8, !tbaa !5
  store i32 1, ptr getelementptr inbounds (i8, ptr @fib, i64 4), align 4, !tbaa !5
  store i8 97, ptr getelementptr inbounds (i8, ptr @str, i64 514239), align 1, !tbaa !9
  store i8 98, ptr getelementptr inbounds (i8, ptr @str, i64 1028478), align 2, !tbaa !9
  br label %5

1:                                                ; preds = %5
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %3 = load i32, ptr @m, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @m, align 4, !tbaa !5
  %.not77 = icmp eq i32 %3, 0
  br i1 %.not77, label %._crit_edge80, label %.lr.ph79

5:                                                ; preds = %0, %5
  %6 = phi i32 [ 1, %0 ], [ %11, %5 ]
  %indvars.iv = phi i64 [ 3, %0 ], [ %indvars.iv.next, %5 ]
  %7 = add nsw i64 %indvars.iv, -1
  %8 = add nsw i64 %indvars.iv, -2
  %9 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %8
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = add nsw i32 %10, %6
  %12 = getelementptr inbounds [30 x i32], ptr @fib, i64 0, i64 %indvars.iv
  store i32 %11, ptr %12, align 4, !tbaa !5
  %13 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %indvars.iv
  %14 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %7
  %15 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) %14) #7
  %16 = getelementptr inbounds [30 x [514239 x i8]], ptr @str, i64 0, i64 %8
  %17 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) %16) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 30
  br i1 %exitcond.not, label %1, label %5, !llvm.loop !10

.lr.ph79:                                         ; preds = %1, %.loopexit
  %18 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @tmp)
  %19 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @tmp) #8
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr @tlen, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 1
  br i1 %21, label %.preheader.preheader, label %.preheader60

.preheader.preheader:                             ; preds = %.lr.ph79
  %wide.trip.count = and i64 %19, 2147483647
  br label %.preheader

.preheader60:                                     ; preds = %.critedge, %.lr.ph79
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 4), align 4, !tbaa !5
  %.not55 = icmp sle i32 %22, %20
  %.pre94 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 8), align 8, !tbaa !5
  %23 = icmp sgt i32 %.pre94, %20
  %or.cond124 = select i1 %.not55, i1 %23, i1 false
  br i1 %or.cond124, label %.lr.ph71.preheader, label %87

.preheader:                                       ; preds = %.preheader.preheader, %.critedge
  %indvars.iv85 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next86, %.critedge ]
  %.04867 = phi i32 [ 0, %.preheader.preheader ], [ %spec.select, %.critedge ]
  %.not5763 = icmp eq i32 %.04867, 0
  %.phi.trans.insert = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %indvars.iv85
  %.pre = load i8, ptr %.phi.trans.insert, align 1, !tbaa !9
  br i1 %.not5763, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %27
  %.164 = phi i32 [ %29, %27 ], [ %.04867, %.preheader ]
  %24 = sext i32 %.164 to i64
  %25 = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !9
  %.not58 = icmp eq i8 %.pre, %26
  br i1 %.not58, label %.critedge, label %27

27:                                               ; preds = %.lr.ph
  %28 = getelementptr inbounds [100010 x i32], ptr @f, i64 0, i64 %24
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %.not57 = icmp eq i32 %29, 0
  br i1 %.not57, label %.critedge, label %.lr.ph, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph, %27, %.preheader
  %.1.lcssa = phi i32 [ 0, %.preheader ], [ 0, %27 ], [ %.164, %.lr.ph ]
  %30 = sext i32 %.1.lcssa to i64
  %31 = getelementptr inbounds [100010 x i8], ptr @tmp, i64 0, i64 %30
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = icmp eq i8 %.pre, %32
  %34 = zext i1 %33 to i32
  %spec.select = add nsw i32 %.1.lcssa, %34
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %35 = getelementptr inbounds [100010 x i32], ptr @f, i64 0, i64 %indvars.iv.next86
  store i32 %spec.select, ptr %35, align 4, !tbaa !5
  %exitcond88.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
  br i1 %exitcond88.not, label %.preheader60, label %.preheader, !llvm.loop !13

.lr.ph71.preheader:                               ; preds = %139, %137, %135, %133, %131, %129, %127, %125, %123, %121, %119, %117, %115, %113, %111, %109, %107, %105, %103, %101, %99, %97, %95, %93, %91, %89, %87, %.preheader60, %142
  %.04969.lcssa.wide = phi i32 [ 29, %142 ], [ 1, %.preheader60 ], [ 2, %87 ], [ 3, %89 ], [ 4, %91 ], [ 5, %93 ], [ 6, %95 ], [ 7, %97 ], [ 8, %99 ], [ 9, %101 ], [ 10, %103 ], [ 11, %105 ], [ 12, %107 ], [ 13, %109 ], [ 14, %111 ], [ 15, %113 ], [ 16, %115 ], [ 17, %117 ], [ 18, %119 ], [ 19, %121 ], [ 20, %123 ], [ 21, %125 ], [ 22, %127 ], [ 23, %129 ], [ 24, %131 ], [ 25, %133 ], [ 26, %135 ], [ 27, %137 ], [ 28, %139 ]
  %36 = add nuw nsw i32 %.04969.lcssa.wide, 3
  %37 = sub nuw nsw i32 29, %.04969.lcssa.wide
  %umin = tail call i32 @llvm.umin.i32(i32 %37, i32 3)
  %38 = add nuw nsw i32 %umin, 1
  %39 = add nuw nsw i32 %38, %.04969.lcssa.wide
  br label %.lr.ph71

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %41
  %.05070 = phi i32 [ %42, %41 ], [ %.04969.lcssa.wide, %.lr.ph71.preheader ]
  %40 = tail call noundef i32 @_Z4calci(i32 noundef %.05070)
  %.not56 = icmp eq i32 %40, 0
  br i1 %.not56, label %41, label %._crit_edge

41:                                               ; preds = %.lr.ph71
  %42 = add nuw nsw i32 %.05070, 1
  %exitcond93.not = icmp eq i32 %42, %39
  br i1 %exitcond93.not, label %._crit_edge, label %.lr.ph71, !llvm.loop !14

._crit_edge:                                      ; preds = %41, %.lr.ph71
  %.050.lcssa.ph = phi i32 [ %39, %41 ], [ %.05070, %.lr.ph71 ]
  %.pre122 = load i32, ptr @tlen, align 4, !tbaa !5
  %43 = icmp eq i32 %.pre122, 1
  %44 = load i8, ptr @tmp, align 16
  %45 = icmp eq i8 %44, 97
  %or.cond = select i1 %43, i1 %45, i1 false
  %46 = load i64, ptr @n, align 8
  %47 = icmp eq i64 %46, 1
  %or.cond4 = select i1 %or.cond, i1 %47, i1 false
  br i1 %or.cond4, label %48, label %49

48:                                               ; preds = %._crit_edge
  store i64 1, ptr @ans, align 8, !tbaa !15
  br label %.loopexit

49:                                               ; preds = %._crit_edge
  %50 = icmp ugt i32 %.050.lcssa.ph, %36
  br i1 %50, label %54, label %51

51:                                               ; preds = %49
  %52 = zext nneg i32 %.050.lcssa.ph to i64
  %53 = icmp slt i64 %46, %52
  br i1 %53, label %54, label %55

54:                                               ; preds = %51, %49
  store i64 0, ptr @ans, align 8, !tbaa !15
  br label %.loopexit

55:                                               ; preds = %51
  %56 = add nuw nsw i32 %.050.lcssa.ph, 1
  %57 = tail call noundef i32 @_Z4calci(i32 noundef %56)
  %58 = icmp eq i32 %57, 2
  br i1 %58, label %59, label %67

59:                                               ; preds = %55
  %60 = load i64, ptr @n, align 8, !tbaa !15
  %reass.sub82 = sub i64 %60, %52
  %61 = add i64 %reass.sub82, 3
  %62 = tail call i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8) @A, i64 noundef %61)
  %sext = add i64 %62, -4294967296
  %63 = ashr i64 %sext, 32
  store i64 %63, ptr @ans, align 8, !tbaa !15
  %64 = icmp slt i64 %63, 0
  br i1 %64, label %65, label %.loopexit

65:                                               ; preds = %59
  %66 = add nsw i64 %63, 1000000007
  store i64 %66, ptr @ans, align 8, !tbaa !15
  br label %.loopexit

67:                                               ; preds = %55
  %68 = add nuw nsw i32 %.050.lcssa.ph, 2
  %69 = tail call noundef i32 @_Z4calci(i32 noundef %68)
  %70 = icmp eq i32 %69, 2
  %71 = load i64, ptr @n, align 8, !tbaa !15
  %reass.sub81 = sub i64 %71, %52
  br i1 %70, label %72, label %76

72:                                               ; preds = %67
  %73 = add i64 %reass.sub81, 1
  %74 = tail call i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8) @A, i64 noundef %73)
  %75 = ashr i64 %74, 32
  store i64 %75, ptr @ans, align 8, !tbaa !15
  br label %.loopexit

76:                                               ; preds = %67
  %77 = add i64 %reass.sub81, 2
  %78 = tail call i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8) @A, i64 noundef %77)
  %79 = ashr i64 %78, 32
  %80 = load i64, ptr @n, align 8, !tbaa !15
  %81 = sub nsw i64 %80, %52
  %82 = and i64 %81, 1
  %83 = sub nsw i64 %79, %82
  store i64 %83, ptr @ans, align 8, !tbaa !15
  %84 = icmp slt i64 %83, 0
  br i1 %84, label %85, label %.loopexit

85:                                               ; preds = %76
  %86 = add nsw i64 %83, 1000000007
  store i64 %86, ptr @ans, align 8, !tbaa !15
  br label %.loopexit

87:                                               ; preds = %.preheader60
  %.not55.1 = icmp sle i32 %.pre94, %20
  %.pre95 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 12), align 4, !tbaa !5
  %88 = icmp sgt i32 %.pre95, %20
  %or.cond125 = select i1 %.not55.1, i1 %88, i1 false
  br i1 %or.cond125, label %.lr.ph71.preheader, label %89

89:                                               ; preds = %87
  %.not55.2 = icmp sle i32 %.pre95, %20
  %.pre96 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 16), align 16, !tbaa !5
  %90 = icmp sgt i32 %.pre96, %20
  %or.cond126 = select i1 %.not55.2, i1 %90, i1 false
  br i1 %or.cond126, label %.lr.ph71.preheader, label %91

91:                                               ; preds = %89
  %.not55.3 = icmp sle i32 %.pre96, %20
  %.pre97 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 20), align 4, !tbaa !5
  %92 = icmp sgt i32 %.pre97, %20
  %or.cond127 = select i1 %.not55.3, i1 %92, i1 false
  br i1 %or.cond127, label %.lr.ph71.preheader, label %93

93:                                               ; preds = %91
  %.not55.4 = icmp sle i32 %.pre97, %20
  %.pre98 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 24), align 8, !tbaa !5
  %94 = icmp sgt i32 %.pre98, %20
  %or.cond128 = select i1 %.not55.4, i1 %94, i1 false
  br i1 %or.cond128, label %.lr.ph71.preheader, label %95

95:                                               ; preds = %93
  %.not55.5 = icmp sle i32 %.pre98, %20
  %.pre99 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 28), align 4, !tbaa !5
  %96 = icmp sgt i32 %.pre99, %20
  %or.cond129 = select i1 %.not55.5, i1 %96, i1 false
  br i1 %or.cond129, label %.lr.ph71.preheader, label %97

97:                                               ; preds = %95
  %.not55.6 = icmp sle i32 %.pre99, %20
  %.pre100 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 32), align 16, !tbaa !5
  %98 = icmp sgt i32 %.pre100, %20
  %or.cond130 = select i1 %.not55.6, i1 %98, i1 false
  br i1 %or.cond130, label %.lr.ph71.preheader, label %99

99:                                               ; preds = %97
  %.not55.7 = icmp sle i32 %.pre100, %20
  %.pre101 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 36), align 4, !tbaa !5
  %100 = icmp sgt i32 %.pre101, %20
  %or.cond131 = select i1 %.not55.7, i1 %100, i1 false
  br i1 %or.cond131, label %.lr.ph71.preheader, label %101

101:                                              ; preds = %99
  %.not55.8 = icmp sle i32 %.pre101, %20
  %.pre102 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 40), align 8, !tbaa !5
  %102 = icmp sgt i32 %.pre102, %20
  %or.cond132 = select i1 %.not55.8, i1 %102, i1 false
  br i1 %or.cond132, label %.lr.ph71.preheader, label %103

103:                                              ; preds = %101
  %.not55.9 = icmp sle i32 %.pre102, %20
  %.pre103 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 44), align 4, !tbaa !5
  %104 = icmp sgt i32 %.pre103, %20
  %or.cond133 = select i1 %.not55.9, i1 %104, i1 false
  br i1 %or.cond133, label %.lr.ph71.preheader, label %105

105:                                              ; preds = %103
  %.not55.10 = icmp sle i32 %.pre103, %20
  %.pre104 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 48), align 16, !tbaa !5
  %106 = icmp sgt i32 %.pre104, %20
  %or.cond134 = select i1 %.not55.10, i1 %106, i1 false
  br i1 %or.cond134, label %.lr.ph71.preheader, label %107

107:                                              ; preds = %105
  %.not55.11 = icmp sle i32 %.pre104, %20
  %.pre105 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 52), align 4, !tbaa !5
  %108 = icmp sgt i32 %.pre105, %20
  %or.cond135 = select i1 %.not55.11, i1 %108, i1 false
  br i1 %or.cond135, label %.lr.ph71.preheader, label %109

109:                                              ; preds = %107
  %.not55.12 = icmp sle i32 %.pre105, %20
  %.pre106 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 56), align 8, !tbaa !5
  %110 = icmp sgt i32 %.pre106, %20
  %or.cond136 = select i1 %.not55.12, i1 %110, i1 false
  br i1 %or.cond136, label %.lr.ph71.preheader, label %111

111:                                              ; preds = %109
  %.not55.13 = icmp sle i32 %.pre106, %20
  %.pre107 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 60), align 4, !tbaa !5
  %112 = icmp sgt i32 %.pre107, %20
  %or.cond137 = select i1 %.not55.13, i1 %112, i1 false
  br i1 %or.cond137, label %.lr.ph71.preheader, label %113

113:                                              ; preds = %111
  %.not55.14 = icmp sle i32 %.pre107, %20
  %.pre108 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 64), align 16, !tbaa !5
  %114 = icmp sgt i32 %.pre108, %20
  %or.cond138 = select i1 %.not55.14, i1 %114, i1 false
  br i1 %or.cond138, label %.lr.ph71.preheader, label %115

115:                                              ; preds = %113
  %.not55.15 = icmp sle i32 %.pre108, %20
  %.pre109 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 68), align 4, !tbaa !5
  %116 = icmp sgt i32 %.pre109, %20
  %or.cond139 = select i1 %.not55.15, i1 %116, i1 false
  br i1 %or.cond139, label %.lr.ph71.preheader, label %117

117:                                              ; preds = %115
  %.not55.16 = icmp sle i32 %.pre109, %20
  %.pre110 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 72), align 8, !tbaa !5
  %118 = icmp sgt i32 %.pre110, %20
  %or.cond140 = select i1 %.not55.16, i1 %118, i1 false
  br i1 %or.cond140, label %.lr.ph71.preheader, label %119

119:                                              ; preds = %117
  %.not55.17 = icmp sle i32 %.pre110, %20
  %.pre111 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 76), align 4, !tbaa !5
  %120 = icmp sgt i32 %.pre111, %20
  %or.cond141 = select i1 %.not55.17, i1 %120, i1 false
  br i1 %or.cond141, label %.lr.ph71.preheader, label %121

121:                                              ; preds = %119
  %.not55.18 = icmp sle i32 %.pre111, %20
  %.pre112 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 80), align 16, !tbaa !5
  %122 = icmp sgt i32 %.pre112, %20
  %or.cond142 = select i1 %.not55.18, i1 %122, i1 false
  br i1 %or.cond142, label %.lr.ph71.preheader, label %123

123:                                              ; preds = %121
  %.not55.19 = icmp sle i32 %.pre112, %20
  %.pre113 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 84), align 4, !tbaa !5
  %124 = icmp sgt i32 %.pre113, %20
  %or.cond143 = select i1 %.not55.19, i1 %124, i1 false
  br i1 %or.cond143, label %.lr.ph71.preheader, label %125

125:                                              ; preds = %123
  %.not55.20 = icmp sle i32 %.pre113, %20
  %.pre114 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 88), align 8, !tbaa !5
  %126 = icmp sgt i32 %.pre114, %20
  %or.cond144 = select i1 %.not55.20, i1 %126, i1 false
  br i1 %or.cond144, label %.lr.ph71.preheader, label %127

127:                                              ; preds = %125
  %.not55.21 = icmp sle i32 %.pre114, %20
  %.pre115 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 92), align 4, !tbaa !5
  %128 = icmp sgt i32 %.pre115, %20
  %or.cond145 = select i1 %.not55.21, i1 %128, i1 false
  br i1 %or.cond145, label %.lr.ph71.preheader, label %129

129:                                              ; preds = %127
  %.not55.22 = icmp sle i32 %.pre115, %20
  %.pre116 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 96), align 16, !tbaa !5
  %130 = icmp sgt i32 %.pre116, %20
  %or.cond146 = select i1 %.not55.22, i1 %130, i1 false
  br i1 %or.cond146, label %.lr.ph71.preheader, label %131

131:                                              ; preds = %129
  %.not55.23 = icmp sle i32 %.pre116, %20
  %.pre117 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 100), align 4, !tbaa !5
  %132 = icmp sgt i32 %.pre117, %20
  %or.cond147 = select i1 %.not55.23, i1 %132, i1 false
  br i1 %or.cond147, label %.lr.ph71.preheader, label %133

133:                                              ; preds = %131
  %.not55.24 = icmp sle i32 %.pre117, %20
  %.pre118 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 104), align 8, !tbaa !5
  %134 = icmp sgt i32 %.pre118, %20
  %or.cond148 = select i1 %.not55.24, i1 %134, i1 false
  br i1 %or.cond148, label %.lr.ph71.preheader, label %135

135:                                              ; preds = %133
  %.not55.25 = icmp sle i32 %.pre118, %20
  %.pre119 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 108), align 4, !tbaa !5
  %136 = icmp sgt i32 %.pre119, %20
  %or.cond149 = select i1 %.not55.25, i1 %136, i1 false
  br i1 %or.cond149, label %.lr.ph71.preheader, label %137

137:                                              ; preds = %135
  %.not55.26 = icmp sle i32 %.pre119, %20
  %.pre120 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 112), align 16, !tbaa !5
  %138 = icmp sgt i32 %.pre120, %20
  %or.cond150 = select i1 %.not55.26, i1 %138, i1 false
  br i1 %or.cond150, label %.lr.ph71.preheader, label %139

139:                                              ; preds = %137
  %.not55.27 = icmp sle i32 %.pre120, %20
  %.pre121 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 116), align 4, !tbaa !5
  %140 = icmp sgt i32 %.pre121, %20
  %or.cond151 = select i1 %.not55.27, i1 %140, i1 false
  br i1 %or.cond151, label %.lr.ph71.preheader, label %141

141:                                              ; preds = %139
  %.not55.28 = icmp sgt i32 %.pre121, %20
  br i1 %.not55.28, label %.loopexit.loopexit, label %142

142:                                              ; preds = %141
  %143 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 120), align 8, !tbaa !5
  %144 = icmp sgt i32 %143, %20
  br i1 %144, label %.lr.ph71.preheader, label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %142, %141
  %.pre123 = load i64, ptr @ans, align 8, !tbaa !15
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %48, %65, %59, %76, %85, %72, %54
  %145 = phi i64 [ %.pre123, %.loopexit.loopexit ], [ 1, %48 ], [ %66, %65 ], [ %63, %59 ], [ %83, %76 ], [ %86, %85 ], [ %75, %72 ], [ 0, %54 ]
  %146 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %145)
  %147 = load i32, ptr @m, align 4, !tbaa !5
  %148 = add nsw i32 %147, -1
  store i32 %148, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %147, 0
  br i1 %.not, label %._crit_edge80, label %.lr.ph79, !llvm.loop !17

._crit_edge80:                                    ; preds = %.loopexit, %1
  ret i32 0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZN9Fibonacci3powEx(ptr noundef nonnull align 4 dereferenceable(8), i64 noundef) local_unnamed_addr #5 align 2

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

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

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 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 #2 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { 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 #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 }
attributes #8 = { nounwind willreturn memory(read) }

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

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


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