; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/LONG/MARCH15/DEVCLASS (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" }

@t = external dso_local global i32, align 4
@type = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@g = external dso_local global i32, align 4
@cost1 = external dso_local global i32, align 4
@cost2 = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %11

11:                                               ; preds = %264, %48, %0
  %12 = load i32, ptr @t, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @t, align 4, !tbaa !5
  %14 = icmp ne i32 %12, 0
  br i1 %14, label %15, label %265

15:                                               ; preds = %11
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @type)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #8
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr @n, align 4, !tbaa !5
  store i32 0, ptr @g, align 4, !tbaa !5
  store i32 0, ptr @b, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %39, %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %42

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %27)
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = icmp eq i32 %30, 66
  br i1 %31, label %32, label %35

32:                                               ; preds = %25
  %33 = load i32, ptr @b, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @b, align 4, !tbaa !5
  br label %38

35:                                               ; preds = %25
  %36 = load i32, ptr @g, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @g, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %35, %32
  br label %39

39:                                               ; preds = %38
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !5
  br label %20, !llvm.loop !10

42:                                               ; preds = %24
  %43 = load i32, ptr @b, align 4, !tbaa !5
  %44 = load i32, ptr @g, align 4, !tbaa !5
  %45 = sub nsw i32 %43, %44
  %46 = call i32 @llvm.abs.i32(i32 %45, i1 true)
  %47 = icmp sgt i32 %46, 1
  br i1 %47, label %48, label %51

48:                                               ; preds = %42
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %11, !llvm.loop !12

51:                                               ; preds = %42
  %52 = load i32, ptr @type, align 4, !tbaa !5
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %158

54:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr @cost1, align 4, !tbaa !5
  store i32 0, ptr @cost2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %90, %54
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = icmp slt i32 %56, %57
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %55
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = icmp eq i32 %61, 0
  br i1 %62, label %63, label %73

63:                                               ; preds = %60
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %65)
  %67 = load i8, ptr %66, align 1, !tbaa !9
  %68 = sext i8 %67 to i32
  %69 = icmp eq i32 %68, 71
  br i1 %69, label %70, label %73

70:                                               ; preds = %63
  %71 = load i32, ptr @cost1, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr @cost1, align 4, !tbaa !5
  br label %87

73:                                               ; preds = %63, %60
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 1
  br i1 %75, label %76, label %86

76:                                               ; preds = %73
  %77 = load i32, ptr %4, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %78)
  %80 = load i8, ptr %79, align 1, !tbaa !9
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 66
  br i1 %82, label %83, label %86

83:                                               ; preds = %76
  %84 = load i32, ptr @cost1, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr @cost1, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %83, %76, %73
  br label %87

87:                                               ; preds = %86, %70
  %88 = load i32, ptr %3, align 4, !tbaa !5
  %89 = sub nsw i32 1, %88
  store i32 %89, ptr %3, align 4, !tbaa !5
  br label %90

90:                                               ; preds = %87
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %4, align 4, !tbaa !5
  br label %55, !llvm.loop !13

93:                                               ; preds = %59
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %129, %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

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

99:                                               ; preds = %94
  %100 = load i32, ptr %3, align 4, !tbaa !5
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %112

102:                                              ; preds = %99
  %103 = load i32, ptr %5, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %104)
  %106 = load i8, ptr %105, align 1, !tbaa !9
  %107 = sext i8 %106 to i32
  %108 = icmp eq i32 %107, 71
  br i1 %108, label %109, label %112

109:                                              ; preds = %102
  %110 = load i32, ptr @cost2, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr @cost2, align 4, !tbaa !5
  br label %126

112:                                              ; preds = %102, %99
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = icmp eq i32 %113, 1
  br i1 %114, label %115, label %125

115:                                              ; preds = %112
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %117)
  %119 = load i8, ptr %118, align 1, !tbaa !9
  %120 = sext i8 %119 to i32
  %121 = icmp eq i32 %120, 66
  br i1 %121, label %122, label %125

122:                                              ; preds = %115
  %123 = load i32, ptr @cost2, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr @cost2, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %122, %115, %112
  br label %126

126:                                              ; preds = %125, %109
  %127 = load i32, ptr %3, align 4, !tbaa !5
  %128 = sub nsw i32 1, %127
  store i32 %128, ptr %3, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %126
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %5, align 4, !tbaa !5
  br label %94, !llvm.loop !14

132:                                              ; preds = %98
  %133 = load i32, ptr @cost1, align 4, !tbaa !5
  %134 = srem i32 %133, 2
  %135 = icmp eq i32 %134, 1
  br i1 %135, label %136, label %141

136:                                              ; preds = %132
  %137 = load i32, ptr @cost2, align 4, !tbaa !5
  %138 = sdiv i32 %137, 2
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %138)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %139, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %157

141:                                              ; preds = %132
  %142 = load i32, ptr @cost2, align 4, !tbaa !5
  %143 = srem i32 %142, 2
  %144 = icmp eq i32 %143, 1
  br i1 %144, label %145, label %150

145:                                              ; preds = %141
  %146 = load i32, ptr @cost1, align 4, !tbaa !5
  %147 = sdiv i32 %146, 2
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %147)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %156

150:                                              ; preds = %141
  %151 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @cost1, ptr noundef nonnull align 4 dereferenceable(4) @cost2)
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sdiv i32 %152, 2
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %153)
  %155 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %154, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %156

156:                                              ; preds = %150, %145
  br label %157

157:                                              ; preds = %156, %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  br label %264

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

159:                                              ; preds = %195, %158
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %198

164:                                              ; preds = %159
  %165 = load i32, ptr %8, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %166)
  %168 = load i8, ptr %167, align 1, !tbaa !9
  %169 = sext i8 %168 to i32
  %170 = icmp eq i32 %169, 66
  br i1 %170, label %171, label %182

171:                                              ; preds = %164
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = load i32, ptr @b, align 4, !tbaa !5
  %174 = mul nsw i32 2, %173
  %175 = sub nsw i32 %172, %174
  %176 = call i32 @llvm.abs.i32(i32 %175, i1 true)
  %177 = sext i32 %176 to i64
  %178 = load i64, ptr %6, align 8, !tbaa !15
  %179 = add nsw i64 %178, %177
  store i64 %179, ptr %6, align 8, !tbaa !15
  %180 = load i32, ptr @b, align 4, !tbaa !5
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr @b, align 4, !tbaa !5
  br label %194

182:                                              ; preds = %164
  %183 = load i32, ptr %8, align 4, !tbaa !5
  %184 = load i32, ptr @g, align 4, !tbaa !5
  %185 = mul nsw i32 2, %184
  %186 = add nsw i32 %185, 1
  %187 = sub nsw i32 %183, %186
  %188 = call i32 @llvm.abs.i32(i32 %187, i1 true)
  %189 = sext i32 %188 to i64
  %190 = load i64, ptr %6, align 8, !tbaa !15
  %191 = add nsw i64 %190, %189
  store i64 %191, ptr %6, align 8, !tbaa !15
  %192 = load i32, ptr @g, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  store i32 %193, ptr @g, align 4, !tbaa !5
  br label %194

194:                                              ; preds = %182, %171
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %8, align 4, !tbaa !5
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %8, align 4, !tbaa !5
  br label %159, !llvm.loop !17

198:                                              ; preds = %163
  store i32 0, ptr @g, align 4, !tbaa !5
  store i32 0, ptr @b, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %235, %198
  %200 = load i32, ptr %9, align 4, !tbaa !5
  %201 = load i32, ptr @n, align 4, !tbaa !5
  %202 = icmp slt i32 %200, %201
  br i1 %202, label %204, label %203

203:                                              ; preds = %199
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %238

204:                                              ; preds = %199
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %206)
  %208 = load i8, ptr %207, align 1, !tbaa !9
  %209 = sext i8 %208 to i32
  %210 = icmp eq i32 %209, 71
  br i1 %210, label %211, label %222

211:                                              ; preds = %204
  %212 = load i32, ptr %9, align 4, !tbaa !5
  %213 = load i32, ptr @g, align 4, !tbaa !5
  %214 = mul nsw i32 2, %213
  %215 = sub nsw i32 %212, %214
  %216 = call i32 @llvm.abs.i32(i32 %215, i1 true)
  %217 = sext i32 %216 to i64
  %218 = load i64, ptr %7, align 8, !tbaa !15
  %219 = add nsw i64 %218, %217
  store i64 %219, ptr %7, align 8, !tbaa !15
  %220 = load i32, ptr @g, align 4, !tbaa !5
  %221 = add nsw i32 %220, 1
  store i32 %221, ptr @g, align 4, !tbaa !5
  br label %234

222:                                              ; preds = %204
  %223 = load i32, ptr %9, align 4, !tbaa !5
  %224 = load i32, ptr @b, align 4, !tbaa !5
  %225 = mul nsw i32 2, %224
  %226 = add nsw i32 %225, 1
  %227 = sub nsw i32 %223, %226
  %228 = call i32 @llvm.abs.i32(i32 %227, i1 true)
  %229 = sext i32 %228 to i64
  %230 = load i64, ptr %7, align 8, !tbaa !15
  %231 = add nsw i64 %230, %229
  store i64 %231, ptr %7, align 8, !tbaa !15
  %232 = load i32, ptr @b, align 4, !tbaa !5
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr @b, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %222, %211
  br label %235

235:                                              ; preds = %234
  %236 = load i32, ptr %9, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %9, align 4, !tbaa !5
  br label %199, !llvm.loop !18

238:                                              ; preds = %203
  %239 = load i64, ptr %6, align 8, !tbaa !15
  %240 = srem i64 %239, 2
  %241 = icmp eq i64 %240, 1
  br i1 %241, label %242, label %247

242:                                              ; preds = %238
  %243 = load i64, ptr %7, align 8, !tbaa !15
  %244 = sdiv i64 %243, 2
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %244)
  %246 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %245, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %263

247:                                              ; preds = %238
  %248 = load i64, ptr %7, align 8, !tbaa !15
  %249 = srem i64 %248, 2
  %250 = icmp eq i64 %249, 1
  br i1 %250, label %251, label %256

251:                                              ; preds = %247
  %252 = load i64, ptr %6, align 8, !tbaa !15
  %253 = sdiv i64 %252, 2
  %254 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %253)
  %255 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %254, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %262

256:                                              ; preds = %247
  %257 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %258 = load i64, ptr %257, align 8, !tbaa !15
  %259 = sdiv i64 %258, 2
  %260 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %259)
  %261 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %260, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %262

262:                                              ; preds = %256, %251
  br label %263

263:                                              ; preds = %262, %242
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %264

264:                                              ; preds = %263, %157
  br label %11, !llvm.loop !12

265:                                              ; preds = %11
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #7 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !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" }

@t = external dso_local global i32, align 4
@type = external dso_local global i32, align 4
@n = external dso_local local_unnamed_addr global i32, align 4
@b = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local local_unnamed_addr global i32, align 4
@cost1 = external dso_local global i32, align 4
@cost2 = external dso_local global i32, align 4
@_Z1sB5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %4 = load i32, ptr @t, align 4, !tbaa !5
  %5 = add nsw i32 %4, -1
  store i32 %5, ptr @t, align 4, !tbaa !5
  %.not50 = icmp eq i32 %4, 0
  br i1 %.not50, label %._crit_edge53, label %.lr.ph52

.lr.ph52:                                         ; preds = %0, %.backedge
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @type)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11)
  %8 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11) #9
  %9 = trunc i64 %8 to i32
  store i32 %9, ptr @n, align 4, !tbaa !5
  store i32 0, ptr @g, align 4, !tbaa !5
  store i32 0, ptr @b, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr @b, align 4, !tbaa !5
  %.pre68 = load i32, ptr @g, align 4, !tbaa !5
  %11 = sub nsw i32 %.pre, %.pre68
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph52
  %12 = phi i32 [ %21, %._crit_edge.loopexit ], [ %9, %.lr.ph52 ]
  %13 = phi i32 [ %11, %._crit_edge.loopexit ], [ 0, %.lr.ph52 ]
  %14 = call i32 @llvm.abs.i32(i32 %13, i1 true)
  %15 = icmp ugt i32 %14, 1
  br i1 %15, label %24, label %29

.lr.ph:                                           ; preds = %.lr.ph52, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph52 ]
  %16 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv)
  %17 = load i8, ptr %16, align 1, !tbaa !9
  %18 = icmp eq i8 %17, 66
  %b.g = select i1 %18, ptr @b, ptr @g
  %19 = load i32, ptr %b.g, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %b.g, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !10

24:                                               ; preds = %._crit_edge
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.backedge

.backedge:                                        ; preds = %149, %72, %76, %65, %24
  %27 = load i32, ptr @t, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !12

29:                                               ; preds = %._crit_edge
  %30 = load i32, ptr @type, align 4, !tbaa !5
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %82

32:                                               ; preds = %29
  store i32 0, ptr @cost1, align 4, !tbaa !5
  store i32 0, ptr @cost2, align 4, !tbaa !5
  %33 = icmp sgt i32 %12, 0
  br i1 %33, label %.lr.ph45, label %._crit_edge49

.preheader:                                       ; preds = %43
  %34 = icmp sgt i32 %45, 0
  br i1 %34, label %.lr.ph48, label %._crit_edge49

.lr.ph45:                                         ; preds = %32, %43
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %43 ], [ 0, %32 ]
  %.03042 = phi i32 [ %44, %43 ], [ 0, %32 ]
  %switch89 = icmp eq i32 %.03042, 0
  %35 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv61)
  %36 = load i8, ptr %35, align 1, !tbaa !9
  br i1 %switch89, label %37, label %39

37:                                               ; preds = %.lr.ph45
  %38 = icmp eq i8 %36, 71
  br i1 %38, label %.sink.split, label %43

39:                                               ; preds = %.lr.ph45
  %40 = icmp eq i8 %36, 66
  br i1 %40, label %.sink.split, label %43

.sink.split:                                      ; preds = %39, %37
  %41 = load i32, ptr @cost1, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @cost1, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %.sink.split, %37, %39
  %44 = sub nuw nsw i32 1, %.03042
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next62, %46
  br i1 %47, label %.lr.ph45, label %.preheader, !llvm.loop !13

._crit_edge49:                                    ; preds = %60, %32, %.preheader
  %48 = load i32, ptr @cost1, align 4, !tbaa !5
  %49 = and i32 %48, -2147483647
  %50 = icmp eq i32 %49, 1
  %51 = load i32, ptr @cost2, align 4, !tbaa !5
  br i1 %50, label %65, label %69

.lr.ph48:                                         ; preds = %.preheader, %60
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %60 ], [ 0, %.preheader ]
  %.146 = phi i32 [ %61, %60 ], [ 1, %.preheader ]
  %switch = icmp eq i32 %.146, 0
  %52 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv64)
  %53 = load i8, ptr %52, align 1, !tbaa !9
  br i1 %switch, label %54, label %56

54:                                               ; preds = %.lr.ph48
  %55 = icmp eq i8 %53, 71
  br i1 %55, label %.sink.split78, label %60

56:                                               ; preds = %.lr.ph48
  %57 = icmp eq i8 %53, 66
  br i1 %57, label %.sink.split78, label %60

.sink.split78:                                    ; preds = %56, %54
  %58 = load i32, ptr @cost2, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr @cost2, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %.sink.split78, %54, %56
  %61 = sub nuw nsw i32 1, %.146
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next65, %63
  br i1 %64, label %.lr.ph48, label %._crit_edge49, !llvm.loop !14

65:                                               ; preds = %._crit_edge49
  %66 = sdiv i32 %51, 2
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %66)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.backedge

69:                                               ; preds = %._crit_edge49
  %70 = and i32 %51, -2147483647
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %76

72:                                               ; preds = %69
  %73 = sdiv i32 %48, 2
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %73)
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.backedge

76:                                               ; preds = %69
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @cost1, ptr noundef nonnull align 4 dereferenceable(4) @cost2)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = sdiv i32 %78, 2
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %79)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.backedge

82:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  store i64 0, ptr %1, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store i64 0, ptr %2, align 8, !tbaa !15
  store i32 0, ptr @g, align 4, !tbaa !5
  store i32 0, ptr @b, align 4, !tbaa !5
  %83 = icmp sgt i32 %12, 0
  br i1 %83, label %.lr.ph36, label %._crit_edge41.thread

._crit_edge37:                                    ; preds = %106
  store i32 0, ptr @g, align 4, !tbaa !5
  store i32 0, ptr @b, align 4, !tbaa !5
  %84 = icmp sgt i32 %108, 0
  br i1 %84, label %.lr.ph40, label %._crit_edge41

.lr.ph36:                                         ; preds = %82, %106
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %106 ], [ 0, %82 ]
  %85 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv55)
  %86 = load i8, ptr %85, align 1, !tbaa !9
  %87 = icmp eq i8 %86, 66
  br i1 %87, label %88, label %97

88:                                               ; preds = %.lr.ph36
  %89 = load i32, ptr @b, align 4, !tbaa !5
  %90 = shl nsw i32 %89, 1
  %91 = trunc nuw nsw i64 %indvars.iv55 to i32
  %92 = sub nsw i32 %91, %90
  %93 = call i32 @llvm.abs.i32(i32 %92, i1 true)
  %94 = zext nneg i32 %93 to i64
  %95 = load i64, ptr %1, align 8, !tbaa !15
  %96 = add nsw i64 %95, %94
  br label %106

97:                                               ; preds = %.lr.ph36
  %98 = load i32, ptr @g, align 4, !tbaa !5
  %99 = shl nsw i32 %98, 1
  %.neg32 = xor i32 %99, -1
  %100 = trunc nuw nsw i64 %indvars.iv55 to i32
  %101 = add i32 %100, %.neg32
  %102 = call i32 @llvm.abs.i32(i32 %101, i1 true)
  %103 = zext nneg i32 %102 to i64
  %104 = load i64, ptr %1, align 8, !tbaa !15
  %105 = add nsw i64 %104, %103
  br label %106

106:                                              ; preds = %88, %97
  %.sink83 = phi i32 [ %89, %88 ], [ %98, %97 ]
  %b.sink82 = phi ptr [ @b, %88 ], [ @g, %97 ]
  %.sink = phi i64 [ %96, %88 ], [ %105, %97 ]
  %107 = add nsw i32 %.sink83, 1
  store i32 %107, ptr %b.sink82, align 4, !tbaa !5
  store i64 %.sink, ptr %1, align 8
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next56, %109
  br i1 %110, label %.lr.ph36, label %._crit_edge37, !llvm.loop !17

._crit_edge41.loopexit:                           ; preds = %135
  %.pre69 = load i64, ptr %1, align 8, !tbaa !15
  br label %._crit_edge41

._crit_edge41:                                    ; preds = %._crit_edge41.loopexit, %._crit_edge37
  %111 = phi i64 [ %.pre69, %._crit_edge41.loopexit ], [ %.sink, %._crit_edge37 ]
  %112 = and i64 %111, -9223372036854775807
  %113 = icmp eq i64 %112, 1
  br i1 %113, label %140, label %._crit_edge41.thread

.lr.ph40:                                         ; preds = %._crit_edge37, %135
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %135 ], [ 0, %._crit_edge37 ]
  %114 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) @_Z1sB5cxx11, i64 noundef %indvars.iv58)
  %115 = load i8, ptr %114, align 1, !tbaa !9
  %116 = icmp eq i8 %115, 71
  br i1 %116, label %117, label %126

117:                                              ; preds = %.lr.ph40
  %118 = load i32, ptr @g, align 4, !tbaa !5
  %119 = shl nsw i32 %118, 1
  %120 = trunc nuw nsw i64 %indvars.iv58 to i32
  %121 = sub nsw i32 %120, %119
  %122 = call i32 @llvm.abs.i32(i32 %121, i1 true)
  %123 = zext nneg i32 %122 to i64
  %124 = load i64, ptr %2, align 8, !tbaa !15
  %125 = add nsw i64 %124, %123
  br label %135

126:                                              ; preds = %.lr.ph40
  %127 = load i32, ptr @b, align 4, !tbaa !5
  %128 = shl nsw i32 %127, 1
  %.neg = xor i32 %128, -1
  %129 = trunc nuw nsw i64 %indvars.iv58 to i32
  %130 = add i32 %129, %.neg
  %131 = call i32 @llvm.abs.i32(i32 %130, i1 true)
  %132 = zext nneg i32 %131 to i64
  %133 = load i64, ptr %2, align 8, !tbaa !15
  %134 = add nsw i64 %133, %132
  br label %135

135:                                              ; preds = %117, %126
  %.sink85 = phi i32 [ %118, %117 ], [ %127, %126 ]
  %g.sink = phi ptr [ @g, %117 ], [ @b, %126 ]
  %.sink67 = phi i64 [ %125, %117 ], [ %134, %126 ]
  %136 = add nsw i32 %.sink85, 1
  store i32 %136, ptr %g.sink, align 4, !tbaa !5
  store i64 %.sink67, ptr %2, align 8
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %137 = load i32, ptr @n, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = icmp slt i64 %indvars.iv.next59, %138
  br i1 %139, label %.lr.ph40, label %._crit_edge41.loopexit, !llvm.loop !18

140:                                              ; preds = %._crit_edge41
  %141 = load i64, ptr %2, align 8, !tbaa !15
  br label %149

._crit_edge41.thread:                             ; preds = %82, %._crit_edge41
  %142 = phi i64 [ %111, %._crit_edge41 ], [ 0, %82 ]
  %143 = load i64, ptr %2, align 8, !tbaa !15
  %144 = and i64 %143, -9223372036854775807
  %145 = icmp eq i64 %144, 1
  br i1 %145, label %149, label %146

146:                                              ; preds = %._crit_edge41.thread
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %148 = load i64, ptr %147, align 8, !tbaa !15
  br label %149

149:                                              ; preds = %._crit_edge41.thread, %146, %140
  %.sink88 = phi i64 [ %148, %146 ], [ %141, %140 ], [ %142, %._crit_edge41.thread ]
  %150 = sdiv i64 %.sink88, 2
  %151 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %150)
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %151, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  br label %.backedge

._crit_edge53:                                    ; preds = %.backedge, %0
  ret i32 0
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

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

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

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

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

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { 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 #8 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}


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