; LLVM IR from tangjz/acm-icpc :: 51nod/1553.ll (Z7seg_queiiii)

; 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.Hash = type { [2 x i32] }

@tag = external dso_local global [200003 x i32], align 16
@pw = external dso_local global [100001 x %struct.Hash], align 16
@sum = external dso_local global [100001 x %struct.Hash], align 16
@seg = external dso_local global [200003 x %struct.Hash], align 16

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7seg_idxii(i32 noundef, i32 noundef) #1

; 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) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z7seg_queiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4 {
  %5 = alloca %struct.Hash, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.Hash, align 4
  %16 = alloca %struct.Hash, align 4
  %17 = alloca %struct.Hash, align 4
  %18 = alloca %struct.Hash, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.Hash, align 4
  %22 = alloca %struct.Hash, align 4
  %23 = alloca %struct.Hash, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca %struct.Hash, align 4
  %27 = alloca %struct.Hash, align 4
  %28 = alloca %struct.Hash, align 4
  %29 = alloca %struct.Hash, align 4
  %30 = alloca %struct.Hash, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = call noundef i32 @_Z7seg_idxii(i32 noundef %31, i32 noundef %32)
  store i32 %33, ptr %10, align 4, !tbaa !5
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %37, label %45

37:                                               ; preds = %4
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = icmp sle i32 %38, %39
  br i1 %40, label %41, label %45

41:                                               ; preds = %37
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %43
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 8 %44, i64 8, i1 false), !tbaa.struct !9
  store i32 1, ptr %11, align 4
  br label %196

45:                                               ; preds = %37, %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = add nsw i32 %46, %47
  %49 = ashr i32 %48, 1
  store i32 %49, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = load i32, ptr %12, align 4, !tbaa !5
  %52 = call noundef i32 @_Z7seg_idxii(i32 noundef %50, i32 noundef %51)
  store i32 %52, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %53 = load i32, ptr %12, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = call noundef i32 @_Z7seg_idxii(i32 noundef %54, i32 noundef %55)
  store i32 %56, ptr %14, align 4, !tbaa !5
  %57 = load i32, ptr %10, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %121

62:                                               ; preds = %45
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = load i32, ptr %13, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %68
  store i32 %66, ptr %69, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = sub nsw i32 %70, %71
  %73 = add nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %76 = getelementptr inbounds %struct.Hash, ptr %16, i32 0, i32 0
  %77 = load i32, ptr %10, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  store i32 %80, ptr %76, align 4, !tbaa !5
  %81 = getelementptr inbounds i32, ptr %76, i64 1
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %85, ptr %81, align 4, !tbaa !5
  %86 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %75, ptr noundef nonnull align 4 dereferenceable(8) %16)
  %87 = getelementptr inbounds %struct.Hash, ptr %15, i32 0, i32 0
  store i64 %86, ptr %87, align 4
  %88 = load i32, ptr %13, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %89
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %90, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %91 = load i32, ptr %10, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %96
  store i32 %94, ptr %97, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = sub nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %103 = getelementptr inbounds %struct.Hash, ptr %18, i32 0, i32 0
  %104 = load i32, ptr %10, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  store i32 %107, ptr %103, align 4, !tbaa !5
  %108 = getelementptr inbounds i32, ptr %103, i64 1
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  store i32 %112, ptr %108, align 4, !tbaa !5
  %113 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %102, ptr noundef nonnull align 4 dereferenceable(8) %18)
  %114 = getelementptr inbounds %struct.Hash, ptr %17, i32 0, i32 0
  store i64 %113, ptr %114, align 4
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %116
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %117, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %119
  store i32 0, ptr %120, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %62, %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %5, i8 0, i64 8, i1 false)
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = icmp sle i32 %122, %123
  br i1 %124, label %125, label %148

125:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %126 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = sub nsw i32 %127, %129
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %20, align 4, !tbaa !5
  %132 = load i32, ptr %20, align 4, !tbaa !5
  %133 = load i32, ptr %19, align 4, !tbaa !5
  %134 = add nsw i32 %133, %132
  store i32 %134, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %135 = load i32, ptr %20, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %136
  %138 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %137)
  %139 = getelementptr inbounds %struct.Hash, ptr %22, i32 0, i32 0
  store i64 %138, ptr %139, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %140 = load i32, ptr %6, align 4, !tbaa !5
  %141 = load i32, ptr %12, align 4, !tbaa !5
  %142 = load i32, ptr %8, align 4, !tbaa !5
  %143 = load i32, ptr %9, align 4, !tbaa !5
  %144 = call i64 @_Z7seg_queiiii(i32 noundef %140, i32 noundef %141, i32 noundef %142, i32 noundef %143)
  %145 = getelementptr inbounds %struct.Hash, ptr %23, i32 0, i32 0
  store i64 %144, ptr %145, align 4
  %146 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %22, ptr noundef nonnull align 4 dereferenceable(8) %23)
  %147 = getelementptr inbounds %struct.Hash, ptr %21, i32 0, i32 0
  store i64 %146, ptr %147, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %148

148:                                              ; preds = %125, %121
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = load i32, ptr %9, align 4, !tbaa !5
  %151 = icmp slt i32 %149, %150
  br i1 %151, label %152, label %177

152:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %154 = load i32, ptr %153, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = sub nsw i32 %155, 1
  store i32 %156, ptr %25, align 4, !tbaa !5
  %157 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sub nsw i32 %154, %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  store i32 %159, ptr %24, align 4, !tbaa !5
  %160 = load i32, ptr %24, align 4, !tbaa !5
  %161 = load i32, ptr %19, align 4, !tbaa !5
  %162 = add nsw i32 %161, %160
  store i32 %162, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %163 = load i32, ptr %24, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %164
  %166 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %165)
  %167 = getelementptr inbounds %struct.Hash, ptr %27, i32 0, i32 0
  store i64 %166, ptr %167, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %168 = load i32, ptr %12, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  %170 = load i32, ptr %7, align 4, !tbaa !5
  %171 = load i32, ptr %8, align 4, !tbaa !5
  %172 = load i32, ptr %9, align 4, !tbaa !5
  %173 = call i64 @_Z7seg_queiiii(i32 noundef %169, i32 noundef %170, i32 noundef %171, i32 noundef %172)
  %174 = getelementptr inbounds %struct.Hash, ptr %28, i32 0, i32 0
  store i64 %173, ptr %174, align 4
  %175 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(8) %28)
  %176 = getelementptr inbounds %struct.Hash, ptr %26, i32 0, i32 0
  store i64 %175, ptr %176, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %26, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %177

177:                                              ; preds = %152, %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  %178 = load i32, ptr %13, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %179
  %181 = load i32, ptr %7, align 4, !tbaa !5
  %182 = load i32, ptr %12, align 4, !tbaa !5
  %183 = sub nsw i32 %181, %182
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %184
  %186 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %180, ptr noundef nonnull align 4 dereferenceable(8) %185)
  %187 = getelementptr inbounds %struct.Hash, ptr %30, i32 0, i32 0
  store i64 %186, ptr %187, align 4
  %188 = load i32, ptr %14, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %189
  %191 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %30, ptr noundef nonnull align 4 dereferenceable(8) %190)
  %192 = getelementptr inbounds %struct.Hash, ptr %29, i32 0, i32 0
  store i64 %191, ptr %192, align 4
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %194
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %195, ptr align 4 %29, i64 8, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %196

196:                                              ; preds = %177, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %197 = getelementptr inbounds %struct.Hash, ptr %5, i32 0, i32 0
  %198 = load i64, ptr %197, align 4
  ret i64 %198
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{i64 0, i64 8, !10}
!10 = !{!7, !7, i64 0}


; 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.Hash = type { [2 x i32] }

@tag = external dso_local local_unnamed_addr global [200003 x i32], align 16
@pw = external dso_local global [100001 x %struct.Hash], align 16
@sum = external dso_local global [100001 x %struct.Hash], align 16
@seg = external dso_local global [200003 x %struct.Hash], align 16

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z7seg_idxii(i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local i64 @_Z7seg_queiiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = alloca %struct.Hash, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Hash, align 4
  %12 = alloca %struct.Hash, align 4
  %13 = alloca %struct.Hash, align 8
  %14 = alloca %struct.Hash, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.Hash, align 8
  %17 = alloca %struct.Hash, align 8
  %18 = alloca %struct.Hash, align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !5
  %19 = tail call noundef i32 @_Z7seg_idxii(i32 noundef %0, i32 noundef %1)
  %.not = icmp sgt i32 %2, %0
  %.not27 = icmp sgt i32 %1, %3
  %or.cond = or i1 %.not, %.not27
  br i1 %or.cond, label %23, label %20

20:                                               ; preds = %4
  %21 = sext i32 %19 to i64
  %22 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %21
  br label %103

23:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #3
  %24 = add nsw i32 %1, %0
  %25 = ashr i32 %24, 1
  store i32 %25, ptr %10, align 4, !tbaa !5
  %26 = tail call noundef i32 @_Z7seg_idxii(i32 noundef %0, i32 noundef %25)
  %27 = add nsw i32 %25, 1
  %28 = tail call noundef i32 @_Z7seg_idxii(i32 noundef %27, i32 noundef %1)
  %29 = sext i32 %19 to i64
  %30 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %.not28 = icmp eq i32 %31, 0
  br i1 %.not28, label %51, label %32

32:                                               ; preds = %23
  %33 = sext i32 %26 to i64
  %34 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %33
  store i32 %31, ptr %34, align 4, !tbaa !5
  %35 = sub i32 %27, %0
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  %38 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %38, ptr %11, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %11, i64 4
  store i32 %38, ptr %39, align 4, !tbaa !5
  %40 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %37, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %41 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %33
  store i64 %40, ptr %41, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  %42 = load i32, ptr %30, align 4, !tbaa !5
  %43 = sext i32 %28 to i64
  %44 = getelementptr inbounds [200003 x i32], ptr @tag, i64 0, i64 %43
  store i32 %42, ptr %44, align 4, !tbaa !5
  %45 = sub nsw i32 %1, %25
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100001 x %struct.Hash], ptr @sum, i64 0, i64 %46
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  store i32 %42, ptr %12, align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %12, i64 4
  store i32 %42, ptr %48, align 4, !tbaa !5
  %49 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %47, ptr noundef nonnull align 4 dereferenceable(8) %12)
  %50 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %43
  store i64 %49, ptr %50, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %32, %23
  store i64 0, ptr %5, align 8
  %.not29 = icmp slt i32 %25, %2
  br i1 %.not29, label %68, label %52

52:                                               ; preds = %51
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add i32 %54, 1
  %58 = sub i32 %57, %56
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %59
  %61 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %60)
  store i64 %61, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = call i64 @_Z7seg_queiiii(i32 noundef %62, i32 noundef %63, i32 noundef %64, i32 noundef %65)
  store i64 %66, ptr %14, align 8
  %67 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(8) %14)
  store i64 %67, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  %.pre = load i32, ptr %10, align 4, !tbaa !5
  %.pre31 = load i32, ptr %9, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %52, %51
  %69 = phi i32 [ %.pre31, %52 ], [ %3, %51 ]
  %70 = phi i32 [ %.pre, %52 ], [ %25, %51 ]
  %71 = icmp slt i32 %70, %69
  br i1 %71, label %72, label %90

72:                                               ; preds = %68
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #3
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = add nsw i32 %75, -1
  store i32 %76, ptr %15, align 4, !tbaa !5
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sub nsw i32 %74, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #3
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %80
  %82 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %5, ptr noundef nonnull align 4 dereferenceable(8) %81)
  store i64 %82, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #3
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = load i32, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = call i64 @_Z7seg_queiiii(i32 noundef %84, i32 noundef %85, i32 noundef %86, i32 noundef %87)
  store i64 %88, ptr %17, align 8
  %89 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %17)
  store i64 %89, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #3
  %.pre32 = load i32, ptr %7, align 4, !tbaa !5
  %.pre33 = load i32, ptr %10, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %72, %68
  %91 = phi i32 [ %.pre33, %72 ], [ %70, %68 ]
  %92 = phi i32 [ %.pre32, %72 ], [ %1, %68 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #3
  %93 = sext i32 %26 to i64
  %94 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %93
  %95 = sub nsw i32 %92, %91
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100001 x %struct.Hash], ptr @pw, i64 0, i64 %96
  %98 = call i64 @_ZNK4HashmlERKS_(ptr noundef nonnull align 4 dereferenceable(8) %94, ptr noundef nonnull align 4 dereferenceable(8) %97)
  store i64 %98, ptr %18, align 8
  %99 = sext i32 %28 to i64
  %100 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %99
  %101 = call i64 @_ZNK4HashplERKS_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(8) %100)
  %102 = getelementptr inbounds [200003 x %struct.Hash], ptr @seg, i64 0, i64 %29
  store i64 %101, ptr %102, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #3
  br label %103

103:                                              ; preds = %90, %20
  %.in = phi ptr [ %5, %90 ], [ %22, %20 ]
  %104 = load i64, ptr %.in, align 4
  ret i64 %104
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!7, !7, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass