; LLVM IR from brpapa/algorithms :: solutions/codeforces (1254-A)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@_Z8chickensB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@farm = external dso_local global [101 x [101 x i8]], align 16
@ans = external dso_local global [101 x [101 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %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 i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %24

24:                                               ; preds = %190, %0
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %2, align 4, !tbaa !5
  %27 = icmp ne i32 %25, 0
  br i1 %27, label %28, label %191

28:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %29, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %63, %28
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp slt i32 %33, %34
  br i1 %35, label %37, label %36

36:                                               ; preds = %32
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %66

37:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %59, %37
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %62

43:                                               ; preds = %38
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %6)
  %45 = load i8, ptr %6, align 1, !tbaa !9
  %46 = load i32, ptr %8, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [101 x [101 x i8]], ptr @farm, i64 0, i64 %47
  %49 = load i32, ptr %10, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [101 x i8], ptr %48, i64 0, i64 %50
  store i8 %45, ptr %51, align 1, !tbaa !9
  %52 = load i8, ptr %6, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 82
  br i1 %54, label %55, label %58

55:                                               ; preds = %43
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %55, %43
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %10, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %10, align 4, !tbaa !5
  br label %38, !llvm.loop !10

62:                                               ; preds = %42
  br label %63

63:                                               ; preds = %62
  %64 = load i32, ptr %8, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %8, align 4, !tbaa !5
  br label %32, !llvm.loop !12

66:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = srem i32 %67, %68
  store i32 %69, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = sdiv i32 %70, %71
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = load i32, ptr %11, align 4, !tbaa !5
  %76 = sub nsw i32 %74, %75
  store i32 %76, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sdiv i32 %77, %78
  store i32 %79, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %158, %66
  %81 = load i32, ptr %17, align 4, !tbaa !5
  %82 = load i32, ptr %3, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %161

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #6
  %86 = load i32, ptr %17, align 4, !tbaa !5
  %87 = srem i32 %86, 2
  %88 = icmp eq i32 %87, 0
  %89 = zext i1 %88 to i8
  store i8 %89, ptr %18, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %90 = load i8, ptr %18, align 1, !tbaa !13, !range !15, !noundef !16
  %91 = trunc i8 %90 to i1
  br i1 %91, label %92, label %93

92:                                               ; preds = %85
  br label %96

93:                                               ; preds = %85
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  br label %96

96:                                               ; preds = %93, %92
  %97 = phi i32 [ 0, %92 ], [ %95, %93 ]
  store i32 %97, ptr %19, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %150, %96
  %99 = load i8, ptr %18, align 1, !tbaa !13, !range !15, !noundef !16
  %100 = trunc i8 %99 to i1
  br i1 %100, label %101, label %105

101:                                              ; preds = %98
  %102 = load i32, ptr %19, align 4, !tbaa !5
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br label %108

105:                                              ; preds = %98
  %106 = load i32, ptr %19, align 4, !tbaa !5
  %107 = icmp sge i32 %106, 0
  br label %108

108:                                              ; preds = %105, %101
  %109 = phi i1 [ %104, %101 ], [ %107, %105 ]
  br i1 %109, label %111, label %110

110:                                              ; preds = %108
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %157

111:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = load i32, ptr %11, align 4, !tbaa !5
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %115, label %117

115:                                              ; preds = %111
  %116 = load i32, ptr %12, align 4, !tbaa !5
  br label %119

117:                                              ; preds = %111
  %118 = load i32, ptr %14, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %117, %115
  %120 = phi i32 [ %116, %115 ], [ %118, %117 ]
  store i32 %120, ptr %20, align 4, !tbaa !5
  %121 = load i32, ptr %17, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [101 x [101 x i8]], ptr @farm, i64 0, i64 %122
  %124 = load i32, ptr %19, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [101 x i8], ptr %123, i64 0, i64 %125
  %127 = load i8, ptr %126, align 1, !tbaa !9
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 82
  br i1 %129, label %130, label %139

130:                                              ; preds = %119
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %16, align 4, !tbaa !5
  %133 = load i32, ptr %20, align 4, !tbaa !5
  %134 = icmp sgt i32 %132, %133
  br i1 %134, label %135, label %138

135:                                              ; preds = %130
  store i32 1, ptr %16, align 4, !tbaa !5
  %136 = load i32, ptr %15, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %15, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %135, %130
  br label %139

139:                                              ; preds = %138, %119
  %140 = load i32, ptr %15, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z8chickensB5cxx11, i64 noundef %141)
  %143 = load i8, ptr %142, align 1, !tbaa !9
  %144 = load i32, ptr %17, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [101 x [101 x i8]], ptr @ans, i64 0, i64 %145
  %147 = load i32, ptr %19, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [101 x i8], ptr %146, i64 0, i64 %148
  store i8 %143, ptr %149, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %150

150:                                              ; preds = %139
  %151 = load i8, ptr %18, align 1, !tbaa !13, !range !15, !noundef !16
  %152 = trunc i8 %151 to i1
  %153 = zext i1 %152 to i64
  %154 = select i1 %152, i32 1, i32 -1
  %155 = load i32, ptr %19, align 4, !tbaa !5
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %19, align 4, !tbaa !5
  br label %98, !llvm.loop !17

157:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #6
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %17, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %17, align 4, !tbaa !5
  br label %80, !llvm.loop !18

161:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %187, %161
  %163 = load i32, ptr %21, align 4, !tbaa !5
  %164 = load i32, ptr %3, align 4, !tbaa !5
  %165 = icmp slt i32 %163, %164
  br i1 %165, label %167, label %166

166:                                              ; preds = %162
  store i32 16, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %190

167:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %182, %167
  %169 = load i32, ptr %22, align 4, !tbaa !5
  %170 = load i32, ptr %4, align 4, !tbaa !5
  %171 = icmp slt i32 %169, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %168
  store i32 19, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %185

173:                                              ; preds = %168
  %174 = load i32, ptr %21, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [101 x [101 x i8]], ptr @ans, i64 0, i64 %175
  %177 = load i32, ptr %22, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [101 x i8], ptr %176, i64 0, i64 %178
  %180 = load i8, ptr %179, align 1, !tbaa !9
  %181 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %180)
  br label %182

182:                                              ; preds = %173
  %183 = load i32, ptr %22, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %22, align 4, !tbaa !5
  br label %168, !llvm.loop !19

185:                                              ; preds = %172
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %187

187:                                              ; preds = %185
  %188 = load i32, ptr %21, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %21, align 4, !tbaa !5
  br label %162, !llvm.loop !20

190:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %24, !llvm.loop !21

191:                                              ; preds = %24
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %192 = load i32, ptr %1, align 4
  ret i32 %192
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 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) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"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" }

@_Z8chickensB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@farm = external dso_local local_unnamed_addr global [101 x [101 x i8]], align 16
@ans = external dso_local local_unnamed_addr global [101 x [101 x i8]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  store i32 %8, ptr %1, align 4, !tbaa !5
  %.not81 = icmp eq i32 %7, 0
  br i1 %.not81, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %0, %._crit_edge80
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.preheader55.lr.ph, label %._crit_edge80

.preheader55.lr.ph:                               ; preds = %.lr.ph83
  %14 = load i32, ptr %3, align 4
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader55, label %.lr.ph75.preheader

.preheader55:                                     ; preds = %.preheader55.lr.ph, %._crit_edge
  %16 = phi i32 [ %26, %._crit_edge ], [ %12, %.preheader55.lr.ph ]
  %17 = phi i32 [ %27, %._crit_edge ], [ %14, %.preheader55.lr.ph ]
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %._crit_edge ], [ 0, %.preheader55.lr.ph ]
  %.04160 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 0, %.preheader55.lr.ph ]
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge61:                                    ; preds = %._crit_edge
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = srem i32 %.1.lcssa, %19
  %21 = sdiv i32 %.1.lcssa, %19
  %22 = icmp sgt i32 %26, 0
  br i1 %22, label %.lr.ph75.preheader, label %._crit_edge80

.lr.ph75.preheader:                               ; preds = %.preheader55.lr.ph, %._crit_edge61
  %23 = phi i32 [ %21, %._crit_edge61 ], [ 0, %.preheader55.lr.ph ]
  %24 = phi i32 [ %20, %._crit_edge61 ], [ 0, %.preheader55.lr.ph ]
  %25 = phi i32 [ %26, %._crit_edge61 ], [ %12, %.preheader55.lr.ph ]
  %.pre102 = load i32, ptr %3, align 4
  br label %.lr.ph75

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader55
  %26 = phi i32 [ %16, %.preheader55 ], [ %.pre, %._crit_edge.loopexit ]
  %27 = phi i32 [ %17, %.preheader55 ], [ %35, %._crit_edge.loopexit ]
  %.1.lcssa = phi i32 [ %.04160, %.preheader55 ], [ %spec.select, %._crit_edge.loopexit ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %28 = sext i32 %26 to i64
  %29 = icmp slt i64 %indvars.iv.next88, %28
  br i1 %29, label %.preheader55, label %._crit_edge61, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader55, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader55 ]
  %.158 = phi i32 [ %spec.select, %.lr.ph ], [ %.04160, %.preheader55 ]
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 1 dereferenceable(1) %5)
  %31 = load i8, ptr %5, align 1, !tbaa !12
  %32 = getelementptr inbounds [101 x [101 x i8]], ptr @farm, i64 0, i64 %indvars.iv87, i64 %indvars.iv
  store i8 %31, ptr %32, align 1, !tbaa !12
  %33 = icmp eq i8 %31, 82
  %34 = zext i1 %33 to i32
  %spec.select = add nsw i32 %.158, %34
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %3, align 4
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !13

.preheader56:                                     ; preds = %._crit_edge68
  %38 = icmp sgt i32 %50, 0
  br i1 %38, label %.preheader, label %._crit_edge80

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %._crit_edge68
  %39 = phi i32 [ %25, %.lr.ph75.preheader ], [ %50, %._crit_edge68 ]
  %40 = phi i32 [ %.pre102, %.lr.ph75.preheader ], [ %51, %._crit_edge68 ]
  %indvars.iv93 = phi i64 [ 0, %.lr.ph75.preheader ], [ %indvars.iv.next94, %._crit_edge68 ]
  %.04372 = phi i32 [ 0, %.lr.ph75.preheader ], [ %.144.lcssa, %._crit_edge68 ]
  %.04671 = phi i32 [ 0, %.lr.ph75.preheader ], [ %.147.lcssa, %._crit_edge68 ]
  %41 = and i64 %indvars.iv93, 1
  %42 = icmp eq i64 %41, 0
  %43 = add nsw i32 %40, -1
  %44 = select i1 %42, i32 0, i32 %43
  %45 = icmp slt i32 %44, %40
  %46 = icmp sgt i32 %44, -1
  %47 = select i1 %42, i1 %45, i1 %46
  br i1 %47, label %.lr.ph67, label %._crit_edge68

.lr.ph67:                                         ; preds = %.lr.ph75
  %48 = sext i32 %44 to i64
  %49 = select i1 %42, i64 1, i64 -1
  br label %54

._crit_edge68.loopexit:                           ; preds = %64
  %.pre103 = load i32, ptr %2, align 4, !tbaa !5
  br label %._crit_edge68

._crit_edge68:                                    ; preds = %._crit_edge68.loopexit, %.lr.ph75
  %50 = phi i32 [ %39, %.lr.ph75 ], [ %.pre103, %._crit_edge68.loopexit ]
  %51 = phi i32 [ %40, %.lr.ph75 ], [ %69, %._crit_edge68.loopexit ]
  %.147.lcssa = phi i32 [ %.04671, %.lr.ph75 ], [ %.248, %._crit_edge68.loopexit ]
  %.144.lcssa = phi i32 [ %.04372, %.lr.ph75 ], [ %.245, %._crit_edge68.loopexit ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %52 = sext i32 %50 to i64
  %53 = icmp slt i64 %indvars.iv.next94, %52
  br i1 %53, label %.lr.ph75, label %.preheader56, !llvm.loop !14

54:                                               ; preds = %.lr.ph67, %64
  %indvars.iv90 = phi i64 [ %48, %.lr.ph67 ], [ %indvars.iv.next91, %64 ]
  %.14464 = phi i32 [ %.04372, %.lr.ph67 ], [ %.245, %64 ]
  %.14763 = phi i32 [ %.04671, %.lr.ph67 ], [ %.248, %64 ]
  %55 = getelementptr inbounds [101 x [101 x i8]], ptr @farm, i64 0, i64 %indvars.iv93, i64 %indvars.iv90
  %56 = load i8, ptr %55, align 1, !tbaa !12
  %57 = icmp eq i8 %56, 82
  br i1 %57, label %58, label %64

58:                                               ; preds = %54
  %59 = icmp slt i32 %.14763, %24
  %60 = zext i1 %59 to i32
  %61 = add nsw i32 %23, %60
  %62 = add nsw i32 %.14464, 1
  %.not52 = icmp sge i32 %.14464, %61
  %63 = zext i1 %.not52 to i32
  %spec.select53 = add nsw i32 %.14763, %63
  %spec.select54 = select i1 %.not52, i32 1, i32 %62
  br label %64

64:                                               ; preds = %58, %54
  %.248 = phi i32 [ %.14763, %54 ], [ %spec.select53, %58 ]
  %.245 = phi i32 [ %.14464, %54 ], [ %spec.select54, %58 ]
  %65 = sext i32 %.248 to i64
  %66 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z8chickensB5cxx11, i64 noundef %65)
  %67 = load i8, ptr %66, align 1, !tbaa !12
  %68 = getelementptr inbounds [101 x [101 x i8]], ptr @ans, i64 0, i64 %indvars.iv93, i64 %indvars.iv90
  store i8 %67, ptr %68, align 1, !tbaa !12
  %indvars.iv.next91 = add nsw i64 %indvars.iv90, %49
  %69 = load i32, ptr %3, align 4
  %70 = sext i32 %69 to i64
  %71 = icmp slt i64 %indvars.iv.next91, %70
  %72 = icmp sgt i64 %indvars.iv.next91, -1
  %73 = select i1 %42, i1 %71, i1 %72
  br i1 %73, label %54, label %._crit_edge68.loopexit, !llvm.loop !15

.preheader:                                       ; preds = %.preheader56, %._crit_edge78
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %._crit_edge78 ], [ 0, %.preheader56 ]
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = icmp sgt i32 %74, 0
  br i1 %75, label %.lr.ph77, label %._crit_edge78

._crit_edge80:                                    ; preds = %._crit_edge78, %.lr.ph83, %._crit_edge61, %.preheader56
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %76 = load i32, ptr %1, align 4, !tbaa !5
  %77 = add nsw i32 %76, -1
  store i32 %77, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %76, 0
  br i1 %.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !16

._crit_edge78:                                    ; preds = %.lr.ph77, %.preheader
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %79 = load i32, ptr %2, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = icmp slt i64 %indvars.iv.next100, %80
  br i1 %81, label %.preheader, label %._crit_edge80, !llvm.loop !17

.lr.ph77:                                         ; preds = %.preheader, %.lr.ph77
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %.lr.ph77 ], [ 0, %.preheader ]
  %82 = getelementptr inbounds [101 x [101 x i8]], ptr @ans, i64 0, i64 %indvars.iv99, i64 %indvars.iv96
  %83 = load i8, ptr %82, align 1, !tbaa !12
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %83)
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next97, %86
  br i1 %87, label %.lr.ph77, label %._crit_edge78, !llvm.loop !18

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 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 #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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


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