; LLVM IR from tangjz/acm-icpc :: 51nod (1348)

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

@FFTx = external dso_local global [131072 x %struct.complex], align 16
@FFTy = external dso_local global [131072 x %struct.complex], align 16
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@a = external dso_local global [65536 x i32], align 16
@len = external dso_local global i32, align 4
@f = external dso_local global [131072 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; 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 norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %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 i32, align 4
  %11 = alloca %struct.complex, align 16
  %12 = alloca i32, align 4
  %13 = alloca %struct.complex, align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %27, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %30

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @a, i64 %24
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %25)
  br label %27

27:                                               ; preds = %22
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !9

30:                                               ; preds = %21
  store i32 1, ptr @len, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %37, %30
  %32 = load i32, ptr @len, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = shl i32 %33, 1
  %35 = icmp slt i32 %32, %34
  br i1 %35, label %36, label %40

36:                                               ; preds = %31
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr @len, align 4, !tbaa !5
  %39 = shl i32 %38, 1
  store i32 %39, ptr @len, align 4, !tbaa !5
  br label %31, !llvm.loop !11

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %71, %40
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = load i32, ptr @len, align 4, !tbaa !5
  %44 = ashr i32 %43, 1
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %74

47:                                               ; preds = %41
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = load i32, ptr @n, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %65

51:                                               ; preds = %47
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = shl i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %58
  store i32 %55, ptr %59, align 4, !tbaa !5
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = shl i32 %60, 1
  %62 = or i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %63
  store i32 1, ptr %64, align 4, !tbaa !5
  br label %70

65:                                               ; preds = %47
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = shl i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %68
  store i32 1, ptr %69, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %65, %51
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %3, align 4, !tbaa !5
  br label %41, !llvm.loop !12

74:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 2, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = shl i32 %75, 1
  store i32 %76, ptr %5, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %196, %74
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = load i32, ptr @len, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %200

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %191, %82
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = load i32, ptr @len, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

87:                                               ; preds = %83
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %195

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

89:                                               ; preds = %112, %88
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = load i32, ptr %5, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %115

94:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #6
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %94
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = add nsw i32 %99, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  br label %106

105:                                              ; preds = %94
  br label %106

106:                                              ; preds = %105, %98
  %107 = phi i32 [ %104, %98 ], [ 0, %105 ]
  %108 = sitofp i32 %107 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %9, x86_fp80 noundef %108, x86_fp80 noundef 0xK00000000000000000000)
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %110
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %111, ptr align 16 %9, i64 32, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #6
  br label %112

112:                                              ; preds = %106
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %8, align 4, !tbaa !5
  br label %89, !llvm.loop !16

115:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %141, %115
  %117 = load i32, ptr %10, align 4, !tbaa !5
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %144

121:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #6
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %134

125:                                              ; preds = %121
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = add nsw i32 %126, %127
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = add nsw i32 %128, %129
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  br label %135

134:                                              ; preds = %121
  br label %135

135:                                              ; preds = %134, %125
  %136 = phi i32 [ %133, %125 ], [ 0, %134 ]
  %137 = sitofp i32 %136 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %11, x86_fp80 noundef %137, x86_fp80 noundef 0xK00000000000000000000)
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTy, i64 0, i64 %139
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %140, ptr align 16 %11, i64 32, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #6
  br label %141

141:                                              ; preds = %135
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %10, align 4, !tbaa !5
  br label %116, !llvm.loop !17

144:                                              ; preds = %120
  %145 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3FFTP7complexii(ptr noundef @FFTx, i32 noundef %145, i32 noundef 1)
  %146 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3FFTP7complexii(ptr noundef @FFTy, i32 noundef %146, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %162, %144
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = load i32, ptr %5, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 23, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %165

152:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %154
  %156 = load i32, ptr %12, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTy, i64 0, i64 %157
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind writable sret(%struct.complex) align 16 %13, ptr noundef nonnull align 16 dereferenceable(32) %155, ptr noundef nonnull align 16 dereferenceable(32) %158)
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %160
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %161, ptr align 16 %13, i64 32, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  br label %162

162:                                              ; preds = %152
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %12, align 4, !tbaa !5
  br label %147, !llvm.loop !18

165:                                              ; preds = %151
  %166 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3FFTP7complexii(ptr noundef @FFTx, i32 noundef %166, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %167

167:                                              ; preds = %187, %165
  %168 = load i32, ptr %14, align 4, !tbaa !5
  %169 = load i32, ptr %5, align 4, !tbaa !5
  %170 = icmp slt i32 %168, %169
  br i1 %170, label %172, label %171

171:                                              ; preds = %167
  store i32 26, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %190

172:                                              ; preds = %167
  %173 = load i32, ptr %14, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %174
  %176 = getelementptr inbounds %struct.complex, ptr %175, i32 0, i32 0
  %177 = load x86_fp80, ptr %176, align 16, !tbaa !19
  %178 = fadd x86_fp80 %177, 0xK3FFE8000000000000000
  %179 = fptosi x86_fp80 %178 to i64
  %180 = srem i64 %179, 100003
  %181 = trunc i64 %180 to i32
  %182 = load i32, ptr %7, align 4, !tbaa !5
  %183 = load i32, ptr %14, align 4, !tbaa !5
  %184 = add nsw i32 %182, %183
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %185
  store i32 %181, ptr %186, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %172
  %188 = load i32, ptr %14, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %14, align 4, !tbaa !5
  br label %167, !llvm.loop !21

190:                                              ; preds = %171
  br label %191

191:                                              ; preds = %190
  %192 = load i32, ptr %5, align 4, !tbaa !5
  %193 = load i32, ptr %7, align 4, !tbaa !5
  %194 = add nsw i32 %193, %192
  store i32 %194, ptr %7, align 4, !tbaa !5
  br label %83, !llvm.loop !22

195:                                              ; preds = %87
  br label %196

196:                                              ; preds = %195
  %197 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %197, ptr %4, align 4, !tbaa !5
  %198 = load i32, ptr %5, align 4, !tbaa !5
  %199 = shl i32 %198, 1
  store i32 %199, ptr %5, align 4, !tbaa !5
  br label %77, !llvm.loop !23

200:                                              ; preds = %81
  br label %201

201:                                              ; preds = %205, %200
  %202 = load i32, ptr @q, align 4, !tbaa !5
  %203 = add nsw i32 %202, -1
  store i32 %203, ptr @q, align 4, !tbaa !5
  %204 = icmp ne i32 %202, 0
  br i1 %204, label %205, label %214

205:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %206 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %15)
  %207 = load i32, ptr @n, align 4, !tbaa !5
  %208 = load i32, ptr %15, align 4, !tbaa !5
  %209 = sub nsw i32 %207, %208
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %212)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %201, !llvm.loop !24

214:                                              ; preds = %201
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #5

declare i32 @printf(ptr noundef, ...) #5

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

@FFTx = external dso_local global [131072 x %struct.complex], align 16
@FFTy = external dso_local global [131072 x %struct.complex], align 16
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@a = external dso_local global [65536 x i32], align 16
@len = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [131072 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; 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 norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %1 = alloca %struct.complex, align 16
  %2 = alloca %struct.complex, align 16
  %3 = alloca %struct.complex, align 16
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.preheader63

.preheader63:                                     ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %6, %0 ], [ %11, %.lr.ph ]
  %8 = shl i32 %.lcssa, 1
  br label %14

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = icmp slt i64 %indvars.iv.next, %12
  br i1 %13, label %.lr.ph, label %.preheader63, !llvm.loop !9

14:                                               ; preds = %14, %.preheader63
  %15 = phi i32 [ %17, %14 ], [ 1, %.preheader63 ]
  %16 = icmp slt i32 %15, %8
  %17 = shl i32 %15, 1
  br i1 %16, label %14, label %.preheader62, !llvm.loop !11

.preheader62:                                     ; preds = %14
  store i32 %15, ptr @len, align 4, !tbaa !5
  %18 = ashr i32 %15, 1
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph67.preheader, label %.preheader

.lr.ph67.preheader:                               ; preds = %.preheader62
  %20 = sext i32 %.lcssa to i64
  %wide.trip.count = zext nneg i32 %18 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %21 = icmp eq i32 %18, 1
  br i1 %21, label %.preheader61.unr-lcssa, label %.lr.ph67.preheader.new

.lr.ph67.preheader.new:                           ; preds = %.lr.ph67.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph67

.preheader61.unr-lcssa:                           ; preds = %52, %.lr.ph67.preheader
  %indvars.iv90.unr = phi i64 [ 0, %.lr.ph67.preheader ], [ %indvars.iv.next91.1, %52 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader61, label %.lr.ph67.epil

.lr.ph67.epil:                                    ; preds = %.preheader61.unr-lcssa
  %22 = icmp slt i64 %indvars.iv90.unr, %20
  br i1 %22, label %25, label %23

23:                                               ; preds = %.lr.ph67.epil
  %24 = shl nuw i64 %indvars.iv90.unr, 1
  br label %.preheader61.epilog-lcssa

25:                                               ; preds = %.lr.ph67.epil
  %26 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %indvars.iv90.unr
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = shl nuw i64 %indvars.iv90.unr, 1
  %29 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %28
  store i32 %27, ptr %29, align 8, !tbaa !5
  %30 = or disjoint i64 %28, 1
  br label %.preheader61.epilog-lcssa

.preheader61.epilog-lcssa:                        ; preds = %25, %23
  %.sink119.epil = phi i64 [ %30, %25 ], [ %24, %23 ]
  %31 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %.sink119.epil
  store i32 1, ptr %31, align 4, !tbaa !5
  br label %.preheader61

.preheader61:                                     ; preds = %.preheader61.unr-lcssa, %.preheader61.epilog-lcssa
  %32 = icmp sgt i32 %15, 2
  br i1 %32, label %.preheader60, label %.preheader

.lr.ph67:                                         ; preds = %52, %.lr.ph67.preheader.new
  %indvars.iv90 = phi i64 [ 0, %.lr.ph67.preheader.new ], [ %indvars.iv.next91.1, %52 ]
  %niter = phi i64 [ 0, %.lr.ph67.preheader.new ], [ %niter.next.1, %52 ]
  %33 = icmp slt i64 %indvars.iv90, %20
  br i1 %33, label %34, label %40

34:                                               ; preds = %.lr.ph67
  %35 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %indvars.iv90
  %36 = load i32, ptr %35, align 8, !tbaa !5
  %37 = shl nuw i64 %indvars.iv90, 1
  %38 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %37
  store i32 %36, ptr %38, align 16, !tbaa !5
  %39 = or disjoint i64 %37, 1
  br label %.lr.ph67.1

40:                                               ; preds = %.lr.ph67
  %41 = shl nuw i64 %indvars.iv90, 1
  br label %.lr.ph67.1

.lr.ph67.1:                                       ; preds = %34, %40
  %.sink119 = phi i64 [ %39, %34 ], [ %41, %40 ]
  %42 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %.sink119
  store i32 1, ptr %42, align 4, !tbaa !5
  %indvars.iv.next91 = or disjoint i64 %indvars.iv90, 1
  %43 = icmp slt i64 %indvars.iv.next91, %20
  br i1 %43, label %46, label %44

44:                                               ; preds = %.lr.ph67.1
  %45 = shl nuw i64 %indvars.iv.next91, 1
  br label %52

46:                                               ; preds = %.lr.ph67.1
  %47 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %indvars.iv.next91
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = shl nuw i64 %indvars.iv.next91, 1
  %50 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %49
  store i32 %48, ptr %50, align 8, !tbaa !5
  %51 = or disjoint i64 %49, 1
  br label %52

52:                                               ; preds = %46, %44
  %.sink119.1 = phi i64 [ %51, %46 ], [ %45, %44 ]
  %53 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %.sink119.1
  store i32 1, ptr %53, align 4, !tbaa !5
  %indvars.iv.next91.1 = add nuw nsw i64 %indvars.iv90, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader61.unr-lcssa, label %.lr.ph67, !llvm.loop !12

.preheader60:                                     ; preds = %.preheader61, %._crit_edge81
  %54 = phi i32 [ %61, %._crit_edge81 ], [ %15, %.preheader61 ]
  %.05383 = phi i32 [ %62, %._crit_edge81 ], [ 4, %.preheader61 ]
  %.05482 = phi i32 [ %.05383, %._crit_edge81 ], [ 2, %.preheader61 ]
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.preheader59.lr.ph, label %._crit_edge81

.preheader59.lr.ph:                               ; preds = %.preheader60
  %56 = icmp sgt i32 %.05383, 0
  %57 = sext i32 %.05482 to i64
  %58 = sext i32 %.05383 to i64
  %wide.trip.count96 = zext i32 %.05383 to i64
  %wide.trip.count101 = zext nneg i32 %.05383 to i64
  %wide.trip.count106 = zext nneg i32 %.05383 to i64
  br label %.preheader59

.preheader:                                       ; preds = %._crit_edge81, %.preheader62, %.preheader61
  %59 = load i32, ptr @q, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  store i32 %60, ptr @q, align 4, !tbaa !5
  %.not84 = icmp eq i32 %59, 0
  br i1 %.not84, label %._crit_edge86, label %.lr.ph85

.preheader59:                                     ; preds = %.preheader59.lr.ph, %._crit_edge79
  %indvars.iv113 = phi i64 [ 0, %.preheader59.lr.ph ], [ %indvars.iv.next114, %._crit_edge79 ]
  br i1 %56, label %.lr.ph69, label %._crit_edge75.thread.critedge

._crit_edge81:                                    ; preds = %._crit_edge79, %.preheader60
  %61 = phi i32 [ %54, %.preheader60 ], [ %86, %._crit_edge79 ]
  %62 = shl i32 %.05383, 1
  %63 = icmp slt i32 %.05383, %61
  br i1 %63, label %.preheader60, label %.preheader, !llvm.loop !13

.preheader58:                                     ; preds = %70
  br i1 %56, label %.lr.ph71, label %._crit_edge75.thread.critedge

.lr.ph71:                                         ; preds = %.preheader58
  %64 = add nsw i64 %indvars.iv113, %57
  br label %74

.lr.ph69:                                         ; preds = %.preheader59, %70
  %indvars.iv93 = phi i64 [ %indvars.iv.next94, %70 ], [ 0, %.preheader59 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  %65 = icmp slt i64 %indvars.iv93, %57
  br i1 %65, label %66, label %70

66:                                               ; preds = %.lr.ph69
  %67 = add nsw i64 %indvars.iv93, %indvars.iv113
  %68 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %.lr.ph69, %66
  %71 = phi i32 [ %69, %66 ], [ 0, %.lr.ph69 ]
  %72 = sitofp i32 %71 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %1, x86_fp80 noundef %72, x86_fp80 noundef 0xK00000000000000000000)
  %73 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %indvars.iv93
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %73, ptr noundef nonnull align 16 dereferenceable(32) %1, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #6
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %.preheader58, label %.lr.ph69, !llvm.loop !18

._crit_edge:                                      ; preds = %80
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTx, i32 noundef %.05383, i32 noundef 1)
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTy, i32 noundef %.05383, i32 noundef 1)
  br i1 %56, label %.lr.ph74, label %._crit_edge75.thread

._crit_edge75.thread.critedge:                    ; preds = %.preheader58, %.preheader59
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTx, i32 noundef %.05383, i32 noundef 1)
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTy, i32 noundef %.05383, i32 noundef 1)
  br label %._crit_edge75.thread

._crit_edge75.thread:                             ; preds = %._crit_edge75.thread.critedge, %._crit_edge
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTx, i32 noundef %.05383, i32 noundef -1)
  br label %._crit_edge79

74:                                               ; preds = %.lr.ph71, %80
  %indvars.iv98 = phi i64 [ 0, %.lr.ph71 ], [ %indvars.iv.next99, %80 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  %75 = icmp slt i64 %indvars.iv98, %57
  br i1 %75, label %76, label %80

76:                                               ; preds = %74
  %77 = add nsw i64 %64, %indvars.iv98
  %78 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %74, %76
  %81 = phi i32 [ %79, %76 ], [ 0, %74 ]
  %82 = sitofp i32 %81 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %2, x86_fp80 noundef %82, x86_fp80 noundef 0xK00000000000000000000)
  %83 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTy, i64 0, i64 %indvars.iv98
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %83, ptr noundef nonnull align 16 dereferenceable(32) %2, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
  br i1 %exitcond102.not, label %._crit_edge, label %74, !llvm.loop !19

._crit_edge75:                                    ; preds = %.lr.ph74
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTx, i32 noundef %.05383, i32 noundef -1)
  br i1 %56, label %.lr.ph78, label %._crit_edge79

.lr.ph74:                                         ; preds = %._crit_edge, %.lr.ph74
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %.lr.ph74 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %84 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %indvars.iv103
  %85 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTy, i64 0, i64 %indvars.iv103
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %3, ptr noundef nonnull align 16 dereferenceable(32) %84, ptr noundef nonnull align 16 dereferenceable(32) %85)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %84, ptr noundef nonnull align 16 dereferenceable(32) %3, i64 32, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %exitcond107.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count106
  br i1 %exitcond107.not, label %._crit_edge75, label %.lr.ph74, !llvm.loop !20

._crit_edge79:                                    ; preds = %.lr.ph78, %._crit_edge75.thread, %._crit_edge75
  %indvars.iv.next114 = add nsw i64 %indvars.iv113, %58
  %86 = load i32, ptr @len, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = icmp slt i64 %indvars.iv.next114, %87
  br i1 %88, label %.preheader59, label %._crit_edge81, !llvm.loop !21

.lr.ph78:                                         ; preds = %._crit_edge75, %.lr.ph78
  %indvars.iv108 = phi i64 [ %indvars.iv.next109.1, %.lr.ph78 ], [ 0, %._crit_edge75 ]
  %niter129 = phi i64 [ %niter129.next.1, %.lr.ph78 ], [ 0, %._crit_edge75 ]
  %89 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %indvars.iv108
  %90 = load x86_fp80, ptr %89, align 16, !tbaa !22
  %91 = fadd x86_fp80 %90, 0xK3FFE8000000000000000
  %92 = fptosi x86_fp80 %91 to i64
  %93 = srem i64 %92, 100003
  %94 = trunc nsw i64 %93 to i32
  %95 = add nsw i64 %indvars.iv108, %indvars.iv113
  %96 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %95
  store i32 %94, ptr %96, align 8, !tbaa !5
  %indvars.iv.next109 = or disjoint i64 %indvars.iv108, 1
  %97 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %indvars.iv.next109
  %98 = load x86_fp80, ptr %97, align 16, !tbaa !22
  %99 = fadd x86_fp80 %98, 0xK3FFE8000000000000000
  %100 = fptosi x86_fp80 %99 to i64
  %101 = srem i64 %100, 100003
  %102 = trunc nsw i64 %101 to i32
  %103 = add nsw i64 %indvars.iv.next109, %indvars.iv113
  %104 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %103
  store i32 %102, ptr %104, align 4, !tbaa !5
  %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2
  %niter129.next.1 = add i64 %niter129, 2
  %niter129.ncmp.1 = icmp eq i64 %niter129.next.1, %wide.trip.count96
  br i1 %niter129.ncmp.1, label %._crit_edge79, label %.lr.ph78, !llvm.loop !24

.lr.ph85:                                         ; preds = %.preheader, %.lr.ph85
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %105 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %4)
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = sub nsw i32 %106, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %111)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %113 = load i32, ptr @q, align 4, !tbaa !5
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr @q, align 4, !tbaa !5
  %.not = icmp eq i32 %113, 0
  br i1 %.not, label %._crit_edge86, label %.lr.ph85, !llvm.loop !25

._crit_edge86:                                    ; preds = %.lr.ph85, %.preheader
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5

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 = { mustprogress norecurse 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 = { nofree 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!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, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = !{!23, !17, i64 0}
!23 = !{!"_ZTS7complex", !17, i64 0, !17, i64 16}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}


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