; LLVM IR from tangjz/acm-icpc :: codeforces/gym (101194I)

; 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.Complex = type { double, double }

@_ZL2pi = external hidden global double, align 8
@w = external dso_local global [32769 x %struct.Complex], align 16
@inv = external dso_local global [10001 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@c = external dso_local global [101 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7ComplexC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6solve1v() #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6solve2v() #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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 %struct.Complex, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  store i32 1, ptr getelementptr inbounds ([10001 x i32], ptr @inv, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %11

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

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

15:                                               ; preds = %11
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sdiv i32 1000000007, %16
  %18 = sext i32 %17 to i64
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = srem i32 1000000007, %19
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = mul nsw i64 %18, %24
  %26 = srem i64 %25, 1000000007
  %27 = trunc i64 %26 to i32
  %28 = sub nsw i32 1000000007, %27
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %30
  store i32 %28, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %15
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

35:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 32768, ptr %4, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %82, %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %85

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  %42 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %42, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = ashr i32 %43, 1
  store i32 %44, ptr %6, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %57, %41
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = and i32 %46, 1
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %54, label %49

49:                                               ; preds = %45
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = and i32 %50, 1
  %52 = icmp ne i32 %51, 0
  %53 = xor i1 %52, true
  br label %54

54:                                               ; preds = %49, %45
  %55 = phi i1 [ false, %45 ], [ %53, %49 ]
  br i1 %55, label %56, label %62

56:                                               ; preds = %54
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = ashr i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = ashr i32 %60, 1
  store i32 %61, ptr %6, align 4, !tbaa !5
  br label %45, !llvm.loop !11

62:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #8
  %63 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = sitofp i32 %64 to double
  %66 = fdiv double %63, %65
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = sitofp i32 %67 to double
  %69 = fmul double %66, %68
  %70 = call double @cos(double noundef %69) #8
  %71 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = sitofp i32 %72 to double
  %74 = fdiv double %71, %73
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sitofp i32 %75 to double
  %77 = fmul double %74, %76
  %78 = call double @sin(double noundef %77) #8
  call void @_ZN7ComplexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %70, double noundef %78)
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [32769 x %struct.Complex], ptr @w, i64 0, i64 %80
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %81, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %82

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

85:                                               ; preds = %40
  %86 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %87

87:                                               ; preds = %127, %85
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = load i32, ptr @t, align 4, !tbaa !5
  %90 = icmp sle i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %130

92:                                               ; preds = %87
  %93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @n, ptr noundef @m, ptr noundef @p)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %104, %92
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = load i32, ptr @m, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %107

99:                                               ; preds = %94
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr @c, i64 %101
  %103 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %102)
  br label %104

104:                                              ; preds = %99
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %10, align 4, !tbaa !5
  br label %94, !llvm.loop !16

107:                                              ; preds = %98
  %108 = load i32, ptr @m, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr @c, i64 %109
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @c, ptr noundef %110)
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = load i32, ptr @p, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %123

114:                                              ; preds = %107
  %115 = load i32, ptr @m, align 4, !tbaa !5
  %116 = icmp eq i32 %115, 1
  br i1 %116, label %117, label %119

117:                                              ; preds = %114
  %118 = call noundef i32 @_Z6solve1v()
  br label %121

119:                                              ; preds = %114
  %120 = call noundef i32 @_Z6solve2v()
  br label %121

121:                                              ; preds = %119, %117
  %122 = phi i32 [ %118, %117 ], [ %120, %119 ]
  br label %124

123:                                              ; preds = %107
  br label %124

124:                                              ; preds = %123, %121
  %125 = phi i32 [ %122, %121 ], [ 0, %123 ]
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %111, i32 noundef %125)
  br label %127

127:                                              ; preds = %124
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %8, align 4, !tbaa !5
  br label %87, !llvm.loop !17

130:                                              ; preds = %91
  ret i32 0
}

; Function Attrs: nounwind
declare double @cos(double noundef) #5

; Function Attrs: nounwind
declare double @sin(double noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #7

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

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

%struct.Complex = type { double, double }

@_ZL2pi = external hidden local_unnamed_addr global double, align 8
@w = external dso_local local_unnamed_addr global [32769 x %struct.Complex], align 16
@inv = external dso_local local_unnamed_addr global [10001 x i32], align 16
@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@c = external dso_local global [101 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7ComplexC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6solve1v() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z6solve2v() local_unnamed_addr #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %struct.Complex, align 8
  store i32 1, ptr getelementptr inbounds (i8, ptr @inv, i64 4), align 4, !tbaa !5
  br label %2

2:                                                ; preds = %0, %2
  %indvars.iv = phi i64 [ 2, %0 ], [ %indvars.iv.next, %2 ]
  %3 = trunc nuw nsw i64 %indvars.iv to i32
  %4 = udiv i32 1000000007, %3
  %5 = zext nneg i32 %4 to i64
  %6 = urem i32 1000000007, %3
  %7 = zext nneg i32 %6 to i64
  %8 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = mul nsw i64 %10, %5
  %12 = srem i64 %11, 1000000007
  %13 = trunc nsw i64 %12 to i32
  %14 = sub nsw i32 1000000007, %13
  %15 = getelementptr inbounds [10001 x i32], ptr @inv, i64 0, i64 %indvars.iv
  store i32 %14, ptr %15, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 10001
  br i1 %exitcond.not, label %.preheader, label %2, !llvm.loop !9

.preheader:                                       ; preds = %2, %._crit_edge
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %._crit_edge ], [ 0, %2 ]
  %16 = trunc nuw nsw i64 %indvars.iv55 to i32
  %17 = and i32 %16, 1
  %.not3236 = icmp eq i32 %17, 0
  br i1 %.not3236, label %.lr.ph, label %._crit_edge

18:                                               ; preds = %._crit_edge
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %20 = load i32, ptr @t, align 4, !tbaa !5
  %.not46 = icmp slt i32 %20, 1
  br i1 %.not46, label %._crit_edge50, label %.lr.ph49

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.02638 = phi i32 [ %22, %.lr.ph ], [ 16384, %.preheader ]
  %.02737 = phi i32 [ %21, %.lr.ph ], [ %16, %.preheader ]
  %21 = lshr exact i32 %.02737, 1
  %22 = lshr exact i32 %.02638, 1
  %23 = and i32 %.02737, 2
  %.not32 = icmp eq i32 %23, 0
  %24 = and i32 %.02638, 2
  %.not33 = icmp eq i32 %24, 0
  %25 = select i1 %.not32, i1 %.not33, i1 false
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.027.lcssa = phi i32 [ %16, %.preheader ], [ %21, %.lr.ph ]
  %.026.lcssa = phi i32 [ 16384, %.preheader ], [ %22, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #8
  %26 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %27 = uitofp nneg i32 %.026.lcssa to double
  %28 = fdiv double %26, %27
  %29 = uitofp nneg i32 %.027.lcssa to double
  %30 = fmul double %28, %29
  %31 = call double @cos(double noundef %30) #8
  %32 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %33 = fdiv double %32, %27
  %34 = fmul double %33, %29
  %35 = call double @sin(double noundef %34) #8
  call void @_ZN7ComplexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %31, double noundef %35)
  %36 = getelementptr inbounds [32769 x %struct.Complex], ptr @w, i64 0, i64 %indvars.iv55
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #8
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next56, 32768
  br i1 %exitcond58.not, label %18, label %.preheader, !llvm.loop !15

._crit_edge50:                                    ; preds = %54, %18
  ret i32 0

.lr.ph49:                                         ; preds = %18, %54
  %.02547 = phi i32 [ %57, %54 ], [ 1, %18 ]
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @p)
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph43, label %.lr.ph49.._crit_edge44_crit_edge

.lr.ph49.._crit_edge44_crit_edge:                 ; preds = %.lr.ph49
  %.pre = sext i32 %38 to i64
  br label %._crit_edge44

._crit_edge44:                                    ; preds = %.lr.ph43, %.lr.ph49.._crit_edge44_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.lr.ph49.._crit_edge44_crit_edge ], [ %45, %.lr.ph43 ]
  %40 = getelementptr inbounds i32, ptr @c, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @c, ptr noundef nonnull %40)
  %41 = load i32, ptr @p, align 4, !tbaa !5
  %.not31 = icmp eq i32 %41, 0
  br i1 %.not31, label %54, label %47

.lr.ph43:                                         ; preds = %.lr.ph49, %.lr.ph43
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph43 ], [ 0, %.lr.ph49 ]
  %42 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv59
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %42)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %44 = load i32, ptr @m, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = icmp slt i64 %indvars.iv.next60, %45
  br i1 %46, label %.lr.ph43, label %._crit_edge44, !llvm.loop !16

47:                                               ; preds = %._crit_edge44
  %48 = load i32, ptr @m, align 4, !tbaa !5
  %49 = icmp eq i32 %48, 1
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = call noundef i32 @_Z6solve1v()
  br label %54

52:                                               ; preds = %47
  %53 = call noundef i32 @_Z6solve2v()
  br label %54

54:                                               ; preds = %._crit_edge44, %50, %52
  %55 = phi i32 [ %51, %50 ], [ %53, %52 ], [ 0, %._crit_edge44 ]
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.02547, i32 noundef %55)
  %57 = add nuw nsw i32 %.02547, 1
  %58 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.02547, %58
  br i1 %.not.not, label %.lr.ph49, label %._crit_edge50, !llvm.loop !17
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #7

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree 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 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 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { 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 #7 = { inlinehint 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 #8 = { 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, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass