; LLVM IR from eXascaleInfolab/daoc :: export/shared (fileio)

; 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.anon = type { i8 }

@stderr = external global ptr, align 8
@__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.clsmark = external hidden unnamed_addr constant [9 x i8], align 1
@__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.ndsmark = external hidden unnamed_addr constant [6 x i8], align 1
@__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.attrnameDelim = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [83 x i8], align 1

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4daoc12StringBuffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3, i1 noundef zeroext %4) #3 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca %class.anon, align 1
  %12 = alloca [9 x i8], align 1
  %13 = alloca [6 x i8], align 1
  %14 = alloca [5 x i8], align 1
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  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 ptr %3, ptr %9, align 8, !tbaa !5
  %19 = zext i1 %4 to i8
  store i8 %19, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #8
  %20 = call ptr @__errno_location() #9
  store i32 0, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 9, ptr %12) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %12, ptr align 1 @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.clsmark, i64 9, i1 false)
  call void @llvm.lifetime.start.p0(i64 6, ptr %13) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %13, ptr align 1 @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.ndsmark, i64 6, i1 false)
  call void @llvm.lifetime.start.p0(i64 5, ptr %14) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %14, ptr align 1 @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.attrnameDelim, i64 5, i1 false)
  br label %21

21:                                               ; preds = %128, %29, %5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = call noundef ptr @_ZNK4daoc16NamedFileWrappercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(48) %23) #8
  %25 = call noundef zeroext i1 @_ZN4daoc12StringBuffer8readlineEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(40) %22, ptr noundef %24)
  br i1 %25, label %26, label %130

26:                                               ; preds = %21
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef zeroext i1 @_ZNK4daoc12StringBuffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(40) %27) #8
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  br label %21, !llvm.loop !13

30:                                               ; preds = %26
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef 0) #8
  %33 = load i8, ptr %32, align 1, !tbaa !15
  %34 = sext i8 %33 to i32
  %35 = icmp ne i32 %34, 35
  br i1 %35, label %36, label %37

36:                                               ; preds = %30
  br label %130

37:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = call noundef ptr @_ZN4daoc12StringBuffercvPcEv(ptr noundef nonnull align 8 dereferenceable(40) %38) #8
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  %41 = getelementptr inbounds [5 x i8], ptr %14, i64 0, i64 0
  %42 = call ptr @strtok(ptr noundef %40, ptr noundef %41) #8
  store ptr %42, ptr %15, align 8, !tbaa !5
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %51

45:                                               ; preds = %37
  %46 = load ptr, ptr %15, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 0
  %48 = load i8, ptr %47, align 1, !tbaa !15
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 35
  br i1 %50, label %51, label %52

51:                                               ; preds = %45, %37
  store i32 2, ptr %16, align 4
  br label %128, !llvm.loop !13

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #8
  store i8 0, ptr %17, align 1, !tbaa !15
  br label %53

53:                                               ; preds = %101, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %54 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %54, ptr %18, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %67, %53
  %56 = load ptr, ptr %18, align 8, !tbaa !5
  %57 = load i8, ptr %56, align 1, !tbaa !15
  %58 = icmp ne i8 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 6, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %70

60:                                               ; preds = %55
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = load i8, ptr %61, align 1, !tbaa !15
  %63 = sext i8 %62 to i32
  %64 = call i32 @tolower(i32 noundef %63) #10
  %65 = trunc i32 %64 to i8
  %66 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %65, ptr %66, align 1, !tbaa !15
  br label %67

67:                                               ; preds = %60
  %68 = load ptr, ptr %18, align 8, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %68, i32 1
  store ptr %69, ptr %18, align 8, !tbaa !5
  br label %55, !llvm.loop !16

70:                                               ; preds = %59
  %71 = load ptr, ptr %15, align 8, !tbaa !5
  %72 = getelementptr inbounds [9 x i8], ptr %12, i64 0, i64 0
  %73 = call i32 @strcmp(ptr noundef %71, ptr noundef %72) #10
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %80, label %75

75:                                               ; preds = %70
  %76 = call noundef i64 @"_ZZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_bENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 %76, ptr %77, align 8, !tbaa !17
  %78 = load i8, ptr %17, align 1, !tbaa !15
  %79 = add i8 %78, 1
  store i8 %79, ptr %17, align 1, !tbaa !15
  br label %92

80:                                               ; preds = %70
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = getelementptr inbounds [6 x i8], ptr %13, i64 0, i64 0
  %83 = call i32 @strcmp(ptr noundef %81, ptr noundef %82) #10
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %90, label %85

85:                                               ; preds = %80
  %86 = call noundef i64 @"_ZZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_bENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) %11) #8
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %86, ptr %87, align 8, !tbaa !17
  %88 = load i8, ptr %17, align 1, !tbaa !15
  %89 = add i8 %88, 1
  store i8 %89, ptr %17, align 1, !tbaa !15
  br label %91

90:                                               ; preds = %80
  br label %103

91:                                               ; preds = %85
  br label %92

92:                                               ; preds = %91, %75
  br label %93

93:                                               ; preds = %92
  %94 = getelementptr inbounds [5 x i8], ptr %14, i64 0, i64 0
  %95 = call ptr @strtok(ptr noundef null, ptr noundef %94) #8
  store ptr %95, ptr %15, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %101

97:                                               ; preds = %93
  %98 = load i8, ptr %17, align 1, !tbaa !15
  %99 = zext i8 %98 to i32
  %100 = icmp slt i32 %99, 2
  br label %101

101:                                              ; preds = %97, %93
  %102 = phi i1 [ false, %93 ], [ %100, %97 ]
  br i1 %102, label %53, label %103, !llvm.loop !19

103:                                              ; preds = %101, %90
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = load i64, ptr %104, align 8, !tbaa !17
  %106 = icmp ne i64 %105, 0
  br i1 %106, label %107, label %123

107:                                              ; preds = %103
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = load i64, ptr %108, align 8, !tbaa !17
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = load i64, ptr %110, align 8, !tbaa !17
  %112 = icmp ugt i64 %109, %111
  br i1 %112, label %113, label %123

113:                                              ; preds = %107
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load i64, ptr %115, align 8, !tbaa !17
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = load i64, ptr %117, align 8, !tbaa !17
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.6, i64 noundef %116, i64 noundef %118) #8
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = load i64, ptr %120, align 8, !tbaa !17
  %122 = load ptr, ptr %8, align 8, !tbaa !5
  store i64 %121, ptr %122, align 8, !tbaa !17
  br label %123

123:                                              ; preds = %113, %107, %103
  %124 = load ptr, ptr %7, align 8, !tbaa !5
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = call noundef ptr @_ZNK4daoc16NamedFileWrappercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(48) %125) #8
  %127 = call noundef zeroext i1 @_ZN4daoc12StringBuffer8readlineEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(40) %124, ptr noundef %126)
  store i32 3, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #8
  br label %128

128:                                              ; preds = %123, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  %129 = load i32, ptr %16, align 4
  switch i32 %129, label %131 [
    i32 2, label %21
    i32 3, label %130
  ]

130:                                              ; preds = %128, %36, %21
  call void @llvm.lifetime.end.p0(i64 5, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 6, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 9, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #8
  ret void

131:                                              ; preds = %128
  unreachable
}

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4daoc16NamedFileWrappercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

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

; Function Attrs: nounwind
declare ptr @strtok(ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4daoc12StringBuffercvPcEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

; Function Attrs: nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) #6

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @"_ZZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_bENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #7 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 willreturn memory(none) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind willreturn memory(read) "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 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { nounwind willreturn memory(read) }

!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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !14}
!17 = !{!18, !18, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = distinct !{!19, !14}


; 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.anon = type { i8 }

@stderr = external local_unnamed_addr global ptr, align 8
@__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.clsmark = external hidden unnamed_addr constant [9 x i8], align 1
@__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.ndsmark = external hidden unnamed_addr constant [6 x i8], align 1
@__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.attrnameDelim = external hidden unnamed_addr constant [5 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [83 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4daoc12StringBuffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 8 dereferenceable(40) %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2, ptr nocapture noundef nonnull align 8 dereferenceable(8) %3, i1 noundef zeroext %4) local_unnamed_addr #3 {
  %6 = alloca %class.anon, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #9
  %7 = tail call ptr @__errno_location() #10
  store i32 0, ptr %7, align 4, !tbaa !5
  %8 = tail call noundef ptr @_ZNK4daoc16NamedFileWrappercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #9
  %9 = tail call noundef zeroext i1 @_ZN4daoc12StringBuffer8readlineEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %8)
  br i1 %9, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %5, %.backedge
  %10 = tail call noundef zeroext i1 @_ZNK4daoc12StringBuffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(40) %1) #9
  br i1 %10, label %.backedge, label %13

.backedge:                                        ; preds = %20, %16, %.lr.ph
  %11 = tail call noundef ptr @_ZNK4daoc16NamedFileWrappercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #9
  %12 = tail call noundef zeroext i1 @_ZN4daoc12StringBuffer8readlineEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %11)
  br i1 %12, label %.lr.ph, label %.loopexit, !llvm.loop !9

13:                                               ; preds = %.lr.ph
  %14 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #9
  %15 = load i8, ptr %14, align 1, !tbaa !11
  %.not = icmp eq i8 %15, 35
  br i1 %.not, label %16, label %.loopexit

16:                                               ; preds = %13
  %17 = tail call noundef ptr @_ZN4daoc12StringBuffercvPcEv(ptr noundef nonnull align 8 dereferenceable(40) %1) #9
  %18 = getelementptr inbounds i8, ptr %17, i64 1
  %19 = tail call ptr @strtok(ptr noundef nonnull %18, ptr noundef nonnull @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.attrnameDelim) #9
  %.not36 = icmp eq ptr %19, null
  br i1 %.not36, label %.backedge, label %20, !llvm.loop !9

20:                                               ; preds = %16
  %21 = load i8, ptr %19, align 1, !tbaa !11
  %22 = icmp eq i8 %21, 35
  br i1 %22, label %.backedge, label %.preheader, !llvm.loop !9

.preheaderthread-pre-split:                       ; preds = %34
  %.pr = load i8, ptr %36, align 1, !tbaa !11
  br label %.preheader

.preheader:                                       ; preds = %20, %.preheaderthread-pre-split
  %23 = phi i8 [ %.pr, %.preheaderthread-pre-split ], [ %21, %20 ]
  %.030 = phi ptr [ %36, %.preheaderthread-pre-split ], [ %19, %20 ]
  %24 = phi i1 [ false, %.preheaderthread-pre-split ], [ true, %20 ]
  %.not3745 = icmp eq i8 %23, 0
  br i1 %.not3745, label %._crit_edge, label %.lr.ph47

._crit_edge:                                      ; preds = %.lr.ph47, %.preheader
  %25 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.030, ptr noundef nonnull dereferenceable(1) @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.clsmark) #11
  %.not38 = icmp eq i32 %25, 0
  br i1 %.not38, label %34, label %32

.lr.ph47:                                         ; preds = %.preheader, %.lr.ph47
  %26 = phi i8 [ %31, %.lr.ph47 ], [ %23, %.preheader ]
  %.046 = phi ptr [ %30, %.lr.ph47 ], [ %.030, %.preheader ]
  %27 = sext i8 %26 to i32
  %28 = call i32 @tolower(i32 noundef %27) #11
  %29 = trunc i32 %28 to i8
  store i8 %29, ptr %.046, align 1, !tbaa !11
  %30 = getelementptr inbounds i8, ptr %.046, i64 1
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %.not37 = icmp eq i8 %31, 0
  br i1 %.not37, label %._crit_edge, label %.lr.ph47, !llvm.loop !12

32:                                               ; preds = %._crit_edge
  %33 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.030, ptr noundef nonnull dereferenceable(1) @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.ndsmark) #11
  %.not39 = icmp eq i32 %33, 0
  br i1 %.not39, label %34, label %39

34:                                               ; preds = %32, %._crit_edge
  %.sink49 = phi ptr [ %2, %._crit_edge ], [ %3, %32 ]
  %35 = call noundef i64 @"_ZZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_bENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) %6) #9
  store i64 %35, ptr %.sink49, align 8, !tbaa !13
  %36 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @__const._ZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_b.attrnameDelim) #9
  %37 = icmp ne ptr %36, null
  %38 = and i1 %37, %24
  br i1 %38, label %.preheaderthread-pre-split, label %39, !llvm.loop !15

39:                                               ; preds = %32, %34
  %40 = load i64, ptr %3, align 8, !tbaa !13
  %.not40 = icmp eq i64 %40, 0
  br i1 %.not40, label %.thread, label %41

41:                                               ; preds = %39
  %42 = load i64, ptr %2, align 8, !tbaa !13
  %43 = icmp ugt i64 %42, %40
  br i1 %43, label %44, label %.thread

44:                                               ; preds = %41
  %45 = load ptr, ptr @stderr, align 8, !tbaa !16
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.6, i64 noundef %42, i64 noundef %40) #12
  %47 = load i64, ptr %3, align 8, !tbaa !13
  store i64 %47, ptr %2, align 8, !tbaa !13
  br label %.thread

.thread:                                          ; preds = %39, %41, %44
  %48 = call noundef ptr @_ZNK4daoc16NamedFileWrappercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(48) %0) #9
  %49 = call noundef zeroext i1 @_ZN4daoc12StringBuffer8readlineEP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(40) %1, ptr noundef %48)
  br label %.loopexit

.loopexit:                                        ; preds = %.backedge, %13, %5, %.thread
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #9
  ret void
}

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #5

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare i32 @tolower(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i64 @"_ZZN4daoc14parseCnlHeaderERNS_16NamedFileWrapperERNS_12StringBufferERmS4_bENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #8 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree 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 #2 = { 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 #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 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn "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 = { mustprogress nofree nounwind willreturn memory(read) "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { cold nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}


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