; LLVM IR from romerojosh/zefr :: src/funcs.ll (Z23gmsh_to_structured_quadj)

; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::vector<int>>, std::_Select1st<std::pair<const int, std::vector<int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::vector<int>>, std::_Select1st<std::pair<const int, std::vector<int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.18" = type { i8 }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }

@_ZL13ijk_maps_quad = external hidden global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [63 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@__func__._Z23gmsh_to_structured_quadj = external hidden unnamed_addr constant [24 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [32 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 uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #1 align 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) #2

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) #1 align 2

declare void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

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

declare void @__cxa_free_exception(ptr)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #5 align 2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23gmsh_to_structured_quadj(ptr dead_on_unwind noalias writable sret(%"class.std::vector.16") align 8 %0, i32 noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca %"class.std::allocator.18", align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %14 = alloca %"class.std::__cxx11::basic_string", align 8
  %15 = alloca i1, align 1
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %24 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %24, ptr %5, align 4, !tbaa !5
  %25 = call noundef i64 @_ZNKSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13ijk_maps_quad, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %26 = icmp ne i64 %25, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br i1 %26, label %27, label %30

27:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %28 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %28, ptr %6, align 4, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13ijk_maps_quad, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %29)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %255

30:                                               ; preds = %2
  store i1 false, ptr %7, align 1
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = zext i32 %31 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %32, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %33 unwind label %66

33:                                               ; preds = %30
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 8
  br i1 %35, label %36, label %241

36:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = uitofp i32 %37 to double
  %39 = call double @sqrt(double noundef %38) #6
  %40 = fptosi double %39 to i32
  store i32 %40, ptr %12, align 4, !tbaa !5
  %41 = load i32, ptr %12, align 4, !tbaa !5
  %42 = load i32, ptr %12, align 4, !tbaa !5
  %43 = mul nsw i32 %41, %42
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = icmp ne i32 %43, %44
  br i1 %45, label %46, label %92

46:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 392, ptr %13) #6
  invoke void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %13)
          to label %47 unwind label %70

47:                                               ; preds = %46
  %48 = getelementptr inbounds i8, ptr %13, i64 16
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef @.str)
          to label %50 unwind label %74

50:                                               ; preds = %47
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @.str.11)
          to label %52 unwind label %74

52:                                               ; preds = %50
  %53 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %51, i32 noundef 1020)
          to label %54 unwind label %74

54:                                               ; preds = %52
  %55 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @.str.11)
          to label %56 unwind label %74

56:                                               ; preds = %54
  %57 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @__func__._Z23gmsh_to_structured_quadj)
          to label %58 unwind label %74

58:                                               ; preds = %56
  %59 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @.str.12)
          to label %60 unwind label %74

60:                                               ; preds = %58
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef @.str.35)
          to label %62 unwind label %74

62:                                               ; preds = %60
  store i1 true, ptr %15, align 1
  %63 = call ptr @__cxa_allocate_exception(i64 16) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #6
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %14, ptr noundef nonnull align 8 dereferenceable(128) %13)
          to label %64 unwind label %78

64:                                               ; preds = %62
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(32) %14)
          to label %65 unwind label %82

65:                                               ; preds = %64
  store i1 false, ptr %15, align 1
  invoke void @__cxa_throw(ptr %63, ptr @_ZTISt13runtime_error, ptr @_ZNSt13runtime_errorD1Ev) #7
          to label %261 unwind label %82

66:                                               ; preds = %30
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %10, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %11, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %256

70:                                               ; preds = %46
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %10, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %11, align 4
  br label %91

74:                                               ; preds = %60, %58, %56, %54, %52, %50, %47
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %10, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %11, align 4
  br label %90

78:                                               ; preds = %62
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %10, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %11, align 4
  br label %86

82:                                               ; preds = %65, %64
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %10, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #6
  br label %86

86:                                               ; preds = %82, %78
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #6
  %87 = load i1, ptr %15, align 1
  br i1 %87, label %88, label %89

88:                                               ; preds = %86
  call void @__cxa_free_exception(ptr %63) #6
  br label %89

89:                                               ; preds = %88, %86
  br label %90

90:                                               ; preds = %89, %74
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %13) #6
  br label %91

91:                                               ; preds = %90, %70
  call void @llvm.lifetime.end.p0(i64 392, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %254

92:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = sdiv i32 %93, 2
  store i32 %94, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %221, %92
  %96 = load i32, ptr %18, align 4, !tbaa !5
  %97 = load i32, ptr %16, align 4, !tbaa !5
  %98 = icmp slt i32 %96, %97
  br i1 %98, label %100, label %99

99:                                               ; preds = %95
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %224

100:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = load i32, ptr %18, align 4, !tbaa !5
  %104 = sub nsw i32 %102, %103
  store i32 %104, ptr %20, align 4, !tbaa !5
  %105 = load i32, ptr %18, align 4, !tbaa !5
  %106 = load i32, ptr %12, align 4, !tbaa !5
  %107 = load i32, ptr %18, align 4, !tbaa !5
  %108 = mul nsw i32 %106, %107
  %109 = add nsw i32 %105, %108
  %110 = load i32, ptr %17, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %111) #6
  store i32 %109, ptr %112, align 4, !tbaa !5
  %113 = load i32, ptr %20, align 4, !tbaa !5
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = load i32, ptr %18, align 4, !tbaa !5
  %116 = mul nsw i32 %114, %115
  %117 = add nsw i32 %113, %116
  %118 = load i32, ptr %17, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %120) #6
  store i32 %117, ptr %121, align 4, !tbaa !5
  %122 = load i32, ptr %20, align 4, !tbaa !5
  %123 = load i32, ptr %12, align 4, !tbaa !5
  %124 = load i32, ptr %20, align 4, !tbaa !5
  %125 = mul nsw i32 %123, %124
  %126 = add nsw i32 %122, %125
  %127 = load i32, ptr %17, align 4, !tbaa !5
  %128 = add nsw i32 %127, 2
  %129 = sext i32 %128 to i64
  %130 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %129) #6
  store i32 %126, ptr %130, align 4, !tbaa !5
  %131 = load i32, ptr %18, align 4, !tbaa !5
  %132 = load i32, ptr %12, align 4, !tbaa !5
  %133 = load i32, ptr %20, align 4, !tbaa !5
  %134 = mul nsw i32 %132, %133
  %135 = add nsw i32 %131, %134
  %136 = load i32, ptr %17, align 4, !tbaa !5
  %137 = add nsw i32 %136, 3
  %138 = sext i32 %137 to i64
  %139 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %138) #6
  store i32 %135, ptr %139, align 4, !tbaa !5
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = add nsw i32 %140, 4
  store i32 %141, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %142 = load i32, ptr %12, align 4, !tbaa !5
  %143 = load i32, ptr %18, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  %145 = mul nsw i32 2, %144
  %146 = sub nsw i32 %142, %145
  store i32 %146, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %213, %100
  %148 = load i32, ptr %22, align 4, !tbaa !5
  %149 = load i32, ptr %21, align 4, !tbaa !5
  %150 = icmp slt i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %216

152:                                              ; preds = %147
  %153 = load i32, ptr %18, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  %155 = load i32, ptr %22, align 4, !tbaa !5
  %156 = add nsw i32 %154, %155
  %157 = load i32, ptr %12, align 4, !tbaa !5
  %158 = load i32, ptr %18, align 4, !tbaa !5
  %159 = mul nsw i32 %157, %158
  %160 = add nsw i32 %156, %159
  %161 = load i32, ptr %17, align 4, !tbaa !5
  %162 = load i32, ptr %22, align 4, !tbaa !5
  %163 = add nsw i32 %161, %162
  %164 = sext i32 %163 to i64
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %164) #6
  store i32 %160, ptr %165, align 4, !tbaa !5
  %166 = load i32, ptr %20, align 4, !tbaa !5
  %167 = load i32, ptr %12, align 4, !tbaa !5
  %168 = load i32, ptr %18, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  %170 = load i32, ptr %22, align 4, !tbaa !5
  %171 = add nsw i32 %169, %170
  %172 = mul nsw i32 %167, %171
  %173 = add nsw i32 %166, %172
  %174 = load i32, ptr %17, align 4, !tbaa !5
  %175 = load i32, ptr %21, align 4, !tbaa !5
  %176 = add nsw i32 %174, %175
  %177 = load i32, ptr %22, align 4, !tbaa !5
  %178 = add nsw i32 %176, %177
  %179 = sext i32 %178 to i64
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %179) #6
  store i32 %173, ptr %180, align 4, !tbaa !5
  %181 = load i32, ptr %20, align 4, !tbaa !5
  %182 = sub nsw i32 %181, 1
  %183 = load i32, ptr %22, align 4, !tbaa !5
  %184 = sub nsw i32 %182, %183
  %185 = load i32, ptr %12, align 4, !tbaa !5
  %186 = load i32, ptr %20, align 4, !tbaa !5
  %187 = mul nsw i32 %185, %186
  %188 = add nsw i32 %184, %187
  %189 = load i32, ptr %17, align 4, !tbaa !5
  %190 = load i32, ptr %21, align 4, !tbaa !5
  %191 = mul nsw i32 2, %190
  %192 = add nsw i32 %189, %191
  %193 = load i32, ptr %22, align 4, !tbaa !5
  %194 = add nsw i32 %192, %193
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %195) #6
  store i32 %188, ptr %196, align 4, !tbaa !5
  %197 = load i32, ptr %18, align 4, !tbaa !5
  %198 = load i32, ptr %12, align 4, !tbaa !5
  %199 = load i32, ptr %20, align 4, !tbaa !5
  %200 = sub nsw i32 %199, 1
  %201 = load i32, ptr %22, align 4, !tbaa !5
  %202 = sub nsw i32 %200, %201
  %203 = mul nsw i32 %198, %202
  %204 = add nsw i32 %197, %203
  %205 = load i32, ptr %17, align 4, !tbaa !5
  %206 = load i32, ptr %21, align 4, !tbaa !5
  %207 = mul nsw i32 3, %206
  %208 = add nsw i32 %205, %207
  %209 = load i32, ptr %22, align 4, !tbaa !5
  %210 = add nsw i32 %208, %209
  %211 = sext i32 %210 to i64
  %212 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %211) #6
  store i32 %204, ptr %212, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %152
  %214 = load i32, ptr %22, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  store i32 %215, ptr %22, align 4, !tbaa !5
  br label %147, !llvm.loop !9

216:                                              ; preds = %151
  %217 = load i32, ptr %21, align 4, !tbaa !5
  %218 = mul nsw i32 4, %217
  %219 = load i32, ptr %17, align 4, !tbaa !5
  %220 = add nsw i32 %219, %218
  store i32 %220, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %221

221:                                              ; preds = %216
  %222 = load i32, ptr %18, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  store i32 %223, ptr %18, align 4, !tbaa !5
  br label %95, !llvm.loop !11

224:                                              ; preds = %99
  %225 = load i32, ptr %12, align 4, !tbaa !5
  %226 = srem i32 %225, 2
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %228, label %240

228:                                              ; preds = %224
  %229 = load i32, ptr %12, align 4, !tbaa !5
  %230 = sdiv i32 %229, 2
  %231 = load i32, ptr %12, align 4, !tbaa !5
  %232 = load i32, ptr %12, align 4, !tbaa !5
  %233 = sdiv i32 %232, 2
  %234 = mul nsw i32 %231, %233
  %235 = add nsw i32 %230, %234
  %236 = load i32, ptr %4, align 4, !tbaa !5
  %237 = sub i32 %236, 1
  %238 = zext i32 %237 to i64
  %239 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %238) #6
  store i32 %235, ptr %239, align 4, !tbaa !5
  br label %240

240:                                              ; preds = %228, %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %241

241:                                              ; preds = %240, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %242 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %242, ptr %23, align 4, !tbaa !5
  %243 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13ijk_maps_quad, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %244 unwind label %248

244:                                              ; preds = %241
  %245 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %243, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %246 unwind label %248

246:                                              ; preds = %244
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  store i1 true, ptr %7, align 1
  store i32 1, ptr %19, align 4
  %247 = load i1, ptr %7, align 1
  br i1 %247, label %253, label %252

248:                                              ; preds = %244, %241
  %249 = landingpad { ptr, i32 }
          cleanup
  %250 = extractvalue { ptr, i32 } %249, 0
  store ptr %250, ptr %10, align 8
  %251 = extractvalue { ptr, i32 } %249, 1
  store i32 %251, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %254

252:                                              ; preds = %246
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %253

253:                                              ; preds = %252, %246
  br label %255

254:                                              ; preds = %248, %91
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %256

255:                                              ; preds = %253, %27
  ret void

256:                                              ; preds = %254, %66
  %257 = load ptr, ptr %10, align 8
  %258 = load i32, ptr %11, align 4
  %259 = insertvalue { ptr, i32 } poison, ptr %257, 0
  %260 = insertvalue { ptr, i32 } %259, i32 %258, 1
  resume { ptr, i32 } %260

261:                                              ; preds = %65
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { "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 = { 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 = { nounwind }
attributes #7 = { noreturn }

!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}


; 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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::vector<int>>, std::_Select1st<std::pair<const int, std::vector<int>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::vector<int>>, std::_Select1st<std::pair<const int, std::vector<int>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.18" = type { i8 }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"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 }

@_ZL13ijk_maps_quad = external hidden global %"class.std::map", align 8
@.str = external hidden unnamed_addr constant [63 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZTISt13runtime_error = external constant ptr
@__func__._Z23gmsh_to_structured_quadj = external hidden unnamed_addr constant [24 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [32 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 uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #1 align 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

declare i32 @__gxx_personality_v0(...)

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #1 align 2

declare void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23gmsh_to_structured_quadj(ptr dead_on_unwind noalias writable sret(%"class.std::vector.16") align 8 %0, i32 noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::allocator.18", align 1
  %7 = alloca %"class.std::__cxx11::basic_stringstream", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 %1, ptr %3, align 4, !tbaa !5
  %10 = call noundef i64 @_ZNKSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEE5countERS6_(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13ijk_maps_quad, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %.not = icmp eq i64 %10, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br i1 %.not, label %13, label %11

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 %1, ptr %4, align 4, !tbaa !5
  %12 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13ijk_maps_quad, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %12)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  br label %130

13:                                               ; preds = %2
  %14 = zext i32 %1 to i64
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %14, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %15 unwind label %41

15:                                               ; preds = %13
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %.not88 = icmp eq i32 %1, 8
  br i1 %.not88, label %122, label %16

16:                                               ; preds = %15
  %17 = uitofp i32 %1 to double
  %sqrt = call double @llvm.sqrt.f64(double %17)
  %18 = fptosi double %sqrt to i32
  %19 = mul nsw i32 %18, %18
  %.not89 = icmp eq i32 %19, %1
  br i1 %.not89, label %53, label %20

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 392, ptr nonnull %7) #7
  invoke void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %21 unwind label %43

21:                                               ; preds = %20
  %22 = getelementptr inbounds i8, ptr %7, i64 16
  %23 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @.str)
          to label %24 unwind label %45

24:                                               ; preds = %21
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull @.str.11)
          to label %26 unwind label %45

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %25, i32 noundef 1020)
          to label %28 unwind label %45

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull @.str.11)
          to label %30 unwind label %45

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull @__func__._Z23gmsh_to_structured_quadj)
          to label %32 unwind label %45

32:                                               ; preds = %30
  %33 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @.str.12)
          to label %34 unwind label %45

34:                                               ; preds = %32
  %35 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @.str.35)
          to label %36 unwind label %45

36:                                               ; preds = %34
  %37 = call ptr @__cxa_allocate_exception(i64 16) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #7
  invoke void @_ZNKSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEE3strEv(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %8, ptr noundef nonnull align 8 dereferenceable(128) %7)
          to label %38 unwind label %.thread

38:                                               ; preds = %36
  invoke void @_ZNSt13runtime_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %40 unwind label %.thread99

.thread99:                                        ; preds = %38
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  br label %50

40:                                               ; preds = %38
  invoke void @__cxa_throw(ptr nonnull %37, ptr nonnull @_ZTISt13runtime_error, ptr nonnull @_ZNSt13runtime_errorD1Ev) #8
          to label %132 unwind label %48

41:                                               ; preds = %13
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %131

43:                                               ; preds = %20
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %52

45:                                               ; preds = %34, %32, %30, %28, %26, %24, %21
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %51

.thread:                                          ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  br label %50

48:                                               ; preds = %40
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #7
  br label %51

50:                                               ; preds = %.thread99, %.thread
  %.pn98 = phi { ptr, i32 } [ %47, %.thread ], [ %39, %.thread99 ]
  call void @__cxa_free_exception(ptr %37) #7
  br label %51

51:                                               ; preds = %48, %50, %45
  %.pn.pn = phi { ptr, i32 } [ %.pn98, %50 ], [ %49, %48 ], [ %46, %45 ]
  call void @_ZNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(128) %7) #7
  br label %52

52:                                               ; preds = %51, %43
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %51 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 392, ptr nonnull %7) #7
  br label %129

53:                                               ; preds = %16
  %54 = sdiv i32 %18, 2
  %55 = icmp sgt i32 %18, 1
  br i1 %55, label %.lr.ph105.preheader, label %._crit_edge106

.lr.ph105.preheader:                              ; preds = %53
  %56 = zext nneg i32 %18 to i64
  %wide.trip.count113 = zext nneg i32 %54 to i64
  br label %.lr.ph105

._crit_edge106:                                   ; preds = %._crit_edge, %53
  %57 = and i32 %18, 1
  %.not90 = icmp eq i32 %57, 0
  br i1 %.not90, label %122, label %116

.lr.ph105:                                        ; preds = %.lr.ph105.preheader, %._crit_edge
  %indvars.iv110 = phi i64 [ 0, %.lr.ph105.preheader ], [ %indvars.iv.next111, %._crit_edge ]
  %indvars.iv108.in = phi i32 [ %18, %.lr.ph105.preheader ], [ %indvars.iv108, %._crit_edge ]
  %.076102 = phi i32 [ 0, %.lr.ph105.preheader ], [ %94, %._crit_edge ]
  %indvars.iv108 = add i32 %indvars.iv108.in, -2
  %indvars112 = trunc i64 %indvars.iv110 to i32
  %58 = xor i64 %indvars.iv110, -1
  %59 = xor i32 %indvars112, -1
  %60 = add nsw i64 %58, %56
  %61 = add nsw i32 %59, %18
  %62 = mul nuw nsw i64 %indvars.iv110, %56
  %63 = mul nuw nsw i32 %indvars112, %18
  %64 = add nuw nsw i32 %63, %indvars112
  %65 = sext i32 %.076102 to i64
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %65) #7
  store i32 %64, ptr %66, align 4, !tbaa !5
  %67 = trunc nsw i64 %60 to i32
  %68 = add nsw i32 %63, %67
  %69 = add nuw nsw i32 %.076102, 1
  %70 = sext i32 %69 to i64
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %70) #7
  store i32 %68, ptr %71, align 4, !tbaa !5
  %72 = mul nsw i32 %61, %18
  %73 = add nsw i32 %72, %67
  %74 = add nuw nsw i32 %.076102, 2
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %75) #7
  store i32 %73, ptr %76, align 4, !tbaa !5
  %77 = add nsw i32 %72, %indvars112
  %78 = add nuw nsw i32 %.076102, 3
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %79) #7
  store i32 %77, ptr %80, align 4, !tbaa !5
  %81 = add nsw i32 %.076102, 4
  %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
  %82 = shl nuw nsw i64 %indvars.iv.next111, 1
  %83 = sub nsw i64 %56, %82
  %84 = icmp sgt i64 %83, 0
  br i1 %84, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph105
  %85 = sext i32 %81 to i64
  %86 = add nsw i64 %83, %85
  %87 = shl nuw nsw i64 %83, 1
  %88 = add nsw i64 %87, %85
  %89 = mul nuw nsw i64 %83, 3
  %90 = add nsw i64 %89, %85
  %wide.trip.count = zext i32 %indvars.iv108 to i64
  %91 = trunc i64 %60 to i32
  %92 = mul i32 %91, %18
  br label %95

._crit_edge:                                      ; preds = %95, %.lr.ph105
  %.tr = trunc i64 %83 to i32
  %93 = shl i32 %.tr, 2
  %94 = add nsw i32 %93, %81
  %exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count113
  br i1 %exitcond114.not, label %._crit_edge106, label %.lr.ph105, !llvm.loop !9

95:                                               ; preds = %.lr.ph, %95
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %95 ]
  %96 = add nuw nsw i64 %indvars.iv, %indvars.iv.next111
  %97 = add nuw nsw i64 %96, %62
  %98 = add nsw i64 %indvars.iv, %85
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %98) #7
  %100 = trunc nsw i64 %97 to i32
  store i32 %100, ptr %99, align 4, !tbaa !5
  %101 = mul nuw nsw i64 %96, %56
  %102 = add nsw i64 %101, %60
  %103 = add nsw i64 %86, %indvars.iv
  %104 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %103) #7
  %105 = trunc nsw i64 %102 to i32
  store i32 %105, ptr %104, align 4, !tbaa !5
  %106 = trunc i64 %indvars.iv to i32
  %107 = xor i32 %106, -1
  %108 = add i32 %67, %107
  %109 = add nsw i32 %108, %92
  %110 = add nsw i64 %88, %indvars.iv
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %110) #7
  store i32 %109, ptr %111, align 4, !tbaa !5
  %112 = mul nsw i32 %108, %18
  %113 = add nsw i32 %112, %indvars112
  %114 = add nsw i64 %90, %indvars.iv
  %115 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %114) #7
  store i32 %113, ptr %115, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %95, !llvm.loop !11

116:                                              ; preds = %._crit_edge106
  %117 = add i32 %18, 1
  %118 = mul i32 %54, %117
  %119 = add i32 %1, -1
  %120 = zext i32 %119 to i64
  %121 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %120) #7
  store i32 %118, ptr %121, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %._crit_edge106, %116, %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 %1, ptr %9, align 4, !tbaa !5
  %123 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt3mapIiSt6vectorIiSaIiEESt4lessIiESaISt4pairIKiS2_EEEixEOi(ptr noundef nonnull align 8 dereferenceable(48) @_ZL13ijk_maps_quad, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %124 unwind label %127

124:                                              ; preds = %122
  %125 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIiSaIiEEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %123, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %126 unwind label %127

126:                                              ; preds = %124
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %130

127:                                              ; preds = %124, %122
  %128 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  br label %129

129:                                              ; preds = %127, %52
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %52 ], [ %128, %127 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %131

130:                                              ; preds = %126, %11
  ret void

131:                                              ; preds = %129, %41
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %129 ], [ %42, %41 ]
  resume { ptr, i32 } %.pn.pn.pn.pn.pn

132:                                              ; preds = %40
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #5 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #6

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

!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}


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