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

; 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::__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 }

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@_ZZN7CSegyIn4readEvE6isRead = external hidden global 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 @_ZN7CSegyIn4readEv(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 %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8
  %10 = getelementptr inbounds %class.CSegyIO, ptr %9, i32 0, i32 17
  %11 = load i8, ptr %10, align 1, !tbaa !9, !range !27, !noundef !28
  %12 = trunc i8 %11 to i1
  br i1 %12, label %25, label %13

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %14 unwind label %16

14:                                               ; preds = %13
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %9, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %15 unwind label %20

15:                                               ; preds = %14
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  store i1 false, ptr %2, align 1
  br label %49

16:                                               ; preds = %13
  %17 = landingpad { ptr, i32 }
          cleanup
  %18 = extractvalue { ptr, i32 } %17, 0
  store ptr %18, ptr %6, align 8
  %19 = extractvalue { ptr, i32 } %17, 1
  store i32 %19, ptr %7, align 4
  br label %24

20:                                               ; preds = %14
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %6, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br label %24

24:                                               ; preds = %20, %16
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  br label %51

25:                                               ; preds = %1
  %26 = load i8, ptr @_ZZN7CSegyIn4readEvE6isRead, align 1, !tbaa !29, !range !27, !noundef !28
  %27 = trunc i8 %26 to i1
  br i1 %27, label %28, label %29

28:                                               ; preds = %25
  store i1 true, ptr %2, align 1
  br label %49

29:                                               ; preds = %25
  store i8 1, ptr @_ZZN7CSegyIn4readEvE6isRead, align 1, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %30 = call noundef i64 @_ZN7CSegyIn11getFileSizeEv(ptr noundef nonnull align 8 dereferenceable(1546) %9)
  %31 = getelementptr inbounds %class.CSegyIO, ptr %9, i32 0, i32 11
  store i64 %30, ptr %31, align 8, !tbaa !30
  call void @_ZN7CSegyIn18readSEGYFileHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %9)
  %32 = call noundef zeroext i1 @_ZN7CSegyIn19readSEGYTraceHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %9)
  store i32 0, ptr %8, align 4, !tbaa !31
  br label %33

33:                                               ; preds = %45, %29
  %34 = load i32, ptr %8, align 4, !tbaa !31
  %35 = getelementptr inbounds %class.CSegyIO, ptr %9, i32 0, i32 3
  %36 = load i32, ptr %35, align 8, !tbaa !32
  %37 = icmp slt i32 %34, %36
  br i1 %37, label %38, label %48

38:                                               ; preds = %33
  %39 = load i32, ptr %8, align 4, !tbaa !31
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %38
  %42 = call noundef zeroext i1 @_ZN7CSegyIn19readSEGYTraceHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %9)
  br label %43

43:                                               ; preds = %41, %38
  %44 = call noundef zeroext i1 @_ZN7CSegyIn13readSEGYTraceEv(ptr noundef nonnull align 8 dereferenceable(1546) %9)
  br label %45

45:                                               ; preds = %43
  %46 = load i32, ptr %8, align 4, !tbaa !31
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %8, align 4, !tbaa !31
  br label %33, !llvm.loop !33

48:                                               ; preds = %33
  store i1 true, ptr %2, align 1
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %49

49:                                               ; preds = %48, %28, %15
  %50 = load i1, ptr %2, align 1
  ret i1 %50

51:                                               ; preds = %24
  %52 = load ptr, ptr %6, align 8
  %53 = load i32, ptr %7, align 4
  %54 = insertvalue { ptr, i32 } poison, ptr %52, 0
  %55 = insertvalue { ptr, i32 } %54, i32 %53, 1
  resume { ptr, i32 } %55
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7CSegyIn11getFileSizeEv(ptr noundef nonnull align 8 dereferenceable(1546)) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7CSegyIn19readSEGYTraceHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7CSegyIn13readSEGYTraceEv(ptr noundef nonnull align 8 dereferenceable(1546)) #3 align 2

; 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 = { 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, !20, i64 1545}
!10 = !{!"_ZTS7CSegyIO", !11, i64 8, !11, i64 12, !11, i64 16, !12, i64 20, !11, i64 24, !7, i64 28, !7, i64 312, !6, i64 424, !6, i64 432, !13, i64 440, !14, i64 448, !23, i64 968, !25, i64 1480, !25, i64 1512, !20, i64 1544, !20, i64 1545}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !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, !6, i64 152, !13, i64 160, !20, i64 168, !20, i64 169, !20, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !20, i64 192, !6, i64 200, !6, i64 208, !13, i64 216, !6, i64 224, !6, i64 232}
!17 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !18, i64 56}
!18 = !{!"_ZTSSt6locale", !6, i64 0}
!19 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !20, i64 8}
!20 = !{!"bool", !7, i64 0}
!21 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!22 = !{!"_ZTS11__mbstate_t", !11, 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", !6, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!20, !20, i64 0}
!30 = !{!10, !13, i64 440}
!31 = !{!11, !11, i64 0}
!32 = !{!10, !11, i64 16}
!33 = distinct !{!33, !34}
!34 = !{!"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::__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 }

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@_ZZN7CSegyIn4readEvE6isRead = external hidden local_unnamed_addr global 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 @_ZN7CSegyIn4readEv(ptr noundef nonnull align 8 dereferenceable(1546) %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = getelementptr inbounds i8, ptr %0, i64 1545
  %5 = load i8, ptr %4, align 1, !tbaa !5, !range !26, !noundef !27
  %6 = trunc nuw i8 %5 to i1
  br i1 %6, label %15, label %7

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #4
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %8 unwind label %10

8:                                                ; preds = %7
  invoke void @_ZN7CSegyIO15setErrorMessageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %9 unwind label %12

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

10:                                               ; preds = %7
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %14

12:                                               ; preds = %8
  %13 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  br label %14

14:                                               ; preds = %12, %10
  %.pn = phi { ptr, i32 } [ %13, %12 ], [ %11, %10 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn

15:                                               ; preds = %1
  %16 = load i8, ptr @_ZZN7CSegyIn4readEvE6isRead, align 1, !tbaa !28, !range !26, !noundef !27
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %.loopexit, label %18

18:                                               ; preds = %15
  store i8 1, ptr @_ZZN7CSegyIn4readEvE6isRead, align 1, !tbaa !28
  %19 = tail call noundef i64 @_ZN7CSegyIn11getFileSizeEv(ptr noundef nonnull align 8 dereferenceable(1546) %0)
  %20 = getelementptr inbounds i8, ptr %0, i64 440
  store i64 %19, ptr %20, align 8, !tbaa !29
  tail call void @_ZN7CSegyIn18readSEGYFileHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %0)
  %21 = tail call noundef zeroext i1 @_ZN7CSegyIn19readSEGYTraceHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %0)
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  %23 = load i32, ptr %22, align 8, !tbaa !30
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %18
  %25 = tail call noundef zeroext i1 @_ZN7CSegyIn13readSEGYTraceEv(ptr noundef nonnull align 8 dereferenceable(1546) %0)
  %26 = load i32, ptr %22, align 8, !tbaa !30
  %27 = icmp sgt i32 %26, 1
  br i1 %27, label %.lr.ph.peel.next, label %.loopexit

.lr.ph.peel.next:                                 ; preds = %.lr.ph.preheader, %.lr.ph.peel.next
  %.010 = phi i32 [ %30, %.lr.ph.peel.next ], [ 1, %.lr.ph.preheader ]
  %28 = tail call noundef zeroext i1 @_ZN7CSegyIn19readSEGYTraceHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %0)
  %29 = tail call noundef zeroext i1 @_ZN7CSegyIn13readSEGYTraceEv(ptr noundef nonnull align 8 dereferenceable(1546) %0)
  %30 = add nuw nsw i32 %.010, 1
  %31 = load i32, ptr %22, align 8, !tbaa !30
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %.lr.ph.peel.next, label %.loopexit, !llvm.loop !31

.loopexit:                                        ; preds = %.lr.ph.peel.next, %.lr.ph.preheader, %18, %15, %9
  ret i1 %6
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7CSegyIn11getFileSizeEv(ptr noundef nonnull align 8 dereferenceable(1546)) local_unnamed_addr #3 align 2

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

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

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

; 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 = { 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, !19, i64 1545}
!6 = !{!"_ZTS7CSegyIO", !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 20, !7, i64 24, !8, i64 28, !8, i64 312, !11, i64 424, !11, i64 432, !12, i64 440, !13, i64 448, !22, i64 968, !24, i64 1480, !24, i64 1512, !19, i64 1544, !19, i64 1545}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTSSt14basic_ifstreamIcSt11char_traitsIcEE", !14, i64 0, !15, i64 16}
!14 = !{!"_ZTSSi", !12, i64 8}
!15 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !16, i64 0, !8, i64 64, !18, i64 104, !20, i64 120, !21, i64 124, !21, i64 132, !21, i64 140, !11, i64 152, !12, i64 160, !19, i64 168, !19, i64 169, !19, i64 170, !8, i64 171, !11, i64 176, !11, i64 184, !19, i64 192, !11, i64 200, !11, i64 208, !12, i64 216, !11, i64 224, !11, i64 232}
!16 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !17, i64 56}
!17 = !{!"_ZTSSt6locale", !11, i64 0}
!18 = !{!"_ZTSSt12__basic_fileIcE", !11, i64 0, !19, i64 8}
!19 = !{!"bool", !8, i64 0}
!20 = !{!"_ZTSSt13_Ios_Openmode", !8, i64 0}
!21 = !{!"_ZTS11__mbstate_t", !7, i64 0, !8, i64 4}
!22 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !23, i64 0, !15, i64 8}
!23 = !{!"_ZTSSo"}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !12, i64 8, !8, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !11, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!19, !19, i64 0}
!29 = !{!6, !12, i64 440}
!30 = !{!6, !7, i64 16}
!31 = distinct !{!31, !32, !33}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass