; LLVM IR from tangjz/acm-icpc :: hdu/5530.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 double, align 8
@len = external dso_local global i32, align 4
@bitrev = external dso_local global [65536 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %44, %3
  %20 = load i32, ptr %7, align 4, !tbaa !9
  %21 = load i32, ptr @len, align 4, !tbaa !9
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

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

24:                                               ; preds = %19
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [65536 x i32], ptr @bitrev, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = icmp slt i32 %25, %29
  br i1 %30, label %31, label %43

31:                                               ; preds = %24
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %struct.complex, ptr %32, i64 %34
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [65536 x i32], ptr @bitrev, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds %struct.complex, ptr %36, i64 %41
  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) %35, ptr noundef nonnull align 16 dereferenceable(32) %42) #6
  br label %43

43:                                               ; preds = %31, %24
  br label %44

44:                                               ; preds = %43
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %7, align 4, !tbaa !9
  br label %19, !llvm.loop !11

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

48:                                               ; preds = %125, %47
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = load i32, ptr %5, align 4, !tbaa !9
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #6
  %54 = load double, ptr @_ZL2pi, align 8, !tbaa !13
  %55 = load i32, ptr %8, align 4, !tbaa !9
  %56 = sitofp i32 %55 to double
  %57 = fdiv double %54, %56
  %58 = call double @cos(double noundef %57) #6
  %59 = fpext double %58 to x86_fp80
  %60 = load i32, ptr %6, align 4, !tbaa !9
  %61 = sitofp i32 %60 to double
  %62 = load double, ptr @_ZL2pi, align 8, !tbaa !13
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = sitofp i32 %63 to double
  %65 = fdiv double %62, %64
  %66 = call double @sin(double noundef %65) #6
  %67 = fmul double %61, %66
  %68 = fpext double %67 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %10, x86_fp80 noundef %59, x86_fp80 noundef %68)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %119, %53
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = load i32, ptr %5, align 4, !tbaa !9
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %69
  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 %75

75:                                               ; preds = %115, %74
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = icmp slt i32 %76, %77
  br i1 %78, label %80, label %79

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

80:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = add nsw i32 %82, %83
  %85 = load i32, ptr %8, align 4, !tbaa !9
  %86 = add nsw i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.complex, ptr %81, i64 %87
  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) %88)
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #6
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = load i32, ptr %13, align 4, !tbaa !9
  %92 = add nsw i32 %90, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds %struct.complex, ptr %89, i64 %93
  call void @_ZmiRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %15, ptr noundef nonnull align 16 dereferenceable(32) %94, ptr noundef nonnull align 16 dereferenceable(32) %14)
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = load i32, ptr %11, align 4, !tbaa !9
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = add nsw i32 %96, %97
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = add nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds %struct.complex, ptr %95, i64 %101
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %102, ptr align 16 %15, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = add nsw i32 %104, %105
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds %struct.complex, ptr %103, i64 %107
  call void @_ZplRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %16, ptr noundef nonnull align 16 dereferenceable(32) %108, ptr noundef nonnull align 16 dereferenceable(32) %14)
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = load i32, ptr %11, align 4, !tbaa !9
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = add nsw i32 %110, %111
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds %struct.complex, ptr %109, i64 %113
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %114, ptr align 16 %16, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  br label %115

115:                                              ; preds = %80
  %116 = load i32, ptr %13, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, 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 !15
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  br label %75, !llvm.loop !18

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

119:                                              ; preds = %118
  %120 = load i32, ptr %8, align 4, !tbaa !9
  %121 = shl i32 %120, 1
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = add nsw i32 %122, %121
  store i32 %123, ptr %11, align 4, !tbaa !9
  br label %69, !llvm.loop !19

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

125:                                              ; preds = %124
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = shl i32 %126, 1
  store i32 %127, ptr %8, align 4, !tbaa !9
  br label %48, !llvm.loop !20

128:                                              ; preds = %52
  %129 = load i32, ptr %6, align 4, !tbaa !9
  %130 = icmp eq i32 %129, -1
  br i1 %130, label %131, label %151

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

132:                                              ; preds = %147, %131
  %133 = load i32, ptr %18, align 4, !tbaa !9
  %134 = load i32, ptr %5, align 4, !tbaa !9
  %135 = icmp slt i32 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %150

137:                                              ; preds = %132
  %138 = load i32, ptr %5, align 4, !tbaa !9
  %139 = sitofp i32 %138 to x86_fp80
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  %141 = load i32, ptr %18, align 4, !tbaa !9
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds %struct.complex, ptr %140, i64 %142
  %144 = getelementptr inbounds %struct.complex, ptr %143, i32 0, i32 0
  %145 = load x86_fp80, ptr %144, align 16, !tbaa !21
  %146 = fdiv x86_fp80 %145, %139
  store x86_fp80 %146, ptr %144, align 16, !tbaa !21
  br label %147

147:                                              ; preds = %137
  %148 = load i32, ptr %18, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %18, align 4, !tbaa !9
  br label %132, !llvm.loop !23

150:                                              ; preds = %136
  br label %151

151:                                              ; preds = %150, %128
  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 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{i64 0, i64 16, !16, i64 16, i64 16, !16}
!16 = !{!17, !17, i64 0}
!17 = !{!"long 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 16}
!23 = distinct !{!23, !12}


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

%struct.complex = type { x86_fp80, x86_fp80 }

@_ZL2pi = external hidden local_unnamed_addr global double, align 8
@len = external dso_local local_unnamed_addr global i32, align 4
@bitrev = external dso_local local_unnamed_addr global [65536 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
  %10 = load i32, ptr @len, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 1
  br i1 %11, label %.lr.ph, label %.preheader50

.preheader50:                                     ; preds = %44, %3
  %12 = icmp sgt i32 %1, 1
  br i1 %12, label %.lr.ph60, label %._crit_edge

.lr.ph60:                                         ; preds = %.preheader50
  %13 = sitofp i32 %2 to double
  %14 = zext nneg i32 %1 to i64
  br label %.lr.ph56.us

.lr.ph56.us:                                      ; preds = %._crit_edge57.us, %.lr.ph60
  %.04658.us = phi i32 [ 1, %.lr.ph60 ], [ %26, %._crit_edge57.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  %15 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %16 = sitofp i32 %.04658.us to double
  %17 = fdiv double %15, %16
  %18 = call double @cos(double noundef %17) #6
  %19 = fpext double %18 to x86_fp80
  %20 = load double, ptr @_ZL2pi, align 8, !tbaa !9
  %21 = fdiv double %20, %16
  %22 = call double @sin(double noundef %21) #6
  %23 = fmul double %22, %13
  %24 = fpext double %23 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef %19, x86_fp80 noundef %24)
  %25 = icmp sgt i32 %.04658.us, 0
  %26 = shl i32 %.04658.us, 1
  br i1 %25, label %.lr.ph53.us.us.preheader, label %.lr.ph56.split.us63

.lr.ph53.us.us.preheader:                         ; preds = %.lr.ph56.us
  %27 = zext nneg i32 %.04658.us to i64
  %28 = sext i32 %26 to i64
  %wide.trip.count = zext nneg i32 %.04658.us to i64
  %invariant.gep = getelementptr %struct.complex, ptr %0, i64 %27
  br label %.lr.ph53.us.us

.lr.ph56.split.us63:                              ; preds = %.lr.ph56.us, %.lr.ph56.split.us63
  %.04554.us61 = phi i32 [ %29, %.lr.ph56.split.us63 ], [ 0, %.lr.ph56.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)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %29 = add nsw i32 %.04554.us61, %26
  %30 = icmp slt i32 %29, %1
  br i1 %30, label %.lr.ph56.split.us63, label %._crit_edge57.us, !llvm.loop !11

._crit_edge57.us:                                 ; preds = %.lr.ph56.split.us63, %._crit_edge.us.us
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  %31 = icmp slt i32 %26, %1
  br i1 %31, label %.lr.ph56.us, label %._crit_edge, !llvm.loop !13

.lr.ph53.us.us:                                   ; preds = %.lr.ph53.us.us.preheader, %._crit_edge.us.us
  %indvars.iv71 = phi i64 [ 0, %.lr.ph53.us.us.preheader ], [ %indvars.iv.next72, %._crit_edge.us.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 %32

32:                                               ; preds = %32, %.lr.ph53.us.us
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %32 ], [ 0, %.lr.ph53.us.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %33 = add nsw i64 %indvars.iv68, %indvars.iv71
  %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) #6
  %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 !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) %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 !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.next69 = add nuw nsw i64 %indvars.iv68, 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
  %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us.us, label %32, !llvm.loop !17

._crit_edge.us.us:                                ; preds = %32
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %indvars.iv.next72 = add nsw i64 %indvars.iv71, %28
  %35 = icmp slt i64 %indvars.iv.next72, %14
  br i1 %35, label %.lr.ph53.us.us, label %._crit_edge57.us, !llvm.loop !11

.lr.ph:                                           ; preds = %3, %44
  %36 = phi i32 [ %45, %44 ], [ %10, %3 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %44 ], [ 1, %3 ]
  %37 = getelementptr inbounds [65536 x i32], ptr @bitrev, i64 0, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = icmp slt i64 %indvars.iv, %39
  br i1 %40, label %41, label %44

41:                                               ; preds = %.lr.ph
  %42 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv
  %43 = getelementptr inbounds %struct.complex, ptr %0, i64 %39
  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) %42, ptr noundef nonnull align 16 dereferenceable(32) %43) #6
  %.pre = load i32, ptr @len, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %.lr.ph, %41
  %45 = phi i32 [ %36, %.lr.ph ], [ %.pre, %41 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %.lr.ph, label %.preheader50, !llvm.loop !18

._crit_edge:                                      ; preds = %._crit_edge57.us, %.preheader50
  %48 = icmp eq i32 %2, -1
  %49 = icmp sgt i32 %1, 0
  %or.cond = and i1 %48, %49
  br i1 %or.cond, label %.lr.ph65, label %.loopexit

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

.lr.ph65.new:                                     ; preds = %.lr.ph65
  %unroll_iter = and i64 %wide.trip.count77, 2147483644
  br label %52

52:                                               ; preds = %52, %.lr.ph65.new
  %indvars.iv74 = phi i64 [ 0, %.lr.ph65.new ], [ %indvars.iv.next75.3, %52 ]
  %niter = phi i64 [ 0, %.lr.ph65.new ], [ %niter.next.3, %52 ]
  %53 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv74
  %54 = load x86_fp80, ptr %53, align 16, !tbaa !19
  %55 = fdiv x86_fp80 %54, %50
  store x86_fp80 %55, ptr %53, align 16, !tbaa !19
  %indvars.iv.next75 = or disjoint i64 %indvars.iv74, 1
  %56 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next75
  %57 = load x86_fp80, ptr %56, align 16, !tbaa !19
  %58 = fdiv x86_fp80 %57, %50
  store x86_fp80 %58, ptr %56, align 16, !tbaa !19
  %indvars.iv.next75.1 = or disjoint i64 %indvars.iv74, 2
  %59 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next75.1
  %60 = load x86_fp80, ptr %59, align 16, !tbaa !19
  %61 = fdiv x86_fp80 %60, %50
  store x86_fp80 %61, ptr %59, align 16, !tbaa !19
  %indvars.iv.next75.2 = or disjoint i64 %indvars.iv74, 3
  %62 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv.next75.2
  %63 = load x86_fp80, ptr %62, align 16, !tbaa !19
  %64 = fdiv x86_fp80 %63, %50
  store x86_fp80 %64, ptr %62, align 16, !tbaa !19
  %indvars.iv.next75.3 = add nuw nsw i64 %indvars.iv74, 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 %52, !llvm.loop !21

.loopexit.loopexit.unr-lcssa:                     ; preds = %52, %.lr.ph65
  %indvars.iv74.unr = phi i64 [ 0, %.lr.ph65 ], [ %indvars.iv.next75.3, %52 ]
  %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.iv74.epil = phi i64 [ %indvars.iv.next75.epil, %.epil.preheader ], [ %indvars.iv74.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %65 = getelementptr inbounds %struct.complex, ptr %0, i64 %indvars.iv74.epil
  %66 = load x86_fp80, ptr %65, align 16, !tbaa !19
  %67 = fdiv x86_fp80 %66, %50
  store x86_fp80 %67, ptr %65, align 16, !tbaa !19
  %indvars.iv.next75.epil = add nuw nsw i64 %indvars.iv74.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 !22

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


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