; LLVM IR from NotManyIdeasDev/double-pendulum-sim :: double-pendulum-sim/Libraries/raygui-2.8/examples/controls_test_suite (GuiImageButton)

; 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.Texture = type { i32, i32, i32, i32, i32 }
%struct.Rectangle = type { float, float, float, float }

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @GuiImageButton(<2 x float> %0, <2 x float> %1, ptr noundef %2, ptr noundef byval(%struct.Texture) align 8 %3) #0 {
  %5 = alloca %struct.Rectangle, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %struct.Rectangle, align 4
  %8 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %0, ptr %8, align 4
  %9 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %1, ptr %9, align 4
  store ptr %2, ptr %6, align 8, !tbaa !5
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 0
  store float 0.000000e+00, ptr %11, align 4, !tbaa !9
  %12 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 1
  store float 0.000000e+00, ptr %12, align 4, !tbaa !12
  %13 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 2
  %14 = getelementptr inbounds %struct.Texture, ptr %3, i32 0, i32 1
  %15 = load i32, ptr %14, align 4, !tbaa !13
  %16 = sitofp i32 %15 to float
  store float %16, ptr %13, align 4, !tbaa !16
  %17 = getelementptr inbounds %struct.Rectangle, ptr %7, i32 0, i32 3
  %18 = getelementptr inbounds %struct.Texture, ptr %3, i32 0, i32 2
  %19 = load i32, ptr %18, align 8, !tbaa !17
  %20 = sitofp i32 %19 to float
  store float %20, ptr %17, align 4, !tbaa !18
  %21 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  %22 = load <2 x float>, ptr %21, align 4
  %23 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  %24 = load <2 x float>, ptr %23, align 4
  %25 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  %26 = load <2 x float>, ptr %25, align 4
  %27 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  %28 = load <2 x float>, ptr %27, align 4
  %29 = call zeroext i1 @GuiImageButtonEx(<2 x float> %22, <2 x float> %24, ptr noundef %10, ptr noundef byval(%struct.Texture) align 8 %3, <2 x float> %26, <2 x float> %28)
  ret i1 %29
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @GuiImageButtonEx(<2 x float>, <2 x float>, ptr noundef, ptr noundef byval(%struct.Texture) align 8, <2 x float>, <2 x float>) #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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, !11, i64 0}
!10 = !{!"Rectangle", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"float", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!14, !15, i64 4}
!14 = !{!"Texture", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16}
!15 = !{!"int", !7, i64 0}
!16 = !{!10, !11, i64 8}
!17 = !{!14, !15, i64 8}
!18 = !{!10, !11, i64 12}


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

%struct.Texture = type { i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @GuiImageButton(<2 x float> %0, <2 x float> %1, ptr noundef %2, ptr noundef byval(%struct.Texture) align 8 %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %3, i64 4
  %6 = load <2 x i32>, ptr %5, align 4, !tbaa !5
  %7 = sitofp <2 x i32> %6 to <2 x float>
  %8 = tail call zeroext i1 @GuiImageButtonEx(<2 x float> %0, <2 x float> %1, ptr noundef %2, ptr noundef nonnull byval(%struct.Texture) align 8 %3, <2 x float> zeroinitializer, <2 x float> %7)
  ret i1 %8
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @GuiImageButtonEx(<2 x float>, <2 x float>, ptr noundef, ptr noundef byval(%struct.Texture) align 8, <2 x float>, <2 x float>) local_unnamed_addr #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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