; LLVM IR from ADJA/algos :: Graphs (LCABinary)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@qn = external dso_local global i32, align 4
@g = external dso_local global [405000 x %"class.std::vector"], align 16
@a = external dso_local global [405000 x i32], align 16
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@z = external dso_local global i32, align 4
@ans = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(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 noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @qn)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %29, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

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

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %3)
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [405000 x %"class.std::vector"], ptr @g, i64 0, i64 %22
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [405000 x %"class.std::vector"], ptr @g, i64 0, i64 %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %4, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %29

29:                                               ; preds = %16
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

32:                                               ; preds = %15
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 1)
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef getelementptr inbounds ([405000 x i32], ptr @a, i64 0, i64 1), ptr noundef getelementptr inbounds ([405000 x i32], ptr @a, i64 0, i64 2))
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef @x, ptr noundef @y, ptr noundef @z)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 3, ptr %5, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %74, %32
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr @qn, align 4, !tbaa !5
  %38 = mul nsw i32 2, %37
  %39 = icmp sle i32 %36, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %77

41:                                               ; preds = %35
  %42 = load i32, ptr @x, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = mul nsw i64 1, %43
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 2
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = mul nsw i64 %44, %50
  %52 = load i32, ptr @y, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 1, %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sub nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = mul nsw i64 %54, %60
  %62 = add nsw i64 %51, %61
  %63 = load i32, ptr @z, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = mul nsw i64 1, %64
  %66 = add nsw i64 %62, %65
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = srem i64 %66, %68
  %70 = trunc i64 %69 to i32
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %72
  store i32 %70, ptr %73, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %41
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %5, align 4, !tbaa !5
  br label %35, !llvm.loop !11

77:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %78 = load i32, ptr getelementptr inbounds ([405000 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  store i32 %78, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %79 = load i32, ptr getelementptr inbounds ([405000 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !5
  store i32 %79, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %113, %77
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = load i32, ptr @qn, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %116

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = call noundef i32 @_Z3lcaii(i32 noundef %87, i32 noundef %89)
  %91 = sub nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !5
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = load i64, ptr @ans, align 8, !tbaa !12
  %95 = add nsw i64 %94, %93
  store i64 %95, ptr @ans, align 8, !tbaa !12
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  %98 = mul nsw i32 2, %97
  %99 = sub nsw i32 %98, 1
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %102, %103
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %106 = srem i32 %104, %105
  store i32 %106, ptr %6, align 4, !tbaa !5
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  %109 = mul nsw i32 2, %108
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  store i32 %112, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %113

113:                                              ; preds = %85
  %114 = load i32, ptr %8, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %8, align 4, !tbaa !5
  br label %80, !llvm.loop !14

116:                                              ; preds = %84
  %117 = load i64, ptr @ans, align 8, !tbaa !12
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %117)
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %118, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 #4 = { "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 = { inlinehint 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 #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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@qn = external dso_local global i32, align 4
@g = external dso_local global [405000 x %"class.std::vector"], align 16
@a = external dso_local global [405000 x i32], align 16
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@z = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(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 noundef i32 @_Z3lcaii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @qn)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 1
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @_Z3dfsii(i32 noundef 1, i32 noundef 1)
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 4), ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 8))
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @z)
  %8 = load i32, ptr @qn, align 4, !tbaa !5
  %.not23 = icmp slt i32 %8, 2
  br i1 %.not23, label %._crit_edge27, label %.lr.ph26

.lr.ph26:                                         ; preds = %._crit_edge
  %9 = shl nuw i32 %8, 1
  %10 = load i32, ptr @x, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = load i32, ptr @y, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = load i32, ptr @z, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %smax = call i32 @llvm.smax.i32(i32 %9, i32 3)
  %.pre = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  %.pre42 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !5
  %18 = zext nneg i32 %smax to i64
  %xtraiter = and i64 %18, 1
  %19 = icmp eq i32 %smax, 3
  br i1 %19, label %._crit_edge27.loopexit.unr-lcssa, label %.lr.ph26.new

.lr.ph26.new:                                     ; preds = %.lr.ph26
  %20 = and i64 %18, 2147483646
  %21 = add nsw i64 %20, -4
  br label %43

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1)
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %1, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = getelementptr inbounds [405000 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv.next
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [405000 x %"class.std::vector"], ptr @g, i64 0, i64 %27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %29 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %29, ptr %2, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = icmp slt i64 %indvars.iv.next, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge27.loopexit.unr-lcssa:                 ; preds = %43, %.lr.ph26
  %.unr = phi i32 [ %.pre42, %.lr.ph26 ], [ %62, %43 ]
  %.unr44 = phi i32 [ %.pre, %.lr.ph26 ], [ %53, %43 ]
  %indvars.iv36.unr = phi i64 [ 3, %.lr.ph26 ], [ %indvars.iv.next37.1, %43 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge27, label %._crit_edge27.loopexit.epilog-lcssa

._crit_edge27.loopexit.epilog-lcssa:              ; preds = %._crit_edge27.loopexit.unr-lcssa
  %33 = sext i32 %.unr44 to i64
  %34 = mul nsw i64 %33, %11
  %35 = sext i32 %.unr to i64
  %36 = mul nsw i64 %35, %13
  %37 = add nsw i64 %36, %34
  %38 = add nsw i64 %37, %15
  %39 = srem i64 %38, %17
  %40 = trunc nsw i64 %39 to i32
  %41 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %indvars.iv36.unr
  store i32 %40, ptr %41, align 4, !tbaa !5
  br label %._crit_edge27

._crit_edge27:                                    ; preds = %._crit_edge27.loopexit.epilog-lcssa, %._crit_edge27.loopexit.unr-lcssa, %._crit_edge
  %.not2128 = icmp slt i32 %8, 1
  br i1 %.not2128, label %._crit_edge27.._crit_edge34_crit_edge, label %.lr.ph33.preheader

._crit_edge27.._crit_edge34_crit_edge:            ; preds = %._crit_edge27
  %.pre43 = load i64, ptr @ans, align 8, !tbaa !11
  br label %._crit_edge34

.lr.ph33.preheader:                               ; preds = %._crit_edge27
  %42 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  br label %.lr.ph33

43:                                               ; preds = %43, %.lr.ph26.new
  %44 = phi i32 [ %.pre42, %.lr.ph26.new ], [ %62, %43 ]
  %45 = phi i32 [ %.pre, %.lr.ph26.new ], [ %53, %43 ]
  %indvars.iv36 = phi i64 [ 3, %.lr.ph26.new ], [ %indvars.iv.next37.1, %43 ]
  %niter = phi i64 [ 0, %.lr.ph26.new ], [ %niter.next.1, %43 ]
  %46 = sext i32 %45 to i64
  %47 = mul nsw i64 %46, %11
  %48 = sext i32 %44 to i64
  %49 = mul nsw i64 %48, %13
  %50 = add nsw i64 %49, %47
  %51 = add nsw i64 %50, %15
  %52 = srem i64 %51, %17
  %53 = trunc nsw i64 %52 to i32
  %54 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %indvars.iv36
  store i32 %53, ptr %54, align 4, !tbaa !5
  %indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
  %55 = sext i32 %44 to i64
  %56 = mul nsw i64 %55, %11
  %sext = shl i64 %52, 32
  %57 = ashr exact i64 %sext, 32
  %58 = mul nsw i64 %57, %13
  %59 = add nsw i64 %58, %56
  %60 = add nsw i64 %59, %15
  %61 = srem i64 %60, %17
  %62 = trunc nsw i64 %61 to i32
  %63 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %indvars.iv.next37
  store i32 %62, ptr %63, align 4, !tbaa !5
  %indvars.iv.next37.1 = add nuw nsw i64 %indvars.iv36, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter, %21
  br i1 %niter.ncmp.1, label %._crit_edge27.loopexit.unr-lcssa, label %43, !llvm.loop !13

._crit_edge34:                                    ; preds = %.lr.ph33, %._crit_edge27.._crit_edge34_crit_edge
  %64 = phi i64 [ %.pre43, %._crit_edge27.._crit_edge34_crit_edge ], [ %73, %.lr.ph33 ]
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %64)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph33:                                         ; preds = %.lr.ph33.preheader, %.lr.ph33
  %indvars.iv39 = phi i64 [ 1, %.lr.ph33.preheader ], [ %indvars.iv.next40, %.lr.ph33 ]
  %.018.in30 = phi ptr [ getelementptr inbounds (i8, ptr @a, i64 8), %.lr.ph33.preheader ], [ %81, %.lr.ph33 ]
  %.01929 = phi i32 [ %42, %.lr.ph33.preheader ], [ %80, %.lr.ph33 ]
  %.018 = load i32, ptr %.018.in30, align 4, !tbaa !5
  %67 = add nsw i32 %.01929, 1
  %68 = add nsw i32 %.018, 1
  %69 = call noundef i32 @_Z3lcaii(i32 noundef %67, i32 noundef %68)
  %70 = add nsw i32 %69, -1
  %71 = sext i32 %70 to i64
  %72 = load i64, ptr @ans, align 8, !tbaa !11
  %73 = add nsw i64 %72, %71
  store i64 %73, ptr @ans, align 8, !tbaa !11
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %74 = shl nuw nsw i64 %indvars.iv.next40, 1
  %75 = add nsw i64 %74, -1
  %76 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = add nsw i32 %77, %70
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = srem i32 %78, %79
  %81 = getelementptr inbounds [405000 x i32], ptr @a, i64 0, i64 %74
  %82 = load i32, ptr @qn, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %.not21.not = icmp slt i64 %indvars.iv39, %83
  br i1 %.not21.not, label %.lr.ph33, label %._crit_edge34, !llvm.loop !14
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

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 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 #4 = { 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 #5 = { inlinehint 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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