; LLVM IR from Discngine/fpocket :: src (descriptors)

; 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.s_desc = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, i32, [20 x i32], i32, i32, i32, float, float, i32, i32, i32, i32, i32, [255 x i8], [255 x i8], [8 x i8] }

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

; Function Attrs: nounwind uwtable
define dso_local void @reset_desc(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.s_desc, ptr %4, i32 0, i32 0
  store float 0.000000e+00, ptr %5, align 4, !tbaa !9
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.s_desc, ptr %6, i32 0, i32 1
  store float 0.000000e+00, ptr %7, align 4, !tbaa !13
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.s_desc, ptr %8, i32 0, i32 2
  store float 0.000000e+00, ptr %9, align 4, !tbaa !14
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.s_desc, ptr %10, i32 0, i32 4
  store float 0.000000e+00, ptr %11, align 4, !tbaa !15
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.s_desc, ptr %12, i32 0, i32 5
  store float 0.000000e+00, ptr %13, align 4, !tbaa !16
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.s_desc, ptr %14, i32 0, i32 6
  store float 0.000000e+00, ptr %15, align 4, !tbaa !17
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.s_desc, ptr %16, i32 0, i32 7
  store float 0.000000e+00, ptr %17, align 4, !tbaa !18
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.s_desc, ptr %18, i32 0, i32 8
  store float 0.000000e+00, ptr %19, align 4, !tbaa !19
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.s_desc, ptr %20, i32 0, i32 9
  store float 0.000000e+00, ptr %21, align 4, !tbaa !20
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.s_desc, ptr %22, i32 0, i32 10
  store float 0.000000e+00, ptr %23, align 4, !tbaa !21
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.s_desc, ptr %24, i32 0, i32 11
  store float 0.000000e+00, ptr %25, align 4, !tbaa !22
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.s_desc, ptr %26, i32 0, i32 12
  store float 0.000000e+00, ptr %27, align 4, !tbaa !23
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.s_desc, ptr %28, i32 0, i32 15
  store float 0.000000e+00, ptr %29, align 4, !tbaa !24
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.s_desc, ptr %30, i32 0, i32 14
  store float 0.000000e+00, ptr %31, align 4, !tbaa !25
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.s_desc, ptr %32, i32 0, i32 16
  store float 0.000000e+00, ptr %33, align 4, !tbaa !26
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.s_desc, ptr %34, i32 0, i32 13
  store float 0.000000e+00, ptr %35, align 4, !tbaa !27
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.s_desc, ptr %36, i32 0, i32 17
  store float 0.000000e+00, ptr %37, align 4, !tbaa !28
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.s_desc, ptr %38, i32 0, i32 29
  store i32 0, ptr %39, align 4, !tbaa !29
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.s_desc, ptr %40, i32 0, i32 30
  store i32 0, ptr %41, align 4, !tbaa !30
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.s_desc, ptr %42, i32 0, i32 31
  store i32 0, ptr %43, align 4, !tbaa !31
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.s_desc, ptr %44, i32 0, i32 24
  store float 0.000000e+00, ptr %45, align 4, !tbaa !32
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.s_desc, ptr %46, i32 0, i32 25
  store float 0.000000e+00, ptr %47, align 4, !tbaa !33
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.s_desc, ptr %48, i32 0, i32 26
  store float 0.000000e+00, ptr %49, align 4, !tbaa !34
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.s_desc, ptr %50, i32 0, i32 21
  store float 0.000000e+00, ptr %51, align 4, !tbaa !35
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.s_desc, ptr %52, i32 0, i32 22
  store float 0.000000e+00, ptr %53, align 4, !tbaa !36
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.s_desc, ptr %54, i32 0, i32 23
  store float 0.000000e+00, ptr %55, align 4, !tbaa !37
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.s_desc, ptr %56, i32 0, i32 18
  store float 0.000000e+00, ptr %57, align 4, !tbaa !38
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.s_desc, ptr %58, i32 0, i32 19
  store float 0.000000e+00, ptr %59, align 4, !tbaa !39
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.s_desc, ptr %60, i32 0, i32 20
  store float 0.000000e+00, ptr %61, align 4, !tbaa !40
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.s_desc, ptr %62, i32 0, i32 33
  store float 0.000000e+00, ptr %63, align 4, !tbaa !41
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s_desc, ptr %64, i32 0, i32 37
  store i32 0, ptr %65, align 4, !tbaa !42
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.s_desc, ptr %66, i32 0, i32 38
  store i32 0, ptr %67, align 4, !tbaa !43
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.s_desc, ptr %68, i32 0, i32 35
  store i32 0, ptr %69, align 4, !tbaa !44
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.s_desc, ptr %70, i32 0, i32 36
  store i32 0, ptr %71, align 4, !tbaa !45
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.s_desc, ptr %72, i32 0, i32 3
  store float 0.000000e+00, ptr %73, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !47
  br label %74

74:                                               ; preds = %83, %1
  %75 = load i32, ptr %3, align 4, !tbaa !47
  %76 = icmp slt i32 %75, 20
  br i1 %76, label %77, label %86

77:                                               ; preds = %74
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.s_desc, ptr %78, i32 0, i32 28
  %80 = load i32, ptr %3, align 4, !tbaa !47
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [20 x i32], ptr %79, i64 0, i64 %81
  store i32 0, ptr %82, align 4, !tbaa !47
  br label %83

83:                                               ; preds = %77
  %84 = load i32, ptr %3, align 4, !tbaa !47
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %3, align 4, !tbaa !47
  br label %74, !llvm.loop !48

86:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!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 = !{!"s_desc", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !12, i64 108, !7, i64 112, !12, i64 192, !12, i64 196, !12, i64 200, !11, i64 204, !11, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !7, i64 232, !7, i64 487, !7, i64 742}
!11 = !{!"float", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !11, i64 16}
!16 = !{!10, !11, i64 20}
!17 = !{!10, !11, i64 24}
!18 = !{!10, !11, i64 28}
!19 = !{!10, !11, i64 32}
!20 = !{!10, !11, i64 36}
!21 = !{!10, !11, i64 40}
!22 = !{!10, !11, i64 44}
!23 = !{!10, !11, i64 48}
!24 = !{!10, !11, i64 60}
!25 = !{!10, !11, i64 56}
!26 = !{!10, !11, i64 64}
!27 = !{!10, !11, i64 52}
!28 = !{!10, !11, i64 68}
!29 = !{!10, !12, i64 192}
!30 = !{!10, !12, i64 196}
!31 = !{!10, !12, i64 200}
!32 = !{!10, !11, i64 96}
!33 = !{!10, !11, i64 100}
!34 = !{!10, !11, i64 104}
!35 = !{!10, !11, i64 84}
!36 = !{!10, !11, i64 88}
!37 = !{!10, !11, i64 92}
!38 = !{!10, !11, i64 72}
!39 = !{!10, !11, i64 76}
!40 = !{!10, !11, i64 80}
!41 = !{!10, !11, i64 208}
!42 = !{!10, !12, i64 224}
!43 = !{!10, !12, i64 228}
!44 = !{!10, !12, i64 216}
!45 = !{!10, !12, i64 220}
!46 = !{!10, !11, i64 12}
!47 = !{!12, !12, i64 0}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}


; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @reset_desc(ptr nocapture noundef writeonly %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 208
  store float 0.000000e+00, ptr %2, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 216
  %4 = getelementptr inbounds i8, ptr %0, i64 112
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(108) %0, i8 0, i64 108, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(92) %4, i8 0, i64 92, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %3, i8 0, i64 16, i1 false)
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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 nounwind willreturn memory(argmem: write) }

!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 208}
!6 = !{!"s_desc", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !10, i64 108, !8, i64 112, !10, i64 192, !10, i64 196, !10, i64 200, !7, i64 204, !7, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !8, i64 232, !8, i64 487, !8, i64 742}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass