; LLVM IR from tangjz/acm-icpc :: hdu/6120.ll (Z3FFTiP7complexi)

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

@w = external dso_local global [2049 x %struct.complex], align 16
@_ZZ3FFTiP7complexiE6bitLen = external hidden global i32, align 4
@_ZZ3FFTiP7complexiE6bitRev = external hidden global [2049 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3FFTiP7complexi(i32 noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %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 i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, 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 i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load i32, ptr @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  %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 @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %31, %24
  %26 = load i32, ptr @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  %27 = shl i32 1, %26
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %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 @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  br label %25, !llvm.loop !11

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

35:                                               ; preds = %56, %34
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %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) #5
  br label %59

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

56:                                               ; preds = %40
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %7, align 4, !tbaa !5
  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) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %86, %60
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %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) #5
  br label %89

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

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

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

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

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

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

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

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %152, %95
  %97 = load i32, ptr %12, align 4, !tbaa !5
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %157

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %148, %101
  %103 = load i32, ptr %13, align 4, !tbaa !5
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = icmp slt i32 %103, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %102
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %151

107:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %108 = load ptr, ptr %5, align 8, !tbaa !9
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = add nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds %struct.complex, ptr %108, i64 %112
  store ptr %113, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %114 = load ptr, ptr %5, align 8, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = load i32, ptr %13, align 4, !tbaa !5
  %117 = add nsw i32 %115, %116
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.complex, ptr %114, i64 %120
  store ptr %121, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %122 = load i32, ptr %13, align 4, !tbaa !5
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = sub nsw i32 11, %123
  %125 = shl i32 %122, %124
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [2049 x %struct.complex], ptr @w, i64 0, i64 %126
  %128 = load ptr, ptr %15, align 8, !tbaa !9
  %129 = call { double, double } @_ZNK7complexmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) %127, ptr noundef nonnull align 8 dereferenceable(16) %128)
  %130 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %131 = extractvalue { double, double } %129, 0
  store double %131, ptr %130, align 8
  %132 = getelementptr inbounds { double, double }, ptr %16, 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 %17) #5
  %134 = load ptr, ptr %14, align 8, !tbaa !9
  %135 = call { double, double } @_ZNK7complexmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %134, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %136 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %137 = extractvalue { double, double } %135, 0
  store double %137, ptr %136, align 8
  %138 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %139 = extractvalue { double, double } %135, 1
  store double %139, ptr %138, align 8
  %140 = load ptr, ptr %15, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %140, ptr align 8 %17, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %141 = load ptr, ptr %14, align 8, !tbaa !9
  %142 = call { double, double } @_ZNK7complexplERKS_(ptr noundef nonnull align 8 dereferenceable(16) %141, ptr noundef nonnull align 8 dereferenceable(16) %16)
  %143 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %144 = extractvalue { double, double } %142, 0
  store double %144, ptr %143, align 8
  %145 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %146 = extractvalue { double, double } %142, 1
  store double %146, ptr %145, align 8
  %147 = load ptr, ptr %14, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %147, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %148

148:                                              ; preds = %107
  %149 = load i32, ptr %13, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %13, align 4, !tbaa !5
  br label %102, !llvm.loop !18

151:                                              ; preds = %106
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %10, align 4, !tbaa !5
  %154 = shl i32 %153, 1
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %12, align 4, !tbaa !5
  br label %96, !llvm.loop !19

157:                                              ; preds = %100
  br label %158

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

163:                                              ; preds = %94
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = icmp ne i32 %164, -1
  br i1 %165, label %166, label %167

166:                                              ; preds = %163
  br label %192

167:                                              ; preds = %163
  %168 = load ptr, ptr %5, align 8, !tbaa !9
  %169 = getelementptr inbounds %struct.complex, ptr %168, i64 1
  %170 = load ptr, ptr %5, align 8, !tbaa !9
  %171 = load i32, ptr %4, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds %struct.complex, ptr %170, i64 %172
  call void @_ZSt7reverseIP7complexEvT_S2_(ptr noundef %169, ptr noundef %173)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %189, %167
  %175 = load i32, ptr %19, align 4, !tbaa !5
  %176 = load i32, ptr %4, align 4, !tbaa !5
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  store i32 20, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %192

179:                                              ; preds = %174
  %180 = load i32, ptr %4, align 4, !tbaa !5
  %181 = sitofp i32 %180 to double
  %182 = load ptr, ptr %5, align 8, !tbaa !9
  %183 = load i32, ptr %19, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds %struct.complex, ptr %182, i64 %184
  %186 = getelementptr inbounds %struct.complex, ptr %185, i32 0, i32 0
  %187 = load double, ptr %186, align 8, !tbaa !21
  %188 = fdiv double %187, %181
  store double %188, ptr %186, align 8, !tbaa !21
  br label %189

189:                                              ; preds = %179
  %190 = load i32, ptr %19, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %19, align 4, !tbaa !5
  br label %174, !llvm.loop !23

192:                                              ; preds = %178, %166
  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: mustprogress uwtable
declare dso_local { double, double } @_ZNK7complexmlERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

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

; 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) #3

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }

!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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{i64 0, i64 8, !16, i64 8, i64 8, !16}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !17, i64 0}
!22 = !{!"_ZTS7complex", !17, i64 0, !17, i64 8}
!23 = distinct !{!23, !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 }

@w = external dso_local global [2049 x %struct.complex], align 16
@_ZZ3FFTiP7complexiE6bitLen = external hidden local_unnamed_addr global i32, align 4
@_ZZ3FFTiP7complexiE6bitRev = external hidden local_unnamed_addr global [2049 x i32], align 16

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3FFTiP7complexi(i32 noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.complex, align 8
  %5 = load i32, ptr @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  %6 = shl nuw i32 1, %5
  %.not = icmp eq i32 %6, %0
  br i1 %.not, label %.loopexit65, label %.preheader66

.preheader66:                                     ; preds = %3, %.preheader66
  %storemerge = phi i32 [ %9, %.preheader66 ], [ 0, %3 ]
  %7 = shl nuw i32 1, %storemerge
  %8 = icmp slt i32 %7, %0
  %9 = add nuw nsw i32 %storemerge, 1
  br i1 %8, label %.preheader66, label %.preheader64, !llvm.loop !9

.preheader64:                                     ; preds = %.preheader66
  store i32 %storemerge, ptr @_ZZ3FFTiP7complexiE6bitLen, align 4, !tbaa !5
  %10 = icmp sgt i32 %0, 1
  br i1 %10, label %.lr.ph, label %.loopexit65

.lr.ph:                                           ; preds = %.preheader64
  %11 = add nsw i32 %storemerge, -1
  %wide.trip.count = zext nneg i32 %0 to i64
  %12 = add nsw i64 %wide.trip.count, -1
  %xtraiter = and i64 %12, 1
  %13 = icmp eq i32 %0, 2
  br i1 %13, label %.loopexit65.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %12, -2
  %14 = shl nuw i32 1, %11
  br label %15

15:                                               ; preds = %15, %.lr.ph.new
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.1, %15 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.1, %15 ]
  %16 = lshr i64 %indvars.iv, 1
  %17 = and i64 %16, 2147483647
  %18 = getelementptr inbounds [2049 x i32], ptr @_ZZ3FFTiP7complexiE6bitRev, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = ashr i32 %19, 1
  %21 = or i32 %20, %14
  %22 = getelementptr inbounds [2049 x i32], ptr @_ZZ3FFTiP7complexiE6bitRev, i64 0, i64 %indvars.iv
  store i32 %21, ptr %22, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = lshr i64 %indvars.iv.next, 1
  %24 = and i64 %23, 2147483647
  %25 = getelementptr inbounds [2049 x i32], ptr @_ZZ3FFTiP7complexiE6bitRev, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = ashr i32 %26, 1
  %28 = getelementptr inbounds [2049 x i32], ptr @_ZZ3FFTiP7complexiE6bitRev, i64 0, i64 %indvars.iv.next
  store i32 %27, ptr %28, 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 %.loopexit65.loopexit.unr-lcssa, label %15, !llvm.loop !11

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

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

.loopexit65:                                      ; preds = %.loopexit65.loopexit.epilog-lcssa, %.loopexit65.loopexit.unr-lcssa, %.preheader64, %3
  %39 = icmp sgt i32 %0, 0
  br i1 %39, label %.lr.ph70.preheader, label %._crit_edge

.lr.ph70.preheader:                               ; preds = %.loopexit65
  %wide.trip.count90 = zext nneg i32 %0 to i64
  br label %.lr.ph70

.preheader63:                                     ; preds = %73
  %.not105 = icmp eq i32 %0, 1
  br i1 %.not105, label %._crit_edge, label %.preheader62.lr.ph

.preheader62.lr.ph:                               ; preds = %.preheader63
  %40 = getelementptr inbounds i8, ptr %4, i64 8
  %41 = zext nneg i32 %0 to i64
  br label %.preheader62.us

.preheader62.us:                                  ; preds = %._crit_edge74.us, %.preheader62.lr.ph
  %.05577.us = phi i32 [ 1, %.preheader62.lr.ph ], [ %47, %._crit_edge74.us ]
  %.05675.us = phi i32 [ 1, %.preheader62.lr.ph ], [ %44, %._crit_edge74.us ]
  %42 = icmp sgt i32 %.05675.us, 0
  %43 = sub nsw i32 11, %.05577.us
  %44 = shl i32 %.05675.us, 1
  br i1 %42, label %.preheader.us.us.preheader, label %._crit_edge74.us

.preheader.us.us.preheader:                       ; preds = %.preheader62.us
  %45 = zext nneg i32 %.05675.us to i64
  %46 = sext i32 %44 to i64
  %wide.trip.count95 = zext nneg i32 %.05675.us to i64
  %invariant.gep = getelementptr %struct.complex, ptr %1, i64 %45
  br label %.preheader.us.us

._crit_edge74.us:                                 ; preds = %._crit_edge.us.us, %.preheader62.us
  %47 = add nuw nsw i32 %.05577.us, 1
  %48 = icmp slt i32 %44, %0
  br i1 %48, label %.preheader62.us, label %._crit_edge, !llvm.loop !12

.preheader.us.us:                                 ; preds = %.preheader.us.us.preheader, %._crit_edge.us.us
  %indvars.iv97 = phi i64 [ 0, %.preheader.us.us.preheader ], [ %indvars.iv.next98, %._crit_edge.us.us ]
  br label %49

49:                                               ; preds = %49, %.preheader.us.us
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %49 ], [ 0, %.preheader.us.us ]
  %50 = add nsw i64 %indvars.iv92, %indvars.iv97
  %51 = getelementptr inbounds %struct.complex, ptr %1, i64 %50
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %50
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  %52 = trunc nuw nsw i64 %indvars.iv92 to i32
  %53 = shl i32 %52, %43
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [2049 x %struct.complex], ptr @w, i64 0, i64 %54
  %56 = call { double, double } @_ZNK7complexmlERKS_(ptr noundef nonnull align 8 dereferenceable(16) %55, ptr noundef nonnull align 8 dereferenceable(16) %gep)
  %57 = extractvalue { double, double } %56, 0
  store double %57, ptr %4, align 8
  %58 = extractvalue { double, double } %56, 1
  store double %58, ptr %40, align 8
  %59 = call { double, double } @_ZNK7complexmiERKS_(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %60 = extractvalue { double, double } %59, 0
  %61 = extractvalue { double, double } %59, 1
  store double %60, ptr %gep, align 8, !tbaa !13
  %.sroa.44.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %gep, i64 8
  store double %61, ptr %.sroa.44.0..sroa_idx.us.us, align 8, !tbaa !13
  %62 = call { double, double } @_ZNK7complexplERKS_(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(16) %4)
  %63 = extractvalue { double, double } %62, 0
  %64 = extractvalue { double, double } %62, 1
  store double %63, ptr %51, align 8, !tbaa !13
  %.sroa.4.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %51, i64 8
  store double %64, ptr %.sroa.4.0..sroa_idx.us.us, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count95
  br i1 %exitcond96.not, label %._crit_edge.us.us, label %49, !llvm.loop !15

._crit_edge.us.us:                                ; preds = %49
  %indvars.iv.next98 = add nsw i64 %indvars.iv97, %46
  %65 = icmp slt i64 %indvars.iv.next98, %41
  br i1 %65, label %.preheader.us.us, label %._crit_edge74.us, !llvm.loop !16

.lr.ph70:                                         ; preds = %.lr.ph70.preheader, %73
  %indvars.iv87 = phi i64 [ 0, %.lr.ph70.preheader ], [ %indvars.iv.next88, %73 ]
  %66 = getelementptr inbounds [2049 x i32], ptr @_ZZ3FFTiP7complexiE6bitRev, i64 0, i64 %indvars.iv87
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = icmp slt i64 %indvars.iv87, %68
  br i1 %69, label %70, label %73

70:                                               ; preds = %.lr.ph70
  %71 = getelementptr inbounds %struct.complex, ptr %1, i64 %indvars.iv87
  %72 = getelementptr inbounds %struct.complex, ptr %1, i64 %68
  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) %71, ptr noundef nonnull align 8 dereferenceable(16) %72) #4
  br label %73

73:                                               ; preds = %.lr.ph70, %70
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90
  br i1 %exitcond91.not, label %.preheader63, label %.lr.ph70, !llvm.loop !17

._crit_edge:                                      ; preds = %._crit_edge74.us, %.loopexit65, %.preheader63
  %.not61 = icmp eq i32 %2, -1
  br i1 %.not61, label %74, label %.loopexit

74:                                               ; preds = %._crit_edge
  %75 = getelementptr inbounds i8, ptr %1, i64 16
  %76 = sext i32 %0 to i64
  %77 = getelementptr inbounds %struct.complex, ptr %1, i64 %76
  call void @_ZSt7reverseIP7complexEvT_S2_(ptr noundef nonnull %75, ptr noundef %77)
  br i1 %39, label %.lr.ph84, label %.loopexit

.lr.ph84:                                         ; preds = %74
  %78 = uitofp nneg i32 %0 to double
  %wide.trip.count103 = zext nneg i32 %0 to i64
  %min.iters.check = icmp ult i32 %0, 3
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph84
  %.neg = or i64 %wide.trip.count103, -2
  %n.vec = add nsw i64 %.neg, %wide.trip.count103
  %broadcast.splatinsert = insertelement <2 x double> poison, double %78, 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 ]
  %79 = or disjoint i64 %index, 1
  %80 = getelementptr inbounds %struct.complex, ptr %1, i64 %index
  %81 = getelementptr inbounds %struct.complex, ptr %1, i64 %79
  %82 = load double, ptr %80, align 8, !tbaa !18
  %83 = load double, ptr %81, align 8, !tbaa !18
  %84 = insertelement <2 x double> poison, double %82, i64 0
  %85 = insertelement <2 x double> %84, double %83, i64 1
  %86 = fdiv <2 x double> %85, %broadcast.splat
  %87 = extractelement <2 x double> %86, i64 0
  store double %87, ptr %80, align 8, !tbaa !18
  %88 = extractelement <2 x double> %86, i64 1
  store double %88, ptr %81, align 8, !tbaa !18
  %index.next = add nuw i64 %index, 2
  %89 = icmp eq i64 %index.next, %n.vec
  br i1 %89, label %scalar.ph.preheader, label %vector.body, !llvm.loop !20

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

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %scalar.ph ], [ %indvars.iv100.ph, %scalar.ph.preheader ]
  %90 = getelementptr inbounds %struct.complex, ptr %1, i64 %indvars.iv100
  %91 = load double, ptr %90, align 8, !tbaa !18
  %92 = fdiv double %91, %78
  store double %92, ptr %90, align 8, !tbaa !18
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103
  br i1 %exitcond104.not, label %.loopexit, label %scalar.ph, !llvm.loop !23

.loopexit:                                        ; preds = %scalar.ph, %74, %._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 uwtable
declare dso_local { double, double } @_ZNK7complexmlERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

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

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

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

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


; 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