; LLVM IR from ravireddy07/cpp-book :: src/Code-Forces/Good_Bye2020_apollo-versus-pan.ll (Z5harryv)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@ntot = external dso_local global [62 x i32], align 16
@nco = external dso_local global [62 x [62 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5harryv() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %45, %0
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = icmp slt i32 %23, 62
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %48

26:                                               ; preds = %22
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %28
  store i32 0, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %41, %26
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 62
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 5, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %44

34:                                               ; preds = %30
  %35 = load i32, ptr %1, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %36
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [62 x i32], ptr %37, i64 0, i64 %39
  store i32 0, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %34
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !9

44:                                               ; preds = %33
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %1, align 4, !tbaa !5
  br label %22, !llvm.loop !11

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

49:                                               ; preds = %104, %48
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = load i32, ptr @N, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  store i32 8, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %107

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %100, %54
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = icmp sle i32 %57, 60
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 11, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %103

60:                                               ; preds = %56
  %61 = load i64, ptr %5, align 8, !tbaa !12
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = shl i64 1, %63
  %65 = and i64 %61, %64
  %66 = icmp ne i64 %65, 0
  br i1 %66, label %67, label %99

67:                                               ; preds = %60
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %70, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %95, %67
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = icmp sle i32 %74, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %73
  store i32 14, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %98

78:                                               ; preds = %73
  %79 = load i64, ptr %5, align 8, !tbaa !12
  %80 = load i32, ptr %7, align 4, !tbaa !5
  %81 = zext i32 %80 to i64
  %82 = shl i64 1, %81
  %83 = and i64 %79, %82
  %84 = icmp ne i64 %83, 0
  br i1 %84, label %85, label %94

85:                                               ; preds = %78
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [62 x i32], ptr %88, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %91, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %85, %78
  br label %95

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

98:                                               ; preds = %77
  br label %99

99:                                               ; preds = %98, %60
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %6, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %6, align 4, !tbaa !5
  br label %56, !llvm.loop !15

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

104:                                              ; preds = %103
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !16

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

108:                                              ; preds = %137, %107
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = icmp slt i32 %109, 62
  br i1 %110, label %112, label %111

111:                                              ; preds = %108
  store i32 17, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %140

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %9, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %133, %112
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = icmp slt i32 %116, 62
  br i1 %117, label %119, label %118

118:                                              ; preds = %115
  store i32 20, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %136

119:                                              ; preds = %115
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %121
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [62 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %128
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [62 x i32], ptr %129, i64 0, i64 %131
  store i32 %126, ptr %132, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %119
  %134 = load i32, ptr %9, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %9, align 4, !tbaa !5
  br label %115, !llvm.loop !17

136:                                              ; preds = %118
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %8, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %8, align 4, !tbaa !5
  br label %108, !llvm.loop !18

140:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store i64 0, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %220, %140
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = icmp slt i32 %142, 62
  br i1 %143, label %145, label %144

144:                                              ; preds = %141
  store i32 23, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %223

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %146

146:                                              ; preds = %216, %145
  %147 = load i32, ptr %12, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 62
  br i1 %148, label %150, label %149

149:                                              ; preds = %146
  store i32 26, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %219

150:                                              ; preds = %146
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %151 = load i32, ptr %11, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  store i64 %155, ptr %13, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %156 = load i32, ptr %11, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %157
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [62 x i32], ptr %158, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  store i64 %163, ptr %14, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %164 = load i32, ptr %11, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = load i32, ptr %11, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %169
  %171 = load i32, ptr %12, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [62 x i32], ptr %170, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = sub nsw i32 %167, %174
  %176 = sext i32 %175 to i64
  store i64 %176, ptr %15, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %177 = load i64, ptr %13, align 8, !tbaa !12
  %178 = load i64, ptr %14, align 8, !tbaa !12
  %179 = mul nsw i64 %177, %178
  %180 = load i32, ptr @N, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = mul nsw i64 %179, %181
  store i64 %182, ptr %16, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %183 = load i64, ptr %13, align 8, !tbaa !12
  %184 = load i64, ptr %15, align 8, !tbaa !12
  %185 = mul nsw i64 %183, %184
  %186 = load i32, ptr %12, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %187
  %189 = load i32, ptr %188, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = mul nsw i64 %185, %190
  store i64 %191, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %192 = load i64, ptr %16, align 8, !tbaa !12
  %193 = load i64, ptr %17, align 8, !tbaa !12
  %194 = add nsw i64 %192, %193
  %195 = srem i64 %194, 1000000007
  store i64 %195, ptr %18, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %196 = load i32, ptr %11, align 4, !tbaa !5
  %197 = zext i32 %196 to i64
  %198 = shl i64 1, %197
  %199 = srem i64 %198, 1000000007
  store i64 %199, ptr %19, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %200 = load i32, ptr %12, align 4, !tbaa !5
  %201 = zext i32 %200 to i64
  %202 = shl i64 1, %201
  %203 = srem i64 %202, 1000000007
  store i64 %203, ptr %20, align 8, !tbaa !12
  %204 = load i64, ptr %18, align 8, !tbaa !12
  %205 = load i64, ptr %19, align 8, !tbaa !12
  %206 = mul nsw i64 %204, %205
  %207 = srem i64 %206, 1000000007
  store i64 %207, ptr %18, align 8, !tbaa !12
  %208 = load i64, ptr %18, align 8, !tbaa !12
  %209 = load i64, ptr %20, align 8, !tbaa !12
  %210 = mul nsw i64 %208, %209
  %211 = srem i64 %210, 1000000007
  store i64 %211, ptr %18, align 8, !tbaa !12
  %212 = load i64, ptr %10, align 8, !tbaa !12
  %213 = load i64, ptr %18, align 8, !tbaa !12
  %214 = add nsw i64 %212, %213
  %215 = srem i64 %214, 1000000007
  store i64 %215, ptr %10, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %216

216:                                              ; preds = %150
  %217 = load i32, ptr %12, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %12, align 4, !tbaa !5
  br label %146, !llvm.loop !19

219:                                              ; preds = %149
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %11, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %11, align 4, !tbaa !5
  br label %141, !llvm.loop !20

223:                                              ; preds = %144
  %224 = load i64, ptr %10, align 8, !tbaa !12
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %224)
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %225, ptr noundef @.str)
  store i32 1, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 align 2

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 = { "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 nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i32, align 4
@ntot = external dso_local local_unnamed_addr global [62 x i32], align 16
@nco = external dso_local local_unnamed_addr global [62 x [62 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5harryv() local_unnamed_addr #0 {
.preheader68:
  %0 = alloca i64, align 8
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(248) @ntot, i8 0, i64 248, i1 false), !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(15376) @nco, i8 0, i64 15376, i1 false), !tbaa !5
  %2 = load i32, ptr @N, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.preheader66

.preheader66:                                     ; preds = %6, %.preheader68
  %.lcssa = phi i32 [ %2, %.preheader68 ], [ %8, %6 ]
  br label %40

.lr.ph:                                           ; preds = %.preheader68, %6
  %.05573 = phi i32 [ %7, %6 ], [ 0, %.preheader68 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #5
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %0)
  %5 = load i64, ptr %0, align 8, !tbaa !9
  br label %10

6:                                                ; preds = %.loopexit67
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #5
  %7 = add nuw nsw i32 %.05573, 1
  %8 = load i32, ptr @N, align 4, !tbaa !5
  %9 = icmp slt i32 %7, %8
  br i1 %9, label %.lr.ph, label %.preheader66, !llvm.loop !11

10:                                               ; preds = %.lr.ph, %.loopexit67
  %indvars.iv90 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next91, %.loopexit67 ]
  %indvars.iv88 = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next89, %.loopexit67 ]
  %11 = shl nuw nsw i64 1, %indvars.iv90
  %12 = and i64 %5, %11
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %.loopexit67, label %13

13:                                               ; preds = %10
  %14 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %indvars.iv90
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr %14, align 4, !tbaa !5
  %xtraiter = and i64 %indvars.iv88, 1
  %17 = icmp eq i64 %indvars.iv90, 0
  br i1 %17, label %.loopexit67.loopexit.unr-lcssa, label %.new

.new:                                             ; preds = %13
  %unroll_iter = and i64 %indvars.iv88, 9223372036854775806
  br label %18

18:                                               ; preds = %32, %.new
  %indvars.iv = phi i64 [ 0, %.new ], [ %indvars.iv.next.1, %32 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.1, %32 ]
  %19 = shl nuw i64 1, %indvars.iv
  %20 = and i64 %19, %5
  %.not64 = icmp eq i64 %20, 0
  br i1 %.not64, label %25, label %21

21:                                               ; preds = %18
  %22 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %indvars.iv90, i64 %indvars.iv
  %23 = load i32, ptr %22, align 8, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %22, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %18, %21
  %26 = shl nuw i64 2, %indvars.iv
  %27 = and i64 %26, %5
  %.not64.1 = icmp eq i64 %27, 0
  br i1 %.not64.1, label %32, label %28

28:                                               ; preds = %25
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %29 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %indvars.iv90, i64 %indvars.iv.next
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %28, %25
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit67.loopexit.unr-lcssa, label %18, !llvm.loop !13

.loopexit67.loopexit.unr-lcssa:                   ; preds = %32, %13
  %indvars.iv.unr = phi i64 [ 0, %13 ], [ %indvars.iv.next.1, %32 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit67, label %.epil.preheader

.epil.preheader:                                  ; preds = %.loopexit67.loopexit.unr-lcssa
  %33 = shl nuw i64 1, %indvars.iv.unr
  %34 = and i64 %33, %5
  %.not64.epil = icmp eq i64 %34, 0
  br i1 %.not64.epil, label %.loopexit67, label %35

35:                                               ; preds = %.epil.preheader
  %36 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %indvars.iv90, i64 %indvars.iv.unr
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  br label %.loopexit67

.loopexit67:                                      ; preds = %.loopexit67.loopexit.unr-lcssa, %35, %.epil.preheader, %10
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next91, 61
  br i1 %exitcond95.not, label %6, label %10, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph75, %40
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next103, 62
  br i1 %exitcond105.not, label %.preheader65, label %40, !llvm.loop !15

.preheader65:                                     ; preds = %.loopexit
  %39 = sext i32 %.lcssa to i64
  br label %.preheader

40:                                               ; preds = %.preheader66, %.loopexit
  %indvars.iv102 = phi i64 [ 0, %.preheader66 ], [ %indvars.iv.next103, %.loopexit ]
  %indvars.iv96 = phi i64 [ 1, %.preheader66 ], [ %indvars.iv.next97, %.loopexit ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %41 = icmp ult i64 %indvars.iv102, 61
  br i1 %41, label %.lr.ph75, label %.loopexit

.lr.ph75:                                         ; preds = %40, %.lr.ph75
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.lr.ph75 ], [ %indvars.iv96, %40 ]
  %42 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %indvars.iv98, i64 %indvars.iv102
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %indvars.iv102, i64 %indvars.iv98
  store i32 %43, ptr %44, align 4, !tbaa !5
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond101.not = icmp eq i64 %indvars.iv.next99, 62
  br i1 %exitcond101.not, label %.loopexit, label %.lr.ph75, !llvm.loop !16

.preheader:                                       ; preds = %.preheader65, %53
  %indvars.iv110 = phi i64 [ 0, %.preheader65 ], [ %indvars.iv.next111, %53 ]
  %.06279 = phi i64 [ 0, %.preheader65 ], [ %73, %53 ]
  %45 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %indvars.iv110
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = shl nuw i64 1, %indvars.iv110
  %49 = srem i64 %48, 1000000007
  br label %54

50:                                               ; preds = %53
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %73)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %51, ptr noundef nonnull @.str)
  ret void

53:                                               ; preds = %54
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %exitcond113.not = icmp eq i64 %indvars.iv.next111, 62
  br i1 %exitcond113.not, label %50, label %.preheader, !llvm.loop !17

54:                                               ; preds = %.preheader, %54
  %indvars.iv106 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next107, %54 ]
  %.177 = phi i64 [ %.06279, %.preheader ], [ %73, %54 ]
  %55 = getelementptr inbounds [62 x [62 x i32]], ptr @nco, i64 0, i64 %indvars.iv110, i64 %indvars.iv106
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = sub nsw i32 %46, %56
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %57, %39
  %61 = getelementptr inbounds [62 x i32], ptr @ntot, i64 0, i64 %indvars.iv106
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = mul nsw i64 %63, %59
  %reass.add = add i64 %64, %60
  %reass.mul = mul i64 %reass.add, %47
  %65 = srem i64 %reass.mul, 1000000007
  %66 = shl nuw nsw i64 1, %indvars.iv106
  %67 = urem i64 %66, 1000000007
  %68 = mul nsw i64 %65, %49
  %69 = srem i64 %68, 1000000007
  %70 = mul nsw i64 %69, %67
  %71 = srem i64 %70, 1000000007
  %72 = add nsw i64 %71, %.177
  %73 = srem i64 %72, 1000000007
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond109.not = icmp eq i64 %indvars.iv.next107, 62
  br i1 %exitcond109.not, label %53, label %54, !llvm.loop !18
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0 align 2

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

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 = { "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}


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