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

; 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.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 }
%"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] }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7CSegyIn18readSEGYFileHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca [400 x i8], align 16
  %4 = alloca i32, align 4
  %5 = alloca i16, align 2
  %6 = alloca [4 x i8], align 1
  %7 = alloca [2 x i8], align 1
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 400, ptr %3) #4
  %16 = getelementptr inbounds %class.CSegyIO, ptr %15, i32 0, i32 12
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef 3200, i32 noundef 0)
  %18 = getelementptr inbounds %class.CSegyIO, ptr %15, i32 0, i32 12
  %19 = getelementptr inbounds [400 x i8], ptr %3, i64 0, i64 0
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef %19, i64 noundef 400)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store i64 0, ptr %8, align 8, !tbaa !9
  store i32 0, ptr %4, align 4, !tbaa !11
  br label %21

21:                                               ; preds = %36, %1
  %22 = load i32, ptr %4, align 4, !tbaa !11
  %23 = icmp slt i32 %22, 3
  br i1 %23, label %24, label %39

24:                                               ; preds = %21
  %25 = getelementptr inbounds [400 x i8], ptr %3, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %26 = getelementptr inbounds [4 x i8], ptr %6, i64 0, i64 0
  store ptr %26, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 4, ptr %11, align 4, !tbaa !11
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %15, ptr noundef %25, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %29 = getelementptr inbounds %class.CSegyIO, ptr %15, i32 0, i32 7
  %30 = load i32, ptr %4, align 4, !tbaa !11
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [27 x i32], ptr %29, i64 0, i64 %31
  %33 = getelementptr inbounds [4 x i8], ptr %6, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 1 %33, i64 4, i1 false)
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = add nsw i64 %34, 4
  store i64 %35, ptr %8, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %24
  %37 = load i32, ptr %4, align 4, !tbaa !11
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %4, align 4, !tbaa !11
  br label %21, !llvm.loop !13

39:                                               ; preds = %21
  br label %40

40:                                               ; preds = %57, %39
  %41 = load i32, ptr %4, align 4, !tbaa !11
  %42 = icmp slt i32 %41, 27
  br i1 %42, label %43, label %60

43:                                               ; preds = %40
  %44 = getelementptr inbounds [400 x i8], ptr %3, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %45 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 0
  store ptr %45, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %46 = load i64, ptr %8, align 8, !tbaa !9
  %47 = trunc i64 %46 to i32
  store i32 %47, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 2, ptr %14, align 4, !tbaa !11
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %15, ptr noundef %44, 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 %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  %48 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %5, ptr align 1 %48, i64 2, i1 false)
  %49 = load i16, ptr %5, align 2, !tbaa !15
  %50 = zext i16 %49 to i32
  %51 = getelementptr inbounds %class.CSegyIO, ptr %15, i32 0, i32 7
  %52 = load i32, ptr %4, align 4, !tbaa !11
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [27 x i32], ptr %51, i64 0, i64 %53
  store i32 %50, ptr %54, align 4, !tbaa !11
  %55 = load i64, ptr %8, align 8, !tbaa !9
  %56 = add nsw i64 %55, 2
  store i64 %56, ptr %8, align 8, !tbaa !9
  br label %57

57:                                               ; preds = %43
  %58 = load i32, ptr %4, align 4, !tbaa !11
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %4, align 4, !tbaa !11
  br label %40, !llvm.loop !17

60:                                               ; preds = %40
  %61 = getelementptr inbounds %class.CSegyIO, ptr %15, i32 0, i32 7
  %62 = getelementptr inbounds [27 x i32], ptr %61, i64 0, i64 9
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = getelementptr inbounds %class.CSegyIO, ptr %15, i32 0, i32 5
  store i32 %63, ptr %64, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 400, ptr %3) #4
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) #2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7CSegyIn18readSEGYFileHeaderEv(ptr noundef nonnull align 8 dereferenceable(1546) %0) local_unnamed_addr #1 align 2 {
.lr.ph:
  %1 = alloca [400 x i8], align 16
  %2 = alloca [4 x i8], align 4
  %3 = alloca [2 x i8], align 2
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %1) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 448
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef 3200, i32 noundef 0)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi4readEPcl(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull %1, i64 noundef 400)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #3
  %13 = getelementptr inbounds i8, ptr %0, i64 312
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store ptr %2, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 4, ptr %6, align 4, !tbaa !9
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %14 = load i32, ptr %2, align 4
  store i32 %14, ptr %13, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store ptr %2, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 4, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 4, ptr %6, align 4, !tbaa !9
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %15 = getelementptr inbounds i8, ptr %0, i64 316
  %16 = load i32, ptr %2, align 4
  store i32 %16, ptr %15, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  store ptr %2, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 8, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  store i32 4, ptr %6, align 4, !tbaa !9
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  %17 = getelementptr inbounds i8, ptr %0, i64 320
  %18 = load i32, ptr %2, align 4
  store i32 %18, ptr %17, align 8
  br label %19

19:                                               ; preds = %.lr.ph, %19
  %indvars.iv = phi i64 [ 3, %.lr.ph ], [ %indvars.iv.next, %19 ]
  %.116 = phi i64 [ 12, %.lr.ph ], [ %23, %19 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  store ptr %3, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #3
  %20 = trunc i64 %.116 to i32
  store i32 %20, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #3
  store i32 2, ptr %9, align 4, !tbaa !9
  call void @_ZN7CSegyIn6getBufEPKcRKPcRKiS6_(ptr noundef nonnull align 8 dereferenceable(1546) %0, ptr noundef nonnull %1, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %.0.copyload = load i16, ptr %3, align 2
  %21 = zext i16 %.0.copyload to i32
  %22 = getelementptr inbounds [27 x i32], ptr %13, i64 0, i64 %indvars.iv
  store i32 %21, ptr %22, align 4, !tbaa !9
  %23 = add nuw nsw i64 %.116, 2
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 27
  br i1 %exitcond.not, label %._crit_edge, label %19, !llvm.loop !11

._crit_edge:                                      ; preds = %19
  %24 = getelementptr inbounds i8, ptr %0, i64 348
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %25, ptr %26, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %1) #3
  ret void
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSi5seekgElSt12_Ios_Seekdir(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i32 noundef) local_unnamed_addr #2

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

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass