; LLVM IR from Dragons-Lake/REI :: sources/REI_Integration/3rdParty/nanovg (nanovg)

; 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.NVGcontext = type { %struct.NVGparams, ptr, i32, i32, float, float, [32 x %struct.NVGstate], i32, ptr, float, float, float, float, ptr, [4 x i32], i32, i32, i32, i32, i32 }
%struct.NVGparams = type { ptr, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.NVGstate = type { %struct.NVGcompositeOperationState, %struct.NVGpaint, %struct.NVGpaint, float, float, i32, i32, float, [6 x float], %struct.NVGscissor, float, float, float, float, i32, i32 }
%struct.NVGcompositeOperationState = type { i32, i32, i32, i32 }
%struct.NVGpaint = type { [6 x float], [2 x float], float, float, %struct.NVGcolor, %struct.NVGcolor, i32 }
%struct.NVGcolor = type { %union.anon }
%union.anon = type { [4 x float] }
%struct.NVGscissor = type { [6 x float], [2 x 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 float @llvm.fmuladd.f32(float, float, float) #1

; Function Attrs: nounwind uwtable
declare hidden float @nvg__cosf(float noundef) #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__sinf(float noundef) #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__absf(float noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @nvg__appendCommands(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @nvgArc(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, i32 noundef %6) #2 {
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca [138 x float], align 16
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store float %1, ptr %9, align 4, !tbaa !9
  store float %2, ptr %10, align 4, !tbaa !9
  store float %3, ptr %11, align 4, !tbaa !9
  store float %4, ptr %12, align 4, !tbaa !9
  store float %5, ptr %13, align 4, !tbaa !9
  store i32 %6, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store float 0.000000e+00, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store float 0.000000e+00, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store float 0.000000e+00, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store float 0.000000e+00, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #3
  store float 0.000000e+00, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  store float 0.000000e+00, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  store float 0.000000e+00, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store float 0.000000e+00, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  store float 0.000000e+00, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store float 0.000000e+00, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  store float 0.000000e+00, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  store float 0.000000e+00, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  store float 0.000000e+00, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #3
  store float 0.000000e+00, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 552, ptr %29) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #3
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.NVGcontext, ptr %34, i32 0, i32 3
  %36 = load i32, ptr %35, align 4, !tbaa !13
  %37 = icmp sgt i32 %36, 0
  %38 = zext i1 %37 to i64
  %39 = select i1 %37, i32 1, i32 0
  store i32 %39, ptr %33, align 4, !tbaa !11
  %40 = load float, ptr %13, align 4, !tbaa !9
  %41 = load float, ptr %12, align 4, !tbaa !9
  %42 = fsub float %40, %41
  store float %42, ptr %16, align 4, !tbaa !9
  %43 = load i32, ptr %14, align 4, !tbaa !11
  %44 = icmp eq i32 %43, 2
  br i1 %44, label %45, label %59

45:                                               ; preds = %7
  %46 = load float, ptr %16, align 4, !tbaa !9
  %47 = call float @nvg__absf(float noundef %46)
  %48 = fcmp oge float %47, 0x401921FB60000000
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  store float 0x401921FB60000000, ptr %16, align 4, !tbaa !9
  br label %58

50:                                               ; preds = %45
  br label %51

51:                                               ; preds = %54, %50
  %52 = load float, ptr %16, align 4, !tbaa !9
  %53 = fcmp olt float %52, 0.000000e+00
  br i1 %53, label %54, label %57

54:                                               ; preds = %51
  %55 = load float, ptr %16, align 4, !tbaa !9
  %56 = fadd float %55, 0x401921FB60000000
  store float %56, ptr %16, align 4, !tbaa !9
  br label %51, !llvm.loop !16

57:                                               ; preds = %51
  br label %58

58:                                               ; preds = %57, %49
  br label %73

59:                                               ; preds = %7
  %60 = load float, ptr %16, align 4, !tbaa !9
  %61 = call float @nvg__absf(float noundef %60)
  %62 = fcmp oge float %61, 0x401921FB60000000
  br i1 %62, label %63, label %64

63:                                               ; preds = %59
  store float 0xC01921FB60000000, ptr %16, align 4, !tbaa !9
  br label %72

64:                                               ; preds = %59
  br label %65

65:                                               ; preds = %68, %64
  %66 = load float, ptr %16, align 4, !tbaa !9
  %67 = fcmp ogt float %66, 0.000000e+00
  br i1 %67, label %68, label %71

68:                                               ; preds = %65
  %69 = load float, ptr %16, align 4, !tbaa !9
  %70 = fsub float %69, 0x401921FB60000000
  store float %70, ptr %16, align 4, !tbaa !9
  br label %65, !llvm.loop !18

71:                                               ; preds = %65
  br label %72

72:                                               ; preds = %71, %63
  br label %73

73:                                               ; preds = %72, %58
  %74 = load float, ptr %16, align 4, !tbaa !9
  %75 = call float @nvg__absf(float noundef %74)
  %76 = fdiv float %75, 0x3FF921FB60000000
  %77 = fadd float %76, 5.000000e-01
  %78 = fptosi float %77 to i32
  %79 = call i32 @nvg__mini(i32 noundef %78, i32 noundef 5)
  %80 = call i32 @nvg__maxi(i32 noundef 1, i32 noundef %79)
  store i32 %80, ptr %31, align 4, !tbaa !11
  %81 = load float, ptr %16, align 4, !tbaa !9
  %82 = load i32, ptr %31, align 4, !tbaa !11
  %83 = sitofp i32 %82 to float
  %84 = fdiv float %81, %83
  %85 = fdiv float %84, 2.000000e+00
  store float %85, ptr %17, align 4, !tbaa !9
  %86 = load float, ptr %17, align 4, !tbaa !9
  %87 = call float @nvg__cosf(float noundef %86)
  %88 = fsub float 1.000000e+00, %87
  %89 = fmul float 0x3FF5555560000000, %88
  %90 = load float, ptr %17, align 4, !tbaa !9
  %91 = call float @nvg__sinf(float noundef %90)
  %92 = fdiv float %89, %91
  %93 = call float @nvg__absf(float noundef %92)
  store float %93, ptr %18, align 4, !tbaa !9
  %94 = load i32, ptr %14, align 4, !tbaa !11
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %99

96:                                               ; preds = %73
  %97 = load float, ptr %18, align 4, !tbaa !9
  %98 = fneg float %97
  store float %98, ptr %18, align 4, !tbaa !9
  br label %99

99:                                               ; preds = %96, %73
  store i32 0, ptr %32, align 4, !tbaa !11
  store i32 0, ptr %30, align 4, !tbaa !11
  br label %100

100:                                              ; preds = %203, %99
  %101 = load i32, ptr %30, align 4, !tbaa !11
  %102 = load i32, ptr %31, align 4, !tbaa !11
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %104, label %206

104:                                              ; preds = %100
  %105 = load float, ptr %12, align 4, !tbaa !9
  %106 = load float, ptr %16, align 4, !tbaa !9
  %107 = load i32, ptr %30, align 4, !tbaa !11
  %108 = sitofp i32 %107 to float
  %109 = load i32, ptr %31, align 4, !tbaa !11
  %110 = sitofp i32 %109 to float
  %111 = fdiv float %108, %110
  %112 = call float @llvm.fmuladd.f32(float %106, float %111, float %105)
  store float %112, ptr %15, align 4, !tbaa !9
  %113 = load float, ptr %15, align 4, !tbaa !9
  %114 = call float @nvg__cosf(float noundef %113)
  store float %114, ptr %19, align 4, !tbaa !9
  %115 = load float, ptr %15, align 4, !tbaa !9
  %116 = call float @nvg__sinf(float noundef %115)
  store float %116, ptr %20, align 4, !tbaa !9
  %117 = load float, ptr %9, align 4, !tbaa !9
  %118 = load float, ptr %19, align 4, !tbaa !9
  %119 = load float, ptr %11, align 4, !tbaa !9
  %120 = call float @llvm.fmuladd.f32(float %118, float %119, float %117)
  store float %120, ptr %21, align 4, !tbaa !9
  %121 = load float, ptr %10, align 4, !tbaa !9
  %122 = load float, ptr %20, align 4, !tbaa !9
  %123 = load float, ptr %11, align 4, !tbaa !9
  %124 = call float @llvm.fmuladd.f32(float %122, float %123, float %121)
  store float %124, ptr %22, align 4, !tbaa !9
  %125 = load float, ptr %20, align 4, !tbaa !9
  %126 = fneg float %125
  %127 = load float, ptr %11, align 4, !tbaa !9
  %128 = fmul float %126, %127
  %129 = load float, ptr %18, align 4, !tbaa !9
  %130 = fmul float %128, %129
  store float %130, ptr %23, align 4, !tbaa !9
  %131 = load float, ptr %19, align 4, !tbaa !9
  %132 = load float, ptr %11, align 4, !tbaa !9
  %133 = fmul float %131, %132
  %134 = load float, ptr %18, align 4, !tbaa !9
  %135 = fmul float %133, %134
  store float %135, ptr %24, align 4, !tbaa !9
  %136 = load i32, ptr %30, align 4, !tbaa !11
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %155

138:                                              ; preds = %104
  %139 = load i32, ptr %33, align 4, !tbaa !11
  %140 = sitofp i32 %139 to float
  %141 = load i32, ptr %32, align 4, !tbaa !11
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %32, align 4, !tbaa !11
  %143 = sext i32 %141 to i64
  %144 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %143
  store float %140, ptr %144, align 4, !tbaa !9
  %145 = load float, ptr %21, align 4, !tbaa !9
  %146 = load i32, ptr %32, align 4, !tbaa !11
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %32, align 4, !tbaa !11
  %148 = sext i32 %146 to i64
  %149 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %148
  store float %145, ptr %149, align 4, !tbaa !9
  %150 = load float, ptr %22, align 4, !tbaa !9
  %151 = load i32, ptr %32, align 4, !tbaa !11
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %32, align 4, !tbaa !11
  %153 = sext i32 %151 to i64
  %154 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %153
  store float %150, ptr %154, align 4, !tbaa !9
  br label %198

155:                                              ; preds = %104
  %156 = load i32, ptr %32, align 4, !tbaa !11
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %32, align 4, !tbaa !11
  %158 = sext i32 %156 to i64
  %159 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %158
  store float 2.000000e+00, ptr %159, align 4, !tbaa !9
  %160 = load float, ptr %25, align 4, !tbaa !9
  %161 = load float, ptr %27, align 4, !tbaa !9
  %162 = fadd float %160, %161
  %163 = load i32, ptr %32, align 4, !tbaa !11
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %32, align 4, !tbaa !11
  %165 = sext i32 %163 to i64
  %166 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %165
  store float %162, ptr %166, align 4, !tbaa !9
  %167 = load float, ptr %26, align 4, !tbaa !9
  %168 = load float, ptr %28, align 4, !tbaa !9
  %169 = fadd float %167, %168
  %170 = load i32, ptr %32, align 4, !tbaa !11
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %32, align 4, !tbaa !11
  %172 = sext i32 %170 to i64
  %173 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %172
  store float %169, ptr %173, align 4, !tbaa !9
  %174 = load float, ptr %21, align 4, !tbaa !9
  %175 = load float, ptr %23, align 4, !tbaa !9
  %176 = fsub float %174, %175
  %177 = load i32, ptr %32, align 4, !tbaa !11
  %178 = add nsw i32 %177, 1
  store i32 %178, ptr %32, align 4, !tbaa !11
  %179 = sext i32 %177 to i64
  %180 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %179
  store float %176, ptr %180, align 4, !tbaa !9
  %181 = load float, ptr %22, align 4, !tbaa !9
  %182 = load float, ptr %24, align 4, !tbaa !9
  %183 = fsub float %181, %182
  %184 = load i32, ptr %32, align 4, !tbaa !11
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %32, align 4, !tbaa !11
  %186 = sext i32 %184 to i64
  %187 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %186
  store float %183, ptr %187, align 4, !tbaa !9
  %188 = load float, ptr %21, align 4, !tbaa !9
  %189 = load i32, ptr %32, align 4, !tbaa !11
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %32, align 4, !tbaa !11
  %191 = sext i32 %189 to i64
  %192 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %191
  store float %188, ptr %192, align 4, !tbaa !9
  %193 = load float, ptr %22, align 4, !tbaa !9
  %194 = load i32, ptr %32, align 4, !tbaa !11
  %195 = add nsw i32 %194, 1
  store i32 %195, ptr %32, align 4, !tbaa !11
  %196 = sext i32 %194 to i64
  %197 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 %196
  store float %193, ptr %197, align 4, !tbaa !9
  br label %198

198:                                              ; preds = %155, %138
  %199 = load float, ptr %21, align 4, !tbaa !9
  store float %199, ptr %25, align 4, !tbaa !9
  %200 = load float, ptr %22, align 4, !tbaa !9
  store float %200, ptr %26, align 4, !tbaa !9
  %201 = load float, ptr %23, align 4, !tbaa !9
  store float %201, ptr %27, align 4, !tbaa !9
  %202 = load float, ptr %24, align 4, !tbaa !9
  store float %202, ptr %28, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %198
  %204 = load i32, ptr %30, align 4, !tbaa !11
  %205 = add nsw i32 %204, 1
  store i32 %205, ptr %30, align 4, !tbaa !11
  br label %100, !llvm.loop !19

206:                                              ; preds = %100
  %207 = load ptr, ptr %8, align 8, !tbaa !5
  %208 = getelementptr inbounds [138 x float], ptr %29, i64 0, i64 0
  %209 = load i32, ptr %32, align 4, !tbaa !11
  call void @nvg__appendCommands(ptr noundef %207, ptr noundef %208, i32 noundef %209)
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 552, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 4, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @nvg__maxi(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @nvg__mini(i32 noundef, i32 noundef) #2

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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 124}
!14 = !{!"NVGcontext", !15, i64 0, !6, i64 112, !12, i64 120, !12, i64 124, !10, i64 128, !10, i64 132, !7, i64 136, !12, i64 8712, !6, i64 8720, !10, i64 8728, !10, i64 8732, !10, i64 8736, !10, i64 8740, !6, i64 8744, !7, i64 8752, !12, i64 8768, !12, i64 8772, !12, i64 8776, !12, i64 8780, !12, i64 8784}
!15 = !{!"NVGparams", !6, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden float @nvg__cosf(float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__sinf(float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden float @nvg__absf(float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @nvg__appendCommands(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @nvgArc(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4, float noundef %5, i32 noundef %6) local_unnamed_addr #2 {
  %8 = alloca [138 x float], align 16
  call void @llvm.lifetime.start.p0(i64 552, ptr nonnull %8) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 124
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  %12 = fsub float %5, %4
  %13 = icmp eq i32 %6, 2
  %14 = tail call float @nvg__absf(float noundef %12)
  %15 = fcmp ult float %14, 0x401921FB60000000
  br i1 %13, label %16, label %20

16:                                               ; preds = %7
  br i1 %15, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %16
  %17 = fcmp olt float %12, 0.000000e+00
  br i1 %17, label %.lr.ph79, label %.loopexit

.lr.ph79:                                         ; preds = %.preheader, %.lr.ph79
  %.06778 = phi float [ %18, %.lr.ph79 ], [ %12, %.preheader ]
  %18 = fadd float %.06778, 0x401921FB60000000
  %19 = fcmp olt float %18, 0.000000e+00
  br i1 %19, label %.lr.ph79, label %.loopexit, !llvm.loop !13

20:                                               ; preds = %7
  br i1 %15, label %.preheader75, label %.loopexit

.preheader75:                                     ; preds = %20
  %21 = fcmp ogt float %12, 0.000000e+00
  br i1 %21, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader75, %.lr.ph
  %.16877 = phi float [ %22, %.lr.ph ], [ %12, %.preheader75 ]
  %22 = fadd float %.16877, 0xC01921FB60000000
  %23 = fcmp ogt float %22, 0.000000e+00
  br i1 %23, label %.lr.ph, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph79, %.preheader75, %.preheader, %20, %16
  %.2 = phi float [ 0x401921FB60000000, %16 ], [ 0xC01921FB60000000, %20 ], [ %12, %.preheader ], [ %12, %.preheader75 ], [ %18, %.lr.ph79 ], [ %22, %.lr.ph ]
  %24 = tail call float @nvg__absf(float noundef %.2)
  %25 = fdiv float %24, 0x3FF921FB60000000
  %26 = fadd float %25, 5.000000e-01
  %27 = fptosi float %26 to i32
  %28 = tail call i32 @nvg__mini(i32 noundef %27, i32 noundef 5)
  %29 = tail call i32 @nvg__maxi(i32 noundef 1, i32 noundef %28)
  %30 = sitofp i32 %29 to float
  %31 = fdiv float %.2, %30
  %32 = fmul float %31, 5.000000e-01
  %33 = tail call float @nvg__cosf(float noundef %32)
  %34 = fsub float 1.000000e+00, %33
  %35 = fmul float %34, 0x3FF5555560000000
  %36 = tail call float @nvg__sinf(float noundef %32)
  %37 = fdiv float %35, %36
  %38 = tail call float @nvg__absf(float noundef %37)
  %39 = icmp eq i32 %6, 1
  %40 = fneg float %38
  %.074 = select i1 %39, float %40, float %38
  %.not81 = icmp slt i32 %29, 0
  br i1 %.not81, label %._crit_edge, label %41

41:                                               ; preds = %.loopexit
  %42 = fdiv float 0.000000e+00, %30
  %43 = tail call float @llvm.fmuladd.f32(float %.2, float %42, float %4)
  %44 = tail call float @nvg__cosf(float noundef %43)
  %45 = tail call float @nvg__sinf(float noundef %43)
  %46 = insertelement <2 x float> poison, float %44, i64 0
  %47 = insertelement <2 x float> %46, float %45, i64 1
  %48 = insertelement <2 x float> poison, float %3, i64 0
  %49 = shufflevector <2 x float> %48, <2 x float> poison, <2 x i32> zeroinitializer
  %50 = insertelement <2 x float> poison, float %1, i64 0
  %51 = insertelement <2 x float> %50, float %2, i64 1
  %52 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %47, <2 x float> %49, <2 x float> %51)
  %53 = uitofp i1 %11 to float
  store float %53, ptr %8, align 16, !tbaa !16
  %54 = getelementptr inbounds i8, ptr %8, i64 4
  store <2 x float> %52, ptr %54, align 4, !tbaa !16
  %exitcond.peel.not = icmp eq i32 %29, 0
  br i1 %exitcond.peel.not, label %._crit_edge, label %.peel.next.preheader

.peel.next.preheader:                             ; preds = %41
  %55 = fneg float %45
  %56 = insertelement <2 x float> poison, float %55, i64 0
  %57 = insertelement <2 x float> %56, float %44, i64 1
  %58 = fmul <2 x float> %57, %49
  %59 = insertelement <2 x float> poison, float %.074, i64 0
  %60 = shufflevector <2 x float> %59, <2 x float> poison, <2 x i32> zeroinitializer
  %61 = fmul <2 x float> %60, %58
  br label %.peel.next

.peel.next:                                       ; preds = %.peel.next.preheader, %.peel.next
  %.087 = phi i32 [ %90, %.peel.next ], [ 3, %.peel.next.preheader ]
  %.06986 = phi i32 [ %91, %.peel.next ], [ 1, %.peel.next.preheader ]
  %62 = phi <2 x float> [ %79, %.peel.next ], [ %52, %.peel.next.preheader ]
  %63 = phi <2 x float> [ %83, %.peel.next ], [ %61, %.peel.next.preheader ]
  %64 = uitofp nneg i32 %.06986 to float
  %65 = fdiv float %64, %30
  %66 = tail call float @llvm.fmuladd.f32(float %.2, float %65, float %4)
  %67 = tail call float @nvg__cosf(float noundef %66)
  %68 = tail call float @nvg__sinf(float noundef %66)
  %69 = fneg float %68
  %70 = add nuw nsw i32 %.087, 1
  %71 = zext nneg i32 %.087 to i64
  %72 = getelementptr inbounds [138 x float], ptr %8, i64 0, i64 %71
  store float 2.000000e+00, ptr %72, align 4, !tbaa !16
  %73 = fadd <2 x float> %62, %63
  %74 = zext nneg i32 %70 to i64
  %75 = getelementptr inbounds [138 x float], ptr %8, i64 0, i64 %74
  %76 = add nuw nsw i32 %.087, 3
  %77 = insertelement <2 x float> poison, float %67, i64 0
  %78 = insertelement <2 x float> %77, float %68, i64 1
  %79 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %78, <2 x float> %49, <2 x float> %51)
  %80 = insertelement <2 x float> poison, float %69, i64 0
  %81 = insertelement <2 x float> %80, float %67, i64 1
  %82 = fmul <2 x float> %81, %49
  %83 = fmul <2 x float> %60, %82
  store <2 x float> %73, ptr %75, align 4, !tbaa !16
  %84 = zext nneg i32 %76 to i64
  %85 = getelementptr inbounds [138 x float], ptr %8, i64 0, i64 %84
  %86 = add nuw nsw i32 %.087, 5
  %87 = fsub <2 x float> %79, %83
  store <2 x float> %87, ptr %85, align 4, !tbaa !16
  %88 = zext nneg i32 %86 to i64
  %89 = getelementptr inbounds [138 x float], ptr %8, i64 0, i64 %88
  %90 = add nuw nsw i32 %.087, 7
  store <2 x float> %79, ptr %89, align 4, !tbaa !16
  %91 = add nuw i32 %.06986, 1
  %exitcond.not = icmp eq i32 %.06986, %29
  br i1 %exitcond.not, label %._crit_edge, label %.peel.next, !llvm.loop !17

._crit_edge:                                      ; preds = %.peel.next, %41, %.loopexit
  %.0.lcssa = phi i32 [ 0, %.loopexit ], [ 3, %41 ], [ %90, %.peel.next ]
  call void @nvg__appendCommands(ptr noundef %0, ptr noundef nonnull %8, i32 noundef %.0.lcssa)
  call void @llvm.lifetime.end.p0(i64 552, ptr nonnull %8) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @nvg__maxi(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @nvg__mini(i32 noundef, i32 noundef) local_unnamed_addr #2

; 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>) #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !11, i64 124}
!6 = !{!"NVGcontext", !7, i64 0, !8, i64 112, !11, i64 120, !11, i64 124, !12, i64 128, !12, i64 132, !9, i64 136, !11, i64 8712, !8, i64 8720, !12, i64 8728, !12, i64 8732, !12, i64 8736, !12, i64 8740, !8, i64 8744, !9, i64 8752, !11, i64 8768, !11, i64 8772, !11, i64 8776, !11, i64 8780, !11, i64 8784}
!7 = !{!"NVGparams", !8, i64 0, !11, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !8, i64 104}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!12, !12, i64 0}
!17 = distinct !{!17, !14, !18}
!18 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass