; LLVM IR from tangjz/acm-icpc :: lydsy/4115.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 { x86_fp80, x86_fp80 }

@_ZL2pi = external hidden global x86_fp80, align 16
@_ZZ3FFTP7complexiiE6bitlen = external hidden global i32, align 4
@_ZZ3FFTP7complexiiE6bitrev = external hidden global [1048576 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 %struct.complex, align 16
  %11 = alloca i32, align 4
  %12 = alloca %struct.complex, align 16
  %13 = alloca i32, align 4
  %14 = alloca %struct.complex, align 16
  %15 = alloca %struct.complex, align 16
  %16 = alloca %struct.complex, align 16
  %17 = alloca %struct.complex, align 16
  %18 = 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
  store i32 0, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %25, %3
  %20 = load i32, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !9
  %21 = shl i32 1, %20
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %28

24:                                               ; preds = %19
  br label %25

25:                                               ; preds = %24
  %26 = load i32, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !9
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !9
  br label %19, !llvm.loop !11

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

29:                                               ; preds = %69, %28
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %7, align 4, !tbaa !9
  %36 = ashr i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [1048576 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = ashr i32 %39, 1
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = and i32 %41, 1
  %43 = load i32, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !9
  %44 = sub nsw i32 %43, 1
  %45 = shl i32 %42, %44
  %46 = or i32 %40, %45
  %47 = load i32, ptr %7, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1048576 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %48
  store i32 %46, ptr %49, align 4, !tbaa !9
  %50 = load i32, ptr %7, align 4, !tbaa !9
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [1048576 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = icmp slt i32 %50, %54
  br i1 %55, label %56, label %68

56:                                               ; preds = %34
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %struct.complex, ptr %57, i64 %59
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = load i32, ptr %7, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1048576 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %struct.complex, ptr %61, i64 %66
  call void @_ZSt4swapI7complexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 16 dereferenceable(32) %60, ptr noundef nonnull align 16 dereferenceable(32) %67) #6
  br label %68

68:                                               ; preds = %56, %34
  br label %69

69:                                               ; preds = %68
  %70 = load i32, ptr %7, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %7, align 4, !tbaa !9
  br label %29, !llvm.loop !13

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

73:                                               ; preds = %152, %72
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr %5, align 4, !tbaa !9
  %76 = icmp slt i32 %74, %75
  br i1 %76, label %78, label %77

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

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  %79 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !14
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = sitofp i32 %80 to x86_fp80
  %82 = fdiv x86_fp80 %79, %81
  %83 = fptrunc x86_fp80 %82 to double
  %84 = call double @cos(double noundef %83) #6
  %85 = fpext double %84 to x86_fp80
  %86 = load i32, ptr %6, align 4, !tbaa !9
  %87 = sitofp i32 %86 to double
  %88 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !14
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = sitofp i32 %89 to x86_fp80
  %91 = fdiv x86_fp80 %88, %90
  %92 = fptrunc x86_fp80 %91 to double
  %93 = call double @sin(double noundef %92) #6
  %94 = fmul double %87, %93
  %95 = fpext double %94 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %10, x86_fp80 noundef %85, x86_fp80 noundef %95)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %146, %78
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = load i32, ptr %5, align 4, !tbaa !9
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

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

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #6
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %12, x86_fp80 noundef 0xK3FFF8000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %102

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

106:                                              ; preds = %102
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %145

107:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = add nsw i32 %109, %110
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = add nsw i32 %111, %112
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %struct.complex, ptr %108, i64 %114
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %14, ptr noundef nonnull align 16 dereferenceable(32) %12, ptr noundef nonnull align 16 dereferenceable(32) %115)
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = load i32, ptr %13, align 4, !tbaa !9
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds %struct.complex, ptr %116, i64 %120
  call void @_ZmiRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %15, ptr noundef nonnull align 16 dereferenceable(32) %121, ptr noundef nonnull align 16 dereferenceable(32) %14)
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = load i32, ptr %13, align 4, !tbaa !9
  %125 = add nsw i32 %123, %124
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = add nsw i32 %125, %126
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds %struct.complex, ptr %122, i64 %128
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %129, ptr align 16 %15, i64 32, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = add nsw i32 %131, %132
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.complex, ptr %130, i64 %134
  call void @_ZplRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %16, ptr noundef nonnull align 16 dereferenceable(32) %135, ptr noundef nonnull align 16 dereferenceable(32) %14)
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = load i32, ptr %13, align 4, !tbaa !9
  %139 = add nsw i32 %137, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.complex, ptr %136, i64 %140
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %141, ptr align 16 %16, i64 32, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %142

142:                                              ; preds = %107
  %143 = load i32, ptr %13, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #6
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %17, ptr noundef nonnull align 16 dereferenceable(32) %12, ptr noundef nonnull align 16 dereferenceable(32) %10)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %12, ptr align 16 %17, i64 32, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  br label %102, !llvm.loop !17

145:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #6
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %8, align 4, !tbaa !9
  %148 = shl i32 %147, 1
  %149 = load i32, ptr %11, align 4, !tbaa !9
  %150 = add nsw i32 %149, %148
  store i32 %150, ptr %11, align 4, !tbaa !9
  br label %96, !llvm.loop !18

151:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #6
  br label %152

152:                                              ; preds = %151
  %153 = load i32, ptr %8, align 4, !tbaa !9
  %154 = shl i32 %153, 1
  store i32 %154, ptr %8, align 4, !tbaa !9
  br label %73, !llvm.loop !19

155:                                              ; preds = %77
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = icmp eq i32 %156, -1
  br i1 %157, label %158, label %178

158:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %159

159:                                              ; preds = %174, %158
  %160 = load i32, ptr %18, align 4, !tbaa !9
  %161 = load i32, ptr %5, align 4, !tbaa !9
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %177

164:                                              ; preds = %159
  %165 = load i32, ptr %5, align 4, !tbaa !9
  %166 = sitofp i32 %165 to x86_fp80
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = load i32, ptr %18, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds %struct.complex, ptr %167, i64 %169
  %171 = getelementptr inbounds %struct.complex, ptr %170, i32 0, i32 0
  %172 = load x86_fp80, ptr %171, align 16, !tbaa !20
  %173 = fdiv x86_fp80 %172, %166
  store x86_fp80 %173, ptr %171, align 16, !tbaa !20
  br label %174

174:                                              ; preds = %164
  %175 = load i32, ptr %18, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %18, align 4, !tbaa !9
  br label %159, !llvm.loop !22

177:                                              ; preds = %163
  br label %178

178:                                              ; preds = %177, %155
  ret void
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZmlRK7complexS1_(ptr dead_on_unwind noalias writable sret(%struct.complex) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZmiRK7complexS1_(ptr dead_on_unwind noalias writable sret(%struct.complex) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) #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 void @_ZplRK7complexS1_(ptr dead_on_unwind noalias writable sret(%struct.complex) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) #0

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long double", !7, i64 0}
!16 = !{i64 0, i64 16, !14, i64 16, i64 16, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!21, !15, i64 0}
!21 = !{!"_ZTS7complex", !15, i64 0, !15, i64 16}
!22 = distinct !{!22, !12}


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

%struct.complex = type { x86_fp80, x86_fp80 }

@_ZL2pi = external hidden local_unnamed_addr global x86_fp80, align 16
@_ZZ3FFTP7complexiiE6bitlen = external hidden local_unnamed_addr global i32, align 4
@_ZZ3FFTP7complexiiE6bitrev = external hidden local_unnamed_addr global [1048576 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 16
  %5 = alloca %struct.complex, align 16
  %6 = alloca %struct.complex, align 16
  %7 = alloca %struct.complex, align 16
  %8 = alloca %struct.complex, align 16
  %9 = alloca %struct.complex, align 16
  br label %10

10:                                               ; preds = %10, %3
  %.pre84 = phi i32 [ 0, %3 ], [ %13, %10 ]
  %11 = shl nuw i32 1, %.pre84
  %12 = icmp slt i32 %11, %1
  %13 = add nuw nsw i32 %.pre84, 1
  br i1 %12, label %10, label %.preheader56, !llvm.loop !5

.preheader56:                                     ; preds = %10
  store i32 %.pre84, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !7
  %14 = icmp sgt i32 %1, 1
  br i1 %14, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader56
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph

.preheader55:                                     ; preds = %34
  br i1 %14, label %.lr.ph66, label %._crit_edge

.lr.ph66:                                         ; preds = %.preheader55
  %15 = sitofp i32 %2 to double
  %16 = zext nneg i32 %1 to i64
  br label %.lr.ph62

.lr.ph:                                           ; preds = %.lr.ph.preheader, %34
  %17 = phi i32 [ %.pre84, %.lr.ph.preheader ], [ %35, %34 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %34 ]
  %18 = trunc nuw nsw i64 %indvars.iv to i32
  %19 = lshr i64 %indvars.iv, 1
  %20 = and i64 %19, 2147483647
  %21 = getelementptr inbounds [1048576 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !7
  %23 = ashr i32 %22, 1
  %24 = and i32 %18, 1
  %25 = add nsw i32 %17, -1
  %26 = shl nuw i32 %24, %25
  %27 = or i32 %26, %23
  %28 = getelementptr inbounds [1048576 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %indvars.iv
  store i32 %27, ptr %28, align 4, !tbaa !7
  %29 = sext i32 %27 to i64
  %30 = icmp slt i64 %indvars.iv, %29
  br i1 %30, label %31, label %34

31:                                               ; preds = %.lr.ph
  %32 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv
  %33 = getelementptr inbounds %struct.complex, ptr %0, i64 %29
  tail call void @_ZSt4swapI7complexENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 16 dereferenceable(32) %32, ptr noundef nonnull align 16 dereferenceable(32) %33) #6
  %.pre = load i32, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !7
  br label %34

34:                                               ; preds = %.lr.ph, %31
  %35 = phi i32 [ %17, %.lr.ph ], [ %.pre, %31 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader55, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %._crit_edge63, %.preheader56, %.preheader55
  %36 = icmp eq i32 %2, -1
  %37 = icmp sgt i32 %1, 0
  %or.cond = and i1 %36, %37
  br i1 %or.cond, label %.lr.ph68, label %.loopexit

.lr.ph68:                                         ; preds = %._crit_edge
  %38 = uitofp nneg i32 %1 to x86_fp80
  %wide.trip.count82 = zext nneg i32 %1 to i64
  %xtraiter = and i64 %wide.trip.count82, 3
  %39 = icmp ult i32 %1, 4
  br i1 %39, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph68.new

.lr.ph68.new:                                     ; preds = %.lr.ph68
  %unroll_iter = and i64 %wide.trip.count82, 2147483644
  br label %63

.lr.ph62:                                         ; preds = %._crit_edge63, %.lr.ph66
  %.05164 = phi i32 [ 1, %.lr.ph66 ], [ %53, %._crit_edge63 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  %40 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !12
  %41 = sitofp i32 %.05164 to x86_fp80
  %42 = fdiv x86_fp80 %40, %41
  %43 = fptrunc x86_fp80 %42 to double
  %44 = call double @cos(double noundef %43) #6
  %45 = fpext double %44 to x86_fp80
  %46 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !12
  %47 = fdiv x86_fp80 %46, %41
  %48 = fptrunc x86_fp80 %47 to double
  %49 = call double @sin(double noundef %48) #6
  %50 = fmul double %49, %15
  %51 = fpext double %50 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef %45, x86_fp80 noundef %51)
  %52 = icmp sgt i32 %.05164, 0
  %53 = shl i32 %.05164, 1
  br i1 %52, label %.lr.ph59.us.preheader, label %.lr.ph62.split

.lr.ph59.us.preheader:                            ; preds = %.lr.ph62
  %54 = zext nneg i32 %.05164 to i64
  %55 = sext i32 %53 to i64
  %wide.trip.count74 = zext nneg i32 %.05164 to i64
  %invariant.gep = getelementptr %struct.complex, ptr %0, i64 %54
  br label %.lr.ph59.us

.lr.ph59.us:                                      ; preds = %.lr.ph59.us.preheader, %._crit_edge.us
  %indvars.iv76 = phi i64 [ 0, %.lr.ph59.us.preheader ], [ %indvars.iv.next77, %._crit_edge.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %5, x86_fp80 noundef 0xK3FFF8000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  br label %56

56:                                               ; preds = %.lr.ph59.us, %56
  %indvars.iv71 = phi i64 [ 0, %.lr.ph59.us ], [ %indvars.iv.next72, %56 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %57 = add nsw i64 %indvars.iv71, %indvars.iv76
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %57
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %6, ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) %gep)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #6
  %58 = getelementptr inbounds %struct.complex, ptr %0, i64 %57
  call void @_ZmiRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %7, ptr noundef nonnull align 16 dereferenceable(32) %58, ptr noundef nonnull align 16 dereferenceable(32) %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %gep, ptr noundef nonnull align 16 dereferenceable(32) %7, i64 32, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @_ZplRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %8, ptr noundef nonnull align 16 dereferenceable(32) %58, ptr noundef nonnull align 16 dereferenceable(32) %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %58, ptr noundef nonnull align 16 dereferenceable(32) %8, i64 32, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #6
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %9, ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %5, ptr noundef nonnull align 16 dereferenceable(32) %9, i64 32, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge.us, label %56, !llvm.loop !15

._crit_edge.us:                                   ; preds = %56
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %indvars.iv.next77 = add nsw i64 %indvars.iv76, %55
  %59 = icmp slt i64 %indvars.iv.next77, %16
  br i1 %59, label %.lr.ph59.us, label %._crit_edge63, !llvm.loop !16

._crit_edge63:                                    ; preds = %.lr.ph62.split, %._crit_edge.us
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  %60 = icmp slt i32 %53, %1
  br i1 %60, label %.lr.ph62, label %._crit_edge, !llvm.loop !17

.lr.ph62.split:                                   ; preds = %.lr.ph62, %.lr.ph62.split
  %.05060 = phi i32 [ %61, %.lr.ph62.split ], [ 0, %.lr.ph62 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %5, x86_fp80 noundef 0xK3FFF8000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %61 = add nsw i32 %.05060, %53
  %62 = icmp slt i32 %61, %1
  br i1 %62, label %.lr.ph62.split, label %._crit_edge63, !llvm.loop !16

63:                                               ; preds = %63, %.lr.ph68.new
  %indvars.iv79 = phi i64 [ 0, %.lr.ph68.new ], [ %indvars.iv.next80.3, %63 ]
  %niter = phi i64 [ 0, %.lr.ph68.new ], [ %niter.next.3, %63 ]
  %64 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv79
  %65 = load x86_fp80, ptr %64, align 16, !tbaa !18
  %66 = fdiv x86_fp80 %65, %38
  store x86_fp80 %66, ptr %64, align 16, !tbaa !18
  %indvars.iv.next80 = or disjoint i64 %indvars.iv79, 1
  %67 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next80
  %68 = load x86_fp80, ptr %67, align 16, !tbaa !18
  %69 = fdiv x86_fp80 %68, %38
  store x86_fp80 %69, ptr %67, align 16, !tbaa !18
  %indvars.iv.next80.1 = or disjoint i64 %indvars.iv79, 2
  %70 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next80.1
  %71 = load x86_fp80, ptr %70, align 16, !tbaa !18
  %72 = fdiv x86_fp80 %71, %38
  store x86_fp80 %72, ptr %70, align 16, !tbaa !18
  %indvars.iv.next80.2 = or disjoint i64 %indvars.iv79, 3
  %73 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next80.2
  %74 = load x86_fp80, ptr %73, align 16, !tbaa !18
  %75 = fdiv x86_fp80 %74, %38
  store x86_fp80 %75, ptr %73, align 16, !tbaa !18
  %indvars.iv.next80.3 = add nuw nsw i64 %indvars.iv79, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %63, !llvm.loop !20

.loopexit.loopexit.unr-lcssa:                     ; preds = %63, %.lr.ph68
  %indvars.iv79.unr = phi i64 [ 0, %.lr.ph68 ], [ %indvars.iv.next80.3, %63 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.epil.preheader

.epil.preheader:                                  ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv79.epil = phi i64 [ %indvars.iv.next80.epil, %.epil.preheader ], [ %indvars.iv79.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %76 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv79.epil
  %77 = load x86_fp80, ptr %76, align 16, !tbaa !18
  %78 = fdiv x86_fp80 %77, %38
  store x86_fp80 %78, ptr %76, align 16, !tbaa !18
  %indvars.iv.next80.epil = add nuw nsw i64 %indvars.iv79.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.loopexit, label %.epil.preheader, !llvm.loop !21

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader, %._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: 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 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZmlRK7complexS1_(ptr dead_on_unwind noalias writable sret(%struct.complex) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZmiRK7complexS1_(ptr dead_on_unwind noalias writable sret(%struct.complex) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) local_unnamed_addr #0

; Function Attrs: mustprogress 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 void @_ZplRK7complexS1_(ptr dead_on_unwind noalias writable sret(%struct.complex) align 16, ptr noundef nonnull align 16 dereferenceable(32), ptr noundef nonnull align 16 dereferenceable(32)) 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 = { mustprogress 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long double", !9, i64 0}
!14 = !{i64 0, i64 16, !12, i64 16, i64 16, !12}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = !{!19, !13, i64 0}
!19 = !{!"_ZTS7complex", !13, i64 0, !13, i64 16}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}


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