; LLVM IR from tangjz/acm-icpc :: lydsy/4451.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
@_ZZ3FFTP7complexiiE6bitLen = external hidden global i32, align 4
@_ZZ3FFTP7complexiiE6bitRev = external hidden global [524289 x i32], align 16

; 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 %struct.complex, align 8
  %12 = alloca i32, align 4
  %13 = alloca %struct.complex, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.complex, align 8
  %16 = alloca %struct.complex, align 8
  %17 = alloca %struct.complex, align 8
  %18 = alloca %struct.complex, align 8
  %19 = 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
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = load i32, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !9
  %22 = shl i32 1, %21
  %23 = icmp ne i32 %20, %22
  br i1 %23, label %24, label %60

24:                                               ; preds = %3
  store i32 0, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %31, %24
  %26 = load i32, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !9
  %27 = shl i32 1, %26
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %30, label %34

30:                                               ; preds = %25
  br label %31

31:                                               ; preds = %30
  %32 = load i32, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !9
  br label %25, !llvm.loop !11

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %56, %34
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = ashr i32 %41, 1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = ashr i32 %45, 1
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = and i32 %47, 1
  %49 = load i32, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !9
  %50 = sub nsw i32 %49, 1
  %51 = shl i32 %48, %50
  %52 = or i32 %46, %51
  %53 = load i32, ptr %7, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %40
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %7, align 4, !tbaa !9
  br label %35, !llvm.loop !13

59:                                               ; preds = %39
  br label %60

60:                                               ; preds = %59, %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %86, %60
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %61
  %67 = load i32, ptr %8, align 4, !tbaa !9
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = icmp slt i32 %67, %71
  br i1 %72, label %73, label %85

73:                                               ; preds = %66
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds %struct.complex, ptr %74, i64 %76
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %struct.complex, ptr %78, i64 %83
  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) %77, ptr noundef nonnull align 8 dereferenceable(16) %84) #6
  br label %85

85:                                               ; preds = %73, %66
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %8, align 4, !tbaa !9
  br label %61, !llvm.loop !14

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

90:                                               ; preds = %185, %89
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = load i32, ptr %5, align 4, !tbaa !9
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %188

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %96 = load double, ptr @_ZL2pi, align 8, !tbaa !15
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = sitofp i32 %97 to double
  %99 = fdiv double %96, %98
  %100 = call double @cos(double noundef %99) #6
  %101 = load i32, ptr %6, align 4, !tbaa !9
  %102 = sitofp i32 %101 to double
  %103 = load double, ptr @_ZL2pi, align 8, !tbaa !15
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = sitofp i32 %104 to double
  %106 = fdiv double %103, %105
  %107 = call double @sin(double noundef %106) #6
  %108 = fmul double %102, %107
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %11, double noundef %100, double noundef %108)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %179, %95
  %110 = load i32, ptr %12, align 4, !tbaa !9
  %111 = load i32, ptr %5, align 4, !tbaa !9
  %112 = icmp slt i32 %110, %111
  br i1 %112, label %114, label %113

113:                                              ; preds = %109
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %184

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

115:                                              ; preds = %170, %114
  %116 = load i32, ptr %14, align 4, !tbaa !9
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  store i32 17, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %178

120:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #6
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = load i32, ptr %12, align 4, !tbaa !9
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = add nsw i32 %122, %123
  %125 = load i32, ptr %9, align 4, !tbaa !9
  %126 = add nsw i32 %124, %125
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %struct.complex, ptr %121, i64 %127
  %129 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %128)
  %130 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %131 = extractvalue { double, double } %129, 0
  store double %131, ptr %130, align 8
  %132 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %133 = extractvalue { double, double } %129, 1
  store double %133, ptr %132, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #6
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = load i32, ptr %12, align 4, !tbaa !9
  %136 = load i32, ptr %14, align 4, !tbaa !9
  %137 = add nsw i32 %135, %136
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds %struct.complex, ptr %134, i64 %138
  %140 = call { double, double } @_ZmiRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %139, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %141 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %142 = extractvalue { double, double } %140, 0
  store double %142, ptr %141, align 8
  %143 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %144 = extractvalue { double, double } %140, 1
  store double %144, ptr %143, align 8
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = load i32, ptr %12, align 4, !tbaa !9
  %147 = load i32, ptr %14, align 4, !tbaa !9
  %148 = add nsw i32 %146, %147
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = add nsw i32 %148, %149
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds %struct.complex, ptr %145, i64 %151
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %152, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = load i32, ptr %12, align 4, !tbaa !9
  %155 = load i32, ptr %14, align 4, !tbaa !9
  %156 = add nsw i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds %struct.complex, ptr %153, i64 %157
  %159 = call { double, double } @_ZplRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %158, ptr noundef nonnull align 8 dereferenceable(16) %15)
  %160 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %161 = extractvalue { double, double } %159, 0
  store double %161, ptr %160, align 8
  %162 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %163 = extractvalue { double, double } %159, 1
  store double %163, ptr %162, align 8
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = load i32, ptr %12, align 4, !tbaa !9
  %166 = load i32, ptr %14, align 4, !tbaa !9
  %167 = add nsw i32 %165, %166
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds %struct.complex, ptr %164, i64 %168
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %169, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #6
  br label %170

170:                                              ; preds = %120
  %171 = load i32, ptr %14, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %173 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(16) %11)
  %174 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %175 = extractvalue { double, double } %173, 0
  store double %175, ptr %174, align 8
  %176 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %177 = extractvalue { double, double } %173, 1
  store double %177, ptr %176, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  br label %115, !llvm.loop !18

178:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %9, align 4, !tbaa !9
  %181 = shl i32 %180, 1
  %182 = load i32, ptr %12, align 4, !tbaa !9
  %183 = add nsw i32 %182, %181
  store i32 %183, ptr %12, align 4, !tbaa !9
  br label %109, !llvm.loop !19

184:                                              ; preds = %113
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  br label %185

185:                                              ; preds = %184
  %186 = load i32, ptr %9, align 4, !tbaa !9
  %187 = shl i32 %186, 1
  store i32 %187, ptr %9, align 4, !tbaa !9
  br label %90, !llvm.loop !20

188:                                              ; preds = %94
  %189 = load i32, ptr %6, align 4, !tbaa !9
  %190 = icmp eq i32 %189, -1
  br i1 %190, label %191, label %220

191:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %192

192:                                              ; preds = %216, %191
  %193 = load i32, ptr %19, align 4, !tbaa !9
  %194 = load i32, ptr %5, align 4, !tbaa !9
  %195 = icmp slt i32 %193, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %192
  store i32 20, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %219

197:                                              ; preds = %192
  %198 = load i32, ptr %5, align 4, !tbaa !9
  %199 = sitofp i32 %198 to double
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = load i32, ptr %19, align 4, !tbaa !9
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds %struct.complex, ptr %200, i64 %202
  %204 = getelementptr inbounds %struct.complex, ptr %203, i32 0, i32 0
  %205 = load double, ptr %204, align 8, !tbaa !21
  %206 = fdiv double %205, %199
  store double %206, ptr %204, align 8, !tbaa !21
  %207 = load i32, ptr %5, align 4, !tbaa !9
  %208 = sitofp i32 %207 to double
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = load i32, ptr %19, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds %struct.complex, ptr %209, i64 %211
  %213 = getelementptr inbounds %struct.complex, ptr %212, i32 0, i32 1
  %214 = load double, ptr %213, align 8, !tbaa !23
  %215 = fdiv double %214, %208
  store double %215, ptr %213, align 8, !tbaa !23
  br label %216

216:                                              ; preds = %197
  %217 = load i32, ptr %19, align 4, !tbaa !9
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %19, align 4, !tbaa !9
  br label %192, !llvm.loop !24

219:                                              ; preds = %196
  br label %220

220:                                              ; preds = %219, %188
  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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: 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 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{i64 0, i64 8, !15, i64 8, i64 8, !15}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !16, i64 0}
!22 = !{!"_ZTS7complex", !16, i64 0, !16, i64 8}
!23 = !{!22, !16, i64 8}
!24 = distinct !{!24, !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
@_ZZ3FFTP7complexiiE6bitLen = external hidden local_unnamed_addr global i32, align 4
@_ZZ3FFTP7complexiiE6bitRev = external hidden local_unnamed_addr global [524289 x i32], align 16

; 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 = load i32, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !5
  %8 = shl nuw i32 1, %7
  %.not = icmp eq i32 %8, %1
  br i1 %.not, label %.loopexit69, label %.preheader70

.preheader70:                                     ; preds = %3, %.preheader70
  %storemerge = phi i32 [ %11, %.preheader70 ], [ 0, %3 ]
  %9 = shl nuw i32 1, %storemerge
  %10 = icmp slt i32 %9, %1
  %11 = add nuw nsw i32 %storemerge, 1
  br i1 %10, label %.preheader70, label %.preheader68, !llvm.loop !9

.preheader68:                                     ; preds = %.preheader70
  store i32 %storemerge, ptr @_ZZ3FFTP7complexiiE6bitLen, align 4, !tbaa !5
  %12 = icmp sgt i32 %1, 1
  br i1 %12, label %.lr.ph, label %.loopexit69

.lr.ph:                                           ; preds = %.preheader68
  %13 = add nsw i32 %storemerge, -1
  %wide.trip.count = zext nneg i32 %1 to i64
  %14 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %14, 1
  %15 = icmp eq i32 %1, 2
  br i1 %15, label %.loopexit69.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %14, -2
  %16 = shl nuw i32 1, %13
  br label %17

17:                                               ; preds = %17, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %17 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %17 ]
  %18 = lshr i64 %indvars.iv, 1
  %19 = and i64 %18, 2147483647
  %20 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %19
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = ashr i32 %21, 1
  %23 = or i32 %22, %16
  %24 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = lshr i64 %indvars.iv.next, 1
  %26 = and i64 %25, 2147483647
  %27 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = ashr i32 %28, 1
  %30 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %indvars.iv.next
  store i32 %29, ptr %30, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit69.loopexit.unr-lcssa, label %17, !llvm.loop !11

.loopexit69.loopexit.unr-lcssa:                   ; preds = %17, %.lr.ph
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.1, %17 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit69, label %.loopexit69.loopexit.epilog-lcssa

.loopexit69.loopexit.epilog-lcssa:                ; preds = %.loopexit69.loopexit.unr-lcssa
  %31 = trunc nuw nsw i64 %indvars.iv.unr to i32
  %32 = lshr i64 %indvars.iv.unr, 1
  %33 = and i64 %32, 2147483647
  %34 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = ashr i32 %35, 1
  %37 = and i32 %31, 1
  %38 = shl nuw i32 %37, %13
  %39 = or i32 %36, %38
  %40 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %indvars.iv.unr
  store i32 %39, ptr %40, align 4, !tbaa !5
  br label %.loopexit69

.loopexit69:                                      ; preds = %.loopexit69.loopexit.epilog-lcssa, %.loopexit69.loopexit.unr-lcssa, %.preheader68, %3
  %41 = icmp sgt i32 %1, 0
  br i1 %41, label %.lr.ph74.preheader, label %.loopexit

.lr.ph74.preheader:                               ; preds = %.loopexit69
  %wide.trip.count94 = zext nneg i32 %1 to i64
  br label %.lr.ph74

.preheader67:                                     ; preds = %83
  %.not111 = icmp eq i32 %1, 1
  br i1 %.not111, label %._crit_edge, label %.lr.ph83

.lr.ph83:                                         ; preds = %.preheader67
  %42 = sitofp i32 %2 to double
  %43 = getelementptr inbounds i8, ptr %6, i64 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %44 = zext nneg i32 %1 to i64
  br label %.lr.ph79.us

.lr.ph79.us:                                      ; preds = %._crit_edge80.us, %.lr.ph83
  %.06281.us = phi i32 [ 1, %.lr.ph83 ], [ %54, %._crit_edge80.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %45 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %46 = sitofp i32 %.06281.us to double
  %47 = fdiv double %45, %46
  %48 = call double @cos(double noundef %47) #5
  %49 = load double, ptr @_ZL2pi, align 8, !tbaa !12
  %50 = fdiv double %49, %46
  %51 = call double @sin(double noundef %50) #5
  %52 = fmul double %51, %42
  call void @_ZN7complexC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %4, double noundef %48, double noundef %52)
  %53 = icmp sgt i32 %.06281.us, 0
  %54 = shl i32 %.06281.us, 1
  br i1 %53, label %.lr.ph76.us.us.preheader, label %.lr.ph79.split.us86

.lr.ph76.us.us.preheader:                         ; preds = %.lr.ph79.us
  %55 = zext nneg i32 %.06281.us to i64
  %56 = sext i32 %54 to i64
  %wide.trip.count99 = zext nneg i32 %.06281.us to i64
  %invariant.gep = getelementptr %struct.complex, ptr %0, i64 %55
  br label %.lr.ph76.us.us

.lr.ph79.split.us86:                              ; preds = %.lr.ph79.us, %.lr.ph79.split.us86
  %.06377.us84 = phi i32 [ %57, %.lr.ph79.split.us86 ], [ 0, %.lr.ph79.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
  %57 = add nsw i32 %.06377.us84, %54
  %58 = icmp slt i32 %57, %1
  br i1 %58, label %.lr.ph79.split.us86, label %._crit_edge80.us, !llvm.loop !14

._crit_edge80.us:                                 ; preds = %.lr.ph79.split.us86, %._crit_edge.us.us
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  %59 = icmp slt i32 %54, %1
  br i1 %59, label %.lr.ph79.us, label %._crit_edge, !llvm.loop !15

.lr.ph76.us.us:                                   ; preds = %.lr.ph76.us.us.preheader, %._crit_edge.us.us
  %indvars.iv101 = phi i64 [ 0, %.lr.ph76.us.us.preheader ], [ %indvars.iv.next102, %._crit_edge.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 %60

60:                                               ; preds = %60, %.lr.ph76.us.us
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %60 ], [ 0, %.lr.ph76.us.us ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %61 = add nsw i64 %indvars.iv96, %indvars.iv101
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %61
  %62 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %gep)
  %63 = extractvalue { double, double } %62, 0
  store double %63, ptr %6, align 8
  %64 = extractvalue { double, double } %62, 1
  store double %64, ptr %43, align 8
  %65 = getelementptr inbounds %struct.complex, ptr %0, i64 %61
  %66 = call { double, double } @_ZmiRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %67 = extractvalue { double, double } %66, 0
  %68 = extractvalue { double, double } %66, 1
  store double %67, ptr %gep, align 8, !tbaa !12
  %.sroa.47.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %gep, i64 8
  store double %68, ptr %.sroa.47.0..sroa_idx.us.us, align 8, !tbaa !12
  %69 = call { double, double } @_ZplRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 8 dereferenceable(16) %6)
  %70 = extractvalue { double, double } %69, 0
  %71 = extractvalue { double, double } %69, 1
  store double %70, ptr %65, align 8, !tbaa !12
  %.sroa.45.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %65, i64 8
  store double %71, ptr %.sroa.45.0..sroa_idx.us.us, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %72 = call { double, double } @_ZmlRK7complexS1_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %73 = extractvalue { double, double } %72, 0
  %74 = extractvalue { double, double } %72, 1
  store double %73, ptr %5, align 8, !tbaa !12
  store double %74, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !12
  %exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
  br i1 %exitcond100.not, label %._crit_edge.us.us, label %60, !llvm.loop !16

._crit_edge.us.us:                                ; preds = %60
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  %indvars.iv.next102 = add nsw i64 %indvars.iv101, %56
  %75 = icmp slt i64 %indvars.iv.next102, %44
  br i1 %75, label %.lr.ph76.us.us, label %._crit_edge80.us, !llvm.loop !14

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %83
  %indvars.iv91 = phi i64 [ 0, %.lr.ph74.preheader ], [ %indvars.iv.next92, %83 ]
  %76 = getelementptr inbounds [524289 x i32], ptr @_ZZ3FFTP7complexiiE6bitRev, i64 0, i64 %indvars.iv91
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = icmp slt i64 %indvars.iv91, %78
  br i1 %79, label %80, label %83

80:                                               ; preds = %.lr.ph74
  %81 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv91
  %82 = getelementptr inbounds %struct.complex, ptr %0, i64 %78
  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) %81, ptr noundef nonnull align 8 dereferenceable(16) %82) #5
  br label %83

83:                                               ; preds = %.lr.ph74, %80
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
  br i1 %exitcond95.not, label %.preheader67, label %.lr.ph74, !llvm.loop !17

._crit_edge:                                      ; preds = %._crit_edge80.us, %.preheader67
  %84 = icmp eq i32 %2, -1
  %or.cond = and i1 %84, %41
  br i1 %or.cond, label %.lr.ph88, label %.loopexit

.lr.ph88:                                         ; preds = %._crit_edge
  %85 = uitofp nneg i32 %1 to double
  %wide.trip.count107 = zext nneg i32 %1 to i64
  %min.iters.check = icmp eq i32 %1, 1
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph88
  %n.vec = and i64 %wide.trip.count94, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %85, i64 0
  %86 = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %87 = getelementptr inbounds %struct.complex, ptr %0, i64 %index
  %wide.vec = load <4 x double>, ptr %87, align 8, !tbaa !12
  %interleaved.vec = fdiv <4 x double> %wide.vec, %86
  store <4 x double> %interleaved.vec, ptr %87, align 8, !tbaa !12
  %index.next = add nuw i64 %index, 2
  %88 = icmp eq i64 %index.next, %n.vec
  br i1 %88, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count94
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph88
  %indvars.iv104.ph = phi i64 [ 0, %.lr.ph88 ], [ %n.vec, %middle.block ]
  %89 = insertelement <2 x double> poison, double %85, i64 0
  %90 = shufflevector <2 x double> %89, <2 x double> poison, <2 x i32> zeroinitializer
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %scalar.ph ], [ %indvars.iv104.ph, %scalar.ph.preheader ]
  %91 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv104
  %92 = load <2 x double>, ptr %91, align 8, !tbaa !12
  %93 = fdiv <2 x double> %92, %90
  store <2 x double> %93, ptr %91, align 8, !tbaa !12
  %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
  br i1 %exitcond108.not, label %.loopexit, label %scalar.ph, !llvm.loop !21

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %.loopexit69, %._crit_edge
  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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 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 = !{!"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}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !10, !20, !19}


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