; LLVM IR from tangjz/acm-icpc :: Summer_Training/2016-07-19/upsolved/H - Shell Necklace - tjz.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

; 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 i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.complex, align 16
  %13 = alloca i32, align 4
  %14 = alloca %struct.complex, align 16
  %15 = alloca i32, align 4
  %16 = alloca %struct.complex, align 16
  %17 = alloca %struct.complex, align 16
  %18 = alloca %struct.complex, align 16
  %19 = alloca %struct.complex, align 16
  %20 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %21 = load i32, ptr %5, align 4, !tbaa !9
  %22 = ashr i32 %21, 1
  store i32 %22, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  br label %23

23:                                               ; preds = %65, %3
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !9
  %26 = sub nsw i32 %25, 1
  %27 = icmp slt i32 %24, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %23
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %42

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

42:                                               ; preds = %33, %29
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = ashr i32 %43, 1
  store i32 %44, ptr %9, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %53, %42
  %46 = load i32, ptr %8, align 4, !tbaa !9
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = icmp sge i32 %46, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %45
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = sub nsw i32 %51, %50
  store i32 %52, ptr %8, align 4, !tbaa !9
  br label %53

53:                                               ; preds = %49
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = ashr i32 %54, 1
  store i32 %55, ptr %9, align 4, !tbaa !9
  br label %45, !llvm.loop !11

56:                                               ; preds = %45
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %64

60:                                               ; preds = %56
  %61 = load i32, ptr %9, align 4, !tbaa !9
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = add nsw i32 %62, %61
  store i32 %63, ptr %8, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %60, %56
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %7, align 4, !tbaa !9
  br label %23, !llvm.loop !13

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

69:                                               ; preds = %148, %68
  %70 = load i32, ptr %10, 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 %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %151

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

92:                                               ; preds = %142, %74
  %93 = load i32, ptr %13, 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 %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %147

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %14, x86_fp80 noundef 0xK3FFF8000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %98

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

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

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = load i32, ptr %15, align 4, !tbaa !9
  %107 = add nsw i32 %105, %106
  %108 = load i32, ptr %10, 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 %16, ptr noundef nonnull align 16 dereferenceable(32) %14, ptr noundef nonnull align 16 dereferenceable(32) %111)
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #6
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = load i32, ptr %13, align 4, !tbaa !9
  %114 = load i32, ptr %15, 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 %17, ptr noundef nonnull align 16 dereferenceable(32) %117, ptr noundef nonnull align 16 dereferenceable(32) %16)
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = load i32, ptr %15, align 4, !tbaa !9
  %121 = add nsw i32 %119, %120
  %122 = load i32, ptr %10, 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 %17, i64 32, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #6
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = load i32, ptr %15, 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 %18, ptr noundef nonnull align 16 dereferenceable(32) %131, ptr noundef nonnull align 16 dereferenceable(32) %16)
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = load i32, ptr %13, align 4, !tbaa !9
  %134 = load i32, ptr %15, 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 %18, i64 32, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  br label %138

138:                                              ; preds = %103
  %139 = load i32, ptr %15, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #6
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %19, ptr noundef nonnull align 16 dereferenceable(32) %14, ptr noundef nonnull align 16 dereferenceable(32) %12)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %14, ptr align 16 %19, i64 32, i1 false), !tbaa.struct !16
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #6
  br label %98, !llvm.loop !17

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

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

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

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

151:                                              ; preds = %73
  %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 %20) #6
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %170, %154
  %156 = load i32, ptr %20, 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 %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  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 %20, 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 %20, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %20, 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: 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

; 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 = ashr i32 %1, 1
  %11 = icmp sgt i32 %1, 2
  br i1 %11, label %.lr.ph72.preheader, label %.preheader64

.lr.ph72.preheader:                               ; preds = %3
  %12 = add nsw i32 %1, -1
  %wide.trip.count = zext nneg i32 %12 to i64
  br label %.lr.ph72

.preheader64:                                     ; preds = %._crit_edge, %3
  %13 = icmp sgt i32 %1, 1
  br i1 %13, label %.lr.ph83, label %._crit_edge84

.lr.ph83:                                         ; preds = %.preheader64
  %14 = sitofp i32 %2 to double
  %15 = zext nneg i32 %1 to i64
  br label %.lr.ph79.us

.lr.ph79.us:                                      ; preds = %._crit_edge80.us, %.lr.ph83
  %.05881.us = phi i32 [ 1, %.lr.ph83 ], [ %29, %._crit_edge80.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #6
  %16 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !5
  %17 = sitofp i32 %.05881.us to x86_fp80
  %18 = fdiv x86_fp80 %16, %17
  %19 = fptrunc x86_fp80 %18 to double
  %20 = call double @cos(double noundef %19) #6
  %21 = fpext double %20 to x86_fp80
  %22 = load x86_fp80, ptr @_ZL2pi, align 16, !tbaa !5
  %23 = fdiv x86_fp80 %22, %17
  %24 = fptrunc x86_fp80 %23 to double
  %25 = call double @sin(double noundef %24) #6
  %26 = fmul double %25, %14
  %27 = fpext double %26 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef %21, x86_fp80 noundef %27)
  %28 = icmp sgt i32 %.05881.us, 0
  %29 = shl i32 %.05881.us, 1
  br i1 %28, label %.lr.ph75.us.us.preheader, label %.lr.ph79.split.us87

.lr.ph75.us.us.preheader:                         ; preds = %.lr.ph79.us
  %30 = zext nneg i32 %.05881.us to i64
  %31 = sext i32 %29 to i64
  %wide.trip.count96 = zext nneg i32 %.05881.us to i64
  %invariant.gep = getelementptr %struct.complex, ptr %0, i64 %30
  br label %.lr.ph75.us.us

.lr.ph79.split.us87:                              ; preds = %.lr.ph79.us, %.lr.ph79.split.us87
  %.05777.us85 = phi i32 [ %32, %.lr.ph79.split.us87 ], [ 0, %.lr.ph79.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
  %32 = add nsw i32 %.05777.us85, %29
  %33 = icmp slt i32 %32, %1
  br i1 %33, label %.lr.ph79.split.us87, label %._crit_edge80.us, !llvm.loop !9

._crit_edge80.us:                                 ; preds = %.lr.ph79.split.us87, %._crit_edge76.us.us
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #6
  %34 = icmp slt i32 %29, %1
  br i1 %34, label %.lr.ph79.us, label %._crit_edge84, !llvm.loop !11

.lr.ph75.us.us:                                   ; preds = %.lr.ph75.us.us.preheader, %._crit_edge76.us.us
  %indvars.iv98 = phi i64 [ 0, %.lr.ph75.us.us.preheader ], [ %indvars.iv.next99, %._crit_edge76.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 %35

35:                                               ; preds = %35, %.lr.ph75.us.us
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %35 ], [ 0, %.lr.ph75.us.us ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %36 = add nsw i64 %indvars.iv93, %indvars.iv98
  %gep = getelementptr %struct.complex, ptr %invariant.gep, i64 %36
  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
  %37 = getelementptr inbounds %struct.complex, ptr %0, i64 %36
  call void @_ZmiRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %7, ptr noundef nonnull align 16 dereferenceable(32) %37, 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 !12
  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) %37, ptr noundef nonnull align 16 dereferenceable(32) %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %37, ptr noundef nonnull align 16 dereferenceable(32) %8, i64 32, i1 false), !tbaa.struct !12
  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.next94 = add nuw nsw i64 %indvars.iv93, 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 !12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #6
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %._crit_edge76.us.us, label %35, !llvm.loop !13

._crit_edge76.us.us:                              ; preds = %35
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  %indvars.iv.next99 = add nsw i64 %indvars.iv98, %31
  %38 = icmp slt i64 %indvars.iv.next99, %15
  br i1 %38, label %.lr.ph75.us.us, label %._crit_edge80.us, !llvm.loop !9

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 1, %.lr.ph72.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %.06070 = phi i32 [ %10, %.lr.ph72.preheader ], [ %47, %._crit_edge ]
  %39 = sext i32 %.06070 to i64
  %40 = icmp slt i64 %indvars.iv, %39
  br i1 %40, label %41, label %44

41:                                               ; preds = %.lr.ph72
  %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
  br label %44

44:                                               ; preds = %41, %.lr.ph72
  %.not65 = icmp slt i32 %.06070, %10
  br i1 %.not65, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %44, %.lr.ph
  %.05967 = phi i32 [ %46, %.lr.ph ], [ %10, %44 ]
  %.166 = phi i32 [ %45, %.lr.ph ], [ %.06070, %44 ]
  %45 = sub nsw i32 %.166, %.05967
  %46 = lshr i32 %.05967, 1
  %.not = icmp slt i32 %45, %46
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph, %44
  %.1.lcssa = phi i32 [ %.06070, %44 ], [ %45, %.lr.ph ]
  %.059.lcssa = phi i32 [ %10, %44 ], [ %46, %.lr.ph ]
  %47 = add nsw i32 %.059.lcssa, %.1.lcssa
  %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 %.preheader64, label %.lr.ph72, !llvm.loop !15

._crit_edge84:                                    ; preds = %._crit_edge80.us, %.preheader64
  %48 = icmp eq i32 %2, -1
  %49 = icmp sgt i32 %1, 0
  %or.cond = and i1 %48, %49
  br i1 %or.cond, label %.lr.ph89, label %.loopexit

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

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

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

.loopexit.loopexit.unr-lcssa:                     ; preds = %52, %.lr.ph89
  %indvars.iv101.unr = phi i64 [ 0, %.lr.ph89 ], [ %indvars.iv.next102.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.iv101.epil = phi i64 [ %indvars.iv.next102.epil, %.epil.preheader ], [ %indvars.iv101.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.iv101.epil
  %66 = load x86_fp80, ptr %65, align 16, !tbaa !16
  %67 = fdiv x86_fp80 %66, %50
  store x86_fp80 %67, ptr %65, align 16, !tbaa !16
  %indvars.iv.next102.epil = add nuw nsw i64 %indvars.iv101.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 !19

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge84
  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 = !{!"long double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{i64 0, i64 16, !5, i64 16, i64 16, !5}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS7complex", !6, i64 0, !6, i64 16}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !20}
!20 = !{!"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