; LLVM IR from ClementineAccount/Albuquerque :: src/HelloSDL (main)

; 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.nk_rect = type { float, float, float, float }
%struct.nk_vec2 = type { float, float }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__.nk_triangle_from_direction = external hidden unnamed_addr constant [97 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @nk_vec2(float noundef, float noundef) #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @nk_triangle_from_direction(ptr noundef %0, <2 x float> %1, <2 x float> %2, float noundef %3, float noundef %4, i32 noundef %5) #1 {
  %7 = alloca %struct.nk_rect, align 4
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca %struct.nk_vec2, align 4
  %15 = alloca %struct.nk_vec2, align 4
  %16 = alloca %struct.nk_vec2, align 4
  %17 = alloca %struct.nk_vec2, align 4
  %18 = alloca %struct.nk_vec2, align 4
  %19 = alloca %struct.nk_vec2, align 4
  %20 = alloca %struct.nk_vec2, align 4
  %21 = alloca %struct.nk_vec2, align 4
  %22 = alloca %struct.nk_vec2, align 4
  %23 = alloca %struct.nk_vec2, align 4
  %24 = alloca %struct.nk_vec2, align 4
  %25 = alloca %struct.nk_vec2, align 4
  %26 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  store <2 x float> %1, ptr %26, align 4
  %27 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  store <2 x float> %2, ptr %27, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store float %3, ptr %9, align 4, !tbaa !9
  store float %4, ptr %10, align 4, !tbaa !9
  store i32 %5, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %6
  br label %33

31:                                               ; preds = %6
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 6391, ptr noundef @__PRETTY_FUNCTION__.nk_triangle_from_direction) #6
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  %34 = load float, ptr %9, align 4, !tbaa !9
  %35 = fmul float 2.000000e+00, %34
  %36 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %37 = load float, ptr %36, align 4, !tbaa !13
  %38 = fcmp olt float %35, %37
  br i1 %38, label %39, label %42

39:                                               ; preds = %33
  %40 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %41 = load float, ptr %40, align 4, !tbaa !13
  br label %45

42:                                               ; preds = %33
  %43 = load float, ptr %9, align 4, !tbaa !9
  %44 = fmul float 2.000000e+00, %43
  br label %45

45:                                               ; preds = %42, %39
  %46 = phi float [ %41, %39 ], [ %44, %42 ]
  %47 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  store float %46, ptr %47, align 4, !tbaa !13
  %48 = load float, ptr %10, align 4, !tbaa !9
  %49 = fmul float 2.000000e+00, %48
  %50 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %51 = load float, ptr %50, align 4, !tbaa !15
  %52 = fcmp olt float %49, %51
  br i1 %52, label %53, label %56

53:                                               ; preds = %45
  %54 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %55 = load float, ptr %54, align 4, !tbaa !15
  br label %59

56:                                               ; preds = %45
  %57 = load float, ptr %10, align 4, !tbaa !9
  %58 = fmul float 2.000000e+00, %57
  br label %59

59:                                               ; preds = %56, %53
  %60 = phi float [ %55, %53 ], [ %58, %56 ]
  %61 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  store float %60, ptr %61, align 4, !tbaa !15
  %62 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %63 = load float, ptr %62, align 4, !tbaa !13
  %64 = load float, ptr %9, align 4, !tbaa !9
  %65 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %64, float %63)
  %66 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  store float %65, ptr %66, align 4, !tbaa !13
  %67 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %68 = load float, ptr %67, align 4, !tbaa !15
  %69 = load float, ptr %10, align 4, !tbaa !9
  %70 = call float @llvm.fmuladd.f32(float -2.000000e+00, float %69, float %68)
  %71 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  store float %70, ptr %71, align 4, !tbaa !15
  %72 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %73 = load float, ptr %72, align 4, !tbaa !16
  %74 = load float, ptr %9, align 4, !tbaa !9
  %75 = fadd float %73, %74
  %76 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  store float %75, ptr %76, align 4, !tbaa !16
  %77 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %78 = load float, ptr %77, align 4, !tbaa !17
  %79 = load float, ptr %10, align 4, !tbaa !9
  %80 = fadd float %78, %79
  %81 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  store float %80, ptr %81, align 4, !tbaa !17
  %82 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %83 = load float, ptr %82, align 4, !tbaa !13
  %84 = fdiv float %83, 2.000000e+00
  store float %84, ptr %12, align 4, !tbaa !9
  %85 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %86 = load float, ptr %85, align 4, !tbaa !15
  %87 = fdiv float %86, 2.000000e+00
  store float %87, ptr %13, align 4, !tbaa !9
  %88 = load i32, ptr %11, align 4, !tbaa !11
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %123

90:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %91 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %92 = load float, ptr %91, align 4, !tbaa !16
  %93 = load float, ptr %12, align 4, !tbaa !9
  %94 = fadd float %92, %93
  %95 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %96 = load float, ptr %95, align 4, !tbaa !17
  %97 = call <2 x float> @nk_vec2(float noundef %94, float noundef %96)
  store <2 x float> %97, ptr %14, align 4
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.nk_vec2, ptr %98, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %99, ptr align 4 %14, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %100 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %101 = load float, ptr %100, align 4, !tbaa !16
  %102 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %103 = load float, ptr %102, align 4, !tbaa !13
  %104 = fadd float %101, %103
  %105 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %106 = load float, ptr %105, align 4, !tbaa !17
  %107 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %108 = load float, ptr %107, align 4, !tbaa !15
  %109 = fadd float %106, %108
  %110 = call <2 x float> @nk_vec2(float noundef %104, float noundef %109)
  store <2 x float> %110, ptr %15, align 4
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.nk_vec2, ptr %111, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %112, ptr align 4 %15, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %113 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %114 = load float, ptr %113, align 4, !tbaa !16
  %115 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %116 = load float, ptr %115, align 4, !tbaa !17
  %117 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %118 = load float, ptr %117, align 4, !tbaa !15
  %119 = fadd float %116, %118
  %120 = call <2 x float> @nk_vec2(float noundef %114, float noundef %119)
  store <2 x float> %120, ptr %16, align 4
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.nk_vec2, ptr %121, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %122, ptr align 4 %16, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %224

123:                                              ; preds = %59
  %124 = load i32, ptr %11, align 4, !tbaa !11
  %125 = icmp eq i32 %124, 1
  br i1 %125, label %126, label %156

126:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %127 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %128 = load float, ptr %127, align 4, !tbaa !16
  %129 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %130 = load float, ptr %129, align 4, !tbaa !17
  %131 = call <2 x float> @nk_vec2(float noundef %128, float noundef %130)
  store <2 x float> %131, ptr %17, align 4
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.nk_vec2, ptr %132, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %133, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %134 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %135 = load float, ptr %134, align 4, !tbaa !16
  %136 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %137 = load float, ptr %136, align 4, !tbaa !13
  %138 = fadd float %135, %137
  %139 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %140 = load float, ptr %139, align 4, !tbaa !17
  %141 = load float, ptr %13, align 4, !tbaa !9
  %142 = fadd float %140, %141
  %143 = call <2 x float> @nk_vec2(float noundef %138, float noundef %142)
  store <2 x float> %143, ptr %18, align 4
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.nk_vec2, ptr %144, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %145, ptr align 4 %18, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %146 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %147 = load float, ptr %146, align 4, !tbaa !16
  %148 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %149 = load float, ptr %148, align 4, !tbaa !17
  %150 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %151 = load float, ptr %150, align 4, !tbaa !15
  %152 = fadd float %149, %151
  %153 = call <2 x float> @nk_vec2(float noundef %147, float noundef %152)
  store <2 x float> %153, ptr %19, align 4
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.nk_vec2, ptr %154, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %155, ptr align 4 %19, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %223

156:                                              ; preds = %123
  %157 = load i32, ptr %11, align 4, !tbaa !11
  %158 = icmp eq i32 %157, 2
  br i1 %158, label %159, label %189

159:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %160 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %161 = load float, ptr %160, align 4, !tbaa !16
  %162 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %163 = load float, ptr %162, align 4, !tbaa !17
  %164 = call <2 x float> @nk_vec2(float noundef %161, float noundef %163)
  store <2 x float> %164, ptr %20, align 4
  %165 = load ptr, ptr %8, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.nk_vec2, ptr %165, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %166, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %167 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %168 = load float, ptr %167, align 4, !tbaa !16
  %169 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %170 = load float, ptr %169, align 4, !tbaa !13
  %171 = fadd float %168, %170
  %172 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %173 = load float, ptr %172, align 4, !tbaa !17
  %174 = call <2 x float> @nk_vec2(float noundef %171, float noundef %173)
  store <2 x float> %174, ptr %21, align 4
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.nk_vec2, ptr %175, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %176, ptr align 4 %21, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %177 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %178 = load float, ptr %177, align 4, !tbaa !16
  %179 = load float, ptr %12, align 4, !tbaa !9
  %180 = fadd float %178, %179
  %181 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %182 = load float, ptr %181, align 4, !tbaa !17
  %183 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %184 = load float, ptr %183, align 4, !tbaa !15
  %185 = fadd float %182, %184
  %186 = call <2 x float> @nk_vec2(float noundef %180, float noundef %185)
  store <2 x float> %186, ptr %22, align 4
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.nk_vec2, ptr %187, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %188, ptr align 4 %22, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %222

189:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %190 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %191 = load float, ptr %190, align 4, !tbaa !16
  %192 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %193 = load float, ptr %192, align 4, !tbaa !17
  %194 = load float, ptr %13, align 4, !tbaa !9
  %195 = fadd float %193, %194
  %196 = call <2 x float> @nk_vec2(float noundef %191, float noundef %195)
  store <2 x float> %196, ptr %23, align 4
  %197 = load ptr, ptr %8, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.nk_vec2, ptr %197, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %198, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %199 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %200 = load float, ptr %199, align 4, !tbaa !16
  %201 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %202 = load float, ptr %201, align 4, !tbaa !13
  %203 = fadd float %200, %202
  %204 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %205 = load float, ptr %204, align 4, !tbaa !17
  %206 = call <2 x float> @nk_vec2(float noundef %203, float noundef %205)
  store <2 x float> %206, ptr %24, align 4
  %207 = load ptr, ptr %8, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.nk_vec2, ptr %207, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %208, ptr align 4 %24, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %209 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 0
  %210 = load float, ptr %209, align 4, !tbaa !16
  %211 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 2
  %212 = load float, ptr %211, align 4, !tbaa !13
  %213 = fadd float %210, %212
  %214 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 1
  %215 = load float, ptr %214, align 4, !tbaa !17
  %216 = getelementptr inbounds %struct.nk_rect, ptr %7, i32 0, i32 3
  %217 = load float, ptr %216, align 4, !tbaa !15
  %218 = fadd float %215, %217
  %219 = call <2 x float> @nk_vec2(float noundef %213, float noundef %218)
  store <2 x float> %219, ptr %25, align 4
  %220 = load ptr, ptr %8, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.nk_vec2, ptr %220, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %221, ptr align 4 %25, i64 8, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %222

222:                                              ; preds = %189, %159
  br label %223

223:                                              ; preds = %222, %126
  br label %224

224:                                              ; preds = %223, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  ret void
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { noreturn nounwind "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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS10nk_heading", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS7nk_rect", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!15 = !{!14, !10, i64 12}
!16 = !{!14, !10, i64 0}
!17 = !{!14, !10, i64 4}
!18 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}


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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__.nk_triangle_from_direction = external hidden unnamed_addr constant [97 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local <2 x float> @nk_vec2(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @nk_triangle_from_direction(ptr noundef writeonly %0, <2 x float> %1, <2 x float> %2, float noundef %3, float noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %7, label %8

7:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 6391, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_triangle_from_direction) #3
  unreachable

8:                                                ; preds = %6
  %9 = fmul float %3, 2.000000e+00
  %.sroa.29.8.vec.extract = extractelement <2 x float> %2, i64 0
  %10 = fcmp olt float %9, %.sroa.29.8.vec.extract
  %11 = select i1 %10, float %.sroa.29.8.vec.extract, float %9
  %12 = fmul float %4, 2.000000e+00
  %.sroa.29.12.vec.extract = extractelement <2 x float> %2, i64 1
  %13 = fcmp olt float %12, %.sroa.29.12.vec.extract
  %14 = select i1 %13, float %.sroa.29.12.vec.extract, float %12
  %15 = tail call float @llvm.fmuladd.f32(float %3, float -2.000000e+00, float %11)
  %16 = tail call float @llvm.fmuladd.f32(float %4, float -2.000000e+00, float %14)
  %.sroa.038.0.vec.extract = extractelement <2 x float> %1, i64 0
  %17 = fadd float %.sroa.038.0.vec.extract, %3
  %.sroa.038.4.vec.extract = extractelement <2 x float> %1, i64 1
  %18 = fadd float %.sroa.038.4.vec.extract, %4
  %19 = fmul float %15, 5.000000e-01
  %20 = fmul float %16, 5.000000e-01
  switch i32 %5, label %45 [
    i32 0, label %21
    i32 1, label %29
    i32 2, label %37
  ]

21:                                               ; preds = %8
  %22 = fadd float %17, %19
  %23 = tail call <2 x float> @nk_vec2(float noundef %22, float noundef %18)
  store <2 x float> %23, ptr %0, align 4
  %24 = fadd float %17, %15
  %25 = fadd float %18, %16
  %26 = tail call <2 x float> @nk_vec2(float noundef %24, float noundef %25)
  %27 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x float> %26, ptr %27, align 4
  %28 = tail call <2 x float> @nk_vec2(float noundef %17, float noundef %25)
  br label %53

29:                                               ; preds = %8
  %30 = tail call <2 x float> @nk_vec2(float noundef %17, float noundef %18)
  store <2 x float> %30, ptr %0, align 4
  %31 = fadd float %17, %15
  %32 = fadd float %18, %20
  %33 = tail call <2 x float> @nk_vec2(float noundef %31, float noundef %32)
  %34 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x float> %33, ptr %34, align 4
  %35 = fadd float %18, %16
  %36 = tail call <2 x float> @nk_vec2(float noundef %17, float noundef %35)
  br label %53

37:                                               ; preds = %8
  %38 = tail call <2 x float> @nk_vec2(float noundef %17, float noundef %18)
  store <2 x float> %38, ptr %0, align 4
  %39 = fadd float %17, %15
  %40 = tail call <2 x float> @nk_vec2(float noundef %39, float noundef %18)
  %41 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x float> %40, ptr %41, align 4
  %42 = fadd float %17, %19
  %43 = fadd float %18, %16
  %44 = tail call <2 x float> @nk_vec2(float noundef %42, float noundef %43)
  br label %53

45:                                               ; preds = %8
  %46 = fadd float %18, %20
  %47 = tail call <2 x float> @nk_vec2(float noundef %17, float noundef %46)
  store <2 x float> %47, ptr %0, align 4
  %48 = fadd float %17, %15
  %49 = tail call <2 x float> @nk_vec2(float noundef %48, float noundef %18)
  %50 = getelementptr inbounds i8, ptr %0, i64 8
  store <2 x float> %49, ptr %50, align 4
  %51 = fadd float %18, %16
  %52 = tail call <2 x float> @nk_vec2(float noundef %48, float noundef %51)
  br label %53

53:                                               ; preds = %29, %45, %37, %21
  %.sink = phi <2 x float> [ %36, %29 ], [ %52, %45 ], [ %44, %37 ], [ %28, %21 ]
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  store <2 x float> %.sink, ptr %54, align 4
  ret void
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

attributes #0 = { mustprogress 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" }
attributes #1 = { noreturn nounwind "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { noreturn 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)"}


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