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

; 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.readahead_model_config = type { float, float, i32, i32, i32 }
%union.val = type { double }
%struct.readahead_class_net = type { i32, ptr, ptr, ptr, ptr, %struct.model_data, %struct.model_multithreading, %struct.model_state, ptr, ptr, %struct.readahead_net_data_stat, %struct.readahead_norm_data_stat, float, i32 }
%struct.model_data = type { ptr, ptr, ptr, ptr }
%struct.model_multithreading = type { [32 x %struct.mt_buffer], [32 x i32], i32, i32, i32, i64, ptr }
%struct.mt_buffer = type { ptr, ptr }
%struct.model_state = type { i8, i32 }
%struct.readahead_net_data_stat = type { i64, double, double }
%struct.readahead_norm_data_stat = type { i64, ptr, ptr, ptr, ptr }
%struct.matrix = type { i32, i32, i32, %union.anon }
%union.anon = type { ptr }
%struct.layers = type { ptr, ptr }
%struct.layer = type { ptr, i32, ptr, ptr }

@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@input_matrix = external hidden global ptr, align 8
@output_matrix = external hidden global ptr, align 8
@__const.main.modula_f = external hidden unnamed_addr constant { float, [4 x i8] }, align 8
@.str.6 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [78 x i8], align 1

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

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

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

declare i32 @kml_file_close(ptr noundef) #1

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

declare ptr @matrix_zscore(ptr noundef, i32 noundef) #1

declare void @free_matrix(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.readahead_model_config, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %union.val, align 8
  %12 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 1000, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store ptr null, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 @__const.main.modula_f, i64 8, i1 false)
  %13 = getelementptr inbounds %struct.readahead_model_config, ptr %4, i32 0, i32 2
  store i32 1442, ptr %13, align 4, !tbaa !11
  %14 = getelementptr inbounds %struct.readahead_model_config, ptr %4, i32 0, i32 0
  store float 0x3F847AE140000000, ptr %14, align 4, !tbaa !14
  %15 = getelementptr inbounds %struct.readahead_model_config, ptr %4, i32 0, i32 1
  store float 0x3FEFAE1480000000, ptr %15, align 4, !tbaa !15
  %16 = getelementptr inbounds %struct.readahead_model_config, ptr %4, i32 0, i32 3
  store i32 5, ptr %16, align 4, !tbaa !16
  %17 = getelementptr inbounds %struct.readahead_model_config, ptr %4, i32 0, i32 4
  store i32 1, ptr %17, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %18 = call ptr @build_readahead_class_net(ptr noundef %4)
  store ptr %18, ptr %12, align 8, !tbaa !9
  %19 = load ptr, ptr %12, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.readahead_class_net, ptr %19, i32 0, i32 7
  %21 = getelementptr inbounds %struct.model_state, ptr %20, i32 0, i32 0
  store atomic i8 1, ptr %21 seq_cst, align 1, !tbaa !18
  %22 = load ptr, ptr %12, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.readahead_class_net, ptr %22, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !27
  %25 = getelementptr inbounds %union.val, ptr %11, i32 0, i32 0
  %26 = load i64, ptr %25, align 8
  call void @set_random_weights(ptr noundef %24, i64 %26)
  %27 = load ptr, ptr %12, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.readahead_class_net, ptr %27, i32 0, i32 13
  %29 = load i32, ptr %28, align 4, !tbaa !28
  %30 = call ptr @allocate_matrix(i32 noundef 1442, i32 noundef 5, i32 noundef %29)
  store ptr %30, ptr @input_matrix, align 8, !tbaa !9
  %31 = call ptr @allocate_matrix(i32 noundef 1442, i32 noundef 1, i32 noundef 0)
  store ptr %31, ptr @output_matrix, align 8, !tbaa !9
  %32 = call ptr @kml_file_open(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 0)
  store ptr %32, ptr %5, align 8, !tbaa !9
  %33 = call ptr @kml_file_open(ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 0)
  store ptr %33, ptr %6, align 8, !tbaa !9
  %34 = call ptr @kml_file_open(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 2)
  store ptr %34, ptr %7, align 8, !tbaa !9
  %35 = call ptr @kml_file_open(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 2)
  store ptr %35, ptr %8, align 8, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !9
  %37 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  call void @load_matrix_from_file(ptr noundef %36, ptr noundef %37)
  %38 = load ptr, ptr %6, align 8, !tbaa !9
  %39 = load ptr, ptr @output_matrix, align 8, !tbaa !9
  call void @load_matrix_from_file(ptr noundef %38, ptr noundef %39)
  %40 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  %41 = call ptr @matrix_mean(ptr noundef %40, i32 noundef 1)
  store ptr %41, ptr %9, align 8, !tbaa !9
  %42 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  %43 = load ptr, ptr %9, align 8, !tbaa !9
  %44 = call ptr @matrix_stddev(ptr noundef %42, ptr noundef %43, i32 noundef 1)
  store ptr %44, ptr %10, align 8, !tbaa !9
  %45 = load ptr, ptr %8, align 8, !tbaa !9
  %46 = load ptr, ptr %9, align 8, !tbaa !9
  call void @save_matrix_to_file(ptr noundef %45, ptr noundef %46)
  %47 = load ptr, ptr %7, align 8, !tbaa !9
  %48 = load ptr, ptr %10, align 8, !tbaa !9
  call void @save_matrix_to_file(ptr noundef %47, ptr noundef %48)
  %49 = load ptr, ptr %8, align 8, !tbaa !9
  %50 = call i32 @kml_file_close(ptr noundef %49)
  %51 = load ptr, ptr %7, align 8, !tbaa !9
  %52 = call i32 @kml_file_close(ptr noundef %51)
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = call i32 @kml_file_close(ptr noundef %53)
  %55 = load ptr, ptr %6, align 8, !tbaa !9
  %56 = call i32 @kml_file_close(ptr noundef %55)
  %57 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  %58 = call ptr @matrix_zscore(ptr noundef %57, i32 noundef 1)
  store ptr %58, ptr @input_matrix, align 8, !tbaa !9
  %59 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.readahead_class_net, ptr %60, i32 0, i32 5
  %62 = getelementptr inbounds %struct.model_data, ptr %61, i32 0, i32 0
  store ptr %59, ptr %62, align 8, !tbaa !29
  %63 = load ptr, ptr @output_matrix, align 8, !tbaa !9
  %64 = load ptr, ptr %12, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.readahead_class_net, ptr %64, i32 0, i32 5
  %66 = getelementptr inbounds %struct.model_data, ptr %65, i32 0, i32 1
  store ptr %63, ptr %66, align 8, !tbaa !30
  %67 = load ptr, ptr %12, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.readahead_class_net, ptr %67, i32 0, i32 11
  %69 = load ptr, ptr %9, align 8, !tbaa !9
  %70 = load ptr, ptr %10, align 8, !tbaa !9
  %71 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.matrix, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 8, !tbaa !31
  call void @set_readahead_data(ptr noundef %68, ptr noundef %69, ptr noundef %70, i32 noundef %73)
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %91, %0
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %78, label %94

78:                                               ; preds = %74
  %79 = load ptr, ptr %12, align 8, !tbaa !9
  call void @readahead_class_net_train(ptr noundef %79)
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = srem i32 %80, 1000
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %78
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = load ptr, ptr %12, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.readahead_class_net, ptr %85, i32 0, i32 12
  %87 = load float, ptr %86, align 8, !tbaa !33
  %88 = fpext float %87 to double
  %89 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %84, double noundef %88)
  br label %90

90:                                               ; preds = %83, %78
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %3, align 4, !tbaa !5
  br label %74, !llvm.loop !34

94:                                               ; preds = %74
  %95 = load ptr, ptr %12, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.readahead_class_net, ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !27
  call void @print_weigths(ptr noundef %97)
  %98 = load ptr, ptr %12, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.readahead_class_net, ptr %98, i32 0, i32 3
  %100 = load ptr, ptr %99, align 8, !tbaa !27
  call void @print_biases(ptr noundef %100)
  %101 = load ptr, ptr %12, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.readahead_class_net, ptr %101, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !27
  %104 = getelementptr inbounds %struct.layers, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !36
  call void @save_weights_biases_to_file(ptr noundef %105, ptr noundef @.str.12, ptr noundef @.str.13)
  %106 = load ptr, ptr %12, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.readahead_class_net, ptr %106, i32 0, i32 3
  %108 = load ptr, ptr %107, align 8, !tbaa !27
  %109 = getelementptr inbounds %struct.layers, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !36
  %111 = getelementptr inbounds %struct.layer, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !38
  %113 = getelementptr inbounds %struct.layer, ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !38
  call void @save_weights_biases_to_file(ptr noundef %114, ptr noundef @.str.14, ptr noundef @.str.15)
  %115 = load ptr, ptr %12, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.readahead_class_net, ptr %115, i32 0, i32 3
  %117 = load ptr, ptr %116, align 8, !tbaa !27
  %118 = getelementptr inbounds %struct.layers, ptr %117, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !40
  call void @save_weights_biases_to_file(ptr noundef %119, ptr noundef @.str.16, ptr noundef @.str.17)
  %120 = load ptr, ptr %12, align 8, !tbaa !9
  call void @clean_readahead_class_net(ptr noundef %120)
  %121 = load ptr, ptr @input_matrix, align 8, !tbaa !9
  call void @free_matrix(ptr noundef %121)
  %122 = load ptr, ptr @output_matrix, align 8, !tbaa !9
  call void @free_matrix(ptr noundef %122)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %123 = load i32, ptr %1, align 4
  ret i32 %123
}

; 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) #3

declare ptr @build_readahead_class_net(ptr noundef) #1

declare void @set_random_weights(ptr noundef, i64) #1

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

declare void @load_matrix_from_file(ptr noundef, ptr noundef) #1

declare ptr @matrix_mean(ptr noundef, i32 noundef) #1

declare ptr @matrix_stddev(ptr noundef, ptr noundef, i32 noundef) #1

declare void @save_matrix_to_file(ptr noundef, ptr noundef) #1

declare void @set_readahead_data(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #1

declare void @readahead_class_net_train(ptr noundef) #1

declare void @print_weigths(ptr noundef) #1

declare void @print_biases(ptr noundef) #1

declare void @save_weights_biases_to_file(ptr noundef, ptr noundef, ptr noundef) #1

declare void @clean_readahead_class_net(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"readahead_model_config", !13, i64 0, !13, i64 4, !6, i64 8, !6, i64 12, !6, i64 16}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!12, !13, i64 4}
!16 = !{!12, !6, i64 12}
!17 = !{!12, !6, i64 16}
!18 = !{!19, !7, i64 744}
!19 = !{!"readahead_class_net", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !20, i64 40, !21, i64 72, !23, i64 744, !10, i64 752, !10, i64 760, !24, i64 768, !26, i64 792, !13, i64 832, !6, i64 836}
!20 = !{!"model_data", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!21 = !{!"model_multithreading", !7, i64 0, !7, i64 512, !7, i64 640, !7, i64 644, !7, i64 648, !22, i64 656, !10, i64 664}
!22 = !{!"long", !7, i64 0}
!23 = !{!"model_state", !7, i64 0, !7, i64 4}
!24 = !{!"readahead_net_data_stat", !22, i64 0, !25, i64 8, !25, i64 16}
!25 = !{!"double", !7, i64 0}
!26 = !{!"readahead_norm_data_stat", !22, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!27 = !{!19, !10, i64 24}
!28 = !{!19, !6, i64 836}
!29 = !{!19, !10, i64 40}
!30 = !{!19, !10, i64 48}
!31 = !{!32, !6, i64 0}
!32 = !{!"matrix", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 16}
!33 = !{!19, !13, i64 832}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!37, !10, i64 0}
!37 = !{!"layers", !10, i64 0, !10, i64 8}
!38 = !{!39, !10, i64 16}
!39 = !{!"layer", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 24}
!40 = !{!37, !10, i64 8}


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

@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@input_matrix = external hidden local_unnamed_addr global ptr, align 8
@output_matrix = external hidden local_unnamed_addr global ptr, align 8
@__const.main.modula_f = external hidden unnamed_addr constant { float, [4 x i8] }, align 8
@.str.6 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [78 x i8], align 1

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

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

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

declare i32 @kml_file_close(ptr noundef) local_unnamed_addr #1

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

declare ptr @matrix_zscore(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @free_matrix(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
.peel.next:
  %0 = alloca %struct.readahead_model_config, align 8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %0) #4
  %.sroa.0.0.copyload = load i64, ptr @__const.main.modula_f, align 8
  %1 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 1442, ptr %1, align 8, !tbaa !5
  store <2 x float> <float 0x3F847AE140000000, float 0x3FEFAE1480000000>, ptr %0, align 8, !tbaa !11
  %2 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 5, ptr %2, align 4, !tbaa !12
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 1, ptr %3, align 8, !tbaa !13
  %4 = call ptr @build_readahead_class_net(ptr noundef nonnull %0) #4
  %5 = getelementptr inbounds i8, ptr %4, i64 744
  store atomic i8 1, ptr %5 seq_cst, align 1, !tbaa !14
  %6 = getelementptr inbounds i8, ptr %4, i64 24
  %7 = load ptr, ptr %6, align 8, !tbaa !24
  call void @set_random_weights(ptr noundef %7, i64 %.sroa.0.0.copyload) #4
  %8 = getelementptr inbounds i8, ptr %4, i64 836
  %9 = load i32, ptr %8, align 4, !tbaa !25
  %10 = call ptr @allocate_matrix(i32 noundef 1442, i32 noundef 5, i32 noundef %9) #4
  store ptr %10, ptr @input_matrix, align 8, !tbaa !26
  %11 = call ptr @allocate_matrix(i32 noundef 1442, i32 noundef 1, i32 noundef 0) #4
  store ptr %11, ptr @output_matrix, align 8, !tbaa !26
  %12 = call ptr @kml_file_open(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 0) #4
  %13 = call ptr @kml_file_open(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 0) #4
  %14 = call ptr @kml_file_open(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 2) #4
  %15 = call ptr @kml_file_open(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 2) #4
  %16 = load ptr, ptr @input_matrix, align 8, !tbaa !26
  call void @load_matrix_from_file(ptr noundef %12, ptr noundef %16) #4
  %17 = load ptr, ptr @output_matrix, align 8, !tbaa !26
  call void @load_matrix_from_file(ptr noundef %13, ptr noundef %17) #4
  %18 = load ptr, ptr @input_matrix, align 8, !tbaa !26
  %19 = call ptr @matrix_mean(ptr noundef %18, i32 noundef 1) #4
  %20 = load ptr, ptr @input_matrix, align 8, !tbaa !26
  %21 = call ptr @matrix_stddev(ptr noundef %20, ptr noundef %19, i32 noundef 1) #4
  call void @save_matrix_to_file(ptr noundef %15, ptr noundef %19) #4
  call void @save_matrix_to_file(ptr noundef %14, ptr noundef %21) #4
  %22 = call i32 @kml_file_close(ptr noundef %15) #4
  %23 = call i32 @kml_file_close(ptr noundef %14) #4
  %24 = call i32 @kml_file_close(ptr noundef %12) #4
  %25 = call i32 @kml_file_close(ptr noundef %13) #4
  %26 = load ptr, ptr @input_matrix, align 8, !tbaa !26
  %27 = call ptr @matrix_zscore(ptr noundef %26, i32 noundef 1) #4
  store ptr %27, ptr @input_matrix, align 8, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr %27, ptr %28, align 8, !tbaa !27
  %29 = load ptr, ptr @output_matrix, align 8, !tbaa !26
  %30 = getelementptr inbounds i8, ptr %4, i64 48
  store ptr %29, ptr %30, align 8, !tbaa !28
  %31 = getelementptr inbounds i8, ptr %4, i64 792
  %32 = load i32, ptr %27, align 8, !tbaa !29
  call void @set_readahead_data(ptr noundef nonnull %31, ptr noundef %19, ptr noundef %21, i32 noundef %32) #4
  call void @readahead_class_net_train(ptr noundef %4) #4
  %33 = getelementptr inbounds i8, ptr %4, i64 832
  %34 = load float, ptr %33, align 8, !tbaa !31
  %35 = fpext float %34 to double
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef 0, double noundef %35)
  br label %37

37:                                               ; preds = %37, %.peel.next
  %.032 = phi i32 [ 1, %.peel.next ], [ %38, %37 ]
  call void @readahead_class_net_train(ptr noundef %4) #4
  %38 = add nuw nsw i32 %.032, 1
  %exitcond.not = icmp eq i32 %38, 1000
  br i1 %exitcond.not, label %.loopexit, label %37, !llvm.loop !32

.loopexit:                                        ; preds = %37
  %39 = load ptr, ptr %6, align 8, !tbaa !24
  call void @print_weigths(ptr noundef %39) #4
  %40 = load ptr, ptr %6, align 8, !tbaa !24
  call void @print_biases(ptr noundef %40) #4
  %41 = load ptr, ptr %6, align 8, !tbaa !24
  %42 = load ptr, ptr %41, align 8, !tbaa !35
  call void @save_weights_biases_to_file(ptr noundef %42, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13) #4
  %43 = load ptr, ptr %6, align 8, !tbaa !24
  %44 = load ptr, ptr %43, align 8, !tbaa !35
  %45 = getelementptr inbounds i8, ptr %44, i64 16
  %46 = load ptr, ptr %45, align 8, !tbaa !37
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %48 = load ptr, ptr %47, align 8, !tbaa !37
  call void @save_weights_biases_to_file(ptr noundef %48, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.15) #4
  %49 = load ptr, ptr %6, align 8, !tbaa !24
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !39
  call void @save_weights_biases_to_file(ptr noundef %51, ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.17) #4
  call void @clean_readahead_class_net(ptr noundef %4) #4
  %52 = load ptr, ptr @input_matrix, align 8, !tbaa !26
  call void @free_matrix(ptr noundef %52) #4
  %53 = load ptr, ptr @output_matrix, align 8, !tbaa !26
  call void @free_matrix(ptr noundef %53) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %0) #4
  ret i32 0
}

declare ptr @build_readahead_class_net(ptr noundef) local_unnamed_addr #1

declare void @set_random_weights(ptr noundef, i64) local_unnamed_addr #1

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

declare void @load_matrix_from_file(ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @matrix_mean(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @matrix_stddev(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @save_matrix_to_file(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @set_readahead_data(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @readahead_class_net_train(ptr noundef) local_unnamed_addr #1

declare void @print_weigths(ptr noundef) local_unnamed_addr #1

declare void @print_biases(ptr noundef) local_unnamed_addr #1

declare void @save_weights_biases_to_file(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @clean_readahead_class_net(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #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 = { 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 8}
!6 = !{!"readahead_model_config", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 12, !10, i64 16}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !10, i64 12}
!13 = !{!6, !10, i64 16}
!14 = !{!15, !8, i64 744}
!15 = !{!"readahead_class_net", !10, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !17, i64 40, !18, i64 72, !20, i64 744, !16, i64 752, !16, i64 760, !21, i64 768, !23, i64 792, !7, i64 832, !10, i64 836}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"model_data", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!18 = !{!"model_multithreading", !8, i64 0, !8, i64 512, !8, i64 640, !8, i64 644, !8, i64 648, !19, i64 656, !16, i64 664}
!19 = !{!"long", !8, i64 0}
!20 = !{!"model_state", !8, i64 0, !8, i64 4}
!21 = !{!"readahead_net_data_stat", !19, i64 0, !22, i64 8, !22, i64 16}
!22 = !{!"double", !8, i64 0}
!23 = !{!"readahead_norm_data_stat", !19, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32}
!24 = !{!15, !16, i64 24}
!25 = !{!15, !10, i64 836}
!26 = !{!16, !16, i64 0}
!27 = !{!15, !16, i64 40}
!28 = !{!15, !16, i64 48}
!29 = !{!30, !10, i64 0}
!30 = !{!"matrix", !10, i64 0, !10, i64 4, !10, i64 8, !8, i64 16}
!31 = !{!15, !7, i64 832}
!32 = distinct !{!32, !33, !34}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!"llvm.loop.peeled.count", i32 1}
!35 = !{!36, !16, i64 0}
!36 = !{!"layers", !16, i64 0, !16, i64 8}
!37 = !{!38, !16, i64 16}
!38 = !{!"layer", !16, i64 0, !10, i64 8, !16, i64 16, !16, i64 24}
!39 = !{!36, !16, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,PostOrderFunctionAttrsPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass