; LLVM IR from tangjz/acm-icpc :: projecteuler/192.ll (Z5solveiRxS_S_S_x)

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

%struct.BigInt = type { i32, [11 x i32] }

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solveiRxS_S_S_x(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %5) #0 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca %struct.BigInt, align 4
  %22 = alloca %struct.BigInt, align 4
  %23 = alloca %struct.BigInt, align 4
  %24 = alloca %struct.BigInt, align 4
  %25 = alloca %struct.BigInt, align 4
  %26 = alloca %struct.BigInt, align 4
  %27 = alloca %struct.BigInt, align 4
  %28 = alloca %struct.BigInt, align 4
  %29 = alloca %struct.BigInt, align 4
  %30 = alloca %struct.BigInt, align 4
  %31 = alloca %struct.BigInt, align 4
  %32 = alloca %struct.BigInt, align 4
  %33 = alloca %struct.BigInt, align 4
  %34 = alloca %struct.BigInt, align 4
  store i32 %0, ptr %7, align 4, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !9
  store ptr %4, ptr %11, align 8, !tbaa !9
  store i64 %5, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %35 = load ptr, ptr %8, align 8, !tbaa !9
  %36 = load i64, ptr %35, align 8, !tbaa !11
  %37 = load ptr, ptr %10, align 8, !tbaa !9
  %38 = load i64, ptr %37, align 8, !tbaa !11
  %39 = add nsw i64 %36, %38
  store i64 %39, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %40 = load ptr, ptr %9, align 8, !tbaa !9
  %41 = load i64, ptr %40, align 8, !tbaa !11
  %42 = load ptr, ptr %11, align 8, !tbaa !9
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = add nsw i64 %41, %43
  store i64 %44, ptr %14, align 8, !tbaa !11
  br label %45

45:                                               ; preds = %200, %6
  %46 = load i64, ptr %14, align 8, !tbaa !11
  %47 = load i64, ptr %12, align 8, !tbaa !11
  %48 = icmp sle i64 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %211

50:                                               ; preds = %45
  %51 = load i64, ptr %13, align 8, !tbaa !11
  %52 = sext i64 %51 to i128
  %53 = load i64, ptr %13, align 8, !tbaa !11
  %54 = sext i64 %53 to i128
  %55 = mul nsw i128 %52, %54
  %56 = load i64, ptr %14, align 8, !tbaa !11
  %57 = sext i64 %56 to i128
  %58 = load i64, ptr %14, align 8, !tbaa !11
  %59 = sext i64 %58 to i128
  %60 = mul nsw i128 %57, %59
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = sext i32 %61 to i128
  %63 = mul nsw i128 %60, %62
  %64 = icmp sle i128 %55, %63
  br i1 %64, label %65, label %132

65:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store i64 1, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %66 = load i64, ptr %12, align 8, !tbaa !11
  %67 = load ptr, ptr %9, align 8, !tbaa !9
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %69 = sub nsw i64 %66, %68
  %70 = load ptr, ptr %11, align 8, !tbaa !9
  %71 = load i64, ptr %70, align 8, !tbaa !11
  %72 = sdiv i64 %69, %71
  store i64 %72, ptr %16, align 8, !tbaa !11
  br label %73

73:                                               ; preds = %116, %65
  %74 = load i64, ptr %15, align 8, !tbaa !11
  %75 = load i64, ptr %16, align 8, !tbaa !11
  %76 = icmp slt i64 %74, %75
  br i1 %76, label %77, label %117

77:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %78 = load i64, ptr %15, align 8, !tbaa !11
  %79 = load i64, ptr %16, align 8, !tbaa !11
  %80 = add nsw i64 %78, %79
  %81 = add nsw i64 %80, 1
  %82 = ashr i64 %81, 1
  store i64 %82, ptr %17, align 8, !tbaa !11
  %83 = load ptr, ptr %8, align 8, !tbaa !9
  %84 = load i64, ptr %83, align 8, !tbaa !11
  %85 = load i64, ptr %17, align 8, !tbaa !11
  %86 = load ptr, ptr %10, align 8, !tbaa !9
  %87 = load i64, ptr %86, align 8, !tbaa !11
  %88 = mul nsw i64 %85, %87
  %89 = add nsw i64 %84, %88
  store i64 %89, ptr %13, align 8, !tbaa !11
  %90 = load ptr, ptr %9, align 8, !tbaa !9
  %91 = load i64, ptr %90, align 8, !tbaa !11
  %92 = load i64, ptr %17, align 8, !tbaa !11
  %93 = load ptr, ptr %11, align 8, !tbaa !9
  %94 = load i64, ptr %93, align 8, !tbaa !11
  %95 = mul nsw i64 %92, %94
  %96 = add nsw i64 %91, %95
  store i64 %96, ptr %14, align 8, !tbaa !11
  %97 = load i64, ptr %13, align 8, !tbaa !11
  %98 = sext i64 %97 to i128
  %99 = load i64, ptr %13, align 8, !tbaa !11
  %100 = sext i64 %99 to i128
  %101 = mul nsw i128 %98, %100
  %102 = load i64, ptr %14, align 8, !tbaa !11
  %103 = sext i64 %102 to i128
  %104 = load i64, ptr %14, align 8, !tbaa !11
  %105 = sext i64 %104 to i128
  %106 = mul nsw i128 %103, %105
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i128
  %109 = mul nsw i128 %106, %108
  %110 = icmp sle i128 %101, %109
  br i1 %110, label %111, label %113

111:                                              ; preds = %77
  %112 = load i64, ptr %17, align 8, !tbaa !11
  store i64 %112, ptr %15, align 8, !tbaa !11
  br label %116

113:                                              ; preds = %77
  %114 = load i64, ptr %17, align 8, !tbaa !11
  %115 = sub nsw i64 %114, 1
  store i64 %115, ptr %16, align 8, !tbaa !11
  br label %116

116:                                              ; preds = %113, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %73, !llvm.loop !13

117:                                              ; preds = %73
  %118 = load i64, ptr %15, align 8, !tbaa !11
  %119 = load ptr, ptr %10, align 8, !tbaa !9
  %120 = load i64, ptr %119, align 8, !tbaa !11
  %121 = mul nsw i64 %118, %120
  %122 = load ptr, ptr %8, align 8, !tbaa !9
  %123 = load i64, ptr %122, align 8, !tbaa !11
  %124 = add nsw i64 %123, %121
  store i64 %124, ptr %122, align 8, !tbaa !11
  %125 = load i64, ptr %15, align 8, !tbaa !11
  %126 = load ptr, ptr %11, align 8, !tbaa !9
  %127 = load i64, ptr %126, align 8, !tbaa !11
  %128 = mul nsw i64 %125, %127
  %129 = load ptr, ptr %9, align 8, !tbaa !9
  %130 = load i64, ptr %129, align 8, !tbaa !11
  %131 = add nsw i64 %130, %128
  store i64 %131, ptr %129, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %199

132:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store i64 1, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %133 = load i64, ptr %12, align 8, !tbaa !11
  %134 = load ptr, ptr %11, align 8, !tbaa !9
  %135 = load i64, ptr %134, align 8, !tbaa !11
  %136 = sub nsw i64 %133, %135
  %137 = load ptr, ptr %9, align 8, !tbaa !9
  %138 = load i64, ptr %137, align 8, !tbaa !11
  %139 = sdiv i64 %136, %138
  store i64 %139, ptr %19, align 8, !tbaa !11
  br label %140

140:                                              ; preds = %183, %132
  %141 = load i64, ptr %18, align 8, !tbaa !11
  %142 = load i64, ptr %19, align 8, !tbaa !11
  %143 = icmp slt i64 %141, %142
  br i1 %143, label %144, label %184

144:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %145 = load i64, ptr %18, align 8, !tbaa !11
  %146 = load i64, ptr %19, align 8, !tbaa !11
  %147 = add nsw i64 %145, %146
  %148 = add nsw i64 %147, 1
  %149 = ashr i64 %148, 1
  store i64 %149, ptr %20, align 8, !tbaa !11
  %150 = load ptr, ptr %10, align 8, !tbaa !9
  %151 = load i64, ptr %150, align 8, !tbaa !11
  %152 = load i64, ptr %20, align 8, !tbaa !11
  %153 = load ptr, ptr %8, align 8, !tbaa !9
  %154 = load i64, ptr %153, align 8, !tbaa !11
  %155 = mul nsw i64 %152, %154
  %156 = add nsw i64 %151, %155
  store i64 %156, ptr %13, align 8, !tbaa !11
  %157 = load ptr, ptr %11, align 8, !tbaa !9
  %158 = load i64, ptr %157, align 8, !tbaa !11
  %159 = load i64, ptr %20, align 8, !tbaa !11
  %160 = load ptr, ptr %9, align 8, !tbaa !9
  %161 = load i64, ptr %160, align 8, !tbaa !11
  %162 = mul nsw i64 %159, %161
  %163 = add nsw i64 %158, %162
  store i64 %163, ptr %14, align 8, !tbaa !11
  %164 = load i64, ptr %13, align 8, !tbaa !11
  %165 = sext i64 %164 to i128
  %166 = load i64, ptr %13, align 8, !tbaa !11
  %167 = sext i64 %166 to i128
  %168 = mul nsw i128 %165, %167
  %169 = load i64, ptr %14, align 8, !tbaa !11
  %170 = sext i64 %169 to i128
  %171 = load i64, ptr %14, align 8, !tbaa !11
  %172 = sext i64 %171 to i128
  %173 = mul nsw i128 %170, %172
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = sext i32 %174 to i128
  %176 = mul nsw i128 %173, %175
  %177 = icmp sgt i128 %168, %176
  br i1 %177, label %178, label %180

178:                                              ; preds = %144
  %179 = load i64, ptr %20, align 8, !tbaa !11
  store i64 %179, ptr %18, align 8, !tbaa !11
  br label %183

180:                                              ; preds = %144
  %181 = load i64, ptr %20, align 8, !tbaa !11
  %182 = sub nsw i64 %181, 1
  store i64 %182, ptr %19, align 8, !tbaa !11
  br label %183

183:                                              ; preds = %180, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %140, !llvm.loop !15

184:                                              ; preds = %140
  %185 = load i64, ptr %18, align 8, !tbaa !11
  %186 = load ptr, ptr %8, align 8, !tbaa !9
  %187 = load i64, ptr %186, align 8, !tbaa !11
  %188 = mul nsw i64 %185, %187
  %189 = load ptr, ptr %10, align 8, !tbaa !9
  %190 = load i64, ptr %189, align 8, !tbaa !11
  %191 = add nsw i64 %190, %188
  store i64 %191, ptr %189, align 8, !tbaa !11
  %192 = load i64, ptr %18, align 8, !tbaa !11
  %193 = load ptr, ptr %9, align 8, !tbaa !9
  %194 = load i64, ptr %193, align 8, !tbaa !11
  %195 = mul nsw i64 %192, %194
  %196 = load ptr, ptr %11, align 8, !tbaa !9
  %197 = load i64, ptr %196, align 8, !tbaa !11
  %198 = add nsw i64 %197, %195
  store i64 %198, ptr %196, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %199

199:                                              ; preds = %184, %117
  br label %200

200:                                              ; preds = %199
  %201 = load ptr, ptr %8, align 8, !tbaa !9
  %202 = load i64, ptr %201, align 8, !tbaa !11
  %203 = load ptr, ptr %10, align 8, !tbaa !9
  %204 = load i64, ptr %203, align 8, !tbaa !11
  %205 = add nsw i64 %202, %204
  store i64 %205, ptr %13, align 8, !tbaa !11
  %206 = load ptr, ptr %9, align 8, !tbaa !9
  %207 = load i64, ptr %206, align 8, !tbaa !11
  %208 = load ptr, ptr %11, align 8, !tbaa !9
  %209 = load i64, ptr %208, align 8, !tbaa !11
  %210 = add nsw i64 %207, %209
  store i64 %210, ptr %14, align 8, !tbaa !11
  br label %45, !llvm.loop !16

211:                                              ; preds = %49
  call void @llvm.lifetime.start.p0(i64 48, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %23) #3
  %212 = load ptr, ptr %8, align 8, !tbaa !9
  %213 = load i64, ptr %212, align 8, !tbaa !11
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %23, i64 noundef %213)
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #3
  %214 = load ptr, ptr %11, align 8, !tbaa !9
  %215 = load i64, ptr %214, align 8, !tbaa !11
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %24, i64 noundef %215)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %22, ptr noundef nonnull align 4 dereferenceable(48) %23, ptr noundef nonnull align 4 dereferenceable(48) %24)
  call void @llvm.lifetime.start.p0(i64 48, ptr %25) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %26) #3
  %216 = load ptr, ptr %10, align 8, !tbaa !9
  %217 = load i64, ptr %216, align 8, !tbaa !11
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %26, i64 noundef %217)
  call void @llvm.lifetime.start.p0(i64 48, ptr %27) #3
  %218 = load ptr, ptr %9, align 8, !tbaa !9
  %219 = load i64, ptr %218, align 8, !tbaa !11
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %27, i64 noundef %219)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %25, ptr noundef nonnull align 4 dereferenceable(48) %26, ptr noundef nonnull align 4 dereferenceable(48) %27)
  call void @_ZNK6BigIntplERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %21, ptr noundef nonnull align 4 dereferenceable(48) %22, ptr noundef nonnull align 4 dereferenceable(48) %25)
  call void @llvm.lifetime.end.p0(i64 48, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %29) #3
  %220 = load ptr, ptr %9, align 8, !tbaa !9
  %221 = load i64, ptr %220, align 8, !tbaa !11
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %29, i64 noundef %221)
  call void @llvm.lifetime.start.p0(i64 48, ptr %30) #3
  %222 = load ptr, ptr %11, align 8, !tbaa !9
  %223 = load i64, ptr %222, align 8, !tbaa !11
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %30, i64 noundef %223)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %28, ptr noundef nonnull align 4 dereferenceable(48) %29, ptr noundef nonnull align 4 dereferenceable(48) %30)
  call void @llvm.lifetime.end.p0(i64 48, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %31) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr %32) #3
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %32, ptr noundef nonnull align 4 dereferenceable(48) %28, ptr noundef nonnull align 4 dereferenceable(48) %28)
  call void @llvm.lifetime.start.p0(i64 48, ptr %33) #3
  %224 = load i32, ptr %7, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = mul nsw i64 4, %225
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %33, i64 noundef %226)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %31, ptr noundef nonnull align 4 dereferenceable(48) %32, ptr noundef nonnull align 4 dereferenceable(48) %33)
  call void @llvm.lifetime.start.p0(i64 48, ptr %34) #3
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind writable sret(%struct.BigInt) align 4 %34, ptr noundef nonnull align 4 dereferenceable(48) %21, ptr noundef nonnull align 4 dereferenceable(48) %21)
  %227 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(48) %31, ptr noundef nonnull align 4 dereferenceable(48) %34)
  br i1 %227, label %228, label %231

228:                                              ; preds = %211
  %229 = load ptr, ptr %9, align 8, !tbaa !9
  %230 = load i64, ptr %229, align 8, !tbaa !11
  br label %234

231:                                              ; preds = %211
  %232 = load ptr, ptr %11, align 8, !tbaa !9
  %233 = load i64, ptr %232, align 8, !tbaa !11
  br label %234

234:                                              ; preds = %231, %228
  %235 = phi i64 [ %230, %228 ], [ %233, %231 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr %34) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %33) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %21) #3
  ret i64 %235
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.BigInt) align 4, ptr noundef nonnull align 4 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6BigIntplERKS_(ptr dead_on_unwind noalias writable sret(%struct.BigInt) align 4, ptr noundef nonnull align 4 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(48)) #2 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }

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

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

%struct.BigInt = type { i32, [11 x i32] }

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_Z5solveiRxS_S_S_x(i32 noundef %0, ptr nocapture noundef nonnull align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull align 8 dereferenceable(8) %3, ptr nocapture noundef nonnull align 8 dereferenceable(8) %4, i64 noundef %5) local_unnamed_addr #0 {
  %7 = alloca %struct.BigInt, align 4
  %8 = alloca %struct.BigInt, align 4
  %9 = alloca %struct.BigInt, align 4
  %10 = alloca %struct.BigInt, align 4
  %11 = alloca %struct.BigInt, align 4
  %12 = alloca %struct.BigInt, align 4
  %13 = alloca %struct.BigInt, align 4
  %14 = alloca %struct.BigInt, align 4
  %15 = alloca %struct.BigInt, align 4
  %16 = alloca %struct.BigInt, align 4
  %17 = alloca %struct.BigInt, align 4
  %18 = alloca %struct.BigInt, align 4
  %19 = alloca %struct.BigInt, align 4
  %20 = alloca %struct.BigInt, align 4
  %21 = load i64, ptr %2, align 8, !tbaa !5
  %22 = load i64, ptr %4, align 8, !tbaa !5
  %23 = add nsw i64 %22, %21
  %.not95 = icmp sgt i64 %23, %5
  %.pre102 = load i64, ptr %1, align 8, !tbaa !5
  br i1 %.not95, label %._crit_edge100, label %.lr.ph99

.lr.ph99:                                         ; preds = %6
  %24 = load i64, ptr %3, align 8, !tbaa !5
  %25 = add nsw i64 %24, %.pre102
  %26 = sext i32 %0 to i128
  br label %37

._crit_edge100:                                   ; preds = %96, %6
  %27 = phi i64 [ %.pre102, %6 ], [ %99, %96 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #3
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %9, i64 noundef %27)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %10) #3
  %28 = load i64, ptr %4, align 8, !tbaa !5
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %10, i64 noundef %28)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %8, ptr noundef nonnull align 4 dereferenceable(48) %9, ptr noundef nonnull align 4 dereferenceable(48) %10)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %12) #3
  %29 = load i64, ptr %3, align 8, !tbaa !5
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %12, i64 noundef %29)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %13) #3
  %30 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %13, i64 noundef %30)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %11, ptr noundef nonnull align 4 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(48) %13)
  call void @_ZNK6BigIntplERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %7, ptr noundef nonnull align 4 dereferenceable(48) %8, ptr noundef nonnull align 4 dereferenceable(48) %11)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %14) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %15) #3
  %31 = load i64, ptr %2, align 8, !tbaa !5
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %15, i64 noundef %31)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %16) #3
  %32 = load i64, ptr %4, align 8, !tbaa !5
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %16, i64 noundef %32)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %14, ptr noundef nonnull align 4 dereferenceable(48) %15, ptr noundef nonnull align 4 dereferenceable(48) %16)
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %15) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %17) #3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %18) #3
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %18, ptr noundef nonnull align 4 dereferenceable(48) %14, ptr noundef nonnull align 4 dereferenceable(48) %14)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %19) #3
  %33 = sext i32 %0 to i64
  %34 = shl nsw i64 %33, 2
  call void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48) %19, i64 noundef %34)
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %17, ptr noundef nonnull align 4 dereferenceable(48) %18, ptr noundef nonnull align 4 dereferenceable(48) %19)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %20) #3
  call void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind nonnull writable sret(%struct.BigInt) align 4 %20, ptr noundef nonnull align 4 dereferenceable(48) %7, ptr noundef nonnull align 4 dereferenceable(48) %7)
  %35 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(48) %17, ptr noundef nonnull align 4 dereferenceable(48) %20)
  %.val = load i64, ptr %2, align 8
  %.val86 = load i64, ptr %4, align 8
  %36 = select i1 %35, i64 %.val, i64 %.val86
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %20) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %19) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %18) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %17) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #3
  ret i64 %36

37:                                               ; preds = %.lr.ph99, %96
  %38 = phi i64 [ %24, %.lr.ph99 ], [ %100, %96 ]
  %39 = phi i64 [ %.pre102, %.lr.ph99 ], [ %99, %96 ]
  %40 = phi i64 [ %22, %.lr.ph99 ], [ %97, %96 ]
  %41 = phi i64 [ %21, %.lr.ph99 ], [ %98, %96 ]
  %.097 = phi i64 [ %25, %.lr.ph99 ], [ %101, %96 ]
  %.07896 = phi i64 [ %23, %.lr.ph99 ], [ %102, %96 ]
  %42 = sext i64 %.097 to i128
  %43 = mul nsw i128 %42, %42
  %44 = sext i64 %.07896 to i128
  %45 = mul nsw i128 %44, %26
  %46 = mul i128 %45, %44
  %.not84 = icmp sgt i128 %43, %46
  br i1 %.not84, label %71, label %47

47:                                               ; preds = %37
  %48 = sub nsw i64 %5, %41
  %49 = sdiv i64 %48, %40
  %50 = icmp sgt i64 %49, 1
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %47, %.lr.ph
  %.07988 = phi i64 [ %.180, %.lr.ph ], [ %49, %47 ]
  %.08187 = phi i64 [ %.182, %.lr.ph ], [ 1, %47 ]
  %51 = add nuw nsw i64 %.08187, 1
  %52 = add nuw nsw i64 %51, %.07988
  %53 = lshr i64 %52, 1
  %54 = mul nsw i64 %38, %53
  %55 = add nsw i64 %54, %39
  %56 = mul nsw i64 %53, %40
  %57 = add nsw i64 %56, %41
  %58 = sext i64 %55 to i128
  %59 = mul nsw i128 %58, %58
  %60 = sext i64 %57 to i128
  %61 = mul nsw i128 %60, %26
  %62 = mul i128 %61, %60
  %.not85 = icmp sgt i128 %59, %62
  %63 = add nsw i64 %53, -1
  %.182 = select i1 %.not85, i64 %.08187, i64 %53
  %.180 = select i1 %.not85, i64 %63, i64 %.07988
  %64 = icmp slt i64 %.182, %.180
  br i1 %64, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %47
  %.081.lcssa = phi i64 [ 1, %47 ], [ %.182, %.lr.ph ]
  %65 = mul nsw i64 %38, %.081.lcssa
  %66 = add nsw i64 %39, %65
  store i64 %66, ptr %1, align 8, !tbaa !5
  %67 = load i64, ptr %4, align 8, !tbaa !5
  %68 = mul nsw i64 %67, %.081.lcssa
  %69 = load i64, ptr %2, align 8, !tbaa !5
  %70 = add nsw i64 %69, %68
  store i64 %70, ptr %2, align 8, !tbaa !5
  %.pre101 = load i64, ptr %4, align 8, !tbaa !5
  br label %96

71:                                               ; preds = %37
  %72 = sub nsw i64 %5, %40
  %73 = sdiv i64 %72, %41
  %74 = icmp sgt i64 %73, 1
  br i1 %74, label %.lr.ph92, label %._crit_edge93

.lr.ph92:                                         ; preds = %71, %.lr.ph92
  %.07590 = phi i64 [ %.1, %.lr.ph92 ], [ %73, %71 ]
  %.07689 = phi i64 [ %.177, %.lr.ph92 ], [ 1, %71 ]
  %75 = add nuw nsw i64 %.07689, 1
  %76 = add nuw nsw i64 %75, %.07590
  %77 = lshr i64 %76, 1
  %78 = mul nsw i64 %39, %77
  %79 = add nsw i64 %78, %38
  %80 = mul nsw i64 %77, %41
  %81 = add nsw i64 %80, %40
  %82 = sext i64 %79 to i128
  %83 = mul nsw i128 %82, %82
  %84 = sext i64 %81 to i128
  %85 = mul nsw i128 %84, %26
  %86 = mul i128 %85, %84
  %87 = icmp sgt i128 %83, %86
  %88 = add nsw i64 %77, -1
  %.177 = select i1 %87, i64 %77, i64 %.07689
  %.1 = select i1 %87, i64 %.07590, i64 %88
  %89 = icmp slt i64 %.177, %.1
  br i1 %89, label %.lr.ph92, label %._crit_edge93, !llvm.loop !11

._crit_edge93:                                    ; preds = %.lr.ph92, %71
  %.076.lcssa = phi i64 [ 1, %71 ], [ %.177, %.lr.ph92 ]
  %90 = mul nsw i64 %39, %.076.lcssa
  %91 = add nsw i64 %38, %90
  store i64 %91, ptr %3, align 8, !tbaa !5
  %92 = load i64, ptr %2, align 8, !tbaa !5
  %93 = mul nsw i64 %92, %.076.lcssa
  %94 = load i64, ptr %4, align 8, !tbaa !5
  %95 = add nsw i64 %94, %93
  store i64 %95, ptr %4, align 8, !tbaa !5
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %._crit_edge, %._crit_edge93
  %97 = phi i64 [ %.pre101, %._crit_edge ], [ %95, %._crit_edge93 ]
  %98 = phi i64 [ %70, %._crit_edge ], [ %.pre, %._crit_edge93 ]
  %99 = load i64, ptr %1, align 8, !tbaa !5
  %100 = load i64, ptr %3, align 8, !tbaa !5
  %101 = add nsw i64 %100, %99
  %102 = add nsw i64 %97, %98
  %.not = icmp sgt i64 %102, %5
  br i1 %.not, label %._crit_edge100, label %37, !llvm.loop !12
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigIntC2Ex(ptr noundef nonnull align 4 dereferenceable(48), i64 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6BigIntmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.BigInt) align 4, ptr noundef nonnull align 4 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6BigIntplERKS_(ptr dead_on_unwind noalias writable sret(%struct.BigInt) align 4, ptr noundef nonnull align 4 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(48)) local_unnamed_addr #2 align 2

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


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