; 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
@min_count = external dso_local global i32, align 4
@train_words = external dso_local global i64, align 8
@threshold = external dso_local global float, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@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.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@output_file = external dso_local global [60 x i8], align 16
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 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

declare i32 @fflush(ptr noundef) #4

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

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

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

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

declare i32 @fclose(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @TrainModel() #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca [60 x i8], align 16
  %9 = alloca [60 x i8], align 16
  %10 = alloca [120 x i8], align 16
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #5
  store i64 0, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store i64 0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 -1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 60, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 60, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 120, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef @train_file)
  call void @LearnVocabFromTrainFile()
  %15 = call noalias ptr @fopen(ptr noundef @train_file, ptr noundef @.str.1)
  store ptr %15, ptr %13, align 8, !tbaa !9
  %16 = call noalias ptr @fopen(ptr noundef @output_file, ptr noundef @.str.8)
  store ptr %16, ptr %12, align 8, !tbaa !9
  %17 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  store i8 0, ptr %17, align 16, !tbaa !11
  br label %18

18:                                               ; preds = %130, %33, %0
  br label %19

19:                                               ; preds = %18
  %20 = getelementptr inbounds [60 x i8], ptr %9, i64 0, i64 0
  %21 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %22 = call ptr @strcpy(ptr noundef %20, ptr noundef %21) #5
  %23 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %24 = load ptr, ptr %13, align 8, !tbaa !9
  call void @ReadWord(ptr noundef %23, ptr noundef %24)
  %25 = load ptr, ptr %13, align 8, !tbaa !9
  %26 = call i32 @feof(ptr noundef %25) #5
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %19
  br label %132

29:                                               ; preds = %19
  %30 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %31 = call i32 @strcmp(ptr noundef %30, ptr noundef @.str) #6
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %36, label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr %12, align 8, !tbaa !9
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.9) #5
  br label %18

36:                                               ; preds = %29
  %37 = load i64, ptr %7, align 8, !tbaa !5
  %38 = add nsw i64 %37, 1
  store i64 %38, ptr %7, align 8, !tbaa !5
  %39 = load i32, ptr @debug_mode, align 4, !tbaa !12
  %40 = icmp sgt i32 %39, 1
  br i1 %40, label %41, label %51

41:                                               ; preds = %36
  %42 = load i64, ptr %7, align 8, !tbaa !5
  %43 = srem i64 %42, 100000
  %44 = icmp eq i64 %43, 0
  br i1 %44, label %45, label %51

45:                                               ; preds = %41
  %46 = load i64, ptr %7, align 8, !tbaa !5
  %47 = sdiv i64 %46, 1000
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i64 noundef %47, i32 noundef 13)
  %49 = load ptr, ptr @stdout, align 8, !tbaa !9
  %50 = call i32 @fflush(ptr noundef %49)
  br label %51

51:                                               ; preds = %45, %41, %36
  store i64 0, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %53 = call i32 @SearchVocab(ptr noundef %52)
  %54 = sext i32 %53 to i64
  store i64 %54, ptr %5, align 8, !tbaa !5
  %55 = load i64, ptr %5, align 8, !tbaa !5
  %56 = icmp eq i64 %55, -1
  br i1 %56, label %57, label %58

57:                                               ; preds = %51
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %64

58:                                               ; preds = %51
  %59 = load ptr, ptr @vocab, align 8, !tbaa !9
  %60 = load i64, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.vocab_word, ptr %59, i64 %60
  %62 = getelementptr inbounds %struct.vocab_word, ptr %61, i32 0, i32 0
  %63 = load i64, ptr %62, align 8, !tbaa !14
  store i64 %63, ptr %2, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %58, %57
  %65 = load i64, ptr %6, align 8, !tbaa !5
  %66 = icmp eq i64 %65, -1
  br i1 %66, label %67, label %68

67:                                               ; preds = %64
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %67, %64
  %69 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %69, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds [120 x i8], ptr %10, i64 0, i64 0
  %71 = getelementptr inbounds [60 x i8], ptr %9, i64 0, i64 0
  %72 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %73 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %70, ptr noundef @.str.4, ptr noundef %71, ptr noundef %72) #5
  %74 = getelementptr inbounds [120 x i8], ptr %10, i64 0, i64 59
  store i8 0, ptr %74, align 1, !tbaa !11
  %75 = getelementptr inbounds [120 x i8], ptr %10, i64 0, i64 0
  %76 = call i32 @SearchVocab(ptr noundef %75)
  %77 = sext i32 %76 to i64
  store i64 %77, ptr %5, align 8, !tbaa !5
  %78 = load i64, ptr %5, align 8, !tbaa !5
  %79 = icmp eq i64 %78, -1
  br i1 %79, label %80, label %81

80:                                               ; preds = %68
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %87

81:                                               ; preds = %68
  %82 = load ptr, ptr @vocab, align 8, !tbaa !9
  %83 = load i64, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.vocab_word, ptr %82, i64 %83
  %85 = getelementptr inbounds %struct.vocab_word, ptr %84, i32 0, i32 0
  %86 = load i64, ptr %85, align 8, !tbaa !14
  store i64 %86, ptr %3, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %81, %80
  %88 = load i64, ptr %1, align 8, !tbaa !5
  %89 = load i32, ptr @min_count, align 4, !tbaa !12
  %90 = sext i32 %89 to i64
  %91 = icmp slt i64 %88, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %87
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %93

93:                                               ; preds = %92, %87
  %94 = load i64, ptr %2, align 8, !tbaa !5
  %95 = load i32, ptr @min_count, align 4, !tbaa !12
  %96 = sext i32 %95 to i64
  %97 = icmp slt i64 %94, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %93
  store i64 1, ptr %4, align 8, !tbaa !5
  br label %99

99:                                               ; preds = %98, %93
  %100 = load i64, ptr %4, align 8, !tbaa !5
  %101 = icmp ne i64 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  store float 0.000000e+00, ptr %11, align 4, !tbaa !16
  br label %118

103:                                              ; preds = %99
  %104 = load i64, ptr %3, align 8, !tbaa !5
  %105 = load i32, ptr @min_count, align 4, !tbaa !12
  %106 = sext i32 %105 to i64
  %107 = sub nsw i64 %104, %106
  %108 = sitofp i64 %107 to float
  %109 = load i64, ptr %1, align 8, !tbaa !5
  %110 = sitofp i64 %109 to float
  %111 = fdiv float %108, %110
  %112 = load i64, ptr %2, align 8, !tbaa !5
  %113 = sitofp i64 %112 to float
  %114 = fdiv float %111, %113
  %115 = load i64, ptr @train_words, align 8, !tbaa !5
  %116 = sitofp i64 %115 to float
  %117 = fmul float %114, %116
  store float %117, ptr %11, align 4, !tbaa !16
  br label %118

118:                                              ; preds = %103, %102
  %119 = load float, ptr %11, align 4, !tbaa !16
  %120 = load float, ptr @threshold, align 4, !tbaa !16
  %121 = fcmp ogt float %119, %120
  br i1 %121, label %122, label %126

122:                                              ; preds = %118
  %123 = load ptr, ptr %12, align 8, !tbaa !9
  %124 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.11, ptr noundef %124) #5
  store i64 0, ptr %2, align 8, !tbaa !5
  br label %130

126:                                              ; preds = %118
  %127 = load ptr, ptr %12, align 8, !tbaa !9
  %128 = getelementptr inbounds [60 x i8], ptr %8, i64 0, i64 0
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.12, ptr noundef %128) #5
  br label %130

130:                                              ; preds = %126, %122
  %131 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %131, ptr %1, align 8, !tbaa !5
  br label %18

132:                                              ; preds = %28
  %133 = load ptr, ptr %12, align 8, !tbaa !9
  %134 = call i32 @fclose(ptr noundef %133)
  %135 = load ptr, ptr %13, align 8, !tbaa !9
  %136 = call i32 @fclose(ptr noundef %135)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 60, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 60, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #5
  ret void
}

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

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 = { nounwind }
attributes #6 = { 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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"vocab_word", !6, i64 0, !10, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !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
@min_count = external dso_local local_unnamed_addr global i32, align 4
@train_words = external dso_local local_unnamed_addr global i64, align 8
@threshold = external dso_local local_unnamed_addr global float, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@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.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@output_file = external dso_local global [60 x i8], align 16
@.str.8 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 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: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

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

; 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: 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: nounwind uwtable
define dso_local void @TrainModel() 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) #5
  call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %3) #5
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @train_file)
  tail call void @LearnVocabFromTrainFile()
  %5 = tail call noalias ptr @fopen(ptr noundef nonnull @train_file, ptr noundef nonnull @.str.1)
  %6 = tail call noalias ptr @fopen(ptr noundef nonnull @output_file, ptr noundef nonnull @.str.8)
  store i8 0, ptr %1, align 16, !tbaa !5
  %7 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %1) #5
  call void @ReadWord(ptr noundef nonnull %1, ptr noundef %5)
  %8 = call i32 @feof(ptr noundef %5) #5
  %.not4243 = icmp eq i32 %8, 0
  br i1 %.not4243, label %.lr.ph.lr.ph, label %.outer._crit_edge

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

.lr.ph:                                           ; preds = %.lr.ph.lr.ph, %.thread
  %.0.ph48 = phi i64 [ 0, %.lr.ph.lr.ph ], [ %..1, %.thread ]
  %.025.ph46 = phi i64 [ 0, %.lr.ph.lr.ph ], [ %17, %.thread ]
  %.026.ph45 = phi i64 [ -1, %.lr.ph.lr.ph ], [ %29, %.thread ]
  br label %10

10:                                               ; preds = %.lr.ph, %12
  %11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str) #6
  %.not34 = icmp eq i32 %11, 0
  br i1 %.not34, label %12, label %16

12:                                               ; preds = %10
  %13 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.9) #5
  %14 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %1) #5
  call void @ReadWord(ptr noundef nonnull %1, ptr noundef %5)
  %15 = call i32 @feof(ptr noundef %5) #5
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %10, label %.outer._crit_edge

16:                                               ; preds = %10
  %17 = add nuw nsw i64 %.025.ph46, 1
  %18 = load i32, ptr @debug_mode, align 4, !tbaa !8
  %19 = icmp sgt i32 %18, 1
  %20 = urem 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 %27

22:                                               ; preds = %16
  %23 = udiv i64 %17, 1000
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef %23, i32 noundef 13)
  %25 = load ptr, ptr @stdout, align 8, !tbaa !10
  %26 = call i32 @fflush(ptr noundef %25)
  br label %27

27:                                               ; preds = %22, %16
  %28 = call i32 @SearchVocab(ptr noundef nonnull %1)
  %29 = sext i32 %28 to i64
  %30 = icmp ne i32 %28, -1
  br i1 %30, label %31, label %35

31:                                               ; preds = %27
  %32 = load ptr, ptr @vocab, align 8, !tbaa !10
  %33 = getelementptr inbounds %struct.vocab_word, ptr %32, i64 %29
  %34 = load i64, ptr %33, align 8, !tbaa !12
  br label %35

35:                                               ; preds = %27, %31
  %.1 = phi i64 [ %34, %31 ], [ %.0.ph48, %27 ]
  %36 = 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) #5
  store i8 0, ptr %9, align 1, !tbaa !5
  %37 = call i32 @SearchVocab(ptr noundef nonnull %3)
  %38 = icmp eq i32 %37, -1
  br i1 %38, label %.thread, label %39

39:                                               ; preds = %35
  %40 = icmp ne i64 %.026.ph45, -1
  %41 = load i32, ptr @min_count, align 4, !tbaa !8
  %42 = sext i32 %41 to i64
  %43 = icmp sge i64 %.0.ph48, %42
  %44 = icmp sge i64 %.1, %42
  %.not41 = select i1 %44, i1 %43, i1 false
  %45 = and i1 %40, %.not41
  %.not35 = and i1 %45, %30
  br i1 %.not35, label %46, label %.thread

46:                                               ; preds = %39
  %47 = load ptr, ptr @vocab, align 8, !tbaa !10
  %48 = sext i32 %37 to i64
  %49 = getelementptr inbounds %struct.vocab_word, ptr %47, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !12
  %51 = sub nsw i64 %50, %42
  %52 = sitofp i64 %51 to float
  %53 = sitofp i64 %.0.ph48 to float
  %54 = fdiv float %52, %53
  %55 = sitofp i64 %.1 to float
  %56 = fdiv float %54, %55
  %57 = load i64, ptr @train_words, align 8, !tbaa !15
  %58 = sitofp i64 %57 to float
  %59 = fmul float %56, %58
  br label %.thread

.thread:                                          ; preds = %35, %39, %46
  %.024 = phi float [ %59, %46 ], [ 0.000000e+00, %39 ], [ 0.000000e+00, %35 ]
  %60 = load float, ptr @threshold, align 4, !tbaa !16
  %61 = fcmp ogt float %.024, %60
  %.str.11..str.12 = select i1 %61, ptr @.str.11, ptr @.str.12
  %..1 = select i1 %61, i64 0, i64 %.1
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull %.str.11..str.12, ptr noundef nonnull %1) #5
  %63 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %1) #5
  call void @ReadWord(ptr noundef nonnull %1, ptr noundef %5)
  %64 = call i32 @feof(ptr noundef %5) #5
  %.not42 = icmp eq i32 %64, 0
  br i1 %.not42, label %.lr.ph, label %.outer._crit_edge

.outer._crit_edge:                                ; preds = %.thread, %12, %0
  %65 = call i32 @fclose(ptr noundef %6)
  %66 = call i32 @fclose(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %1) #5
  ret void
}

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

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 = { nounwind }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"vocab_word", !14, i64 0, !11, i64 8}
!14 = !{!"long long", !6, i64 0}
!15 = !{!14, !14, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !6, i64 0}


; Effective O3 passes: ADCEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass