; LLVM IR from zchrissirhcz/pixel :: src (px_max_pooling)

; 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.px_pooling_param_t = type { i32, i32, i32, i32 }
%struct.px_size_t = type { i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local i64 @px_get_pooling_output_matrix_dim(i64, i64, i64) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @px_forward_max_pooling_layer_for_matrix(ptr noundef %0, i64 %1, i64 %2) #0 {
  %4 = alloca %struct.px_pooling_param_t, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.px_size_t, align 4
  %7 = alloca %struct.px_size_t, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  store i64 %1, ptr %26, align 4
  %27 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  store i64 %2, ptr %27, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call i64 @px_get_matrix_dim(ptr noundef %28)
  store i64 %29, ptr %6, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %30 = load i64, ptr %6, align 4
  %31 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 0
  %32 = load i64, ptr %31, align 4
  %33 = getelementptr inbounds { i64, i64 }, ptr %4, i32 0, i32 1
  %34 = load i64, ptr %33, align 4
  %35 = call i64 @px_get_pooling_output_matrix_dim(i64 %30, i64 %32, i64 %34)
  store i64 %35, ptr %7, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %36 = getelementptr inbounds %struct.px_pooling_param_t, ptr %4, i32 0, i32 0
  %37 = load i32, ptr %36, align 4, !tbaa !9
  store i32 %37, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %38 = getelementptr inbounds %struct.px_pooling_param_t, ptr %4, i32 0, i32 1
  %39 = load i32, ptr %38, align 4, !tbaa !13
  store i32 %39, ptr %9, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %40 = getelementptr inbounds %struct.px_size_t, ptr %6, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !14
  store i32 %41, ptr %10, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %42 = getelementptr inbounds %struct.px_size_t, ptr %6, i32 0, i32 0
  %43 = load i32, ptr %42, align 4, !tbaa !16
  store i32 %43, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %44 = getelementptr inbounds %struct.px_pooling_param_t, ptr %4, i32 0, i32 2
  %45 = load i32, ptr %44, align 4, !tbaa !17
  store i32 %45, ptr %12, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %46 = getelementptr inbounds %struct.px_pooling_param_t, ptr %4, i32 0, i32 3
  %47 = load i32, ptr %46, align 4, !tbaa !18
  store i32 %47, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %48 = load i64, ptr %7, align 4
  %49 = call ptr @px_create_matrix(i64 %48)
  store ptr %49, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !12
  br label %50

50:                                               ; preds = %123, %3
  %51 = load i32, ptr %15, align 4, !tbaa !12
  %52 = load i32, ptr %8, align 4, !tbaa !12
  %53 = add nsw i32 %51, %52
  %54 = sub nsw i32 %53, 1
  %55 = load i32, ptr %10, align 4, !tbaa !12
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %50
  store i32 2, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %127

58:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !12
  br label %59

59:                                               ; preds = %118, %58
  %60 = load i32, ptr %17, align 4, !tbaa !12
  %61 = load i32, ptr %9, align 4, !tbaa !12
  %62 = add nsw i32 %60, %61
  %63 = sub nsw i32 %62, 1
  %64 = load i32, ptr %11, align 4, !tbaa !12
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %59
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %122

67:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store float 0x3810000000000000, ptr %18, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store i32 0, ptr %19, align 4, !tbaa !12
  br label %68

68:                                               ; preds = %103, %67
  %69 = load i32, ptr %19, align 4, !tbaa !12
  %70 = load i32, ptr %8, align 4, !tbaa !12
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #3
  br label %106

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  store i32 0, ptr %20, align 4, !tbaa !12
  br label %74

74:                                               ; preds = %99, %73
  %75 = load i32, ptr %20, align 4, !tbaa !12
  %76 = load i32, ptr %9, align 4, !tbaa !12
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  br label %102

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %80 = load i32, ptr %15, align 4, !tbaa !12
  %81 = load i32, ptr %19, align 4, !tbaa !12
  %82 = add nsw i32 %80, %81
  store i32 %82, ptr %21, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  %83 = load i32, ptr %17, align 4, !tbaa !12
  %84 = load i32, ptr %20, align 4, !tbaa !12
  %85 = add nsw i32 %83, %84
  store i32 %85, ptr %22, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load i32, ptr %21, align 4, !tbaa !12
  %88 = load i32, ptr %22, align 4, !tbaa !12
  %89 = call float @px_get_matrix_value(ptr noundef %86, i32 noundef %87, i32 noundef %88)
  %90 = fptosi float %89 to i32
  store i32 %90, ptr %23, align 4, !tbaa !12
  %91 = load float, ptr %18, align 4, !tbaa !19
  %92 = load i32, ptr %23, align 4, !tbaa !12
  %93 = sitofp i32 %92 to float
  %94 = fcmp olt float %91, %93
  br i1 %94, label %95, label %98

95:                                               ; preds = %79
  %96 = load i32, ptr %23, align 4, !tbaa !12
  %97 = sitofp i32 %96 to float
  store float %97, ptr %18, align 4, !tbaa !19
  br label %98

98:                                               ; preds = %95, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %20, align 4, !tbaa !12
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %20, align 4, !tbaa !12
  br label %74, !llvm.loop !21

102:                                              ; preds = %78
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %19, align 4, !tbaa !12
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %19, align 4, !tbaa !12
  br label %68, !llvm.loop !23

106:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %107 = load i32, ptr %15, align 4, !tbaa !12
  %108 = load i32, ptr %12, align 4, !tbaa !12
  %109 = sdiv i32 %107, %108
  store i32 %109, ptr %24, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %110 = load i32, ptr %17, align 4, !tbaa !12
  %111 = load i32, ptr %13, align 4, !tbaa !12
  %112 = sdiv i32 %110, %111
  store i32 %112, ptr %25, align 4, !tbaa !12
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = load i32, ptr %24, align 4, !tbaa !12
  %115 = load i32, ptr %25, align 4, !tbaa !12
  %116 = load float, ptr %18, align 4, !tbaa !19
  %117 = call i32 @px_set_matrix_value(ptr noundef %113, i32 noundef %114, i32 noundef %115, float noundef %116)
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  br label %118

118:                                              ; preds = %106
  %119 = load i32, ptr %13, align 4, !tbaa !12
  %120 = load i32, ptr %17, align 4, !tbaa !12
  %121 = add nsw i32 %120, %119
  store i32 %121, ptr %17, align 4, !tbaa !12
  br label %59, !llvm.loop !24

122:                                              ; preds = %66
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %12, align 4, !tbaa !12
  %125 = load i32, ptr %15, align 4, !tbaa !12
  %126 = add nsw i32 %125, %124
  store i32 %126, ptr %15, align 4, !tbaa !12
  br label %50, !llvm.loop !25

127:                                              ; preds = %57
  %128 = load ptr, ptr %14, align 8, !tbaa !5
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  ret ptr %128
}

declare i64 @px_get_matrix_dim(ptr noundef) #2

declare ptr @px_create_matrix(i64) #2

declare float @px_get_matrix_value(ptr noundef, i32 noundef, i32 noundef) #2

declare i32 @px_set_matrix_value(ptr noundef, i32 noundef, i32 noundef, float noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!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, !11, i64 0}
!10 = !{!"px_pooling_param_t", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!15, !11, i64 4}
!15 = !{!"px_size_t", !11, i64 0, !11, i64 4}
!16 = !{!15, !11, i64 0}
!17 = !{!10, !11, i64 8}
!18 = !{!10, !11, i64 12}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}


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

; Function Attrs: nounwind uwtable
declare dso_local i64 @px_get_pooling_output_matrix_dim(i64, i64, i64) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @px_forward_max_pooling_layer_for_matrix(ptr noundef %0, i64 %1, i64 %2) local_unnamed_addr #0 {
  %.sroa.037.0.extract.trunc = trunc i64 %1 to i32
  %.sroa.3.0.extract.shift = lshr i64 %1, 32
  %.sroa.3.0.extract.trunc = trunc nuw i64 %.sroa.3.0.extract.shift to i32
  %.sroa.4.8.extract.trunc = trunc i64 %2 to i32
  %.sroa.7.8.extract.shift = lshr i64 %2, 32
  %.sroa.7.8.extract.trunc = trunc nuw i64 %.sroa.7.8.extract.shift to i32
  %4 = tail call i64 @px_get_matrix_dim(ptr noundef %0) #2
  %.sroa.033.0.extract.trunc = trunc i64 %4 to i32
  %.sroa.5.0.extract.shift = lshr i64 %4, 32
  %.sroa.5.0.extract.trunc = trunc nuw i64 %.sroa.5.0.extract.shift to i32
  %5 = tail call i64 @px_get_pooling_output_matrix_dim(i64 %4, i64 %1, i64 %2)
  %6 = tail call ptr @px_create_matrix(i64 %5) #2
  %.not61 = icmp sgt i32 %.sroa.037.0.extract.trunc, %.sroa.5.0.extract.trunc
  br i1 %.not61, label %._crit_edge65, label %.preheader47.lr.ph

.preheader47.lr.ph:                               ; preds = %3
  %.not4554 = icmp sgt i32 %.sroa.3.0.extract.trunc, %.sroa.033.0.extract.trunc
  %7 = icmp sgt i32 %.sroa.3.0.extract.trunc, 0
  br i1 %.not4554, label %._crit_edge65, label %.preheader47.lr.ph.split

.preheader47.lr.ph.split:                         ; preds = %.preheader47.lr.ph
  %8 = icmp sgt i32 %.sroa.037.0.extract.trunc, 0
  br i1 %8, label %.preheader47.lr.ph.split.split.us, label %.preheader47

.preheader47.lr.ph.split.split.us:                ; preds = %.preheader47.lr.ph.split
  br i1 %7, label %.preheader47.us66.us, label %.preheader47.us66

.preheader47.us66.us:                             ; preds = %.preheader47.lr.ph.split.split.us, %._crit_edge.split.us.split.us.us.us
  %.062.us67.us = phi i32 [ %23, %._crit_edge.split.us.split.us.us.us ], [ 0, %.preheader47.lr.ph.split.split.us ]
  br label %.preheader46.us.us.us.us

.preheader46.us.us.us.us:                         ; preds = %._crit_edge52.split.us.us.us.us.us, %.preheader47.us66.us
  %.04055.us.us.us.us = phi i32 [ 0, %.preheader47.us66.us ], [ %21, %._crit_edge52.split.us.us.us.us.us ]
  br label %.preheader.us.us.us.us.us

.preheader.us.us.us.us.us:                        ; preds = %._crit_edge.us.us.us.us.us, %.preheader46.us.us.us.us
  %.04151.us.us.us.us.us = phi float [ 0x3810000000000000, %.preheader46.us.us.us.us ], [ %.2.us.us.us.us.us, %._crit_edge.us.us.us.us.us ]
  %.04250.us.us.us.us.us = phi i32 [ 0, %.preheader46.us.us.us.us ], [ %17, %._crit_edge.us.us.us.us.us ]
  %9 = add nsw i32 %.04250.us.us.us.us.us, %.062.us67.us
  br label %10

10:                                               ; preds = %10, %.preheader.us.us.us.us.us
  %.149.us.us.us.us.us = phi float [ %.04151.us.us.us.us.us, %.preheader.us.us.us.us.us ], [ %.2.us.us.us.us.us, %10 ]
  %.04348.us.us.us.us.us = phi i32 [ 0, %.preheader.us.us.us.us.us ], [ %16, %10 ]
  %11 = add nsw i32 %.04348.us.us.us.us.us, %.04055.us.us.us.us
  %12 = tail call float @px_get_matrix_value(ptr noundef %0, i32 noundef %9, i32 noundef %11) #2
  %13 = fptosi float %12 to i32
  %14 = sitofp i32 %13 to float
  %15 = fcmp olt float %.149.us.us.us.us.us, %14
  %.2.us.us.us.us.us = select i1 %15, float %14, float %.149.us.us.us.us.us
  %16 = add nuw nsw i32 %.04348.us.us.us.us.us, 1
  %exitcond.not = icmp eq i32 %16, %.sroa.3.0.extract.trunc
  br i1 %exitcond.not, label %._crit_edge.us.us.us.us.us, label %10, !llvm.loop !5

._crit_edge.us.us.us.us.us:                       ; preds = %10
  %17 = add nuw nsw i32 %.04250.us.us.us.us.us, 1
  %exitcond77.not = icmp eq i32 %17, %.sroa.037.0.extract.trunc
  br i1 %exitcond77.not, label %._crit_edge52.split.us.us.us.us.us, label %.preheader.us.us.us.us.us, !llvm.loop !7

._crit_edge52.split.us.us.us.us.us:               ; preds = %._crit_edge.us.us.us.us.us
  %18 = sdiv i32 %.062.us67.us, %.sroa.4.8.extract.trunc
  %19 = sdiv i32 %.04055.us.us.us.us, %.sroa.7.8.extract.trunc
  %20 = tail call i32 @px_set_matrix_value(ptr noundef %6, i32 noundef %18, i32 noundef %19, float noundef %.2.us.us.us.us.us) #2
  %21 = add nsw i32 %.04055.us.us.us.us, %.sroa.7.8.extract.trunc
  %22 = add nsw i32 %21, %.sroa.3.0.extract.trunc
  %.not45.us.us.us.us = icmp sgt i32 %22, %.sroa.033.0.extract.trunc
  br i1 %.not45.us.us.us.us, label %._crit_edge.split.us.split.us.us.us, label %.preheader46.us.us.us.us, !llvm.loop !8

._crit_edge.split.us.split.us.us.us:              ; preds = %._crit_edge52.split.us.us.us.us.us
  %23 = add nsw i32 %.062.us67.us, %.sroa.4.8.extract.trunc
  %24 = add nsw i32 %23, %.sroa.037.0.extract.trunc
  %.not.us68.us = icmp sgt i32 %24, %.sroa.5.0.extract.trunc
  br i1 %.not.us68.us, label %._crit_edge65, label %.preheader47.us66.us, !llvm.loop !9

.preheader47.us66:                                ; preds = %.preheader47.lr.ph.split.split.us, %._crit_edge.split.us.split.us72
  %.062.us67 = phi i32 [ %30, %._crit_edge.split.us.split.us72 ], [ 0, %.preheader47.lr.ph.split.split.us ]
  %25 = sdiv i32 %.062.us67, %.sroa.4.8.extract.trunc
  br label %.preheader46.us.us69

.preheader46.us.us69:                             ; preds = %.preheader47.us66, %.preheader46.us.us69
  %.04055.us.us70 = phi i32 [ 0, %.preheader47.us66 ], [ %28, %.preheader46.us.us69 ]
  %26 = sdiv i32 %.04055.us.us70, %.sroa.7.8.extract.trunc
  %27 = tail call i32 @px_set_matrix_value(ptr noundef %6, i32 noundef %25, i32 noundef %26, float noundef 0x3810000000000000) #2
  %28 = add nsw i32 %.04055.us.us70, %.sroa.7.8.extract.trunc
  %29 = add nsw i32 %28, %.sroa.3.0.extract.trunc
  %.not45.us.us71 = icmp sgt i32 %29, %.sroa.033.0.extract.trunc
  br i1 %.not45.us.us71, label %._crit_edge.split.us.split.us72, label %.preheader46.us.us69, !llvm.loop !8

._crit_edge.split.us.split.us72:                  ; preds = %.preheader46.us.us69
  %30 = add nsw i32 %.062.us67, %.sroa.4.8.extract.trunc
  %31 = add nsw i32 %30, %.sroa.037.0.extract.trunc
  %.not.us68 = icmp sgt i32 %31, %.sroa.5.0.extract.trunc
  br i1 %.not.us68, label %._crit_edge65, label %.preheader47.us66, !llvm.loop !9

.preheader47:                                     ; preds = %.preheader47.lr.ph.split, %._crit_edge.split
  %.062 = phi i32 [ %37, %._crit_edge.split ], [ 0, %.preheader47.lr.ph.split ]
  %32 = sdiv i32 %.062, %.sroa.4.8.extract.trunc
  br label %.preheader46

._crit_edge65:                                    ; preds = %._crit_edge.split, %._crit_edge.split.us.split.us72, %._crit_edge.split.us.split.us.us.us, %.preheader47.lr.ph, %3
  ret ptr %6

.preheader46:                                     ; preds = %.preheader47, %.preheader46
  %.04055 = phi i32 [ 0, %.preheader47 ], [ %35, %.preheader46 ]
  %33 = sdiv i32 %.04055, %.sroa.7.8.extract.trunc
  %34 = tail call i32 @px_set_matrix_value(ptr noundef %6, i32 noundef %32, i32 noundef %33, float noundef 0x3810000000000000) #2
  %35 = add nsw i32 %.04055, %.sroa.7.8.extract.trunc
  %36 = add nsw i32 %35, %.sroa.3.0.extract.trunc
  %.not45 = icmp sgt i32 %36, %.sroa.033.0.extract.trunc
  br i1 %.not45, label %._crit_edge.split, label %.preheader46, !llvm.loop !8

._crit_edge.split:                                ; preds = %.preheader46
  %37 = add nsw i32 %.062, %.sroa.4.8.extract.trunc
  %38 = add nsw i32 %37, %.sroa.037.0.extract.trunc
  %.not = icmp sgt i32 %38, %.sroa.5.0.extract.trunc
  br i1 %.not, label %._crit_edge65, label %.preheader47, !llvm.loop !9
}

declare i64 @px_get_matrix_dim(ptr noundef) local_unnamed_addr #1

declare ptr @px_create_matrix(i64) local_unnamed_addr #1

declare float @px_get_matrix_value(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare i32 @px_set_matrix_value(ptr noundef, i32 noundef, i32 noundef, float noundef) local_unnamed_addr #1

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 = { "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 }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6}
!9 = distinct !{!9, !6}


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