; LLVM IR from moarseniy/CudaFEMproject :: FEMproject/VTKfile/src (VTKfile)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_fstream" = type { %"class.std::basic_iostream.base", %"class.std::basic_filebuf", %"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::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" }
%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.0 }
%union.anon.0 = type { i32 }
%class.CSegyOut = type { %class.CSegyIO.base, i8, [5 x i8] }
%class.CSegyIO.base = 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 }>
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"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] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare void @_ZN8CSegyOutC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKiRKb(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #5

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

declare noundef zeroext i1 @_ZN8CSegyOut4openEv(ptr noundef nonnull align 8 dereferenceable(1547)) unnamed_addr #5

declare noundef zeroext i1 @_ZN8CSegyOut12setSegyTraceERKPKfRKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut15setSampleNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut14setTraceNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut13setSegyFormatERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut9setSegyIDERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut17setSampleIntervalERKf(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) #6 align 2

declare noundef zeroext i1 @_ZN8CSegyOut5writeEv(ptr noundef nonnull align 8 dereferenceable(1547)) #5

declare void @_ZN8CSegyOut5closeEv(ptr noundef nonnull align 8 dereferenceable(1547)) unnamed_addr #5

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(264)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #9 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(264)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(264)) unnamed_addr #9 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13convertToSEGYNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_St6vectorIiSaIiEEfi(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef %3, i32 noundef %4) #4 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca %"class.std::basic_fstream", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca %class.CSegyOut, align 8
  %22 = alloca i8, align 1
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store float %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  %26 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #10
  %27 = trunc i64 %26 to i32
  store i32 %27, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #10
  %28 = load i32, ptr %11, align 4, !tbaa !11
  %29 = load i32, ptr %10, align 4, !tbaa !11
  %30 = mul nsw i32 %28, %29
  %31 = sext i32 %30 to i64
  %32 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %31, i64 4)
  %33 = extractvalue { i64, i1 } %32, 1
  %34 = extractvalue { i64, i1 } %32, 0
  %35 = select i1 %33, i64 -1, i64 %34
  %36 = call noalias noundef nonnull ptr @_Znam(i64 noundef %35) #11
  store ptr %36, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 528, ptr %13) #10
  call void @_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(264) %13)
  invoke void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 8)
          to label %37 unwind label %51

37:                                               ; preds = %5
  %38 = load ptr, ptr %13, align 8, !tbaa !13
  %39 = getelementptr i8, ptr %38, i64 -24
  %40 = load i64, ptr %39, align 8
  %41 = getelementptr inbounds i8, ptr %13, i64 %40
  %42 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %41)
          to label %43 unwind label %51

43:                                               ; preds = %37
  br i1 %42, label %44, label %85

44:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  store i64 0, ptr %16, align 8, !tbaa !15
  br label %45

45:                                               ; preds = %81, %44
  %46 = load i64, ptr %16, align 8, !tbaa !15
  %47 = load i32, ptr %10, align 4, !tbaa !11
  %48 = sext i32 %47 to i64
  %49 = icmp ult i64 %46, %48
  br i1 %49, label %55, label %50

50:                                               ; preds = %45
  store i32 2, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  br label %84

51:                                               ; preds = %85, %37, %5
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %14, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %15, align 4
  br label %194

55:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  store i64 0, ptr %18, align 8, !tbaa !15
  br label %56

56:                                               ; preds = %73, %55
  %57 = load i64, ptr %18, align 8, !tbaa !15
  %58 = load i32, ptr %11, align 4, !tbaa !11
  %59 = sext i32 %58 to i64
  %60 = icmp ult i64 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  br label %80

62:                                               ; preds = %56
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = load i64, ptr %16, align 8, !tbaa !15
  %65 = load i64, ptr %18, align 8, !tbaa !15
  %66 = load i32, ptr %10, align 4, !tbaa !11
  %67 = sext i32 %66 to i64
  %68 = mul i64 %65, %67
  %69 = add i64 %64, %68
  %70 = getelementptr inbounds float, ptr %63, i64 %69
  %71 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERf(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %70)
          to label %72 unwind label %76

72:                                               ; preds = %62
  br label %73

73:                                               ; preds = %72
  %74 = load i64, ptr %18, align 8, !tbaa !15
  %75 = add i64 %74, 1
  store i64 %75, ptr %18, align 8, !tbaa !15
  br label %56, !llvm.loop !17

76:                                               ; preds = %62
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %14, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  br label %194

80:                                               ; preds = %61
  br label %81

81:                                               ; preds = %80
  %82 = load i64, ptr %16, align 8, !tbaa !15
  %83 = add i64 %82, 1
  store i64 %83, ptr %16, align 8, !tbaa !15
  br label %45, !llvm.loop !19

84:                                               ; preds = %50
  br label %88

85:                                               ; preds = %43
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.12)
          to label %87 unwind label %51

87:                                               ; preds = %85
  br label %88

88:                                               ; preds = %87, %84
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #10
  store i64 0, ptr %19, align 8, !tbaa !15
  br label %89

89:                                               ; preds = %126, %88
  %90 = load i64, ptr %19, align 8, !tbaa !15
  %91 = load i32, ptr %11, align 4, !tbaa !11
  %92 = sext i32 %91 to i64
  %93 = icmp ult i64 %90, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %89
  store i32 8, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  br label %134

95:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #10
  store i64 0, ptr %20, align 8, !tbaa !15
  br label %96

96:                                               ; preds = %116, %95
  %97 = load i64, ptr %20, align 8, !tbaa !15
  %98 = load i32, ptr %10, align 4, !tbaa !11
  %99 = sext i32 %98 to i64
  %100 = icmp ult i64 %97, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  store i32 11, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %123

102:                                              ; preds = %96
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = load i64, ptr %20, align 8, !tbaa !15
  %105 = load i64, ptr %19, align 8, !tbaa !15
  %106 = load i32, ptr %10, align 4, !tbaa !11
  %107 = sext i32 %106 to i64
  %108 = mul i64 %105, %107
  %109 = add i64 %104, %108
  %110 = getelementptr inbounds float, ptr %103, i64 %109
  %111 = load float, ptr %110, align 4, !tbaa !9
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, float noundef %111)
          to label %113 unwind label %119

113:                                              ; preds = %102
  %114 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef @.str.11)
          to label %115 unwind label %119

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %20, align 8, !tbaa !15
  %118 = add i64 %117, 1
  store i64 %118, ptr %20, align 8, !tbaa !15
  br label %96, !llvm.loop !20

119:                                              ; preds = %113, %102
  %120 = landingpad { ptr, i32 }
          cleanup
  %121 = extractvalue { ptr, i32 } %120, 0
  store ptr %121, ptr %14, align 8
  %122 = extractvalue { ptr, i32 } %120, 1
  store i32 %122, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %133

123:                                              ; preds = %101
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
          to label %125 unwind label %129

125:                                              ; preds = %123
  br label %126

126:                                              ; preds = %125
  %127 = load i64, ptr %19, align 8, !tbaa !15
  %128 = add i64 %127, 1
  store i64 %128, ptr %19, align 8, !tbaa !15
  br label %89, !llvm.loop !21

129:                                              ; preds = %123
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %14, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %15, align 4
  br label %133

133:                                              ; preds = %129, %119
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  br label %194

134:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 1552, ptr %21) #10
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #10
  store i8 0, ptr %22, align 1, !tbaa !22
  invoke void @_ZN8CSegyOutC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKiRKb(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 1 dereferenceable(1) %22)
          to label %135 unwind label %141

135:                                              ; preds = %134
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #10
  %136 = invoke noundef zeroext i1 @_ZN8CSegyOut4openEv(ptr noundef nonnull align 8 dereferenceable(1547) %21)
          to label %137 unwind label %145

137:                                              ; preds = %135
  br i1 %136, label %149, label %138

138:                                              ; preds = %137
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.9)
          to label %140 unwind label %145

140:                                              ; preds = %138
  br label %149

141:                                              ; preds = %134
  %142 = landingpad { ptr, i32 }
          cleanup
  %143 = extractvalue { ptr, i32 } %142, 0
  store ptr %143, ptr %14, align 8
  %144 = extractvalue { ptr, i32 } %142, 1
  store i32 %144, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #10
  br label %193

145:                                              ; preds = %186, %185, %182, %171, %168, %167, %166, %165, %156, %138, %135
  %146 = landingpad { ptr, i32 }
          cleanup
  %147 = extractvalue { ptr, i32 } %146, 0
  store ptr %147, ptr %14, align 8
  %148 = extractvalue { ptr, i32 } %146, 1
  store i32 %148, ptr %15, align 4
  br label %192

149:                                              ; preds = %140, %137
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #10
  %150 = load i32, ptr %11, align 4, !tbaa !11
  %151 = load i32, ptr %10, align 4, !tbaa !11
  %152 = mul nsw i32 %150, %151
  store i32 %152, ptr %23, align 4, !tbaa !11
  %153 = invoke noundef zeroext i1 @_ZN8CSegyOut12setSegyTraceERKPKfRKi(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %23)
          to label %154 unwind label %159

154:                                              ; preds = %149
  %155 = xor i1 %153, true
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br i1 %155, label %156, label %163

156:                                              ; preds = %154
  %157 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.13)
          to label %158 unwind label %145

158:                                              ; preds = %156
  br label %163

159:                                              ; preds = %149
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %14, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #10
  br label %192

163:                                              ; preds = %158, %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  store i32 5, ptr %24, align 4, !tbaa !11
  invoke void @_ZN8CSegyOut13setSegyFormatERKi(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %164 unwind label %174

164:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  store i32 0, ptr %25, align 4, !tbaa !11
  invoke void @_ZN8CSegyOut9setSegyIDERKi(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 4 dereferenceable(4) %25)
          to label %165 unwind label %178

165:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  invoke void @_ZN8CSegyOut14setTraceNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 4 dereferenceable(4) %11)
          to label %166 unwind label %145

166:                                              ; preds = %165
  invoke void @_ZN8CSegyOut17setSampleIntervalERKf(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %167 unwind label %145

167:                                              ; preds = %166
  invoke void @_ZN8CSegyOut15setSampleNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547) %21, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %168 unwind label %145

168:                                              ; preds = %167
  %169 = invoke noundef zeroext i1 @_ZN8CSegyOut5writeEv(ptr noundef nonnull align 8 dereferenceable(1547) %21)
          to label %170 unwind label %145

170:                                              ; preds = %168
  br i1 %169, label %182, label %171

171:                                              ; preds = %170
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.14)
          to label %173 unwind label %145

173:                                              ; preds = %171
  br label %185

174:                                              ; preds = %163
  %175 = landingpad { ptr, i32 }
          cleanup
  %176 = extractvalue { ptr, i32 } %175, 0
  store ptr %176, ptr %14, align 8
  %177 = extractvalue { ptr, i32 } %175, 1
  store i32 %177, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  br label %192

178:                                              ; preds = %164
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %14, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %192

182:                                              ; preds = %170
  %183 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.15)
          to label %184 unwind label %145

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184, %173
  invoke void @_ZN8CSegyOut5closeEv(ptr noundef nonnull align 8 dereferenceable(1547) %21)
          to label %186 unwind label %145

186:                                              ; preds = %185
  invoke void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(264) %13)
          to label %187 unwind label %145

187:                                              ; preds = %186
  %188 = load ptr, ptr %12, align 8, !tbaa !5
  %189 = icmp eq ptr %188, null
  br i1 %189, label %191, label %190

190:                                              ; preds = %187
  call void @_ZdaPv(ptr noundef %188) #12
  br label %191

191:                                              ; preds = %190, %187
  call void @_ZN8CSegyOutD1Ev(ptr noundef nonnull align 8 dereferenceable(1547) %21) #10
  call void @llvm.lifetime.end.p0(i64 1552, ptr %21) #10
  call void @_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(264) %13) #10
  call void @llvm.lifetime.end.p0(i64 528, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  ret void

192:                                              ; preds = %178, %174, %159, %145
  call void @_ZN8CSegyOutD1Ev(ptr noundef nonnull align 8 dereferenceable(1547) %21) #10
  br label %193

193:                                              ; preds = %192, %141
  call void @llvm.lifetime.end.p0(i64 1552, ptr %21) #10
  br label %194

194:                                              ; preds = %193, %133, %76, %51
  call void @_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(264) %13) #10
  call void @llvm.lifetime.end.p0(i64 528, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %14, align 8
  %197 = load i32, ptr %15, align 4
  %198 = insertvalue { ptr, i32 } poison, ptr %196, 0
  %199 = insertvalue { ptr, i32 } %198, i32 %197, 1
  resume { ptr, i32 } %199
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress 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 #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 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
attributes #12 = { builtin 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = !{!23, !23, i64 0}
!23 = !{!"bool", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_fstream" = type { %"class.std::basic_iostream.base", %"class.std::basic_filebuf", %"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::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" }
%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.0 }
%union.anon.0 = type { i32 }
%class.CSegyOut = type { %class.CSegyIO.base, i8, [5 x i8] }
%class.CSegyIO.base = 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 }>
%"class.std::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"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] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 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

declare i32 @__gxx_personality_v0(...)

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

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

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

declare void @_ZN8CSegyOutC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKiRKb(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4

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

declare noundef zeroext i1 @_ZN8CSegyOut4openEv(ptr noundef nonnull align 8 dereferenceable(1547)) unnamed_addr #4

declare noundef zeroext i1 @_ZN8CSegyOut12setSegyTraceERKPKfRKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut15setSampleNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut14setTraceNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut13setSegyFormatERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut9setSegyIDERKi(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CSegyOut17setSampleIntervalERKf(ptr noundef nonnull align 8 dereferenceable(1547), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

declare noundef zeroext i1 @_ZN8CSegyOut5writeEv(ptr noundef nonnull align 8 dereferenceable(1547)) local_unnamed_addr #4

declare void @_ZN8CSegyOut5closeEv(ptr noundef nonnull align 8 dereferenceable(1547)) unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(264)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13convertToSEGYNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_St6vectorIiSaIiEEfi(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %2, float noundef %3, i32 noundef %4) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %6 = alloca float, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %"class.std::basic_fstream", align 8
  %11 = alloca %class.CSegyOut, align 8
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store float %3, ptr %6, align 4, !tbaa !5
  store i32 %4, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  %16 = tail call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %18 = mul nsw i32 %17, %4
  %19 = zext nneg i32 %18 to i64
  %20 = icmp slt i32 %18, 0
  %21 = shl nuw nsw i64 %19, 2
  %22 = select i1 %20, i64 -1, i64 %21
  %23 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %22) #10
  store ptr %23, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 528, ptr nonnull %10) #9
  call void @_ZNSt13basic_fstreamIcSt11char_traitsIcEEC1Ev(ptr noundef nonnull align 8 dereferenceable(264) %10)
  invoke void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE4openERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 8)
          to label %24 unwind label %35

24:                                               ; preds = %5
  %25 = load ptr, ptr %10, align 8, !tbaa !13
  %26 = getelementptr i8, ptr %25, i64 -24
  %27 = load i64, ptr %26, align 8
  %28 = getelementptr inbounds i8, ptr %10, i64 %27
  %29 = invoke noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEEcvbEv(ptr noundef nonnull align 8 dereferenceable(264) %28)
          to label %30 unwind label %35

30:                                               ; preds = %24
  br i1 %29, label %.preheader30, label %48

.preheader30:                                     ; preds = %30
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %.loopexit, label %.preheader29.preheader

.preheader29.preheader:                           ; preds = %.preheader30
  %31 = sext i32 %4 to i64
  %sext = shl i64 %16, 32
  %32 = ashr exact i64 %sext, 32
  %.pre = sext i32 %4 to i64
  br label %.preheader29

.preheader29:                                     ; preds = %.preheader29.preheader, %._crit_edge
  %33 = phi i32 [ %37, %._crit_edge ], [ %17, %.preheader29.preheader ]
  %.01532 = phi i64 [ %38, %._crit_edge ], [ 0, %.preheader29.preheader ]
  %.not38 = icmp eq i32 %33, 0
  br i1 %.not38, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader29
  %34 = getelementptr float, ptr %23, i64 %.01532
  br label %.lr.ph

35:                                               ; preds = %48, %24, %5
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %107

._crit_edge:                                      ; preds = %43, %.preheader29
  %.pre-phi = phi i64 [ %.pre, %.preheader29 ], [ %31, %43 ]
  %37 = phi i32 [ 0, %.preheader29 ], [ %17, %43 ]
  %38 = add nuw i64 %.01532, 1
  %39 = icmp ult i64 %38, %.pre-phi
  br i1 %39, label %.preheader29, label %.loopexit, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader, %43
  %.01431 = phi i64 [ %44, %43 ], [ 0, %.lr.ph.preheader ]
  %40 = mul i64 %.01431, %31
  %41 = getelementptr float, ptr %34, i64 %40
  %42 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERf(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %41)
          to label %43 unwind label %46

43:                                               ; preds = %.lr.ph
  %44 = add nuw i64 %.01431, 1
  %45 = icmp ult i64 %44, %32
  br i1 %45, label %.lr.ph, label %._crit_edge, !llvm.loop !17

46:                                               ; preds = %.lr.ph
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %107

48:                                               ; preds = %30
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.12)
          to label %.loopexit unwind label %35

.loopexit:                                        ; preds = %._crit_edge, %.preheader30, %48
  %.not39 = icmp eq i32 %17, 0
  br i1 %.not39, label %._crit_edge37, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.loopexit
  %50 = sext i32 %4 to i64
  %sext41 = shl i64 %16, 32
  %51 = ashr exact i64 %sext41, 32
  %52 = icmp ugt i32 %4, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %72
  %53 = phi i32 [ %63, %72 ], [ %4, %.preheader.preheader ]
  %.01336 = phi i64 [ %73, %72 ], [ 0, %.preheader.preheader ]
  %.not40 = icmp eq i32 %53, 0
  br i1 %.not40, label %._crit_edge35, label %.lr.ph34.preheader

.lr.ph34.preheader:                               ; preds = %.preheader
  %54 = sext i32 %53 to i64
  %55 = mul i64 %.01336, %54
  %56 = getelementptr float, ptr %23, i64 %55
  %57 = load float, ptr %56, align 4, !tbaa !5
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, float noundef %57)
          to label %59 unwind label %.loopexit.split-lp

59:                                               ; preds = %.lr.ph34.preheader
  %60 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @.str.11)
          to label %61 unwind label %.loopexit.split-lp

61:                                               ; preds = %59
  br i1 %52, label %.lr.ph34.preheader.peel.newph, label %._crit_edge35

.lr.ph34.preheader.peel.newph:                    ; preds = %61
  %62 = mul i64 %.01336, %50
  %invariant.gep = getelementptr float, ptr %23, i64 %62
  br label %.lr.ph34

._crit_edge37:                                    ; preds = %72, %.loopexit
  call void @llvm.lifetime.start.p0(i64 1552, ptr nonnull %11) #9
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #9
  store i8 0, ptr %12, align 1, !tbaa !18
  invoke void @_ZN8CSegyOutC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKiRKb(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %77 unwind label %82

._crit_edge35:                                    ; preds = %61, %69, %.preheader
  %63 = phi i32 [ 0, %.preheader ], [ %4, %69 ], [ %4, %61 ]
  %64 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.7)
          to label %72 unwind label %75

.lr.ph34:                                         ; preds = %.lr.ph34.preheader.peel.newph, %69
  %.033 = phi i64 [ %70, %69 ], [ 1, %.lr.ph34.preheader.peel.newph ]
  %gep = getelementptr float, ptr %invariant.gep, i64 %.033
  %65 = load float, ptr %gep, align 4, !tbaa !5
  %66 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEf(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, float noundef %65)
          to label %67 unwind label %.loopexit44

67:                                               ; preds = %.lr.ph34
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull @.str.11)
          to label %69 unwind label %.loopexit44

69:                                               ; preds = %67
  %70 = add nuw i64 %.033, 1
  %71 = icmp ult i64 %70, %50
  br i1 %71, label %.lr.ph34, label %._crit_edge35, !llvm.loop !20

.loopexit44:                                      ; preds = %.lr.ph34, %67
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %107

.loopexit.split-lp:                               ; preds = %.lr.ph34.preheader, %59
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %107

72:                                               ; preds = %._crit_edge35
  %73 = add nuw i64 %.01336, 1
  %74 = icmp ult i64 %73, %51
  br i1 %74, label %.preheader, label %._crit_edge37, !llvm.loop !22

75:                                               ; preds = %._crit_edge35
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %107

77:                                               ; preds = %._crit_edge37
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #9
  %78 = invoke noundef zeroext i1 @_ZN8CSegyOut4openEv(ptr noundef nonnull align 8 dereferenceable(1547) %11)
          to label %79 unwind label %84

79:                                               ; preds = %77
  br i1 %78, label %86, label %80

80:                                               ; preds = %79
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.9)
          to label %86 unwind label %84

82:                                               ; preds = %._crit_edge37
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #9
  br label %106

84:                                               ; preds = %.invoke, %99, %98, %95, %91, %80, %77
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %105

86:                                               ; preds = %80, %79
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #9
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = mul nsw i32 %87, %4
  store i32 %88, ptr %13, align 4, !tbaa !9
  %89 = invoke noundef zeroext i1 @_ZN8CSegyOut12setSegyTraceERKPKfRKi(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %90 unwind label %93

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  br i1 %89, label %95, label %91

91:                                               ; preds = %90
  %92 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.13)
          to label %95 unwind label %84

93:                                               ; preds = %86
  %94 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #9
  br label %105

95:                                               ; preds = %91, %90
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #9
  store i32 5, ptr %14, align 4, !tbaa !9
  call void @_ZN8CSegyOut13setSegyFormatERKi(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #9
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @_ZN8CSegyOut9setSegyIDERKi(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #9
  call void @_ZN8CSegyOut14setTraceNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @_ZN8CSegyOut17setSampleIntervalERKf(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @_ZN8CSegyOut15setSampleNumberERKi(ptr noundef nonnull align 8 dereferenceable(1547) %11, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %96 = invoke noundef zeroext i1 @_ZN8CSegyOut5writeEv(ptr noundef nonnull align 8 dereferenceable(1547) %11)
          to label %.invoke unwind label %84

.invoke:                                          ; preds = %95
  %.str.15..str.14 = select i1 %96, ptr @.str.15, ptr @.str.14
  %97 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.15..str.14)
          to label %98 unwind label %84

98:                                               ; preds = %.invoke
  invoke void @_ZN8CSegyOut5closeEv(ptr noundef nonnull align 8 dereferenceable(1547) %11)
          to label %99 unwind label %84

99:                                               ; preds = %98
  invoke void @_ZNSt13basic_fstreamIcSt11char_traitsIcEE5closeEv(ptr noundef nonnull align 8 dereferenceable(264) %10)
          to label %100 unwind label %84

100:                                              ; preds = %99
  %101 = load ptr, ptr %9, align 8, !tbaa !11
  %102 = icmp eq ptr %101, null
  br i1 %102, label %104, label %103

103:                                              ; preds = %100
  call void @_ZdaPv(ptr noundef nonnull %101) #11
  br label %104

104:                                              ; preds = %103, %100
  call void @_ZN8CSegyOutD1Ev(ptr noundef nonnull align 8 dereferenceable(1547) %11) #9
  call void @llvm.lifetime.end.p0(i64 1552, ptr nonnull %11) #9
  call void @_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(264) %10) #9
  call void @llvm.lifetime.end.p0(i64 528, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  ret void

105:                                              ; preds = %93, %84
  %.pn = phi { ptr, i32 } [ %85, %84 ], [ %94, %93 ]
  call void @_ZN8CSegyOutD1Ev(ptr noundef nonnull align 8 dereferenceable(1547) %11) #9
  br label %106

106:                                              ; preds = %105, %82
  %.pn.pn = phi { ptr, i32 } [ %.pn, %105 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 1552, ptr nonnull %11) #9
  br label %107

107:                                              ; preds = %.loopexit44, %.loopexit.split-lp, %75, %106, %46, %35
  %.pn27 = phi { ptr, i32 } [ %47, %46 ], [ %.pn.pn, %106 ], [ %36, %35 ], [ %76, %75 ], [ %lpad.loopexit, %.loopexit44 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt13basic_fstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(264) %10) #9
  call void @llvm.lifetime.end.p0(i64 528, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  resume { ptr, i32 } %.pn27
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 "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 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { builtin 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 = !{!"float", !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, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = distinct !{!20, !16, !21}
!21 = !{!"llvm.loop.peeled.count", i32 1}
!22 = distinct !{!22, !16}


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