; LLVM IR from JessonYue/LeetCodeLearning :: Array/zhanchengguo/homework/db操作 (dbOperation)

; 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, [30 x i8] }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @compare(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 i32, align 4
  %13 = alloca i32, align 4
  %14 = 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
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call noalias ptr @fopen(ptr noundef %15, ptr noundef @.str.2)
  store ptr %16, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %21

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

21:                                               ; 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 %22

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

26:                                               ; preds = %22
  %27 = load i64, ptr %8, align 8, !tbaa !9
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %27)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %29)
  %31 = load i32, ptr %9, align 4, !tbaa !11
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %9, align 4, !tbaa !11
  br label %22, !llvm.loop !13

33:                                               ; preds = %22
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %35 = load i32, ptr %9, align 4, !tbaa !11
  %36 = sext i32 %35 to i64
  %37 = mul i64 36, %36
  %38 = call noalias ptr @malloc(i64 noundef %37) #7
  store ptr %38, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = load i32, ptr %9, align 4, !tbaa !11
  %41 = sext i32 %40 to i64
  %42 = mul i64 36, %41
  call void @llvm.memset.p0.i64(ptr align 4 %39, i8 0, i64 %42, i1 false)
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = call i32 @fseek(ptr noundef %43, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %45, ptr %11, align 8, !tbaa !5
  br label %46

46:                                               ; preds = %51, %33
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = call i32 @feof(ptr noundef %47) #6
  %49 = icmp ne i32 %48, 0
  %50 = xor i1 %49, true
  br i1 %50, label %51, label %61

51:                                               ; preds = %46
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Person, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Person, ptr %55, i32 0, i32 1
  %57 = getelementptr inbounds [30 x i8], ptr %56, i64 0, i64 0
  %58 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %52, ptr noundef @.str.7, ptr noundef %54, ptr noundef %57)
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.Person, ptr %59, i32 1
  store ptr %60, ptr %11, align 8, !tbaa !5
  br label %46, !llvm.loop !15

61:                                               ; preds = %46
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = call i32 @fclose(ptr noundef %62)
  store ptr null, ptr %4, align 8, !tbaa !5
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %65, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %66

66:                                               ; preds = %81, %61
  %67 = load i32, ptr %12, align 4, !tbaa !11
  %68 = load i32, ptr %9, align 4, !tbaa !11
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

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

71:                                               ; preds = %66
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Person, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 4, !tbaa !16
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Person, ptr %75, i32 0, i32 1
  %77 = getelementptr inbounds [30 x i8], ptr %76, i64 0, i64 0
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %74, ptr noundef %77)
  %79 = load ptr, ptr %11, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Person, ptr %79, i32 1
  store ptr %80, ptr %11, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %71
  %82 = load i32, ptr %12, align 4, !tbaa !11
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %12, align 4, !tbaa !11
  br label %66, !llvm.loop !18

84:                                               ; preds = %70
  %85 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %85, ptr %11, align 8, !tbaa !5
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  call void @qsort(ptr noundef %86, i64 noundef %88, i64 noundef 36, ptr noundef @compare)
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %90

90:                                               ; preds = %105, %84
  %91 = load i32, ptr %13, align 4, !tbaa !11
  %92 = load i32, ptr %9, align 4, !tbaa !11
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %95, label %94

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

95:                                               ; preds = %90
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Person, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 4, !tbaa !16
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Person, ptr %99, i32 0, i32 1
  %101 = getelementptr inbounds [30 x i8], ptr %100, i64 0, i64 0
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %98, ptr noundef %101)
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.Person, ptr %103, i32 1
  store ptr %104, ptr %11, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %95
  %106 = load i32, ptr %13, align 4, !tbaa !11
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %13, align 4, !tbaa !11
  br label %90, !llvm.loop !19

108:                                              ; preds = %94
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = call noalias ptr @fopen(ptr noundef %109, ptr noundef @.str.11)
  store ptr %110, ptr %4, align 8, !tbaa !5
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = icmp eq ptr %111, null
  br i1 %112, label %113, label %115

113:                                              ; preds = %108
  %114 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %5, align 4
  br label %139

115:                                              ; preds = %108
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %116, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %117

117:                                              ; preds = %133, %115
  %118 = load i32, ptr %14, align 4, !tbaa !11
  %119 = load i32, ptr %9, align 4, !tbaa !11
  %120 = icmp slt i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  store i32 12, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %136

122:                                              ; preds = %117
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.Person, ptr %124, i32 0, i32 0
  %126 = load i32, ptr %125, align 4, !tbaa !16
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Person, ptr %127, i32 0, i32 1
  %129 = getelementptr inbounds [30 x i8], ptr %128, i64 0, i64 0
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.12, i32 noundef %126, ptr noundef %129) #6
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.Person, ptr %131, i32 1
  store ptr %132, ptr %11, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %122
  %134 = load i32, ptr %14, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %14, align 4, !tbaa !11
  br label %117, !llvm.loop !20

136:                                              ; preds = %121
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = call i32 @fclose(ptr noundef %137)
  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 %139

139:                                              ; preds = %136, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  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 %140

140:                                              ; preds = %139, %19
  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
  %141 = load i32, ptr %1, align 4
  ret i32 %141
}

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

; 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 i32 @fclose(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 [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @compare(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 -1, 1) 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 %52

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
  %8 = call i64 @getline(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %.not53 = icmp eq i64 %8, -1
  br i1 %.not53, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %7, %.lr.ph
  %9 = phi i64 [ %14, %.lr.ph ], [ %8, %7 ]
  %.04854 = phi i32 [ %13, %.lr.ph ], [ 0, %7 ]
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %9)
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %11)
  %13 = add nuw nsw i32 %.04854, 1
  %14 = call i64 @getline(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3) #6
  %.not = icmp eq i64 %14, -1
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %7
  %.048.lcssa = phi i32 [ 0, %7 ], [ %13, %.lr.ph ]
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %16 = zext nneg i32 %.048.lcssa to i64
  %17 = mul nuw nsw i64 %16, 36
  %calloc = call ptr @calloc(i64 1, i64 %17)
  %18 = call i32 @fseek(ptr noundef nonnull %3, i64 noundef 0, i32 noundef 0)
  %19 = call i32 @feof(ptr noundef nonnull %3) #6
  %.not5255 = icmp eq i32 %19, 0
  br i1 %.not5255, label %.lr.ph58, label %._crit_edge59

.lr.ph58:                                         ; preds = %._crit_edge, %.lr.ph58
  %.04556 = phi ptr [ %22, %.lr.ph58 ], [ %calloc, %._crit_edge ]
  %20 = getelementptr inbounds i8, ptr %.04556, i64 4
  %21 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.7, ptr noundef %.04556, ptr noundef nonnull %20) #6
  %22 = getelementptr inbounds i8, ptr %.04556, i64 36
  %23 = call i32 @feof(ptr noundef nonnull %3) #6
  %.not52 = icmp eq i32 %23, 0
  br i1 %.not52, label %.lr.ph58, label %._crit_edge59, !llvm.loop !13

._crit_edge59:                                    ; preds = %.lr.ph58, %._crit_edge
  %24 = call i32 @fclose(ptr noundef nonnull %3)
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %.not74 = icmp eq i32 %.048.lcssa, 0
  br i1 %.not74, label %._crit_edge69.thread.critedge, label %.lr.ph63

._crit_edge64:                                    ; preds = %.lr.ph63
  call void @qsort(ptr noundef %calloc, i64 noundef %16, i64 noundef 36, ptr noundef nonnull @compare) #6
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %.lr.ph68

.lr.ph63:                                         ; preds = %._crit_edge59, %.lr.ph63
  %.04461 = phi i32 [ %31, %.lr.ph63 ], [ 0, %._crit_edge59 ]
  %.160 = phi ptr [ %30, %.lr.ph63 ], [ %calloc, %._crit_edge59 ]
  %27 = load i32, ptr %.160, align 4, !tbaa !14
  %28 = getelementptr inbounds i8, ptr %.160, i64 4
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %27, ptr noundef nonnull %28)
  %30 = getelementptr inbounds i8, ptr %.160, i64 36
  %31 = add nuw i32 %.04461, 1
  %exitcond.not = icmp eq i32 %31, %.048.lcssa
  br i1 %exitcond.not, label %._crit_edge64, label %.lr.ph63, !llvm.loop !17

._crit_edge69:                                    ; preds = %.lr.ph68
  %32 = call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.11)
  %33 = icmp eq ptr %32, null
  br i1 %33, label %42, label %.lr.ph72

._crit_edge69.thread.critedge:                    ; preds = %._crit_edge59
  call void @qsort(ptr noundef %calloc, i64 noundef %16, i64 noundef 36, ptr noundef nonnull @compare) #6
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %35 = call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.11)
  %36 = icmp eq ptr %35, null
  br i1 %36, label %42, label %._crit_edge73

.lr.ph68:                                         ; preds = %._crit_edge64, %.lr.ph68
  %.04366 = phi i32 [ %41, %.lr.ph68 ], [ 0, %._crit_edge64 ]
  %.265 = phi ptr [ %40, %.lr.ph68 ], [ %calloc, %._crit_edge64 ]
  %37 = load i32, ptr %.265, align 4, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %.265, i64 4
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %37, ptr noundef nonnull %38)
  %40 = getelementptr inbounds i8, ptr %.265, i64 36
  %41 = add nuw i32 %.04366, 1
  %exitcond77.not = icmp eq i32 %41, %.048.lcssa
  br i1 %exitcond77.not, label %._crit_edge69, label %.lr.ph68, !llvm.loop !18

42:                                               ; preds = %._crit_edge69.thread.critedge, %._crit_edge69
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %51

._crit_edge73:                                    ; preds = %.lr.ph72, %._crit_edge69.thread.critedge
  %44 = phi ptr [ %35, %._crit_edge69.thread.critedge ], [ %32, %.lr.ph72 ]
  %45 = call i32 @fclose(ptr noundef nonnull %44)
  br label %51

.lr.ph72:                                         ; preds = %._crit_edge69, %.lr.ph72
  %.071 = phi i32 [ %50, %.lr.ph72 ], [ 0, %._crit_edge69 ]
  %.370 = phi ptr [ %49, %.lr.ph72 ], [ %calloc, %._crit_edge69 ]
  %46 = load i32, ptr %.370, align 4, !tbaa !14
  %47 = getelementptr inbounds i8, ptr %.370, i64 4
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.12, i32 noundef %46, ptr noundef nonnull %47) #6
  %49 = getelementptr inbounds i8, ptr %.370, i64 36
  %50 = add nuw i32 %.071, 1
  %exitcond78.not = icmp eq i32 %50, %.048.lcssa
  br i1 %exitcond78.not, label %._crit_edge73, label %.lr.ph72, !llvm.loop !19

51:                                               ; preds = %._crit_edge73, %42
  %.046 = phi i32 [ -1, %42 ], [ 0, %._crit_edge73 ]
  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 %52

52:                                               ; preds = %51, %5
  %.147 = phi i32 [ -1, %5 ], [ %.046, %51 ]
  ret i32 %.147
}

; 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 @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 nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; 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