; LLVM IR from tangjz/acm-icpc :: 51nod/1348.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 [131072 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) #5
  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) #5
  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 [131072 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 [131072 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 [131072 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 [131072 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) #5
  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) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %148, %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) #5
  br label %151

78:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  %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 = call noundef x86_fp80 @_ZSt3cose(x86_fp80 noundef %82)
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = sitofp i32 %84 to x86_fp80
  %86 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !14
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = sitofp i32 %87 to x86_fp80
  %89 = fdiv x86_fp80 %86, %88
  %90 = call noundef x86_fp80 @_ZSt3sine(x86_fp80 noundef %89)
  %91 = fmul x86_fp80 %85, %90
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %10, x86_fp80 noundef %83, x86_fp80 noundef %91)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %142, %78
  %93 = load i32, ptr %11, align 4, !tbaa !9
  %94 = load i32, ptr %5, align 4, !tbaa !9
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #5
  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) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %138, %97
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = load i32, ptr %8, align 4, !tbaa !9
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

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

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

138:                                              ; preds = %103
  %139 = load i32, ptr %13, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #5
  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) #5
  br label %98, !llvm.loop !17

141:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #5
  br label %142

142:                                              ; preds = %141
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = shl i32 %143, 1
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = add nsw i32 %145, %144
  store i32 %146, ptr %11, align 4, !tbaa !9
  br label %92, !llvm.loop !18

147:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %8, align 4, !tbaa !9
  %150 = shl i32 %149, 1
  store i32 %150, ptr %8, align 4, !tbaa !9
  br label %73, !llvm.loop !19

151:                                              ; preds = %77
  %152 = load i32, ptr %6, align 4, !tbaa !9
  %153 = icmp eq i32 %152, -1
  br i1 %153, label %154, label %174

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

155:                                              ; preds = %170, %154
  %156 = load i32, ptr %18, align 4, !tbaa !9
  %157 = load i32, ptr %5, align 4, !tbaa !9
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

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

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

170:                                              ; preds = %160
  %171 = load i32, ptr %18, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %18, align 4, !tbaa !9
  br label %155, !llvm.loop !22

173:                                              ; preds = %159
  br label %174

174:                                              ; preds = %173, %151
  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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt3cose(x86_fp80 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt3sine(x86_fp80 noundef) #2

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

; 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!"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 [131072 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
  %.pre87 = phi i32 [ 0, %3 ], [ %13, %10 ]
  %11 = shl nuw i32 1, %.pre87
  %12 = icmp slt i32 %11, %1
  %13 = add nuw nsw i32 %.pre87, 1
  br i1 %12, label %10, label %.preheader56, !llvm.loop !5

.preheader56:                                     ; preds = %10
  store i32 %.pre87, 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 = %53
  br i1 %14, label %.lr.ph66, label %._crit_edge

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

.lr.ph62.us:                                      ; preds = %._crit_edge63.us, %.lr.ph66
  %.05164.us = phi i32 [ 1, %.lr.ph66 ], [ %26, %._crit_edge63.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #5
  %17 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !11
  %18 = sitofp i32 %.05164.us to x86_fp80
  %19 = fdiv x86_fp80 %17, %18
  %20 = call noundef x86_fp80 @_ZSt3cose(x86_fp80 noundef %19)
  %21 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !11
  %22 = fdiv x86_fp80 %21, %18
  %23 = call noundef x86_fp80 @_ZSt3sine(x86_fp80 noundef %22)
  %24 = fmul x86_fp80 %23, %15
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef %20, x86_fp80 noundef %24)
  %25 = icmp sgt i32 %.05164.us, 0
  %26 = shl i32 %.05164.us, 1
  br i1 %25, label %.lr.ph59.us.us.preheader, label %.lr.ph62.split.us69

.lr.ph59.us.us.preheader:                         ; preds = %.lr.ph62.us
  %27 = zext nneg i32 %.05164.us to i64
  %28 = sext i32 %26 to i64
  %wide.trip.count77 = zext nneg i32 %.05164.us to i64
  %invariant.gep = getelementptr %struct.complex, ptr %0, i64 %27
  br label %.lr.ph59.us.us

.lr.ph62.split.us69:                              ; preds = %.lr.ph62.us, %.lr.ph62.split.us69
  %.05060.us67 = phi i32 [ %29, %.lr.ph62.split.us69 ], [ 0, %.lr.ph62.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #5
  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) #5
  %29 = add nsw i32 %.05060.us67, %26
  %30 = icmp slt i32 %29, %1
  br i1 %30, label %.lr.ph62.split.us69, label %._crit_edge63.us, !llvm.loop !13

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

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

32:                                               ; preds = %32, %.lr.ph59.us.us
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %32 ], [ 0, %.lr.ph59.us.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #5
  %33 = add nsw i64 %indvars.iv74, %indvars.iv79
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %33
  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) #5
  %34 = getelementptr inbounds %struct.complex, ptr %0, i64 %33
  call void @_ZmiRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %7, ptr noundef nonnull align 16 dereferenceable(32) %34, 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 !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @_ZplRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %8, ptr noundef nonnull align 16 dereferenceable(32) %34, ptr noundef nonnull align 16 dereferenceable(32) %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %34, ptr noundef nonnull align 16 dereferenceable(32) %8, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #5
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  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 !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge.us.us, label %32, !llvm.loop !16

._crit_edge.us.us:                                ; preds = %32
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #5
  %indvars.iv.next80 = add nsw i64 %indvars.iv79, %28
  %35 = icmp slt i64 %indvars.iv.next80, %16
  br i1 %35, label %.lr.ph59.us.us, label %._crit_edge63.us, !llvm.loop !13

.lr.ph:                                           ; preds = %.lr.ph.preheader, %53
  %36 = phi i32 [ %.pre87, %.lr.ph.preheader ], [ %54, %53 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %53 ]
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  %38 = lshr i64 %indvars.iv, 1
  %39 = and i64 %38, 2147483647
  %40 = getelementptr inbounds [131072 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !7
  %42 = ashr i32 %41, 1
  %43 = and i32 %37, 1
  %44 = add nsw i32 %36, -1
  %45 = shl nuw i32 %43, %44
  %46 = or i32 %45, %42
  %47 = getelementptr inbounds [131072 x i32], ptr @_ZZ3FFTP7complexiiE6bitrev, i64 0, i64 %indvars.iv
  store i32 %46, ptr %47, align 4, !tbaa !7
  %48 = sext i32 %46 to i64
  %49 = icmp slt i64 %indvars.iv, %48
  br i1 %49, label %50, label %53

50:                                               ; preds = %.lr.ph
  %51 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv
  %52 = getelementptr inbounds %struct.complex, ptr %0, i64 %48
  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) %51, ptr noundef nonnull align 16 dereferenceable(32) %52) #5
  %.pre = load i32, ptr @_ZZ3FFTP7complexiiE6bitlen, align 4, !tbaa !7
  br label %53

53:                                               ; preds = %.lr.ph, %50
  %54 = phi i32 [ %36, %.lr.ph ], [ %.pre, %50 ]
  %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 !17

._crit_edge:                                      ; preds = %._crit_edge63.us, %.preheader56, %.preheader55
  %55 = icmp eq i32 %2, -1
  %56 = icmp sgt i32 %1, 0
  %or.cond = and i1 %55, %56
  br i1 %or.cond, label %.lr.ph71, label %.loopexit

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

.lr.ph71.new:                                     ; preds = %.lr.ph71
  %unroll_iter = and i64 %wide.trip.count85, 2147483644
  br label %59

59:                                               ; preds = %59, %.lr.ph71.new
  %indvars.iv82 = phi i64 [ 0, %.lr.ph71.new ], [ %indvars.iv.next83.3, %59 ]
  %niter = phi i64 [ 0, %.lr.ph71.new ], [ %niter.next.3, %59 ]
  %60 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv82
  %61 = load x86_fp80, ptr %60, align 16, !tbaa !18
  %62 = fdiv x86_fp80 %61, %57
  store x86_fp80 %62, ptr %60, align 16, !tbaa !18
  %indvars.iv.next83 = or disjoint i64 %indvars.iv82, 1
  %63 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next83
  %64 = load x86_fp80, ptr %63, align 16, !tbaa !18
  %65 = fdiv x86_fp80 %64, %57
  store x86_fp80 %65, ptr %63, align 16, !tbaa !18
  %indvars.iv.next83.1 = or disjoint i64 %indvars.iv82, 2
  %66 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next83.1
  %67 = load x86_fp80, ptr %66, align 16, !tbaa !18
  %68 = fdiv x86_fp80 %67, %57
  store x86_fp80 %68, ptr %66, align 16, !tbaa !18
  %indvars.iv.next83.2 = or disjoint i64 %indvars.iv82, 3
  %69 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next83.2
  %70 = load x86_fp80, ptr %69, align 16, !tbaa !18
  %71 = fdiv x86_fp80 %70, %57
  store x86_fp80 %71, ptr %69, align 16, !tbaa !18
  %indvars.iv.next83.3 = add nuw nsw i64 %indvars.iv82, 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 %59, !llvm.loop !20

.loopexit.loopexit.unr-lcssa:                     ; preds = %59, %.lr.ph71
  %indvars.iv82.unr = phi i64 [ 0, %.lr.ph71 ], [ %indvars.iv.next83.3, %59 ]
  %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.iv82.epil = phi i64 [ %indvars.iv.next83.epil, %.epil.preheader ], [ %indvars.iv82.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %72 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv82.epil
  %73 = load x86_fp80, ptr %72, align 16, !tbaa !18
  %74 = fdiv x86_fp80 %73, %57
  store x86_fp80 %74, ptr %72, align 16, !tbaa !18
  %indvars.iv.next83.epil = add nuw nsw i64 %indvars.iv82.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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt3cose(x86_fp80 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef x86_fp80 @_ZSt3sine(x86_fp80 noundef) local_unnamed_addr #2

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

; 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 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = 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 = !{!12, !12, i64 0}
!12 = !{!"long double", !9, i64 0}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = !{i64 0, i64 16, !11, i64 16, i64 16, !11}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = !{!19, !12, i64 0}
!19 = !{!"_ZTS7complex", !12, i64 0, !12, 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,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass