; LLVM IR from tangjz/acm-icpc :: hackerrank (emma-and-sum-of-products)

; 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 [3 x i8], align 1
@.str.3 = 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)
  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, 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
  %201 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @q)
  br label %202

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

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

215:                                              ; preds = %202
  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 [3 x i8], align 1
@.str.3 = 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)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %.preheader62

.preheader62:                                     ; 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, 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 %.preheader62, !llvm.loop !9

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

.preheader61:                                     ; 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.ph66.preheader, label %._crit_edge83

.lr.ph66.preheader:                               ; preds = %.preheader61
  %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 %.preheader60.unr-lcssa, label %.lr.ph66.preheader.new

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

.preheader60.unr-lcssa:                           ; preds = %52, %.lr.ph66.preheader
  %indvars.iv91.unr = phi i64 [ 0, %.lr.ph66.preheader ], [ %indvars.iv.next92.1, %52 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader60, label %.lr.ph66.epil

.lr.ph66.epil:                                    ; preds = %.preheader60.unr-lcssa
  %22 = icmp slt i64 %indvars.iv91.unr, %20
  br i1 %22, label %25, label %23

23:                                               ; preds = %.lr.ph66.epil
  %24 = shl nuw i64 %indvars.iv91.unr, 1
  br label %.preheader60.epilog-lcssa

25:                                               ; preds = %.lr.ph66.epil
  %26 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %indvars.iv91.unr
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = shl nuw i64 %indvars.iv91.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 %.preheader60.epilog-lcssa

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

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

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

34:                                               ; preds = %.lr.ph66
  %35 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %indvars.iv91
  %36 = load i32, ptr %35, align 8, !tbaa !5
  %37 = shl nuw i64 %indvars.iv91, 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.ph66.1

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

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

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

46:                                               ; preds = %.lr.ph66.1
  %47 = getelementptr inbounds [65536 x i32], ptr @a, i64 0, i64 %indvars.iv.next92
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = shl nuw i64 %indvars.iv.next92, 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
  %.sink120.1 = phi i64 [ %51, %46 ], [ %45, %44 ]
  %53 = getelementptr inbounds [131072 x i32], ptr @f, i64 0, i64 %.sink120.1
  store i32 1, ptr %53, align 4, !tbaa !5
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91, 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 %.preheader60.unr-lcssa, label %.lr.ph66, !llvm.loop !12

.preheader59:                                     ; preds = %.preheader60, %._crit_edge80
  %54 = phi i32 [ %62, %._crit_edge80 ], [ %15, %.preheader60 ]
  %.05382 = phi i32 [ %63, %._crit_edge80 ], [ 4, %.preheader60 ]
  %.05481 = phi i32 [ %.05382, %._crit_edge80 ], [ 2, %.preheader60 ]
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.preheader58.lr.ph, label %._crit_edge80

.preheader58.lr.ph:                               ; preds = %.preheader59
  %56 = icmp sgt i32 %.05382, 0
  %57 = sext i32 %.05481 to i64
  %58 = sext i32 %.05382 to i64
  %wide.trip.count97 = zext i32 %.05382 to i64
  %wide.trip.count102 = zext nneg i32 %.05382 to i64
  %wide.trip.count107 = zext nneg i32 %.05382 to i64
  br label %.preheader58

._crit_edge83:                                    ; preds = %._crit_edge80, %.preheader61, %.preheader60
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
  %60 = load i32, ptr @q, align 4, !tbaa !5
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr @q, align 4, !tbaa !5
  %.not84 = icmp eq i32 %60, 0
  br i1 %.not84, label %._crit_edge87, label %.lr.ph86

.preheader58:                                     ; preds = %.preheader58.lr.ph, %._crit_edge78
  %indvars.iv114 = phi i64 [ 0, %.preheader58.lr.ph ], [ %indvars.iv.next115, %._crit_edge78 ]
  br i1 %56, label %.lr.ph68, label %._crit_edge74.thread.critedge

._crit_edge80:                                    ; preds = %._crit_edge78, %.preheader59
  %62 = phi i32 [ %54, %.preheader59 ], [ %87, %._crit_edge78 ]
  %63 = shl i32 %.05382, 1
  %64 = icmp slt i32 %.05382, %62
  br i1 %64, label %.preheader59, label %._crit_edge83, !llvm.loop !13

.preheader:                                       ; preds = %71
  br i1 %56, label %.lr.ph70, label %._crit_edge74.thread.critedge

.lr.ph70:                                         ; preds = %.preheader
  %65 = add nsw i64 %indvars.iv114, %57
  br label %75

.lr.ph68:                                         ; preds = %.preheader58, %71
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %71 ], [ 0, %.preheader58 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #6
  %66 = icmp slt i64 %indvars.iv94, %57
  br i1 %66, label %67, label %71

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

71:                                               ; preds = %.lr.ph68, %67
  %72 = phi i32 [ %70, %67 ], [ 0, %.lr.ph68 ]
  %73 = sitofp i32 %72 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %1, x86_fp80 noundef %73, x86_fp80 noundef 0xK00000000000000000000)
  %74 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %indvars.iv94
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %74, 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.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97
  br i1 %exitcond98.not, label %.preheader, label %.lr.ph68, !llvm.loop !18

._crit_edge:                                      ; preds = %81
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTx, i32 noundef %.05382, i32 noundef 1)
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTy, i32 noundef %.05382, i32 noundef 1)
  br i1 %56, label %.lr.ph73, label %._crit_edge74.thread

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

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

75:                                               ; preds = %.lr.ph70, %81
  %indvars.iv99 = phi i64 [ 0, %.lr.ph70 ], [ %indvars.iv.next100, %81 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  %76 = icmp slt i64 %indvars.iv99, %57
  br i1 %76, label %77, label %81

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

81:                                               ; preds = %75, %77
  %82 = phi i32 [ %80, %77 ], [ 0, %75 ]
  %83 = sitofp i32 %82 to x86_fp80
  call void @_ZN7complexC2Eee(ptr noundef nonnull align 16 dereferenceable(32) %2, x86_fp80 noundef %83, x86_fp80 noundef 0xK00000000000000000000)
  %84 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTy, i64 0, i64 %indvars.iv99
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %84, 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.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102
  br i1 %exitcond103.not, label %._crit_edge, label %75, !llvm.loop !19

._crit_edge74:                                    ; preds = %.lr.ph73
  call void @_Z3FFTP7complexii(ptr noundef nonnull @FFTx, i32 noundef %.05382, i32 noundef -1)
  br i1 %56, label %.lr.ph77, label %._crit_edge78

.lr.ph73:                                         ; preds = %._crit_edge, %.lr.ph73
  %indvars.iv104 = phi i64 [ %indvars.iv.next105, %.lr.ph73 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  %85 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTx, i64 0, i64 %indvars.iv104
  %86 = getelementptr inbounds [131072 x %struct.complex], ptr @FFTy, i64 0, i64 %indvars.iv104
  call void @_ZmlRK7complexS1_(ptr dead_on_unwind nonnull writable sret(%struct.complex) align 16 %3, ptr noundef nonnull align 16 dereferenceable(32) %85, ptr noundef nonnull align 16 dereferenceable(32) %86)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %85, 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.next105 = add nuw nsw i64 %indvars.iv104, 1
  %exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
  br i1 %exitcond108.not, label %._crit_edge74, label %.lr.ph73, !llvm.loop !20

._crit_edge78:                                    ; preds = %.lr.ph77, %._crit_edge74.thread, %._crit_edge74
  %indvars.iv.next115 = add nsw i64 %indvars.iv114, %58
  %87 = load i32, ptr @len, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next115, %88
  br i1 %89, label %.preheader58, label %._crit_edge80, !llvm.loop !21

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

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

._crit_edge87:                                    ; preds = %.lr.ph86, %._crit_edge83
  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