; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/333 Division 2/Problem D (D)

; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@h = external dso_local global [100100 x i32], align 16
@d = external dso_local global [100100 x i32], align 16
@x = external dso_local global [100100 x i32], align 16
@y = external dso_local global [100100 x i32], align 16
@s = external dso_local global %"class.std::stack", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@_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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %23, %0
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %26

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100100 x i32], ptr @h, i64 0, i64 %20
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %21)
  br label %23

23:                                               ; preds = %18
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %2, align 4, !tbaa !5
  br label %13, !llvm.loop !9

26:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %48, %26
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 1
  %31 = icmp slt i32 %28, %30
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %27
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100100 x i32], ptr @h, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [100100 x i32], ptr @h, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sub nsw i32 %38, %42
  %44 = call i32 @llvm.abs.i32(i32 %43, i1 true)
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %46
  store i32 %44, ptr %47, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %33
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !11

51:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  br label %52

52:                                               ; preds = %209, %61, %51
  %53 = load i32, ptr @q, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr @q, align 4, !tbaa !5
  %55 = icmp ne i32 %53, 0
  br i1 %55, label %56, label %213

56:                                               ; preds = %52
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5)
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = icmp eq i32 %58, %59
  br i1 %60, label %61, label %63

61:                                               ; preds = %56
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %52, !llvm.loop !12

63:                                               ; preds = %56
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = add nsw i32 %64, -1
  store i32 %65, ptr %4, align 4, !tbaa !5
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sub nsw i32 %66, 2
  store i32 %67, ptr %5, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %71
  store i32 %69, ptr %72, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %6, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %112, %63
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %115

80:                                               ; preds = %75
  br label %81

81:                                               ; preds = %96, %80
  %82 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %82, label %94, label %83

83:                                               ; preds = %81
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %6, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp sle i32 %88, %92
  br label %94

94:                                               ; preds = %83, %81
  %95 = phi i1 [ false, %81 ], [ %93, %83 ]
  br i1 %95, label %96, label %97

96:                                               ; preds = %94
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br label %81, !llvm.loop !13

97:                                               ; preds = %94
  %98 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %98, label %99, label %105

99:                                               ; preds = %97
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sub nsw i32 %100, 1
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %103
  store i32 %101, ptr %104, align 4, !tbaa !5
  br label %111

105:                                              ; preds = %97
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %109
  store i32 %107, ptr %110, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %105, %99
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %6)
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %6, align 4, !tbaa !5
  br label %75, !llvm.loop !14

115:                                              ; preds = %79
  br label %116

116:                                              ; preds = %119, %115
  %117 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %118 = xor i1 %117, true
  br i1 %118, label %119, label %120

119:                                              ; preds = %116
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br label %116, !llvm.loop !15

120:                                              ; preds = %116
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %124
  store i32 %122, ptr %125, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  store i32 %127, ptr %7, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %165, %120
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = load i32, ptr %4, align 4, !tbaa !5
  %131 = icmp sge i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %168

133:                                              ; preds = %128
  br label %134

134:                                              ; preds = %149, %133
  %135 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %135, label %147, label %136

136:                                              ; preds = %134
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = load i32, ptr %7, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = icmp slt i32 %141, %145
  br label %147

147:                                              ; preds = %136, %134
  %148 = phi i1 [ false, %134 ], [ %146, %136 ]
  br i1 %148, label %149, label %150

149:                                              ; preds = %147
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br label %134, !llvm.loop !16

150:                                              ; preds = %147
  %151 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %151, label %152, label %158

152:                                              ; preds = %150
  %153 = load i32, ptr %5, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %156
  store i32 %154, ptr %157, align 4, !tbaa !5
  br label %164

158:                                              ; preds = %150
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = load i32, ptr %7, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %162
  store i32 %160, ptr %163, align 4, !tbaa !5
  br label %164

164:                                              ; preds = %158, %152
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %7)
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %7, align 4, !tbaa !5
  %167 = add nsw i32 %166, -1
  store i32 %167, ptr %7, align 4, !tbaa !5
  br label %128, !llvm.loop !17

168:                                              ; preds = %132
  br label %169

169:                                              ; preds = %172, %168
  %170 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %171 = xor i1 %170, true
  br i1 %171, label %172, label %173

172:                                              ; preds = %169
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br label %169, !llvm.loop !18

173:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %174 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %174, ptr %9, align 4, !tbaa !5
  br label %175

175:                                              ; preds = %206, %173
  %176 = load i32, ptr %9, align 4, !tbaa !5
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = icmp sle i32 %176, %177
  br i1 %178, label %180, label %179

179:                                              ; preds = %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %209

180:                                              ; preds = %175
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %181 = load i32, ptr %9, align 4, !tbaa !5
  %182 = load i32, ptr %9, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %183
  %185 = load i32, ptr %184, align 4, !tbaa !5
  %186 = sub nsw i32 %181, %185
  %187 = sext i32 %186 to i64
  store i64 %187, ptr %10, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %188 = load i32, ptr %9, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %9, align 4, !tbaa !5
  %193 = sub nsw i32 %191, %192
  %194 = sext i32 %193 to i64
  store i64 %194, ptr %11, align 8, !tbaa !19
  %195 = load i64, ptr %10, align 8, !tbaa !19
  %196 = load i64, ptr %11, align 8, !tbaa !19
  %197 = mul nsw i64 %195, %196
  %198 = load i32, ptr %9, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = mul nsw i64 %197, %202
  %204 = load i64, ptr %8, align 8, !tbaa !19
  %205 = add nsw i64 %204, %203
  store i64 %205, ptr %8, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %206

206:                                              ; preds = %180
  %207 = load i32, ptr %9, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %9, align 4, !tbaa !5
  br label %175, !llvm.loop !21

209:                                              ; preds = %179
  %210 = load i64, ptr %8, align 8, !tbaa !19
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %210)
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %211, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %52, !llvm.loop !12

213:                                              ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #5 align 2

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

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

attributes #0 = { mustprogress 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #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 = { nounwind }

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

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


; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::basic_ostream" = type { ptr, %"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 }

@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@h = external dso_local global [100100 x i32], align 16
@d = external dso_local local_unnamed_addr global [100100 x i32], align 16
@x = external dso_local local_unnamed_addr global [100100 x i32], align 16
@y = external dso_local local_unnamed_addr global [100100 x i32], align 16
@s = external dso_local global %"class.std::stack", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@_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 i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @q)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.preheader31:                                     ; preds = %.lr.ph
  %8 = icmp sgt i32 %24, 1
  br i1 %8, label %.lr.ph34.preheader, label %._crit_edge

.lr.ph34.preheader:                               ; preds = %.preheader31
  %9 = add nsw i32 %24, -1
  %wide.trip.count = zext nneg i32 %9 to i64
  %.pre = load i32, ptr @h, align 16, !tbaa !5
  %min.iters.check = icmp ult i32 %24, 9
  br i1 %min.iters.check, label %.lr.ph34.preheader83, label %vector.ph

.lr.ph34.preheader83:                             ; preds = %middle.block, %.lr.ph34.preheader
  %.ph = phi i32 [ %.pre, %.lr.ph34.preheader ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv65.ph = phi i64 [ 0, %.lr.ph34.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph34

vector.ph:                                        ; preds = %.lr.ph34.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load82, %vector.body ]
  %10 = or disjoint i64 %index, 1
  %11 = getelementptr inbounds [100100 x i32], ptr @h, i64 0, i64 %10
  %12 = getelementptr inbounds i8, ptr %11, i64 16
  %wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5
  %wide.load82 = load <4 x i32>, ptr %12, align 4, !tbaa !5
  %13 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %14 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load82, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %15 = sub nsw <4 x i32> %wide.load, %13
  %16 = sub nsw <4 x i32> %wide.load82, %14
  %17 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %15, i1 true)
  %18 = tail call <4 x i32> @llvm.abs.v4i32(<4 x i32> %16, i1 true)
  %19 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %index
  %20 = getelementptr inbounds i8, ptr %19, i64 16
  store <4 x i32> %17, ptr %19, align 16, !tbaa !5
  store <4 x i32> %18, ptr %20, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %21 = icmp eq i64 %index.next, %n.vec
  br i1 %21, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %vector.recur.extract = extractelement <4 x i32> %wide.load82, i64 3
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph34.preheader83

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %22 = getelementptr inbounds [100100 x i32], ptr @h, i64 0, i64 %indvars.iv
  %23 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %22)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %.preheader31, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph34, %middle.block, %0, %.preheader31
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %27 = load i32, ptr @q, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr @q, align 4, !tbaa !5
  %.not58 = icmp eq i32 %27, 0
  br i1 %.not58, label %._crit_edge61, label %.lr.ph60

.lr.ph34:                                         ; preds = %.lr.ph34.preheader83, %.lr.ph34
  %29 = phi i32 [ %31, %.lr.ph34 ], [ %.ph, %.lr.ph34.preheader83 ]
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %.lr.ph34 ], [ %indvars.iv65.ph, %.lr.ph34.preheader83 ]
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %30 = getelementptr inbounds [100100 x i32], ptr @h, i64 0, i64 %indvars.iv.next66
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = sub nsw i32 %31, %29
  %33 = tail call i32 @llvm.abs.i32(i32 %32, i1 true)
  %34 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %indvars.iv65
  store i32 %33, ptr %34, align 4, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph34, !llvm.loop !14

.lr.ph60:                                         ; preds = %._crit_edge, %.backedge
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp eq i32 %36, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %.lr.ph60
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.backedge

.backedge:                                        ; preds = %39, %._crit_edge56
  %41 = load i32, ptr @q, align 4, !tbaa !5
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr @q, align 4, !tbaa !5
  %.not = icmp eq i32 %41, 0
  br i1 %.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !15

43:                                               ; preds = %.lr.ph60
  %44 = add nsw i32 %36, -1
  store i32 %44, ptr %1, align 4, !tbaa !5
  %45 = add nsw i32 %37, -2
  store i32 %45, ptr %2, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %46 = load i32, ptr %1, align 4, !tbaa !5
  %47 = add nsw i32 %46, -1
  %48 = sext i32 %46 to i64
  %49 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %48
  store i32 %47, ptr %49, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %storemerge37 = add nsw i32 %46, 1
  store i32 %storemerge37, ptr %3, align 4, !tbaa !5
  %50 = load i32, ptr %2, align 4, !tbaa !5
  %.not25.not38 = icmp slt i32 %46, %50
  br i1 %.not25.not38, label %.preheader30, label %._crit_edge39

.preheader30:                                     ; preds = %43, %71
  %51 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %51, label %.critedge, label %.lr.ph35

._crit_edge39:                                    ; preds = %71, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  %52 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %52, label %._crit_edge42, label %.lr.ph41

.lr.ph35:                                         ; preds = %.preheader30, %62
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %.not29 = icmp sgt i32 %57, %61
  br i1 %.not29, label %.critedge, label %62

62:                                               ; preds = %.lr.ph35
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %63 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %63, label %.critedge, label %.lr.ph35, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph35, %62, %.preheader30
  %64 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %64, label %65, label %68

65:                                               ; preds = %.critedge
  %66 = load i32, ptr %1, align 4, !tbaa !5
  %67 = add nsw i32 %66, -1
  br label %71

68:                                               ; preds = %.critedge
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %68, %65
  %.sink = phi i32 [ %70, %68 ], [ %67, %65 ]
  %.sink76 = load i32, ptr %3, align 4, !tbaa !5
  %72 = sext i32 %.sink76 to i64
  %73 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %72
  store i32 %.sink, ptr %73, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %74 = load i32, ptr %3, align 4, !tbaa !5
  %storemerge = add nsw i32 %74, 1
  store i32 %storemerge, ptr %3, align 4, !tbaa !5
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %.not25.not = icmp slt i32 %74, %75
  br i1 %.not25.not, label %.preheader30, label %._crit_edge39, !llvm.loop !17

.lr.ph41:                                         ; preds = %._crit_edge39, %.lr.ph41
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %76 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %76, label %._crit_edge42, label %.lr.ph41, !llvm.loop !18

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge39
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %79
  store i32 %78, ptr %80, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %storemerge2645 = add nsw i32 %77, -1
  store i32 %storemerge2645, ptr %4, align 4, !tbaa !5
  %81 = load i32, ptr %1, align 4, !tbaa !5
  %.not27.not46 = icmp sgt i32 %77, %81
  br i1 %.not27.not46, label %.preheader, label %._crit_edge47

.preheader:                                       ; preds = %._crit_edge42, %103
  %82 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %82, label %.critedge2, label %.lr.ph43

._crit_edge47:                                    ; preds = %103, %._crit_edge42
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %83 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %83, label %._crit_edge50, label %.lr.ph49

.lr.ph43:                                         ; preds = %.preheader, %94
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp slt i32 %88, %92
  br i1 %93, label %94, label %.critedge2

94:                                               ; preds = %.lr.ph43
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %95 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %95, label %.critedge2, label %.lr.ph43, !llvm.loop !19

.critedge2:                                       ; preds = %.lr.ph43, %94, %.preheader
  %96 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %96, label %97, label %100

97:                                               ; preds = %.critedge2
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  br label %103

100:                                              ; preds = %.critedge2
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %102 = load i32, ptr %101, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %100, %97
  %.sink77 = phi i32 [ %102, %100 ], [ %99, %97 ]
  %.sink80 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %.sink80 to i64
  %105 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %104
  store i32 %.sink77, ptr %105, align 4, !tbaa !5
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) @s, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %storemerge26 = add nsw i32 %106, -1
  store i32 %storemerge26, ptr %4, align 4, !tbaa !5
  %107 = load i32, ptr %1, align 4, !tbaa !5
  %.not27.not = icmp sgt i32 %106, %107
  br i1 %.not27.not, label %.preheader, label %._crit_edge47, !llvm.loop !20

.lr.ph49:                                         ; preds = %._crit_edge47, %.lr.ph49
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  %108 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) @s)
  br i1 %108, label %._crit_edge50, label %.lr.ph49, !llvm.loop !21

._crit_edge50:                                    ; preds = %.lr.ph49, %._crit_edge47
  %109 = load i32, ptr %1, align 4, !tbaa !5
  %110 = load i32, ptr %2, align 4, !tbaa !5
  %.not2851 = icmp sgt i32 %109, %110
  br i1 %.not2851, label %._crit_edge56, label %.lr.ph55.preheader

.lr.ph55.preheader:                               ; preds = %._crit_edge50
  %111 = sext i32 %109 to i64
  %112 = add i32 %110, 1
  %113 = sub i32 %112, %109
  %xtraiter = and i32 %113, 1
  %114 = icmp eq i32 %110, %109
  br i1 %114, label %._crit_edge56.loopexit.unr-lcssa, label %.lr.ph55.preheader.new

.lr.ph55.preheader.new:                           ; preds = %.lr.ph55.preheader
  %unroll_iter = and i32 %113, -2
  br label %.lr.ph55

._crit_edge56.loopexit.unr-lcssa:                 ; preds = %.lr.ph55, %.lr.ph55.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph55.preheader ], [ %158, %.lr.ph55 ]
  %indvars.iv68.unr = phi i64 [ %111, %.lr.ph55.preheader ], [ %indvars.iv.next69.1, %.lr.ph55 ]
  %.02352.unr = phi i64 [ 0, %.lr.ph55.preheader ], [ %158, %.lr.ph55 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge56, label %.lr.ph55.epil

.lr.ph55.epil:                                    ; preds = %._crit_edge56.loopexit.unr-lcssa
  %115 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %indvars.iv68.unr
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = sub nsw i64 %indvars.iv68.unr, %117
  %119 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %indvars.iv68.unr
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = sub nsw i64 %121, %indvars.iv68.unr
  %123 = mul nsw i64 %122, %118
  %124 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %indvars.iv68.unr
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = mul nsw i64 %123, %126
  %128 = add nsw i64 %127, %.02352.unr
  br label %._crit_edge56

._crit_edge56:                                    ; preds = %.lr.ph55.epil, %._crit_edge56.loopexit.unr-lcssa, %._crit_edge50
  %.023.lcssa = phi i64 [ 0, %._crit_edge50 ], [ %.lcssa.ph, %._crit_edge56.loopexit.unr-lcssa ], [ %128, %.lr.ph55.epil ]
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.023.lcssa)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %129, i8 noundef signext 10)
  br label %.backedge

.lr.ph55:                                         ; preds = %.lr.ph55, %.lr.ph55.preheader.new
  %indvars.iv68 = phi i64 [ %111, %.lr.ph55.preheader.new ], [ %indvars.iv.next69.1, %.lr.ph55 ]
  %.02352 = phi i64 [ 0, %.lr.ph55.preheader.new ], [ %158, %.lr.ph55 ]
  %niter = phi i32 [ 0, %.lr.ph55.preheader.new ], [ %niter.next.1, %.lr.ph55 ]
  %131 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %indvars.iv68
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = sub nsw i64 %indvars.iv68, %133
  %135 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %indvars.iv68
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = sub nsw i64 %137, %indvars.iv68
  %139 = mul nsw i64 %138, %134
  %140 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %indvars.iv68
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = mul nsw i64 %139, %142
  %144 = add nsw i64 %143, %.02352
  %indvars.iv.next69 = add nsw i64 %indvars.iv68, 1
  %145 = getelementptr inbounds [100100 x i32], ptr @x, i64 0, i64 %indvars.iv.next69
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = sub nsw i64 %indvars.iv.next69, %147
  %149 = getelementptr inbounds [100100 x i32], ptr @y, i64 0, i64 %indvars.iv.next69
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = sub nsw i64 %151, %indvars.iv.next69
  %153 = mul nsw i64 %152, %148
  %154 = getelementptr inbounds [100100 x i32], ptr @d, i64 0, i64 %indvars.iv.next69
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = mul nsw i64 %153, %156
  %158 = add nsw i64 %157, %144
  %indvars.iv.next69.1 = add nsw i64 %indvars.iv68, 2
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge56.loopexit.unr-lcssa, label %.lr.ph55, !llvm.loop !22

._crit_edge61:                                    ; preds = %.backedge, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass