; LLVM IR from xtaci/algorithms :: src (word_seg_demo)

; 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.alg::WordSeg" = type { %"class.alg::HashTable" }
%"class.alg::HashTable" = type { i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.alg::WordSeg", align 8
  %3 = alloca [1024 x i8], align 16
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #9
  call void @_ZN3alg7WordSegC2EPKc(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef @.str)
  call void @llvm.lifetime.start.p0(i64 1024, ptr %3) #9
  %13 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1)
          to label %14 unwind label %60

14:                                               ; preds = %0
  br label %15

15:                                               ; preds = %102, %14
  br label %16

16:                                               ; preds = %15
  %17 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %18 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %17)
          to label %19 unwind label %60

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  store ptr @.str.3, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = call ptr @strtok_r(ptr noundef %20, ptr noundef %21, ptr noundef %7) #9
  store ptr %22, ptr %6, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %97, %19
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %102

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = invoke noundef ptr @_ZN3alg7WordSeg3runEPKc(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef %27)
          to label %29 unwind label %64

29:                                               ; preds = %26
  store ptr %28, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #9
  store i16 0, ptr %10, align 2, !tbaa !9
  br label %30

30:                                               ; preds = %88, %29
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = invoke noundef zeroext i1 @_ZNK3alg5QueueIjE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %33 unwind label %68

33:                                               ; preds = %30
  %34 = xor i1 %32, true
  br i1 %34, label %35, label %90

35:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5QueueIjE5frontEv(ptr noundef nonnull align 8 dereferenceable(32) %36)
          to label %38 unwind label %72

38:                                               ; preds = %35
  %39 = load i32, ptr %37, align 4, !tbaa !11
  store i32 %39, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = load i16, ptr %10, align 2, !tbaa !9
  %42 = sext i16 %41 to i32
  %43 = invoke noundef signext i16 @_ZL12gb18030_readPKciPj(ptr noundef %40, i32 noundef %42, ptr noundef %12)
          to label %44 unwind label %76

44:                                               ; preds = %38
  %45 = sext i16 %43 to i32
  %46 = load i16, ptr %10, align 2, !tbaa !9
  %47 = sext i16 %46 to i32
  %48 = add nsw i32 %47, %45
  %49 = trunc i32 %48 to i16
  store i16 %49, ptr %10, align 2, !tbaa !9
  %50 = load i32, ptr %12, align 4, !tbaa !11
  invoke void @_ZL15gb18030_putcharj(i32 noundef %50)
          to label %51 unwind label %76

51:                                               ; preds = %44
  %52 = load i32, ptr %11, align 4, !tbaa !11
  %53 = invoke i32 @putchar(i32 noundef %52)
          to label %54 unwind label %76

54:                                               ; preds = %51
  %55 = load i32, ptr %11, align 4, !tbaa !11
  %56 = icmp eq i32 %55, 48
  br i1 %56, label %57, label %80

57:                                               ; preds = %54
  %58 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %59 unwind label %76

59:                                               ; preds = %57
  br label %80

60:                                               ; preds = %16, %0
  %61 = landingpad { ptr, i32 }
          cleanup
  %62 = extractvalue { ptr, i32 } %61, 0
  store ptr %62, ptr %4, align 8
  %63 = extractvalue { ptr, i32 } %61, 1
  store i32 %63, ptr %5, align 4
  br label %103

64:                                               ; preds = %26
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %4, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %5, align 4
  br label %101

68:                                               ; preds = %90, %30
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %4, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %5, align 4
  br label %100

72:                                               ; preds = %35
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %4, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %5, align 4
  br label %89

76:                                               ; preds = %86, %83, %57, %51, %44, %38
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %4, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %89

80:                                               ; preds = %59, %54
  %81 = load i32, ptr %11, align 4, !tbaa !11
  %82 = icmp eq i32 %81, 51
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  %84 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %85 unwind label %76

85:                                               ; preds = %83
  br label %86

86:                                               ; preds = %85, %80
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  invoke void @_ZN3alg5QueueIjE7dequeueEv(ptr noundef nonnull align 8 dereferenceable(32) %87)
          to label %88 unwind label %76

88:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %30, !llvm.loop !13

89:                                               ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %100

90:                                               ; preds = %33
  %91 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4)
          to label %92 unwind label %68

92:                                               ; preds = %90
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = icmp eq ptr %93, null
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  call void @_ZN3alg5QueueIjED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %93) #9
  call void @_ZdlPvm(ptr noundef %93, i64 noundef 32) #10
  br label %96

96:                                               ; preds = %95, %92
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = call ptr @strtok_r(ptr noundef null, ptr noundef %98, ptr noundef %7) #9
  store ptr %99, ptr %6, align 8, !tbaa !5
  br label %23, !llvm.loop !15

100:                                              ; preds = %89, %68
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #9
  br label %101

101:                                              ; preds = %100, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %103

102:                                              ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %15, !llvm.loop !16

103:                                              ; preds = %101, %60
  call void @llvm.lifetime.end.p0(i64 1024, ptr %3) #9
  call void @_ZN3alg7WordSegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #9
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %4, align 8
  %106 = load i32, ptr %5, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

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

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

declare i32 @printf(ptr noundef, ...) #3

declare i32 @__gxx_personality_v0(...)

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

; Function Attrs: nounwind
declare ptr @strtok_r(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3alg5QueueIjE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5QueueIjE5frontEv(ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef signext i16 @_ZL12gb18030_readPKciPj(ptr noundef, i32 noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL15gb18030_putcharj(i32 noundef) #6

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg5QueueIjE7dequeueEv(ptr noundef nonnull align 8 dereferenceable(32)) #5 align 2

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg7WordSegD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

attributes #0 = { mustprogress norecurse 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 "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 = { 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 #7 = { 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 = { 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 = { nounwind }
attributes #10 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !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.alg::WordSeg" = type { %"class.alg::HashTable" }
%"class.alg::HashTable" = type { i32, ptr, ptr }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress norecurse noreturn uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.alg::WordSeg", align 8
  %2 = alloca [1024 x i8], align 16
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %1) #10
  call void @_ZN3alg7WordSegC2EPKc(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull @.str)
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %2) #10
  %5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %6

6:                                                ; preds = %._crit_edge26, %0
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  %8 = call ptr @strtok_r(ptr noundef nonnull %2, ptr noundef nonnull @.str.3, ptr noundef nonnull %3) #10
  %.not22 = icmp eq ptr %8, null
  br i1 %.not22, label %._crit_edge26, label %.lr.ph25

.lr.ph25:                                         ; preds = %6, %._crit_edge
  %.01823 = phi ptr [ %31, %._crit_edge ], [ %8, %6 ]
  %9 = invoke noundef ptr @_ZN3alg7WordSeg3runEPKc(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull %.01823)
          to label %.preheader unwind label %21

.preheader:                                       ; preds = %.lr.ph25
  %10 = call noundef zeroext i1 @_ZNK3alg5QueueIjE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
  br i1 %10, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %28
  %.01521 = phi i32 [ %17, %28 ], [ 0, %.preheader ]
  %11 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5QueueIjE5frontEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
          to label %12 unwind label %23

12:                                               ; preds = %.lr.ph
  %13 = load i32, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #10
  %sext = shl i32 %.01521, 16
  %14 = ashr exact i32 %sext, 16
  %15 = call noundef signext i16 @_ZL12gb18030_readPKciPj(ptr noundef nonnull %.01823, i32 noundef %14, ptr noundef nonnull %4)
  %16 = zext i16 %15 to i32
  %17 = add nsw i32 %14, %16
  %18 = load i32, ptr %4, align 4, !tbaa !5
  invoke void @_ZL15gb18030_putcharj(i32 noundef %18)
          to label %19 unwind label %25

19:                                               ; preds = %12
  %20 = call i32 @putchar(i32 noundef %13)
  switch i32 %13, label %28 [
    i32 48, label %.sink.split
    i32 51, label %.sink.split
  ]

21:                                               ; preds = %.lr.ph25
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %32

23:                                               ; preds = %.lr.ph
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %32

25:                                               ; preds = %12
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #10
  br label %32

.sink.split:                                      ; preds = %19, %19
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %28

28:                                               ; preds = %.sink.split, %19
  call void @_ZN3alg5QueueIjE7dequeueEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #10
  %29 = call noundef zeroext i1 @_ZNK3alg5QueueIjE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %9)
  br i1 %29, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %28, %.preheader
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @_ZN3alg5QueueIjED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %9) #10
  call void @_ZdlPvm(ptr noundef %9, i64 noundef 32) #11
  %31 = call ptr @strtok_r(ptr noundef null, ptr noundef nonnull @.str.3, ptr noundef nonnull %3) #10
  %.not = icmp eq ptr %31, null
  br i1 %.not, label %._crit_edge26, label %.lr.ph25, !llvm.loop !11

32:                                               ; preds = %23, %25, %21
  %.pn.pn = phi { ptr, i32 } [ %22, %21 ], [ %26, %25 ], [ %24, %23 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %2) #10
  call void @_ZN3alg7WordSegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %1) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %1) #10
  resume { ptr, i32 } %.pn.pn

._crit_edge26:                                    ; preds = %._crit_edge, %6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  br label %6, !llvm.loop !12
}

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

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3alg5QueueIjE8is_emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3alg5QueueIjE5frontEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef signext i16 @_ZL12gb18030_readPKciPj(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL15gb18030_putcharj(i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7

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

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #9

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3alg7WordSegD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #5 align 2

attributes #0 = { mustprogress norecurse noreturn 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { 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 #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 = { 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 #7 = { inlinehint mustprogress nofree 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 = { 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 = { 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 #10 = { nounwind }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass