; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1070. Mooncake (25) (main)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl" }
%"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl" = type { %"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%struct.mooncake = type { float, float, float }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp8mooncakeS_(<2 x float>, float, <2 x float>, float) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #8
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #8
  call void @_ZNSaI8mooncakeEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  invoke void @_ZNSt6vectorI8mooncakeSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %19, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %20 unwind label %26

20:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI8mooncakeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %37, %20
  %22 = load i32, ptr %8, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %30, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %44

26:                                               ; preds = %0
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %6, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %7, align 4
  call void @_ZNSt15__new_allocatorI8mooncakeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #8
  br label %160

30:                                               ; preds = %21
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %32) #8
  %34 = getelementptr inbounds %struct.mooncake, ptr %33, i32 0, i32 0
  %35 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %34)
          to label %36 unwind label %40

36:                                               ; preds = %30
  br label %37

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

40:                                               ; preds = %30
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %6, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %159

44:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %57, %44
  %46 = load i32, ptr %9, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %64

50:                                               ; preds = %45
  %51 = load i32, ptr %9, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %52) #8
  %54 = getelementptr inbounds %struct.mooncake, ptr %53, i32 0, i32 1
  %55 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %54)
          to label %56 unwind label %60

56:                                               ; preds = %50
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %9, align 4, !tbaa !5
  br label %45, !llvm.loop !11

60:                                               ; preds = %50
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %6, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %159

64:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %86, %64
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %89

70:                                               ; preds = %65
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %72) #8
  %74 = getelementptr inbounds %struct.mooncake, ptr %73, i32 0, i32 1
  %75 = load float, ptr %74, align 4, !tbaa !12
  %76 = load i32, ptr %10, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %77) #8
  %79 = getelementptr inbounds %struct.mooncake, ptr %78, i32 0, i32 0
  %80 = load float, ptr %79, align 4, !tbaa !15
  %81 = fdiv float %75, %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %83) #8
  %85 = getelementptr inbounds %struct.mooncake, ptr %84, i32 0, i32 2
  store float %81, ptr %85, align 4, !tbaa !16
  br label %86

86:                                               ; preds = %70
  %87 = load i32, ptr %10, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %10, align 4, !tbaa !5
  br label %65, !llvm.loop !17

89:                                               ; preds = %69
  %90 = call ptr @_ZNSt6vectorI8mooncakeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %91 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %90, ptr %91, align 8
  %92 = call ptr @_ZNSt6vectorI8mooncakeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8
  %96 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP8mooncakeSt6vectorIS2_SaIS2_EEEEPFiS2_S2_EEvT_SA_T0_(ptr %95, ptr %97, ptr noundef @_Z3cmp8mooncakeS_)
          to label %98 unwind label %104

98:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store float 0.000000e+00, ptr %13, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %145, %98
  %100 = load i32, ptr %14, align 4, !tbaa !5
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %108, label %103

103:                                              ; preds = %99
  store i32 11, ptr %15, align 4
  br label %148

104:                                              ; preds = %89
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %6, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %7, align 4
  br label %159

108:                                              ; preds = %99
  %109 = load i32, ptr %14, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %110) #8
  %112 = getelementptr inbounds %struct.mooncake, ptr %111, i32 0, i32 0
  %113 = load float, ptr %112, align 4, !tbaa !15
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = sitofp i32 %114 to float
  %116 = fcmp ole float %113, %115
  br i1 %116, label %117, label %125

117:                                              ; preds = %108
  %118 = load float, ptr %13, align 4, !tbaa !18
  %119 = load i32, ptr %14, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %120) #8
  %122 = getelementptr inbounds %struct.mooncake, ptr %121, i32 0, i32 1
  %123 = load float, ptr %122, align 4, !tbaa !12
  %124 = fadd float %118, %123
  store float %124, ptr %13, align 4, !tbaa !18
  br label %135

125:                                              ; preds = %108
  %126 = load float, ptr %13, align 4, !tbaa !18
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %128) #8
  %130 = getelementptr inbounds %struct.mooncake, ptr %129, i32 0, i32 2
  %131 = load float, ptr %130, align 4, !tbaa !16
  %132 = load i32, ptr %3, align 4, !tbaa !5
  %133 = sitofp i32 %132 to float
  %134 = call float @llvm.fmuladd.f32(float %131, float %133, float %126)
  store float %134, ptr %13, align 4, !tbaa !18
  store i32 11, ptr %15, align 4
  br label %148

135:                                              ; preds = %117
  %136 = load i32, ptr %3, align 4, !tbaa !5
  %137 = sitofp i32 %136 to float
  %138 = load i32, ptr %14, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %139) #8
  %141 = getelementptr inbounds %struct.mooncake, ptr %140, i32 0, i32 0
  %142 = load float, ptr %141, align 4, !tbaa !15
  %143 = fsub float %137, %142
  %144 = fptosi float %143 to i32
  store i32 %144, ptr %3, align 4, !tbaa !5
  br label %145

145:                                              ; preds = %135
  %146 = load i32, ptr %14, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %14, align 4, !tbaa !5
  br label %99, !llvm.loop !19

148:                                              ; preds = %125, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %149

149:                                              ; preds = %148
  %150 = load float, ptr %13, align 4, !tbaa !18
  %151 = fpext float %150 to double
  %152 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %151)
          to label %153 unwind label %155

153:                                              ; preds = %149
  store i32 0, ptr %1, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @_ZNSt6vectorI8mooncakeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %154 = load i32, ptr %1, align 4
  ret i32 %154

155:                                              ; preds = %149
  %156 = landingpad { ptr, i32 }
          cleanup
  %157 = extractvalue { ptr, i32 } %156, 0
  store ptr %157, ptr %6, align 8
  %158 = extractvalue { ptr, i32 } %156, 1
  store i32 %158, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %159

159:                                              ; preds = %155, %104, %60, %40
  call void @_ZNSt6vectorI8mooncakeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #8
  br label %160

160:                                              ; preds = %159, %26
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %161

161:                                              ; preds = %160
  %162 = load ptr, ptr %6, align 8
  %163 = load i32, ptr %7, align 4
  %164 = insertvalue { ptr, i32 } poison, ptr %162, 0
  %165 = insertvalue { ptr, i32 } %164, i32 %163, 1
  resume { ptr, i32 } %165
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI8mooncakeEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI8mooncakeSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI8mooncakeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI8mooncakeED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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, !14, i64 4}
!13 = !{!"_ZTS8mooncake", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"float", !7, i64 0}
!15 = !{!13, !14, i64 0}
!16 = !{!13, !14, i64 8}
!17 = distinct !{!17, !10}
!18 = !{!14, !14, i64 0}
!19 = distinct !{!19, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl" }
%"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl" = type { %"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl_data" }
%"struct.std::_Vector_base<mooncake, std::allocator<mooncake>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3cmp8mooncakeS_(<2 x float>, float, <2 x float>, float) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  %5 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #9
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #9
  call void @_ZNSaI8mooncakeEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #9
  invoke void @_ZNSt6vectorI8mooncakeSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %8, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %9 unwind label %13

9:                                                ; preds = %0
  call void @_ZNSt15__new_allocatorI8mooncakeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #9
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.preheader31:                                     ; preds = %.lr.ph
  %12 = icmp sgt i32 %17, 0
  br i1 %12, label %.lr.ph35, label %._crit_edge

13:                                               ; preds = %0
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI8mooncakeED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #9
  br label %71

.lr.ph:                                           ; preds = %9, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %9 ]
  %15 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #9
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %15)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = icmp slt i64 %indvars.iv.next, %18
  br i1 %19, label %.lr.ph, label %.preheader31, !llvm.loop !9

.preheader30:                                     ; preds = %.lr.ph35
  %20 = icmp sgt i32 %24, 0
  br i1 %20, label %.lr.ph37, label %._crit_edge

.lr.ph35:                                         ; preds = %.preheader31, %.lr.ph35
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph35 ], [ 0, %.preheader31 ]
  %21 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv45) #9
  %22 = getelementptr inbounds i8, ptr %21, i64 4
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %22)
  %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next46, %25
  br i1 %26, label %.lr.ph35, label %.preheader30, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph37, %9, %.preheader31, %.preheader30
  %27 = call ptr @_ZNSt6vectorI8mooncakeSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  %28 = call ptr @_ZNSt6vectorI8mooncakeSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP8mooncakeSt6vectorIS2_SaIS2_EEEEPFiS2_S2_EEvT_SA_T0_(ptr %27, ptr %28, ptr noundef nonnull @_Z3cmp8mooncakeS_)
          to label %.preheader unwind label %42

.preheader:                                       ; preds = %._crit_edge
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph40, label %.loopexit

.lr.ph37:                                         ; preds = %.preheader30, %.lr.ph37
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.lr.ph37 ], [ 0, %.preheader30 ]
  %31 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv48) #9
  %32 = getelementptr inbounds i8, ptr %31, i64 4
  %33 = load float, ptr %32, align 4, !tbaa !12
  %34 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv48) #9
  %35 = load float, ptr %34, align 4, !tbaa !15
  %36 = fdiv float %33, %35
  %37 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv48) #9
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  store float %36, ptr %38, align 4, !tbaa !16
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next49, %40
  br i1 %41, label %.lr.ph37, label %._crit_edge, !llvm.loop !17

42:                                               ; preds = %._crit_edge
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorI8mooncakeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  br label %71

.lr.ph40:                                         ; preds = %.preheader, %50
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %50 ], [ 0, %.preheader ]
  %.02338 = phi float [ %53, %50 ], [ 0.000000e+00, %.preheader ]
  %44 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv51) #9
  %45 = load float, ptr %44, align 4, !tbaa !15
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = sitofp i32 %46 to float
  %48 = fcmp ugt float %45, %47
  %49 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv51) #9
  br i1 %48, label %63, label %50

50:                                               ; preds = %.lr.ph40
  %51 = getelementptr inbounds i8, ptr %49, i64 4
  %52 = load float, ptr %51, align 4, !tbaa !12
  %53 = fadd float %.02338, %52
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sitofp i32 %54 to float
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv51) #9
  %57 = load float, ptr %56, align 4, !tbaa !15
  %58 = fsub float %55, %57
  %59 = fptosi float %58 to i32
  store i32 %59, ptr %2, align 4, !tbaa !5
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next52, %61
  br i1 %62, label %.lr.ph40, label %.loopexit, !llvm.loop !18

63:                                               ; preds = %.lr.ph40
  %64 = getelementptr inbounds i8, ptr %49, i64 8
  %65 = load float, ptr %64, align 4, !tbaa !16
  %66 = load i32, ptr %2, align 4, !tbaa !5
  %67 = sitofp i32 %66 to float
  %68 = call float @llvm.fmuladd.f32(float %65, float %67, float %.02338)
  br label %.loopexit

.loopexit:                                        ; preds = %50, %.preheader, %63
  %.1 = phi float [ %68, %63 ], [ 0.000000e+00, %.preheader ], [ %53, %50 ]
  %69 = fpext float %.1 to double
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %69)
  call void @_ZNSt6vectorI8mooncakeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0

71:                                               ; preds = %42, %13
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %14, %13 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaI8mooncakeEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI8mooncakeSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorI8mooncakeSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #4 align 2

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #8

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorI8mooncakeSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorI8mooncakeED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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, !14, i64 4}
!13 = !{!"_ZTS8mooncake", !14, i64 0, !14, i64 4, !14, i64 8}
!14 = !{!"float", !7, i64 0}
!15 = !{!13, !14, i64 0}
!16 = !{!13, !14, i64 8}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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