; LLVM IR from moarseniy/CudaFEMproject :: FEMproject/thirdparty/segyio/src/SegyIn.ll (ZN7CSegyIn13readSEGYTraceEv)

; 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::bad_alloc" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%class.CSegyIO = type <{ ptr, i32, i32, i32, float, i32, [71 x i32], [27 x i32], [4 x i8], ptr, ptr, i64, %"class.std::basic_ifstream", %"class.std::basic_ofstream", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i8, i8, [6 x i8] }>
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"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::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }

@_ZZN7CSegyIn13readSEGYTraceEvE5count = external hidden global i32, align 4
@_ZTISt9bad_alloc = external constant ptr
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [52 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546), ptr noundef nonnull align 8 dereferenceable(32)) #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7CSegyIn13readSEGYTraceEv(ptr noundef nonnull align 8 dereferenceable(1546) %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::bad_alloc", align 8
  %7 = alloca %"class.std::__cxx11::basic_string", align 8
  %8 = alloca %"class.std::allocator", align 1
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::bad_alloc", align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.std::bad_alloc", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca [4 x i8], align 1
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8
  %25 = load i32, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !9
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %66

27:                                               ; preds = %1
  %28 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 3
  %29 = load i32, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %31 = load i32, ptr %30, align 4, !tbaa !28
  %32 = mul nsw i32 %29, %31
  %33 = sext i32 %32 to i64
  %34 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %33, i64 4)
  %35 = extractvalue { i64, i1 } %34, 1
  %36 = extractvalue { i64, i1 } %34, 0
  %37 = select i1 %35, i64 -1, i64 %36
  %38 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %37) #12
          to label %39 unwind label %41

39:                                               ; preds = %27
  %40 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 9
  store ptr %38, ptr %40, align 8, !tbaa !29
  br label %65

41:                                               ; preds = %27
  %42 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9bad_alloc
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %4, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %5, align 4
  br label %45

45:                                               ; preds = %41
  %46 = load i32, ptr %5, align 4
  %47 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9bad_alloc) #13
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %49, label %200

49:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #13
  %50 = load ptr, ptr %4, align 8
  %51 = call ptr @__cxa_get_exception_ptr(ptr %50) #13
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %51) #13
  %52 = call ptr @__cxa_begin_catch(ptr %50) #13
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #13
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #13
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #13
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %7, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %53 unwind label %55

53:                                               ; preds = %49
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %24, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %54 unwind label %59

54:                                               ; preds = %53
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #13
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #13
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #13
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #13
  store i1 false, ptr %2, align 1
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #13
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #13
  br label %198

55:                                               ; preds = %49
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %4, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %5, align 4
  br label %63

59:                                               ; preds = %53
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %4, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #13
  br label %63

63:                                               ; preds = %59, %55
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #13
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #13
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #13
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #13
  invoke void @__cxa_end_catch()
          to label %64 unwind label %205

64:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #13
  br label %200

65:                                               ; preds = %39
  br label %66

66:                                               ; preds = %65, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #13
  store ptr null, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %68 = load i32, ptr %67, align 4, !tbaa !28
  %69 = sext i32 %68 to i64
  %70 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %69, i64 4)
  %71 = extractvalue { i64, i1 } %70, 1
  %72 = extractvalue { i64, i1 } %70, 0
  %73 = select i1 %71, i64 -1, i64 %72
  %74 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %73) #12
          to label %75 unwind label %76

75:                                               ; preds = %66
  store ptr %74, ptr %9, align 8, !tbaa !5
  br label %100

76:                                               ; preds = %66
  %77 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9bad_alloc
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %4, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %5, align 4
  br label %80

80:                                               ; preds = %76
  %81 = load i32, ptr %5, align 4
  %82 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9bad_alloc) #13
  %83 = icmp eq i32 %81, %82
  br i1 %83, label %84, label %197

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #13
  %85 = load ptr, ptr %4, align 8
  %86 = call ptr @__cxa_get_exception_ptr(ptr %85) #13
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %86) #13
  %87 = call ptr @__cxa_begin_catch(ptr %85) #13
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #13
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #13
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #13
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef @.str.2, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %88 unwind label %90

88:                                               ; preds = %84
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %24, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %89 unwind label %94

89:                                               ; preds = %88
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #13
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #13
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #13
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #13
  store i1 false, ptr %2, align 1
  store i32 1, ptr %13, align 4
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #13
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #13
  br label %196

90:                                               ; preds = %84
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %4, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %5, align 4
  br label %98

94:                                               ; preds = %88
  %95 = landingpad { ptr, i32 }
          cleanup
  %96 = extractvalue { ptr, i32 } %95, 0
  store ptr %96, ptr %4, align 8
  %97 = extractvalue { ptr, i32 } %95, 1
  store i32 %97, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #13
  br label %98

98:                                               ; preds = %94, %90
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #13
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #13
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #13
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %10) #13
  invoke void @__cxa_end_catch()
          to label %99 unwind label %205

99:                                               ; preds = %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #13
  br label %197

100:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #13
  store ptr null, ptr %14, align 8, !tbaa !5
  %101 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %102 = load i32, ptr %101, align 4, !tbaa !28
  %103 = mul nsw i32 %102, 4
  %104 = sext i32 %103 to i64
  %105 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %104) #12
          to label %106 unwind label %107

106:                                              ; preds = %100
  store ptr %105, ptr %14, align 8, !tbaa !5
  br label %131

107:                                              ; preds = %100
  %108 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9bad_alloc
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %4, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %5, align 4
  br label %111

111:                                              ; preds = %107
  %112 = load i32, ptr %5, align 4
  %113 = call i32 @llvm.eh.typeid.for.p0(ptr @_ZTISt9bad_alloc) #13
  %114 = icmp eq i32 %112, %113
  br i1 %114, label %115, label %195

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #13
  %116 = load ptr, ptr %4, align 8
  %117 = call ptr @__cxa_get_exception_ptr(ptr %116) #13
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %117) #13
  %118 = call ptr @__cxa_begin_catch(ptr %116) #13
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #13
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #13
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #13
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %119 unwind label %121

119:                                              ; preds = %115
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %24, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %120 unwind label %125

120:                                              ; preds = %119
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #13
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #13
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #13
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #13
  store i1 false, ptr %2, align 1
  store i32 1, ptr %13, align 4
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #13
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #13
  br label %194

121:                                              ; preds = %115
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %4, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %5, align 4
  br label %129

125:                                              ; preds = %119
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %4, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %5, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #13
  br label %129

129:                                              ; preds = %125, %121
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #13
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #13
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #13
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #13
  invoke void @__cxa_end_catch()
          to label %130 unwind label %205

130:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #13
  br label %195

131:                                              ; preds = %106
  %132 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 12
  %133 = load ptr, ptr %14, align 8, !tbaa !5
  %134 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %135 = load i32, ptr %134, align 4, !tbaa !28
  %136 = mul nsw i32 %135, 4
  %137 = sext i32 %136 to i64
  %138 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %132, ptr noundef %133, i64 noundef %137)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #13
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #13
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #13
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %167, %131
  %140 = load i32, ptr %18, align 4, !tbaa !9
  %141 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !28
  %143 = icmp slt i32 %140, %142
  br i1 %143, label %144, label %170

144:                                              ; preds = %139
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #13
  %146 = getelementptr inbounds [4 x i8], ptr %20, i64 0, i64 0
  store ptr %146, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #13
  %147 = load i32, ptr %18, align 4, !tbaa !9
  %148 = mul nsw i32 %147, 4
  store i32 %148, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #13
  store i32 4, ptr %23, align 4, !tbaa !9
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %24, ptr noundef %145, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(4) %22, ptr noundef nonnull align 4 dereferenceable(4) %23)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #13
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #13
  %149 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 5
  %150 = load i32, ptr %149, align 8, !tbaa !30
  %151 = icmp eq i32 %150, 2
  br i1 %151, label %152, label %160

152:                                              ; preds = %144
  %153 = getelementptr inbounds [4 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 1 %153, i64 4, i1 false)
  %154 = load i32, ptr %19, align 4, !tbaa !9
  %155 = sitofp i32 %154 to float
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = load i32, ptr %18, align 4, !tbaa !9
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds float, ptr %156, i64 %158
  store float %155, ptr %159, align 4, !tbaa !31
  br label %166

160:                                              ; preds = %144
  %161 = load ptr, ptr %9, align 8, !tbaa !5
  %162 = load i32, ptr %18, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds float, ptr %161, i64 %163
  %165 = getelementptr inbounds [4 x i8], ptr %20, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %164, ptr align 1 %165, i64 4, i1 false)
  br label %166

166:                                              ; preds = %160, %152
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %18, align 4, !tbaa !9
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %18, align 4, !tbaa !9
  br label %139, !llvm.loop !32

170:                                              ; preds = %139
  %171 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 9
  %172 = load ptr, ptr %171, align 8, !tbaa !29
  %173 = load i32, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !9
  %174 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %175 = load i32, ptr %174, align 4, !tbaa !28
  %176 = mul nsw i32 %173, %175
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds float, ptr %172, i64 %177
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %class.CSegyIO, ptr %24, i32 0, i32 2
  %181 = load i32, ptr %180, align 4, !tbaa !28
  %182 = sext i32 %181 to i64
  %183 = mul i64 4, %182
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %178, ptr align 4 %179, i64 %183, i1 false)
  %184 = load i32, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !9
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !9
  %186 = load ptr, ptr %9, align 8, !tbaa !5
  %187 = icmp eq ptr %186, null
  br i1 %187, label %189, label %188

188:                                              ; preds = %170
  call void @_ZdaPv(ptr noundef %186) #14
  br label %189

189:                                              ; preds = %188, %170
  %190 = load ptr, ptr %14, align 8, !tbaa !5
  %191 = icmp eq ptr %190, null
  br i1 %191, label %193, label %192

192:                                              ; preds = %189
  call void @_ZdaPv(ptr noundef %190) #14
  br label %193

193:                                              ; preds = %192, %189
  store i1 true, ptr %2, align 1
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #13
  br label %194

194:                                              ; preds = %193, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #13
  br label %196

195:                                              ; preds = %130, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #13
  br label %197

196:                                              ; preds = %194, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #13
  br label %198

197:                                              ; preds = %195, %99, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #13
  br label %200

198:                                              ; preds = %196, %54
  %199 = load i1, ptr %2, align 1
  ret i1 %199

200:                                              ; preds = %197, %64, %45
  %201 = load ptr, ptr %4, align 8
  %202 = load i32, ptr %5, align 4
  %203 = insertvalue { ptr, i32 } poison, ptr %201, 0
  %204 = insertvalue { ptr, i32 } %203, i32 %202, 1
  resume { ptr, i32 } %204

205:                                              ; preds = %129, %98, %63
  %206 = landingpad { ptr, i32 }
          catch ptr null
  %207 = extractvalue { ptr, i32 } %206, 0
  call void @__clang_call_terminate(ptr %207) #15
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

; Function Attrs: nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #6

declare ptr @__cxa_get_exception_ptr(ptr)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

declare ptr @__cxa_begin_catch(ptr)

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #7

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #8

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) #9

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #11

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

attributes #0 = { 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 #1 = { 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 memory(none) }
attributes #7 = { 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 #8 = { noinline noreturn nounwind uwtable "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 = { "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 #10 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #11 = { nobuiltin 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 #12 = { builtin allocsize(0) }
attributes #13 = { nounwind }
attributes #14 = { builtin nounwind }
attributes #15 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS7CSegyIO", !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20, !10, i64 24, !7, i64 28, !7, i64 312, !6, i64 424, !6, i64 432, !14, i64 440, !15, i64 448, !24, i64 968, !26, i64 1480, !26, i64 1512, !21, i64 1544, !21, i64 1545}
!13 = !{!"float", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTSSt14basic_ifstreamIcSt11char_traitsIcEE", !16, i64 0, !17, i64 16}
!16 = !{!"_ZTSSi", !14, i64 8}
!17 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !18, i64 0, !7, i64 64, !20, i64 104, !22, i64 120, !23, i64 124, !23, i64 132, !23, i64 140, !6, i64 152, !14, i64 160, !21, i64 168, !21, i64 169, !21, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !21, i64 192, !6, i64 200, !6, i64 208, !14, i64 216, !6, i64 224, !6, i64 232}
!18 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !19, i64 56}
!19 = !{!"_ZTSSt6locale", !6, i64 0}
!20 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !21, i64 8}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!23 = !{!"_ZTS11__mbstate_t", !10, i64 0, !7, i64 4}
!24 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !25, i64 0, !17, i64 8}
!25 = !{!"_ZTSSo"}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !27, i64 0, !14, i64 8, !7, i64 16}
!27 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!28 = !{!12, !10, i64 12}
!29 = !{!12, !6, i64 424}
!30 = !{!12, !10, i64 24}
!31 = !{!13, !13, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; 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::bad_alloc" = type { %"class.std::exception" }
%"class.std::exception" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@_ZZN7CSegyIn13readSEGYTraceEvE5count = external hidden local_unnamed_addr global i32, align 4
@_ZTISt9bad_alloc = external constant ptr
@.str.1 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [52 x i8], align 1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7CSegyIn13readSEGYTraceEv(ptr noundef nonnull align 8 dereferenceable(1546) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::bad_alloc", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca %"class.std::bad_alloc", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator", align 1
  %8 = alloca %"class.std::bad_alloc", align 8
  %9 = alloca %"class.std::__cxx11::basic_string", align 8
  %10 = alloca %"class.std::allocator", align 1
  %11 = alloca [4 x i8], align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = load i32, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !5
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %._crit_edge44

._crit_edge44:                                    ; preds = %1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 12
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !9
  br label %47

17:                                               ; preds = %1
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load i32, ptr %18, align 8, !tbaa !27
  %20 = getelementptr inbounds i8, ptr %0, i64 12
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = mul nsw i32 %21, %19
  %23 = sext i32 %22 to i64
  %24 = icmp slt i32 %22, 0
  %25 = shl nsw i64 %23, 2
  %26 = select i1 %24, i64 -1, i64 %25
  %27 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %26) #11
          to label %28 unwind label %30

28:                                               ; preds = %17
  %29 = getelementptr inbounds i8, ptr %0, i64 424
  store ptr %27, ptr %29, align 8, !tbaa !28
  br label %47

30:                                               ; preds = %17
  %31 = landingpad { ptr, i32 }
          catch ptr @_ZTISt9bad_alloc
  %32 = extractvalue { ptr, i32 } %31, 1
  %33 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9bad_alloc) #12
  %34 = icmp eq i32 %32, %33
  br i1 %34, label %35, label %119

35:                                               ; preds = %30
  %36 = extractvalue { ptr, i32 } %31, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #12
  %37 = tail call ptr @__cxa_get_exception_ptr(ptr %36) #12
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %37) #12
  %38 = call ptr @__cxa_begin_catch(ptr %36) #12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #12
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #12
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #12
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %39 unwind label %41

39:                                               ; preds = %35
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %40 unwind label %43

40:                                               ; preds = %39
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #12
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #12
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #12
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #12
  br label %118

41:                                               ; preds = %35
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %45

43:                                               ; preds = %39
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #12
  br label %45

45:                                               ; preds = %43, %41
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %42, %41 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #12
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #12
  invoke void @__cxa_end_catch()
          to label %46 unwind label %120

46:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #12
  br label %119

47:                                               ; preds = %._crit_edge44, %28
  %48 = phi i32 [ %.pre, %._crit_edge44 ], [ %21, %28 ]
  %49 = getelementptr inbounds i8, ptr %0, i64 12
  %50 = sext i32 %48 to i64
  %51 = icmp slt i32 %48, 0
  %52 = shl nsw i64 %50, 2
  %53 = select i1 %51, i64 -1, i64 %52
  %54 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %53) #11
          to label %55 unwind label %59

55:                                               ; preds = %47
  %56 = shl nsw i32 %48, 2
  %57 = sext i32 %56 to i64
  %58 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %57) #11
          to label %76 unwind label %82

59:                                               ; preds = %47
  %60 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9bad_alloc
  %61 = extractvalue { ptr, i32 } %60, 1
  %62 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9bad_alloc) #12
  %63 = icmp eq i32 %61, %62
  br i1 %63, label %64, label %119

64:                                               ; preds = %59
  %65 = extractvalue { ptr, i32 } %60, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #12
  %66 = tail call ptr @__cxa_get_exception_ptr(ptr %65) #12
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %66) #12
  %67 = call ptr @__cxa_begin_catch(ptr %65) #12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #12
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #12
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #12
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.2, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %68 unwind label %70

68:                                               ; preds = %64
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %69 unwind label %72

69:                                               ; preds = %68
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #12
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #12
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #12
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #12
  br label %118

70:                                               ; preds = %64
  %71 = landingpad { ptr, i32 }
          cleanup
  br label %74

72:                                               ; preds = %68
  %73 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #12
  br label %74

74:                                               ; preds = %72, %70
  %.pn37 = phi { ptr, i32 } [ %73, %72 ], [ %71, %70 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #12
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #12
  invoke void @__cxa_end_catch()
          to label %75 unwind label %120

75:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #12
  br label %119

76:                                               ; preds = %55
  %77 = getelementptr inbounds i8, ptr %0, i64 448
  %78 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %77, ptr noundef nonnull %58, i64 noundef %57)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #12
  %79 = load i32, ptr %49, align 4, !tbaa !9
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %76
  %.pre45 = sext i32 %79 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %76
  %81 = getelementptr inbounds i8, ptr %0, i64 24
  br label %99

82:                                               ; preds = %55
  %83 = landingpad { ptr, i32 }
          cleanup
          catch ptr @_ZTISt9bad_alloc
  %84 = extractvalue { ptr, i32 } %83, 1
  %85 = tail call i32 @llvm.eh.typeid.for.p0(ptr nonnull @_ZTISt9bad_alloc) #12
  %86 = icmp eq i32 %84, %85
  br i1 %86, label %87, label %119

87:                                               ; preds = %82
  %88 = extractvalue { ptr, i32 } %83, 0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #12
  %89 = tail call ptr @__cxa_get_exception_ptr(ptr %88) #12
  call void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %89) #12
  %90 = call ptr @__cxa_begin_catch(ptr %88) #12
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #12
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #12
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #12
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %91 unwind label %93

91:                                               ; preds = %87
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %92 unwind label %95

92:                                               ; preds = %91
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #12
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #12
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #12
  call void @__cxa_end_catch()
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #12
  br label %118

93:                                               ; preds = %87
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %97

95:                                               ; preds = %91
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #12
  br label %97

97:                                               ; preds = %95, %93
  %.pn39 = phi { ptr, i32 } [ %96, %95 ], [ %94, %93 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #12
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #12
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #12
  call void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #12
  invoke void @__cxa_end_catch()
          to label %98 unwind label %120

98:                                               ; preds = %97
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #12
  br label %119

99:                                               ; preds = %.lr.ph, %99
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %99 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #12
  store ptr %11, ptr %12, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #12
  %indvars.iv.tr = trunc i64 %indvars.iv to i32
  %100 = shl i32 %indvars.iv.tr, 2
  store i32 %100, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #12
  store i32 4, ptr %14, align 4, !tbaa !5
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull %58, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #12
  %101 = load i32, ptr %81, align 8, !tbaa !30
  %102 = icmp eq i32 %101, 2
  %.0.copyload = load i32, ptr %11, align 4
  %103 = sitofp i32 %.0.copyload to float
  %104 = bitcast float %103 to i32
  %.sink = select i1 %102, i32 %104, i32 %.0.copyload
  %105 = getelementptr inbounds float, ptr %54, i64 %indvars.iv
  store i32 %.sink, ptr %105, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %106 = load i32, ptr %49, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = icmp slt i64 %indvars.iv.next, %107
  br i1 %108, label %99, label %._crit_edge, !llvm.loop !31

._crit_edge:                                      ; preds = %99, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre45, %.._crit_edge_crit_edge ], [ %107, %99 ]
  %.lcssa = phi i32 [ %79, %.._crit_edge_crit_edge ], [ %106, %99 ]
  %109 = getelementptr inbounds i8, ptr %0, i64 424
  %110 = load ptr, ptr %109, align 8, !tbaa !28
  %111 = load i32, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !5
  %112 = mul nsw i32 %111, %.lcssa
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds float, ptr %110, i64 %113
  %115 = shl nsw i64 %.pre-phi, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %114, ptr nonnull align 4 %54, i64 %115, i1 false)
  %116 = load i32, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr @_ZZN7CSegyIn13readSEGYTraceEvE5count, align 4, !tbaa !5
  call void @_ZdaPv(ptr noundef nonnull %54) #13
  call void @_ZdaPv(ptr noundef nonnull %58) #13
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #12
  br label %118

118:                                              ; preds = %69, %._crit_edge, %92, %40
  %.2 = phi i1 [ false, %40 ], [ false, %69 ], [ true, %._crit_edge ], [ false, %92 ]
  ret i1 %.2

119:                                              ; preds = %59, %75, %98, %82, %46, %30
  %.merged = phi { ptr, i32 } [ %.pn, %46 ], [ %31, %30 ], [ %.pn37, %75 ], [ %60, %59 ], [ %.pn39, %98 ], [ %83, %82 ]
  resume { ptr, i32 } %.merged

120:                                              ; preds = %97, %74, %45
  %121 = landingpad { ptr, i32 }
          catch ptr null
  %122 = extractvalue { ptr, i32 } %121, 0
  call void @__clang_call_terminate(ptr %122) #14
  unreachable
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree nosync nounwind memory(none)
declare i32 @llvm.eh.typeid.for.p0(ptr) #5

declare ptr @__cxa_get_exception_ptr(ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt9bad_allocC2ERKS_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt9bad_allocD1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #6

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #7

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) local_unnamed_addr #8

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #10

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nosync nounwind memory(none) }
attributes #6 = { 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 #7 = { noinline noreturn nounwind uwtable "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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nobuiltin 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 #11 = { builtin allocsize(0) }
attributes #12 = { nounwind }
attributes #13 = { builtin nounwind }
attributes #14 = { 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, !6, i64 12}
!10 = !{!"_ZTS7CSegyIO", !6, i64 8, !6, i64 12, !6, i64 16, !11, i64 20, !6, i64 24, !7, i64 28, !7, i64 312, !12, i64 424, !12, i64 432, !13, i64 440, !14, i64 448, !23, i64 968, !25, i64 1480, !25, i64 1512, !20, i64 1544, !20, i64 1545}
!11 = !{!"float", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSSt14basic_ifstreamIcSt11char_traitsIcEE", !15, i64 0, !16, i64 16}
!15 = !{!"_ZTSSi", !13, i64 8}
!16 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !17, i64 0, !7, i64 64, !19, i64 104, !21, i64 120, !22, i64 124, !22, i64 132, !22, i64 140, !12, i64 152, !13, i64 160, !20, i64 168, !20, i64 169, !20, i64 170, !7, i64 171, !12, i64 176, !12, i64 184, !20, i64 192, !12, i64 200, !12, i64 208, !13, i64 216, !12, i64 224, !12, i64 232}
!17 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !18, i64 56}
!18 = !{!"_ZTSSt6locale", !12, i64 0}
!19 = !{!"_ZTSSt12__basic_fileIcE", !12, i64 0, !20, i64 8}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!22 = !{!"_ZTS11__mbstate_t", !6, i64 0, !7, i64 4}
!23 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !24, i64 0, !16, i64 8}
!24 = !{!"_ZTSSo"}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !26, i64 0, !13, i64 8, !7, i64 16}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!27 = !{!10, !6, i64 16}
!28 = !{!10, !12, i64 424}
!29 = !{!12, !12, i64 0}
!30 = !{!10, !6, i64 24}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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