; LLVM IR from BrunoLevy/learn-fpga :: FemtoRV/FIRMWARE/EXAMPLES (imgui_disco)

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

@K = external dso_local global i32, align 4
@J = external dso_local global i32, align 4
@l = external dso_local global float, align 4
@x = external dso_local global float, align 4
@z = external dso_local global float, align 4
@c = external dso_local global float, align 4
@k = external dso_local global i32, align 4
@j = external dso_local global i32, align 4
@i = external dso_local global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@y = external dso_local global float, align 4
@e = external dso_local global float, align 4
@f = external dso_local global float, align 4
@g = external dso_local global float, align 4
@r = external dso_local global float, align 4

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @vec2(float noundef, float noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @FX(<2 x float> %0, <2 x float> %1, <2 x float> %2, float noundef %3) #0 {
  %5 = alloca %struct.ImVec2, align 4
  %6 = alloca %struct.ImVec2, align 4
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca float, align 4
  %9 = alloca %struct.ImVec2, align 4
  %10 = alloca [4 x %struct.ImVec2], align 16
  %11 = alloca %struct.ImVec2, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca %struct.ImVec2, align 4
  %16 = alloca %struct.ImVec2, align 4
  %17 = alloca %struct.ImVec2, align 4
  store <2 x float> %0, ptr %5, align 4
  store <2 x float> %1, ptr %6, align 4
  store <2 x float> %2, ptr %7, align 4
  store float %3, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %18 = call <2 x float> @vec2(float noundef 0.000000e+00, float noundef 0.000000e+00)
  store <2 x float> %18, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %19 = getelementptr inbounds %struct.ImVec2, ptr %5, i32 0, i32 0
  %20 = load float, ptr %19, align 4, !tbaa !9
  %21 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 0
  %22 = load float, ptr %21, align 4, !tbaa !9
  %23 = fadd float %20, %22
  %24 = fpext float %23 to double
  %25 = fmul double 5.000000e-01, %24
  %26 = fptrunc double %25 to float
  %27 = getelementptr inbounds %struct.ImVec2, ptr %5, i32 0, i32 1
  %28 = load float, ptr %27, align 4, !tbaa !11
  %29 = getelementptr inbounds %struct.ImVec2, ptr %6, i32 0, i32 1
  %30 = load float, ptr %29, align 4, !tbaa !11
  %31 = fadd float %28, %30
  %32 = fpext float %31 to double
  %33 = fmul double 5.000000e-01, %32
  %34 = fptrunc double %33 to float
  %35 = call <2 x float> @vec2(float noundef %26, float noundef %34)
  store <2 x float> %35, ptr %11, align 4
  %36 = load float, ptr %8, align 4, !tbaa !5
  %37 = fdiv float %36, 2.000000e+00
  store float %37, ptr @c, align 4, !tbaa !5
  %38 = load float, ptr %8, align 4, !tbaa !5
  %39 = fmul float %38, 1.300000e+01
  %40 = fpext float %39 to double
  %41 = call double @sin(double noundef %40) #7
  %42 = call double @llvm.fmuladd.f64(double %41, double 2.400000e+01, double 2.400000e+01)
  %43 = fptosi double %42 to i32
  store i32 %43, ptr @k, align 4, !tbaa !12
  %44 = load i32, ptr @k, align 4, !tbaa !12
  %45 = mul nsw i32 %44, 257
  %46 = add nsw i32 -11530160, %45
  store i32 %46, ptr @j, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %47 = load i32, ptr @K, align 4, !tbaa !12
  store i32 %47, ptr @k, align 4, !tbaa !12
  br label %48

48:                                               ; preds = %283, %4
  %49 = load i32, ptr @k, align 4, !tbaa !12
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr @k, align 4, !tbaa !12
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %284

52:                                               ; preds = %48
  %53 = load i32, ptr @J, align 4, !tbaa !12
  store i32 %53, ptr @j, align 4, !tbaa !12
  br label %54

54:                                               ; preds = %282, %52
  %55 = load i32, ptr @j, align 4, !tbaa !12
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr @j, align 4, !tbaa !12
  %57 = icmp ne i32 %55, 0
  br i1 %57, label %58, label %283

58:                                               ; preds = %54
  store i32 4, ptr @i, align 4, !tbaa !12
  br label %59

59:                                               ; preds = %63, %58
  %60 = load i32, ptr @i, align 4, !tbaa !12
  %61 = add nsw i32 %60, -1
  store i32 %61, ptr @i, align 4, !tbaa !12
  %62 = icmp ne i32 %60, 0
  br i1 %62, label %63, label %114

63:                                               ; preds = %59
  %64 = load i32, ptr @j, align 4, !tbaa !12
  %65 = load i32, ptr @i, align 4, !tbaa !12
  %66 = srem i32 %65, 3
  %67 = icmp sgt i32 %66, 0
  %68 = zext i1 %67 to i32
  %69 = add nsw i32 %64, %68
  store i32 %69, ptr @u, align 4, !tbaa !12
  %70 = load i32, ptr @i, align 4, !tbaa !12
  %71 = sdiv i32 %70, 2
  %72 = sub nsw i32 0, %71
  store i32 %72, ptr @v, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %73 = load i32, ptr @k, align 4, !tbaa !12
  %74 = load i32, ptr @v, align 4, !tbaa !12
  %75 = add nsw i32 %73, %74
  %76 = sitofp i32 %75 to float
  %77 = call <2 x float> @P(float noundef %76)
  store <2 x float> %77, ptr %15, align 4
  %78 = getelementptr inbounds %struct.ImVec2, ptr %15, i32 0, i32 0
  %79 = load float, ptr %78, align 4, !tbaa !9
  store float %79, ptr @x, align 4, !tbaa !5
  %80 = getelementptr inbounds %struct.ImVec2, ptr %15, i32 0, i32 1
  %81 = load float, ptr %80, align 4, !tbaa !11
  store float %81, ptr @y, align 4, !tbaa !5
  store float 0.000000e+00, ptr @z, align 4, !tbaa !5
  %82 = load i32, ptr @u, align 4, !tbaa !12
  %83 = sitofp i32 %82 to float
  %84 = load i32, ptr @J, align 4, !tbaa !12
  %85 = sitofp i32 %84 to float
  %86 = fdiv float %83, %85
  call void @T(float noundef %86)
  %87 = load float, ptr @x, align 4, !tbaa !5
  store float %87, ptr @e, align 4, !tbaa !5
  %88 = load float, ptr @y, align 4, !tbaa !5
  store float %88, ptr @f, align 4, !tbaa !5
  %89 = getelementptr inbounds %struct.ImVec2, ptr %7, i32 0, i32 1
  %90 = load float, ptr %89, align 4, !tbaa !11
  %91 = load float, ptr @z, align 4, !tbaa !5
  %92 = fpext float %91 to double
  %93 = fadd double %92, 2.500000e+00
  %94 = fptrunc double %93 to float
  store float %94, ptr @g, align 4, !tbaa !5
  %95 = fdiv float %90, %94
  store float %95, ptr @z, align 4, !tbaa !5
  %96 = getelementptr inbounds %struct.ImVec2, ptr %11, i32 0, i32 0
  %97 = load float, ptr %96, align 4, !tbaa !9
  %98 = load float, ptr @x, align 4, !tbaa !5
  %99 = load float, ptr @z, align 4, !tbaa !5
  %100 = call float @llvm.fmuladd.f32(float %98, float %99, float %97)
  %101 = load i32, ptr @i, align 4, !tbaa !12
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [4 x %struct.ImVec2], ptr %10, i64 0, i64 %102
  %104 = getelementptr inbounds %struct.ImVec2, ptr %103, i32 0, i32 0
  store float %100, ptr %104, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.ImVec2, ptr %11, i32 0, i32 1
  %106 = load float, ptr %105, align 4, !tbaa !11
  %107 = load float, ptr @y, align 4, !tbaa !5
  %108 = load float, ptr @z, align 4, !tbaa !5
  %109 = call float @llvm.fmuladd.f32(float %107, float %108, float %106)
  %110 = load i32, ptr @i, align 4, !tbaa !12
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [4 x %struct.ImVec2], ptr %10, i64 0, i64 %111
  %113 = getelementptr inbounds %struct.ImVec2, ptr %112, i32 0, i32 1
  store float %109, ptr %113, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %59, !llvm.loop !14

114:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %115 = load i32, ptr @k, align 4, !tbaa !12
  %116 = sitofp i32 %115 to float
  %117 = call <2 x float> @P(float noundef %116)
  store <2 x float> %117, ptr %16, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %118 = load i32, ptr @k, align 4, !tbaa !12
  %119 = sub nsw i32 %118, 1
  %120 = sitofp i32 %119 to float
  %121 = call <2 x float> @P(float noundef %120)
  store <2 x float> %121, ptr %17, align 4
  %122 = getelementptr inbounds %struct.ImVec2, ptr %16, i32 0, i32 1
  %123 = load float, ptr %122, align 4, !tbaa !11
  %124 = getelementptr inbounds %struct.ImVec2, ptr %17, i32 0, i32 1
  %125 = load float, ptr %124, align 4, !tbaa !11
  %126 = fsub float %123, %125
  store float %126, ptr @x, align 4, !tbaa !5
  %127 = getelementptr inbounds %struct.ImVec2, ptr %17, i32 0, i32 0
  %128 = load float, ptr %127, align 4, !tbaa !9
  %129 = getelementptr inbounds %struct.ImVec2, ptr %16, i32 0, i32 0
  %130 = load float, ptr %129, align 4, !tbaa !9
  %131 = fsub float %128, %130
  store float %131, ptr @y, align 4, !tbaa !5
  store float 0.000000e+00, ptr @z, align 4, !tbaa !5
  %132 = load float, ptr @x, align 4, !tbaa !5
  %133 = load float, ptr @x, align 4, !tbaa !5
  %134 = load float, ptr @y, align 4, !tbaa !5
  %135 = load float, ptr @y, align 4, !tbaa !5
  %136 = fmul float %134, %135
  %137 = call float @llvm.fmuladd.f32(float %132, float %133, float %136)
  %138 = fpext float %137 to double
  %139 = call double @sqrt(double noundef %138) #7
  %140 = fptrunc double %139 to float
  store float %140, ptr @l, align 4, !tbaa !5
  %141 = load float, ptr @x, align 4, !tbaa !5
  %142 = load float, ptr @l, align 4, !tbaa !5
  %143 = fdiv float %141, %142
  store float %143, ptr @x, align 4, !tbaa !5
  %144 = load float, ptr @y, align 4, !tbaa !5
  %145 = load float, ptr @l, align 4, !tbaa !5
  %146 = fdiv float %144, %145
  store float %146, ptr @y, align 4, !tbaa !5
  %147 = load i32, ptr @j, align 4, !tbaa !12
  %148 = sitofp i32 %147 to double
  %149 = fadd double %148, 5.000000e-01
  %150 = load i32, ptr @J, align 4, !tbaa !12
  %151 = sitofp i32 %150 to double
  %152 = fdiv double %149, %151
  %153 = fptrunc double %152 to float
  call void @T(float noundef %153)
  %154 = load float, ptr @x, align 4, !tbaa !5
  %155 = load float, ptr @e, align 4, !tbaa !5
  %156 = load float, ptr @y, align 4, !tbaa !5
  %157 = load float, ptr @f, align 4, !tbaa !5
  %158 = fmul float %156, %157
  %159 = call float @llvm.fmuladd.f32(float %154, float %155, float %158)
  %160 = load float, ptr @z, align 4, !tbaa !5
  %161 = load float, ptr @g, align 4, !tbaa !5
  %162 = call float @llvm.fmuladd.f32(float %160, float %161, float %159)
  %163 = fmul float 2.000000e+00, %162
  store float %163, ptr @r, align 4, !tbaa !5
  %164 = load float, ptr @r, align 4, !tbaa !5
  %165 = load float, ptr @x, align 4, !tbaa !5
  %166 = load float, ptr @e, align 4, !tbaa !5
  %167 = fneg float %164
  %168 = call float @llvm.fmuladd.f32(float %167, float %165, float %166)
  store float %168, ptr @e, align 4, !tbaa !5
  %169 = load float, ptr @r, align 4, !tbaa !5
  %170 = load float, ptr @y, align 4, !tbaa !5
  %171 = load float, ptr @f, align 4, !tbaa !5
  %172 = fneg float %169
  %173 = call float @llvm.fmuladd.f32(float %172, float %170, float %171)
  store float %173, ptr @f, align 4, !tbaa !5
  %174 = load float, ptr @r, align 4, !tbaa !5
  %175 = load float, ptr @z, align 4, !tbaa !5
  %176 = load float, ptr @g, align 4, !tbaa !5
  %177 = fneg float %174
  %178 = call float @llvm.fmuladd.f32(float %177, float %175, float %176)
  store float %178, ptr @g, align 4, !tbaa !5
  %179 = load float, ptr @e, align 4, !tbaa !5
  %180 = load float, ptr @e, align 4, !tbaa !5
  %181 = load float, ptr @f, align 4, !tbaa !5
  %182 = load float, ptr @f, align 4, !tbaa !5
  %183 = fmul float %181, %182
  %184 = call float @llvm.fmuladd.f32(float %179, float %180, float %183)
  %185 = load float, ptr @g, align 4, !tbaa !5
  %186 = load float, ptr @g, align 4, !tbaa !5
  %187 = call float @llvm.fmuladd.f32(float %185, float %186, float %184)
  %188 = fpext float %187 to double
  %189 = call double @sqrt(double noundef %188) #7
  %190 = fptrunc double %189 to float
  store float %190, ptr @l, align 4, !tbaa !5
  %191 = load float, ptr @e, align 4, !tbaa !5
  %192 = fpext float %191 to double
  %193 = load float, ptr @g, align 4, !tbaa !5
  %194 = fpext float %193 to double
  %195 = call double @atan2(double noundef %192, double noundef %194) #7
  %196 = fptrunc double %195 to float
  store float %196, ptr @x, align 4, !tbaa !5
  %197 = load float, ptr @e, align 4, !tbaa !5
  %198 = load float, ptr @e, align 4, !tbaa !5
  %199 = load float, ptr @g, align 4, !tbaa !5
  %200 = load float, ptr @g, align 4, !tbaa !5
  %201 = fmul float %199, %200
  %202 = call float @llvm.fmuladd.f32(float %197, float %198, float %201)
  %203 = fpext float %202 to double
  %204 = call double @sqrt(double noundef %203) #7
  %205 = load float, ptr @f, align 4, !tbaa !5
  %206 = fpext float %205 to double
  %207 = call double @atan2(double noundef %204, double noundef %206) #7
  %208 = fptrunc double %207 to float
  store float %208, ptr @y, align 4, !tbaa !5
  %209 = load float, ptr @x, align 4, !tbaa !5
  %210 = fmul float %209, 5.000000e+00
  %211 = fpext float %210 to double
  %212 = load float, ptr @y, align 4, !tbaa !5
  %213 = load float, ptr %8, align 4, !tbaa !5
  %214 = call float @llvm.fmuladd.f32(float %212, float 3.000000e+00, float %213)
  %215 = fpext float %214 to double
  %216 = call double @sin(double noundef %215) #7
  %217 = fadd double %211, %216
  %218 = call double @sin(double noundef %217) #7
  %219 = load float, ptr @x, align 4, !tbaa !5
  %220 = fmul float %219, 9.000000e+00
  %221 = fpext float %220 to double
  %222 = load float, ptr @y, align 4, !tbaa !5
  %223 = load float, ptr %8, align 4, !tbaa !5
  %224 = call float @llvm.fmuladd.f32(float %222, float 5.000000e+00, float %223)
  %225 = fpext float %224 to double
  %226 = call double @sin(double noundef %225) #7
  %227 = fadd double %221, %226
  %228 = call double @sin(double noundef %227) #7
  %229 = fadd double %218, %228
  %230 = load float, ptr @y, align 4, !tbaa !5
  %231 = fmul float %230, 4.000000e+00
  %232 = fpext float %231 to double
  %233 = load float, ptr @x, align 4, !tbaa !5
  %234 = load float, ptr %8, align 4, !tbaa !5
  %235 = call float @llvm.fmuladd.f32(float %233, float 5.000000e+00, float %234)
  %236 = fpext float %235 to double
  %237 = call double @sin(double noundef %236) #7
  %238 = fadd double %232, %237
  %239 = call double @cos(double noundef %238) #7
  %240 = fadd double %229, %239
  %241 = fptrunc double %240 to float
  store float %241, ptr @l, align 4, !tbaa !5
  %242 = load float, ptr @l, align 4, !tbaa !5
  %243 = fdiv float %242, 4.000000e+00
  %244 = fpext float %243 to double
  %245 = fadd double %244, 5.000000e-01
  %246 = fptrunc double %245 to float
  store float %246, ptr @l, align 4, !tbaa !5
  %247 = load float, ptr @l, align 4, !tbaa !5
  store float %247, ptr %12, align 4, !tbaa !5
  %248 = load float, ptr @l, align 4, !tbaa !5
  %249 = fpext float %248 to double
  %250 = fmul double %249, 9.000000e-01
  %251 = load float, ptr @e, align 4, !tbaa !5
  %252 = fdiv float %251, 4.000000e+00
  %253 = fpext float %252 to double
  %254 = fadd double 8.000000e-01, %253
  %255 = fmul double %250, %254
  %256 = fptrunc double %255 to float
  store float %256, ptr %13, align 4, !tbaa !5
  %257 = load float, ptr @f, align 4, !tbaa !5
  %258 = fdiv float %257, 2.000000e+00
  %259 = fpext float %258 to double
  %260 = fsub double 5.000000e-01, %259
  %261 = load float, ptr @l, align 4, !tbaa !5
  %262 = fpext float %261 to double
  %263 = fmul double %260, %262
  %264 = fdiv double %263, 2.000000e+00
  %265 = fptrunc double %264 to float
  store float %265, ptr %14, align 4, !tbaa !5
  %266 = load float, ptr @r, align 4, !tbaa !5
  %267 = fcmp ogt float %266, 0.000000e+00
  br i1 %267, label %268, label %282

268:                                              ; preds = %114
  %269 = getelementptr inbounds [4 x %struct.ImVec2], ptr %10, i64 0, i64 0
  %270 = getelementptr inbounds [4 x %struct.ImVec2], ptr %10, i64 0, i64 1
  %271 = getelementptr inbounds [4 x %struct.ImVec2], ptr %10, i64 0, i64 2
  %272 = getelementptr inbounds [4 x %struct.ImVec2], ptr %10, i64 0, i64 3
  %273 = load float, ptr %12, align 4, !tbaa !5
  %274 = load float, ptr %13, align 4, !tbaa !5
  %275 = load float, ptr %14, align 4, !tbaa !5
  %276 = call zeroext i16 @GL_RGB_f(float noundef %273, float noundef %274, float noundef %275)
  %277 = zext i16 %276 to i32
  %278 = load <2 x float>, ptr %269, align 16
  %279 = load <2 x float>, ptr %270, align 8
  %280 = load <2 x float>, ptr %271, align 16
  %281 = load <2 x float>, ptr %272, align 8
  call void @addQuad(<2 x float> %278, <2 x float> %279, <2 x float> %280, <2 x float> %281, i32 noundef %277)
  br label %282

282:                                              ; preds = %268, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %54, !llvm.loop !16

283:                                              ; preds = %54
  br label %48, !llvm.loop !17

284:                                              ; preds = %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  ret void
}

; Function Attrs: nounwind
declare double @sin(double noundef) #3

; Function Attrs: nounwind
declare double @cos(double noundef) #3

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @T(float noundef) #5

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

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @GL_RGB_f(float noundef, float noundef, float noundef) #6

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { 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 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 #6 = { inlinehint 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 #7 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}


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

@K = external dso_local local_unnamed_addr global i32, align 4
@J = external dso_local local_unnamed_addr global i32, align 4
@l = external dso_local local_unnamed_addr global float, align 4
@x = external dso_local local_unnamed_addr global float, align 4
@z = external dso_local local_unnamed_addr global float, align 4
@c = external dso_local local_unnamed_addr global float, align 4
@k = external dso_local local_unnamed_addr global i32, align 4
@j = external dso_local local_unnamed_addr global i32, align 4
@i = external dso_local local_unnamed_addr global i32, align 4
@u = external dso_local local_unnamed_addr global i32, align 4
@v = external dso_local local_unnamed_addr global i32, align 4
@y = external dso_local local_unnamed_addr global float, align 4
@e = external dso_local local_unnamed_addr global float, align 4
@f = external dso_local local_unnamed_addr global float, align 4
@g = external dso_local local_unnamed_addr global float, align 4
@r = external dso_local local_unnamed_addr global float, align 4

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden <2 x float> @vec2(float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @FX(<2 x float> %0, <2 x float> %1, <2 x float> %2, float noundef %3) local_unnamed_addr #0 {
  %5 = alloca [4 x %struct.ImVec2], align 16
  %6 = tail call <2 x float> @vec2(float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  %7 = fadd <2 x float> %0, %1
  %8 = extractelement <2 x float> %7, i64 0
  %9 = fmul float %8, 5.000000e-01
  %10 = fadd <2 x float> %0, %1
  %11 = extractelement <2 x float> %10, i64 1
  %12 = fmul float %11, 5.000000e-01
  %13 = tail call <2 x float> @vec2(float noundef %9, float noundef %12)
  %14 = fmul float %3, 5.000000e-01
  store float %14, ptr @c, align 4, !tbaa !5
  %15 = fmul float %3, 1.300000e+01
  %16 = fpext float %15 to double
  %17 = tail call double @sin(double noundef %16) #8
  %18 = tail call double @llvm.fmuladd.f64(double %17, double 2.400000e+01, double 2.400000e+01)
  %19 = fptosi double %18 to i32
  %20 = mul nsw i32 %19, 257
  %21 = add nsw i32 %20, -11530160
  store i32 %21, ptr @j, align 4, !tbaa !9
  %22 = load i32, ptr @K, align 4, !tbaa !9
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr @k, align 4, !tbaa !9
  %.not22 = icmp eq i32 %23, 0
  br i1 %.not22, label %._crit_edge, label %.lr.ph23

.lr.ph23:                                         ; preds = %4
  %.sroa.012.4.vec.extract = extractelement <2 x float> %2, i64 1
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  %25 = getelementptr inbounds i8, ptr %5, i64 16
  %26 = getelementptr inbounds i8, ptr %5, i64 24
  %27 = load i32, ptr @J, align 4, !tbaa !9
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %.lr.ph23.split.us, label %.lr.ph23.split

.lr.ph23.split.us:                                ; preds = %.lr.ph23
  store i32 -1, ptr @j, align 4, !tbaa !9
  store i32 0, ptr @k, align 4, !tbaa !9
  br label %._crit_edge

.loopexit.loopexit:                               ; preds = %170
  %.pre = load i32, ptr @k, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.lr.ph23.split
  %29 = phi i32 [ %.pre, %.loopexit.loopexit ], [ %32, %.lr.ph23.split ]
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr @k, align 4, !tbaa !9
  %.not = icmp eq i32 %30, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph23.splitthread-pre-split, !llvm.loop !11

.lr.ph23.splitthread-pre-split:                   ; preds = %.loopexit
  %.pr24 = load i32, ptr @J, align 4, !tbaa !9
  br label %.lr.ph23.split

.lr.ph23.split:                                   ; preds = %.lr.ph23, %.lr.ph23.splitthread-pre-split
  %31 = phi i32 [ %.pr24, %.lr.ph23.splitthread-pre-split ], [ %27, %.lr.ph23 ]
  %32 = phi i32 [ %30, %.lr.ph23.splitthread-pre-split ], [ %23, %.lr.ph23 ]
  %33 = add nsw i32 %31, -1
  store i32 %33, ptr @j, align 4, !tbaa !9
  %.not1521 = icmp eq i32 %31, 0
  br i1 %.not1521, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph23.split, %170
  store i32 3, ptr @i, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %.lr.ph, %34
  %35 = phi i32 [ 3, %.lr.ph ], [ %63, %34 ]
  %36 = load i32, ptr @j, align 4, !tbaa !9
  %37 = srem i32 %35, 3
  %38 = icmp sgt i32 %37, 0
  %39 = zext i1 %38 to i32
  %40 = add nsw i32 %36, %39
  store i32 %40, ptr @u, align 4, !tbaa !9
  %.neg = sdiv i32 %35, -2
  store i32 %.neg, ptr @v, align 4, !tbaa !9
  %41 = load i32, ptr @k, align 4, !tbaa !9
  %42 = add nsw i32 %41, %.neg
  %43 = sitofp i32 %42 to float
  %44 = tail call <2 x float> @P(float noundef %43)
  %.sroa.02.0.vec.extract = extractelement <2 x float> %44, i64 0
  store float %.sroa.02.0.vec.extract, ptr @x, align 4, !tbaa !5
  %.sroa.02.4.vec.extract = extractelement <2 x float> %44, i64 1
  store float %.sroa.02.4.vec.extract, ptr @y, align 4, !tbaa !5
  store float 0.000000e+00, ptr @z, align 4, !tbaa !5
  %45 = load i32, ptr @u, align 4, !tbaa !9
  %46 = sitofp i32 %45 to float
  %47 = load i32, ptr @J, align 4, !tbaa !9
  %48 = sitofp i32 %47 to float
  %49 = fdiv float %46, %48
  tail call void @T(float noundef %49)
  %50 = load float, ptr @x, align 4, !tbaa !5
  store float %50, ptr @e, align 4, !tbaa !5
  %51 = load float, ptr @y, align 4, !tbaa !5
  store float %51, ptr @f, align 4, !tbaa !5
  %52 = load float, ptr @z, align 4, !tbaa !5
  %53 = fadd float %52, 2.500000e+00
  store float %53, ptr @g, align 4, !tbaa !5
  %54 = fdiv float %.sroa.012.4.vec.extract, %53
  store float %54, ptr @z, align 4, !tbaa !5
  %55 = load i32, ptr @i, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [4 x %struct.ImVec2], ptr %5, i64 0, i64 %56
  %58 = insertelement <2 x float> poison, float %50, i64 0
  %59 = insertelement <2 x float> %58, float %51, i64 1
  %60 = insertelement <2 x float> poison, float %54, i64 0
  %61 = shufflevector <2 x float> %60, <2 x float> poison, <2 x i32> zeroinitializer
  %62 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %59, <2 x float> %61, <2 x float> %13)
  store <2 x float> %62, ptr %57, align 8, !tbaa !5
  %63 = add nsw i32 %55, -1
  store i32 %63, ptr @i, align 4, !tbaa !9
  %.not16 = icmp eq i32 %55, 0
  br i1 %.not16, label %64, label %34, !llvm.loop !14

64:                                               ; preds = %34
  %65 = load i32, ptr @k, align 4, !tbaa !9
  %66 = sitofp i32 %65 to float
  %67 = tail call <2 x float> @P(float noundef %66)
  %68 = load i32, ptr @k, align 4, !tbaa !9
  %69 = add nsw i32 %68, -1
  %70 = sitofp i32 %69 to float
  %71 = tail call <2 x float> @P(float noundef %70)
  %72 = fsub <2 x float> %67, %71
  %73 = extractelement <2 x float> %72, i64 1
  %74 = fsub <2 x float> %71, %67
  %75 = extractelement <2 x float> %74, i64 0
  store float 0.000000e+00, ptr @z, align 4, !tbaa !5
  %76 = fmul <2 x float> %74, %74
  %77 = extractelement <2 x float> %76, i64 0
  %78 = tail call float @llvm.fmuladd.f32(float %73, float %73, float %77)
  %sqrt20 = tail call float @llvm.sqrt.f32(float %78)
  store float %sqrt20, ptr @l, align 4, !tbaa !5
  %79 = fdiv float %73, %sqrt20
  store float %79, ptr @x, align 4, !tbaa !5
  %80 = fdiv float %75, %sqrt20
  store float %80, ptr @y, align 4, !tbaa !5
  %81 = load i32, ptr @j, align 4, !tbaa !9
  %82 = sitofp i32 %81 to double
  %83 = fadd double %82, 5.000000e-01
  %84 = load i32, ptr @J, align 4, !tbaa !9
  %85 = sitofp i32 %84 to double
  %86 = fdiv double %83, %85
  %87 = fptrunc double %86 to float
  tail call void @T(float noundef %87)
  %88 = load float, ptr @x, align 4, !tbaa !5
  %89 = load float, ptr @e, align 4, !tbaa !5
  %90 = load float, ptr @y, align 4, !tbaa !5
  %91 = load float, ptr @f, align 4, !tbaa !5
  %92 = fmul float %90, %91
  %93 = tail call float @llvm.fmuladd.f32(float %88, float %89, float %92)
  %94 = load float, ptr @z, align 4, !tbaa !5
  %95 = load float, ptr @g, align 4, !tbaa !5
  %96 = tail call float @llvm.fmuladd.f32(float %94, float %95, float %93)
  %97 = fmul float %96, 2.000000e+00
  store float %97, ptr @r, align 4, !tbaa !5
  %98 = fneg float %97
  %99 = tail call float @llvm.fmuladd.f32(float %98, float %88, float %89)
  store float %99, ptr @e, align 4, !tbaa !5
  %100 = tail call float @llvm.fmuladd.f32(float %98, float %90, float %91)
  store float %100, ptr @f, align 4, !tbaa !5
  %101 = tail call float @llvm.fmuladd.f32(float %98, float %94, float %95)
  store float %101, ptr @g, align 4, !tbaa !5
  %102 = fpext float %99 to double
  %103 = fpext float %101 to double
  %104 = tail call double @atan2(double noundef %102, double noundef %103) #8
  %105 = fptrunc double %104 to float
  store float %105, ptr @x, align 4, !tbaa !5
  %106 = load float, ptr @e, align 4, !tbaa !5
  %107 = load float, ptr @g, align 4, !tbaa !5
  %108 = fmul float %107, %107
  %109 = tail call float @llvm.fmuladd.f32(float %106, float %106, float %108)
  %110 = fpext float %109 to double
  %sqrt = tail call double @llvm.sqrt.f64(double %110)
  %111 = load float, ptr @f, align 4, !tbaa !5
  %112 = fpext float %111 to double
  %113 = tail call double @atan2(double noundef %sqrt, double noundef %112) #8
  %114 = fptrunc double %113 to float
  store float %114, ptr @y, align 4, !tbaa !5
  %115 = load float, ptr @x, align 4, !tbaa !5
  %116 = fmul float %115, 5.000000e+00
  %117 = fpext float %116 to double
  %118 = tail call float @llvm.fmuladd.f32(float %114, float 3.000000e+00, float %3)
  %119 = fpext float %118 to double
  %120 = tail call double @sin(double noundef %119) #8
  %121 = fadd double %120, %117
  %122 = tail call double @sin(double noundef %121) #8
  %123 = load float, ptr @x, align 4, !tbaa !5
  %124 = fmul float %123, 9.000000e+00
  %125 = fpext float %124 to double
  %126 = load float, ptr @y, align 4, !tbaa !5
  %127 = tail call float @llvm.fmuladd.f32(float %126, float 5.000000e+00, float %3)
  %128 = fpext float %127 to double
  %129 = tail call double @sin(double noundef %128) #8
  %130 = fadd double %129, %125
  %131 = tail call double @sin(double noundef %130) #8
  %132 = fadd double %122, %131
  %133 = load float, ptr @y, align 4, !tbaa !5
  %134 = fmul float %133, 4.000000e+00
  %135 = fpext float %134 to double
  %136 = load float, ptr @x, align 4, !tbaa !5
  %137 = tail call float @llvm.fmuladd.f32(float %136, float 5.000000e+00, float %3)
  %138 = fpext float %137 to double
  %139 = tail call double @sin(double noundef %138) #8
  %140 = fadd double %139, %135
  %141 = tail call double @cos(double noundef %140) #8
  %142 = fadd double %132, %141
  %143 = fptrunc double %142 to float
  %144 = fmul float %143, 2.500000e-01
  %145 = fadd float %144, 5.000000e-01
  store float %145, ptr @l, align 4, !tbaa !5
  %146 = load float, ptr @r, align 4, !tbaa !5
  %147 = fcmp ogt float %146, 0.000000e+00
  br i1 %147, label %148, label %170

148:                                              ; preds = %64
  %149 = load float, ptr @f, align 4, !tbaa !5
  %150 = fmul float %149, 5.000000e-01
  %151 = fpext float %150 to double
  %152 = fsub double 5.000000e-01, %151
  %153 = fpext float %145 to double
  %154 = fmul double %152, %153
  %155 = fmul double %154, 5.000000e-01
  %156 = fptrunc double %155 to float
  %157 = fmul double %153, 9.000000e-01
  %158 = load float, ptr @e, align 4, !tbaa !5
  %159 = fmul float %158, 2.500000e-01
  %160 = fpext float %159 to double
  %161 = fadd double %160, 8.000000e-01
  %162 = fmul double %157, %161
  %163 = fptrunc double %162 to float
  %164 = tail call zeroext i16 @GL_RGB_f(float noundef %145, float noundef %163, float noundef %156)
  %165 = zext i16 %164 to i32
  %166 = load <2 x float>, ptr %5, align 16
  %167 = load <2 x float>, ptr %24, align 8
  %168 = load <2 x float>, ptr %25, align 16
  %169 = load <2 x float>, ptr %26, align 8
  tail call void @addQuad(<2 x float> %166, <2 x float> %167, <2 x float> %168, <2 x float> %169, i32 noundef %165)
  br label %170

170:                                              ; preds = %148, %64
  %.pr = load i32, ptr @j, align 4, !tbaa !9
  %171 = add nsw i32 %.pr, -1
  store i32 %171, ptr @j, align 4, !tbaa !9
  %.not15 = icmp eq i32 %.pr, 0
  br i1 %.not15, label %.loopexit.loopexit, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %.loopexit, %.lr.ph23.split.us, %4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @T(float noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @GL_RGB_f(float noundef, float noundef, float noundef) local_unnamed_addr #6

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #7

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { inlinehint 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { 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 = !{!"float", !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 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: AggressiveInstCombinePass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass