; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/tests (gamma)

; 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.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [103 x i8], align 1
@__PRETTY_FUNCTION__.nk_triangle_from_direction = external hidden unnamed_addr constant [97 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: 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) #2 {
  %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 %32

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

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

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

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

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

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

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

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

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

122:                                              ; preds = %58
  %123 = load i32, ptr %11, align 4, !tbaa !11
  %124 = icmp eq i32 %123, 1
  br i1 %124, label %125, label %155

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

155:                                              ; preds = %122
  %156 = load i32, ptr %11, align 4, !tbaa !11
  %157 = icmp eq i32 %156, 2
  br i1 %157, label %158, label %188

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

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

221:                                              ; preds = %188, %158
  br label %222

222:                                              ; preds = %221, %125
  br label %223

223:                                              ; preds = %222, %89
  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: 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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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/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 8}
!14 = !{!"nk_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.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [103 x i8], align 1
@__PRETTY_FUNCTION__.nk_triangle_from_direction = external hidden unnamed_addr constant [97 x i8], align 1

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

; Function Attrs: 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.1, ptr noundef nonnull @.str.2, i32 noundef 6286, 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 %48 [
    i32 0, label %21
    i32 1, label %30
    i32 2, label %39
  ]

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 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = fadd float %17, %15
  %26 = fadd float %18, %16
  %27 = tail call <2 x float> @nk_vec2(float noundef %25, float noundef %26)
  store <2 x float> %27, ptr %24, align 4
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = tail call <2 x float> @nk_vec2(float noundef %17, float noundef %26)
  store <2 x float> %29, ptr %28, align 4
  br label %57

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

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

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

57:                                               ; preds = %30, %48, %39, %21
  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 = { 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