; LLVM IR from libtcod/libtcod :: src/vendor (stb)

; 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.stbtt_packedchar = type { i16, i16, i16, i16, float, float, float, float, float }
%struct.stbtt_aligned_quad = type { float, float, float, float, float, float, float, float }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @stbtt_GetPackedQuad(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, i32 noundef %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca ptr, align 8
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store i32 %7, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %22 = load i32, ptr %10, align 4, !tbaa !9
  %23 = sitofp i32 %22 to float
  %24 = fdiv float 1.000000e+00, %23
  store float %24, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %25 = load i32, ptr %11, align 4, !tbaa !9
  %26 = sitofp i32 %25 to float
  %27 = fdiv float 1.000000e+00, %26
  store float %27, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %struct.stbtt_packedchar, ptr %28, i64 %30
  store ptr %31, ptr %19, align 8, !tbaa !5
  %32 = load i32, ptr %16, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %85

34:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  %35 = load ptr, ptr %13, align 8, !tbaa !5
  %36 = load float, ptr %35, align 4, !tbaa !11
  %37 = load ptr, ptr %19, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.stbtt_packedchar, ptr %37, i32 0, i32 4
  %39 = load float, ptr %38, align 4, !tbaa !13
  %40 = fadd float %36, %39
  %41 = fadd float %40, 5.000000e-01
  %42 = fpext float %41 to double
  %43 = call double @llvm.floor.f64(double %42)
  %44 = fptosi double %43 to i32
  %45 = sitofp i32 %44 to float
  store float %45, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %46 = load ptr, ptr %14, align 8, !tbaa !5
  %47 = load float, ptr %46, align 4, !tbaa !11
  %48 = load ptr, ptr %19, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.stbtt_packedchar, ptr %48, i32 0, i32 5
  %50 = load float, ptr %49, align 4, !tbaa !16
  %51 = fadd float %47, %50
  %52 = fadd float %51, 5.000000e-01
  %53 = fpext float %52 to double
  %54 = call double @llvm.floor.f64(double %53)
  %55 = fptosi double %54 to i32
  %56 = sitofp i32 %55 to float
  store float %56, ptr %21, align 4, !tbaa !11
  %57 = load float, ptr %20, align 4, !tbaa !11
  %58 = load ptr, ptr %15, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %58, i32 0, i32 0
  store float %57, ptr %59, align 4, !tbaa !17
  %60 = load float, ptr %21, align 4, !tbaa !11
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %61, i32 0, i32 1
  store float %60, ptr %62, align 4, !tbaa !19
  %63 = load float, ptr %20, align 4, !tbaa !11
  %64 = load ptr, ptr %19, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.stbtt_packedchar, ptr %64, i32 0, i32 7
  %66 = load float, ptr %65, align 4, !tbaa !20
  %67 = fadd float %63, %66
  %68 = load ptr, ptr %19, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.stbtt_packedchar, ptr %68, i32 0, i32 4
  %70 = load float, ptr %69, align 4, !tbaa !13
  %71 = fsub float %67, %70
  %72 = load ptr, ptr %15, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %72, i32 0, i32 4
  store float %71, ptr %73, align 4, !tbaa !21
  %74 = load float, ptr %21, align 4, !tbaa !11
  %75 = load ptr, ptr %19, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.stbtt_packedchar, ptr %75, i32 0, i32 8
  %77 = load float, ptr %76, align 4, !tbaa !22
  %78 = fadd float %74, %77
  %79 = load ptr, ptr %19, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.stbtt_packedchar, ptr %79, i32 0, i32 5
  %81 = load float, ptr %80, align 4, !tbaa !16
  %82 = fsub float %78, %81
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %83, i32 0, i32 5
  store float %82, ptr %84, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  br label %118

85:                                               ; preds = %8
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = load float, ptr %86, align 4, !tbaa !11
  %88 = load ptr, ptr %19, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.stbtt_packedchar, ptr %88, i32 0, i32 4
  %90 = load float, ptr %89, align 4, !tbaa !13
  %91 = fadd float %87, %90
  %92 = load ptr, ptr %15, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %92, i32 0, i32 0
  store float %91, ptr %93, align 4, !tbaa !17
  %94 = load ptr, ptr %14, align 8, !tbaa !5
  %95 = load float, ptr %94, align 4, !tbaa !11
  %96 = load ptr, ptr %19, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.stbtt_packedchar, ptr %96, i32 0, i32 5
  %98 = load float, ptr %97, align 4, !tbaa !16
  %99 = fadd float %95, %98
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %100, i32 0, i32 1
  store float %99, ptr %101, align 4, !tbaa !19
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = load float, ptr %102, align 4, !tbaa !11
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.stbtt_packedchar, ptr %104, i32 0, i32 7
  %106 = load float, ptr %105, align 4, !tbaa !20
  %107 = fadd float %103, %106
  %108 = load ptr, ptr %15, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %108, i32 0, i32 4
  store float %107, ptr %109, align 4, !tbaa !21
  %110 = load ptr, ptr %14, align 8, !tbaa !5
  %111 = load float, ptr %110, align 4, !tbaa !11
  %112 = load ptr, ptr %19, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.stbtt_packedchar, ptr %112, i32 0, i32 8
  %114 = load float, ptr %113, align 4, !tbaa !22
  %115 = fadd float %111, %114
  %116 = load ptr, ptr %15, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %116, i32 0, i32 5
  store float %115, ptr %117, align 4, !tbaa !23
  br label %118

118:                                              ; preds = %85, %34
  %119 = load ptr, ptr %19, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.stbtt_packedchar, ptr %119, i32 0, i32 0
  %121 = load i16, ptr %120, align 4, !tbaa !24
  %122 = zext i16 %121 to i32
  %123 = sitofp i32 %122 to float
  %124 = load float, ptr %17, align 4, !tbaa !11
  %125 = fmul float %123, %124
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %126, i32 0, i32 2
  store float %125, ptr %127, align 4, !tbaa !25
  %128 = load ptr, ptr %19, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.stbtt_packedchar, ptr %128, i32 0, i32 1
  %130 = load i16, ptr %129, align 2, !tbaa !26
  %131 = zext i16 %130 to i32
  %132 = sitofp i32 %131 to float
  %133 = load float, ptr %18, align 4, !tbaa !11
  %134 = fmul float %132, %133
  %135 = load ptr, ptr %15, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %135, i32 0, i32 3
  store float %134, ptr %136, align 4, !tbaa !27
  %137 = load ptr, ptr %19, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.stbtt_packedchar, ptr %137, i32 0, i32 2
  %139 = load i16, ptr %138, align 4, !tbaa !28
  %140 = zext i16 %139 to i32
  %141 = sitofp i32 %140 to float
  %142 = load float, ptr %17, align 4, !tbaa !11
  %143 = fmul float %141, %142
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %144, i32 0, i32 6
  store float %143, ptr %145, align 4, !tbaa !29
  %146 = load ptr, ptr %19, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.stbtt_packedchar, ptr %146, i32 0, i32 3
  %148 = load i16, ptr %147, align 2, !tbaa !30
  %149 = zext i16 %148 to i32
  %150 = sitofp i32 %149 to float
  %151 = load float, ptr %18, align 4, !tbaa !11
  %152 = fmul float %150, %151
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.stbtt_aligned_quad, ptr %153, i32 0, i32 7
  store float %152, ptr %154, align 4, !tbaa !31
  %155 = load ptr, ptr %19, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.stbtt_packedchar, ptr %155, i32 0, i32 6
  %157 = load float, ptr %156, align 4, !tbaa !32
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = load float, ptr %158, align 4, !tbaa !11
  %160 = fadd float %159, %157
  store float %160, ptr %158, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 #3 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"", !15, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24}
!15 = !{!"short", !7, i64 0}
!16 = !{!14, !12, i64 12}
!17 = !{!18, !12, i64 0}
!18 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!19 = !{!18, !12, i64 4}
!20 = !{!14, !12, i64 20}
!21 = !{!18, !12, i64 16}
!22 = !{!14, !12, i64 24}
!23 = !{!18, !12, i64 20}
!24 = !{!14, !15, i64 0}
!25 = !{!18, !12, i64 8}
!26 = !{!14, !15, i64 2}
!27 = !{!18, !12, i64 12}
!28 = !{!14, !15, i64 4}
!29 = !{!18, !12, i64 24}
!30 = !{!14, !15, i64 6}
!31 = !{!18, !12, i64 28}
!32 = !{!14, !12, i64 16}


; 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.stbtt_packedchar = type { i16, i16, i16, i16, float, float, float, float, float }

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @stbtt_GetPackedQuad(ptr nocapture noundef readonly %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr nocapture noundef %4, ptr nocapture noundef readonly %5, ptr nocapture noundef writeonly %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = sext i32 %3 to i64
  %10 = getelementptr inbounds %struct.stbtt_packedchar, ptr %0, i64 %9
  %.not = icmp eq i32 %7, 0
  %11 = load float, ptr %4, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %10, i64 8
  %13 = load float, ptr %12, align 4, !tbaa !9
  %14 = fadd float %11, %13
  br i1 %.not, label %37, label %15

15:                                               ; preds = %8
  %16 = load float, ptr %5, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %10, i64 12
  %18 = load float, ptr %17, align 4, !tbaa !12
  %19 = fadd float %16, %18
  %20 = insertelement <2 x float> poison, float %14, i64 0
  %21 = insertelement <2 x float> %20, float %19, i64 1
  %22 = fadd <2 x float> %21, <float 5.000000e-01, float 5.000000e-01>
  %23 = tail call <2 x float> @llvm.floor.v2f32(<2 x float> %22)
  %24 = fptosi <2 x float> %23 to <2 x i32>
  %25 = sitofp <2 x i32> %24 to <2 x float>
  store <2 x float> %25, ptr %6, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %10, i64 20
  %27 = load float, ptr %26, align 4, !tbaa !13
  %28 = extractelement <2 x float> %25, i64 0
  %29 = fadd float %27, %28
  %30 = fsub float %29, %13
  %31 = getelementptr inbounds i8, ptr %6, i64 16
  store float %30, ptr %31, align 4, !tbaa !14
  %32 = getelementptr inbounds i8, ptr %10, i64 24
  %33 = load float, ptr %32, align 4, !tbaa !16
  %34 = extractelement <2 x float> %25, i64 1
  %35 = fadd float %33, %34
  %36 = fsub float %35, %18
  br label %52

37:                                               ; preds = %8
  store float %14, ptr %6, align 4, !tbaa !17
  %38 = load float, ptr %5, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %10, i64 12
  %40 = load float, ptr %39, align 4, !tbaa !12
  %41 = fadd float %38, %40
  %42 = getelementptr inbounds i8, ptr %6, i64 4
  store float %41, ptr %42, align 4, !tbaa !18
  %43 = load float, ptr %4, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %10, i64 20
  %45 = load float, ptr %44, align 4, !tbaa !13
  %46 = fadd float %43, %45
  %47 = getelementptr inbounds i8, ptr %6, i64 16
  store float %46, ptr %47, align 4, !tbaa !14
  %48 = load float, ptr %5, align 4, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %10, i64 24
  %50 = load float, ptr %49, align 4, !tbaa !16
  %51 = fadd float %48, %50
  br label %52

52:                                               ; preds = %37, %15
  %.sink = phi float [ %51, %37 ], [ %36, %15 ]
  %53 = getelementptr inbounds i8, ptr %6, i64 20
  store float %.sink, ptr %53, align 4
  %54 = insertelement <2 x i32> poison, i32 %1, i64 0
  %55 = insertelement <2 x i32> %54, i32 %2, i64 1
  %56 = sitofp <2 x i32> %55 to <2 x float>
  %57 = getelementptr inbounds i8, ptr %6, i64 8
  %58 = fdiv <2 x float> <float 1.000000e+00, float 1.000000e+00>, %56
  %59 = load <2 x i16>, ptr %10, align 4, !tbaa !19
  %60 = uitofp <2 x i16> %59 to <2 x float>
  %61 = fmul <2 x float> %58, %60
  store <2 x float> %61, ptr %57, align 4, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %10, i64 4
  %63 = getelementptr inbounds i8, ptr %6, i64 24
  %64 = load <2 x i16>, ptr %62, align 4, !tbaa !19
  %65 = uitofp <2 x i16> %64 to <2 x float>
  %66 = fmul <2 x float> %58, %65
  store <2 x float> %66, ptr %63, align 4, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %10, i64 16
  %68 = load float, ptr %67, align 4, !tbaa !20
  %69 = load float, ptr %4, align 4, !tbaa !5
  %70 = fadd float %68, %69
  store float %70, ptr %4, align 4, !tbaa !5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.floor.v2f32(<2 x float>) #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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"", !11, i64 0, !11, i64 2, !11, i64 4, !11, i64 6, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !6, i64 12}
!13 = !{!10, !6, i64 20}
!14 = !{!15, !6, i64 16}
!15 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!16 = !{!10, !6, i64 24}
!17 = !{!15, !6, i64 0}
!18 = !{!15, !6, i64 4}
!19 = !{!11, !11, i64 0}
!20 = !{!10, !6, i64 16}


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