; LLVM IR from tangjz/acm-icpc :: lydsy/3160.ll (Z3FFTP7complexii)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.complex = type { double, double }

@_ZL2pi = external hidden global double, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3FFTP7complexii(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.complex, align 8
  %13 = alloca i32, align 4
  %14 = alloca %struct.complex, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.complex, align 8
  %17 = alloca %struct.complex, align 8
  %18 = alloca %struct.complex, align 8
  %19 = alloca %struct.complex, align 8
  %20 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = ashr i32 %21, 1
  store i32 %22, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  br label %23

23:                                               ; preds = %65, %3
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = sub nsw i32 %25, 1
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %68

29:                                               ; preds = %23
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %42

33:                                               ; preds = %29
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds %struct.complex, ptr %34, i64 %36
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %struct.complex, ptr %38, i64 %40
  call void @_ZSt4swapI7complexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(16) %41) #6
  br label %42

42:                                               ; preds = %33, %29
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = ashr i32 %43, 1
  store i32 %44, ptr %9, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %53, %42
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = icmp sge i32 %46, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %45
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = sub nsw i32 %51, %50
  store i32 %52, ptr %8, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %49
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = ashr i32 %54, 1
  store i32 %55, ptr %9, align 4, !tbaa !9
  br label %45, !llvm.loop !11

56:                                               ; preds = %45
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %64

60:                                               ; preds = %56
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = add nsw i32 %62, %61
  store i32 %63, ptr %8, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %60, %56
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !9
  br label %23, !llvm.loop !13

68:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %164, %68
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

73:                                               ; preds = %69
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %167

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %75 = load double, ptr @_ZL2pi, align 8, !tbaa !14
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = sitofp i32 %76 to double
  %78 = fdiv double %75, %77
  %79 = call double @cos(double noundef %78) #6
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = sitofp i32 %80 to double
  %82 = load double, ptr @_ZL2pi, align 8, !tbaa !14
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = sitofp i32 %83 to double
  %85 = fdiv double %82, %84
  %86 = call double @sin(double noundef %85) #6
  %87 = fmul double %81, %86
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %12, double noundef %79, double noundef %87)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %158, %74
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %163

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %14, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %149, %93
  %95 = load i32, ptr %15, align 4, !tbaa !9
  %96 = load i32, ptr %10, align 4, !tbaa !9
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %157

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = load i32, ptr %13, align 4, !tbaa !9
  %102 = load i32, ptr %15, align 4, !tbaa !9
  %103 = add nsw i32 %101, %102
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = add nsw i32 %103, %104
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds %struct.complex, ptr %100, i64 %106
  %108 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %107)
  %109 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %110 = extractvalue { double, double } %108, 0
  store double %110, ptr %109, align 8
  %111 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %112 = extractvalue { double, double } %108, 1
  store double %112, ptr %111, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = load i32, ptr %15, align 4, !tbaa !9
  %116 = add nsw i32 %114, %115
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds %struct.complex, ptr %113, i64 %117
  %119 = call { double, double } @_ZmiRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %118, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %120 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %121 = extractvalue { double, double } %119, 0
  store double %121, ptr %120, align 8
  %122 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %123 = extractvalue { double, double } %119, 1
  store double %123, ptr %122, align 8
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = load i32, ptr %15, align 4, !tbaa !9
  %127 = add nsw i32 %125, %126
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = add nsw i32 %127, %128
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds %struct.complex, ptr %124, i64 %130
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %131, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = load i32, ptr %15, align 4, !tbaa !9
  %135 = add nsw i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.complex, ptr %132, i64 %136
  %138 = call { double, double } @_ZplRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %137, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %139 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %140 = extractvalue { double, double } %138, 0
  store double %140, ptr %139, align 8
  %141 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %142 = extractvalue { double, double } %138, 1
  store double %142, ptr %141, align 8
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = load i32, ptr %13, align 4, !tbaa !9
  %145 = load i32, ptr %15, align 4, !tbaa !9
  %146 = add nsw i32 %144, %145
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds %struct.complex, ptr %143, i64 %147
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %148, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  br label %149

149:                                              ; preds = %99
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %152 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %12)
  %153 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 0
  %154 = extractvalue { double, double } %152, 0
  store double %154, ptr %153, align 8
  %155 = getelementptr inbounds { double, double }, ptr %19, i32 0, i32 1
  %156 = extractvalue { double, double } %152, 1
  store double %156, ptr %155, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %94, !llvm.loop !17

157:                                              ; preds = %98
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %10, align 4, !tbaa !9
  %160 = shl i32 %159, 1
  %161 = load i32, ptr %13, align 4, !tbaa !9
  %162 = add nsw i32 %161, %160
  store i32 %162, ptr %13, align 4, !tbaa !9
  br label %88, !llvm.loop !18

163:                                              ; preds = %92
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %10, align 4, !tbaa !9
  %166 = shl i32 %165, 1
  store i32 %166, ptr %10, align 4, !tbaa !9
  br label %69, !llvm.loop !19

167:                                              ; preds = %73
  %168 = load i32, ptr %6, align 4, !tbaa !9
  %169 = icmp eq i32 %168, -1
  br i1 %169, label %170, label %190

170:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %186, %170
  %172 = load i32, ptr %20, align 4, !tbaa !9
  %173 = load i32, ptr %5, align 4, !tbaa !9
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %189

176:                                              ; preds = %171
  %177 = load i32, ptr %5, align 4, !tbaa !9
  %178 = sitofp i32 %177 to double
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = load i32, ptr %20, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds %struct.complex, ptr %179, i64 %181
  %183 = getelementptr inbounds %struct.complex, ptr %182, i32 0, i32 0
  %184 = load double, ptr %183, align 8, !tbaa !20
  %185 = fdiv double %184, %178
  store double %185, ptr %183, align 8, !tbaa !20
  br label %186

186:                                              ; preds = %176
  %187 = load i32, ptr %20, align 4, !tbaa !9
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %20, align 4, !tbaa !9
  br label %171, !llvm.loop !22

189:                                              ; preds = %175
  br label %190

190:                                              ; preds = %189, %167
  ret void
}

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

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

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

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

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

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

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

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 = { 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 #3 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{i64 0, i64 8, !14, i64 8, i64 8, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!21, !15, i64 0}
!21 = !{!"_ZTS7complex", !15, i64 0, !15, i64 8}
!22 = distinct !{!22, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.complex = type { double, double }

@_ZL2pi = external hidden local_unnamed_addr global double, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3FFTP7complexii(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.complex, align 8
  %5 = alloca %struct.complex, align 8
  %6 = alloca %struct.complex, align 8
  %7 = ashr i32 %1, 1
  %8 = icmp sgt i32 %1, 2
  br i1 %8, label %.lr.ph76.preheader, label %.preheader68

.lr.ph76.preheader:                               ; preds = %3
  %9 = add nsw i32 %1, -1
  %wide.trip.count = zext nneg i32 %9 to i64
  br label %.lr.ph76

.preheader68:                                     ; preds = %._crit_edge, %3
  %10 = icmp sgt i32 %1, 1
  br i1 %10, label %.lr.ph87, label %._crit_edge88

.lr.ph87:                                         ; preds = %.preheader68
  %11 = sitofp i32 %2 to double
  %12 = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %13 = zext nneg i32 %1 to i64
  br label %.lr.ph83.us

.lr.ph83.us:                                      ; preds = %._crit_edge84.us, %.lr.ph87
  %.06385.us = phi i32 [ 1, %.lr.ph87 ], [ %23, %._crit_edge84.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %14 = load double, ptr @_ZL2pi, align 8, !tbaa !5
  %15 = sitofp i32 %.06385.us to double
  %16 = fdiv double %14, %15
  %17 = call double @cos(double noundef %16) #5
  %18 = load double, ptr @_ZL2pi, align 8, !tbaa !5
  %19 = fdiv double %18, %15
  %20 = call double @sin(double noundef %19) #5
  %21 = fmul double %20, %11
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef %17, double noundef %21)
  %22 = icmp sgt i32 %.06385.us, 0
  %23 = shl i32 %.06385.us, 1
  br i1 %22, label %.lr.ph79.us.us.preheader, label %.lr.ph83.split.us91

.lr.ph79.us.us.preheader:                         ; preds = %.lr.ph83.us
  %24 = zext nneg i32 %.06385.us to i64
  %25 = sext i32 %23 to i64
  %wide.trip.count100 = zext nneg i32 %.06385.us to i64
  %invariant.gep = getelementptr %struct.complex, ptr %0, i64 %24
  br label %.lr.ph79.us.us

.lr.ph83.split.us91:                              ; preds = %.lr.ph83.us, %.lr.ph83.split.us91
  %.06481.us89 = phi i32 [ %26, %.lr.ph83.split.us91 ], [ 0, %.lr.ph83.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef 1.000000e+00, double noundef 0.000000e+00)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %26 = add nsw i32 %.06481.us89, %23
  %27 = icmp slt i32 %26, %1
  br i1 %27, label %.lr.ph83.split.us91, label %._crit_edge84.us, !llvm.loop !9

._crit_edge84.us:                                 ; preds = %.lr.ph83.split.us91, %._crit_edge80.us.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %28 = icmp slt i32 %23, %1
  br i1 %28, label %.lr.ph83.us, label %._crit_edge88, !llvm.loop !11

.lr.ph79.us.us:                                   ; preds = %.lr.ph79.us.us.preheader, %._crit_edge80.us.us
  %indvars.iv102 = phi i64 [ 0, %.lr.ph79.us.us.preheader ], [ %indvars.iv.next103, %._crit_edge80.us.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %5, double noundef 1.000000e+00, double noundef 0.000000e+00)
  br label %29

29:                                               ; preds = %29, %.lr.ph79.us.us
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %29 ], [ 0, %.lr.ph79.us.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %30 = add nsw i64 %indvars.iv97, %indvars.iv102
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %30
  %31 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %gep)
  %32 = extractvalue { double, double } %31, 0
  store double %32, ptr %6, align 8
  %33 = extractvalue { double, double } %31, 1
  store double %33, ptr %12, align 8
  %34 = getelementptr inbounds %struct.complex, ptr %0, i64 %30
  %35 = call { double, double } @_ZmiRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %36 = extractvalue { double, double } %35, 0
  %37 = extractvalue { double, double } %35, 1
  store double %36, ptr %gep, align 8, !tbaa !5
  %.sroa.46.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %gep, i64 8
  store double %37, ptr %.sroa.46.0..sroa_idx.us.us, align 8, !tbaa !5
  %38 = call { double, double } @_ZplRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %34, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %39 = extractvalue { double, double } %38, 0
  %40 = extractvalue { double, double } %38, 1
  store double %39, ptr %34, align 8, !tbaa !5
  %.sroa.44.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %34, i64 8
  store double %40, ptr %.sroa.44.0..sroa_idx.us.us, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %41 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %42 = extractvalue { double, double } %41, 0
  %43 = extractvalue { double, double } %41, 1
  store double %42, ptr %5, align 8, !tbaa !5
  store double %43, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !5
  %exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count100
  br i1 %exitcond101.not, label %._crit_edge80.us.us, label %29, !llvm.loop !12

._crit_edge80.us.us:                              ; preds = %29
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %indvars.iv.next103 = add nsw i64 %indvars.iv102, %25
  %44 = icmp slt i64 %indvars.iv.next103, %13
  br i1 %44, label %.lr.ph79.us.us, label %._crit_edge84.us, !llvm.loop !9

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 1, %.lr.ph76.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.06173 = phi i32 [ %7, %.lr.ph76.preheader ], [ %53, %._crit_edge ]
  %45 = sext i32 %.06173 to i64
  %46 = icmp slt i64 %indvars.iv, %45
  br i1 %46, label %47, label %50

47:                                               ; preds = %.lr.ph76
  %48 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv
  %49 = getelementptr inbounds %struct.complex, ptr %0, i64 %45
  tail call void @_ZSt4swapI7complexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 8 dereferenceable(16) %49) #5
  br label %50

50:                                               ; preds = %47, %.lr.ph76
  %.not69 = icmp slt i32 %.06173, %7
  br i1 %.not69, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %50, %.lr.ph
  %.171 = phi i32 [ %51, %.lr.ph ], [ %.06173, %50 ]
  %.06270 = phi i32 [ %52, %.lr.ph ], [ %7, %50 ]
  %51 = sub nsw i32 %.171, %.06270
  %52 = lshr i32 %.06270, 1
  %.not = icmp slt i32 %51, %52
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %50
  %.062.lcssa = phi i32 [ %7, %50 ], [ %52, %.lr.ph ]
  %.1.lcssa = phi i32 [ %.06173, %50 ], [ %51, %.lr.ph ]
  %53 = add nsw i32 %.1.lcssa, %.062.lcssa
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader68, label %.lr.ph76, !llvm.loop !14

._crit_edge88:                                    ; preds = %._crit_edge84.us, %.preheader68
  %54 = icmp eq i32 %2, -1
  %55 = icmp sgt i32 %1, 0
  %or.cond = and i1 %54, %55
  br i1 %or.cond, label %.lr.ph93, label %.loopexit

.lr.ph93:                                         ; preds = %._crit_edge88
  %56 = uitofp nneg i32 %1 to double
  %wide.trip.count108 = zext nneg i32 %1 to i64
  %min.iters.check = icmp ult i32 %1, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph93
  %.neg = or i64 %wide.trip.count108, -2
  %n.vec = add nsw i64 %.neg, %wide.trip.count108
  %broadcast.splatinsert = insertelement <2 x double> poison, double %56, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %57 = or disjoint i64 %index, 1
  %58 = getelementptr inbounds %struct.complex, ptr %0, i64 %index
  %59 = getelementptr inbounds %struct.complex, ptr %0, i64 %57
  %60 = load double, ptr %58, align 8, !tbaa !15
  %61 = load double, ptr %59, align 8, !tbaa !15
  %62 = insertelement <2 x double> poison, double %60, i64 0
  %63 = insertelement <2 x double> %62, double %61, i64 1
  %64 = fdiv <2 x double> %63, %broadcast.splat
  %65 = extractelement <2 x double> %64, i64 0
  store double %65, ptr %58, align 8, !tbaa !15
  %66 = extractelement <2 x double> %64, i64 1
  store double %66, ptr %59, align 8, !tbaa !15
  %index.next = add nuw i64 %index, 2
  %67 = icmp eq i64 %index.next, %n.vec
  br i1 %67, label %scalar.ph.preheader, label %vector.body, !llvm.loop !17

scalar.ph.preheader:                              ; preds = %vector.body, %.lr.ph93
  %indvars.iv105.ph = phi i64 [ 0, %.lr.ph93 ], [ %n.vec, %vector.body ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %scalar.ph ], [ %indvars.iv105.ph, %scalar.ph.preheader ]
  %68 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv105
  %69 = load double, ptr %68, align 8, !tbaa !15
  %70 = fdiv double %69, %56
  store double %70, ptr %68, align 8, !tbaa !15
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
  br i1 %exitcond109.not, label %.loopexit, label %scalar.ph, !llvm.loop !20

.loopexit:                                        ; preds = %scalar.ph, %._crit_edge88
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapI7complexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; 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 nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

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

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

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

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

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

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 = { 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 #3 = { 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 #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 = { 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 = !{!"double", !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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTS7complex", !6, i64 0, !6, i64 8}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !19, !18}


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