; LLVM IR from upupming/algorithm :: kick-start/2020/RoundE/B-High_Buildings.ll (Z5solvev)

; 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::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
@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@c = external dso_local global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [96 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5solvev() #0 {
  %1 = alloca i1, align 1
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %8 = load i32, ptr @n, align 4, !tbaa !5
  %9 = load i32, ptr @a, align 4, !tbaa !5
  %10 = load i32, ptr @b, align 4, !tbaa !5
  %11 = add nsw i32 %9, %10
  %12 = load i32, ptr @c, align 4, !tbaa !5
  %13 = sub nsw i32 %11, %12
  %14 = sub nsw i32 %8, %13
  store i32 %14, ptr %5, align 4, !tbaa !5
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %0
  store i1 false, ptr %1, align 1
  store i32 1, ptr %6, align 4
  br label %203

18:                                               ; preds = %0
  %19 = load i32, ptr @n, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %35

21:                                               ; preds = %18
  %22 = load i32, ptr @a, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 1
  br i1 %23, label %24, label %33

24:                                               ; preds = %21
  %25 = load i32, ptr @b, align 4, !tbaa !5
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %33

27:                                               ; preds = %24
  %28 = load i32, ptr @c, align 4, !tbaa !5
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %34

33:                                               ; preds = %27, %24, %21
  store i1 false, ptr %1, align 1
  store i32 1, ptr %6, align 4
  br label %203

34:                                               ; preds = %30
  br label %202

35:                                               ; preds = %18
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp eq i32 %36, 2
  br i1 %37, label %38, label %84

38:                                               ; preds = %35
  %39 = load i32, ptr @a, align 4, !tbaa !5
  %40 = icmp eq i32 %39, 2
  br i1 %40, label %41, label %52

41:                                               ; preds = %38
  %42 = load i32, ptr @b, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %52

44:                                               ; preds = %41
  %45 = load i32, ptr @c, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %52

47:                                               ; preds = %44
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %49, i32 noundef 2)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %83

52:                                               ; preds = %44, %41, %38
  %53 = load i32, ptr @a, align 4, !tbaa !5
  %54 = icmp eq i32 %53, 2
  br i1 %54, label %55, label %66

55:                                               ; preds = %52
  %56 = load i32, ptr @b, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %58, label %66

58:                                               ; preds = %55
  %59 = load i32, ptr @c, align 4, !tbaa !5
  %60 = icmp eq i32 %59, 2
  br i1 %60, label %61, label %66

61:                                               ; preds = %58
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @.str)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %63, i32 noundef 2)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %82

66:                                               ; preds = %58, %55, %52
  %67 = load i32, ptr @a, align 4, !tbaa !5
  %68 = icmp eq i32 %67, 1
  br i1 %68, label %69, label %80

69:                                               ; preds = %66
  %70 = load i32, ptr @b, align 4, !tbaa !5
  %71 = icmp eq i32 %70, 2
  br i1 %71, label %72, label %80

72:                                               ; preds = %69
  %73 = load i32, ptr @c, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %80

75:                                               ; preds = %72
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef @.str)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %77, i32 noundef 1)
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %78, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %81

80:                                               ; preds = %72, %69, %66
  store i1 false, ptr %1, align 1
  store i32 1, ptr %6, align 4
  br label %203

81:                                               ; preds = %75
  br label %82

82:                                               ; preds = %81, %61
  br label %83

83:                                               ; preds = %82, %47
  br label %201

84:                                               ; preds = %35
  %85 = load i32, ptr @c, align 4, !tbaa !5
  store i32 %85, ptr %3, align 4, !tbaa !5
  %86 = load i32, ptr @a, align 4, !tbaa !5
  %87 = load i32, ptr @c, align 4, !tbaa !5
  %88 = sub nsw i32 %86, %87
  store i32 %88, ptr %2, align 4, !tbaa !5
  %89 = load i32, ptr @b, align 4, !tbaa !5
  %90 = load i32, ptr @c, align 4, !tbaa !5
  %91 = sub nsw i32 %89, %90
  store i32 %91, ptr %4, align 4, !tbaa !5
  %92 = load i32, ptr %2, align 4, !tbaa !5
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = add nsw i32 %92, %93
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = add nsw i32 %94, %95
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = add nsw i32 %96, %97
  %99 = load i32, ptr @n, align 4, !tbaa !5
  %100 = icmp eq i32 %98, %99
  br i1 %100, label %101, label %102

101:                                              ; preds = %84
  br label %104

102:                                              ; preds = %84
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 44, ptr noundef @__PRETTY_FUNCTION__._Z5solvev) #6
  unreachable

103:                                              ; No predecessors!
  br label %104

104:                                              ; preds = %103, %101
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %105, %106
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = add nsw i32 %107, %108
  %110 = icmp sle i32 %109, 1
  br i1 %110, label %111, label %115

111:                                              ; preds = %104
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %111
  store i1 false, ptr %1, align 1
  store i32 1, ptr %6, align 4
  br label %203

115:                                              ; preds = %111, %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  %116 = load i32, ptr %2, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %115
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %118, %115
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = icmp sgt i32 %120, 1
  br i1 %121, label %122, label %123

122:                                              ; preds = %119
  store i32 2, ptr %7, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %122, %119
  br label %124

124:                                              ; preds = %128, %123
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %2, align 4, !tbaa !5
  %127 = icmp ne i32 %125, 0
  br i1 %127, label %128, label %133

128:                                              ; preds = %124
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = sub nsw i32 %129, 1
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %130)
  %132 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %131, ptr noundef @.str)
  br label %124, !llvm.loop !9

133:                                              ; preds = %124
  %134 = load i32, ptr %7, align 4, !tbaa !5
  %135 = icmp eq i32 %134, 1
  br i1 %135, label %136, label %147

136:                                              ; preds = %133
  br label %137

137:                                              ; preds = %141, %136
  %138 = load i32, ptr %5, align 4, !tbaa !5
  %139 = add nsw i32 %138, -1
  store i32 %139, ptr %5, align 4, !tbaa !5
  %140 = icmp ne i32 %138, 0
  br i1 %140, label %141, label %146

141:                                              ; preds = %137
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = sub nsw i32 %142, 2
  %144 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %143)
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %144, ptr noundef @.str)
  br label %137, !llvm.loop !11

146:                                              ; preds = %137
  br label %147

147:                                              ; preds = %146, %133
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = icmp eq i32 %148, 2
  br i1 %149, label %150, label %166

150:                                              ; preds = %147
  %151 = load i32, ptr @n, align 4, !tbaa !5
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %151)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @.str)
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = add nsw i32 %154, -1
  store i32 %155, ptr %3, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %160, %150
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = add nsw i32 %157, -1
  store i32 %158, ptr %5, align 4, !tbaa !5
  %159 = icmp ne i32 %157, 0
  br i1 %159, label %160, label %165

160:                                              ; preds = %156
  %161 = load i32, ptr @n, align 4, !tbaa !5
  %162 = sub nsw i32 %161, 2
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %162)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %163, ptr noundef @.str)
  br label %156, !llvm.loop !12

165:                                              ; preds = %156
  br label %166

166:                                              ; preds = %165, %147
  br label %167

167:                                              ; preds = %171, %166
  %168 = load i32, ptr %3, align 4, !tbaa !5
  %169 = add nsw i32 %168, -1
  store i32 %169, ptr %3, align 4, !tbaa !5
  %170 = icmp ne i32 %168, 0
  br i1 %170, label %171, label %175

171:                                              ; preds = %167
  %172 = load i32, ptr @n, align 4, !tbaa !5
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %172)
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %173, ptr noundef @.str)
  br label %167, !llvm.loop !13

175:                                              ; preds = %167
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = icmp eq i32 %176, 0
  br i1 %177, label %178, label %189

178:                                              ; preds = %175
  br label %179

179:                                              ; preds = %183, %178
  %180 = load i32, ptr %5, align 4, !tbaa !5
  %181 = add nsw i32 %180, -1
  store i32 %181, ptr %5, align 4, !tbaa !5
  %182 = icmp ne i32 %180, 0
  br i1 %182, label %183, label %188

183:                                              ; preds = %179
  %184 = load i32, ptr @n, align 4, !tbaa !5
  %185 = sub nsw i32 %184, 2
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %185)
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %186, ptr noundef @.str)
  br label %179, !llvm.loop !14

188:                                              ; preds = %179
  br label %189

189:                                              ; preds = %188, %175
  br label %190

190:                                              ; preds = %194, %189
  %191 = load i32, ptr %4, align 4, !tbaa !5
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %4, align 4, !tbaa !5
  %193 = icmp ne i32 %191, 0
  br i1 %193, label %194, label %199

194:                                              ; preds = %190
  %195 = load i32, ptr @n, align 4, !tbaa !5
  %196 = sub nsw i32 %195, 1
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %196)
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %197, ptr noundef @.str)
  br label %190, !llvm.loop !15

199:                                              ; preds = %190
  %200 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %201

201:                                              ; preds = %199, %83
  br label %202

202:                                              ; preds = %201, %34
  store i1 true, ptr %1, align 1
  store i32 1, ptr %6, align 4
  br label %203

203:                                              ; preds = %202, %114, %80, %33, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %204 = load i1, ptr %1, align 1
  ret i1 %204
}

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

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


; 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::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 local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global i32, align 4
@b = external dso_local local_unnamed_addr global i32, align 4
@c = external dso_local local_unnamed_addr global i32, align 4
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [96 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5solvev() local_unnamed_addr #0 {
  %1 = load i32, ptr @n, align 4, !tbaa !5
  %2 = load i32, ptr @a, align 4, !tbaa !5
  %3 = load i32, ptr @b, align 4
  %4 = load i32, ptr @c, align 4
  %5 = add i32 %2, %3
  %.neg = sub i32 %1, %5
  %6 = add i32 %.neg, %4
  %7 = icmp slt i32 %6, 0
  br i1 %7, label %87, label %8

8:                                                ; preds = %0
  switch i32 %1, label %37 [
    i32 1, label %9
    i32 2, label %15
  ]

9:                                                ; preds = %8
  %10 = icmp eq i32 %2, 1
  %11 = icmp eq i32 %3, 1
  %or.cond = and i1 %10, %11
  %12 = icmp eq i32 %4, 1
  %or.cond3 = and i1 %or.cond, %12
  br i1 %or.cond3, label %13, label %87

13:                                               ; preds = %9
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  br label %.sink.split

15:                                               ; preds = %8
  %16 = icmp eq i32 %2, 2
  %17 = icmp eq i32 %3, 1
  %or.cond5 = and i1 %16, %17
  %18 = icmp eq i32 %4, 1
  %or.cond7 = and i1 %or.cond5, %18
  br i1 %or.cond7, label %19, label %23

19:                                               ; preds = %15
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %21 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull @.str)
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef 2)
  br label %.sink.split

23:                                               ; preds = %15
  %24 = icmp eq i32 %3, 2
  %25 = icmp eq i32 %4, 2
  %26 = and i1 %24, %25
  %or.cond11 = and i1 %16, %26
  br i1 %or.cond11, label %27, label %31

27:                                               ; preds = %23
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @.str)
  %30 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %29, i32 noundef 2)
  br label %.sink.split

31:                                               ; preds = %23
  %32 = icmp eq i32 %2, 1
  %or.cond13 = and i1 %32, %24
  %or.cond15 = and i1 %or.cond13, %18
  br i1 %or.cond15, label %33, label %87

33:                                               ; preds = %31
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 2)
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @.str)
  %36 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %35, i32 noundef 1)
  br label %.sink.split

37:                                               ; preds = %8
  %38 = sub nsw i32 %2, %4
  %39 = sub nsw i32 %3, %4
  %40 = add nsw i32 %39, %2
  %41 = add nsw i32 %40, %6
  %42 = icmp eq i32 %41, %1
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 44, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5solvev) #4
  unreachable

44:                                               ; preds = %37
  %45 = icmp slt i32 %40, 2
  %46 = icmp ne i32 %6, 0
  %or.cond17 = and i1 %45, %46
  br i1 %or.cond17, label %87, label %47

47:                                               ; preds = %44
  %48 = icmp sgt i32 %38, 0
  %49 = icmp slt i32 %4, 2
  %.not59 = icmp eq i32 %38, 0
  br i1 %.not59, label %.loopexit58, label %.lr.ph

.lr.ph:                                           ; preds = %47, %.lr.ph
  %.04260 = phi i32 [ %50, %.lr.ph ], [ %38, %47 ]
  %50 = add nsw i32 %.04260, -1
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %52)
  %54 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @.str)
  %.not = icmp eq i32 %50, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph
  %55 = select i1 %49, i1 %48, i1 false
  br i1 %55, label %.preheader57, label %.loopexit58

.preheader57:                                     ; preds = %._crit_edge
  %.not4861 = icmp eq i32 %6, 0
  br i1 %.not4861, label %.loopexit56, label %.lr.ph63

.lr.ph63:                                         ; preds = %.preheader57, %.lr.ph63
  %.062 = phi i32 [ %56, %.lr.ph63 ], [ %6, %.preheader57 ]
  %56 = add nsw i32 %.062, -1
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = add nsw i32 %57, -2
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %58)
  %60 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @.str)
  %.not48 = icmp eq i32 %56, 0
  br i1 %.not48, label %.loopexit58, label %.lr.ph63, !llvm.loop !11

.loopexit58:                                      ; preds = %.lr.ph63, %47, %._crit_edge
  %.1 = phi i32 [ %6, %._crit_edge ], [ %6, %47 ], [ -1, %.lr.ph63 ]
  br i1 %49, label %.loopexit56, label %61

61:                                               ; preds = %.loopexit58
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %62)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str)
  %65 = add nsw i32 %4, -1
  %.not4964 = icmp eq i32 %.1, 0
  br i1 %.not4964, label %.lr.ph71.preheader, label %.lr.ph67

.lr.ph67:                                         ; preds = %61, %.lr.ph67
  %.265 = phi i32 [ %66, %.lr.ph67 ], [ %.1, %61 ]
  %66 = add nsw i32 %.265, -1
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = add nsw i32 %67, -2
  %69 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %68)
  %70 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef nonnull @.str)
  %.not49 = icmp eq i32 %66, 0
  br i1 %.not49, label %.loopexit56, label %.lr.ph67, !llvm.loop !12

.loopexit56:                                      ; preds = %.lr.ph67, %.preheader57, %.loopexit58
  %.040 = phi i32 [ %4, %.loopexit58 ], [ %4, %.preheader57 ], [ %65, %.lr.ph67 ]
  %.3 = phi i32 [ %.1, %.loopexit58 ], [ -1, %.preheader57 ], [ -1, %.lr.ph67 ]
  %.not5068 = icmp eq i32 %.040, 0
  br i1 %.not5068, label %._crit_edge72, label %.lr.ph71.preheader

.lr.ph71.preheader:                               ; preds = %61, %.loopexit56
  %.387 = phi i32 [ %.3, %.loopexit56 ], [ -1, %61 ]
  %.04086 = phi i32 [ %.040, %.loopexit56 ], [ %65, %61 ]
  br label %.lr.ph71

.lr.ph71:                                         ; preds = %.lr.ph71.preheader, %.lr.ph71
  %.14169 = phi i32 [ %71, %.lr.ph71 ], [ %.04086, %.lr.ph71.preheader ]
  %71 = add nsw i32 %.14169, -1
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %72)
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull @.str)
  %.not50 = icmp eq i32 %71, 0
  br i1 %.not50, label %._crit_edge72, label %.lr.ph71, !llvm.loop !13

._crit_edge72:                                    ; preds = %.lr.ph71, %.loopexit56
  %.388 = phi i32 [ %.3, %.loopexit56 ], [ %.387, %.lr.ph71 ]
  %not. = xor i1 %49, true
  %75 = select i1 %not., i1 true, i1 %48
  %.not5173 = icmp eq i32 %.388, 0
  %or.cond81 = or i1 %75, %.not5173
  br i1 %or.cond81, label %.loopexit, label %.lr.ph75

.lr.ph75:                                         ; preds = %._crit_edge72, %.lr.ph75
  %.474 = phi i32 [ %76, %.lr.ph75 ], [ %.388, %._crit_edge72 ]
  %76 = add nsw i32 %.474, -1
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = add nsw i32 %77, -2
  %79 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %78)
  %80 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @.str)
  %.not51 = icmp eq i32 %76, 0
  br i1 %.not51, label %.loopexit, label %.lr.ph75, !llvm.loop !14

.loopexit:                                        ; preds = %.lr.ph75, %._crit_edge72
  %.not5276 = icmp eq i32 %39, 0
  br i1 %.not5276, label %.sink.split, label %.lr.ph79

.lr.ph79:                                         ; preds = %.loopexit, %.lr.ph79
  %.03977 = phi i32 [ %81, %.lr.ph79 ], [ %39, %.loopexit ]
  %81 = add nsw i32 %.03977, -1
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %83)
  %85 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %84, ptr noundef nonnull @.str)
  %.not52 = icmp eq i32 %81, 0
  br i1 %.not52, label %.sink.split, label %.lr.ph79, !llvm.loop !15

.sink.split:                                      ; preds = %.lr.ph79, %.loopexit, %27, %33, %19, %13
  %.sink = phi ptr [ %14, %13 ], [ %22, %19 ], [ %36, %33 ], [ %30, %27 ], [ @_ZSt4cout, %.loopexit ], [ @_ZSt4cout, %.lr.ph79 ]
  %86 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %87

87:                                               ; preds = %.sink.split, %44, %31, %9, %0
  %.043 = phi i1 [ false, %0 ], [ false, %9 ], [ false, %31 ], [ false, %44 ], [ true, %.sink.split ]
  ret i1 %.043
}

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #3 = { noreturn 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 #4 = { noreturn 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}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass