; LLVM IR from VastoLorde95/Competitive-Programming :: SPOJ/Random/KQUERY (k)

; 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.node = type { i32, i32, i32, i32, i8 }

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@i = external dso_local global i32, align 4
@ans = external dso_local global [230000 x i32], align 16
@r = external dso_local global i32, align 4
@req = external dso_local global [230000 x %struct.node], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3geti(i32 noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6updatei(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @N)
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %3

3:                                                ; preds = %23, %0
  %4 = load i32, ptr @i, align 4, !tbaa !5
  %5 = load i32, ptr @N, align 4, !tbaa !5
  %6 = icmp slt i32 %4, %5
  br i1 %6, label %7, label %26

7:                                                ; preds = %3
  %8 = load i32, ptr @i, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %9
  %11 = getelementptr inbounds %struct.node, ptr %10, i32 0, i32 0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %11)
  %13 = load i32, ptr @i, align 4, !tbaa !5
  %14 = add nsw i32 %13, 1
  %15 = load i32, ptr @i, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %16
  %18 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 3
  store i32 %14, ptr %18, align 4, !tbaa !9
  %19 = load i32, ptr @i, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %20
  %22 = getelementptr inbounds %struct.node, ptr %21, i32 0, i32 4
  store i8 0, ptr %22, align 4, !tbaa !12
  br label %23

23:                                               ; preds = %7
  %24 = load i32, ptr @i, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @i, align 4, !tbaa !5
  br label %3, !llvm.loop !13

26:                                               ; preds = %3
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @Q)
  %28 = load i32, ptr @N, align 4, !tbaa !5
  store i32 %28, ptr @i, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %60, %26
  %30 = load i32, ptr @i, align 4, !tbaa !5
  %31 = load i32, ptr @N, align 4, !tbaa !5
  %32 = load i32, ptr @Q, align 4, !tbaa !5
  %33 = add nsw i32 %31, %32
  %34 = icmp slt i32 %30, %33
  br i1 %34, label %35, label %63

35:                                               ; preds = %29
  %36 = load i32, ptr @i, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.node, ptr %38, i32 0, i32 1
  %40 = load i32, ptr @i, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.node, ptr %42, i32 0, i32 2
  %44 = load i32, ptr @i, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %45
  %47 = getelementptr inbounds %struct.node, ptr %46, i32 0, i32 0
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %39, ptr noundef %43, ptr noundef %47)
  %49 = load i32, ptr @i, align 4, !tbaa !5
  %50 = load i32, ptr @N, align 4, !tbaa !5
  %51 = sub nsw i32 %49, %50
  %52 = load i32, ptr @i, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %53
  %55 = getelementptr inbounds %struct.node, ptr %54, i32 0, i32 3
  store i32 %51, ptr %55, align 4, !tbaa !9
  %56 = load i32, ptr @i, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.node, ptr %58, i32 0, i32 4
  store i8 1, ptr %59, align 4, !tbaa !12
  br label %60

60:                                               ; preds = %35
  %61 = load i32, ptr @i, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr @i, align 4, !tbaa !5
  br label %29, !llvm.loop !15

63:                                               ; preds = %29
  %64 = load i32, ptr @N, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.node, ptr @req, i64 %65
  %67 = load i32, ptr @Q, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %struct.node, ptr %66, i64 %68
  call void @_ZSt4sortIP4nodeEvT_S2_(ptr noundef @req, ptr noundef %69)
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %126, %63
  %71 = load i32, ptr @i, align 4, !tbaa !5
  %72 = load i32, ptr @N, align 4, !tbaa !5
  %73 = load i32, ptr @Q, align 4, !tbaa !5
  %74 = add nsw i32 %72, %73
  %75 = icmp slt i32 %71, %74
  br i1 %75, label %76, label %129

76:                                               ; preds = %70
  %77 = load i32, ptr @i, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.node, ptr %79, i32 0, i32 4
  %81 = load i8, ptr %80, align 4, !tbaa !12, !range !16, !noundef !17
  %82 = trunc i8 %81 to i1
  br i1 %82, label %83, label %119

83:                                               ; preds = %76
  %84 = load i32, ptr @i, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.node, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !18
  %89 = call noundef i32 @_Z3geti(i32 noundef %88)
  %90 = load i32, ptr @i, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.node, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !19
  %95 = sub nsw i32 %94, 1
  %96 = call noundef i32 @_Z3geti(i32 noundef %95)
  %97 = sub nsw i32 %89, %96
  store i32 %97, ptr @r, align 4, !tbaa !5
  %98 = load i32, ptr @i, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.node, ptr %100, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !18
  %103 = load i32, ptr @i, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %104
  %106 = getelementptr inbounds %struct.node, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !19
  %108 = sub nsw i32 %102, %107
  %109 = add nsw i32 %108, 1
  %110 = load i32, ptr @r, align 4, !tbaa !5
  %111 = sub nsw i32 %109, %110
  %112 = load i32, ptr @i, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %113
  %115 = getelementptr inbounds %struct.node, ptr %114, i32 0, i32 3
  %116 = load i32, ptr %115, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [230000 x i32], ptr @ans, i64 0, i64 %117
  store i32 %111, ptr %118, align 4, !tbaa !5
  br label %125

119:                                              ; preds = %76
  %120 = load i32, ptr @i, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %121
  %123 = getelementptr inbounds %struct.node, ptr %122, i32 0, i32 3
  %124 = load i32, ptr %123, align 4, !tbaa !9
  call void @_Z6updatei(i32 noundef %124)
  br label %125

125:                                              ; preds = %119, %83
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr @i, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr @i, align 4, !tbaa !5
  br label %70, !llvm.loop !20

129:                                              ; preds = %70
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %130

130:                                              ; preds = %140, %129
  %131 = load i32, ptr @i, align 4, !tbaa !5
  %132 = load i32, ptr @Q, align 4, !tbaa !5
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %143

134:                                              ; preds = %130
  %135 = load i32, ptr @i, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [230000 x i32], ptr @ans, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %138)
  br label %140

140:                                              ; preds = %134
  %141 = load i32, ptr @i, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @i, align 4, !tbaa !5
  br label %130, !llvm.loop !21

143:                                              ; preds = %130
  ret i32 0
}

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

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

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

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 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 #2 = { "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 = { 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" }

!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 = !{!10, !6, i64 12}
!10 = !{!"_ZTS4node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !11, i64 16}
!11 = !{!"bool", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!10, !6, i64 8}
!19 = !{!10, !6, i64 4}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


; 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.node = type { i32, i32, i32, i32, i8 }

@N = external dso_local global i32, align 4
@Q = external dso_local global i32, align 4
@i = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global [230000 x i32], align 16
@r = external dso_local local_unnamed_addr global i32, align 4
@req = external dso_local global [230000 x %struct.node], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3geti(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6updatei(i32 noundef) local_unnamed_addr #0

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

.lr.ph:                                           ; preds = %0, %.lr.ph
  %storemerge10 = phi i32 [ %8, %.lr.ph ], [ 0, %0 ]
  %4 = sext i32 %storemerge10 to i64
  %5 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %4
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %7 = load i32, ptr @i, align 4, !tbaa !5
  %8 = add nsw i32 %7, 1
  %9 = sext i32 %7 to i64
  %10 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %9, i32 3
  store i32 %8, ptr %10, align 4, !tbaa !9
  %11 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %9, i32 4
  store i8 0, ptr %11, align 4, !tbaa !12
  store i32 %8, ptr @i, align 4, !tbaa !5
  %12 = load i32, ptr @N, align 4, !tbaa !5
  %13 = icmp slt i32 %8, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %0
  %14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @Q)
  %15 = load i32, ptr @N, align 4, !tbaa !5
  store i32 %15, ptr @i, align 4, !tbaa !5
  %16 = load i32, ptr @Q, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph13, label %._crit_edge14

.lr.ph13:                                         ; preds = %._crit_edge, %.lr.ph13
  %storemerge411 = phi i32 [ %29, %.lr.ph13 ], [ %15, %._crit_edge ]
  %18 = sext i32 %storemerge411 to i64
  %19 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %18
  %20 = getelementptr inbounds i8, ptr %19, i64 4
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %20, ptr noundef nonnull %21, ptr noundef nonnull %19)
  %23 = load i32, ptr @i, align 4, !tbaa !5
  %24 = load i32, ptr @N, align 4, !tbaa !5
  %25 = sub nsw i32 %23, %24
  %26 = sext i32 %23 to i64
  %27 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %26, i32 3
  store i32 %25, ptr %27, align 4, !tbaa !9
  %28 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %26, i32 4
  store i8 1, ptr %28, align 4, !tbaa !12
  %29 = add nsw i32 %23, 1
  store i32 %29, ptr @i, align 4, !tbaa !5
  %30 = load i32, ptr @Q, align 4, !tbaa !5
  %31 = add nsw i32 %30, %24
  %32 = icmp slt i32 %29, %31
  br i1 %32, label %.lr.ph13, label %._crit_edge14, !llvm.loop !15

._crit_edge14:                                    ; preds = %.lr.ph13, %._crit_edge
  %.lcssa9 = phi i32 [ %15, %._crit_edge ], [ %24, %.lr.ph13 ]
  %.lcssa = phi i32 [ %16, %._crit_edge ], [ %30, %.lr.ph13 ]
  %33 = sext i32 %.lcssa9 to i64
  %34 = getelementptr inbounds %struct.node, ptr @req, i64 %33
  %35 = sext i32 %.lcssa to i64
  %36 = getelementptr inbounds %struct.node, ptr %34, i64 %35
  tail call void @_ZSt4sortIP4nodeEvT_S2_(ptr noundef nonnull @req, ptr noundef nonnull %36)
  store i32 0, ptr @i, align 4, !tbaa !5
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = load i32, ptr @Q, align 4, !tbaa !5
  %39 = add nsw i32 %38, %37
  %40 = icmp sgt i32 %39, 0
  br i1 %40, label %.lr.ph18, label %.preheader

.preheader:                                       ; preds = %76, %._crit_edge14
  %41 = phi i32 [ %38, %._crit_edge14 ], [ %80, %76 ]
  store i32 0, ptr @i, align 4, !tbaa !5
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph20, label %._crit_edge21

.lr.ph18:                                         ; preds = %._crit_edge14, %76
  %storemerge516 = phi i32 [ %78, %76 ], [ 0, %._crit_edge14 ]
  %43 = sext i32 %storemerge516 to i64
  %44 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %43
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load i8, ptr %45, align 4, !tbaa !12, !range !16, !noundef !17
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %73

48:                                               ; preds = %.lr.ph18
  %49 = getelementptr inbounds i8, ptr %44, i64 8
  %50 = load i32, ptr %49, align 4, !tbaa !18
  %51 = tail call noundef i32 @_Z3geti(i32 noundef %50)
  %52 = load i32, ptr @i, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %53, i32 1
  %55 = load i32, ptr %54, align 4, !tbaa !19
  %56 = add nsw i32 %55, -1
  %57 = tail call noundef i32 @_Z3geti(i32 noundef %56)
  %58 = sub nsw i32 %51, %57
  store i32 %58, ptr @r, align 4, !tbaa !5
  %59 = load i32, ptr @i, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [230000 x %struct.node], ptr @req, i64 0, i64 %60
  %62 = getelementptr inbounds i8, ptr %61, i64 8
  %63 = load i32, ptr %62, align 4, !tbaa !18
  %64 = getelementptr inbounds i8, ptr %61, i64 4
  %65 = load i32, ptr %64, align 4, !tbaa !19
  %66 = add i32 %63, 1
  %67 = add i32 %58, %65
  %68 = sub i32 %66, %67
  %69 = getelementptr inbounds i8, ptr %61, i64 12
  %70 = load i32, ptr %69, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [230000 x i32], ptr @ans, i64 0, i64 %71
  store i32 %68, ptr %72, align 4, !tbaa !5
  br label %76

73:                                               ; preds = %.lr.ph18
  %74 = getelementptr inbounds i8, ptr %44, i64 12
  %75 = load i32, ptr %74, align 4, !tbaa !9
  tail call void @_Z6updatei(i32 noundef %75)
  %.pre = load i32, ptr @i, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %48, %73
  %77 = phi i32 [ %59, %48 ], [ %.pre, %73 ]
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr @i, align 4, !tbaa !5
  %79 = load i32, ptr @N, align 4, !tbaa !5
  %80 = load i32, ptr @Q, align 4, !tbaa !5
  %81 = add nsw i32 %80, %79
  %82 = icmp slt i32 %78, %81
  br i1 %82, label %.lr.ph18, label %.preheader, !llvm.loop !20

.lr.ph20:                                         ; preds = %.preheader, %.lr.ph20
  %storemerge619 = phi i32 [ %88, %.lr.ph20 ], [ 0, %.preheader ]
  %83 = sext i32 %storemerge619 to i64
  %84 = getelementptr inbounds [230000 x i32], ptr @ans, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %85)
  %87 = load i32, ptr @i, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr @i, align 4, !tbaa !5
  %89 = load i32, ptr @Q, align 4, !tbaa !5
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %.lr.ph20, label %._crit_edge21, !llvm.loop !21

._crit_edge21:                                    ; preds = %.lr.ph20, %.preheader
  ret i32 0
}

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

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

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

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 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 #2 = { 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 #3 = { 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" }

!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 = !{!10, !6, i64 12}
!10 = !{!"_ZTS4node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !11, i64 16}
!11 = !{!"bool", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!10, !6, i64 8}
!19 = !{!10, !6, i64 4}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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