; LLVM IR from sh1l0h/ZINC :: src (camera)

; 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 @zinc_orthographic_projection(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 ptr, ptr %8, align 8, !tbaa !5
  call void @zinc_mat4_eye(ptr noundef %15)
  %16 = load float, ptr %13, align 4, !tbaa !9
  %17 = load float, ptr %14, align 4, !tbaa !9
  %18 = fsub float %16, %17
  %19 = fdiv float 2.000000e+00, %18
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = getelementptr inbounds [4 x float], ptr %20, i64 0
  %22 = getelementptr inbounds [4 x float], ptr %21, i64 0, i64 0
  store float %19, ptr %22, align 4, !tbaa !9
  %23 = load float, ptr %13, align 4, !tbaa !9
  %24 = load float, ptr %14, align 4, !tbaa !9
  %25 = fadd float %23, %24
  %26 = fneg float %25
  %27 = load float, ptr %13, align 4, !tbaa !9
  %28 = load float, ptr %14, align 4, !tbaa !9
  %29 = fsub float %27, %28
  %30 = fdiv float %26, %29
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds [4 x float], ptr %31, i64 0
  %33 = getelementptr inbounds [4 x float], ptr %32, i64 0, i64 3
  store float %30, ptr %33, align 4, !tbaa !9
  %34 = load float, ptr %11, align 4, !tbaa !9
  %35 = load float, ptr %12, align 4, !tbaa !9
  %36 = fsub float %34, %35
  %37 = fdiv float 2.000000e+00, %36
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds [4 x float], ptr %38, i64 1
  %40 = getelementptr inbounds [4 x float], ptr %39, i64 0, i64 1
  store float %37, ptr %40, align 4, !tbaa !9
  %41 = load float, ptr %11, align 4, !tbaa !9
  %42 = load float, ptr %12, align 4, !tbaa !9
  %43 = fadd float %41, %42
  %44 = fneg float %43
  %45 = load float, ptr %11, align 4, !tbaa !9
  %46 = load float, ptr %12, align 4, !tbaa !9
  %47 = fsub float %45, %46
  %48 = fdiv float %44, %47
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds [4 x float], ptr %49, i64 1
  %51 = getelementptr inbounds [4 x float], ptr %50, i64 0, i64 3
  store float %48, ptr %51, align 4, !tbaa !9
  %52 = load float, ptr %9, align 4, !tbaa !9
  %53 = load float, ptr %10, align 4, !tbaa !9
  %54 = fsub float %52, %53
  %55 = fdiv float 2.000000e+00, %54
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds [4 x float], ptr %56, i64 2
  %58 = getelementptr inbounds [4 x float], ptr %57, i64 0, i64 2
  store float %55, ptr %58, align 4, !tbaa !9
  %59 = load float, ptr %9, align 4, !tbaa !9
  %60 = load float, ptr %10, align 4, !tbaa !9
  %61 = fadd float %59, %60
  %62 = fneg float %61
  %63 = load float, ptr %9, align 4, !tbaa !9
  %64 = load float, ptr %10, align 4, !tbaa !9
  %65 = fsub float %63, %64
  %66 = fdiv float %62, %65
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = getelementptr inbounds [4 x float], ptr %67, i64 2
  %69 = getelementptr inbounds [4 x float], ptr %68, i64 0, i64 3
  store float %66, ptr %69, align 4, !tbaa !9
  ret void
}

declare void @zinc_mat4_eye(ptr noundef) #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" }

!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: nounwind uwtable
define dso_local void @zinc_orthographic_projection(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6) local_unnamed_addr #0 {
  tail call void @zinc_mat4_eye(ptr noundef %0) #2
  %8 = fsub float %5, %6
  %9 = fdiv float 2.000000e+00, %8
  store float %9, ptr %0, align 4, !tbaa !5
  %10 = fadd float %5, %6
  %11 = fneg float %10
  %12 = fdiv float %11, %8
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  store float %12, ptr %13, align 4, !tbaa !5
  %14 = fsub float %3, %4
  %15 = fdiv float 2.000000e+00, %14
  %16 = getelementptr inbounds i8, ptr %0, i64 20
  store float %15, ptr %16, align 4, !tbaa !5
  %17 = fadd float %3, %4
  %18 = fneg float %17
  %19 = fdiv float %18, %14
  %20 = getelementptr inbounds i8, ptr %0, i64 28
  store float %19, ptr %20, align 4, !tbaa !5
  %21 = fsub float %1, %2
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = fadd float %1, %2
  %24 = fneg float %23
  %25 = insertelement <2 x float> <float 2.000000e+00, float poison>, float %24, i64 1
  %26 = insertelement <2 x float> poison, float %21, i64 0
  %27 = shufflevector <2 x float> %26, <2 x float> poison, <2 x i32> zeroinitializer
  %28 = fdiv <2 x float> %25, %27
  store <2 x float> %28, ptr %22, align 4, !tbaa !5
  ret void
}

declare void @zinc_mat4_eye(ptr 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 = !{!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,SLPVectorizerPass,SROAPass,TailCallElimPass