; LLVM IR from vmartinv/eldiego :: estructuras/convexhull.trick (main)

; 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.CHT = type { %"class.std::vector", i8, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.CHTBruto = type <{ %"class.std::vector", i8, [7 x i8] }>
%"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 }

@ch = external dso_local global %struct.CHT, align 8
@chb = external dso_local global %struct.CHTBruto, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [83 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3CHTC2Eb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3CHTD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8CHTBrutoC2Eb(ptr noundef nonnull align 8 dereferenceable(25), i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CHTBrutoD2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2 align 2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.CHT, align 8
  %10 = alloca %struct.CHTBruto, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  %17 = call i64 @time(ptr noundef null) #9
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr %7, align 4, !tbaa !5
  %19 = load i32, ptr %7, align 4, !tbaa !5
  call void @srand(i32 noundef %19) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %143, %0
  br label %21

21:                                               ; preds = %103, %20
  store i32 0, ptr %5, align 4, !tbaa !5
  %22 = call i32 @rand() #9
  %23 = srem i32 %22, 2
  store i32 %23, ptr %5, align 4, !tbaa !5
  store i32 -1, ptr %6, align 4, !tbaa !5
  %24 = call i32 @rand() #9
  %25 = srem i32 %24, 2
  %26 = icmp ne i32 %25, 0
  %27 = zext i1 %26 to i64
  %28 = select i1 %26, i32 1, i32 -1
  store i32 %28, ptr %6, align 4, !tbaa !5
  %29 = call i32 @rand() #9
  %30 = srem i32 %29, 2001
  %31 = add nsw i32 %30, -1000
  %32 = sext i32 %31 to i64
  store i64 %32, ptr %2, align 8, !tbaa !9
  %33 = load i64, ptr %2, align 8, !tbaa !9
  %34 = icmp ne i64 %33, 0
  br i1 %34, label %38, label %35

35:                                               ; preds = %21
  %36 = load i64, ptr %2, align 8, !tbaa !9
  %37 = add nsw i64 %36, 1
  store i64 %37, ptr %2, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %35, %21
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %40 = load i32, ptr %5, align 4, !tbaa !5
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %38
  br label %44

43:                                               ; preds = %38
  br label %44

44:                                               ; preds = %43, %42
  %45 = phi ptr [ @.str.3, %42 ], [ @.str.4, %43 ]
  %46 = getelementptr inbounds [4 x i8], ptr %45, i64 0, i64 0
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef %46)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #9
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  call void @_ZN3CHTC2Eb(ptr noundef nonnull align 8 dereferenceable(32) %9, i1 noundef zeroext %50)
  %51 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3CHTaSEOS_(ptr noundef nonnull align 8 dereferenceable(32) @ch, ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #9
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = icmp ne i32 %52, 0
  invoke void @_ZN8CHTBrutoC2Eb(ptr noundef nonnull align 8 dereferenceable(25) %10, i1 noundef zeroext %53)
          to label %54 unwind label %60

54:                                               ; preds = %44
  %55 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZN8CHTBrutoaSEOS_(ptr noundef nonnull align 8 dereferenceable(25) @chb, ptr noundef nonnull align 8 dereferenceable(25) %10) #9
  call void @_ZN8CHTBrutoD2Ev(ptr noundef nonnull align 8 dereferenceable(25) %10) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #9
  call void @_ZN3CHTD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %100, %54
  %57 = load i32, ptr %13, align 4, !tbaa !5
  %58 = icmp slt i32 %57, 25
  br i1 %58, label %64, label %59

59:                                               ; preds = %56
  store i32 6, ptr %14, align 4
  br label %103

60:                                               ; preds = %44
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %11, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #9
  call void @_ZN3CHTD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #9
  br label %146

64:                                               ; preds = %56
  %65 = load i64, ptr %2, align 8, !tbaa !9
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = call i32 @rand() #9
  %68 = srem i32 %67, 11
  %69 = add nsw i32 %68, 0
  %70 = mul nsw i32 %66, %69
  %71 = sext i32 %70 to i64
  %72 = add nsw i64 %65, %71
  store i64 %72, ptr %2, align 8, !tbaa !9
  %73 = load i64, ptr %2, align 8, !tbaa !9
  %74 = icmp ne i64 %73, 0
  br i1 %74, label %80, label %75

75:                                               ; preds = %64
  %76 = load i32, ptr %6, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = load i64, ptr %2, align 8, !tbaa !9
  %79 = add nsw i64 %78, %77
  store i64 %79, ptr %2, align 8, !tbaa !9
  br label %80

80:                                               ; preds = %75, %64
  %81 = load i64, ptr %2, align 8, !tbaa !9
  %82 = icmp sgt i64 %81, 10000
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  store i32 5, ptr %14, align 4
  br label %103

84:                                               ; preds = %80
  %85 = call i32 @rand() #9
  %86 = srem i32 %85, 2001
  %87 = add nsw i32 %86, -1000
  %88 = sext i32 %87 to i64
  store i64 %88, ptr %3, align 8, !tbaa !9
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
  %90 = load i64, ptr %2, align 8, !tbaa !9
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %89, i64 noundef %90)
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %91, i8 noundef signext 32)
  %93 = load i64, ptr %3, align 8, !tbaa !9
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %92, i64 noundef %93)
  %95 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %96 = load i64, ptr %2, align 8, !tbaa !9
  %97 = load i64, ptr %3, align 8, !tbaa !9
  call void @_ZN3CHT3addExx(ptr noundef nonnull align 8 dereferenceable(32) @ch, i64 noundef %96, i64 noundef %97)
  %98 = load i64, ptr %2, align 8, !tbaa !9
  %99 = load i64, ptr %3, align 8, !tbaa !9
  call void @_ZN8CHTBruto3addExx(ptr noundef nonnull align 8 dereferenceable(25) @chb, i64 noundef %98, i64 noundef %99)
  br label %100

100:                                              ; preds = %84
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %13, align 4, !tbaa !5
  br label %56, !llvm.loop !11

103:                                              ; preds = %83, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  %104 = load i32, ptr %14, align 4
  switch i32 %104, label %151 [
    i32 6, label %105
    i32 5, label %21
  ]

105:                                              ; preds = %103
  %106 = call i32 @rand() #9
  %107 = srem i32 %106, 2001
  %108 = add nsw i32 %107, -1000
  %109 = sext i32 %108 to i64
  store i64 %109, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %110 = load i64, ptr %4, align 8, !tbaa !9
  %111 = call noundef i64 @_ZN3CHT4evalEx(ptr noundef nonnull align 8 dereferenceable(32) @ch, i64 noundef %110)
  store i64 %111, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  %112 = load i64, ptr %4, align 8, !tbaa !9
  %113 = call noundef i64 @_ZN8CHTBruto4evalEx(ptr noundef nonnull align 8 dereferenceable(25) @chb, i64 noundef %112)
  store i64 %113, ptr %16, align 8, !tbaa !9
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  %115 = load i64, ptr %4, align 8, !tbaa !9
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %114, i64 noundef %115)
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %116, i8 noundef signext 32)
  %118 = load i64, ptr %15, align 8, !tbaa !9
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %117, i64 noundef %118)
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %119, i8 noundef signext 32)
  %121 = load i64, ptr %16, align 8, !tbaa !9
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %120, i64 noundef %121)
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %124 = load i64, ptr %15, align 8, !tbaa !9
  %125 = load i64, ptr %16, align 8, !tbaa !9
  %126 = icmp eq i64 %124, %125
  br i1 %126, label %137, label %127

127:                                              ; preds = %105
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.7)
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %128, i32 noundef %129)
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %132 = load ptr, ptr %131, align 8, !tbaa !13
  %133 = getelementptr i8, ptr %132, i64 -24
  %134 = load i64, ptr %133, align 8
  %135 = getelementptr inbounds i8, ptr %131, i64 %134
  %136 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %135)
  br label %137

137:                                              ; preds = %127, %105
  %138 = phi i1 [ true, %105 ], [ %136, %127 ]
  br i1 %138, label %139, label %140

139:                                              ; preds = %137
  br label %142

140:                                              ; preds = %137
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 112, ptr noundef @__PRETTY_FUNCTION__.main) #10
  unreachable

141:                                              ; No predecessors!
  br label %142

142:                                              ; preds = %141, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %8, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %8, align 4, !tbaa !5
  br label %20, !llvm.loop !15

146:                                              ; preds = %60
  %147 = load ptr, ptr %11, align 8
  %148 = load i32, ptr %12, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150

151:                                              ; preds = %103
  unreachable
}

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #4

; Function Attrs: nounwind
declare void @srand(i32 noundef) #4

; Function Attrs: nounwind
declare i32 @rand() #4

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25) ptr @_ZN8CHTBrutoaSEOS_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(25)) #2 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) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3CHT3addExx(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CHTBruto3addExx(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef, i64 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3CHT4evalEx(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN8CHTBruto4evalEx(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) #6 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 = { 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 #6 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !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.CHT = type { %"class.std::vector", i8, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl" = type { %"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Line, std::allocator<Line>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.CHTBruto = type <{ %"class.std::vector", i8, [7 x i8] }>
%"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 }

@ch = external dso_local global %struct.CHT, align 8
@chb = external dso_local global %struct.CHTBruto, align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [83 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3CHTC2Eb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3CHTD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8CHTBrutoC2Eb(ptr noundef nonnull align 8 dereferenceable(25), i1 noundef zeroext) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CHTBrutoD2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #2 align 2

; Function Attrs: mustprogress norecurse noreturn uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %struct.CHT, align 8
  %2 = alloca %struct.CHTBruto, align 8
  %3 = tail call i64 @time(ptr noundef null) #10
  %4 = trunc i64 %3 to i32
  tail call void @srand(i32 noundef %4) #10
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.backedge, %0
  %5 = call i32 @rand() #10
  %6 = call i32 @rand() #10
  %7 = and i32 %6, 1
  %.not = icmp eq i32 %7, 0
  %8 = select i1 %.not, i32 -1, i32 1
  %9 = call i32 @rand() #10
  %10 = srem i32 %9, 2001
  %11 = add nsw i32 %10, -1000
  %narrow = call i32 @llvm.umax.i32(i32 %11, i32 1)
  %spec.select = sext i32 %narrow to i64
  %12 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %13 = and i32 %5, 1
  %14 = icmp ne i32 %13, 0
  %.str.3..str.4 = select i1 %14, ptr @.str.3, ptr @.str.4
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull %.str.3..str.4)
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #10
  call void @_ZN3CHTC2Eb(ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext %14)
  %17 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN3CHTaSEOS_(ptr noundef nonnull align 8 dereferenceable(32) @ch, ptr noundef nonnull align 8 dereferenceable(32) %1) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #10
  call void @_ZN8CHTBrutoC2Eb(ptr noundef nonnull align 8 dereferenceable(25) %2, i1 noundef zeroext %14)
  %18 = call noundef nonnull align 8 dereferenceable(25) ptr @_ZN8CHTBrutoaSEOS_(ptr noundef nonnull align 8 dereferenceable(25) @chb, ptr noundef nonnull align 8 dereferenceable(25) %2) #10
  call void @_ZN8CHTBrutoD2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #10
  call void @_ZN3CHTD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #10
  %19 = sext i32 %8 to i64
  br label %20

20:                                               ; preds = %.loopexit, %27
  %.144 = phi i64 [ %spec.select, %.loopexit ], [ %spec.select39, %27 ]
  %.03143 = phi i32 [ 0, %.loopexit ], [ %37, %27 ]
  %21 = call i32 @rand() #10
  %22 = srem i32 %21, 11
  %23 = mul nsw i32 %22, %8
  %24 = sext i32 %23 to i64
  %25 = add nsw i64 %.144, %24
  %.not38 = icmp eq i64 %25, 0
  %spec.select39 = select i1 %.not38, i64 %19, i64 %25
  %26 = icmp sgt i64 %spec.select39, 10000
  br i1 %26, label %.loopexit.backedge, label %27

27:                                               ; preds = %20
  %28 = call i32 @rand() #10
  %29 = srem i32 %28, 2001
  %30 = add nsw i32 %29, -1000
  %31 = sext i32 %30 to i64
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.5)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %32, i64 noundef %spec.select39)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %33, i8 noundef signext 32)
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %34, i64 noundef %31)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @_ZN3CHT3addExx(ptr noundef nonnull align 8 dereferenceable(32) @ch, i64 noundef %spec.select39, i64 noundef %31)
  call void @_ZN8CHTBruto3addExx(ptr noundef nonnull align 8 dereferenceable(25) @chb, i64 noundef %spec.select39, i64 noundef %31)
  %37 = add nuw nsw i32 %.03143, 1
  %exitcond.not = icmp eq i32 %37, 25
  br i1 %exitcond.not, label %38, label %20, !llvm.loop !5

38:                                               ; preds = %27
  %39 = call i32 @rand() #10
  %40 = srem i32 %39, 2001
  %41 = add nsw i32 %40, -1000
  %42 = sext i32 %41 to i64
  %43 = call noundef i64 @_ZN3CHT4evalEx(ptr noundef nonnull align 8 dereferenceable(32) @ch, i64 noundef %42)
  %44 = call noundef i64 @_ZN8CHTBruto4evalEx(ptr noundef nonnull align 8 dereferenceable(25) @chb, i64 noundef %42)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %45, i64 noundef %42)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %46, i8 noundef signext 32)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %47, i64 noundef %43)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %48, i8 noundef signext 32)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %49, i64 noundef %44)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %52 = icmp eq i64 %43, %44
  br i1 %52, label %.loopexit.backedge, label %53

.loopexit.backedge:                               ; preds = %20, %38, %53
  br label %.loopexit, !llvm.loop !7

53:                                               ; preds = %38
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.7)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %54, i32 noundef %4)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %57 = load ptr, ptr %56, align 8, !tbaa !8
  %58 = getelementptr i8, ptr %57, i64 -24
  %59 = load i64, ptr %58, align 8
  %60 = getelementptr inbounds i8, ptr %56, i64 %59
  %61 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264) %60)
  br i1 %61, label %.loopexit.backedge, label %62

62:                                               ; preds = %53
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 112, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #11
  unreachable
}

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

; 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 #5

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(25) ptr @_ZN8CHTBrutoaSEOS_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 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 #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3CHT3addExx(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef, i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CHTBruto3addExx(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef, i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN3CHT4evalEx(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #6 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN8CHTBruto4evalEx(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEntEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #6 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #9

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


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