; LLVM IR from CLASS-SZ/class_sz :: class-sz/tools (parser)

; 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.file_content = type { ptr, i32, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@__func__.parser_read_file = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @parser_read_file(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [8192 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [1024 x i8], align 16
  %13 = alloca [1024 x i8], align 16
  %14 = alloca [2048 x i8], align 16
  %15 = alloca i32, align 4
  %16 = alloca [2048 x i8], align 16
  %17 = alloca [2048 x i8], align 16
  %18 = alloca [2048 x i8], align 16
  %19 = alloca [2048 x i8], align 16
  %20 = alloca [2048 x i8], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8192, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #4
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call noalias ptr @fopen(ptr noundef %21, ptr noundef @.str)
  store ptr %22, ptr %8, align 8, !tbaa !5
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %30

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2048, ptr %14) #4
  %26 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %26, ptr noundef @.str.1, ptr noundef @.str.2, ptr noundef %27, ptr noundef @.str.3)
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds [2048 x i8], ptr %14, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %28, ptr noundef @.str.4, ptr noundef @__func__.parser_read_file, i32 noundef 15, ptr noundef %29)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %14) #4
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %130

30:                                               ; preds = %3
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %54, %30
  %32 = getelementptr inbounds [8192 x i8], ptr %9, i64 0, i64 0
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = call ptr @fgets(ptr noundef %32, i32 noundef 8192, ptr noundef %33)
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %55

36:                                               ; preds = %31
  %37 = getelementptr inbounds [8192 x i8], ptr %9, i64 0, i64 0
  %38 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 0
  %39 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call i32 @parser_read_line(ptr noundef %37, ptr noundef %11, ptr noundef %38, ptr noundef %39, ptr noundef %40)
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %48

43:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 2048, ptr %16) #4
  %44 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %44, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef %45)
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %46, ptr noundef @.str.4, ptr noundef @__func__.parser_read_file, i32 noundef 19, ptr noundef %47)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %16) #4
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %130

48:                                               ; preds = %36
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 1
  br i1 %50, label %51, label %54

51:                                               ; preds = %48
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %10, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %51, %48
  br label %31, !llvm.loop !11

55:                                               ; preds = %31
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %65

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 2048, ptr %17) #4
  %59 = getelementptr inbounds [2048 x i8], ptr %17, i64 0, i64 0
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %59, ptr noundef @.str.7, ptr noundef %60)
  call void @llvm.lifetime.start.p0(i64 2048, ptr %18) #4
  %61 = getelementptr inbounds [2048 x i8], ptr %18, i64 0, i64 0
  %62 = getelementptr inbounds [2048 x i8], ptr %17, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %61, ptr noundef @.str.8, ptr noundef @.str.9, ptr noundef %62)
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = getelementptr inbounds [2048 x i8], ptr %18, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %63, ptr noundef @.str.4, ptr noundef @__func__.parser_read_file, i32 noundef 25, ptr noundef %64)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr %17) #4
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %130

65:                                               ; preds = %55
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = call i32 @parser_init(ptr noundef %66, i32 noundef %67, ptr noundef %68, ptr noundef %69)
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %72, label %77

72:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 2048, ptr %19) #4
  %73 = getelementptr inbounds [2048 x i8], ptr %19, i64 0, i64 0
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %73, ptr noundef @.str.5, ptr noundef @.str.10, ptr noundef %74)
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds [2048 x i8], ptr %19, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %75, ptr noundef @.str.4, ptr noundef @__func__.parser_read_file, i32 noundef 29, ptr noundef %76)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %19) #4
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %130

77:                                               ; preds = %65
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  call void @rewind(ptr noundef %78)
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %126, %77
  %80 = getelementptr inbounds [8192 x i8], ptr %9, i64 0, i64 0
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = call ptr @fgets(ptr noundef %80, i32 noundef 8192, ptr noundef %81)
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %127

84:                                               ; preds = %79
  %85 = getelementptr inbounds [8192 x i8], ptr %9, i64 0, i64 0
  %86 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 0
  %87 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = call i32 @parser_read_line(ptr noundef %85, ptr noundef %11, ptr noundef %86, ptr noundef %87, ptr noundef %88)
  %90 = icmp eq i32 %89, 1
  br i1 %90, label %91, label %96

91:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 2048, ptr %20) #4
  %92 = getelementptr inbounds [2048 x i8], ptr %20, i64 0, i64 0
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %92, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef %93)
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = getelementptr inbounds [2048 x i8], ptr %20, i64 0, i64 0
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %94, ptr noundef @.str.4, ptr noundef @__func__.parser_read_file, i32 noundef 35, ptr noundef %95)
  call void @llvm.lifetime.end.p0(i64 2048, ptr %20) #4
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %130

96:                                               ; preds = %84
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %126

99:                                               ; preds = %96
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.file_content, ptr %100, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !13
  %103 = load i32, ptr %10, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [1024 x i8], ptr %102, i64 %104
  %106 = getelementptr inbounds [1024 x i8], ptr %105, i64 0, i64 0
  %107 = getelementptr inbounds [1024 x i8], ptr %12, i64 0, i64 0
  %108 = call ptr @strcpy(ptr noundef %106, ptr noundef %107) #4
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.file_content, ptr %109, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !15
  %112 = load i32, ptr %10, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [1024 x i8], ptr %111, i64 %113
  %115 = getelementptr inbounds [1024 x i8], ptr %114, i64 0, i64 0
  %116 = getelementptr inbounds [1024 x i8], ptr %13, i64 0, i64 0
  %117 = call ptr @strcpy(ptr noundef %115, ptr noundef %116) #4
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.file_content, ptr %118, i32 0, i32 4
  %120 = load ptr, ptr %119, align 8, !tbaa !16
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds i16, ptr %120, i64 %122
  store i16 0, ptr %123, align 2, !tbaa !17
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %10, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %99, %96
  br label %79, !llvm.loop !19

127:                                              ; preds = %79
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = call i32 @fclose(ptr noundef %128)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %130

130:                                              ; preds = %127, %91, %72, %58, %43, %25
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8192, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  %131 = load i32, ptr %4, align 4
  ret i32 %131
}

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

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

declare void @class_protect_sprintf(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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

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

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

declare void @rewind(ptr noundef) #2

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

declare i32 @fclose(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 = { "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 "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 }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 16}
!14 = !{!"file_content", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!14, !6, i64 24}
!16 = !{!14, !6, i64 32}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !12}


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

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [13 x i8], align 1
@__func__.parser_read_file = external hidden unnamed_addr constant [17 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [41 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @parser_read_file(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [8192 x i8], align 16
  %5 = alloca i32, align 4
  %6 = alloca [1024 x i8], align 16
  %7 = alloca [1024 x i8], align 16
  %8 = alloca [2048 x i8], align 16
  %9 = alloca [2048 x i8], align 16
  %10 = alloca [2048 x i8], align 16
  %11 = alloca [2048 x i8], align 16
  %12 = alloca [2048 x i8], align 16
  %13 = alloca [2048 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %7) #5
  %14 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %15 = icmp eq ptr %14, null
  br i1 %15, label %17, label %.preheader

.preheader:                                       ; preds = %3
  %16 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 8192, ptr noundef nonnull %14)
  %.not35 = icmp eq ptr %16, null
  br i1 %.not35, label %._crit_edge.thread, label %.lr.ph

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %8) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %8, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, ptr noundef %0, ptr noundef nonnull @.str.3) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.parser_read_file, i32 noundef 15, ptr noundef nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %8) #5
  br label %57

.lr.ph:                                           ; preds = %.preheader, %21
  %.036 = phi i32 [ %spec.select, %21 ], [ 0, %.preheader ]
  %18 = call i32 @parser_read_line(ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef %2)
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %21

20:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %9) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %9, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef %2) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.parser_read_file, i32 noundef 19, ptr noundef nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %9) #5
  br label %57

21:                                               ; preds = %.lr.ph
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 1
  %24 = zext i1 %23 to i32
  %spec.select = add nuw nsw i32 %.036, %24
  %25 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 8192, ptr noundef nonnull %14)
  %.not = icmp eq ptr %25, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %21
  %26 = icmp eq i32 %spec.select, 0
  br i1 %26, label %._crit_edge.thread, label %27

._crit_edge.thread:                               ; preds = %.preheader, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %10) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %10, ptr noundef nonnull @.str.7, ptr noundef %0) #5
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %11) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %11, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, ptr noundef nonnull %10) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.parser_read_file, i32 noundef 25, ptr noundef nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %10) #5
  br label %57

27:                                               ; preds = %._crit_edge
  %28 = call i32 @parser_init(ptr noundef %1, i32 noundef %spec.select, ptr noundef %0, ptr noundef %2)
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %12) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %12, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.10, ptr noundef %2) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.parser_read_file, i32 noundef 29, ptr noundef nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %12) #5
  br label %57

31:                                               ; preds = %27
  call void @rewind(ptr noundef nonnull %14)
  %32 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 8192, ptr noundef nonnull %14)
  %.not3337 = icmp eq ptr %32, null
  br i1 %.not3337, label %._crit_edge41, label %.lr.ph40

.lr.ph40:                                         ; preds = %31
  %33 = getelementptr inbounds i8, ptr %1, i64 16
  %34 = getelementptr inbounds i8, ptr %1, i64 24
  %35 = getelementptr inbounds i8, ptr %1, i64 32
  br label %36

36:                                               ; preds = %.lr.ph40, %54
  %.238 = phi i32 [ 0, %.lr.ph40 ], [ %.3, %54 ]
  %37 = call i32 @parser_read_line(ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef %2)
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %13) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef nonnull %13, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef %2) #5
  call void (ptr, ptr, ...) @class_protect_sprintf(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef nonnull @__func__.parser_read_file, i32 noundef 35, ptr noundef nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %13) #5
  br label %57

40:                                               ; preds = %36
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp eq i32 %41, 1
  br i1 %42, label %43, label %54

43:                                               ; preds = %40
  %44 = load ptr, ptr %33, align 8, !tbaa !11
  %45 = sext i32 %.238 to i64
  %46 = getelementptr inbounds [1024 x i8], ptr %44, i64 %45
  %47 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %46, ptr noundef nonnull dereferenceable(1) %6) #5
  %48 = load ptr, ptr %34, align 8, !tbaa !14
  %49 = getelementptr inbounds [1024 x i8], ptr %48, i64 %45
  %50 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %49, ptr noundef nonnull dereferenceable(1) %7) #5
  %51 = load ptr, ptr %35, align 8, !tbaa !15
  %52 = getelementptr inbounds i16, ptr %51, i64 %45
  store i16 0, ptr %52, align 2, !tbaa !16
  %53 = add nsw i32 %.238, 1
  br label %54

54:                                               ; preds = %43, %40
  %.3 = phi i32 [ %53, %43 ], [ %.238, %40 ]
  %55 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 8192, ptr noundef nonnull %14)
  %.not33 = icmp eq ptr %55, null
  br i1 %.not33, label %._crit_edge41, label %36, !llvm.loop !18

._crit_edge41:                                    ; preds = %54, %31
  %56 = call i32 @fclose(ptr noundef nonnull %14)
  br label %57

57:                                               ; preds = %._crit_edge41, %39, %30, %._crit_edge.thread, %20, %17
  %.031 = phi i32 [ 1, %17 ], [ 1, %20 ], [ 1, %._crit_edge.thread ], [ 1, %30 ], [ 1, %39 ], [ 0, %._crit_edge41 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %4) #5
  ret i32 %.031
}

; 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 noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

declare void @class_protect_sprintf(ptr noundef, ptr noundef, ...) 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: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare void @rewind(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 #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) 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 = { "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: 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 #5 = { 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/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 16}
!12 = !{!"file_content", !13, i64 0, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!12, !13, i64 24}
!15 = !{!12, !13, i64 32}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !10}


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