; LLVM IR from tangjz/acm-icpc :: hdu (6351)

; 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.std::greater" = type { i8 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@pL = external dso_local global [11 x i32], align 16
@pR = external dso_local global [11 x i32], align 16
@qL = external dso_local global [9 x i32], align 16
@qR = external dso_local global [9 x i32], align 16
@low = external dso_local global i32, align 4
@upp = external dso_local global i32, align 4
@buf = external dso_local global [11 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 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 norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::greater", align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %8

8:                                                ; preds = %207, %61, %19, %0
  %9 = load i32, ptr @t, align 4, !tbaa !5
  %10 = add nsw i32 %9, -1
  store i32 %10, ptr @t, align 4, !tbaa !5
  %11 = icmp ne i32 %9, 0
  br i1 %11, label %12, label %211

12:                                               ; preds = %8
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @low, ptr noundef @m)
  %14 = load i32, ptr @low, align 4, !tbaa !5
  store i32 %14, ptr @upp, align 4, !tbaa !5
  %15 = load i32, ptr @low, align 4, !tbaa !5
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef @buf, ptr noundef @.str, i32 noundef %15) #7
  store i32 %16, ptr @n, align 4, !tbaa !5
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = icmp sgt i32 %17, 9
  br i1 %18, label %19, label %23

19:                                               ; preds = %12
  %20 = load i32, ptr @low, align 4, !tbaa !5
  %21 = load i32, ptr @upp, align 4, !tbaa !5
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %20, i32 noundef %21)
  br label %8, !llvm.loop !9

23:                                               ; preds = %12
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = load i32, ptr @m, align 4, !tbaa !5
  %26 = icmp sle i32 %24, %25
  br i1 %26, label %27, label %69

27:                                               ; preds = %23
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr @buf, i64 %29
  call void @_ZSt4sortIPcSt7greaterIcEEvT_S3_T0_(ptr noundef @buf, ptr noundef %30)
  %31 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef @buf, ptr noundef @.str, ptr noundef @upp) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %58, %27
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %61

37:                                               ; preds = %32
  %38 = load i8, ptr @buf, align 1, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = icmp sgt i32 %39, %44
  br i1 %45, label %46, label %57

46:                                               ; preds = %37
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp sgt i32 %51, 48
  br i1 %52, label %53, label %57

53:                                               ; preds = %46
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %55
  call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) @buf, ptr noundef nonnull align 1 dereferenceable(1) %56) #7
  br label %57

57:                                               ; preds = %53, %46, %37
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %3, align 4, !tbaa !5
  br label %32, !llvm.loop !12

61:                                               ; preds = %36
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr @buf, i64 %63
  call void @_ZSt4sortIPcEvT_S1_(ptr noundef getelementptr inbounds (i8, ptr @buf, i64 1), ptr noundef %64)
  %65 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef @buf, ptr noundef @.str, ptr noundef @low) #7
  %66 = load i32, ptr @low, align 4, !tbaa !5
  %67 = load i32, ptr @upp, align 4, !tbaa !5
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %66, i32 noundef %67)
  br label %8, !llvm.loop !9

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

70:                                               ; preds = %100, %69
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %103

75:                                               ; preds = %70
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %77
  %79 = load i8, ptr %78, align 1, !tbaa !11
  %80 = sext i8 %79 to i32
  %81 = sub nsw i32 %80, 48
  %82 = trunc i32 %81 to i8
  store i8 %82, ptr %78, align 1, !tbaa !11
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sub nsw i32 %83, 1
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !5
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = load i32, ptr %4, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %91
  store i32 %89, ptr %92, align 4, !tbaa !5
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !5
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %98
  store i32 %93, ptr %99, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %75
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %4, align 4, !tbaa !5
  br label %70, !llvm.loop !13

103:                                              ; preds = %74
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr @pL, align 16, !tbaa !5
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %108
  store i32 0, ptr %109, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %110 = load i32, ptr @n, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  store i32 %114, ptr %5, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %202, %103
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %118 = icmp ne i32 %116, %117
  br i1 %118, label %120, label %119

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

120:                                              ; preds = %115
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !11
  %125 = icmp ne i8 %124, 0
  br i1 %125, label %127, label %126

126:                                              ; preds = %120
  br label %202

127:                                              ; preds = %120
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = load i32, ptr %5, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %136
  store i32 %131, ptr %137, align 4, !tbaa !5
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i32, ptr %5, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %146
  store i32 %141, ptr %147, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %148 = load i32, ptr %5, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = icmp ne i32 %151, 0
  %153 = zext i1 %152 to i32
  store i32 %153, ptr %6, align 4, !tbaa !5
  %154 = load i32, ptr %6, align 4, !tbaa !5
  %155 = load i32, ptr @m, align 4, !tbaa !5
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %157, label %188

157:                                              ; preds = %127
  %158 = load i32, ptr %5, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = load i32, ptr @qL, align 16, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %163
  store i32 %161, ptr %164, align 4, !tbaa !5
  %165 = load i32, ptr @qL, align 16, !tbaa !5
  %166 = load i32, ptr %5, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %170
  store i32 %165, ptr %171, align 4, !tbaa !5
  %172 = load i32, ptr %6, align 4, !tbaa !5
  %173 = load i32, ptr %5, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %174
  %176 = load i8, ptr %175, align 1, !tbaa !11
  %177 = sext i8 %176 to i32
  call void @_Z3dfsiii(i32 noundef 1, i32 noundef %172, i32 noundef %177)
  %178 = load i32, ptr @qL, align 16, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %179
  store i32 0, ptr %180, align 4, !tbaa !5
  %181 = load i32, ptr %5, align 4, !tbaa !5
  %182 = load i32, ptr %5, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %186
  store i32 %181, ptr %187, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %157, %127
  %189 = load i32, ptr %5, align 4, !tbaa !5
  %190 = load i32, ptr %5, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %194
  store i32 %189, ptr %195, align 4, !tbaa !5
  %196 = load i32, ptr %5, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %200
  store i32 %189, ptr %201, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %202

202:                                              ; preds = %188, %126
  %203 = load i32, ptr %5, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  store i32 %206, ptr %5, align 4, !tbaa !5
  br label %115, !llvm.loop !14

207:                                              ; preds = %119
  %208 = load i32, ptr @low, align 4, !tbaa !5
  %209 = load i32, ptr @upp, align 4, !tbaa !5
  %210 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %208, i32 noundef %209)
  br label %8, !llvm.loop !9

211:                                              ; preds = %8
  ret i32 0
}

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

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

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPcEvT_S1_(ptr noundef, 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 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 #3 = { "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 = { 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 = { inlinehint 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 #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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!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"

@t = external dso_local global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@m = external dso_local global i32, align 4
@pL = external dso_local local_unnamed_addr global [11 x i32], align 16
@pR = external dso_local local_unnamed_addr global [11 x i32], align 16
@qL = external dso_local local_unnamed_addr global [9 x i32], align 16
@qR = external dso_local local_unnamed_addr global [9 x i32], align 16
@low = external dso_local global i32, align 4
@upp = external dso_local global i32, align 4
@buf = external dso_local global [11 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsiii(i32 noundef, i32 noundef, 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 @t)
  %2 = load i32, ptr @t, align 4, !tbaa !5
  %3 = add nsw i32 %2, -1
  store i32 %3, ptr @t, align 4, !tbaa !5
  %.not55 = icmp eq i32 %2, 0
  br i1 %.not55, label %._crit_edge58, label %.lr.ph57

.lr.ph57:                                         ; preds = %0, %.backedge
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @low, ptr noundef nonnull @m)
  %5 = load i32, ptr @low, align 4, !tbaa !5
  store i32 %5, ptr @upp, align 4, !tbaa !5
  %6 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) @buf, ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5) #5
  store i32 %6, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 9
  br i1 %7, label %.backedge, label %13

.backedge:                                        ; preds = %106, %.lr.ph57, %._crit_edge47, %._crit_edge
  %8 = load i32, ptr @low, align 4, !tbaa !5
  %9 = load i32, ptr @upp, align 4, !tbaa !5
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8, i32 noundef %9)
  %11 = load i32, ptr @t, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  store i32 %12, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !9

13:                                               ; preds = %.lr.ph57
  %14 = load i32, ptr @m, align 4, !tbaa !5
  %.not40 = icmp sgt i32 %6, %14
  br i1 %.not40, label %.preheader, label %35

.preheader:                                       ; preds = %13
  %15 = icmp sgt i32 %6, 0
  br i1 %15, label %.lr.ph46.preheader, label %._crit_edge47

.lr.ph46.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %6 to i64
  %min.iters.check = icmp ult i32 %6, 8
  br i1 %min.iters.check, label %.lr.ph46.preheader86, label %vector.ph

.lr.ph46.preheader86:                             ; preds = %middle.block, %.lr.ph46.preheader
  %indvars.iv61.ph = phi i64 [ 0, %.lr.ph46.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph46

vector.ph:                                        ; preds = %.lr.ph46.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.ind77 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next80, %vector.body ]
  %vec.ind81 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next84, %vector.body ]
  %step.add82 = add <4 x i32> %vec.ind81, <i32 4, i32 4, i32 4, i32 4>
  %16 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %index
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  %wide.load = load <4 x i8>, ptr %16, align 1, !tbaa !11
  %wide.load85 = load <4 x i8>, ptr %17, align 1, !tbaa !11
  %18 = add <4 x i8> %wide.load, <i8 -48, i8 -48, i8 -48, i8 -48>
  %19 = add <4 x i8> %wide.load85, <i8 -48, i8 -48, i8 -48, i8 -48>
  store <4 x i8> %18, ptr %16, align 1, !tbaa !11
  store <4 x i8> %19, ptr %17, align 1, !tbaa !11
  %20 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %index
  %21 = add <4 x i32> %vec.ind77, <i32 -1, i32 -1, i32 -1, i32 -1>
  %22 = add <4 x i32> %vec.ind77, <i32 3, i32 3, i32 3, i32 3>
  %23 = getelementptr inbounds i8, ptr %20, i64 16
  store <4 x i32> %21, ptr %20, align 16, !tbaa !5
  store <4 x i32> %22, ptr %23, align 16, !tbaa !5
  %24 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %index
  %25 = trunc <4 x i64> %vec.ind to <4 x i32>
  %26 = add <4 x i32> %25, <i32 1, i32 1, i32 1, i32 1>
  %27 = trunc <4 x i64> %vec.ind to <4 x i32>
  %28 = add <4 x i32> %27, <i32 5, i32 5, i32 5, i32 5>
  %29 = getelementptr inbounds i8, ptr %24, i64 16
  store <4 x i32> %26, ptr %24, align 16, !tbaa !5
  store <4 x i32> %28, ptr %29, align 16, !tbaa !5
  %30 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <4 x i32> %vec.ind81, ptr %30, align 16, !tbaa !5
  store <4 x i32> %step.add82, ptr %31, align 16, !tbaa !5
  %32 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <4 x i32> %vec.ind81, ptr %32, align 16, !tbaa !5
  store <4 x i32> %step.add82, ptr %33, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %vec.ind.next80 = add <4 x i32> %vec.ind77, <i32 8, i32 8, i32 8, i32 8>
  %vec.ind.next84 = add <4 x i32> %vec.ind81, <i32 8, i32 8, i32 8, i32 8>
  %34 = icmp eq i64 %index.next, %n.vec
  br i1 %34, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge47, label %.lr.ph46.preheader86

35:                                               ; preds = %13
  %36 = sext i32 %6 to i64
  %37 = getelementptr inbounds i8, ptr @buf, i64 %36
  tail call void @_ZSt4sortIPcSt7greaterIcEEvT_S3_T0_(ptr noundef nonnull @buf, ptr noundef nonnull %37)
  %38 = tail call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull @buf, ptr noundef nonnull @.str, ptr noundef nonnull @upp) #5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = icmp sgt i32 %39, 1
  br i1 %40, label %.lr.ph.preheader, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %35
  %.pre73 = sext i32 %39 to i64
  br label %._crit_edge

.lr.ph.preheader:                                 ; preds = %35
  %.pre64 = load i8, ptr @buf, align 1, !tbaa !11
  br label %.lr.ph

._crit_edge:                                      ; preds = %50, %.._crit_edge_crit_edge
  %.pre-phi74 = phi i64 [ %.pre73, %.._crit_edge_crit_edge ], [ %53, %50 ]
  %41 = getelementptr inbounds i8, ptr @buf, i64 %.pre-phi74
  tail call void @_ZSt4sortIPcEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @buf, i64 1), ptr noundef nonnull %41)
  %42 = tail call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull @buf, ptr noundef nonnull @.str, ptr noundef nonnull @low) #5
  br label %.backedge

.lr.ph:                                           ; preds = %.lr.ph.preheader, %50
  %43 = phi i32 [ %39, %.lr.ph.preheader ], [ %51, %50 ]
  %44 = phi i8 [ %.pre64, %.lr.ph.preheader ], [ %52, %50 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %50 ]
  %45 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %indvars.iv
  %46 = load i8, ptr %45, align 1, !tbaa !11
  %47 = icmp sgt i8 %44, %46
  %48 = icmp sgt i8 %46, 48
  %or.cond = and i1 %47, %48
  br i1 %or.cond, label %49, label %50

49:                                               ; preds = %.lr.ph
  tail call void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1) @buf, ptr noundef nonnull align 1 dereferenceable(1) %45) #5
  %.pre = load i8, ptr @buf, align 1, !tbaa !11
  %.pre65 = load i32, ptr @n, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %.lr.ph, %49
  %51 = phi i32 [ %43, %.lr.ph ], [ %.pre65, %49 ]
  %52 = phi i8 [ %44, %.lr.ph ], [ %.pre, %49 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %53 = sext i32 %51 to i64
  %54 = icmp slt i64 %indvars.iv.next, %53
  br i1 %54, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge47:                                    ; preds = %.lr.ph46, %middle.block, %.preheader
  %55 = add nsw i32 %6, 1
  store i32 %55, ptr @pL, align 16, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %56
  store i32 0, ptr %57, align 4, !tbaa !5
  %.not4150 = icmp eq i32 %6, 0
  br i1 %.not4150, label %.backedge, label %.lr.ph53

.lr.ph46:                                         ; preds = %.lr.ph46.preheader86, %.lr.ph46
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph46 ], [ %indvars.iv61.ph, %.lr.ph46.preheader86 ]
  %58 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %indvars.iv61
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = add i8 %59, -48
  store i8 %60, ptr %58, align 1, !tbaa !11
  %61 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %indvars.iv61
  %62 = trunc i64 %indvars.iv61 to i32
  %63 = add i32 %62, -1
  store i32 %63, ptr %61, align 4, !tbaa !5
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %64 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %indvars.iv61
  %65 = trunc nuw nsw i64 %indvars.iv.next62 to i32
  store i32 %65, ptr %64, align 4, !tbaa !5
  %66 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %indvars.iv61
  %67 = trunc nuw nsw i64 %indvars.iv61 to i32
  store i32 %67, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %indvars.iv61
  store i32 %67, ptr %68, align 4, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge47, label %.lr.ph46, !llvm.loop !16

.lr.ph53:                                         ; preds = %._crit_edge47, %106
  %.pre6869 = phi i32 [ %.pre6870, %106 ], [ %6, %._crit_edge47 ]
  %69 = phi i32 [ %107, %106 ], [ %6, %._crit_edge47 ]
  %.03351 = phi i32 [ %.033, %106 ], [ 0, %._crit_edge47 ]
  %70 = sext i32 %.03351 to i64
  %71 = getelementptr inbounds [11 x i8], ptr @buf, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !11
  %.not42 = icmp eq i8 %72, 0
  br i1 %.not42, label %.lr.ph53._crit_edge, label %73

.lr.ph53._crit_edge:                              ; preds = %.lr.ph53
  %.033.in.phi.trans.insert = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %70
  %.033.pre = load i32, ptr %.033.in.phi.trans.insert, align 4, !tbaa !5
  br label %106

73:                                               ; preds = %.lr.ph53
  %74 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %70
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %70
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %78
  store i32 %75, ptr %79, align 4, !tbaa !5
  %80 = sext i32 %75 to i64
  %81 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %80
  store i32 %77, ptr %81, align 4, !tbaa !5
  %82 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %70
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  %85 = zext i1 %84 to i32
  %86 = load i32, ptr @m, align 4, !tbaa !5
  %.not43 = icmp slt i32 %86, %85
  br i1 %.not43, label %101, label %87

87:                                               ; preds = %73
  %88 = load i32, ptr @qL, align 16, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %89
  store i32 %83, ptr %90, align 4, !tbaa !5
  %91 = load i32, ptr %82, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %92
  store i32 %88, ptr %93, align 4, !tbaa !5
  %94 = sext i8 %72 to i32
  tail call void @_Z3dfsiii(i32 noundef 1, i32 noundef %85, i32 noundef %94)
  %95 = load i32, ptr @qL, align 16, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [9 x i32], ptr @qR, i64 0, i64 %96
  store i32 0, ptr %97, align 4, !tbaa !5
  %98 = load i32, ptr %82, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [9 x i32], ptr @qL, i64 0, i64 %99
  store i32 %.03351, ptr %100, align 4, !tbaa !5
  %.pre66 = load i32, ptr %74, align 4, !tbaa !5
  %.pre68.pre = load i32, ptr @n, align 4, !tbaa !5
  %.pre72 = sext i32 %.pre66 to i64
  br label %101

101:                                              ; preds = %87, %73
  %.pre-phi = phi i64 [ %.pre72, %87 ], [ %80, %73 ]
  %.pre68 = phi i32 [ %.pre68.pre, %87 ], [ %.pre6869, %73 ]
  %102 = getelementptr inbounds [11 x i32], ptr @pR, i64 0, i64 %.pre-phi
  store i32 %.03351, ptr %102, align 4, !tbaa !5
  %103 = load i32, ptr %76, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [11 x i32], ptr @pL, i64 0, i64 %104
  store i32 %.03351, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %.lr.ph53._crit_edge, %101
  %.pre6870 = phi i32 [ %.pre6869, %.lr.ph53._crit_edge ], [ %.pre68, %101 ]
  %107 = phi i32 [ %69, %.lr.ph53._crit_edge ], [ %.pre68, %101 ]
  %.033 = phi i32 [ %.033.pre, %.lr.ph53._crit_edge ], [ %103, %101 ]
  %.not41 = icmp eq i32 %.033, %107
  br i1 %.not41, label %.backedge, label %.lr.ph53, !llvm.loop !17

._crit_edge58:                                    ; preds = %.backedge, %0
  ret i32 0
}

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

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

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 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" }
attributes #4 = { inlinehint 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
!17 = distinct !{!17, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass