; LLVM IR from thunlp/SE-WRL :: word2vec (word2phrase)

; 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"

%struct.vocab_word = type { i64, ptr }

@debug_mode = external dso_local global i32, align 4
@vocab_size = external dso_local global i64, align 8
@train_words = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@vocab_hash = external dso_local global ptr, align 8
@vocab = external dso_local global ptr, align 8
@stdout = external global ptr, align 8
@train_file = external dso_local global [60 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ReadWord(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #2

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @SearchVocab(ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @AddWordToVocab(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @SortVocab() #0

; Function Attrs: nounwind uwtable
declare dso_local void @ReduceVocab() #0

declare i32 @fflush(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @LearnVocabFromTrainFile() #0 {
  %1 = alloca [60 x i8], align 16
  %2 = alloca [60 x i8], align 16
  %3 = alloca [120 x i8], align 16
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 60, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 60, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 1, ptr %7, align 8, !tbaa !5
  store i64 0, ptr %5, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %15, %0
  %9 = load i64, ptr %5, align 8, !tbaa !5
  %10 = icmp slt i64 %9, 500000000
  br i1 %10, label %11, label %18

11:                                               ; preds = %8
  %12 = load ptr, ptr @vocab_hash, align 8, !tbaa !9
  %13 = load i64, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds i32, ptr %12, i64 %13
  store i32 -1, ptr %14, align 4, !tbaa !11
  br label %15

15:                                               ; preds = %11
  %16 = load i64, ptr %5, align 8, !tbaa !5
  %17 = add nsw i64 %16, 1
  store i64 %17, ptr %5, align 8, !tbaa !5
  br label %8, !llvm.loop !13

18:                                               ; preds = %8
  %19 = call noalias ptr @fopen(ptr noundef @train_file, ptr noundef @.str.1)
  store ptr %19, ptr %4, align 8, !tbaa !9
  %20 = load ptr, ptr %4, align 8, !tbaa !9
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %18
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @exit(i32 noundef 1) #7
  unreachable

24:                                               ; preds = %18
  store i64 0, ptr @vocab_size, align 8, !tbaa !5
  %25 = call i32 @AddWordToVocab(ptr noundef @.str)
  br label %26

26:                                               ; preds = %116, %81, %38, %24
  br label %27

27:                                               ; preds = %26
  %28 = getelementptr inbounds [60 x i8], ptr %1, i64 0, i64 0
  %29 = load ptr, ptr %4, align 8, !tbaa !9
  call void @ReadWord(ptr noundef %28, ptr noundef %29)
  %30 = load ptr, ptr %4, align 8, !tbaa !9
  %31 = call i32 @feof(ptr noundef %30) #6
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %27
  br label %117

34:                                               ; preds = %27
  %35 = getelementptr inbounds [60 x i8], ptr %1, i64 0, i64 0
  %36 = call i32 @strcmp(ptr noundef %35, ptr noundef @.str) #8
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i64 1, ptr %7, align 8, !tbaa !5
  br label %26

39:                                               ; preds = %34
  store i64 0, ptr %7, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %39
  %41 = load i64, ptr @train_words, align 8, !tbaa !5
  %42 = add nsw i64 %41, 1
  store i64 %42, ptr @train_words, align 8, !tbaa !5
  %43 = load i32, ptr @debug_mode, align 4, !tbaa !11
  %44 = icmp sgt i32 %43, 1
  br i1 %44, label %45, label %57

45:                                               ; preds = %40
  %46 = load i64, ptr @train_words, align 8, !tbaa !5
  %47 = srem i64 %46, 100000
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %49, label %57

49:                                               ; preds = %45
  %50 = load i64, ptr @train_words, align 8, !tbaa !5
  %51 = sdiv i64 %50, 1000
  %52 = load i64, ptr @vocab_size, align 8, !tbaa !5
  %53 = sdiv i64 %52, 1000
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %51, i64 noundef %53, i32 noundef 13)
  %55 = load ptr, ptr @stdout, align 8, !tbaa !9
  %56 = call i32 @fflush(ptr noundef %55)
  br label %57

57:                                               ; preds = %49, %45, %40
  %58 = getelementptr inbounds [60 x i8], ptr %1, i64 0, i64 0
  %59 = call i32 @SearchVocab(ptr noundef %58)
  %60 = sext i32 %59 to i64
  store i64 %60, ptr %6, align 8, !tbaa !5
  %61 = load i64, ptr %6, align 8, !tbaa !5
  %62 = icmp eq i64 %61, -1
  br i1 %62, label %63, label %71

63:                                               ; preds = %57
  %64 = getelementptr inbounds [60 x i8], ptr %1, i64 0, i64 0
  %65 = call i32 @AddWordToVocab(ptr noundef %64)
  %66 = sext i32 %65 to i64
  store i64 %66, ptr %5, align 8, !tbaa !5
  %67 = load ptr, ptr @vocab, align 8, !tbaa !9
  %68 = load i64, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.vocab_word, ptr %67, i64 %68
  %70 = getelementptr inbounds %struct.vocab_word, ptr %69, i32 0, i32 0
  store i64 1, ptr %70, align 8, !tbaa !15
  br label %78

71:                                               ; preds = %57
  %72 = load ptr, ptr @vocab, align 8, !tbaa !9
  %73 = load i64, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.vocab_word, ptr %72, i64 %73
  %75 = getelementptr inbounds %struct.vocab_word, ptr %74, i32 0, i32 0
  %76 = load i64, ptr %75, align 8, !tbaa !15
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %75, align 8, !tbaa !15
  br label %78

78:                                               ; preds = %71, %63
  %79 = load i64, ptr %7, align 8, !tbaa !5
  %80 = icmp ne i64 %79, 0
  br i1 %80, label %81, label %82

81:                                               ; preds = %78
  br label %26

82:                                               ; preds = %78
  %83 = getelementptr inbounds [120 x i8], ptr %3, i64 0, i64 0
  %84 = getelementptr inbounds [60 x i8], ptr %2, i64 0, i64 0
  %85 = getelementptr inbounds [60 x i8], ptr %1, i64 0, i64 0
  %86 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %83, ptr noundef @.str.4, ptr noundef %84, ptr noundef %85) #6
  %87 = getelementptr inbounds [120 x i8], ptr %3, i64 0, i64 59
  store i8 0, ptr %87, align 1, !tbaa !17
  %88 = getelementptr inbounds [60 x i8], ptr %2, i64 0, i64 0
  %89 = getelementptr inbounds [60 x i8], ptr %1, i64 0, i64 0
  %90 = call ptr @strcpy(ptr noundef %88, ptr noundef %89) #6
  %91 = getelementptr inbounds [120 x i8], ptr %3, i64 0, i64 0
  %92 = call i32 @SearchVocab(ptr noundef %91)
  %93 = sext i32 %92 to i64
  store i64 %93, ptr %6, align 8, !tbaa !5
  %94 = load i64, ptr %6, align 8, !tbaa !5
  %95 = icmp eq i64 %94, -1
  br i1 %95, label %96, label %104

96:                                               ; preds = %82
  %97 = getelementptr inbounds [120 x i8], ptr %3, i64 0, i64 0
  %98 = call i32 @AddWordToVocab(ptr noundef %97)
  %99 = sext i32 %98 to i64
  store i64 %99, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr @vocab, align 8, !tbaa !9
  %101 = load i64, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.vocab_word, ptr %100, i64 %101
  %103 = getelementptr inbounds %struct.vocab_word, ptr %102, i32 0, i32 0
  store i64 1, ptr %103, align 8, !tbaa !15
  br label %111

104:                                              ; preds = %82
  %105 = load ptr, ptr @vocab, align 8, !tbaa !9
  %106 = load i64, ptr %6, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.vocab_word, ptr %105, i64 %106
  %108 = getelementptr inbounds %struct.vocab_word, ptr %107, i32 0, i32 0
  %109 = load i64, ptr %108, align 8, !tbaa !15
  %110 = add nsw i64 %109, 1
  store i64 %110, ptr %108, align 8, !tbaa !15
  br label %111

111:                                              ; preds = %104, %96
  %112 = load i64, ptr @vocab_size, align 8, !tbaa !5
  %113 = sitofp i64 %112 to double
  %114 = fcmp ogt double %113, 3.500000e+08
  br i1 %114, label %115, label %116

115:                                              ; preds = %111
  call void @ReduceVocab()
  br label %116

116:                                              ; preds = %115, %111
  br label %26

117:                                              ; preds = %33
  call void @SortVocab()
  %118 = load i32, ptr @debug_mode, align 4, !tbaa !11
  %119 = icmp sgt i32 %118, 0
  br i1 %119, label %120, label %125

120:                                              ; preds = %117
  %121 = load i64, ptr @vocab_size, align 8, !tbaa !5
  %122 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i64 noundef %121)
  %123 = load i64, ptr @train_words, align 8, !tbaa !5
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i64 noundef %123)
  br label %125

125:                                              ; preds = %120, %117
  %126 = load ptr, ptr %4, align 8, !tbaa !9
  %127 = call i32 @fclose(ptr noundef %126)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 60, ptr %1) #6
  ret void
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

declare i32 @fclose(ptr noundef) #4

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn 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 #6 = { nounwind }
attributes #7 = { noreturn nounwind }
attributes #8 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 0}
!16 = !{!"vocab_word", !6, i64 0, !10, i64 8}
!17 = !{!7, !7, i64 0}


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

%struct.vocab_word = type { i64, ptr }

@debug_mode = external dso_local local_unnamed_addr global i32, align 4
@vocab_size = external dso_local local_unnamed_addr global i64, align 8
@train_words = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@vocab_hash = external dso_local local_unnamed_addr global ptr, align 8
@vocab = external dso_local local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@train_file = external dso_local global [60 x i8], align 16
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @ReadWord(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nofree nounwind
declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @SearchVocab(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @AddWordToVocab(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @SortVocab() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ReduceVocab() local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @LearnVocabFromTrainFile() local_unnamed_addr #0 {
  %1 = alloca [60 x i8], align 16
  %2 = alloca [60 x i8], align 16
  %3 = alloca [120 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %3) #7
  %4 = load ptr, ptr @vocab_hash, align 8, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2000000000) %4, i8 -1, i64 2000000000, i1 false), !tbaa !9
  %5 = tail call noalias ptr @fopen(ptr noundef nonnull @train_file, ptr noundef nonnull @.str.1)
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %9

7:                                                ; preds = %0
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  tail call void @exit(i32 noundef 1) #8
  unreachable

9:                                                ; preds = %0
  store i64 0, ptr @vocab_size, align 8, !tbaa !11
  %10 = tail call i32 @AddWordToVocab(ptr noundef nonnull @.str)
  call void @ReadWord(ptr noundef nonnull %1, ptr noundef nonnull %5)
  %11 = call i32 @feof(ptr noundef nonnull %5) #7
  %.not19 = icmp eq i32 %11, 0
  br i1 %.not19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %9
  %12 = getelementptr inbounds i8, ptr %3, i64 59
  br label %13

13:                                               ; preds = %.lr.ph, %.backedge
  %14 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str) #9
  %.not16 = icmp eq i32 %14, 0
  br i1 %.not16, label %.backedge, label %15

15:                                               ; preds = %13
  %16 = load i64, ptr @train_words, align 8, !tbaa !11
  %17 = add nsw i64 %16, 1
  store i64 %17, ptr @train_words, align 8, !tbaa !11
  %18 = load i32, ptr @debug_mode, align 4, !tbaa !9
  %19 = icmp sgt i32 %18, 1
  %20 = srem i64 %17, 100000
  %21 = icmp eq i64 %20, 0
  %or.cond = select i1 %19, i1 %21, i1 false
  br i1 %or.cond, label %22, label %29

22:                                               ; preds = %15
  %23 = sdiv i64 %17, 1000
  %24 = load i64, ptr @vocab_size, align 8, !tbaa !11
  %25 = sdiv i64 %24, 1000
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %23, i64 noundef %25, i32 noundef 13)
  %27 = load ptr, ptr @stdout, align 8, !tbaa !5
  %28 = call i32 @fflush(ptr noundef %27)
  br label %29

29:                                               ; preds = %22, %15
  %30 = call i32 @SearchVocab(ptr noundef nonnull %1)
  %31 = icmp eq i32 %30, -1
  br i1 %31, label %32, label %37

32:                                               ; preds = %29
  %33 = call i32 @AddWordToVocab(ptr noundef nonnull %1)
  %34 = sext i32 %33 to i64
  %35 = load ptr, ptr @vocab, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.vocab_word, ptr %35, i64 %34
  store i64 1, ptr %36, align 8, !tbaa !13
  br label %43

37:                                               ; preds = %29
  %38 = sext i32 %30 to i64
  %39 = load ptr, ptr @vocab, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.vocab_word, ptr %39, i64 %38
  %41 = load i64, ptr %40, align 8, !tbaa !13
  %42 = add nsw i64 %41, 1
  store i64 %42, ptr %40, align 8, !tbaa !13
  br label %43

43:                                               ; preds = %32, %37
  %44 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %2, ptr noundef nonnull %1) #7
  store i8 0, ptr %12, align 1, !tbaa !15
  %45 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %1) #7
  %46 = call i32 @SearchVocab(ptr noundef nonnull %3)
  %47 = icmp eq i32 %46, -1
  br i1 %47, label %48, label %53

48:                                               ; preds = %43
  %49 = call i32 @AddWordToVocab(ptr noundef nonnull %3)
  %50 = sext i32 %49 to i64
  %51 = load ptr, ptr @vocab, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.vocab_word, ptr %51, i64 %50
  store i64 1, ptr %52, align 8, !tbaa !13
  br label %59

53:                                               ; preds = %43
  %54 = sext i32 %46 to i64
  %55 = load ptr, ptr @vocab, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.vocab_word, ptr %55, i64 %54
  %57 = load i64, ptr %56, align 8, !tbaa !13
  %58 = add nsw i64 %57, 1
  store i64 %58, ptr %56, align 8, !tbaa !13
  br label %59

59:                                               ; preds = %53, %48
  %60 = load i64, ptr @vocab_size, align 8, !tbaa !11
  %61 = icmp sgt i64 %60, 350000000
  br i1 %61, label %62, label %.backedge

62:                                               ; preds = %59
  call void @ReduceVocab()
  br label %.backedge

.backedge:                                        ; preds = %59, %62, %13
  call void @ReadWord(ptr noundef nonnull %1, ptr noundef nonnull %5)
  %63 = call i32 @feof(ptr noundef nonnull %5) #7
  %.not = icmp eq i32 %63, 0
  br i1 %.not, label %13, label %._crit_edge

._crit_edge:                                      ; preds = %.backedge, %9
  call void @SortVocab()
  %64 = load i32, ptr @debug_mode, align 4, !tbaa !9
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %71

66:                                               ; preds = %._crit_edge
  %67 = load i64, ptr @vocab_size, align 8, !tbaa !11
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %67)
  %69 = load i64, ptr @train_words, align 8, !tbaa !11
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %69)
  br label %71

71:                                               ; preds = %66, %._crit_edge
  %72 = call i32 @fclose(ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %1) #7
  ret void
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 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 #5 = { noreturn 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{!14, !12, i64 0}
!14 = !{!"vocab_word", !12, i64 0, !6, i64 8}
!15 = !{!7, !7, i64 0}


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