; LLVM IR from abeaumont/competitive-programming :: codechef/feb20a (longcook)

; 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" }

@s = external dso_local global [4800 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !11
  br label %24

24:                                               ; preds = %101, %0
  %25 = load i32, ptr %3, align 4, !tbaa !11
  %26 = icmp slt i32 %25, 4800
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %104

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %29 = load i32, ptr %3, align 4, !tbaa !11
  %30 = sdiv i32 %29, 12
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %32 = load i32, ptr %3, align 4, !tbaa !11
  %33 = srem i32 %32, 12
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %5, align 4, !tbaa !11
  %35 = load i32, ptr %5, align 4, !tbaa !11
  %36 = icmp eq i32 %35, 2
  br i1 %36, label %37, label %67

37:                                               ; preds = %28
  %38 = load i32, ptr %4, align 4, !tbaa !11
  %39 = call noundef zeroext i1 @_Z6isleapi(i32 noundef %38)
  br i1 %39, label %40, label %53

40:                                               ; preds = %37
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = srem i64 %41, 7
  %43 = icmp eq i64 %42, 5
  br i1 %43, label %44, label %50

44:                                               ; preds = %40
  %45 = load i32, ptr %3, align 4, !tbaa !11
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %47, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %44, %40
  %51 = load i64, ptr %2, align 8, !tbaa !8
  %52 = add nsw i64 %51, 29
  store i64 %52, ptr %2, align 8, !tbaa !8
  br label %66

53:                                               ; preds = %37
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = srem i64 %54, 7
  %56 = icmp sge i64 %55, 5
  br i1 %56, label %57, label %63

57:                                               ; preds = %53
  %58 = load i32, ptr %3, align 4, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !11
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %57, %53
  %64 = load i64, ptr %2, align 8, !tbaa !8
  %65 = add nsw i64 %64, 28
  store i64 %65, ptr %2, align 8, !tbaa !8
  br label %66

66:                                               ; preds = %63, %50
  br label %86

67:                                               ; preds = %28
  %68 = load i32, ptr %5, align 4, !tbaa !11
  %69 = icmp eq i32 %68, 4
  br i1 %69, label %79, label %70

70:                                               ; preds = %67
  %71 = load i32, ptr %5, align 4, !tbaa !11
  %72 = icmp eq i32 %71, 6
  br i1 %72, label %79, label %73

73:                                               ; preds = %70
  %74 = load i32, ptr %5, align 4, !tbaa !11
  %75 = icmp eq i32 %74, 9
  br i1 %75, label %79, label %76

76:                                               ; preds = %73
  %77 = load i32, ptr %5, align 4, !tbaa !11
  %78 = icmp eq i32 %77, 11
  br i1 %78, label %79, label %82

79:                                               ; preds = %76, %73, %70, %67
  %80 = load i64, ptr %2, align 8, !tbaa !8
  %81 = add nsw i64 %80, 30
  store i64 %81, ptr %2, align 8, !tbaa !8
  br label %85

82:                                               ; preds = %76
  %83 = load i64, ptr %2, align 8, !tbaa !8
  %84 = add nsw i64 %83, 31
  store i64 %84, ptr %2, align 8, !tbaa !8
  br label %85

85:                                               ; preds = %82, %79
  br label %86

86:                                               ; preds = %85, %66
  %87 = load i32, ptr %3, align 4, !tbaa !11
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %100

89:                                               ; preds = %86
  %90 = load i32, ptr %3, align 4, !tbaa !11
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = load i32, ptr %3, align 4, !tbaa !11
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !11
  %99 = add nsw i32 %98, %94
  store i32 %99, ptr %97, align 4, !tbaa !11
  br label %100

100:                                              ; preds = %89, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %3, align 4, !tbaa !11
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %3, align 4, !tbaa !11
  br label %24, !llvm.loop !13

104:                                              ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %105 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %106

106:                                              ; preds = %229, %227, %104
  %107 = load i32, ptr %6, align 4, !tbaa !11
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %6, align 4, !tbaa !11
  %109 = icmp ne i32 %107, 0
  br i1 %109, label %110, label %230

110:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %111 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %113 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %112, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %113, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %115 = load i64, ptr %7, align 8, !tbaa !8
  %116 = add nsw i64 %115, -1
  store i64 %116, ptr %7, align 8, !tbaa !8
  %117 = load i64, ptr %8, align 8, !tbaa !8
  %118 = add nsw i64 %117, -1
  store i64 %118, ptr %8, align 8, !tbaa !8
  %119 = load i64, ptr %9, align 8, !tbaa !8
  %120 = add nsw i64 %119, -1
  store i64 %120, ptr %9, align 8, !tbaa !8
  %121 = load i64, ptr %10, align 8, !tbaa !8
  %122 = add nsw i64 %121, -1
  store i64 %122, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %123 = load i64, ptr %8, align 8, !tbaa !8
  %124 = mul nsw i64 %123, 12
  %125 = load i64, ptr %7, align 8, !tbaa !8
  %126 = add nsw i64 %124, %125
  store i64 %126, ptr %11, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %127 = load i64, ptr %10, align 8, !tbaa !8
  %128 = mul nsw i64 %127, 12
  %129 = load i64, ptr %9, align 8, !tbaa !8
  %130 = add nsw i64 %128, %129
  store i64 %130, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %131 = load i64, ptr %11, align 8, !tbaa !8
  %132 = icmp ne i64 %131, 0
  br i1 %132, label %133, label %138

133:                                              ; preds = %110
  %134 = load i64, ptr %11, align 8, !tbaa !8
  %135 = sub nsw i64 %134, 1
  %136 = sdiv i64 %135, 4800
  %137 = add nsw i64 %136, 1
  br label %139

138:                                              ; preds = %110
  br label %139

139:                                              ; preds = %138, %133
  %140 = phi i64 [ %137, %133 ], [ 0, %138 ]
  store i64 %140, ptr %13, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %141 = load i64, ptr %12, align 8, !tbaa !8
  %142 = add nsw i64 %141, 1
  %143 = sdiv i64 %142, 4800
  %144 = sub nsw i64 %143, 1
  store i64 %144, ptr %14, align 8, !tbaa !8
  %145 = load i64, ptr %13, align 8, !tbaa !8
  %146 = load i64, ptr %14, align 8, !tbaa !8
  %147 = icmp sgt i64 %145, %146
  br i1 %147, label %148, label %189

148:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %149 = load i64, ptr %12, align 8, !tbaa !8
  %150 = load i64, ptr %11, align 8, !tbaa !8
  %151 = sub nsw i64 %149, %150
  %152 = sdiv i64 %151, 4800
  %153 = load i32, ptr getelementptr inbounds ([4800 x i32], ptr @s, i64 0, i64 4799), align 4, !tbaa !11
  %154 = sext i32 %153 to i64
  %155 = mul nsw i64 %152, %154
  store i64 %155, ptr %15, align 8, !tbaa !8
  %156 = load i64, ptr %11, align 8, !tbaa !8
  %157 = srem i64 %156, 4800
  store i64 %157, ptr %11, align 8, !tbaa !8
  %158 = load i64, ptr %12, align 8, !tbaa !8
  %159 = srem i64 %158, 4800
  store i64 %159, ptr %12, align 8, !tbaa !8
  %160 = load i64, ptr %11, align 8, !tbaa !8
  %161 = load i64, ptr %12, align 8, !tbaa !8
  %162 = icmp sgt i64 %160, %161
  br i1 %162, label %163, label %168

163:                                              ; preds = %148
  %164 = load i32, ptr getelementptr inbounds ([4800 x i32], ptr @s, i64 0, i64 4799), align 4, !tbaa !11
  %165 = sext i32 %164 to i64
  %166 = load i64, ptr %15, align 8, !tbaa !8
  %167 = add nsw i64 %166, %165
  store i64 %167, ptr %15, align 8, !tbaa !8
  br label %168

168:                                              ; preds = %163, %148
  %169 = load i64, ptr %12, align 8, !tbaa !8
  %170 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !11
  %172 = sext i32 %171 to i64
  %173 = load i64, ptr %15, align 8, !tbaa !8
  %174 = add nsw i64 %173, %172
  store i64 %174, ptr %15, align 8, !tbaa !8
  %175 = load i64, ptr %11, align 8, !tbaa !8
  %176 = icmp ne i64 %175, 0
  br i1 %176, label %177, label %185

177:                                              ; preds = %168
  %178 = load i64, ptr %11, align 8, !tbaa !8
  %179 = sub nsw i64 %178, 1
  %180 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !11
  %182 = sext i32 %181 to i64
  %183 = load i64, ptr %15, align 8, !tbaa !8
  %184 = sub nsw i64 %183, %182
  store i64 %184, ptr %15, align 8, !tbaa !8
  br label %185

185:                                              ; preds = %177, %168
  %186 = load i64, ptr %15, align 8, !tbaa !8
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %186)
  %188 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %187, i8 noundef signext 10)
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %227

189:                                              ; preds = %139
  %190 = load i64, ptr %11, align 8, !tbaa !8
  %191 = srem i64 %190, 4800
  store i64 %191, ptr %11, align 8, !tbaa !8
  %192 = load i64, ptr %12, align 8, !tbaa !8
  %193 = srem i64 %192, 4800
  store i64 %193, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %194 = load i32, ptr getelementptr inbounds ([4800 x i32], ptr @s, i64 0, i64 4799), align 4, !tbaa !11
  %195 = sext i32 %194 to i64
  %196 = load i64, ptr %14, align 8, !tbaa !8
  %197 = load i64, ptr %13, align 8, !tbaa !8
  %198 = sub nsw i64 %196, %197
  %199 = add nsw i64 %198, 1
  %200 = mul nsw i64 %195, %199
  store i64 %200, ptr %17, align 8, !tbaa !8
  %201 = load i64, ptr %11, align 8, !tbaa !8
  %202 = icmp ne i64 %201, 0
  br i1 %202, label %203, label %213

203:                                              ; preds = %189
  %204 = load i32, ptr getelementptr inbounds ([4800 x i32], ptr @s, i64 0, i64 4799), align 4, !tbaa !11
  %205 = load i64, ptr %11, align 8, !tbaa !8
  %206 = sub nsw i64 %205, 1
  %207 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !11
  %209 = sub nsw i32 %204, %208
  %210 = sext i32 %209 to i64
  %211 = load i64, ptr %17, align 8, !tbaa !8
  %212 = add nsw i64 %211, %210
  store i64 %212, ptr %17, align 8, !tbaa !8
  br label %213

213:                                              ; preds = %203, %189
  %214 = load i64, ptr %12, align 8, !tbaa !8
  %215 = icmp slt i64 %214, 4799
  br i1 %215, label %216, label %223

216:                                              ; preds = %213
  %217 = load i64, ptr %12, align 8, !tbaa !8
  %218 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !11
  %220 = sext i32 %219 to i64
  %221 = load i64, ptr %17, align 8, !tbaa !8
  %222 = add nsw i64 %221, %220
  store i64 %222, ptr %17, align 8, !tbaa !8
  br label %223

223:                                              ; preds = %216, %213
  %224 = load i64, ptr %17, align 8, !tbaa !8
  %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_c(ptr noundef nonnull align 8 dereferenceable(8) %225, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  store i32 0, ptr %16, align 4
  br label %227

227:                                              ; preds = %223, %185
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %228 = load i32, ptr %16, align 4
  switch i32 %228, label %232 [
    i32 0, label %229
    i32 5, label %106
  ]

229:                                              ; preds = %227
  br label %106, !llvm.loop !15

230:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %231 = load i32, ptr %1, align 4
  ret i32 %231

232:                                              ; preds = %227
  unreachable
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #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)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"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" }

@s = external dso_local local_unnamed_addr global [4800 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
.peel.next:
  %0 = alloca i32, align 4
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  br label %14

.loopexit:                                        ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %0)
  %12 = load i32, ptr %0, align 4, !tbaa !8
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %0, align 4, !tbaa !8
  %.not78 = icmp eq i32 %12, 0
  br i1 %.not78, label %._crit_edge, label %.lr.ph

14:                                               ; preds = %.peel.next, %37
  %indvars.iv = phi i64 [ 1, %.peel.next ], [ %indvars.iv.next, %37 ]
  %.05877 = phi i64 [ 31, %.peel.next ], [ %38, %37 ]
  %.lhs.trunc = trunc i64 %indvars.iv to i16
  %15 = urem i16 %.lhs.trunc, 12
  %16 = udiv i16 %.lhs.trunc, 12
  %narrow = add nuw nsw i16 %15, 1
  %17 = icmp eq i16 %narrow, 2
  br i1 %17, label %18, label %34

18:                                               ; preds = %14
  %narrow75 = add nuw nsw i16 %16, 1
  %19 = zext nneg i16 %narrow75 to i32
  %20 = tail call noundef zeroext i1 @_Z6isleapi(i32 noundef %19)
  %21 = urem i64 %.05877, 7
  br i1 %20, label %22, label %28

22:                                               ; preds = %18
  %23 = icmp eq i64 %21, 5
  br i1 %23, label %24, label %37

24:                                               ; preds = %22
  %25 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %indvars.iv
  %26 = load i32, ptr %25, align 4, !tbaa !8
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !8
  br label %37

28:                                               ; preds = %18
  %29 = icmp ugt i64 %21, 4
  br i1 %29, label %30, label %37

30:                                               ; preds = %28
  %31 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %indvars.iv
  %32 = load i32, ptr %31, align 4, !tbaa !8
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %31, align 4, !tbaa !8
  br label %37

34:                                               ; preds = %14
  %35 = and i16 %narrow, 29
  %switch.selectcmp.case1 = icmp eq i16 %35, 9
  %switch.selectcmp.case2 = icmp eq i16 %35, 4
  %switch.selectcmp = or i1 %switch.selectcmp.case1, %switch.selectcmp.case2
  %36 = select i1 %switch.selectcmp, i64 30, i64 31
  br label %37

37:                                               ; preds = %34, %28, %30, %22, %24
  %.sink = phi i64 [ 29, %24 ], [ 29, %22 ], [ 28, %30 ], [ 28, %28 ], [ %36, %34 ]
  %38 = add nuw nsw i64 %.05877, %.sink
  %39 = add nsw i64 %indvars.iv, -1
  %40 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !8
  %42 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %indvars.iv
  %43 = load i32, ptr %42, align 4, !tbaa !8
  %44 = add nsw i32 %43, %41
  store i32 %44, ptr %42, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 4800
  br i1 %exitcond.not, label %.loopexit, label %14, !llvm.loop !11

.lr.ph:                                           ; preds = %.loopexit, %108
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %48 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %47, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %49 = load i64, ptr %1, align 8, !tbaa !14
  %50 = add nsw i64 %49, -1
  store i64 %50, ptr %1, align 8, !tbaa !14
  %51 = load i64, ptr %2, align 8, !tbaa !14
  %52 = add nsw i64 %51, -1
  store i64 %52, ptr %2, align 8, !tbaa !14
  %53 = load i64, ptr %3, align 8, !tbaa !14
  %54 = add nsw i64 %53, -1
  store i64 %54, ptr %3, align 8, !tbaa !14
  %55 = load i64, ptr %4, align 8, !tbaa !14
  %56 = add nsw i64 %55, -1
  store i64 %56, ptr %4, align 8, !tbaa !14
  %57 = mul nsw i64 %52, 12
  %58 = add nsw i64 %57, %50
  %59 = mul nsw i64 %56, 12
  %60 = add nsw i64 %59, %54
  %.not68 = icmp eq i64 %58, 0
  br i1 %.not68, label %65, label %61

61:                                               ; preds = %.lr.ph
  %62 = add nsw i64 %58, -1
  %63 = sdiv i64 %62, 4800
  %64 = add nsw i64 %63, 1
  br label %65

65:                                               ; preds = %.lr.ph, %61
  %66 = phi i64 [ %64, %61 ], [ 0, %.lr.ph ]
  %67 = add i64 %59, %53
  %68 = sdiv i64 %67, 4800
  %.not69 = icmp slt i64 %66, %68
  %69 = load i32, ptr getelementptr inbounds (i8, ptr @s, i64 19196), align 4, !tbaa !8
  %70 = sext i32 %69 to i64
  br i1 %.not69, label %89, label %71

71:                                               ; preds = %65
  %72 = sub nsw i64 %60, %58
  %73 = sdiv i64 %72, 4800
  %74 = mul nsw i64 %73, %70
  %75 = srem i64 %58, 4800
  %76 = srem i64 %60, 4800
  %77 = icmp sgt i64 %75, %76
  %78 = select i1 %77, i64 %70, i64 0
  %spec.select = add nsw i64 %74, %78
  %79 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %76
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = add nsw i64 %spec.select, %81
  %.not71 = icmp eq i64 %75, 0
  br i1 %.not71, label %108, label %83

83:                                               ; preds = %71
  %84 = add nsw i64 %75, -1
  %85 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = sub nsw i64 %82, %87
  br label %108

89:                                               ; preds = %65
  %90 = srem i64 %58, 4800
  %91 = srem i64 %60, 4800
  %92 = sub nsw i64 %68, %66
  %93 = mul nsw i64 %92, %70
  %.not70 = icmp eq i64 %90, 0
  br i1 %.not70, label %101, label %94

94:                                               ; preds = %89
  %95 = add nsw i64 %90, -1
  %96 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !8
  %98 = sub nsw i32 %69, %97
  %99 = sext i32 %98 to i64
  %100 = add nsw i64 %93, %99
  br label %101

101:                                              ; preds = %94, %89
  %.0 = phi i64 [ %100, %94 ], [ %93, %89 ]
  %102 = icmp slt i64 %91, 4799
  br i1 %102, label %103, label %108

103:                                              ; preds = %101
  %104 = getelementptr inbounds [4800 x i32], ptr @s, i64 0, i64 %91
  %105 = load i32, ptr %104, align 4, !tbaa !8
  %106 = sext i32 %105 to i64
  %107 = add nsw i64 %.0, %106
  br label %108

108:                                              ; preds = %101, %103, %71, %83
  %.1.sink = phi i64 [ %88, %83 ], [ %82, %71 ], [ %107, %103 ], [ %.0, %101 ]
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.1.sink)
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %109, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %111 = load i32, ptr %0, align 4, !tbaa !8
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %0, align 4, !tbaa !8
  %.not = icmp eq i32 %111, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %108, %.loopexit
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #6
  ret i32 0
}

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

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

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

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

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 #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 #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

; 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 #4 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass