; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/282 Division 1/Problem C (C)

; 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.seg = type { i32, i32, i32, double, [5010 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@s = external dso_local global [5010 x %struct.seg], align 16
@a = external dso_local global [100100 x i32], align 16
@g = external dso_local global [5010 x %"class.std::vector"], align 16
@mx = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4compRK3segS1_(ptr noundef nonnull align 8 dereferenceable(40104), ptr noundef nonnull align 8 dereferenceable(40104)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11sparseTablev() #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3rmqii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7computei(i32 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 personality ptr @__gxx_personality_v0 {
  %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 double, align 8
  %7 = alloca %"class.std::stack", align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %31, %0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = icmp sle i32 %17, %18
  br i1 %19, label %21, label %20

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

21:                                               ; preds = %16
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %23
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %24)
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %27
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %30 = load i32, ptr %29, align 4, !tbaa !5
  store i32 %30, ptr @mx, align 4, !tbaa !5
  br label %31

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

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

35:                                               ; preds = %54, %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr @q, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.seg, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %46
  %48 = getelementptr inbounds %struct.seg, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %50
  %52 = getelementptr inbounds %struct.seg, ptr %51, i32 0, i32 3
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %44, ptr noundef %48, ptr noundef %52)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %54

54:                                               ; preds = %40
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %3, align 4, !tbaa !5
  br label %35, !llvm.loop !11

57:                                               ; preds = %39
  store i32 0, ptr @s, align 16, !tbaa !12
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr getelementptr inbounds (%struct.seg, ptr @s, i32 0, i32 1), align 4, !tbaa !15
  store double 0.000000e+00, ptr getelementptr inbounds (%struct.seg, ptr @s, i32 0, i32 3), align 16, !tbaa !16
  %60 = load i32, ptr @mx, align 4, !tbaa !5
  store i32 %60, ptr getelementptr inbounds (%struct.seg, ptr @s, i32 0, i32 2), align 8, !tbaa !17
  %61 = load i32, ptr @q, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.seg, ptr @s, i64 %62
  %64 = getelementptr inbounds %struct.seg, ptr %63, i64 1
  call void @_ZSt4sortIP3segPFbRKS0_S3_EEvT_S6_T0_(ptr noundef getelementptr inbounds (%struct.seg, ptr @s, i64 1), ptr noundef %64, ptr noundef @_Z4compRK3segS1_)
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %65 unwind label %71

65:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %109, %65
  %67 = load i32, ptr %11, align 4, !tbaa !5
  %68 = load i32, ptr @q, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %75, label %70

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

71:                                               ; preds = %57
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %9, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %187

75:                                               ; preds = %66
  br label %76

76:                                               ; preds = %96, %75
  %77 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %78 unwind label %97

78:                                               ; preds = %76
  br i1 %77, label %93, label %79

79:                                               ; preds = %78
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %81 unwind label %97

81:                                               ; preds = %79
  %82 = load i32, ptr %80, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.seg, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !15
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %88
  %90 = getelementptr inbounds %struct.seg, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !12
  %92 = icmp slt i32 %86, %91
  br label %93

93:                                               ; preds = %81, %78
  %94 = phi i1 [ false, %78 ], [ %92, %81 ]
  br i1 %94, label %95, label %101

95:                                               ; preds = %93
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %96 unwind label %97

96:                                               ; preds = %95
  br label %76, !llvm.loop !18

97:                                               ; preds = %107, %103, %101, %95, %79, %76
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %9, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %187

101:                                              ; preds = %93
  %102 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %103 unwind label %97

103:                                              ; preds = %101
  %104 = load i32, ptr %102, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %105
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %106, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %107 unwind label %97

107:                                              ; preds = %103
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %108 unwind label %97

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %11, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %11, align 4, !tbaa !5
  br label %66, !llvm.loop !19

112:                                              ; preds = %70
  invoke void @_Z11sparseTablev()
          to label %113 unwind label %119

113:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %140, %113
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = load i32, ptr @q, align 4, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %123, label %118

118:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %147

119:                                              ; preds = %147, %112
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %9, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %10, align 4
  br label %187

123:                                              ; preds = %114
  %124 = load i32, ptr %12, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.seg, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 8, !tbaa !12
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %130
  %132 = getelementptr inbounds %struct.seg, ptr %131, i32 0, i32 1
  %133 = load i32, ptr %132, align 4, !tbaa !15
  %134 = invoke noundef i32 @_Z3rmqii(i32 noundef %128, i32 noundef %133)
          to label %135 unwind label %143

135:                                              ; preds = %123
  %136 = load i32, ptr %12, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.seg, ptr %138, i32 0, i32 2
  store i32 %134, ptr %139, align 8, !tbaa !17
  br label %140

140:                                              ; preds = %135
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %12, align 4, !tbaa !5
  br label %114, !llvm.loop !20

143:                                              ; preds = %123
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %9, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %187

147:                                              ; preds = %118
  invoke void @_Z7computei(i32 noundef 0)
          to label %148 unwind label %119

148:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %149 = load double, ptr getelementptr inbounds (%struct.seg, ptr @s, i32 0, i32 4), align 8, !tbaa !21
  %150 = load i32, ptr @mx, align 4, !tbaa !5
  %151 = sitofp i32 %150 to double
  %152 = fmul double %149, %151
  store double %152, ptr %13, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %153

153:                                              ; preds = %175, %148
  %154 = load i32, ptr %14, align 4, !tbaa !5
  %155 = load i32, ptr @q, align 4, !tbaa !5
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %158, label %157

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

158:                                              ; preds = %153
  %159 = load i32, ptr %14, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [5010 x double], ptr getelementptr inbounds (%struct.seg, ptr @s, i32 0, i32 4), i64 0, i64 %160
  %162 = load double, ptr %161, align 8, !tbaa !21
  %163 = load i32, ptr %14, align 4, !tbaa !5
  %164 = sub nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [5010 x double], ptr getelementptr inbounds (%struct.seg, ptr @s, i32 0, i32 4), i64 0, i64 %165
  %167 = load double, ptr %166, align 8, !tbaa !21
  %168 = fsub double %162, %167
  %169 = load i32, ptr @mx, align 4, !tbaa !5
  %170 = load i32, ptr %14, align 4, !tbaa !5
  %171 = add nsw i32 %169, %170
  %172 = sitofp i32 %171 to double
  %173 = load double, ptr %13, align 8, !tbaa !21
  %174 = call double @llvm.fmuladd.f64(double %168, double %172, double %173)
  store double %174, ptr %13, align 8, !tbaa !21
  br label %175

175:                                              ; preds = %158
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %14, align 4, !tbaa !5
  br label %153, !llvm.loop !22

178:                                              ; preds = %157
  %179 = load double, ptr %13, align 8, !tbaa !21
  %180 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %179)
          to label %181 unwind label %183

181:                                              ; preds = %178
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #8
  %182 = load i32, ptr %1, align 4
  ret i32 %182

183:                                              ; preds = %178
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %9, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %187

187:                                              ; preds = %183, %143, %119, %97, %71
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #8
  br label %188

188:                                              ; preds = %187
  %189 = load ptr, ptr %9, align 8
  %190 = load i32, ptr %10, align 4
  %191 = insertvalue { ptr, i32 } poison, ptr %189, 0
  %192 = insertvalue { ptr, i32 } %191, i32 %190, 1
  resume { ptr, i32 } %192
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #7

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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 = { "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 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !6, i64 0}
!13 = !{!"_ZTS3seg", !6, i64 0, !6, i64 4, !6, i64 8, !14, i64 16, !7, i64 24}
!14 = !{!"double", !7, i64 0}
!15 = !{!13, !6, i64 4}
!16 = !{!13, !14, i64 16}
!17 = !{!13, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!14, !14, i64 0}
!22 = distinct !{!22, !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.seg = type { i32, i32, i32, double, [5010 x double] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@s = external dso_local global [5010 x %struct.seg], align 16
@a = external dso_local global [100100 x i32], align 16
@g = external dso_local global [5010 x %"class.std::vector"], align 16
@mx = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4compRK3segS1_(ptr noundef nonnull align 8 dereferenceable(40104), ptr noundef nonnull align 8 dereferenceable(40104)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11sparseTablev() local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::stack", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %.not36 = icmp slt i32 %5, 1
  br i1 %.not36, label %.preheader35, label %.lr.ph

.preheader35:                                     ; preds = %.lr.ph, %0
  %6 = phi i32 [ %5, %0 ], [ %12, %.lr.ph ]
  %7 = load i32, ptr @q, align 4, !tbaa !5
  %.not2938 = icmp slt i32 %7, 1
  br i1 %.not2938, label %.preheader35.._crit_edge_crit_edge, label %.lr.ph40

.preheader35.._crit_edge_crit_edge:               ; preds = %.preheader35
  %.pre68 = sext i32 %7 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %8 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %8)
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @mx, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %11 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %11, ptr @mx, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %.not.not = icmp slt i64 %indvars.iv, %13
  br i1 %.not.not, label %.lr.ph, label %.preheader35, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.lr.ph40
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %.preheader35.._crit_edge_crit_edge, %._crit_edge.loopexit
  %.pre-phi = phi i64 [ %.pre68, %.preheader35.._crit_edge_crit_edge ], [ %24, %._crit_edge.loopexit ]
  %14 = phi i32 [ %6, %.preheader35.._crit_edge_crit_edge ], [ %.pre, %._crit_edge.loopexit ]
  store i32 0, ptr @s, align 16, !tbaa !11
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr getelementptr inbounds (i8, ptr @s, i64 4), align 4, !tbaa !14
  store double 0.000000e+00, ptr getelementptr inbounds (i8, ptr @s, i64 16), align 16, !tbaa !15
  %16 = load i32, ptr @mx, align 4, !tbaa !5
  store i32 %16, ptr getelementptr inbounds (i8, ptr @s, i64 8), align 8, !tbaa !16
  %17 = getelementptr inbounds %struct.seg, ptr @s, i64 %.pre-phi
  %18 = getelementptr inbounds i8, ptr %17, i64 40104
  tail call void @_ZSt4sortIP3segPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @s, i64 40104), ptr noundef nonnull %18, ptr noundef nonnull @_Z4compRK3segS1_)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #8
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %25 unwind label %29

.lr.ph40:                                         ; preds = %.preheader35, %.lr.ph40
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph40 ], [ 1, %.preheader35 ]
  %19 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %indvars.iv59
  %20 = getelementptr inbounds i8, ptr %19, i64 4
  %21 = getelementptr inbounds i8, ptr %19, i64 16
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %19, ptr noundef nonnull %20, ptr noundef nonnull %21)
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %23 = load i32, ptr @q, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %.not29.not = icmp slt i64 %indvars.iv59, %24
  br i1 %.not29.not, label %.lr.ph40, label %._crit_edge.loopexit, !llvm.loop !17

25:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 1, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr @q, align 4, !tbaa !5
  %.not3043 = icmp slt i32 %26, 1
  br i1 %.not3043, label %._crit_edge44, label %.preheader34

.preheader34:                                     ; preds = %25, %50
  %27 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %27, label %.critedge, label %.lr.ph41

._crit_edge44:                                    ; preds = %50, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  invoke void @_Z11sparseTablev()
          to label %.preheader unwind label %54

.preheader:                                       ; preds = %._crit_edge44
  %28 = load i32, ptr @q, align 4, !tbaa !5
  %.not3145 = icmp slt i32 %28, 1
  br i1 %.not3145, label %._crit_edge48, label %.lr.ph47

29:                                               ; preds = %._crit_edge
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  br label %98

.lr.ph41:                                         ; preds = %.preheader34, %41
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %33, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !14
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %37
  %39 = load i32, ptr %38, align 8, !tbaa !11
  %40 = icmp slt i32 %35, %39
  br i1 %40, label %41, label %.critedge

41:                                               ; preds = %.lr.ph41
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %42 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %42, label %.critedge, label %.lr.ph41, !llvm.loop !18

43:                                               ; preds = %49, %.critedge
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %98

.critedge:                                        ; preds = %.lr.ph41, %41, %.preheader34
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [5010 x %"class.std::vector"], ptr @g, i64 0, i64 %47
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %49 unwind label %43

49:                                               ; preds = %.critedge
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %50 unwind label %43

50:                                               ; preds = %49
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !5
  %53 = load i32, ptr @q, align 4, !tbaa !5
  %.not30.not = icmp slt i32 %51, %53
  br i1 %.not30.not, label %.preheader34, label %._crit_edge44, !llvm.loop !19

._crit_edge48:                                    ; preds = %61, %.preheader
  invoke void @_Z7computei(i32 noundef 0)
          to label %67 unwind label %54

54:                                               ; preds = %._crit_edge48, %._crit_edge44
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %98

.lr.ph47:                                         ; preds = %.preheader, %61
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %61 ], [ 1, %.preheader ]
  %56 = getelementptr inbounds [5010 x %struct.seg], ptr @s, i64 0, i64 %indvars.iv62
  %57 = load i32, ptr %56, align 8, !tbaa !11
  %58 = getelementptr inbounds i8, ptr %56, i64 4
  %59 = load i32, ptr %58, align 4, !tbaa !14
  %60 = invoke noundef i32 @_Z3rmqii(i32 noundef %57, i32 noundef %59)
          to label %61 unwind label %65

61:                                               ; preds = %.lr.ph47
  %62 = getelementptr inbounds i8, ptr %56, i64 8
  store i32 %60, ptr %62, align 8, !tbaa !16
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %63 = load i32, ptr @q, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %.not31.not = icmp slt i64 %indvars.iv62, %64
  br i1 %.not31.not, label %.lr.ph47, label %._crit_edge48, !llvm.loop !20

65:                                               ; preds = %.lr.ph47
  %66 = landingpad { ptr, i32 }
          cleanup
  br label %98

67:                                               ; preds = %._crit_edge48
  %68 = load double, ptr getelementptr inbounds (i8, ptr @s, i64 24), align 8, !tbaa !21
  %69 = load i32, ptr @mx, align 4, !tbaa !5
  %70 = sitofp i32 %69 to double
  %71 = fmul double %68, %70
  %72 = load i32, ptr @q, align 4, !tbaa !5
  %.not3249 = icmp slt i32 %72, 1
  br i1 %.not3249, label %._crit_edge54, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %67
  %73 = zext nneg i32 %72 to i64
  %xtraiter = and i64 %73, 1
  %74 = icmp eq i32 %72, 1
  br i1 %74, label %._crit_edge54.loopexit.unr-lcssa, label %.lr.ph53.preheader.new

.lr.ph53.preheader.new:                           ; preds = %.lr.ph53.preheader
  %unroll_iter = and i64 %73, 2147483646
  br label %.lr.ph53

._crit_edge54.loopexit.unr-lcssa:                 ; preds = %.lr.ph53, %.lr.ph53.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph53.preheader ], [ %97, %.lr.ph53 ]
  %.unr = phi double [ %68, %.lr.ph53.preheader ], [ %92, %.lr.ph53 ]
  %indvars.iv65.unr = phi i64 [ 1, %.lr.ph53.preheader ], [ %indvars.iv.next66.1, %.lr.ph53 ]
  %.02350.unr = phi double [ %71, %.lr.ph53.preheader ], [ %97, %.lr.ph53 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge54, label %.lr.ph53.epil

.lr.ph53.epil:                                    ; preds = %._crit_edge54.loopexit.unr-lcssa
  %75 = getelementptr inbounds [5010 x double], ptr getelementptr inbounds (i8, ptr @s, i64 24), i64 0, i64 %indvars.iv65.unr
  %76 = load double, ptr %75, align 8, !tbaa !21
  %77 = fsub double %76, %.unr
  %78 = trunc i64 %indvars.iv65.unr to i32
  %79 = add i32 %69, %78
  %80 = sitofp i32 %79 to double
  %81 = call double @llvm.fmuladd.f64(double %77, double %80, double %.02350.unr)
  br label %._crit_edge54

._crit_edge54:                                    ; preds = %.lr.ph53.epil, %._crit_edge54.loopexit.unr-lcssa, %67
  %.023.lcssa = phi double [ %71, %67 ], [ %.lcssa.ph, %._crit_edge54.loopexit.unr-lcssa ], [ %81, %.lr.ph53.epil ]
  %82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %.023.lcssa)
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #8
  ret i32 0

.lr.ph53:                                         ; preds = %.lr.ph53, %.lr.ph53.preheader.new
  %83 = phi double [ %68, %.lr.ph53.preheader.new ], [ %92, %.lr.ph53 ]
  %indvars.iv65 = phi i64 [ 1, %.lr.ph53.preheader.new ], [ %indvars.iv.next66.1, %.lr.ph53 ]
  %.02350 = phi double [ %71, %.lr.ph53.preheader.new ], [ %97, %.lr.ph53 ]
  %niter = phi i64 [ 0, %.lr.ph53.preheader.new ], [ %niter.next.1, %.lr.ph53 ]
  %84 = getelementptr inbounds [5010 x double], ptr getelementptr inbounds (i8, ptr @s, i64 24), i64 0, i64 %indvars.iv65
  %85 = load double, ptr %84, align 8, !tbaa !21
  %86 = fsub double %85, %83
  %87 = trunc i64 %indvars.iv65 to i32
  %88 = add i32 %69, %87
  %89 = sitofp i32 %88 to double
  %90 = call double @llvm.fmuladd.f64(double %86, double %89, double %.02350)
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %91 = getelementptr inbounds [5010 x double], ptr getelementptr inbounds (i8, ptr @s, i64 24), i64 0, i64 %indvars.iv.next66
  %92 = load double, ptr %91, align 8, !tbaa !21
  %93 = fsub double %92, %85
  %94 = trunc i64 %indvars.iv.next66 to i32
  %95 = add i32 %69, %94
  %96 = sitofp i32 %95 to double
  %97 = call double @llvm.fmuladd.f64(double %93, double %96, double %90)
  %indvars.iv.next66.1 = add nuw nsw i64 %indvars.iv65, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge54.loopexit.unr-lcssa, label %.lr.ph53, !llvm.loop !22

98:                                               ; preds = %65, %54, %43, %29
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %66, %65 ], [ %55, %54 ], [ %30, %29 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #8
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #7

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 #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 = { 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 #6 = { 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 #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS3seg", !6, i64 0, !6, i64 4, !6, i64 8, !13, i64 16, !7, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 4}
!15 = !{!12, !13, i64 16}
!16 = !{!12, !6, i64 8}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = !{!13, !13, i64 0}
!22 = distinct !{!22, !10}


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