; LLVM IR from tangjz/acm-icpc :: 51nod (1060)

; 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, [5 x i32] }
%struct.Node = type { [15 x i32], %struct.BigInt, %struct.BigInt }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@vlim = external dso_local global %struct.BigInt, align 4
@slim = external dso_local global %struct.BigInt, align 4
@tot = external dso_local global i32, align 4
@pr = external dso_local global [45 x i32], align 16
@d = external dso_local global [45 x i32], align 16
@cnt = external dso_local global i32, align 4
@seq = external dso_local global [157 x %struct.Node], align 16
@cur = external dso_local global %struct.Node, align 4
@nxt = external dso_local global %struct.Node, align 4
@Q = external dso_local global %"class.std::priority_queue", align 8
@buf = external dso_local global [19 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.BigInt, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.BigInt, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.BigInt, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #6
  call void @_ZN6BigIntC2Ei(ptr noundef nonnull align 4 dereferenceable(24) %2, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @vlim, ptr align 4 %2, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !6
  br label %16

16:                                               ; preds = %21, %0
  %17 = load i32, ptr %3, align 4, !tbaa !6
  %18 = icmp slt i32 %17, 19
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 10, ptr %4, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %21

21:                                               ; preds = %20
  %22 = load i32, ptr %3, align 4, !tbaa !6
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !6
  br label %16, !llvm.loop !11

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

25:                                               ; preds = %78, %24
  %26 = load i32, ptr %5, align 4, !tbaa !6
  %27 = icmp slt i32 %26, 45
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %81

29:                                               ; preds = %25
  %30 = load i32, ptr %5, align 4, !tbaa !6
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [45 x i32], ptr @d, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !6
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %44, label %35

35:                                               ; preds = %29
  %36 = load i32, ptr %5, align 4, !tbaa !6
  %37 = load i32, ptr %5, align 4, !tbaa !6
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [45 x i32], ptr @d, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !6
  %40 = load i32, ptr @tot, align 4, !tbaa !6
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @tot, align 4, !tbaa !6
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %42
  store i32 %36, ptr %43, align 4, !tbaa !6
  br label %44

44:                                               ; preds = %35, %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  br label %45

45:                                               ; preds = %73, %44
  %46 = load i32, ptr %5, align 4, !tbaa !6
  %47 = load i32, ptr %7, align 4, !tbaa !6
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !6
  %51 = mul nsw i32 %46, %50
  store i32 %51, ptr %8, align 4, !tbaa !6
  %52 = icmp slt i32 %51, 45
  br i1 %52, label %54, label %53

53:                                               ; preds = %45
  store i32 8, ptr %6, align 4
  br label %76

54:                                               ; preds = %45
  %55 = load i32, ptr %7, align 4, !tbaa !6
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !6
  %59 = load i32, ptr %8, align 4, !tbaa !6
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [45 x i32], ptr @d, i64 0, i64 %60
  store i32 %58, ptr %61, align 4, !tbaa !6
  %62 = load i32, ptr %5, align 4, !tbaa !6
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [45 x i32], ptr @d, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !6
  %66 = load i32, ptr %7, align 4, !tbaa !6
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !6
  %70 = icmp eq i32 %65, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %54
  store i32 8, ptr %6, align 4
  br label %76

72:                                               ; preds = %54
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %7, align 4, !tbaa !6
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %7, align 4, !tbaa !6
  br label %45, !llvm.loop !13

76:                                               ; preds = %71, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  %79 = load i32, ptr %5, align 4, !tbaa !6
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !6
  br label %25, !llvm.loop !14

81:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #6
  call void @_ZN6BigIntC2Ei(ptr noundef nonnull align 4 dereferenceable(24) %9, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 getelementptr inbounds (%struct.Node, ptr @cur, i32 0, i32 2), ptr align 4 %9, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 getelementptr inbounds (%struct.Node, ptr @cur, i32 0, i32 1), ptr align 4 getelementptr inbounds (%struct.Node, ptr @cur, i32 0, i32 2), i64 24, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #6
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(108) @cur)
  br label %82

82:                                               ; preds = %145, %81
  %83 = call noundef zeroext i1 @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %84 = xor i1 %83, true
  br i1 %84, label %85, label %146

85:                                               ; preds = %82
  %86 = call noundef nonnull align 4 dereferenceable(108) ptr @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @cur, ptr align 4 %86, i64 108, i1 false), !tbaa.struct !15
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %87 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (%struct.Node, ptr @cur, i32 0, i32 1))
  br i1 %87, label %88, label %89

88:                                               ; preds = %85
  br label %146

89:                                               ; preds = %85
  %90 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(24) @slim, ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (%struct.Node, ptr @cur, i32 0, i32 2))
  br i1 %90, label %91, label %145

91:                                               ; preds = %89
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @slim, ptr align 4 getelementptr inbounds (%struct.Node, ptr @cur, i32 0, i32 2), i64 24, i1 false), !tbaa.struct !5
  %92 = load i32, ptr @cnt, align 4, !tbaa !6
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr @cnt, align 4, !tbaa !6
  %94 = sext i32 %92 to i64
  %95 = getelementptr inbounds [157 x %struct.Node], ptr @seq, i64 0, i64 %94
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %95, ptr align 4 @cur, i64 108, i1 false), !tbaa.struct !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !6
  br label %96

96:                                               ; preds = %140, %91
  %97 = load i32, ptr %10, align 4, !tbaa !6
  %98 = load i32, ptr @tot, align 4, !tbaa !6
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 13, ptr %6, align 4
  br label %143

101:                                              ; preds = %96
  %102 = load i32, ptr %10, align 4, !tbaa !6
  %103 = icmp ne i32 %102, 0
  br i1 %103, label %104, label %115

104:                                              ; preds = %101
  %105 = load i32, ptr %10, align 4, !tbaa !6
  %106 = sub nsw i32 %105, 1
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [15 x i32], ptr @cur, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !6
  %110 = load i32, ptr %10, align 4, !tbaa !6
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [15 x i32], ptr @cur, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !6
  %114 = icmp sgt i32 %109, %113
  br i1 %114, label %115, label %132

115:                                              ; preds = %104, %101
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @nxt, ptr align 4 @cur, i64 108, i1 false), !tbaa.struct !15
  %116 = load i32, ptr %10, align 4, !tbaa !6
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [15 x i32], ptr @nxt, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !6
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 4, !tbaa !6
  %121 = load i32, ptr %10, align 4, !tbaa !6
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %122
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (%struct.Node, ptr @nxt, i32 0, i32 1), ptr noundef nonnull align 4 dereferenceable(4) %123)
  %124 = load i32, ptr %10, align 4, !tbaa !6
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [15 x i32], ptr @nxt, i64 0, i64 %125
  call void @_ZN6BigIntdVERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (%struct.Node, ptr @nxt, i32 0, i32 2), ptr noundef nonnull align 4 dereferenceable(4) %126)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %127 = load i32, ptr %10, align 4, !tbaa !6
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [15 x i32], ptr @nxt, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !6
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %11, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (%struct.Node, ptr @nxt, i32 0, i32 2), ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(108) @nxt)
  br label %132

132:                                              ; preds = %115, %104
  %133 = load i32, ptr %10, align 4, !tbaa !6
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [15 x i32], ptr @cur, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !6
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %139, label %138

138:                                              ; preds = %132
  store i32 13, ptr %6, align 4
  br label %143

139:                                              ; preds = %132
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %10, align 4, !tbaa !6
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %10, align 4, !tbaa !6
  br label %96, !llvm.loop !16

143:                                              ; preds = %138, %100
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144, %89
  br label %82, !llvm.loop !17

146:                                              ; preds = %88, %82
  %147 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @tot)
  br label %148

148:                                              ; preds = %177, %146
  %149 = load i32, ptr @tot, align 4, !tbaa !6
  %150 = add nsw i32 %149, -1
  store i32 %150, ptr @tot, align 4, !tbaa !6
  %151 = icmp ne i32 %149, 0
  br i1 %151, label %152, label %181

152:                                              ; preds = %148
  %153 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef @buf)
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  call void @_ZN6BigIntC2EPc(ptr noundef nonnull align 4 dereferenceable(24) %12, ptr noundef @buf)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 @vlim, ptr align 4 %12, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %154 = load i32, ptr @cnt, align 4, !tbaa !6
  %155 = sub nsw i32 %154, 1
  store i32 %155, ptr %14, align 4, !tbaa !6
  br label %156

156:                                              ; preds = %176, %152
  %157 = load i32, ptr %13, align 4, !tbaa !6
  %158 = load i32, ptr %14, align 4, !tbaa !6
  %159 = icmp slt i32 %157, %158
  br i1 %159, label %160, label %177

160:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %161 = load i32, ptr %13, align 4, !tbaa !6
  %162 = load i32, ptr %14, align 4, !tbaa !6
  %163 = add nsw i32 %161, %162
  %164 = add nsw i32 %163, 1
  %165 = ashr i32 %164, 1
  store i32 %165, ptr %15, align 4, !tbaa !6
  %166 = load i32, ptr %15, align 4, !tbaa !6
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [157 x %struct.Node], ptr @seq, i64 0, i64 %167
  %169 = getelementptr inbounds %struct.Node, ptr %168, i32 0, i32 1
  %170 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(24) %169)
  br i1 %170, label %171, label %174

171:                                              ; preds = %160
  %172 = load i32, ptr %15, align 4, !tbaa !6
  %173 = sub nsw i32 %172, 1
  store i32 %173, ptr %14, align 4, !tbaa !6
  br label %176

174:                                              ; preds = %160
  %175 = load i32, ptr %15, align 4, !tbaa !6
  store i32 %175, ptr %13, align 4, !tbaa !6
  br label %176

176:                                              ; preds = %174, %171
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %156, !llvm.loop !18

177:                                              ; preds = %156
  %178 = load i32, ptr %13, align 4, !tbaa !6
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [157 x %struct.Node], ptr @seq, i64 0, i64 %179
  call void @_ZN4Node5printEv(ptr noundef nonnull align 4 dereferenceable(108) %180)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %148, !llvm.loop !19

181:                                              ; preds = %148
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigIntC2Ei(ptr noundef nonnull align 4 dereferenceable(24), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; 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 @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(108)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(108) ptr @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigIntdVERKi(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6BigIntC2EPc(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Node5printEv(ptr noundef nonnull align 4 dereferenceable(108)) #4 align 2

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


; 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, [5 x i32] }
%struct.Node = type { [15 x i32], %struct.BigInt, %struct.BigInt }
%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl" = type { %"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Node, std::allocator<Node>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@vlim = external dso_local global %struct.BigInt, align 4
@slim = external dso_local global %struct.BigInt, align 4
@tot = external dso_local global i32, align 4
@pr = external dso_local global [45 x i32], align 16
@d = external dso_local local_unnamed_addr global [45 x i32], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local global [157 x %struct.Node], align 16
@cur = external dso_local global %struct.Node, align 4
@nxt = external dso_local global %struct.Node, align 4
@Q = external dso_local global %"class.std::priority_queue", align 8
@buf = external dso_local global [19 x i8], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader:
  %0 = alloca %struct.BigInt, align 4
  %1 = alloca i32, align 4
  %2 = alloca %struct.BigInt, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.BigInt, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %0) #6
  call void @_ZN6BigIntC2Ei(ptr noundef nonnull align 4 dereferenceable(24) %0, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(24) %0, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %0) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 10, ptr %1, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !6
  br label %7

5:                                                ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #6
  call void @_ZN6BigIntC2Ei(ptr noundef nonnull align 4 dereferenceable(24) %2, i32 noundef 1)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @cur, i64 84), ptr noundef nonnull align 4 dereferenceable(24) %2, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @cur, i64 60), ptr noundef nonnull align 4 dereferenceable(24) %2, i64 24, i1 false)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #6
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(108) @cur)
  %6 = call noundef zeroext i1 @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %6, label %._crit_edge52, label %.lr.ph51

7:                                                ; preds = %.preheader, %._crit_edge
  %indvars.iv65 = phi i64 [ 2, %.preheader ], [ %indvars.iv.next66, %._crit_edge ]
  %8 = phi i32 [ %tot.promoted, %.preheader ], [ %16, %._crit_edge ]
  %9 = getelementptr inbounds [45 x i32], ptr @d, i64 0, i64 %indvars.iv65
  %10 = load i32, ptr %9, align 4, !tbaa !6
  %.not41 = icmp eq i32 %10, 0
  %11 = trunc nuw nsw i64 %indvars.iv65 to i32
  br i1 %.not41, label %12, label %._crit_edge77

12:                                               ; preds = %7
  store i32 %11, ptr %9, align 4, !tbaa !6
  %13 = add nsw i32 %8, 1
  store i32 %13, ptr @tot, align 4, !tbaa !6
  %14 = sext i32 %8 to i64
  %15 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %14
  store i32 %11, ptr %15, align 4, !tbaa !6
  br label %._crit_edge77

._crit_edge77:                                    ; preds = %7, %12
  %16 = phi i32 [ %13, %12 ], [ %8, %7 ]
  %17 = load i32, ptr @pr, align 16, !tbaa !6
  %18 = mul nsw i32 %17, %11
  %19 = icmp slt i32 %18, 45
  br i1 %19, label %.lr.ph, label %._crit_edge

20:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %22 = load i32, ptr %21, align 4, !tbaa !6
  %23 = mul nsw i32 %22, %11
  %24 = icmp slt i32 %23, 45
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph:                                           ; preds = %._crit_edge77, %20
  %indvars.iv = phi i64 [ %indvars.iv.next, %20 ], [ 0, %._crit_edge77 ]
  %25 = phi i32 [ %23, %20 ], [ %18, %._crit_edge77 ]
  %26 = phi i32 [ %22, %20 ], [ %17, %._crit_edge77 ]
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [45 x i32], ptr @d, i64 0, i64 %27
  store i32 %26, ptr %28, align 4, !tbaa !6
  %29 = load i32, ptr %9, align 4, !tbaa !6
  %30 = icmp eq i32 %29, %26
  br i1 %30, label %._crit_edge, label %20

._crit_edge:                                      ; preds = %20, %.lr.ph, %._crit_edge77
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next66, 45
  br i1 %exitcond.not, label %5, label %7, !llvm.loop !13

.lr.ph51:                                         ; preds = %5, %.loopexit
  %31 = call noundef nonnull align 4 dereferenceable(108) ptr @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(108) @cur, ptr noundef nonnull align 4 dereferenceable(108) %31, i64 108, i1 false), !tbaa.struct !14
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %32 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @cur, i64 60))
  br i1 %32, label %._crit_edge52, label %33

33:                                               ; preds = %.lr.ph51
  %34 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(24) @slim, ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @cur, i64 84))
  br i1 %34, label %35, label %.loopexit

35:                                               ; preds = %33
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) @slim, ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @cur, i64 84), i64 24, i1 false), !tbaa.struct !5
  %36 = load i32, ptr @cnt, align 4, !tbaa !6
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @cnt, align 4, !tbaa !6
  %38 = sext i32 %36 to i64
  %39 = getelementptr inbounds [157 x %struct.Node], ptr @seq, i64 0, i64 %38
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(108) %39, ptr noundef nonnull align 4 dereferenceable(108) @cur, i64 108, i1 false), !tbaa.struct !14
  %40 = load i32, ptr @tot, align 4
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %42, label %.loopexit

42:                                               ; preds = %35
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(108) @nxt, ptr noundef nonnull align 4 dereferenceable(108) @cur, i64 108, i1 false), !tbaa.struct !14
  %43 = load i32, ptr @nxt, align 4, !tbaa !6
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr @nxt, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @nxt, i64 60), ptr noundef nonnull align 4 dereferenceable(4) @pr)
  call void @_ZN6BigIntdVERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @nxt, i64 84), ptr noundef nonnull align 4 dereferenceable(4) @nxt)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %45 = load i32, ptr @nxt, align 4, !tbaa !6
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %3, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @nxt, i64 84), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(108) @nxt)
  %.pre = load i32, ptr @cur, align 4, !tbaa !6
  %.pre74 = load i32, ptr @tot, align 4
  %.not39.peel = icmp ne i32 %.pre, 0
  %47 = icmp sgt i32 %.pre74, 1
  %or.cond.peel = select i1 %.not39.peel, i1 %47, i1 false
  br i1 %or.cond.peel, label %.lr.ph48.peel.next, label %.loopexit

.lr.ph48.peel.next:                               ; preds = %42, %60
  %48 = phi i32 [ %61, %60 ], [ %.pre74, %42 ]
  %49 = phi i32 [ %62, %60 ], [ %.pre, %42 ]
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %60 ], [ 1, %42 ]
  %50 = getelementptr inbounds [15 x i32], ptr @cur, i64 0, i64 %indvars.iv68
  %51 = load i32, ptr %50, align 4, !tbaa !6
  %52 = icmp sgt i32 %49, %51
  br i1 %52, label %53, label %60

53:                                               ; preds = %.lr.ph48.peel.next
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(108) @nxt, ptr noundef nonnull align 4 dereferenceable(108) @cur, i64 108, i1 false), !tbaa.struct !14
  %54 = getelementptr inbounds [15 x i32], ptr @nxt, i64 0, i64 %indvars.iv68
  %55 = load i32, ptr %54, align 4, !tbaa !6
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %54, align 4, !tbaa !6
  %57 = getelementptr inbounds [45 x i32], ptr @pr, i64 0, i64 %indvars.iv68
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @nxt, i64 60), ptr noundef nonnull align 4 dereferenceable(4) %57)
  call void @_ZN6BigIntdVERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @nxt, i64 84), ptr noundef nonnull align 4 dereferenceable(4) %54)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %58 = load i32, ptr %54, align 4, !tbaa !6
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !6
  call void @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24) getelementptr inbounds (i8, ptr @nxt, i64 84), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 4 dereferenceable(108) @nxt)
  %.phi.trans.insert = getelementptr inbounds [15 x i32], ptr @cur, i64 0, i64 %indvars.iv68
  %.pre75 = load i32, ptr %.phi.trans.insert, align 4, !tbaa !6
  %.pre76 = load i32, ptr @tot, align 4
  br label %60

60:                                               ; preds = %53, %.lr.ph48.peel.next
  %61 = phi i32 [ %.pre76, %53 ], [ %48, %.lr.ph48.peel.next ]
  %62 = phi i32 [ %.pre75, %53 ], [ %51, %.lr.ph48.peel.next ]
  %.not39 = icmp ne i32 %62, 0
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %63 = sext i32 %61 to i64
  %64 = icmp slt i64 %indvars.iv.next69, %63
  %or.cond = select i1 %.not39, i1 %64, i1 false
  br i1 %or.cond, label %.lr.ph48.peel.next, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %60, %42, %35, %33
  %65 = call noundef zeroext i1 @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %65, label %._crit_edge52, label %.lr.ph51, !llvm.loop !17

._crit_edge52:                                    ; preds = %.loopexit, %.lr.ph51, %5
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @tot)
  %67 = load i32, ptr @tot, align 4, !tbaa !6
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr @tot, align 4, !tbaa !6
  %.not4059 = icmp eq i32 %67, 0
  br i1 %.not4059, label %._crit_edge62, label %.lr.ph61

.lr.ph61:                                         ; preds = %._crit_edge52, %._crit_edge58
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @buf)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  call void @_ZN6BigIntC2EPc(ptr noundef nonnull align 4 dereferenceable(24) %4, ptr noundef nonnull @buf)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(24) %4, i64 24, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  %70 = load i32, ptr @cnt, align 4, !tbaa !6
  %71 = icmp sgt i32 %70, 1
  br i1 %71, label %.lr.ph57.preheader, label %._crit_edge58

.lr.ph57.preheader:                               ; preds = %.lr.ph61
  %72 = add nsw i32 %70, -1
  br label %.lr.ph57

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.lr.ph57
  %.03255 = phi i32 [ %.1, %.lr.ph57 ], [ %72, %.lr.ph57.preheader ]
  %.03354 = phi i32 [ %.134, %.lr.ph57 ], [ 0, %.lr.ph57.preheader ]
  %73 = add nuw nsw i32 %.03354, 1
  %74 = add nuw nsw i32 %73, %.03255
  %75 = lshr i32 %74, 1
  %76 = zext nneg i32 %75 to i64
  %77 = getelementptr inbounds [157 x %struct.Node], ptr @seq, i64 0, i64 %76, i32 1
  %78 = call noundef zeroext i1 @_ZNK6BigIntltERKS_(ptr noundef nonnull align 4 dereferenceable(24) @vlim, ptr noundef nonnull align 4 dereferenceable(24) %77)
  %79 = add nsw i32 %75, -1
  %.134 = select i1 %78, i32 %.03354, i32 %75
  %.1 = select i1 %78, i32 %79, i32 %.03255
  %80 = icmp slt i32 %.134, %.1
  br i1 %80, label %.lr.ph57, label %._crit_edge58, !llvm.loop !18

._crit_edge58:                                    ; preds = %.lr.ph57, %.lr.ph61
  %.033.lcssa = phi i32 [ 0, %.lr.ph61 ], [ %.134, %.lr.ph57 ]
  %81 = zext nneg i32 %.033.lcssa to i64
  %82 = getelementptr inbounds [157 x %struct.Node], ptr @seq, i64 0, i64 %81
  call void @_ZN4Node5printEv(ptr noundef nonnull align 4 dereferenceable(108) %82)
  %83 = load i32, ptr @tot, align 4, !tbaa !6
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr @tot, align 4, !tbaa !6
  %.not40 = icmp eq i32 %83, 0
  br i1 %.not40, label %._crit_edge62, label %.lr.ph61, !llvm.loop !19

._crit_edge62:                                    ; preds = %._crit_edge58, %._crit_edge52
  ret i32 0
}

; 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 nounwind uwtable
declare dso_local void @_ZN6BigIntC2Ei(ptr noundef nonnull align 4 dereferenceable(24), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; 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 @_ZN6BigIntmLERKi(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE4pushERKS0_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 4 dereferenceable(108)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(108) ptr @_ZNKSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueI4NodeSt6vectorIS0_SaIS0_EESt4lessIS0_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6BigIntdVERKi(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6BigIntC2EPc(ptr noundef nonnull align 4 dereferenceable(24), ptr noundef) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Node5printEv(ptr noundef nonnull align 4 dereferenceable(108)) local_unnamed_addr #4 align 2

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass