; LLVM IR from rolinh/dfc :: src/platform (services-linux)

; 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.fsmntinfo = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, double, double, i32, i64, i64, i64, i64, i64, i64, i64, i64, i32, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @compute_fs_stats(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.fsmntinfo, ptr %3, i32 0, i32 13
  %5 = load i64, ptr %4, align 8, !tbaa !9
  %6 = uitofp i64 %5 to double
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.fsmntinfo, ptr %7, i32 0, i32 14
  %9 = load i64, ptr %8, align 8, !tbaa !14
  %10 = uitofp i64 %9 to double
  %11 = fmul double %6, %10
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.fsmntinfo, ptr %12, i32 0, i32 8
  store double %11, ptr %13, align 8, !tbaa !15
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.fsmntinfo, ptr %14, i32 0, i32 13
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = uitofp i64 %16 to double
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.fsmntinfo, ptr %18, i32 0, i32 16
  %20 = load i64, ptr %19, align 8, !tbaa !16
  %21 = uitofp i64 %20 to double
  %22 = fmul double %17, %21
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.fsmntinfo, ptr %23, i32 0, i32 9
  store double %22, ptr %24, align 8, !tbaa !17
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.fsmntinfo, ptr %25, i32 0, i32 13
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = uitofp i64 %27 to double
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.fsmntinfo, ptr %29, i32 0, i32 14
  %31 = load i64, ptr %30, align 8, !tbaa !14
  %32 = uitofp i64 %31 to double
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.fsmntinfo, ptr %33, i32 0, i32 15
  %35 = load i64, ptr %34, align 8, !tbaa !18
  %36 = uitofp i64 %35 to double
  %37 = fsub double %32, %36
  %38 = fmul double %28, %37
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.fsmntinfo, ptr %39, i32 0, i32 10
  store double %38, ptr %40, align 8, !tbaa !19
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.fsmntinfo, ptr %41, i32 0, i32 8
  %43 = load double, ptr %42, align 8, !tbaa !15
  %44 = fptosi double %43 to i32
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %49

46:                                               ; preds = %1
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.fsmntinfo, ptr %47, i32 0, i32 7
  store double 1.000000e+02, ptr %48, align 8, !tbaa !20
  br label %63

49:                                               ; preds = %1
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.fsmntinfo, ptr %50, i32 0, i32 16
  %52 = load i64, ptr %51, align 8, !tbaa !16
  %53 = uitofp i64 %52 to double
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.fsmntinfo, ptr %54, i32 0, i32 14
  %56 = load i64, ptr %55, align 8, !tbaa !14
  %57 = uitofp i64 %56 to double
  %58 = fdiv double %53, %57
  %59 = fneg double %58
  %60 = call double @llvm.fmuladd.f64(double %59, double 1.000000e+02, double 1.000000e+02)
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.fsmntinfo, ptr %61, i32 0, i32 7
  store double %60, ptr %62, align 8, !tbaa !20
  br label %63

63:                                               ; preds = %49, %46
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !13, i64 104}
!10 = !{!"fsmntinfo", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !12, i64 88, !13, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !12, i64 160, !6, i64 168}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !13, i64 112}
!15 = !{!10, !11, i64 64}
!16 = !{!10, !13, i64 128}
!17 = !{!10, !11, i64 72}
!18 = !{!10, !13, i64 120}
!19 = !{!10, !11, i64 80}
!20 = !{!10, !11, i64 56}


; 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: readwrite) uwtable
define dso_local void @compute_fs_stats(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 104
  %3 = load i64, ptr %2, align 8, !tbaa !5
  %4 = uitofp i64 %3 to double
  %5 = getelementptr inbounds i8, ptr %0, i64 112
  %6 = load i64, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  %9 = load i64, ptr %8, align 8, !tbaa !14
  %10 = insertelement <2 x i64> poison, i64 %6, i64 0
  %11 = insertelement <2 x i64> %10, i64 %9, i64 1
  %12 = uitofp <2 x i64> %11 to <2 x double>
  %13 = insertelement <2 x double> poison, double %4, i64 0
  %14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
  %15 = fmul <2 x double> %14, %12
  store <2 x double> %15, ptr %7, align 8, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %0, i64 120
  %17 = load i64, ptr %16, align 8, !tbaa !16
  %18 = uitofp i64 %17 to double
  %19 = extractelement <2 x double> %12, i64 0
  %20 = fsub double %19, %18
  %21 = fmul double %20, %4
  %22 = getelementptr inbounds i8, ptr %0, i64 80
  store double %21, ptr %22, align 8, !tbaa !17
  %23 = extractelement <2 x double> %15, i64 0
  %24 = fptosi double %23 to i32
  %25 = icmp eq i32 %24, 0
  %26 = extractelement <2 x double> %12, i64 1
  %27 = fneg double %26
  %28 = fdiv double %27, %19
  %29 = tail call double @llvm.fmuladd.f64(double %28, double 1.000000e+02, double 1.000000e+02)
  %.sink = select i1 %25, double 1.000000e+02, double %29
  %30 = getelementptr inbounds i8, ptr %0, i64 56
  store double %.sink, ptr %30, align 8
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

!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, !12, i64 104}
!6 = !{!"fsmntinfo", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !11, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !11, i64 160, !7, i64 168}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !12, i64 112}
!14 = !{!6, !12, i64 128}
!15 = !{!10, !10, i64 0}
!16 = !{!6, !12, i64 120}
!17 = !{!6, !10, i64 80}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass