; LLVM IR from chirag-singhal/Coding-Interview-101 :: Miscellaneous/Labs/Lab5 (exer_1)

; 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.timeval = type { i64, i64 }
%struct.records = type { ptr, i64, i64 }

@endmem = external dso_local global ptr, align 8
@__const.main.filename = external hidden unnamed_addr constant [10 x i8], align 1
@__const.main.file = external hidden unnamed_addr constant [5 x [10 x i8]], align 16
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @read_cards(ptr noundef, i32 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [10 x i8], align 1
  %3 = alloca [5 x [10 x i8]], align 16
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.timeval, align 8
  %10 = alloca %struct.timeval, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %struct.timeval, align 8
  %17 = alloca %struct.timeval, align 8
  %18 = alloca double, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 10, ptr %2) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %2, ptr align 1 @__const.main.filename, i64 10, i1 false)
  call void @llvm.lifetime.start.p0(i64 50, ptr %3) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.main.file, i64 50, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %21 = getelementptr inbounds [10 x i8], ptr %2, i64 0, i64 0
  %22 = call noalias ptr @fopen(ptr noundef %21, ptr noundef @.str.1)
  store ptr %22, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %23 = call noalias ptr @fopen(ptr noundef @.str.2, ptr noundef @.str.3)
  store ptr %23, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %24 = call noalias ptr @fopen(ptr noundef @.str.4, ptr noundef @.str.3)
  store ptr %24, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %33, label %27

27:                                               ; preds = %0
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = icmp eq ptr %28, null
  br i1 %29, label %33, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %35

33:                                               ; preds = %30, %27, %0
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %176

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %98, %35
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = icmp slt i32 %37, 4
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %101

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  %41 = call i32 @gettimeofday(ptr noundef %9, ptr noundef null) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %42 = call noalias ptr @malloc(i64 noundef 24) #8
  store ptr %42, ptr %12, align 8, !tbaa !5
  %43 = call noalias ptr @malloc(i64 noundef 88000) #8
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.records, ptr %44, i32 0, i32 0
  store ptr %43, ptr %45, align 8, !tbaa !11
  %46 = load ptr, ptr %12, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.records, ptr %46, i32 0, i32 1
  store i64 0, ptr %47, align 8, !tbaa !14
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.records, ptr %48, i32 0, i32 2
  store i64 1000, ptr %49, align 8, !tbaa !15
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = getelementptr inbounds [10 x i8], ptr %2, i64 0, i64 0
  %52 = call i32 @atoi(ptr noundef %51) #9
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = call ptr @read_cards(ptr noundef %50, i32 noundef %52, ptr noundef %53)
  store ptr %54, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %69, %40
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = sitofp i32 %56 to double
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = sitofp i32 %58 to double
  %60 = call double @pow(double noundef 1.000000e+01, double noundef %59) #7
  %61 = fcmp olt double %57, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %55
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %72

63:                                               ; preds = %55
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds [10 x i8], ptr %2, i64 0, i64 0
  %66 = call i32 @atoi(ptr noundef %65) #9
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = call ptr @read_cards(ptr noundef %64, i32 noundef %66, ptr noundef %67)
  store ptr %68, ptr %12, align 8, !tbaa !5
  br label %69

69:                                               ; preds = %63
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %13, align 4, !tbaa !9
  br label %55, !llvm.loop !16

72:                                               ; preds = %62
  %73 = call i32 @gettimeofday(ptr noundef %10, ptr noundef null) #7
  %74 = getelementptr inbounds %struct.timeval, ptr %10, i32 0, i32 0
  %75 = load i64, ptr %74, align 8, !tbaa !18
  %76 = getelementptr inbounds %struct.timeval, ptr %9, i32 0, i32 0
  %77 = load i64, ptr %76, align 8, !tbaa !18
  %78 = sub nsw i64 %75, %77
  %79 = mul nsw i64 %78, 1000
  %80 = sitofp i64 %79 to double
  store double %80, ptr %11, align 8, !tbaa !20
  %81 = getelementptr inbounds %struct.timeval, ptr %10, i32 0, i32 1
  %82 = load i64, ptr %81, align 8, !tbaa !22
  %83 = getelementptr inbounds %struct.timeval, ptr %9, i32 0, i32 1
  %84 = load i64, ptr %83, align 8, !tbaa !22
  %85 = sub nsw i64 %82, %84
  %86 = sdiv i64 %85, 1000
  %87 = sitofp i64 %86 to double
  %88 = load double, ptr %11, align 8, !tbaa !20
  %89 = fadd double %88, %87
  store double %89, ptr %11, align 8, !tbaa !20
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %12, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.records, ptr %91, i32 0, i32 1
  %93 = load i64, ptr %92, align 8, !tbaa !14
  %94 = load double, ptr %11, align 8, !tbaa !20
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.6, i64 noundef %93, double noundef %94) #7
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = call i32 @fseek(ptr noundef %96, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  br label %98

98:                                               ; preds = %72
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %8, align 4, !tbaa !9
  br label %36, !llvm.loop !23

101:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %166, %101
  %103 = load i32, ptr %14, align 4, !tbaa !9
  %104 = icmp slt i32 %103, 5
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %169

106:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %107 = load i32, ptr %14, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [5 x [10 x i8]], ptr %3, i64 0, i64 %108
  %110 = getelementptr inbounds [10 x i8], ptr %109, i64 0, i64 0
  %111 = call noalias ptr @fopen(ptr noundef %110, ptr noundef @.str.1)
  store ptr %111, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %112 = call noalias ptr @malloc(i64 noundef 24) #8
  store ptr %112, ptr %19, align 8, !tbaa !5
  %113 = call noalias ptr @malloc(i64 noundef 88000) #8
  %114 = load ptr, ptr %19, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.records, ptr %114, i32 0, i32 0
  store ptr %113, ptr %115, align 8, !tbaa !11
  %116 = load ptr, ptr %19, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.records, ptr %116, i32 0, i32 1
  store i64 0, ptr %117, align 8, !tbaa !14
  %118 = load ptr, ptr %19, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.records, ptr %118, i32 0, i32 2
  store i64 1000, ptr %119, align 8, !tbaa !15
  %120 = load ptr, ptr %19, align 8, !tbaa !5
  %121 = load i32, ptr %14, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [5 x [10 x i8]], ptr %3, i64 0, i64 %122
  %124 = getelementptr inbounds [10 x i8], ptr %123, i64 0, i64 0
  %125 = call i32 @atoi(ptr noundef %124) #9
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = call ptr @read_cards(ptr noundef %120, i32 noundef %125, ptr noundef %126)
  store ptr %127, ptr %19, align 8, !tbaa !5
  %128 = call i32 @gettimeofday(ptr noundef %16, ptr noundef null) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %129 = load ptr, ptr %19, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.records, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !11
  %132 = load ptr, ptr %19, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.records, ptr %132, i32 0, i32 1
  %134 = load i64, ptr %133, align 8, !tbaa !14
  call void @insertionSort(ptr noundef %131, i64 noundef %134)
  %135 = call i32 @gettimeofday(ptr noundef %17, ptr noundef null) #7
  %136 = getelementptr inbounds %struct.timeval, ptr %17, i32 0, i32 0
  %137 = load i64, ptr %136, align 8, !tbaa !18
  %138 = getelementptr inbounds %struct.timeval, ptr %16, i32 0, i32 0
  %139 = load i64, ptr %138, align 8, !tbaa !18
  %140 = sub nsw i64 %137, %139
  %141 = mul nsw i64 %140, 1000
  %142 = sitofp i64 %141 to double
  store double %142, ptr %18, align 8, !tbaa !20
  %143 = getelementptr inbounds %struct.timeval, ptr %17, i32 0, i32 1
  %144 = load i64, ptr %143, align 8, !tbaa !22
  %145 = getelementptr inbounds %struct.timeval, ptr %16, i32 0, i32 1
  %146 = load i64, ptr %145, align 8, !tbaa !22
  %147 = sub nsw i64 %144, %146
  %148 = sdiv i64 %147, 1000
  %149 = sitofp i64 %148 to double
  %150 = load double, ptr %18, align 8, !tbaa !20
  %151 = fadd double %150, %149
  store double %151, ptr %18, align 8, !tbaa !20
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = load ptr, ptr %19, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.records, ptr %153, i32 0, i32 1
  %155 = load i64, ptr %154, align 8, !tbaa !14
  %156 = load double, ptr %18, align 8, !tbaa !20
  %157 = load ptr, ptr @endmem, align 8, !tbaa !5
  %158 = ptrtoint ptr %20 to i64
  %159 = ptrtoint ptr %157 to i64
  %160 = sub i64 %158, %159
  %161 = sdiv exact i64 %160, 4
  %162 = mul nsw i64 %161, 4
  %163 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef @.str.7, i64 noundef %155, double noundef %156, i64 noundef %162) #7
  %164 = load ptr, ptr %15, align 8, !tbaa !5
  %165 = call i32 @fclose(ptr noundef %164)
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %166

166:                                              ; preds = %106
  %167 = load i32, ptr %14, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %14, align 4, !tbaa !9
  br label %102, !llvm.loop !24

169:                                              ; preds = %105
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = call i32 @fclose(ptr noundef %170)
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = call i32 @fclose(ptr noundef %172)
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = call i32 @fclose(ptr noundef %174)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %7, align 4
  br label %176

176:                                              ; preds = %169, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 50, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 10, ptr %2) #7
  %177 = load i32, ptr %1, align 4
  ret i32 %177
}

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

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

; Function Attrs: nounwind
declare i32 @gettimeofday(ptr noundef, ptr noundef) #4

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #6

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

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

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

declare i32 @fclose(ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { 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 #6 = { inlinehint nounwind willreturn memory(read) 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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"records", !6, i64 0, !13, i64 8, !13, i64 16}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !13, i64 8}
!15 = !{!12, !13, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !13, i64 0}
!19 = !{!"timeval", !13, i64 0, !13, i64 8}
!20 = !{!21, !21, i64 0}
!21 = !{!"double", !7, i64 0}
!22 = !{!19, !13, i64 8}
!23 = distinct !{!23, !17}
!24 = distinct !{!24, !17}


; 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.timeval = type { i64, i64 }

@endmem = external dso_local local_unnamed_addr global ptr, align 8
@__const.main.filename = external hidden unnamed_addr constant [10 x i8], align 1
@__const.main.file = external hidden unnamed_addr constant [5 x [10 x i8]], align 16
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @read_cards(ptr noundef, i32 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: 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 void @insertionSort(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.timeval, align 8
  %2 = alloca %struct.timeval, align 8
  %3 = alloca %struct.timeval, align 8
  %4 = alloca %struct.timeval, align 8
  %5 = alloca i32, align 4
  %6 = tail call noalias ptr @fopen(ptr noundef nonnull @__const.main.filename, ptr noundef nonnull @.str.1)
  %7 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3)
  %8 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3)
  %9 = icmp eq ptr %6, null
  %10 = icmp eq ptr %7, null
  %or.cond = or i1 %9, %10
  %11 = icmp eq ptr %8, null
  %or.cond3 = or i1 %or.cond, %11
  br i1 %or.cond3, label %12, label %.lr.ph.preheader.1

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

.lr.ph.preheader.1:                               ; preds = %0
  %14 = getelementptr inbounds i8, ptr %2, i64 8
  %15 = getelementptr inbounds i8, ptr %1, i64 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %16 = call i32 @gettimeofday(ptr noundef nonnull %1, ptr noundef null) #5
  %17 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %18 = tail call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %18, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %17, i64 8
  store i64 0, ptr %19, align 8, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %17, i64 16
  store i64 1000, ptr %20, align 8, !tbaa !12
  %21 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %22 = tail call ptr @read_cards(ptr noundef nonnull %17, i32 noundef %21, ptr noundef nonnull %6)
  %23 = call i32 @gettimeofday(ptr noundef nonnull %2, ptr noundef null) #5
  %24 = load i64, ptr %2, align 8, !tbaa !13
  %25 = load i64, ptr %1, align 8, !tbaa !13
  %26 = sub nsw i64 %24, %25
  %27 = mul nsw i64 %26, 1000
  %28 = sitofp i64 %27 to double
  %29 = load i64, ptr %14, align 8, !tbaa !15
  %30 = load i64, ptr %15, align 8, !tbaa !15
  %31 = sub nsw i64 %29, %30
  %32 = sdiv i64 %31, 1000
  %33 = sitofp i64 %32 to double
  %34 = fadd double %28, %33
  %35 = getelementptr inbounds i8, ptr %22, i64 8
  %36 = load i64, ptr %35, align 8, !tbaa !11
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %7, ptr noundef nonnull @.str.6, i64 noundef %36, double noundef %34) #5
  %38 = tail call i32 @fseek(ptr noundef nonnull %6, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %39 = call i32 @gettimeofday(ptr noundef nonnull %1, ptr noundef null) #5
  %40 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %41 = tail call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %41, ptr %40, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %40, i64 8
  store i64 0, ptr %42, align 8, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %40, i64 16
  store i64 1000, ptr %43, align 8, !tbaa !12
  %44 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %45 = tail call ptr @read_cards(ptr noundef nonnull %40, i32 noundef %44, ptr noundef nonnull %6)
  %46 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %47 = tail call ptr @read_cards(ptr noundef %45, i32 noundef %46, ptr noundef %6)
  %48 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %49 = tail call ptr @read_cards(ptr noundef %47, i32 noundef %48, ptr noundef %6)
  %50 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %51 = tail call ptr @read_cards(ptr noundef %49, i32 noundef %50, ptr noundef %6)
  %52 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %53 = tail call ptr @read_cards(ptr noundef %51, i32 noundef %52, ptr noundef %6)
  %54 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %55 = tail call ptr @read_cards(ptr noundef %53, i32 noundef %54, ptr noundef %6)
  %56 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %57 = tail call ptr @read_cards(ptr noundef %55, i32 noundef %56, ptr noundef %6)
  %58 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %59 = tail call ptr @read_cards(ptr noundef %57, i32 noundef %58, ptr noundef %6)
  %60 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %61 = tail call ptr @read_cards(ptr noundef %59, i32 noundef %60, ptr noundef %6)
  %62 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %63 = tail call ptr @read_cards(ptr noundef %61, i32 noundef %62, ptr noundef %6)
  %64 = call i32 @gettimeofday(ptr noundef nonnull %2, ptr noundef null) #5
  %65 = load i64, ptr %2, align 8, !tbaa !13
  %66 = load i64, ptr %1, align 8, !tbaa !13
  %67 = sub nsw i64 %65, %66
  %68 = mul nsw i64 %67, 1000
  %69 = sitofp i64 %68 to double
  %70 = load i64, ptr %14, align 8, !tbaa !15
  %71 = load i64, ptr %15, align 8, !tbaa !15
  %72 = sub nsw i64 %70, %71
  %73 = sdiv i64 %72, 1000
  %74 = sitofp i64 %73 to double
  %75 = fadd double %69, %74
  %76 = getelementptr inbounds i8, ptr %63, i64 8
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.6, i64 noundef %77, double noundef %75) #5
  %79 = tail call i32 @fseek(ptr noundef %6, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %80 = call i32 @gettimeofday(ptr noundef nonnull %1, ptr noundef null) #5
  %81 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %82 = tail call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %82, ptr %81, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %81, i64 8
  store i64 0, ptr %83, align 8, !tbaa !11
  %84 = getelementptr inbounds i8, ptr %81, i64 16
  store i64 1000, ptr %84, align 8, !tbaa !12
  %85 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %86 = tail call ptr @read_cards(ptr noundef nonnull %81, i32 noundef %85, ptr noundef %6)
  br label %.lr.ph.2

.lr.ph.2:                                         ; preds = %.lr.ph.2, %.lr.ph.preheader.1
  %.04450.2 = phi i32 [ %89, %.lr.ph.2 ], [ 1, %.lr.ph.preheader.1 ]
  %.04549.2 = phi ptr [ %88, %.lr.ph.2 ], [ %86, %.lr.ph.preheader.1 ]
  %87 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %88 = tail call ptr @read_cards(ptr noundef %.04549.2, i32 noundef %87, ptr noundef %6)
  %89 = add nuw nsw i32 %.04450.2, 1
  %90 = icmp ult i32 %.04450.2, 99
  br i1 %90, label %.lr.ph.2, label %.lr.ph.preheader.3, !llvm.loop !16

.lr.ph.preheader.3:                               ; preds = %.lr.ph.2
  %91 = call i32 @gettimeofday(ptr noundef nonnull %2, ptr noundef null) #5
  %92 = load i64, ptr %2, align 8, !tbaa !13
  %93 = load i64, ptr %1, align 8, !tbaa !13
  %94 = sub nsw i64 %92, %93
  %95 = mul nsw i64 %94, 1000
  %96 = sitofp i64 %95 to double
  %97 = load i64, ptr %14, align 8, !tbaa !15
  %98 = load i64, ptr %15, align 8, !tbaa !15
  %99 = sub nsw i64 %97, %98
  %100 = sdiv i64 %99, 1000
  %101 = sitofp i64 %100 to double
  %102 = fadd double %96, %101
  %103 = getelementptr inbounds i8, ptr %88, i64 8
  %104 = load i64, ptr %103, align 8, !tbaa !11
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.6, i64 noundef %104, double noundef %102) #5
  %106 = tail call i32 @fseek(ptr noundef %6, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #5
  %107 = call i32 @gettimeofday(ptr noundef nonnull %1, ptr noundef null) #5
  %108 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %109 = tail call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %109, ptr %108, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %108, i64 8
  store i64 0, ptr %110, align 8, !tbaa !11
  %111 = getelementptr inbounds i8, ptr %108, i64 16
  store i64 1000, ptr %111, align 8, !tbaa !12
  %112 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %113 = tail call ptr @read_cards(ptr noundef nonnull %108, i32 noundef %112, ptr noundef %6)
  br label %.lr.ph.3

.lr.ph.3:                                         ; preds = %.lr.ph.3, %.lr.ph.preheader.3
  %.04450.3 = phi i32 [ %116, %.lr.ph.3 ], [ 1, %.lr.ph.preheader.3 ]
  %.04549.3 = phi ptr [ %115, %.lr.ph.3 ], [ %113, %.lr.ph.preheader.3 ]
  %114 = tail call i32 @atoi(ptr nocapture noundef @__const.main.filename) #7
  %115 = tail call ptr @read_cards(ptr noundef %.04549.3, i32 noundef %114, ptr noundef %6)
  %116 = add nuw nsw i32 %.04450.3, 1
  %117 = icmp ult i32 %.04450.3, 999
  br i1 %117, label %.lr.ph.3, label %._crit_edge.3, !llvm.loop !16

._crit_edge.3:                                    ; preds = %.lr.ph.3
  %118 = call i32 @gettimeofday(ptr noundef nonnull %2, ptr noundef null) #5
  %119 = load i64, ptr %2, align 8, !tbaa !13
  %120 = load i64, ptr %1, align 8, !tbaa !13
  %121 = sub nsw i64 %119, %120
  %122 = mul nsw i64 %121, 1000
  %123 = sitofp i64 %122 to double
  %124 = load i64, ptr %14, align 8, !tbaa !15
  %125 = load i64, ptr %15, align 8, !tbaa !15
  %126 = sub nsw i64 %124, %125
  %127 = sdiv i64 %126, 1000
  %128 = sitofp i64 %127 to double
  %129 = fadd double %123, %128
  %130 = getelementptr inbounds i8, ptr %115, i64 8
  %131 = load i64, ptr %130, align 8, !tbaa !11
  %132 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str.6, i64 noundef %131, double noundef %129) #5
  %133 = tail call i32 @fseek(ptr noundef %6, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #5
  %134 = getelementptr inbounds i8, ptr %4, i64 8
  %135 = getelementptr inbounds i8, ptr %3, i64 8
  %136 = ptrtoint ptr %5 to i64
  %137 = call noalias ptr @fopen(ptr noundef nonnull @__const.main.file, ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %138 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %139 = call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %139, ptr %138, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %138, i64 8
  store i64 0, ptr %140, align 8, !tbaa !11
  %141 = getelementptr inbounds i8, ptr %138, i64 16
  store i64 1000, ptr %141, align 8, !tbaa !12
  %142 = call i32 @atoi(ptr nocapture noundef @__const.main.file) #7
  %143 = call ptr @read_cards(ptr noundef nonnull %138, i32 noundef %142, ptr noundef %137)
  %144 = call i32 @gettimeofday(ptr noundef nonnull %3, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %145 = load ptr, ptr %143, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %143, i64 8
  %147 = load i64, ptr %146, align 8, !tbaa !11
  call void @insertionSort(ptr noundef %145, i64 noundef %147)
  %148 = call i32 @gettimeofday(ptr noundef nonnull %4, ptr noundef null) #5
  %149 = load i64, ptr %4, align 8, !tbaa !13
  %150 = load i64, ptr %3, align 8, !tbaa !13
  %151 = sub nsw i64 %149, %150
  %152 = mul nsw i64 %151, 1000
  %153 = sitofp i64 %152 to double
  %154 = load i64, ptr %134, align 8, !tbaa !15
  %155 = load i64, ptr %135, align 8, !tbaa !15
  %156 = sub nsw i64 %154, %155
  %157 = sdiv i64 %156, 1000
  %158 = sitofp i64 %157 to double
  %159 = fadd double %153, %158
  %160 = load i64, ptr %146, align 8, !tbaa !11
  %161 = load ptr, ptr @endmem, align 8, !tbaa !18
  %162 = ptrtoint ptr %161 to i64
  %163 = sub i64 %136, %162
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.7, i64 noundef %160, double noundef %159, i64 noundef %163) #5
  %165 = call i32 @fclose(ptr noundef %137)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %166 = call noalias ptr @fopen(ptr noundef nonnull getelementptr inbounds (i8, ptr @__const.main.file, i64 10), ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %167 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %168 = call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %168, ptr %167, align 8, !tbaa !5
  %169 = getelementptr inbounds i8, ptr %167, i64 8
  store i64 0, ptr %169, align 8, !tbaa !11
  %170 = getelementptr inbounds i8, ptr %167, i64 16
  store i64 1000, ptr %170, align 8, !tbaa !12
  %171 = call i32 @atoi(ptr nocapture noundef getelementptr inbounds (i8, ptr @__const.main.file, i64 10)) #7
  %172 = call ptr @read_cards(ptr noundef nonnull %167, i32 noundef %171, ptr noundef %166)
  %173 = call i32 @gettimeofday(ptr noundef nonnull %3, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %174 = load ptr, ptr %172, align 8, !tbaa !5
  %175 = getelementptr inbounds i8, ptr %172, i64 8
  %176 = load i64, ptr %175, align 8, !tbaa !11
  call void @insertionSort(ptr noundef %174, i64 noundef %176)
  %177 = call i32 @gettimeofday(ptr noundef nonnull %4, ptr noundef null) #5
  %178 = load i64, ptr %4, align 8, !tbaa !13
  %179 = load i64, ptr %3, align 8, !tbaa !13
  %180 = sub nsw i64 %178, %179
  %181 = mul nsw i64 %180, 1000
  %182 = sitofp i64 %181 to double
  %183 = load i64, ptr %134, align 8, !tbaa !15
  %184 = load i64, ptr %135, align 8, !tbaa !15
  %185 = sub nsw i64 %183, %184
  %186 = sdiv i64 %185, 1000
  %187 = sitofp i64 %186 to double
  %188 = fadd double %182, %187
  %189 = load i64, ptr %175, align 8, !tbaa !11
  %190 = load ptr, ptr @endmem, align 8, !tbaa !18
  %191 = ptrtoint ptr %190 to i64
  %192 = sub i64 %136, %191
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.7, i64 noundef %189, double noundef %188, i64 noundef %192) #5
  %194 = call i32 @fclose(ptr noundef %166)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %195 = call noalias ptr @fopen(ptr noundef nonnull getelementptr inbounds (i8, ptr @__const.main.file, i64 20), ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %196 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %197 = call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %197, ptr %196, align 8, !tbaa !5
  %198 = getelementptr inbounds i8, ptr %196, i64 8
  store i64 0, ptr %198, align 8, !tbaa !11
  %199 = getelementptr inbounds i8, ptr %196, i64 16
  store i64 1000, ptr %199, align 8, !tbaa !12
  %200 = call i32 @atoi(ptr nocapture noundef getelementptr inbounds (i8, ptr @__const.main.file, i64 20)) #7
  %201 = call ptr @read_cards(ptr noundef nonnull %196, i32 noundef %200, ptr noundef %195)
  %202 = call i32 @gettimeofday(ptr noundef nonnull %3, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %203 = load ptr, ptr %201, align 8, !tbaa !5
  %204 = getelementptr inbounds i8, ptr %201, i64 8
  %205 = load i64, ptr %204, align 8, !tbaa !11
  call void @insertionSort(ptr noundef %203, i64 noundef %205)
  %206 = call i32 @gettimeofday(ptr noundef nonnull %4, ptr noundef null) #5
  %207 = load i64, ptr %4, align 8, !tbaa !13
  %208 = load i64, ptr %3, align 8, !tbaa !13
  %209 = sub nsw i64 %207, %208
  %210 = mul nsw i64 %209, 1000
  %211 = sitofp i64 %210 to double
  %212 = load i64, ptr %134, align 8, !tbaa !15
  %213 = load i64, ptr %135, align 8, !tbaa !15
  %214 = sub nsw i64 %212, %213
  %215 = sdiv i64 %214, 1000
  %216 = sitofp i64 %215 to double
  %217 = fadd double %211, %216
  %218 = load i64, ptr %204, align 8, !tbaa !11
  %219 = load ptr, ptr @endmem, align 8, !tbaa !18
  %220 = ptrtoint ptr %219 to i64
  %221 = sub i64 %136, %220
  %222 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.7, i64 noundef %218, double noundef %217, i64 noundef %221) #5
  %223 = call i32 @fclose(ptr noundef %195)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %224 = call noalias ptr @fopen(ptr noundef nonnull getelementptr inbounds (i8, ptr @__const.main.file, i64 30), ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %225 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %226 = call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %226, ptr %225, align 8, !tbaa !5
  %227 = getelementptr inbounds i8, ptr %225, i64 8
  store i64 0, ptr %227, align 8, !tbaa !11
  %228 = getelementptr inbounds i8, ptr %225, i64 16
  store i64 1000, ptr %228, align 8, !tbaa !12
  %229 = call i32 @atoi(ptr nocapture noundef getelementptr inbounds (i8, ptr @__const.main.file, i64 30)) #7
  %230 = call ptr @read_cards(ptr noundef nonnull %225, i32 noundef %229, ptr noundef %224)
  %231 = call i32 @gettimeofday(ptr noundef nonnull %3, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %232 = load ptr, ptr %230, align 8, !tbaa !5
  %233 = getelementptr inbounds i8, ptr %230, i64 8
  %234 = load i64, ptr %233, align 8, !tbaa !11
  call void @insertionSort(ptr noundef %232, i64 noundef %234)
  %235 = call i32 @gettimeofday(ptr noundef nonnull %4, ptr noundef null) #5
  %236 = load i64, ptr %4, align 8, !tbaa !13
  %237 = load i64, ptr %3, align 8, !tbaa !13
  %238 = sub nsw i64 %236, %237
  %239 = mul nsw i64 %238, 1000
  %240 = sitofp i64 %239 to double
  %241 = load i64, ptr %134, align 8, !tbaa !15
  %242 = load i64, ptr %135, align 8, !tbaa !15
  %243 = sub nsw i64 %241, %242
  %244 = sdiv i64 %243, 1000
  %245 = sitofp i64 %244 to double
  %246 = fadd double %240, %245
  %247 = load i64, ptr %233, align 8, !tbaa !11
  %248 = load ptr, ptr @endmem, align 8, !tbaa !18
  %249 = ptrtoint ptr %248 to i64
  %250 = sub i64 %136, %249
  %251 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.7, i64 noundef %247, double noundef %246, i64 noundef %250) #5
  %252 = call i32 @fclose(ptr noundef %224)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %253 = call noalias ptr @fopen(ptr noundef nonnull getelementptr inbounds (i8, ptr @__const.main.file, i64 40), ptr noundef nonnull @.str.1)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %254 = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #6
  %255 = call noalias dereferenceable_or_null(88000) ptr @malloc(i64 noundef 88000) #6
  store ptr %255, ptr %254, align 8, !tbaa !5
  %256 = getelementptr inbounds i8, ptr %254, i64 8
  store i64 0, ptr %256, align 8, !tbaa !11
  %257 = getelementptr inbounds i8, ptr %254, i64 16
  store i64 1000, ptr %257, align 8, !tbaa !12
  %258 = call i32 @atoi(ptr nocapture noundef getelementptr inbounds (i8, ptr @__const.main.file, i64 40)) #7
  %259 = call ptr @read_cards(ptr noundef nonnull %254, i32 noundef %258, ptr noundef %253)
  %260 = call i32 @gettimeofday(ptr noundef nonnull %3, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %261 = load ptr, ptr %259, align 8, !tbaa !5
  %262 = getelementptr inbounds i8, ptr %259, i64 8
  %263 = load i64, ptr %262, align 8, !tbaa !11
  call void @insertionSort(ptr noundef %261, i64 noundef %263)
  %264 = call i32 @gettimeofday(ptr noundef nonnull %4, ptr noundef null) #5
  %265 = load i64, ptr %4, align 8, !tbaa !13
  %266 = load i64, ptr %3, align 8, !tbaa !13
  %267 = sub nsw i64 %265, %266
  %268 = mul nsw i64 %267, 1000
  %269 = sitofp i64 %268 to double
  %270 = load i64, ptr %134, align 8, !tbaa !15
  %271 = load i64, ptr %135, align 8, !tbaa !15
  %272 = sub nsw i64 %270, %271
  %273 = sdiv i64 %272, 1000
  %274 = sitofp i64 %273 to double
  %275 = fadd double %269, %274
  %276 = load i64, ptr %262, align 8, !tbaa !11
  %277 = load ptr, ptr @endmem, align 8, !tbaa !18
  %278 = ptrtoint ptr %277 to i64
  %279 = sub i64 %136, %278
  %280 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.7, i64 noundef %276, double noundef %275, i64 noundef %279) #5
  %281 = call i32 @fclose(ptr noundef %253)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %282 = call i32 @fclose(ptr noundef %6)
  %283 = call i32 @fclose(ptr noundef %8)
  %284 = call i32 @fclose(ptr noundef %7)
  br label %285

285:                                              ; preds = %._crit_edge.3, %12
  ret i32 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 @gettimeofday(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) 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
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

; 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"records", !7, i64 0, !10, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!14, !10, i64 0}
!14 = !{!"timeval", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!7, !7, i64 0}


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