; LLVM IR from tangjz/acm-icpc :: Summer_Training/2016-07-19/upsolved/H - Shell Necklace - tjz.ll (Z5solveii)

; 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 }

@x = external dso_local global [131072 x %struct.complex], align 16
@y = external dso_local global [131072 x %struct.complex], align 16
@f = external dso_local global [100001 x i32], align 16
@g = external dso_local global [100001 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3FFTP7complexii(ptr noundef, i32 noundef, i32 noundef) #0

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

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

; 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 #2 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveii(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.complex, align 16
  %10 = alloca %struct.complex, align 16
  %11 = alloca i32, align 4
  %12 = alloca %struct.complex, align 16
  %13 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = icmp eq i32 %14, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  br label %137

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = add nsw i32 %19, %20
  %22 = ashr i32 %21, 1
  store i32 %22, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z5solveii(i32 noundef %23, i32 noundef %24)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sub nsw i32 %25, %26
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %7, align 4, !tbaa !5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %29

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

33:                                               ; preds = %29
  br label %34

34:                                               ; preds = %33
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = shl i32 %35, 1
  store i32 %36, ptr %6, align 4, !tbaa !5
  br label %29, !llvm.loop !9

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %76, %37
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %79

43:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #4
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %47, label %53

47:                                               ; preds = %43
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sitofp i32 %51 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %9, x86_fp80 noundef %52, x86_fp80 noundef 0xK00000000000000000000)
  br label %54

53:                                               ; preds = %43
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %9, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  br label %54

54:                                               ; preds = %53, %47
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %56
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %57, ptr align 16 %9, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #4
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = add nsw i32 %58, %59
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %63, label %71

63:                                               ; preds = %54
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %64, %65
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sitofp i32 %69 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %10, x86_fp80 noundef %70, x86_fp80 noundef 0xK00000000000000000000)
  br label %72

71:                                               ; preds = %54
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %10, x86_fp80 noundef 0xK00000000000000000000, x86_fp80 noundef 0xK00000000000000000000)
  br label %72

72:                                               ; preds = %71, %63
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [131072 x %struct.complex], ptr @y, i64 0, i64 %74
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %75, ptr align 16 %10, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #4
  br label %76

76:                                               ; preds = %72
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !5
  br label %38, !llvm.loop !14

79:                                               ; preds = %42
  %80 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3FFTP7complexii(ptr noundef @x, i32 noundef %80, i32 noundef 1)
  %81 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3FFTP7complexii(ptr noundef @y, i32 noundef %81, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %97, %79
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %100

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #4
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %89
  %91 = load i32, ptr %11, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [131072 x %struct.complex], ptr @y, i64 0, i64 %92
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %12, ptr noundef nonnull align 16 dereferenceable(32) %90, ptr noundef nonnull align 16 dereferenceable(32) %93)
  %94 = load i32, ptr %11, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %95
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %96, ptr align 16 %12, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #4
  br label %97

97:                                               ; preds = %87
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %11, align 4, !tbaa !5
  br label %82, !llvm.loop !15

100:                                              ; preds = %86
  %101 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z3FFTP7complexii(ptr noundef @x, i32 noundef %101, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %13, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %130, %100
  %105 = load i32, ptr %13, align 4, !tbaa !5
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %133

109:                                              ; preds = %104
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = sub nsw i32 %115, %116
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %118
  %120 = getelementptr inbounds %struct.complex, ptr %119, i32 0, i32 0
  %121 = load x86_fp80, ptr %120, align 16, !tbaa !16
  %122 = fadd x86_fp80 %121, 0xK3FFE8000000000000000
  %123 = fptosi x86_fp80 %122 to i64
  %124 = add nsw i64 %114, %123
  %125 = srem i64 %124, 313
  %126 = trunc i64 %125 to i32
  %127 = load i32, ptr %13, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %128
  store i32 %126, ptr %129, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %109
  %131 = load i32, ptr %13, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %13, align 4, !tbaa !5
  br label %104, !llvm.loop !18

133:                                              ; preds = %108
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z5solveii(i32 noundef %135, i32 noundef %136)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %137

137:                                              ; preds = %133, %17
  ret void
}

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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

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


; 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 }

@x = external dso_local global [131072 x %struct.complex], align 16
@y = external dso_local global [131072 x %struct.complex], align 16
@f = external dso_local local_unnamed_addr global [100001 x i32], align 16
@g = external dso_local local_unnamed_addr global [100001 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3FFTP7complexii(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; 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 nounwind uwtable
declare dso_local void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32), x86_fp80 noundef, x86_fp80 noundef) unnamed_addr #2 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.complex, align 16
  %4 = alloca %struct.complex, align 16
  %5 = alloca %struct.complex, align 16
  %6 = icmp eq i32 %0, %1
  br i1 %6, label %47, label %7

7:                                                ; preds = %2
  %8 = add nsw i32 %1, %0
  %9 = ashr i32 %8, 1
  tail call void @_Z5solveii(i32 noundef %0, i32 noundef %9)
  %10 = sub nsw i32 %1, %0
  br label %11

11:                                               ; preds = %11, %7
  %.045 = phi i32 [ 1, %7 ], [ %12, %11 ]
  %.not = icmp sgt i32 %.045, %10
  %12 = shl i32 %.045, 1
  br i1 %.not, label %.preheader, label %11, !llvm.loop !5

.preheader:                                       ; preds = %11
  %13 = icmp sgt i32 %.045, 0
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge57.critedge

.lr.ph.preheader:                                 ; preds = %.preheader
  %14 = sext i32 %10 to i64
  %15 = sext i32 %0 to i64
  %16 = sext i32 %9 to i64
  %wide.trip.count = zext nneg i32 %.045 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %28
  call void @_Z3FFTP7complexii(ptr noundef nonnull @x, i32 noundef %.045, i32 noundef 1)
  call void @_Z3FFTP7complexii(ptr noundef nonnull @y, i32 noundef %.045, i32 noundef 1)
  br i1 %13, label %.lr.ph56.preheader, label %._crit_edge57

.lr.ph56.preheader:                               ; preds = %._crit_edge
  %wide.trip.count67 = zext nneg i32 %.045 to i64
  br label %.lr.ph56

.lr.ph:                                           ; preds = %.lr.ph.preheader, %28
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %28 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  %.not51 = icmp sgt i64 %indvars.iv, %14
  br i1 %.not51, label %21, label %17

17:                                               ; preds = %.lr.ph
  %18 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv
  %19 = load i32, ptr %18, align 4, !tbaa !7
  %20 = sitofp i32 %19 to x86_fp80
  br label %21

21:                                               ; preds = %.lr.ph, %17
  %.sink = phi x86_fp80 [ %20, %17 ], [ 0xK00000000000000000000, %.lr.ph ]
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %3, x86_fp80 noundef %.sink, x86_fp80 noundef 0xK00000000000000000000)
  %22 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %22, ptr noundef nonnull align 16 dereferenceable(32) %3, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  %23 = add nsw i64 %indvars.iv, %15
  %.not52 = icmp sgt i64 %23, %16
  br i1 %.not52, label %28, label %24

24:                                               ; preds = %21
  %25 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %23
  %26 = load i32, ptr %25, align 4, !tbaa !7
  %27 = sitofp i32 %26 to x86_fp80
  br label %28

28:                                               ; preds = %21, %24
  %.sink73 = phi x86_fp80 [ %27, %24 ], [ 0xK00000000000000000000, %21 ]
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %4, x86_fp80 noundef %.sink73, x86_fp80 noundef 0xK00000000000000000000)
  %29 = getelementptr inbounds [131072 x %struct.complex], ptr @y, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %29, ptr noundef nonnull align 16 dereferenceable(32) %4, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  %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 %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge57.critedge:                           ; preds = %.preheader
  tail call void @_Z3FFTP7complexii(ptr noundef nonnull @x, i32 noundef %.045, i32 noundef 1)
  tail call void @_Z3FFTP7complexii(ptr noundef nonnull @y, i32 noundef %.045, i32 noundef 1)
  br label %._crit_edge57

._crit_edge57:                                    ; preds = %.lr.ph56, %._crit_edge57.critedge, %._crit_edge
  call void @_Z3FFTP7complexii(ptr noundef nonnull @x, i32 noundef %.045, i32 noundef -1)
  %30 = add nsw i32 %9, 1
  %.not5058.not = icmp slt i32 %9, %1
  br i1 %.not5058.not, label %.lr.ph61.preheader, label %._crit_edge62

.lr.ph61.preheader:                               ; preds = %._crit_edge57
  %narrow = add nsw i32 %9, 1
  %31 = sext i32 %narrow to i64
  %32 = sext i32 %0 to i64
  %33 = add i32 %1, 1
  br label %.lr.ph61

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %.lr.ph56
  %indvars.iv64 = phi i64 [ 0, %.lr.ph56.preheader ], [ %indvars.iv.next65, %.lr.ph56 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  %34 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %indvars.iv64
  %35 = getelementptr inbounds [131072 x %struct.complex], ptr @y, i64 0, i64 %indvars.iv64
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %5, ptr noundef nonnull align 16 dereferenceable(32) %34, ptr noundef nonnull align 16 dereferenceable(32) %35)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %34, ptr noundef nonnull align 16 dereferenceable(32) %5, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count67
  br i1 %exitcond68.not, label %._crit_edge57, label %.lr.ph56, !llvm.loop !15

._crit_edge62:                                    ; preds = %.lr.ph61, %._crit_edge57
  call void @_Z5solveii(i32 noundef %30, i32 noundef %1)
  br label %47

.lr.ph61:                                         ; preds = %.lr.ph61.preheader, %.lr.ph61
  %indvars.iv69 = phi i64 [ %31, %.lr.ph61.preheader ], [ %indvars.iv.next70, %.lr.ph61 ]
  %36 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %indvars.iv69
  %37 = load i32, ptr %36, align 4, !tbaa !7
  %38 = sext i32 %37 to i64
  %39 = sub nsw i64 %indvars.iv69, %32
  %40 = getelementptr inbounds [131072 x %struct.complex], ptr @x, i64 0, i64 %39
  %41 = load x86_fp80, ptr %40, align 16, !tbaa !16
  %42 = fadd x86_fp80 %41, 0xK3FFE8000000000000000
  %43 = fptosi x86_fp80 %42 to i64
  %44 = add nsw i64 %43, %38
  %45 = srem i64 %44, 313
  %46 = trunc nsw i64 %45 to i32
  store i32 %46, ptr %36, align 4, !tbaa !7
  %indvars.iv.next70 = add nsw i64 %indvars.iv69, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next70 to i32
  %exitcond72.not = icmp eq i32 %33, %lftr.wideiv
  br i1 %exitcond72.not, label %._crit_edge62, label %.lr.ph61, !llvm.loop !18

47:                                               ; preds = %2, %._crit_edge62
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = 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 = !{i64 0, i64 16, !12, i64 16, i64 16, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long double", !9, i64 0}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = !{!17, !13, i64 0}
!17 = !{!"_ZTS7complex", !13, i64 0, !13, i64 16}
!18 = distinct !{!18, !6}


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