; LLVM IR from sbu-fsl/kernel-ml :: examples (readahead_net)

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

%union.val = type { double }
%struct.matrix = type { i32, i32, i32, %union.anon }
%union.anon = type { ptr }

@.str = external hidden unnamed_addr constant [69 x i8], align 1
@readahead_test_list = external hidden constant [33 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.data_processing = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@current_readahead_val = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @data_processing(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca float, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [3 x double], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca [255 x i8], align 16
  %11 = alloca [255 x i8], align 16
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %union.val, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %union.val, align 8
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 255, ptr %10) #6
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 255, i1 false)
  call void @llvm.lifetime.start.p0(i64 255, ptr %11) #6
  call void @llvm.memset.p0.i64(ptr align 16 %11, i8 0, i64 255, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %24 = call ptr @allocate_matrix(i32 noundef 1, i32 noundef 33, i32 noundef 1)
  store ptr %24, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %103, %1
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 33
  br i1 %27, label %28, label %106

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %29 = getelementptr inbounds [255 x i8], ptr %10, i64 0, i64 0
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [33 x i32], ptr @readahead_test_list, i64 0, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !9
  %34 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %29, i64 noundef 255, ptr noundef @.str, i32 noundef %33) #6
  store i32 %34, ptr %21, align 4, !tbaa !9
  %35 = load i32, ptr %21, align 4, !tbaa !9
  %36 = icmp sgt i32 %35, 0
  br i1 %36, label %37, label %40

37:                                               ; preds = %28
  %38 = load i32, ptr %21, align 4, !tbaa !9
  %39 = icmp slt i32 %38, 255
  br i1 %39, label %41, label %40

40:                                               ; preds = %37, %28
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 54, ptr noundef @__PRETTY_FUNCTION__.data_processing) #7
  unreachable

41:                                               ; preds = %37
  %42 = getelementptr inbounds [255 x i8], ptr %10, i64 0, i64 0
  %43 = call ptr @kml_file_open(ptr noundef %42, ptr noundef @.str.3, i32 noundef 0)
  store ptr %43, ptr %16, align 8, !tbaa !5
  %44 = load ptr, ptr %16, align 8, !tbaa !5
  %45 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %44, ptr noundef @.str.4, ptr noundef %4)
  %46 = load float, ptr %4, align 4, !tbaa !11
  %47 = fptosi float %46 to i32
  store i32 %47, ptr %3, align 4, !tbaa !9
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = call ptr @allocate_matrix(i32 noundef %48, i32 noundef 1, i32 noundef 1)
  store ptr %49, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %83, %41
  %51 = load i32, ptr %18, align 4, !tbaa !9
  %52 = load ptr, ptr %14, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.matrix, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 8, !tbaa !13
  %55 = icmp slt i32 %51, %54
  br i1 %55, label %56, label %86

56:                                               ; preds = %50
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %79, %56
  %58 = load i32, ptr %19, align 4, !tbaa !9
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.matrix, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !15
  %62 = icmp slt i32 %58, %61
  br i1 %62, label %63, label %82

63:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %64 = load ptr, ptr %16, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %64, ptr noundef @.str.4, ptr noundef %22)
  %66 = load float, ptr %22, align 4, !tbaa !11
  %67 = load ptr, ptr %14, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.matrix, ptr %67, i32 0, i32 3
  %69 = load ptr, ptr %68, align 8, !tbaa !16
  %70 = load i32, ptr %18, align 4, !tbaa !9
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.matrix, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !15
  %74 = mul nsw i32 %70, %73
  %75 = load i32, ptr %19, align 4, !tbaa !9
  %76 = add nsw i32 %74, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds float, ptr %69, i64 %77
  store float %66, ptr %78, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %79

79:                                               ; preds = %63
  %80 = load i32, ptr %19, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %19, align 4, !tbaa !9
  br label %57, !llvm.loop !17

82:                                               ; preds = %57
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %18, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %18, align 4, !tbaa !9
  br label %50, !llvm.loop !19

86:                                               ; preds = %50
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  call void @matrix_mean_constant(ptr noundef %87, ptr noundef %20)
  %88 = load float, ptr %20, align 8, !tbaa !16
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.matrix, ptr %89, i32 0, i32 3
  %91 = load ptr, ptr %90, align 8, !tbaa !16
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.matrix, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !15
  %95 = mul nsw i32 0, %94
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = add nsw i32 %95, %96
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds float, ptr %91, i64 %98
  store float %88, ptr %99, align 4, !tbaa !11
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free_matrix(ptr noundef %100)
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = call i32 @kml_file_close(ptr noundef %101)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %103

103:                                              ; preds = %86
  %104 = load i32, ptr %9, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %9, align 4, !tbaa !9
  br label %25, !llvm.loop !20

106:                                              ; preds = %25
  %107 = load ptr, ptr %15, align 8, !tbaa !5
  %108 = call ptr @matrix_argsort(ptr noundef %107, ptr noundef @cmp_actual_results)
  store ptr %108, ptr %13, align 8, !tbaa !5
  %109 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free_matrix(ptr noundef %109)
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %110

110:                                              ; preds = %175, %106
  %111 = load i32, ptr %9, align 4, !tbaa !9
  %112 = icmp slt i32 %111, 1
  br i1 %112, label %113, label %178

113:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %114 = getelementptr inbounds [255 x i8], ptr %11, i64 0, i64 0
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [33 x i32], ptr @readahead_test_list, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !9
  %119 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %114, i64 noundef 255, ptr noundef @.str.5, i32 noundef %118) #6
  store i32 %119, ptr %23, align 4, !tbaa !9
  %120 = load i32, ptr %23, align 4, !tbaa !9
  %121 = icmp sgt i32 %120, 0
  br i1 %121, label %122, label %125

122:                                              ; preds = %113
  %123 = load i32, ptr %23, align 4, !tbaa !9
  %124 = icmp slt i32 %123, 255
  br i1 %124, label %126, label %125

125:                                              ; preds = %122, %113
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 86, ptr noundef @__PRETTY_FUNCTION__.data_processing) #7
  unreachable

126:                                              ; preds = %122
  %127 = getelementptr inbounds [255 x i8], ptr %11, i64 0, i64 0
  %128 = call ptr @kml_file_open(ptr noundef %127, ptr noundef @.str.3, i32 noundef 0)
  store ptr %128, ptr %5, align 8, !tbaa !5
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %129, ptr noundef @.str.4, ptr noundef %4)
  %131 = load float, ptr %4, align 4, !tbaa !11
  %132 = fptosi float %131 to i32
  store i32 %132, ptr %3, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %165, %126
  %134 = load i32, ptr %7, align 4, !tbaa !9
  %135 = load i32, ptr %3, align 4, !tbaa !9
  %136 = icmp slt i32 %134, %135
  br i1 %136, label %137, label %168

137:                                              ; preds = %133
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %138

138:                                              ; preds = %147, %137
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = icmp slt i32 %139, 3
  br i1 %140, label %141, label %150

141:                                              ; preds = %138
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = load i32, ptr %8, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 %144
  %146 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %142, ptr noundef @.str.6, ptr noundef %145)
  br label %147

147:                                              ; preds = %141
  %148 = load i32, ptr %8, align 4, !tbaa !9
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %8, align 4, !tbaa !9
  br label %138, !llvm.loop !21

150:                                              ; preds = %138
  %151 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = load i32, ptr @current_readahead_val, align 4, !tbaa !9
  %154 = call zeroext i1 @readahead_data_processing(ptr noundef %151, ptr noundef %152, i32 noundef %153, i1 noundef zeroext true, i1 noundef zeroext false, i64 noundef 0)
  br i1 %154, label %155, label %164

155:                                              ; preds = %150
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = call ptr @predict_readahead(ptr noundef %156)
  store ptr %157, ptr %12, align 8, !tbaa !5
  %158 = load ptr, ptr %12, align 8, !tbaa !5
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ranking_matrix_distance(ptr noundef %158, ptr noundef %159, ptr noundef %17)
  %160 = load float, ptr %17, align 8, !tbaa !16
  %161 = fpext float %160 to double
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %161)
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free_matrix(ptr noundef %163)
  br label %164

164:                                              ; preds = %155, %150
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr %7, align 4, !tbaa !9
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %7, align 4, !tbaa !9
  br label %133, !llvm.loop !22

168:                                              ; preds = %133
  %169 = getelementptr inbounds [3 x double], ptr %6, i64 0, i64 0
  %170 = load ptr, ptr %2, align 8, !tbaa !5
  %171 = load i32, ptr @current_readahead_val, align 4, !tbaa !9
  %172 = call zeroext i1 @readahead_data_processing(ptr noundef %169, ptr noundef %170, i32 noundef %171, i1 noundef zeroext true, i1 noundef zeroext true, i64 noundef 0)
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = call i32 @kml_file_close(ptr noundef %173)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %175

175:                                              ; preds = %168
  %176 = load i32, ptr %9, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %9, align 4, !tbaa !9
  br label %110, !llvm.loop !23

178:                                              ; preds = %110
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free_matrix(ptr noundef %179)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 255, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 255, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret void
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare ptr @allocate_matrix(i32 noundef, i32 noundef, i32 noundef) #3

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

declare ptr @kml_file_open(ptr noundef, ptr noundef, i32 noundef) #3

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

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

declare void @matrix_mean_constant(ptr noundef, ptr noundef) #3

declare void @free_matrix(ptr noundef) #3

declare i32 @kml_file_close(ptr noundef) #3

declare ptr @matrix_argsort(ptr noundef, ptr noundef) #3

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

declare zeroext i1 @readahead_data_processing(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef) #3

declare ptr @predict_readahead(ptr noundef) #3

declare void @ranking_matrix_distance(ptr noundef, ptr noundef, ptr noundef) #3

declare i32 @printf(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: write) }
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 = { noreturn 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 = { noreturn nounwind }

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

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


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

%union.val = type { double }

@.str = external hidden unnamed_addr constant [69 x i8], align 1
@readahead_test_list = external hidden local_unnamed_addr constant [33 x i32], align 16
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [76 x i8], align 1
@__PRETTY_FUNCTION__.data_processing = external hidden unnamed_addr constant [38 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@current_readahead_val = external hidden local_unnamed_addr global i32, align 4
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @data_processing(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca float, align 4
  %3 = alloca [3 x double], align 16
  %4 = alloca [255 x i8], align 16
  %5 = alloca [255 x i8], align 16
  %6 = alloca %union.val, align 8
  %7 = alloca %union.val, align 8
  %8 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %4) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(255) %4, i8 0, i64 255, i1 false)
  call void @llvm.lifetime.start.p0(i64 255, ptr nonnull %5) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(255) %5, i8 0, i64 255, i1 false)
  %9 = tail call ptr @allocate_matrix(i32 noundef 1, i32 noundef 33, i32 noundef 1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  br label %11

11:                                               ; preds = %1, %._crit_edge56
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %._crit_edge56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %12 = getelementptr inbounds [33 x i32], ptr @readahead_test_list, i64 0, i64 %indvars.iv
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %14 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 255, ptr noundef nonnull @.str, i32 noundef %13) #6
  %15 = add i32 %14, -1
  %or.cond = icmp ult i32 %15, 254
  br i1 %or.cond, label %17, label %16

16:                                               ; preds = %11
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 54, ptr noundef nonnull @__PRETTY_FUNCTION__.data_processing) #7
  unreachable

17:                                               ; preds = %11
  %18 = call ptr @kml_file_open(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, i32 noundef 0) #6
  %19 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %18, ptr noundef nonnull @.str.4, ptr noundef nonnull %2) #6
  %20 = load float, ptr %2, align 4, !tbaa !9
  %21 = fptosi float %20 to i32
  %22 = call ptr @allocate_matrix(i32 noundef %21, i32 noundef 1, i32 noundef 1) #6
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.preheader53.lr.ph, label %._crit_edge56

.preheader53.lr.ph:                               ; preds = %17
  %25 = getelementptr inbounds i8, ptr %22, i64 4
  %26 = getelementptr inbounds i8, ptr %22, i64 16
  %27 = load i32, ptr %25, align 4, !tbaa !13
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.preheader53, label %._crit_edge56

.preheader53:                                     ; preds = %.preheader53.lr.ph, %._crit_edge
  %29 = phi i32 [ %42, %._crit_edge ], [ %23, %.preheader53.lr.ph ]
  %30 = phi i32 [ %43, %._crit_edge ], [ %27, %.preheader53.lr.ph ]
  %.05055 = phi i32 [ %44, %._crit_edge ], [ 0, %.preheader53.lr.ph ]
  %31 = icmp sgt i32 %30, 0
  br i1 %31, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader53, %.lr.ph
  %.04954 = phi i32 [ %40, %.lr.ph ], [ 0, %.preheader53 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %32 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %18, ptr noundef nonnull @.str.4, ptr noundef nonnull %8) #6
  %33 = load float, ptr %8, align 4, !tbaa !9
  %34 = load ptr, ptr %26, align 8, !tbaa !14
  %35 = load i32, ptr %25, align 4, !tbaa !13
  %36 = mul nsw i32 %35, %.05055
  %37 = add nsw i32 %36, %.04954
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds float, ptr %34, i64 %38
  store float %33, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %40 = add nuw nsw i32 %.04954, 1
  %41 = icmp slt i32 %40, %35
  br i1 %41, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !15

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr %22, align 8, !tbaa !11
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader53
  %42 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %29, %.preheader53 ]
  %43 = phi i32 [ %35, %._crit_edge.loopexit ], [ %30, %.preheader53 ]
  %44 = add nuw nsw i32 %.05055, 1
  %45 = icmp slt i32 %44, %42
  br i1 %45, label %.preheader53, label %._crit_edge56, !llvm.loop !17

._crit_edge56:                                    ; preds = %._crit_edge, %.preheader53.lr.ph, %17
  call void @matrix_mean_constant(ptr noundef nonnull %22, ptr noundef nonnull %7) #6
  %46 = load float, ptr %7, align 8, !tbaa !14
  %47 = load ptr, ptr %10, align 8, !tbaa !14
  %48 = getelementptr inbounds float, ptr %47, i64 %indvars.iv
  store float %46, ptr %48, align 4, !tbaa !9
  call void @free_matrix(ptr noundef nonnull %22) #6
  %49 = call i32 @kml_file_close(ptr noundef %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 33
  br i1 %exitcond.not, label %.critedge, label %11, !llvm.loop !19

.critedge:                                        ; preds = %._crit_edge56
  %50 = call ptr @matrix_argsort(ptr noundef nonnull %9, ptr noundef nonnull @cmp_actual_results) #6
  call void @free_matrix(ptr noundef nonnull %9) #6
  %51 = load i32, ptr @readahead_test_list, align 16, !tbaa !5
  %52 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 255, ptr noundef nonnull @.str.5, i32 noundef %51) #6
  %53 = add i32 %52, -1
  %or.cond3 = icmp ult i32 %53, 254
  br i1 %or.cond3, label %55, label %54

54:                                               ; preds = %.critedge
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 86, ptr noundef nonnull @__PRETTY_FUNCTION__.data_processing) #7
  unreachable

55:                                               ; preds = %.critedge
  %56 = call ptr @kml_file_open(ptr noundef nonnull %5, ptr noundef nonnull @.str.3, i32 noundef 0) #6
  %57 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %56, ptr noundef nonnull @.str.4, ptr noundef nonnull %2) #6
  %58 = load float, ptr %2, align 4, !tbaa !9
  %59 = fptosi float %58 to i32
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %.preheader.preheader, label %._crit_edge60

.preheader.preheader:                             ; preds = %55
  %61 = getelementptr inbounds i8, ptr %3, i64 8
  %62 = getelementptr inbounds i8, ptr %3, i64 16
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %73
  %.059 = phi i32 [ %74, %73 ], [ 0, %.preheader.preheader ]
  %63 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %56, ptr noundef nonnull @.str.6, ptr noundef nonnull %3) #6
  %64 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %56, ptr noundef nonnull @.str.6, ptr noundef nonnull %61) #6
  %65 = call i32 (ptr, ptr, ...) @kml_fscanf(ptr noundef %56, ptr noundef nonnull @.str.6, ptr noundef nonnull %62) #6
  %66 = load i32, ptr @current_readahead_val, align 4, !tbaa !5
  %67 = call zeroext i1 @readahead_data_processing(ptr noundef nonnull %3, ptr noundef %0, i32 noundef %66, i1 noundef zeroext true, i1 noundef zeroext false, i64 noundef 0) #6
  br i1 %67, label %68, label %73

68:                                               ; preds = %.preheader
  %69 = call ptr @predict_readahead(ptr noundef %0) #6
  call void @ranking_matrix_distance(ptr noundef %69, ptr noundef %50, ptr noundef nonnull %6) #6
  %70 = load float, ptr %6, align 8, !tbaa !14
  %71 = fpext float %70 to double
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %71)
  call void @free_matrix(ptr noundef %69) #6
  br label %73

73:                                               ; preds = %.preheader, %68
  %74 = add nuw nsw i32 %.059, 1
  %exitcond67.not = icmp eq i32 %74, %59
  br i1 %exitcond67.not, label %._crit_edge60, label %.preheader, !llvm.loop !20

._crit_edge60:                                    ; preds = %73, %55
  %75 = load i32, ptr @current_readahead_val, align 4, !tbaa !5
  %76 = call zeroext i1 @readahead_data_processing(ptr noundef nonnull %3, ptr noundef %0, i32 noundef %75, i1 noundef zeroext true, i1 noundef zeroext true, i64 noundef 0) #6
  %77 = call i32 @kml_file_close(ptr noundef %56) #6
  call void @free_matrix(ptr noundef %50) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 255, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  ret void
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare ptr @allocate_matrix(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare ptr @kml_file_open(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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

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

declare void @matrix_mean_constant(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @free_matrix(ptr noundef) local_unnamed_addr #3

declare i32 @kml_file_close(ptr noundef) local_unnamed_addr #3

declare ptr @matrix_argsort(ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare zeroext i1 @readahead_data_processing(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext, i64 noundef) local_unnamed_addr #3

declare ptr @predict_readahead(ptr noundef) local_unnamed_addr #3

declare void @ranking_matrix_distance(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 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 = { noreturn 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 = { noreturn nounwind }

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

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


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