; LLVM IR from lzyrapx/Competitive-Programming :: Retired_code/CDQ Divide and Conquer/HDU 4742（三维偏序）.ll (Z3cdqii)

; 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.Query = type { i32, i32, i32, i32, i32, i32 }
%struct.DP = type { i32, i32 }

@a = external dso_local global [100010 x %struct.Query], align 16
@q = external dso_local global [100010 x %struct.Query], align 16
@dp = external dso_local global [100010 x %struct.DP], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6getmaxR2DPS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #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) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z5queryi(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5Cleari(i32 noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpy5QueryS_(ptr noundef byval(%struct.Query) align 8, ptr noundef byval(%struct.Query) align 8) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3cdqii(i32 noundef %0, i32 noundef %1) #2 {
  %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 %struct.DP, align 4
  %9 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  %10 = load i32, ptr %3, align 4, !tbaa !5
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = icmp sge i32 %10, %11
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  br label %126

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = add nsw i32 %15, %16
  %18 = ashr i32 %17, 1
  store i32 %18, ptr %5, align 4, !tbaa !5
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3cdqii(i32 noundef %19, i32 noundef %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %21 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %21, ptr %6, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %38, %14
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100010 x %struct.Query], ptr @a, i64 0, i64 %29
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %32
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %30, i64 24, i1 false), !tbaa.struct !9
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %35
  %37 = getelementptr inbounds %struct.Query, ptr %36, i32 0, i32 0
  store i32 0, ptr %37, align 8, !tbaa !10
  br label %38

38:                                               ; preds = %27
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %6, align 4, !tbaa !5
  br label %22, !llvm.loop !12

41:                                               ; preds = %26
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.Query, ptr @q, i64 %43
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.Query, ptr @q, i64 %46
  %48 = getelementptr inbounds %struct.Query, ptr %47, i64 1
  call void @_ZSt4sortIP5QueryPFbS0_S0_EEvT_S4_T0_(ptr noundef %44, ptr noundef %48, ptr noundef @_Z4cmpy5QueryS_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %49 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %49, ptr %7, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %94, %41
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = icmp sle i32 %51, %52
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %97

55:                                               ; preds = %50
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Query, ptr %58, i32 0, i32 5
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = icmp sle i32 %60, %61
  br i1 %62, label %63, label %76

63:                                               ; preds = %55
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.Query, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !15
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.Query, ptr %71, i32 0, i32 5
  %73 = load i32, ptr %72, align 4, !tbaa !14
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100010 x %struct.DP], ptr @dp, i64 0, i64 %74
  call void @_Z6updateiR2DP(i32 noundef %68, ptr noundef nonnull align 4 dereferenceable(8) %75)
  br label %93

76:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.Query, ptr %79, i32 0, i32 2
  %81 = load i32, ptr %80, align 8, !tbaa !15
  %82 = call i64 @_Z5queryi(i32 noundef %81)
  store i64 %82, ptr %8, align 4
  %83 = getelementptr inbounds %struct.DP, ptr %8, i32 0, i32 0
  %84 = load i32, ptr %83, align 4, !tbaa !16
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %83, align 4, !tbaa !16
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.Query, ptr %88, i32 0, i32 5
  %90 = load i32, ptr %89, align 4, !tbaa !14
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x %struct.DP], ptr @dp, i64 0, i64 %91
  call void @_Z6getmaxR2DPS0_(ptr noundef nonnull align 4 dereferenceable(8) %92, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %93

93:                                               ; preds = %76, %63
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %7, align 4, !tbaa !5
  br label %50, !llvm.loop !18

97:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %98 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %98, ptr %9, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %119, %97
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %122

104:                                              ; preds = %99
  %105 = load i32, ptr %9, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %106
  %108 = getelementptr inbounds %struct.Query, ptr %107, i32 0, i32 5
  %109 = load i32, ptr %108, align 4, !tbaa !14
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = icmp sle i32 %109, %110
  br i1 %111, label %112, label %118

112:                                              ; preds = %104
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.Query, ptr %115, i32 0, i32 2
  %117 = load i32, ptr %116, align 8, !tbaa !15
  call void @_Z5Cleari(i32 noundef %117)
  br label %118

118:                                              ; preds = %112, %104
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %9, align 4, !tbaa !5
  br label %99, !llvm.loop !19

122:                                              ; preds = %103
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  %125 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z3cdqii(i32 noundef %124, i32 noundef %125)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %126

126:                                              ; preds = %122, %13
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5QueryPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5, i64 16, i64 4, !5, i64 20, i64 4, !5}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!11, !6, i64 20}
!15 = !{!11, !6, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS2DP", !6, i64 0, !6, i64 4}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


; 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.Query = type { i32, i32, i32, i32, i32, i32 }
%struct.DP = type { i32, i32 }

@a = external dso_local local_unnamed_addr global [100010 x %struct.Query], align 16
@q = external dso_local global [100010 x %struct.Query], align 16
@dp = external dso_local global [100010 x %struct.DP], align 16

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6getmaxR2DPS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) 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) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z5queryi(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5Cleari(i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmpy5QueryS_(ptr noundef byval(%struct.Query) align 8, ptr noundef byval(%struct.Query) align 8) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z3cdqii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.DP, align 8
  %.not = icmp slt i32 %0, %1
  br i1 %.not, label %4, label %47

4:                                                ; preds = %2
  %5 = add nsw i32 %1, %0
  %6 = ashr i32 %5, 1
  tail call void @_Z3cdqii(i32 noundef %0, i32 noundef %6)
  %7 = sext i32 %0 to i64
  %8 = add i32 %1, 1
  %9 = sub i32 %8, %0
  %xtraiter = and i32 %9, 1
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %4
  %10 = getelementptr inbounds [100010 x %struct.Query], ptr @a, i64 0, i64 %7
  %11 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %7
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %10, i64 24, i1 false), !tbaa.struct !5
  store i32 0, ptr %11, align 8, !tbaa !10
  %indvars.iv.next.prol = add nsw i64 %7, 1
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %4
  %indvars.iv.unr = phi i64 [ %7, %4 ], [ %indvars.iv.next.prol, %.prol.loopexit.unr-lcssa ]
  %12 = icmp eq i32 %1, %0
  br i1 %12, label %.unr-lcssa, label %.new

.unr-lcssa:                                       ; preds = %.new, %.prol.loopexit
  %13 = getelementptr inbounds %struct.Query, ptr @q, i64 %7
  %14 = sext i32 %1 to i64
  %15 = getelementptr inbounds %struct.Query, ptr @q, i64 %14
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  tail call void @_ZSt4sortIP5QueryPFbS0_S0_EEvT_S4_T0_(ptr noundef nonnull %13, ptr noundef nonnull %16, ptr noundef nonnull @_Z4cmpy5QueryS_)
  %.not4045 = icmp sgt i32 %0, %1
  br i1 %.not4045, label %._crit_edge, label %.lr.ph

.new:                                             ; preds = %.prol.loopexit, %.new
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.new ], [ %indvars.iv.unr, %.prol.loopexit ]
  %17 = getelementptr inbounds [100010 x %struct.Query], ptr @a, i64 0, i64 %indvars.iv
  %18 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %indvars.iv
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 8 dereferenceable(24) %17, i64 24, i1 false), !tbaa.struct !5
  store i32 0, ptr %18, align 8, !tbaa !10
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %19 = getelementptr inbounds [100010 x %struct.Query], ptr @a, i64 0, i64 %indvars.iv.next
  %20 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %indvars.iv.next
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 8 dereferenceable(24) %19, i64 24, i1 false), !tbaa.struct !5
  store i32 0, ptr %20, align 8, !tbaa !10
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
  %exitcond.not.1 = icmp eq i32 %8, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %.unr-lcssa, label %.new, !llvm.loop !12

.preheader:                                       ; preds = %38
  br i1 %.not4045, label %._crit_edge, label %.lr.ph49

.lr.ph:                                           ; preds = %.unr-lcssa, %38
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %38 ], [ %7, %.unr-lcssa ]
  %21 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %indvars.iv51
  %22 = getelementptr inbounds i8, ptr %21, i64 20
  %23 = load i32, ptr %22, align 4, !tbaa !14
  %.not43 = icmp sgt i32 %23, %6
  br i1 %.not43, label %29, label %24

24:                                               ; preds = %.lr.ph
  %25 = getelementptr inbounds i8, ptr %21, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !15
  %27 = sext i32 %23 to i64
  %28 = getelementptr inbounds [100010 x %struct.DP], ptr @dp, i64 0, i64 %27
  call void @_Z6updateiR2DP(i32 noundef %26, ptr noundef nonnull align 4 dereferenceable(8) %28)
  br label %38

29:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %30 = getelementptr inbounds i8, ptr %21, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !15
  %32 = call i64 @_Z5queryi(i32 noundef %31)
  store i64 %32, ptr %3, align 8
  %33 = trunc i64 %32 to i32
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %3, align 8, !tbaa !16
  %35 = load i32, ptr %22, align 4, !tbaa !14
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100010 x %struct.DP], ptr @dp, i64 0, i64 %36
  call void @_Z6getmaxR2DPS0_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %38

38:                                               ; preds = %24, %29
  %indvars.iv.next52 = add nsw i64 %indvars.iv51, 1
  %lftr.wideiv54 = trunc i64 %indvars.iv.next52 to i32
  %exitcond55.not = icmp eq i32 %8, %lftr.wideiv54
  br i1 %exitcond55.not, label %.preheader, label %.lr.ph, !llvm.loop !18

._crit_edge:                                      ; preds = %46, %.unr-lcssa, %.preheader
  %39 = add nsw i32 %6, 1
  call void @_Z3cdqii(i32 noundef %39, i32 noundef %1)
  br label %47

.lr.ph49:                                         ; preds = %.preheader, %46
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %46 ], [ %7, %.preheader ]
  %40 = getelementptr inbounds [100010 x %struct.Query], ptr @q, i64 0, i64 %indvars.iv56
  %41 = getelementptr inbounds i8, ptr %40, i64 20
  %42 = load i32, ptr %41, align 4, !tbaa !14
  %.not42 = icmp sgt i32 %42, %6
  br i1 %.not42, label %46, label %43

43:                                               ; preds = %.lr.ph49
  %44 = getelementptr inbounds i8, ptr %40, i64 8
  %45 = load i32, ptr %44, align 8, !tbaa !15
  call void @_Z5Cleari(i32 noundef %45)
  br label %46

46:                                               ; preds = %.lr.ph49, %43
  %indvars.iv.next57 = add nsw i64 %indvars.iv56, 1
  %lftr.wideiv59 = trunc i64 %indvars.iv.next57 to i32
  %exitcond60.not = icmp eq i32 %8, %lftr.wideiv59
  br i1 %exitcond60.not, label %._crit_edge, label %.lr.ph49, !llvm.loop !19

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5QueryPFbS0_S0_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6, i64 20, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_ZTS5Query", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!11, !7, i64 20}
!15 = !{!11, !7, i64 8}
!16 = !{!17, !7, i64 0}
!17 = !{!"_ZTS2DP", !7, i64 0, !7, i64 4}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}


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