; LLVM IR from JessonYue/LeetCodeLearning :: Array/zhangjunwei/7.13-7.18 (database)

; 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.person = type { i32, [20 x i8] }

@.str = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @compareperson(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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

20:                                               ; preds = %0
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %148

22:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !11
  br label %23

23:                                               ; preds = %27, %22
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i64 @getline(ptr noundef %6, ptr noundef %7, ptr noundef %24)
  store i64 %25, ptr %8, align 8, !tbaa !9
  %26 = icmp ne i64 %25, -1
  br i1 %26, label %27, label %30

27:                                               ; preds = %23
  %28 = load i32, ptr %9, align 4, !tbaa !11
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %9, align 4, !tbaa !11
  br label %23, !llvm.loop !13

30:                                               ; preds = %23
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %32 = load i32, ptr %9, align 4, !tbaa !11
  %33 = sext i32 %32 to i64
  %34 = mul i64 24, %33
  %35 = call noalias ptr @malloc(i64 noundef %34) #7
  store ptr %35, ptr %10, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %42

38:                                               ; preds = %30
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call i32 @fclose(ptr noundef %40)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %147

42:                                               ; preds = %30
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  %44 = load i32, ptr %9, align 4, !tbaa !11
  %45 = sext i32 %44 to i64
  %46 = mul i64 24, %45
  call void @llvm.memset.p0.i64(ptr align 4 %43, i8 0, i64 %46, i1 false)
  br label %47

47:                                               ; preds = %42
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = call i32 @fseek(ptr noundef %48, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %50, ptr %12, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %56, %47
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call i32 @feof(ptr noundef %52) #6
  %54 = icmp ne i32 %53, 0
  %55 = xor i1 %54, true
  br i1 %55, label %56, label %66

56:                                               ; preds = %51
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.person, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.person, ptr %60, i32 0, i32 1
  %62 = getelementptr inbounds [20 x i8], ptr %61, i64 0, i64 0
  %63 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %57, ptr noundef @.str.6, ptr noundef %59, ptr noundef %62)
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.person, ptr %64, i32 1
  store ptr %65, ptr %12, align 8, !tbaa !5
  br label %51, !llvm.loop !15

66:                                               ; preds = %51
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = call i32 @fclose(ptr noundef %67)
  store ptr null, ptr %4, align 8, !tbaa !5
  %69 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %70, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %71

71:                                               ; preds = %87, %66
  %72 = load i32, ptr %13, align 4, !tbaa !11
  %73 = load i32, ptr %9, align 4, !tbaa !11
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 6, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %90

76:                                               ; preds = %71
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.person, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !16
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %79)
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.person, ptr %81, i32 0, i32 1
  %83 = getelementptr inbounds [20 x i8], ptr %82, i64 0, i64 0
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %83)
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.person, ptr %85, i32 1
  store ptr %86, ptr %12, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %76
  %88 = load i32, ptr %13, align 4, !tbaa !11
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %13, align 4, !tbaa !11
  br label %71, !llvm.loop !18

90:                                               ; preds = %75
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %92, ptr %12, align 8, !tbaa !5
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !11
  %95 = sext i32 %94 to i64
  call void @qsort(ptr noundef %93, i64 noundef %95, i64 noundef 24, ptr noundef @compareperson)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %96

96:                                               ; preds = %112, %90
  %97 = load i32, ptr %14, align 4, !tbaa !11
  %98 = load i32, ptr %9, align 4, !tbaa !11
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 9, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %115

101:                                              ; preds = %96
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.person, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 4, !tbaa !16
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %104)
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.person, ptr %106, i32 0, i32 1
  %108 = getelementptr inbounds [20 x i8], ptr %107, i64 0, i64 0
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %108)
  %110 = load ptr, ptr %12, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.person, ptr %110, i32 1
  store ptr %111, ptr %12, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %101
  %113 = load i32, ptr %14, align 4, !tbaa !11
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %14, align 4, !tbaa !11
  br label %96, !llvm.loop !19

115:                                              ; preds = %100
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = call noalias ptr @fopen(ptr noundef %116, ptr noundef @.str.10)
  store ptr %117, ptr %4, align 8, !tbaa !5
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = icmp eq ptr %118, null
  br i1 %119, label %120, label %122

120:                                              ; preds = %115
  %121 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %146

122:                                              ; preds = %115
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %123, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !11
  br label %124

124:                                              ; preds = %140, %122
  %125 = load i32, ptr %15, align 4, !tbaa !11
  %126 = load i32, ptr %9, align 4, !tbaa !11
  %127 = icmp slt i32 %125, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %124
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %143

129:                                              ; preds = %124
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load ptr, ptr %12, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.person, ptr %131, i32 0, i32 0
  %133 = load i32, ptr %132, align 4, !tbaa !16
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.person, ptr %134, i32 0, i32 1
  %136 = getelementptr inbounds [20 x i8], ptr %135, i64 0, i64 0
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.12, i32 noundef %133, ptr noundef %136) #6
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.person, ptr %138, i32 1
  store ptr %139, ptr %12, align 8, !tbaa !5
  br label %140

140:                                              ; preds = %129
  %141 = load i32, ptr %15, align 4, !tbaa !11
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %15, align 4, !tbaa !11
  br label %124, !llvm.loop !20

143:                                              ; preds = %128
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = call i32 @fclose(ptr noundef %144)
  store ptr null, ptr %4, align 8, !tbaa !5
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %146

146:                                              ; preds = %143, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %147

147:                                              ; preds = %146, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %148

148:                                              ; preds = %147, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %149 = load i32, ptr %1, align 4
  ret i32 %149
}

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

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

declare i64 @getline(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

declare i32 @fclose(ptr noundef) #2

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

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #2

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

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 allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 = { nounwind allocsize(0) }

!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 = !{!"long", !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 = !{!17, !12, i64 0}
!17 = !{!"person", !12, i64 0, !7, i64 4}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !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"

@.str = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [54 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @compareperson(ptr noundef, ptr noundef) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca ptr, align 8
  %2 = alloca i64, align 8
  %3 = tail call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2)
  %4 = icmp eq ptr %3, null
  br i1 %4, label %5, label %7

5:                                                ; preds = %0
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %56

7:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store ptr null, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i64 0, ptr %2, align 8, !tbaa !9
  br label %8

8:                                                ; preds = %8, %7
  %.050 = phi i32 [ 0, %7 ], [ %10, %8 ]
  %9 = call i64 @getline(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %.not = icmp eq i64 %9, -1
  %10 = add nuw nsw i32 %.050, 1
  br i1 %.not, label %11, label %8, !llvm.loop !11

11:                                               ; preds = %8
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %13 = zext nneg i32 %.050 to i64
  %14 = mul nuw nsw i64 %13, 24
  %calloc = call ptr @calloc(i64 1, i64 %14)
  %15 = icmp eq ptr %calloc, null
  br i1 %15, label %16, label %19

16:                                               ; preds = %11
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %18 = call i32 @fclose(ptr noundef nonnull %3)
  br label %55

19:                                               ; preds = %11
  %20 = call i32 @fseek(ptr noundef nonnull %3, i64 noundef 0, i32 noundef 0)
  %21 = call i32 @feof(ptr noundef nonnull %3) #6
  %.not5455 = icmp eq i32 %21, 0
  br i1 %.not5455, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19, %.lr.ph
  %.04656 = phi ptr [ %24, %.lr.ph ], [ %calloc, %19 ]
  %22 = getelementptr inbounds i8, ptr %.04656, i64 4
  %23 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.6, ptr noundef nonnull %.04656, ptr noundef nonnull %22) #6
  %24 = getelementptr inbounds i8, ptr %.04656, i64 24
  %25 = call i32 @feof(ptr noundef nonnull %3) #6
  %.not54 = icmp eq i32 %25, 0
  br i1 %.not54, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %19
  %26 = call i32 @fclose(ptr noundef nonnull %3)
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  %.not71 = icmp eq i32 %.050, 0
  br i1 %.not71, label %._crit_edge66.thread.critedge, label %.lr.ph60

._crit_edge61:                                    ; preds = %.lr.ph60
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @qsort(ptr noundef nonnull %calloc, i64 noundef %13, i64 noundef 24, ptr noundef nonnull @compareperson) #6
  br label %.lr.ph65

.lr.ph60:                                         ; preds = %._crit_edge, %.lr.ph60
  %.04558 = phi i32 [ %34, %.lr.ph60 ], [ 0, %._crit_edge ]
  %.157 = phi ptr [ %33, %.lr.ph60 ], [ %calloc, %._crit_edge ]
  %29 = load i32, ptr %.157, align 4, !tbaa !14
  %30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %29)
  %31 = getelementptr inbounds i8, ptr %.157, i64 4
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef nonnull %31)
  %33 = getelementptr inbounds i8, ptr %.157, i64 24
  %34 = add nuw nsw i32 %.04558, 1
  %exitcond.not = icmp eq i32 %34, %.050
  br i1 %exitcond.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !17

._crit_edge66:                                    ; preds = %.lr.ph65
  %35 = call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.10)
  %36 = icmp eq ptr %35, null
  br i1 %36, label %46, label %.lr.ph69

._crit_edge66.thread.critedge:                    ; preds = %._crit_edge
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @qsort(ptr noundef nonnull %calloc, i64 noundef %13, i64 noundef 24, ptr noundef nonnull @compareperson) #6
  %38 = call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.10)
  %39 = icmp eq ptr %38, null
  br i1 %39, label %46, label %._crit_edge70

.lr.ph65:                                         ; preds = %._crit_edge61, %.lr.ph65
  %.04463 = phi i32 [ %45, %.lr.ph65 ], [ 0, %._crit_edge61 ]
  %.262 = phi ptr [ %44, %.lr.ph65 ], [ %calloc, %._crit_edge61 ]
  %40 = load i32, ptr %.262, align 4, !tbaa !14
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %40)
  %42 = getelementptr inbounds i8, ptr %.262, i64 4
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef nonnull %42)
  %44 = getelementptr inbounds i8, ptr %.262, i64 24
  %45 = add nuw nsw i32 %.04463, 1
  %exitcond76.not = icmp eq i32 %45, %.050
  br i1 %exitcond76.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !18

46:                                               ; preds = %._crit_edge66.thread.critedge, %._crit_edge66
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %55

._crit_edge70:                                    ; preds = %.lr.ph69, %._crit_edge66.thread.critedge
  %48 = phi ptr [ %38, %._crit_edge66.thread.critedge ], [ %35, %.lr.ph69 ]
  %49 = call i32 @fclose(ptr noundef nonnull %48)
  br label %55

.lr.ph69:                                         ; preds = %._crit_edge66, %.lr.ph69
  %.068 = phi i32 [ %54, %.lr.ph69 ], [ 0, %._crit_edge66 ]
  %.367 = phi ptr [ %53, %.lr.ph69 ], [ %calloc, %._crit_edge66 ]
  %50 = load i32, ptr %.367, align 4, !tbaa !14
  %51 = getelementptr inbounds i8, ptr %.367, i64 4
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %35, ptr noundef nonnull @.str.12, i32 noundef %50, ptr noundef nonnull %51) #6
  %53 = getelementptr inbounds i8, ptr %.367, i64 24
  %54 = add nuw nsw i32 %.068, 1
  %exitcond78.not = icmp eq i32 %54, %.050
  br i1 %exitcond78.not, label %._crit_edge70, label %.lr.ph69, !llvm.loop !19

55:                                               ; preds = %46, %._crit_edge70, %16
  %.148 = phi i32 [ 1, %16 ], [ 1, %46 ], [ 0, %._crit_edge70 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  br label %56

56:                                               ; preds = %55, %5
  %.249 = phi i32 [ 1, %5 ], [ %.148, %55 ]
  ret i32 %.249
}

; 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

declare i64 @getline(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

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

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

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 = { nofree "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 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !16, i64 0}
!15 = !{!"person", !16, i64 0, !7, i64 4}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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