; LLVM IR from tyoma/agge :: src/agge/dash.ll (ZN4agge4dash10add_vertexEffi)

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

%"class.agge::dash" = type { %"class.agge::vertex_sequence", ptr, ptr, float, float, float, %"struct.agge::point", i32, %"class.agge::pod_vector.0" }
%"class.agge::vertex_sequence" = type { %"class.agge::pod_vector" }
%"class.agge::pod_vector" = type { ptr, ptr, ptr }
%"struct.agge::point" = type { float, float }
%"class.agge::pod_vector.0" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4agge4dash10add_vertexEffi(ptr noundef nonnull align 8 dereferenceable(88) %0, float noundef %1, float noundef %2, i32 noundef %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  store float %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  %9 = load ptr, ptr %5, align 8
  %10 = call noundef zeroext i1 @_ZNK4agge10pod_vectorINS_6vertexEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %9)
  br i1 %10, label %11, label %18

11:                                               ; preds = %4
  %12 = load float, ptr %6, align 4, !tbaa !9
  %13 = getelementptr inbounds %"class.agge::dash", ptr %9, i32 0, i32 6
  %14 = getelementptr inbounds %"struct.agge::point", ptr %13, i32 0, i32 0
  store float %12, ptr %14, align 4, !tbaa !13
  %15 = load float, ptr %7, align 4, !tbaa !9
  %16 = getelementptr inbounds %"class.agge::dash", ptr %9, i32 0, i32 6
  %17 = getelementptr inbounds %"struct.agge::point", ptr %16, i32 0, i32 1
  store float %15, ptr %17, align 4, !tbaa !20
  br label %30

18:                                               ; preds = %4
  %19 = load i32, ptr %8, align 4, !tbaa !11
  %20 = and i32 %19, 32
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %29

22:                                               ; preds = %18
  %23 = getelementptr inbounds %"class.agge::dash", ptr %9, i32 0, i32 6
  %24 = getelementptr inbounds %"struct.agge::point", ptr %23, i32 0, i32 0
  %25 = load float, ptr %24, align 4, !tbaa !13
  %26 = getelementptr inbounds %"class.agge::dash", ptr %9, i32 0, i32 6
  %27 = getelementptr inbounds %"struct.agge::point", ptr %26, i32 0, i32 1
  %28 = load float, ptr %27, align 4, !tbaa !20
  call void @_ZN4agge19add_polyline_vertexINS_4dashEEEvRT_ffi(ptr noundef nonnull align 8 dereferenceable(88) %9, float noundef %25, float noundef %28, i32 noundef 2)
  br label %29

29:                                               ; preds = %22, %18
  br label %30

30:                                               ; preds = %29, %11
  %31 = load float, ptr %6, align 4, !tbaa !9
  %32 = load float, ptr %7, align 4, !tbaa !9
  %33 = load i32, ptr %8, align 4, !tbaa !11
  call void @_ZN4agge19add_polyline_vertexINS_4dashEEEvRT_ffi(ptr noundef nonnull align 8 dereferenceable(88) %9, float noundef %31, float noundef %32, i32 noundef %33)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4agge10pod_vectorINS_6vertexEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge19add_polyline_vertexINS_4dashEEEvRT_ffi(ptr noundef nonnull align 8 dereferenceable(88), float noundef, float noundef, i32 noundef) #2

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 = { inlinehint mustprogress 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 52}
!14 = !{!"_ZTSN4agge4dashE", !15, i64 0, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !17, i64 52, !18, i64 60, !19, i64 64}
!15 = !{!"_ZTSN4agge15vertex_sequenceE", !16, i64 0}
!16 = !{!"_ZTSN4agge10pod_vectorINS_6vertexEEE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"_ZTSN4agge5pointIfEE", !10, i64 0, !10, i64 4}
!18 = !{!"_ZTSN4agge4dash5stateE", !7, i64 0}
!19 = !{!"_ZTSN4agge10pod_vectorINS_4dash8dash_gapEEE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!14, !10, 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 uwtable
define dso_local void @_ZN4agge4dash10add_vertexEffi(ptr noundef nonnull align 8 dereferenceable(88) %0, float noundef %1, float noundef %2, i32 noundef %3) local_unnamed_addr #0 align 2 {
  %5 = tail call noundef zeroext i1 @_ZNK4agge10pod_vectorINS_6vertexEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  br i1 %5, label %6, label %9

6:                                                ; preds = %4
  %7 = getelementptr inbounds i8, ptr %0, i64 52
  store float %1, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  store float %2, ptr %8, align 8, !tbaa !16
  br label %16

9:                                                ; preds = %4
  %10 = and i32 %3, 32
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %16, label %11

11:                                               ; preds = %9
  %12 = getelementptr inbounds i8, ptr %0, i64 52
  %13 = load float, ptr %12, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 56
  %15 = load float, ptr %14, align 8, !tbaa !16
  tail call void @_ZN4agge19add_polyline_vertexINS_4dashEEEvRT_ffi(ptr noundef nonnull align 8 dereferenceable(88) %0, float noundef %13, float noundef %15, i32 noundef 2)
  br label %16

16:                                               ; preds = %9, %11, %6
  tail call void @_ZN4agge19add_polyline_vertexINS_4dashEEEvRT_ffi(ptr noundef nonnull align 8 dereferenceable(88) %0, float noundef %1, float noundef %2, i32 noundef %3)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4agge10pod_vectorINS_6vertexEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4agge19add_polyline_vertexINS_4dashEEEvRT_ffi(ptr noundef nonnull align 8 dereferenceable(88), float noundef, float noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 = { inlinehint mustprogress 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, !12, i64 52}
!6 = !{!"_ZTSN4agge4dashE", !7, i64 0, !9, i64 24, !9, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !13, i64 52, !14, i64 60, !15, i64 64}
!7 = !{!"_ZTSN4agge15vertex_sequenceE", !8, i64 0}
!8 = !{!"_ZTSN4agge10pod_vectorINS_6vertexEEE", !9, i64 0, !9, i64 8, !9, i64 16}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"float", !10, i64 0}
!13 = !{!"_ZTSN4agge5pointIfEE", !12, i64 0, !12, i64 4}
!14 = !{!"_ZTSN4agge4dash5stateE", !10, i64 0}
!15 = !{!"_ZTSN4agge10pod_vectorINS_4dash8dash_gapEEE", !9, i64 0, !9, i64 8, !9, i64 16}
!16 = !{!6, !12, i64 56}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass