; LLVM IR from kazunetakahashi/atcoder :: 2017/0114_dwacon2017-honsen (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"

%"class.std::complex" = type { { double, double } }

@R = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3saydd(double noundef, double noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca %"class.std::complex", align 8
  %19 = alloca %"class.std::complex", align 8
  %20 = alloca %"class.std::complex", align 8
  %21 = alloca %"class.std::complex", align 8
  %22 = alloca %"class.std::complex", align 8
  %23 = alloca %"class.std::complex", align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca %"class.std::complex", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %72, %0
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 10
  br i1 %29, label %31, label %30

30:                                               ; preds = %27
  store i32 2, ptr %5, align 4
  br label %75

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %66, %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 10
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  store i32 5, ptr %5, align 4
  br label %69

36:                                               ; preds = %32
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr @R, align 4, !tbaa !5
  %39 = mul nsw i32 %37, %38
  %40 = load i32, ptr @R, align 4, !tbaa !5
  %41 = sdiv i32 %40, 2
  %42 = add nsw i32 %39, %41
  %43 = sitofp i32 %42 to double
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr @R, align 4, !tbaa !5
  %46 = mul nsw i32 %44, %45
  %47 = load i32, ptr @R, align 4, !tbaa !5
  %48 = sdiv i32 %47, 2
  %49 = add nsw i32 %46, %48
  %50 = sitofp i32 %49 to double
  %51 = call noundef zeroext i1 @_Z3saydd(double noundef %43, double noundef %50)
  br i1 %51, label %52, label %65

52:                                               ; preds = %36
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = load i32, ptr @R, align 4, !tbaa !5
  %55 = mul nsw i32 %53, %54
  %56 = load i32, ptr @R, align 4, !tbaa !5
  %57 = sdiv i32 %56, 2
  %58 = add nsw i32 %55, %57
  store i32 %58, ptr %2, align 4, !tbaa !5
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr @R, align 4, !tbaa !5
  %61 = mul nsw i32 %59, %60
  %62 = load i32, ptr @R, align 4, !tbaa !5
  %63 = sdiv i32 %62, 2
  %64 = add nsw i32 %61, %63
  store i32 %64, ptr %3, align 4, !tbaa !5
  store i32 8, ptr %5, align 4
  br label %69

65:                                               ; preds = %36
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %6, align 4, !tbaa !5
  br label %32, !llvm.loop !9

69:                                               ; preds = %52, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %70 = load i32, ptr %5, align 4
  switch i32 %70, label %75 [
    i32 5, label %71
  ]

71:                                               ; preds = %69
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %4, align 4, !tbaa !5
  br label %27, !llvm.loop !11

75:                                               ; preds = %69, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %76 = load i32, ptr %5, align 4
  switch i32 %76, label %200 [
    i32 2, label %77
    i32 8, label %78
  ]

77:                                               ; preds = %75
  br label %78

78:                                               ; preds = %77, %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sitofp i32 %79 to double
  store double %80, ptr %7, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = load i32, ptr @R, align 4, !tbaa !5
  %83 = mul nsw i32 2, %82
  %84 = sub nsw i32 %81, %83
  %85 = sub nsw i32 %84, 1
  %86 = sitofp i32 %85 to double
  store double %86, ptr %8, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %87 = load i32, ptr %3, align 4, !tbaa !5
  %88 = sitofp i32 %87 to double
  store double %88, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %106, %78
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = icmp slt i32 %90, 49
  br i1 %91, label %93, label %92

92:                                               ; preds = %89
  store i32 9, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %109

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %94 = load double, ptr %7, align 8, !tbaa !12
  %95 = load double, ptr %8, align 8, !tbaa !12
  %96 = fadd double %94, %95
  %97 = fdiv double %96, 2.000000e+00
  store double %97, ptr %11, align 8, !tbaa !12
  %98 = load double, ptr %11, align 8, !tbaa !12
  %99 = load double, ptr %9, align 8, !tbaa !12
  %100 = call noundef zeroext i1 @_Z3saydd(double noundef %98, double noundef %99)
  br i1 %100, label %101, label %103

101:                                              ; preds = %93
  %102 = load double, ptr %11, align 8, !tbaa !12
  store double %102, ptr %7, align 8, !tbaa !12
  br label %105

103:                                              ; preds = %93
  %104 = load double, ptr %11, align 8, !tbaa !12
  store double %104, ptr %8, align 8, !tbaa !12
  br label %105

105:                                              ; preds = %103, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %10, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %10, align 4, !tbaa !5
  br label %89, !llvm.loop !14

109:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %110 = load double, ptr %7, align 8, !tbaa !12
  store double %110, ptr %12, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %111 = load double, ptr %9, align 8, !tbaa !12
  store double %111, ptr %13, align 8, !tbaa !12
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = sitofp i32 %112 to double
  store double %113, ptr %7, align 8, !tbaa !12
  %114 = load i32, ptr %3, align 4, !tbaa !5
  %115 = load i32, ptr @R, align 4, !tbaa !5
  %116 = mul nsw i32 2, %115
  %117 = sub nsw i32 %114, %116
  %118 = sub nsw i32 %117, 1
  %119 = sitofp i32 %118 to double
  store double %119, ptr %8, align 8, !tbaa !12
  %120 = load i32, ptr %2, align 4, !tbaa !5
  %121 = sitofp i32 %120 to double
  store double %121, ptr %9, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %139, %109
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = icmp slt i32 %123, 49
  br i1 %124, label %126, label %125

125:                                              ; preds = %122
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %142

126:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %127 = load double, ptr %7, align 8, !tbaa !12
  %128 = load double, ptr %8, align 8, !tbaa !12
  %129 = fadd double %127, %128
  %130 = fdiv double %129, 2.000000e+00
  store double %130, ptr %15, align 8, !tbaa !12
  %131 = load double, ptr %9, align 8, !tbaa !12
  %132 = load double, ptr %15, align 8, !tbaa !12
  %133 = call noundef zeroext i1 @_Z3saydd(double noundef %131, double noundef %132)
  br i1 %133, label %134, label %136

134:                                              ; preds = %126
  %135 = load double, ptr %15, align 8, !tbaa !12
  store double %135, ptr %7, align 8, !tbaa !12
  br label %138

136:                                              ; preds = %126
  %137 = load double, ptr %15, align 8, !tbaa !12
  store double %137, ptr %8, align 8, !tbaa !12
  br label %138

138:                                              ; preds = %136, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %14, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %14, align 4, !tbaa !5
  br label %122, !llvm.loop !15

142:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %143 = load double, ptr %9, align 8, !tbaa !12
  store double %143, ptr %16, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %144 = load double, ptr %7, align 8, !tbaa !12
  store double %144, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #7
  %145 = load double, ptr %12, align 8, !tbaa !12
  %146 = load double, ptr %13, align 8, !tbaa !12
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %18, double noundef %145, double noundef %146)
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %147 = load double, ptr %12, align 8, !tbaa !12
  %148 = load double, ptr %16, align 8, !tbaa !12
  %149 = fadd double %147, %148
  %150 = fdiv double %149, 2.000000e+00
  %151 = load double, ptr %13, align 8, !tbaa !12
  %152 = load double, ptr %17, align 8, !tbaa !12
  %153 = fadd double %151, %152
  %154 = fdiv double %153, 2.000000e+00
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %19, double noundef %150, double noundef %154)
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %155 = call { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %18)
  %156 = getelementptr inbounds %"class.std::complex", ptr %20, i32 0, i32 0
  %157 = getelementptr inbounds { double, double }, ptr %156, i32 0, i32 0
  %158 = extractvalue { double, double } %155, 0
  store double %158, ptr %157, align 8
  %159 = getelementptr inbounds { double, double }, ptr %156, i32 0, i32 1
  %160 = extractvalue { double, double } %155, 1
  store double %160, ptr %159, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %161 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %162 = fneg double %161
  %163 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %21, double noundef %162, double noundef %163)
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %164 = call noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %21)
  %165 = fdiv double 1.000000e+00, %164
  store double %165, ptr %24, align 8, !tbaa !12
  %166 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %167 = getelementptr inbounds %"class.std::complex", ptr %23, i32 0, i32 0
  %168 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 0
  %169 = extractvalue { double, double } %166, 0
  store double %169, ptr %168, align 8
  %170 = getelementptr inbounds { double, double }, ptr %167, i32 0, i32 1
  %171 = extractvalue { double, double } %166, 1
  store double %171, ptr %170, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %172 = load i32, ptr @R, align 4, !tbaa !5
  %173 = sitofp i32 %172 to double
  %174 = load i32, ptr @R, align 4, !tbaa !5
  %175 = sitofp i32 %174 to double
  %176 = call noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %177 = call noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %20)
  %178 = fmul double %176, %177
  %179 = fneg double %178
  %180 = call double @llvm.fmuladd.f64(double %173, double %175, double %179)
  %181 = call double @sqrt(double noundef %180) #7
  store double %181, ptr %25, align 8, !tbaa !12
  %182 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) %25)
  %183 = getelementptr inbounds %"class.std::complex", ptr %22, i32 0, i32 0
  %184 = getelementptr inbounds { double, double }, ptr %183, i32 0, i32 0
  %185 = extractvalue { double, double } %182, 0
  store double %185, ptr %184, align 8
  %186 = getelementptr inbounds { double, double }, ptr %183, i32 0, i32 1
  %187 = extractvalue { double, double } %182, 1
  store double %187, ptr %186, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  %188 = call { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef nonnull align 8 dereferenceable(16) %22)
  %189 = getelementptr inbounds %"class.std::complex", ptr %26, i32 0, i32 0
  %190 = getelementptr inbounds { double, double }, ptr %189, i32 0, i32 0
  %191 = extractvalue { double, double } %188, 0
  store double %191, ptr %190, align 8
  %192 = getelementptr inbounds { double, double }, ptr %189, i32 0, i32 1
  %193 = extractvalue { double, double } %188, 1
  store double %193, ptr %192, align 8
  %194 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %26)
  %195 = call double @llvm.round.f64(double %194)
  %196 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %26)
  %197 = call double @llvm.round.f64(double %196)
  %198 = call noundef zeroext i1 @_Z3saydd(double noundef %195, double noundef %197)
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %199 = load i32, ptr %1, align 4
  ret i32 %199

200:                                              ; preds = %75
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

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

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

@R = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z3saydd(double noundef, double noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca %"class.std::complex", align 8
  %2 = alloca %"class.std::complex", align 8
  %3 = alloca %"class.std::complex", align 8
  %4 = alloca %"class.std::complex", align 8
  %5 = alloca %"class.std::complex", align 8
  %6 = alloca %"class.std::complex", align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca %"class.std::complex", align 8
  br label %.preheader

.preheader:                                       ; preds = %0, %106
  %.04463 = phi i32 [ 0, %0 ], [ %107, %106 ]
  %10 = load i32, ptr @R, align 4, !tbaa !5
  %11 = mul nsw i32 %10, %.04463
  %12 = sdiv i32 %10, 2
  %13 = add nsw i32 %11, %12
  %14 = sitofp i32 %13 to double
  %15 = sitofp i32 %12 to double
  %16 = tail call noundef zeroext i1 @_Z3saydd(double noundef %14, double noundef %15)
  br i1 %16, label %108, label %17

17:                                               ; preds = %.preheader
  %18 = load i32, ptr @R, align 4, !tbaa !5
  %19 = mul nsw i32 %18, %.04463
  %20 = sdiv i32 %18, 2
  %21 = add nsw i32 %19, %20
  %22 = sitofp i32 %21 to double
  %23 = add nsw i32 %18, %20
  %24 = sitofp i32 %23 to double
  %25 = tail call noundef zeroext i1 @_Z3saydd(double noundef %22, double noundef %24)
  br i1 %25, label %108, label %26

26:                                               ; preds = %17
  %27 = load i32, ptr @R, align 4, !tbaa !5
  %28 = mul nsw i32 %27, %.04463
  %29 = sdiv i32 %27, 2
  %30 = add nsw i32 %28, %29
  %31 = sitofp i32 %30 to double
  %32 = shl nsw i32 %27, 1
  %33 = add nsw i32 %32, %29
  %34 = sitofp i32 %33 to double
  %35 = tail call noundef zeroext i1 @_Z3saydd(double noundef %31, double noundef %34)
  br i1 %35, label %108, label %36

36:                                               ; preds = %26
  %37 = load i32, ptr @R, align 4, !tbaa !5
  %38 = mul nsw i32 %37, %.04463
  %39 = sdiv i32 %37, 2
  %40 = add nsw i32 %38, %39
  %41 = sitofp i32 %40 to double
  %42 = mul nsw i32 %37, 3
  %43 = add nsw i32 %42, %39
  %44 = sitofp i32 %43 to double
  %45 = tail call noundef zeroext i1 @_Z3saydd(double noundef %41, double noundef %44)
  br i1 %45, label %108, label %46

46:                                               ; preds = %36
  %47 = load i32, ptr @R, align 4, !tbaa !5
  %48 = mul nsw i32 %47, %.04463
  %49 = sdiv i32 %47, 2
  %50 = add nsw i32 %48, %49
  %51 = sitofp i32 %50 to double
  %52 = shl nsw i32 %47, 2
  %53 = add nsw i32 %52, %49
  %54 = sitofp i32 %53 to double
  %55 = tail call noundef zeroext i1 @_Z3saydd(double noundef %51, double noundef %54)
  br i1 %55, label %108, label %56

56:                                               ; preds = %46
  %57 = load i32, ptr @R, align 4, !tbaa !5
  %58 = mul nsw i32 %57, %.04463
  %59 = sdiv i32 %57, 2
  %60 = add nsw i32 %58, %59
  %61 = sitofp i32 %60 to double
  %62 = mul nsw i32 %57, 5
  %63 = add nsw i32 %62, %59
  %64 = sitofp i32 %63 to double
  %65 = tail call noundef zeroext i1 @_Z3saydd(double noundef %61, double noundef %64)
  br i1 %65, label %108, label %66

66:                                               ; preds = %56
  %67 = load i32, ptr @R, align 4, !tbaa !5
  %68 = mul nsw i32 %67, %.04463
  %69 = sdiv i32 %67, 2
  %70 = add nsw i32 %68, %69
  %71 = sitofp i32 %70 to double
  %72 = mul nsw i32 %67, 6
  %73 = add nsw i32 %72, %69
  %74 = sitofp i32 %73 to double
  %75 = tail call noundef zeroext i1 @_Z3saydd(double noundef %71, double noundef %74)
  br i1 %75, label %108, label %76

76:                                               ; preds = %66
  %77 = load i32, ptr @R, align 4, !tbaa !5
  %78 = mul nsw i32 %77, %.04463
  %79 = sdiv i32 %77, 2
  %80 = add nsw i32 %78, %79
  %81 = sitofp i32 %80 to double
  %82 = mul nsw i32 %77, 7
  %83 = add nsw i32 %82, %79
  %84 = sitofp i32 %83 to double
  %85 = tail call noundef zeroext i1 @_Z3saydd(double noundef %81, double noundef %84)
  br i1 %85, label %108, label %86

86:                                               ; preds = %76
  %87 = load i32, ptr @R, align 4, !tbaa !5
  %88 = mul nsw i32 %87, %.04463
  %89 = sdiv i32 %87, 2
  %90 = add nsw i32 %88, %89
  %91 = sitofp i32 %90 to double
  %92 = shl nsw i32 %87, 3
  %93 = add nsw i32 %92, %89
  %94 = sitofp i32 %93 to double
  %95 = tail call noundef zeroext i1 @_Z3saydd(double noundef %91, double noundef %94)
  br i1 %95, label %108, label %96

96:                                               ; preds = %86
  %97 = load i32, ptr @R, align 4, !tbaa !5
  %98 = mul nsw i32 %97, %.04463
  %99 = sdiv i32 %97, 2
  %100 = add nsw i32 %98, %99
  %101 = sitofp i32 %100 to double
  %102 = mul nsw i32 %97, 9
  %103 = add nsw i32 %102, %99
  %104 = sitofp i32 %103 to double
  %105 = tail call noundef zeroext i1 @_Z3saydd(double noundef %101, double noundef %104)
  br i1 %105, label %108, label %106

106:                                              ; preds = %96
  %107 = add nuw nsw i32 %.04463, 1
  %exitcond.not = icmp eq i32 %107, 10
  br i1 %exitcond.not, label %.loopexit.loopexit, label %.preheader, !llvm.loop !9

108:                                              ; preds = %96, %86, %76, %66, %56, %46, %36, %26, %17, %.preheader
  %.04762.lcssa = phi i32 [ 0, %.preheader ], [ 1, %17 ], [ 2, %26 ], [ 3, %36 ], [ 4, %46 ], [ 5, %56 ], [ 6, %66 ], [ 7, %76 ], [ 8, %86 ], [ 9, %96 ]
  %109 = load i32, ptr @R, align 4, !tbaa !5
  %110 = mul nsw i32 %109, %.04463
  %111 = sdiv i32 %109, 2
  %112 = add nsw i32 %110, %111
  %113 = mul nsw i32 %109, %.04762.lcssa
  %114 = add nsw i32 %113, %111
  br label %.loopexit

.loopexit.loopexit:                               ; preds = %106
  %.pre = load i32, ptr @R, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %108
  %115 = phi i32 [ %109, %108 ], [ %.pre, %.loopexit.loopexit ]
  %.243 = phi i32 [ %114, %108 ], [ undef, %.loopexit.loopexit ]
  %.2 = phi i32 [ %112, %108 ], [ undef, %.loopexit.loopexit ]
  %116 = sitofp i32 %.2 to double
  %117 = shl nsw i32 %115, 1
  %118 = xor i32 %117, -1
  %119 = add i32 %.2, %118
  %120 = sitofp i32 %119 to double
  %121 = sitofp i32 %.243 to double
  br label %128

122:                                              ; preds = %128
  %123 = load i32, ptr @R, align 4, !tbaa !5
  %124 = shl nsw i32 %123, 1
  %125 = xor i32 %124, -1
  %126 = add i32 %.243, %125
  %127 = sitofp i32 %126 to double
  br label %172

128:                                              ; preds = %.loopexit, %128
  %.04866 = phi double [ %116, %.loopexit ], [ %..048, %128 ]
  %.05165 = phi i32 [ 0, %.loopexit ], [ %132, %128 ]
  %.05264 = phi double [ %120, %.loopexit ], [ %.052., %128 ]
  %129 = fadd double %.05264, %.04866
  %130 = fmul double %129, 5.000000e-01
  %131 = tail call noundef zeroext i1 @_Z3saydd(double noundef %130, double noundef %121)
  %.052. = select i1 %131, double %.05264, double %130
  %..048 = select i1 %131, double %130, double %.04866
  %132 = add nuw nsw i32 %.05165, 1
  %exitcond72.not = icmp eq i32 %132, 49
  br i1 %exitcond72.not, label %122, label %128, !llvm.loop !11

133:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #7
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %1, double noundef %..048, double noundef %121)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  %134 = fadd double %..048, %116
  %135 = fmul double %134, 5.000000e-01
  %136 = fadd double %..250, %121
  %137 = fmul double %136, 5.000000e-01
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %2, double noundef %135, double noundef %137)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #7
  %138 = call { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %1)
  %139 = extractvalue { double, double } %138, 0
  store double %139, ptr %3, align 8
  %140 = getelementptr inbounds i8, ptr %3, i64 8
  %141 = extractvalue { double, double } %138, 1
  store double %141, ptr %140, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %142 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %143 = fneg double %142
  %144 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  call void @_ZNSt7complexIdEC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef %143, double noundef %144)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %145 = call noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %146 = fdiv double 1.000000e+00, %145
  store double %146, ptr %7, align 8, !tbaa !12
  %147 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %148 = extractvalue { double, double } %147, 0
  store double %148, ptr %6, align 8
  %149 = getelementptr inbounds i8, ptr %6, i64 8
  %150 = extractvalue { double, double } %147, 1
  store double %150, ptr %149, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %151 = load i32, ptr @R, align 4, !tbaa !5
  %152 = sitofp i32 %151 to double
  %153 = call noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %154 = call noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %155 = fneg double %153
  %156 = fmul double %154, %155
  %157 = call double @llvm.fmuladd.f64(double %152, double %152, double %156)
  %158 = call double @sqrt(double noundef %157) #7
  store double %158, ptr %8, align 8, !tbaa !12
  %159 = call { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %160 = extractvalue { double, double } %159, 0
  store double %160, ptr %5, align 8
  %161 = getelementptr inbounds i8, ptr %5, i64 8
  %162 = extractvalue { double, double } %159, 1
  store double %162, ptr %161, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %163 = call { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %5)
  %164 = extractvalue { double, double } %163, 0
  store double %164, ptr %9, align 8
  %165 = getelementptr inbounds i8, ptr %9, i64 8
  %166 = extractvalue { double, double } %163, 1
  store double %166, ptr %165, align 8
  %167 = call noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %168 = call double @llvm.round.f64(double %167)
  %169 = call noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %170 = call double @llvm.round.f64(double %169)
  %171 = call noundef zeroext i1 @_Z3saydd(double noundef %168, double noundef %170)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  ret i32 0

172:                                              ; preds = %122, %172
  %.04569 = phi i32 [ 0, %122 ], [ %176, %172 ]
  %.25068 = phi double [ %121, %122 ], [ %..250, %172 ]
  %.25467 = phi double [ %127, %122 ], [ %.254., %172 ]
  %173 = fadd double %.25467, %.25068
  %174 = fmul double %173, 5.000000e-01
  %175 = tail call noundef zeroext i1 @_Z3saydd(double noundef %116, double noundef %174)
  %.254. = select i1 %175, double %.25467, double %174
  %..250 = select i1 %175, double %174, double %.25068
  %176 = add nuw nsw i32 %.04569, 1
  %exitcond73.not = icmp eq i32 %176, 49
  br i1 %exitcond73.not, label %133, label %172, !llvm.loop !14
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmiIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4imagB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNKSt7complexIdE4realB5cxx11Ev(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStmlIdESt7complexIT_ERKS2_RKS1_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZSt3absIdET_RKSt7complexIS0_E(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { double, double } @_ZStplIdESt7complexIT_ERKS2_S4_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

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

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


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