; LLVM IR from tangjz/acm-icpc :: lydsy (1409)

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

@fib = external dso_local global [47 x i32], align 16
@tot = external dso_local global i32, align 4
@prime = external dso_local global [46341 x i32], align 16
@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@vis = external dso_local global [46341 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powixi(i32 noundef, i64 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
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([47 x i32], ptr @fib, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %27, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 47
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %8
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sub nsw i32 %13, 1
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [47 x i32], ptr @fib, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sub nsw i32 %18, 2
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [47 x i32], ptr @fib, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = add nsw i32 %17, %22
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [47 x i32], ptr @fib, i64 0, i64 %25
  store i32 %23, ptr %26, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %12
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

30:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 2, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %87, %30
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = icmp slt i32 %32, 46341
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %31
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [46341 x i8], ptr @vis, i64 0, i64 %37
  %39 = load i8, ptr %38, align 1, !tbaa !11, !range !13, !noundef !14
  %40 = trunc i8 %39 to i1
  br i1 %40, label %47, label %41

41:                                               ; preds = %35
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = load i32, ptr @tot, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @tot, align 4, !tbaa !5
  %45 = sext i32 %43 to i64
  %46 = getelementptr inbounds [46341 x i32], ptr @prime, i64 0, i64 %45
  store i32 %42, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %41, %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sdiv i32 46340, %48
  store i32 %49, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %82, %47
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = load i32, ptr @tot, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [46341 x i32], ptr @prime, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br label %61

61:                                               ; preds = %54, %50
  %62 = phi i1 [ false, %50 ], [ %60, %54 ]
  br i1 %62, label %64, label %63

63:                                               ; preds = %61
  store i32 8, ptr %4, align 4
  br label %85

64:                                               ; preds = %61
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [46341 x i32], ptr @prime, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = mul nsw i32 %65, %69
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [46341 x i8], ptr @vis, i64 0, i64 %71
  store i8 1, ptr %72, align 1, !tbaa !11
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [46341 x i32], ptr @prime, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = srem i32 %73, %77
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %64
  store i32 8, ptr %4, align 4
  br label %85

81:                                               ; preds = %64
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !5
  br label %50, !llvm.loop !15

85:                                               ; preds = %80, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %86

86:                                               ; preds = %85
  br label %87

87:                                               ; preds = %86
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %3, align 4, !tbaa !5
  br label %31, !llvm.loop !16

90:                                               ; preds = %34
  %91 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t, ptr noundef @a)
  br label %92

92:                                               ; preds = %110, %100, %90
  %93 = load i32, ptr @t, align 4, !tbaa !5
  %94 = add nsw i32 %93, -1
  store i32 %94, ptr @t, align 4, !tbaa !5
  %95 = icmp ne i32 %93, 0
  br i1 %95, label %96, label %124

96:                                               ; preds = %92
  %97 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @p)
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = icmp slt i32 %98, 47
  br i1 %99, label %100, label %110

100:                                              ; preds = %96
  %101 = load i32, ptr @a, align 4, !tbaa !5
  %102 = load i32, ptr @n, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [47 x i32], ptr @fib, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = load i32, ptr @p, align 4, !tbaa !5
  %108 = call noundef i32 @_Z7mod_powixi(i32 noundef %101, i64 noundef %106, i32 noundef %107)
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %108)
  br label %92, !llvm.loop !17

110:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %111 = load i32, ptr @p, align 4, !tbaa !5
  %112 = call noundef i32 @_Z3phii(i32 noundef %111)
  store i32 %112, ptr %7, align 4, !tbaa !5
  %113 = load i32, ptr @a, align 4, !tbaa !5
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = call noundef i32 @_Z7mod_fibii(i32 noundef %114, i32 noundef %115)
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = add nsw i64 %117, %119
  %121 = load i32, ptr @p, align 4, !tbaa !5
  %122 = call noundef i32 @_Z7mod_powixi(i32 noundef %113, i64 noundef %120, i32 noundef %121)
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %122)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %92, !llvm.loop !17

124:                                              ; preds = %92
  ret i32 0
}

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!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"

@fib = external dso_local local_unnamed_addr global [47 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@prime = external dso_local local_unnamed_addr global [46341 x i32], align 16
@t = external dso_local global i32, align 4
@a = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@vis = external dso_local local_unnamed_addr global [46341 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7mod_fibii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3phii(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7mod_powixi(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
.preheader:
  store i32 1, ptr getelementptr inbounds (i8, ptr @fib, i64 4), align 4, !tbaa !5
  %0 = load i32, ptr @fib, align 16, !tbaa !5
  %1 = add nsw i32 %0, 1
  store i32 %1, ptr getelementptr inbounds (i8, ptr @fib, i64 8), align 8, !tbaa !5
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @fib, i64 4), align 4, !tbaa !5
  %3 = add nsw i32 %2, %1
  store i32 %3, ptr getelementptr inbounds (i8, ptr @fib, i64 12), align 4, !tbaa !5
  %4 = add nsw i32 %1, %3
  store i32 %4, ptr getelementptr inbounds (i8, ptr @fib, i64 16), align 16, !tbaa !5
  %5 = add nsw i32 %3, %4
  store i32 %5, ptr getelementptr inbounds (i8, ptr @fib, i64 20), align 4, !tbaa !5
  %6 = add nsw i32 %4, %5
  store i32 %6, ptr getelementptr inbounds (i8, ptr @fib, i64 24), align 8, !tbaa !5
  %7 = add nsw i32 %5, %6
  store i32 %7, ptr getelementptr inbounds (i8, ptr @fib, i64 28), align 4, !tbaa !5
  %8 = add nsw i32 %6, %7
  store i32 %8, ptr getelementptr inbounds (i8, ptr @fib, i64 32), align 16, !tbaa !5
  %9 = add nsw i32 %7, %8
  store i32 %9, ptr getelementptr inbounds (i8, ptr @fib, i64 36), align 4, !tbaa !5
  %10 = add nsw i32 %8, %9
  store i32 %10, ptr getelementptr inbounds (i8, ptr @fib, i64 40), align 8, !tbaa !5
  %11 = add nsw i32 %9, %10
  store i32 %11, ptr getelementptr inbounds (i8, ptr @fib, i64 44), align 4, !tbaa !5
  %12 = add nsw i32 %10, %11
  store i32 %12, ptr getelementptr inbounds (i8, ptr @fib, i64 48), align 16, !tbaa !5
  %13 = add nsw i32 %11, %12
  store i32 %13, ptr getelementptr inbounds (i8, ptr @fib, i64 52), align 4, !tbaa !5
  %14 = add nsw i32 %12, %13
  store i32 %14, ptr getelementptr inbounds (i8, ptr @fib, i64 56), align 8, !tbaa !5
  %15 = add nsw i32 %13, %14
  store i32 %15, ptr getelementptr inbounds (i8, ptr @fib, i64 60), align 4, !tbaa !5
  %16 = add nsw i32 %14, %15
  store i32 %16, ptr getelementptr inbounds (i8, ptr @fib, i64 64), align 16, !tbaa !5
  %17 = add nsw i32 %15, %16
  store i32 %17, ptr getelementptr inbounds (i8, ptr @fib, i64 68), align 4, !tbaa !5
  %18 = add nsw i32 %16, %17
  store i32 %18, ptr getelementptr inbounds (i8, ptr @fib, i64 72), align 8, !tbaa !5
  %19 = add nsw i32 %17, %18
  store i32 %19, ptr getelementptr inbounds (i8, ptr @fib, i64 76), align 4, !tbaa !5
  %20 = add nsw i32 %18, %19
  store i32 %20, ptr getelementptr inbounds (i8, ptr @fib, i64 80), align 16, !tbaa !5
  %21 = add nsw i32 %19, %20
  store i32 %21, ptr getelementptr inbounds (i8, ptr @fib, i64 84), align 4, !tbaa !5
  %22 = add nsw i32 %20, %21
  store i32 %22, ptr getelementptr inbounds (i8, ptr @fib, i64 88), align 8, !tbaa !5
  %23 = add nsw i32 %21, %22
  store i32 %23, ptr getelementptr inbounds (i8, ptr @fib, i64 92), align 4, !tbaa !5
  %24 = add nsw i32 %22, %23
  store i32 %24, ptr getelementptr inbounds (i8, ptr @fib, i64 96), align 16, !tbaa !5
  %25 = add nsw i32 %23, %24
  store i32 %25, ptr getelementptr inbounds (i8, ptr @fib, i64 100), align 4, !tbaa !5
  %26 = add nsw i32 %24, %25
  store i32 %26, ptr getelementptr inbounds (i8, ptr @fib, i64 104), align 8, !tbaa !5
  %27 = add nsw i32 %25, %26
  store i32 %27, ptr getelementptr inbounds (i8, ptr @fib, i64 108), align 4, !tbaa !5
  %28 = add nsw i32 %26, %27
  store i32 %28, ptr getelementptr inbounds (i8, ptr @fib, i64 112), align 16, !tbaa !5
  %29 = add nsw i32 %27, %28
  store i32 %29, ptr getelementptr inbounds (i8, ptr @fib, i64 116), align 4, !tbaa !5
  %30 = add nsw i32 %28, %29
  store i32 %30, ptr getelementptr inbounds (i8, ptr @fib, i64 120), align 8, !tbaa !5
  %31 = add nsw i32 %29, %30
  store i32 %31, ptr getelementptr inbounds (i8, ptr @fib, i64 124), align 4, !tbaa !5
  %32 = add nsw i32 %30, %31
  store i32 %32, ptr getelementptr inbounds (i8, ptr @fib, i64 128), align 16, !tbaa !5
  %33 = add nsw i32 %31, %32
  store i32 %33, ptr getelementptr inbounds (i8, ptr @fib, i64 132), align 4, !tbaa !5
  %34 = add nsw i32 %32, %33
  store i32 %34, ptr getelementptr inbounds (i8, ptr @fib, i64 136), align 8, !tbaa !5
  %35 = add nsw i32 %33, %34
  store i32 %35, ptr getelementptr inbounds (i8, ptr @fib, i64 140), align 4, !tbaa !5
  %36 = add nsw i32 %34, %35
  store i32 %36, ptr getelementptr inbounds (i8, ptr @fib, i64 144), align 16, !tbaa !5
  %37 = add nsw i32 %35, %36
  store i32 %37, ptr getelementptr inbounds (i8, ptr @fib, i64 148), align 4, !tbaa !5
  %38 = add nsw i32 %36, %37
  store i32 %38, ptr getelementptr inbounds (i8, ptr @fib, i64 152), align 8, !tbaa !5
  %39 = add nsw i32 %37, %38
  store i32 %39, ptr getelementptr inbounds (i8, ptr @fib, i64 156), align 4, !tbaa !5
  %40 = add nsw i32 %38, %39
  store i32 %40, ptr getelementptr inbounds (i8, ptr @fib, i64 160), align 16, !tbaa !5
  %41 = add nsw i32 %39, %40
  store i32 %41, ptr getelementptr inbounds (i8, ptr @fib, i64 164), align 4, !tbaa !5
  %42 = add nsw i32 %40, %41
  store i32 %42, ptr getelementptr inbounds (i8, ptr @fib, i64 168), align 8, !tbaa !5
  %43 = add nsw i32 %41, %42
  store i32 %43, ptr getelementptr inbounds (i8, ptr @fib, i64 172), align 4, !tbaa !5
  %44 = add nsw i32 %42, %43
  store i32 %44, ptr getelementptr inbounds (i8, ptr @fib, i64 176), align 16, !tbaa !5
  %45 = add nsw i32 %43, %44
  store i32 %45, ptr getelementptr inbounds (i8, ptr @fib, i64 180), align 4, !tbaa !5
  %46 = add nsw i32 %44, %45
  store i32 %46, ptr getelementptr inbounds (i8, ptr @fib, i64 184), align 8, !tbaa !5
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %51

47:                                               ; preds = %.critedge
  %48 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t, ptr noundef nonnull @a)
  %49 = load i32, ptr @t, align 4, !tbaa !5
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr @t, align 4, !tbaa !5
  %.not30 = icmp eq i32 %49, 0
  br i1 %.not30, label %._crit_edge, label %.lr.ph31

51:                                               ; preds = %.preheader, %.critedge
  %indvars.iv36 = phi i64 [ 2, %.preheader ], [ %indvars.iv.next37, %.critedge ]
  %52 = phi i32 [ %tot.promoted, %.preheader ], [ %62, %.critedge ]
  %53 = getelementptr inbounds [46341 x i8], ptr @vis, i64 0, i64 %indvars.iv36
  %54 = load i8, ptr %53, align 1, !tbaa !9, !range !11, !noundef !12
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %._crit_edge40, label %56

._crit_edge40:                                    ; preds = %51
  %.pre = trunc nuw nsw i64 %indvars.iv36 to i32
  br label %61

56:                                               ; preds = %51
  %57 = add nsw i32 %52, 1
  store i32 %57, ptr @tot, align 4, !tbaa !5
  %58 = sext i32 %52 to i64
  %59 = getelementptr inbounds [46341 x i32], ptr @prime, i64 0, i64 %58
  %60 = trunc nuw nsw i64 %indvars.iv36 to i32
  store i32 %60, ptr %59, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %._crit_edge40, %56
  %.pre-phi = phi i32 [ %.pre, %._crit_edge40 ], [ %60, %56 ]
  %62 = phi i32 [ %52, %._crit_edge40 ], [ %57, %56 ]
  %.rhs.trunc = trunc nuw i32 %.pre-phi to i16
  %63 = udiv i16 -19196, %.rhs.trunc
  %.zext = zext i16 %63 to i32
  %64 = icmp sgt i32 %62, 0
  br i1 %64, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %61
  %65 = zext nneg i32 %62 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %68
  %indvars.iv33 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next34, %68 ]
  %66 = getelementptr inbounds [46341 x i32], ptr @prime, i64 0, i64 %indvars.iv33
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %.not24 = icmp sgt i32 %67, %.zext
  br i1 %.not24, label %.critedge, label %68

68:                                               ; preds = %.lr.ph
  %69 = mul nsw i32 %67, %.pre-phi
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [46341 x i8], ptr @vis, i64 0, i64 %70
  store i8 1, ptr %71, align 1, !tbaa !9
  %72 = srem i32 %.pre-phi, %67
  %73 = icmp ne i32 %72, 0
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %74 = icmp ult i64 %indvars.iv.next34, %65
  %or.cond = select i1 %73, i1 %74, i1 false
  br i1 %or.cond, label %.lr.ph, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %.lr.ph, %68, %61
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %exitcond39.not = icmp eq i64 %indvars.iv.next37, 46341
  br i1 %exitcond39.not, label %47, label %51, !llvm.loop !15

.lr.ph31:                                         ; preds = %47, %.backedge
  %75 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @p)
  %76 = load i32, ptr @n, align 4, !tbaa !5
  %77 = icmp slt i32 %76, 47
  br i1 %77, label %78, label %89

78:                                               ; preds = %.lr.ph31
  %79 = load i32, ptr @a, align 4, !tbaa !5
  %80 = sext i32 %76 to i64
  %81 = getelementptr inbounds [47 x i32], ptr @fib, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = load i32, ptr @p, align 4, !tbaa !5
  %85 = tail call noundef i32 @_Z7mod_powixi(i32 noundef %79, i64 noundef %83, i32 noundef %84)
  br label %.backedge

.backedge:                                        ; preds = %78, %89
  %.sink = phi i32 [ %85, %78 ], [ %99, %89 ]
  %86 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
  %87 = load i32, ptr @t, align 4, !tbaa !5
  %88 = add nsw i32 %87, -1
  store i32 %88, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %87, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph31, !llvm.loop !16

89:                                               ; preds = %.lr.ph31
  %90 = load i32, ptr @p, align 4, !tbaa !5
  %91 = tail call noundef i32 @_Z3phii(i32 noundef %90)
  %92 = load i32, ptr @a, align 4, !tbaa !5
  %93 = load i32, ptr @n, align 4, !tbaa !5
  %94 = tail call noundef i32 @_Z7mod_fibii(i32 noundef %93, i32 noundef %91)
  %95 = sext i32 %94 to i64
  %96 = sext i32 %91 to i64
  %97 = add nsw i64 %95, %96
  %98 = load i32, ptr @p, align 4, !tbaa !5
  %99 = tail call noundef i32 @_Z7mod_powixi(i32 noundef %92, i64 noundef %97, i32 noundef %98)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %47
  ret i32 0
}

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

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

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

!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 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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