; LLVM IR from tangjz/acm-icpc :: codeforces/gym/101194I.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 [32769 x %struct.Complex], align 16
@_ZZ3FFTiP7ComplexiE6bitLen = external hidden global i32, align 4
@_ZZ3FFTiP7ComplexiE6bitRev = external hidden global [32769 x i32], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3FFTiP7Complexi(i32 noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %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 [32769 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 [32769 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 [32769 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 [32769 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 15, %123
  %125 = shl i32 %122, %124
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [32769 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 %201

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 = %198, %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 %201

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
  %189 = load i32, ptr %4, align 4, !tbaa !5
  %190 = sitofp i32 %189 to double
  %191 = load ptr, ptr %5, align 8, !tbaa !9
  %192 = load i32, ptr %19, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds %struct.Complex, ptr %191, i64 %193
  %195 = getelementptr inbounds %struct.Complex, ptr %194, i32 0, i32 1
  %196 = load double, ptr %195, align 8, !tbaa !23
  %197 = fdiv double %196, %190
  store double %197, ptr %195, align 8, !tbaa !23
  br label %198

198:                                              ; preds = %179
  %199 = load i32, ptr %19, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr %19, align 4, !tbaa !5
  br label %174, !llvm.loop !24

201:                                              ; preds = %178, %166
  ret void
}

; 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)) #1 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)) #1 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)) #1 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!22, !17, 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 }

@w = external dso_local global [32769 x %struct.Complex], align 16
@_ZZ3FFTiP7ComplexiE6bitLen = external hidden local_unnamed_addr global i32, align 4
@_ZZ3FFTiP7ComplexiE6bitRev = external hidden local_unnamed_addr global [32769 x i32], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3FFTiP7Complexi(i32 noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #1 {
  %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 %.loopexit68, label %.preheader69

.preheader69:                                     ; preds = %3, %.preheader69
  %storemerge = phi i32 [ %9, %.preheader69 ], [ 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 %.preheader69, label %.preheader67, !llvm.loop !9

.preheader67:                                     ; preds = %.preheader69
  store i32 %storemerge, ptr @_ZZ3FFTiP7ComplexiE6bitLen, align 4, !tbaa !5
  %10 = icmp sgt i32 %0, 1
  br i1 %10, label %.lr.ph, label %.loopexit68

.lr.ph:                                           ; preds = %.preheader67
  %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 %.loopexit68.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 [32769 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 [32769 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 [32769 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 [32769 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 %.loopexit68.loopexit.unr-lcssa, label %15, !llvm.loop !11

.loopexit68.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 %.loopexit68, label %.loopexit68.loopexit.epilog-lcssa

.loopexit68.loopexit.epilog-lcssa:                ; preds = %.loopexit68.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 [32769 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 [32769 x i32], ptr @_ZZ3FFTiP7ComplexiE6bitRev, i64 0, i64 %indvars.iv.unr
  store i32 %37, ptr %38, align 4, !tbaa !5
  br label %.loopexit68

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

.lr.ph73.preheader:                               ; preds = %.loopexit68
  %wide.trip.count93 = zext nneg i32 %0 to i64
  br label %.lr.ph73

.preheader66:                                     ; preds = %73
  %.not108 = icmp eq i32 %0, 1
  br i1 %.not108, label %._crit_edge, label %.preheader65.lr.ph

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

.preheader65.us:                                  ; preds = %._crit_edge77.us, %.preheader65.lr.ph
  %.05880.us = phi i32 [ 1, %.preheader65.lr.ph ], [ %47, %._crit_edge77.us ]
  %.05978.us = phi i32 [ 1, %.preheader65.lr.ph ], [ %44, %._crit_edge77.us ]
  %42 = icmp sgt i32 %.05978.us, 0
  %43 = sub nsw i32 15, %.05880.us
  %44 = shl i32 %.05978.us, 1
  br i1 %42, label %.preheader.us.us.preheader, label %._crit_edge77.us

.preheader.us.us.preheader:                       ; preds = %.preheader65.us
  %45 = zext nneg i32 %.05978.us to i64
  %46 = sext i32 %44 to i64
  %wide.trip.count98 = zext nneg i32 %.05978.us to i64
  %invariant.gep = getelementptr %struct.Complex, ptr %1, i64 %45
  br label %.preheader.us.us

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

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

49:                                               ; preds = %49, %.preheader.us.us
  %indvars.iv95 = phi i64 [ %indvars.iv.next96, %49 ], [ 0, %.preheader.us.us ]
  %50 = add nsw i64 %indvars.iv95, %indvars.iv100
  %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.iv95 to i32
  %53 = shl i32 %52, %43
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [32769 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.45.0..sroa_idx.us.us = getelementptr inbounds i8, ptr %gep, i64 8
  store double %61, ptr %.sroa.45.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.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98
  br i1 %exitcond99.not, label %._crit_edge.us.us, label %49, !llvm.loop !15

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

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

70:                                               ; preds = %.lr.ph73
  %71 = getelementptr inbounds %struct.Complex, ptr %1, i64 %indvars.iv90
  %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.ph73, %70
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond94.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count93
  br i1 %exitcond94.not, label %.preheader66, label %.lr.ph73, !llvm.loop !17

._crit_edge:                                      ; preds = %._crit_edge77.us, %.loopexit68, %.preheader66
  %.not64 = icmp eq i32 %2, -1
  br i1 %.not64, 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.ph87, label %.loopexit

.lr.ph87:                                         ; preds = %74
  %78 = uitofp nneg i32 %0 to double
  %wide.trip.count106 = zext nneg i32 %0 to i64
  %min.iters.check = icmp eq i32 %0, 1
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph87
  %n.vec = and i64 %wide.trip.count106, 2147483646
  %broadcast.splatinsert = insertelement <2 x double> poison, double %78, i64 0
  %79 = 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 ]
  %80 = getelementptr inbounds %struct.Complex, ptr %1, i64 %index
  %wide.vec = load <4 x double>, ptr %80, align 8, !tbaa !13
  %interleaved.vec = fdiv <4 x double> %wide.vec, %79
  store <4 x double> %interleaved.vec, ptr %80, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 2
  %81 = icmp eq i64 %index.next, %n.vec
  br i1 %81, label %middle.block, label %vector.body, !llvm.loop !18

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

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph87
  %indvars.iv103.ph = phi i64 [ 0, %.lr.ph87 ], [ %n.vec, %middle.block ]
  %82 = insertelement <2 x double> poison, double %78, i64 0
  %83 = shufflevector <2 x double> %82, <2 x double> poison, <2 x i32> zeroinitializer
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %scalar.ph ], [ %indvars.iv103.ph, %scalar.ph.preheader ]
  %84 = getelementptr inbounds %struct.Complex, ptr %1, i64 %indvars.iv103
  %85 = load <2 x double>, ptr %84, align 8, !tbaa !13
  %86 = fdiv <2 x double> %85, %83
  store <2 x double> %86, ptr %84, align 8, !tbaa !13
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count106
  br i1 %exitcond107.not, label %.loopexit, label %scalar.ph, !llvm.loop !21

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %74, %._crit_edge
  ret void
}

; 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 #1 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 #1 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 #1 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = 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