; LLVM IR from tangjz/acm-icpc :: codeforces/complete (1091H)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [3126 x i64] }

@win = external dso_local global ptr, align 8
@lose = external dso_local global ptr, align 8
@tot = external dso_local global i32, align 4
@pr = external dso_local global [200001 x i32], align 16
@d = external dso_local global [200001 x i32], align 16
@sg = external dso_local global [200001 x i32], align 16
@tr = external dso_local global { [3126 x i64] }, align 8
@vis = external dso_local global %"class.std::vector", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::bitset", align 8
  %10 = alloca %"class.std::bitset", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 2, ptr %4, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %97, %0
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = icmp slt i32 %17, 200001
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %100

20:                                               ; preds = %16
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %35, label %26

26:                                               ; preds = %20
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %29
  store i32 %27, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr @tot, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr @tot, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [200001 x i32], ptr @pr, i64 0, i64 %33
  store i32 %27, ptr %34, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %26, %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  br label %36

36:                                               ; preds = %64, %35
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200001 x i32], ptr @pr, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = mul nsw i32 %37, %41
  store i32 %42, ptr %7, align 4, !tbaa !5
  %43 = icmp slt i32 %42, 200001
  br i1 %43, label %45, label %44

44:                                               ; preds = %36
  store i32 5, ptr %5, align 4
  br label %67

45:                                               ; preds = %36
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [200001 x i32], ptr @pr, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %51
  store i32 %49, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [200001 x i32], ptr @pr, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %56, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %45
  store i32 5, ptr %5, align 4
  br label %67

63:                                               ; preds = %45
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %6, align 4, !tbaa !5
  br label %36, !llvm.loop !9

67:                                               ; preds = %62, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %4, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = icmp eq i32 %72, %73
  br i1 %74, label %92, label %75

75:                                               ; preds = %68
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = sdiv i32 %76, %80
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sdiv i32 %82, %86
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp eq i32 %81, %90
  br i1 %91, label %92, label %96

92:                                               ; preds = %75, %68
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(25008) @tr, i64 noundef %94, i1 noundef zeroext true)
  br label %96

96:                                               ; preds = %92, %75
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %4, align 4, !tbaa !5
  br label %16, !llvm.loop !11

100:                                              ; preds = %19
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE5resetEm(ptr noundef nonnull align 8 dereferenceable(25008) @tr, i64 noundef %102)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %155, %100
  %105 = load i32, ptr %8, align 4, !tbaa !5
  %106 = icmp slt i32 %105, 200001
  br i1 %106, label %108, label %107

107:                                              ; preds = %104
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %158

108:                                              ; preds = %104
  br label %109

109:                                              ; preds = %130, %108
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = call noundef i64 @_ZNKSt6vectorISt6bitsetILm200001EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vis) #6
  %116 = icmp ult i64 %114, %115
  br i1 %116, label %117, label %127

117:                                              ; preds = %109
  %118 = load i32, ptr %8, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vis, i64 noundef %122) #6
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = call noundef zeroext i1 @_ZNKSt6bitsetILm200001EE4testEm(ptr noundef nonnull align 8 dereferenceable(25008) %123, i64 noundef %125)
  br label %127

127:                                              ; preds = %117, %109
  %128 = phi i1 [ false, %109 ], [ %126, %117 ]
  br i1 %128, label %129, label %136

129:                                              ; preds = %127
  br label %130

130:                                              ; preds = %129
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %133, align 4, !tbaa !5
  br label %109, !llvm.loop !12

136:                                              ; preds = %127
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = call noundef i64 @_ZNKSt6vectorISt6bitsetILm200001EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vis) #6
  %143 = icmp eq i64 %141, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 25008, ptr %9) #6
  call void @_ZNSt6bitsetILm200001EEC2Ev(ptr noundef nonnull align 8 dereferenceable(25008) %9) #6
  call void @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @vis, ptr noundef nonnull align 8 dereferenceable(25008) %9)
  call void @llvm.lifetime.end.p0(i64 25008, ptr %9) #6
  br label %145

145:                                              ; preds = %144, %136
  call void @llvm.lifetime.start.p0(i64 25008, ptr %10) #6
  %146 = load i32, ptr %8, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  call void @_ZNKSt6bitsetILm200001EElsEm(ptr dead_on_unwind writable sret(%"class.std::bitset") align 8 %10, ptr noundef nonnull align 8 dereferenceable(25008) @tr, i64 noundef %147) #6
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vis, i64 noundef %152) #6
  %154 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(25008) %153, ptr noundef nonnull align 8 dereferenceable(25008) %10) #6
  call void @llvm.lifetime.end.p0(i64 25008, ptr %10) #6
  br label %155

155:                                              ; preds = %145
  %156 = load i32, ptr %8, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %8, align 4, !tbaa !5
  br label %104, !llvm.loop !13

158:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %163, %158
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = add nsw i32 %160, -1
  store i32 %161, ptr %2, align 4, !tbaa !5
  %162 = icmp ne i32 %160, 0
  br i1 %162, label %163, label %182

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %164 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %12, ptr noundef %13, ptr noundef %14)
  %165 = load i32, ptr %13, align 4, !tbaa !5
  %166 = load i32, ptr %12, align 4, !tbaa !5
  %167 = sub nsw i32 %165, %166
  %168 = sub nsw i32 %167, 1
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = load i32, ptr %14, align 4, !tbaa !5
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = sub nsw i32 %172, %173
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = xor i32 %171, %178
  %180 = load i32, ptr %11, align 4, !tbaa !5
  %181 = xor i32 %180, %179
  store i32 %181, ptr %11, align 4, !tbaa !5
  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 %159, !llvm.loop !14

182:                                              ; preds = %159
  %183 = load i32, ptr %11, align 4, !tbaa !5
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %186, label %185

185:                                              ; preds = %182
  call void @_ZSt4swapIPKcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8) @win, ptr noundef nonnull align 8 dereferenceable(8) @lose) #6
  br label %186

186:                                              ; preds = %185, %182
  %187 = load ptr, ptr @win, align 8, !tbaa !15
  %188 = call i32 @puts(ptr noundef %187)
  %189 = load ptr, ptr @lose, align 8, !tbaa !15
  %190 = call i32 @puts(ptr noundef %189)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %191 = load i32, ptr %1, align 4
  ret i32 %191
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef, i1 noundef zeroext) #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm200001EE4testEm(ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(25008)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm200001EEC2Ev(ptr noundef nonnull align 8 dereferenceable(25008)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt6bitsetILm200001EElsEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPKcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

declare i32 @puts(ptr noundef) #2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::bitset<200001>, std::allocator<std::bitset<200001>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::bitset" = type { %"struct.std::_Base_bitset" }
%"struct.std::_Base_bitset" = type { [3126 x i64] }

@win = external dso_local global ptr, align 8
@lose = external dso_local global ptr, align 8
@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [200001 x i32], align 16
@d = external dso_local local_unnamed_addr global [200001 x i32], align 16
@sg = external dso_local local_unnamed_addr global [200001 x i32], align 16
@tr = external dso_local global { [3126 x i64] }, align 8
@vis = external dso_local global %"class.std::vector", align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::bitset", align 8
  %4 = alloca %"class.std::bitset", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2)
  br label %13

9:                                                ; preds = %48
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE5resetEm(ptr noundef nonnull align 8 dereferenceable(25008) @tr, i64 noundef %11)
  br label %.preheader38

13:                                               ; preds = %0, %48
  %indvars.iv55 = phi i64 [ 2, %0 ], [ %indvars.iv.next56, %48 ]
  %14 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %indvars.iv55
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %.not37 = icmp eq i32 %15, 0
  %16 = trunc nuw nsw i64 %indvars.iv55 to i32
  br i1 %.not37, label %17, label %._crit_edge62

17:                                               ; preds = %13
  store i32 %16, ptr %14, align 4, !tbaa !5
  %18 = load i32, ptr @tot, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr @tot, align 4, !tbaa !5
  %20 = sext i32 %18 to i64
  %21 = getelementptr inbounds [200001 x i32], ptr @pr, i64 0, i64 %20
  store i32 %16, ptr %21, align 4, !tbaa !5
  br label %._crit_edge62

._crit_edge62:                                    ; preds = %13, %17
  %22 = phi i32 [ %16, %17 ], [ %15, %13 ]
  %23 = load i32, ptr @pr, align 16, !tbaa !5
  %24 = mul nsw i32 %23, %16
  %25 = icmp slt i32 %24, 200001
  br i1 %25, label %.lr.ph, label %._crit_edge

26:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = getelementptr inbounds [200001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = mul nsw i32 %28, %16
  %30 = icmp slt i32 %29, 200001
  br i1 %30, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge62, %26
  %indvars.iv = phi i64 [ %indvars.iv.next, %26 ], [ 0, %._crit_edge62 ]
  %31 = phi i32 [ %29, %26 ], [ %24, %._crit_edge62 ]
  %32 = phi i32 [ %28, %26 ], [ %23, %._crit_edge62 ]
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %33
  store i32 %32, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %14, align 4, !tbaa !5
  %36 = icmp eq i32 %35, %32
  br i1 %36, label %._crit_edge, label %26

._crit_edge:                                      ; preds = %26, %.lr.ph, %._crit_edge62
  %37 = phi i32 [ %22, %._crit_edge62 ], [ %35, %.lr.ph ], [ %35, %26 ]
  %38 = zext i32 %37 to i64
  %39 = icmp eq i64 %indvars.iv55, %38
  br i1 %39, label %46, label %40

40:                                               ; preds = %._crit_edge
  %41 = sdiv i32 %16, %37
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [200001 x i32], ptr @d, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = icmp eq i32 %41, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %40, %._crit_edge
  %47 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(25008) @tr, i64 noundef %indvars.iv55, i1 noundef zeroext true)
  br label %48

48:                                               ; preds = %40, %46
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next56, 200001
  br i1 %exitcond.not, label %9, label %13, !llvm.loop !11

.preheader38:                                     ; preds = %9, %71
  %indvars.iv58 = phi i64 [ 0, %9 ], [ %indvars.iv.next59, %71 ]
  %49 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %indvars.iv58
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = call noundef i64 @_ZNKSt6vectorISt6bitsetILm200001EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vis) #6
  %53 = icmp ugt i64 %52, %51
  br i1 %53, label %.lr.ph44, label %.critedge

.preheader:                                       ; preds = %71
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %1, align 4, !tbaa !5
  %.not50 = icmp eq i32 %54, 0
  br i1 %.not50, label %._crit_edge53.thread, label %.lr.ph52

.lr.ph44:                                         ; preds = %.preheader38, %60
  %56 = load i32, ptr %49, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vis, i64 noundef %57) #6
  %59 = call noundef zeroext i1 @_ZNKSt6bitsetILm200001EE4testEm(ptr noundef nonnull align 8 dereferenceable(25008) %58, i64 noundef %indvars.iv58)
  br i1 %59, label %60, label %.critedge

60:                                               ; preds = %.lr.ph44
  %61 = load i32, ptr %49, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %49, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = call noundef i64 @_ZNKSt6vectorISt6bitsetILm200001EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vis) #6
  %65 = icmp ugt i64 %64, %63
  br i1 %65, label %.lr.ph44, label %.critedge, !llvm.loop !12

.critedge:                                        ; preds = %.lr.ph44, %60, %.preheader38
  %66 = load i32, ptr %49, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = call noundef i64 @_ZNKSt6vectorISt6bitsetILm200001EESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @vis) #6
  %69 = icmp eq i64 %68, %67
  br i1 %69, label %70, label %71

70:                                               ; preds = %.critedge
  call void @llvm.lifetime.start.p0(i64 25008, ptr nonnull %3) #6
  call void @_ZNSt6bitsetILm200001EEC2Ev(ptr noundef nonnull align 8 dereferenceable(25008) %3) #6
  call void @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) @vis, ptr noundef nonnull align 8 dereferenceable(25008) %3)
  call void @llvm.lifetime.end.p0(i64 25008, ptr nonnull %3) #6
  br label %71

71:                                               ; preds = %70, %.critedge
  call void @llvm.lifetime.start.p0(i64 25008, ptr nonnull %4) #6
  call void @_ZNKSt6bitsetILm200001EElsEm(ptr dead_on_unwind nonnull writable sret(%"class.std::bitset") align 8 %4, ptr noundef nonnull align 8 dereferenceable(25008) @tr, i64 noundef %indvars.iv58) #6
  %72 = load i32, ptr %49, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @vis, i64 noundef %73) #6
  %75 = call noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EEoRERKS0_(ptr noundef nonnull align 8 dereferenceable(25008) %74, ptr noundef nonnull align 8 dereferenceable(25008) %4) #6
  call void @llvm.lifetime.end.p0(i64 25008, ptr nonnull %4) #6
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next59, 200001
  br i1 %exitcond61.not, label %.preheader, label %.preheader38, !llvm.loop !13

.lr.ph52:                                         ; preds = %.preheader, %.lr.ph52
  %.051 = phi i32 [ %91, %.lr.ph52 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %76 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = xor i32 %78, -1
  %80 = add i32 %77, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = xor i32 %77, -1
  %86 = add i32 %84, %85
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [200001 x i32], ptr @sg, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = xor i32 %83, %.051
  %91 = xor i32 %90, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  %92 = load i32, ptr %1, align 4, !tbaa !5
  %93 = add nsw i32 %92, -1
  store i32 %93, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %92, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !14

._crit_edge53:                                    ; preds = %.lr.ph52
  %94 = icmp eq i32 %90, %89
  br i1 %94, label %._crit_edge53.thread, label %95

._crit_edge53.thread:                             ; preds = %.preheader, %._crit_edge53
  call void @_ZSt4swapIPKcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8) @win, ptr noundef nonnull align 8 dereferenceable(8) @lose) #6
  br label %95

95:                                               ; preds = %._crit_edge53.thread, %._crit_edge53
  %96 = load ptr, ptr @win, align 8, !tbaa !15
  %97 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %96)
  %98 = load ptr, ptr @lose, align 8, !tbaa !15
  %99 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %98)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE3setEmb(ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef, i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25008) ptr @_ZNSt6bitsetILm200001EE5resetEm(ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef) local_unnamed_addr #3 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6bitsetILm200001EE4testEm(ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt6bitsetILm200001EESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(25008)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6bitsetILm200001EEC2Ev(ptr noundef nonnull align 8 dereferenceable(25008)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNKSt6bitsetILm200001EElsEm(ptr dead_on_unwind noalias writable sret(%"class.std::bitset") align 8, ptr noundef nonnull align 8 dereferenceable(25008), i64 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIPKcENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS5_ESt18is_move_assignableIS5_EEE5valueEvE4typeERS5_SE_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}


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