; LLVM IR from paroj/gltut :: glsdk/freeglut/progs/demos/smooth_opengl3 (smooth_opengl3)

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

; Function Attrs: nounwind uwtable
define dso_local void @loadOrthof(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) #0 {
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store float %1, ptr %9, align 4, !tbaa !9
  store float %2, ptr %10, align 4, !tbaa !9
  store float %3, ptr %11, align 4, !tbaa !9
  store float %4, ptr %12, align 4, !tbaa !9
  store float %5, ptr %13, align 4, !tbaa !9
  store float %6, ptr %14, align 4, !tbaa !9
  %15 = load float, ptr %10, align 4, !tbaa !9
  %16 = load float, ptr %9, align 4, !tbaa !9
  %17 = fsub float %15, %16
  %18 = fdiv float 2.000000e+00, %17
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds float, ptr %19, i64 0
  store float %18, ptr %20, align 4, !tbaa !9
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds float, ptr %21, i64 1
  store float 0.000000e+00, ptr %22, align 4, !tbaa !9
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = getelementptr inbounds float, ptr %23, i64 2
  store float 0.000000e+00, ptr %24, align 4, !tbaa !9
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds float, ptr %25, i64 3
  store float 0.000000e+00, ptr %26, align 4, !tbaa !9
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds float, ptr %27, i64 4
  store float 0.000000e+00, ptr %28, align 4, !tbaa !9
  %29 = load float, ptr %12, align 4, !tbaa !9
  %30 = load float, ptr %11, align 4, !tbaa !9
  %31 = fsub float %29, %30
  %32 = fdiv float 2.000000e+00, %31
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds float, ptr %33, i64 5
  store float %32, ptr %34, align 4, !tbaa !9
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds float, ptr %35, i64 6
  store float 0.000000e+00, ptr %36, align 4, !tbaa !9
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds float, ptr %37, i64 7
  store float 0.000000e+00, ptr %38, align 4, !tbaa !9
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = getelementptr inbounds float, ptr %39, i64 8
  store float 0.000000e+00, ptr %40, align 4, !tbaa !9
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = getelementptr inbounds float, ptr %41, i64 9
  store float 0.000000e+00, ptr %42, align 4, !tbaa !9
  %43 = load float, ptr %14, align 4, !tbaa !9
  %44 = load float, ptr %13, align 4, !tbaa !9
  %45 = fsub float %43, %44
  %46 = fdiv float -2.000000e+00, %45
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds float, ptr %47, i64 10
  store float %46, ptr %48, align 4, !tbaa !9
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds float, ptr %49, i64 11
  store float 0.000000e+00, ptr %50, align 4, !tbaa !9
  %51 = load float, ptr %10, align 4, !tbaa !9
  %52 = load float, ptr %9, align 4, !tbaa !9
  %53 = fadd float %51, %52
  %54 = fneg float %53
  %55 = load float, ptr %10, align 4, !tbaa !9
  %56 = load float, ptr %9, align 4, !tbaa !9
  %57 = fsub float %55, %56
  %58 = fdiv float %54, %57
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = getelementptr inbounds float, ptr %59, i64 12
  store float %58, ptr %60, align 4, !tbaa !9
  %61 = load float, ptr %12, align 4, !tbaa !9
  %62 = load float, ptr %11, align 4, !tbaa !9
  %63 = fadd float %61, %62
  %64 = fneg float %63
  %65 = load float, ptr %12, align 4, !tbaa !9
  %66 = load float, ptr %11, align 4, !tbaa !9
  %67 = fsub float %65, %66
  %68 = fdiv float %64, %67
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds float, ptr %69, i64 13
  store float %68, ptr %70, align 4, !tbaa !9
  %71 = load float, ptr %14, align 4, !tbaa !9
  %72 = load float, ptr %13, align 4, !tbaa !9
  %73 = fadd float %71, %72
  %74 = fneg float %73
  %75 = load float, ptr %14, align 4, !tbaa !9
  %76 = load float, ptr %13, align 4, !tbaa !9
  %77 = fsub float %75, %76
  %78 = fdiv float %74, %77
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  %80 = getelementptr inbounds float, ptr %79, i64 14
  store float %78, ptr %80, align 4, !tbaa !9
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds float, ptr %81, i64 15
  store float 1.000000e+00, ptr %82, align 4, !tbaa !9
  ret void
}

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

!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 = !{!"float", !7, i64 0}


; 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 @loadOrthof(ptr nocapture noundef writeonly %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) local_unnamed_addr #0 {
  %8 = insertelement <2 x float> poison, float %2, i64 0
  %9 = insertelement <2 x float> %8, float %4, i64 1
  %10 = insertelement <2 x float> poison, float %1, i64 0
  %11 = insertelement <2 x float> %10, float %3, i64 1
  %12 = fsub <2 x float> %9, %11
  %13 = extractelement <2 x float> %12, i64 0
  %14 = fdiv float 2.000000e+00, %13
  store float %14, ptr %0, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 4
  %16 = extractelement <2 x float> %12, i64 1
  %17 = fdiv float 2.000000e+00, %16
  %18 = getelementptr inbounds i8, ptr %0, i64 20
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %15, i8 0, i64 16, i1 false)
  store float %17, ptr %18, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = fsub float %6, %5
  %21 = fdiv float -2.000000e+00, %20
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %19, i8 0, i64 16, i1 false)
  store float %21, ptr %22, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 44
  store float 0.000000e+00, ptr %23, align 4, !tbaa !5
  %24 = fadd <2 x float> %11, %9
  %25 = getelementptr inbounds i8, ptr %0, i64 48
  %26 = fneg <2 x float> %24
  %27 = fdiv <2 x float> %26, %12
  store <2 x float> %27, ptr %25, align 4, !tbaa !5
  %28 = fadd float %5, %6
  %29 = fneg float %28
  %30 = fdiv float %29, %20
  %31 = getelementptr inbounds i8, ptr %0, i64 56
  store float %30, ptr %31, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %0, i64 60
  store float 1.000000e+00, ptr %32, align 4, !tbaa !5
  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, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass