2021-07-23 13:10:12 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
struct buf0 {
|
2021-08-23 21:45:23 +00:00
|
|
|
/* 0x0000 */ float2 injectionSwitch;
|
2021-07-23 13:10:12 +00:00
|
|
|
};
|
|
|
|
struct tint_array_wrapper {
|
|
|
|
int arr[10];
|
|
|
|
};
|
|
|
|
struct main_out {
|
|
|
|
float4 x_GLF_color_1;
|
|
|
|
};
|
2021-08-04 22:15:28 +00:00
|
|
|
struct tint_symbol_1 {
|
2021-07-23 13:10:12 +00:00
|
|
|
float4 x_GLF_color_1 [[color(0)]];
|
|
|
|
};
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void merge_i1_i1_i1_(thread int* const from, thread int* const mid, thread int* const to, thread tint_array_wrapper* const tint_symbol_3, thread tint_array_wrapper* const tint_symbol_4) {
|
2021-07-23 13:10:12 +00:00
|
|
|
int k = 0;
|
|
|
|
int i = 0;
|
|
|
|
int j = 0;
|
|
|
|
int i_1 = 0;
|
|
|
|
int const x_262 = *(from);
|
|
|
|
k = x_262;
|
|
|
|
int const x_263 = *(from);
|
|
|
|
i = x_263;
|
|
|
|
int const x_264 = *(mid);
|
2021-07-30 18:59:06 +00:00
|
|
|
j = as_type<int>((as_type<uint>(x_264) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
while (true) {
|
|
|
|
int const x_270 = i;
|
|
|
|
int const x_271 = *(mid);
|
|
|
|
int const x_273 = j;
|
|
|
|
int const x_274 = *(to);
|
2021-07-26 17:34:58 +00:00
|
|
|
if (((x_270 <= x_271) & (x_273 <= x_274))) {
|
2021-07-23 13:10:12 +00:00
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_278 = i;
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_280 = (*(tint_symbol_3)).arr[x_278];
|
2021-07-23 13:10:12 +00:00
|
|
|
int const x_281 = j;
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_283 = (*(tint_symbol_3)).arr[x_281];
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((x_280 < x_283)) {
|
|
|
|
int const x_288 = k;
|
2021-07-30 18:59:06 +00:00
|
|
|
k = as_type<int>((as_type<uint>(x_288) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
int const x_290 = i;
|
2021-07-30 18:59:06 +00:00
|
|
|
i = as_type<int>((as_type<uint>(x_290) + as_type<uint>(1)));
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_293 = (*(tint_symbol_3)).arr[x_290];
|
|
|
|
(*(tint_symbol_4)).arr[x_288] = x_293;
|
2021-07-23 13:10:12 +00:00
|
|
|
} else {
|
|
|
|
int const x_295 = k;
|
2021-07-30 18:59:06 +00:00
|
|
|
k = as_type<int>((as_type<uint>(x_295) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
int const x_297 = j;
|
2021-07-30 18:59:06 +00:00
|
|
|
j = as_type<int>((as_type<uint>(x_297) + as_type<uint>(1)));
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_300 = (*(tint_symbol_3)).arr[x_297];
|
|
|
|
(*(tint_symbol_4)).arr[x_295] = x_300;
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
while (true) {
|
|
|
|
int const x_306 = i;
|
|
|
|
int const x_308 = i;
|
|
|
|
int const x_309 = *(mid);
|
2021-07-26 17:34:58 +00:00
|
|
|
if (((x_306 < 10) & (x_308 <= x_309))) {
|
2021-07-23 13:10:12 +00:00
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_313 = k;
|
2021-07-30 18:59:06 +00:00
|
|
|
k = as_type<int>((as_type<uint>(x_313) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
int const x_315 = i;
|
2021-07-30 18:59:06 +00:00
|
|
|
i = as_type<int>((as_type<uint>(x_315) + as_type<uint>(1)));
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_318 = (*(tint_symbol_3)).arr[x_315];
|
|
|
|
(*(tint_symbol_4)).arr[x_313] = x_318;
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
int const x_320 = *(from);
|
|
|
|
i_1 = x_320;
|
|
|
|
while (true) {
|
|
|
|
int const x_325 = i_1;
|
|
|
|
int const x_326 = *(to);
|
|
|
|
if ((x_325 <= x_326)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_329 = i_1;
|
|
|
|
int const x_330 = i_1;
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_332 = (*(tint_symbol_4)).arr[x_330];
|
|
|
|
(*(tint_symbol_3)).arr[x_329] = x_332;
|
2021-07-23 13:10:12 +00:00
|
|
|
{
|
|
|
|
int const x_334 = i_1;
|
2021-07-30 18:59:06 +00:00
|
|
|
i_1 = as_type<int>((as_type<uint>(x_334) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void mergeSort_(thread tint_array_wrapper* const tint_symbol_5, thread tint_array_wrapper* const tint_symbol_6) {
|
2021-07-23 13:10:12 +00:00
|
|
|
int low = 0;
|
|
|
|
int high = 0;
|
|
|
|
int m = 0;
|
|
|
|
int i_2 = 0;
|
|
|
|
int from_1 = 0;
|
|
|
|
int mid_1 = 0;
|
|
|
|
int to_1 = 0;
|
|
|
|
int param = 0;
|
|
|
|
int param_1 = 0;
|
|
|
|
int param_2 = 0;
|
|
|
|
low = 0;
|
|
|
|
high = 9;
|
|
|
|
m = 1;
|
|
|
|
while (true) {
|
|
|
|
int const x_341 = m;
|
|
|
|
int const x_342 = high;
|
|
|
|
if ((x_341 <= x_342)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_345 = low;
|
|
|
|
i_2 = x_345;
|
|
|
|
while (true) {
|
|
|
|
int const x_350 = i_2;
|
|
|
|
int const x_351 = high;
|
|
|
|
if ((x_350 < x_351)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_354 = i_2;
|
|
|
|
from_1 = x_354;
|
|
|
|
int const x_355 = i_2;
|
|
|
|
int const x_356 = m;
|
2021-07-30 18:59:06 +00:00
|
|
|
mid_1 = as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_355) + as_type<uint>(x_356)))) - as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
int const x_359 = i_2;
|
|
|
|
int const x_360 = m;
|
|
|
|
int const x_364 = high;
|
2021-07-30 18:59:06 +00:00
|
|
|
to_1 = min(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_359) + as_type<uint>(as_type<int>((as_type<uint>(2) * as_type<uint>(x_360))))))) - as_type<uint>(1))), x_364);
|
2021-07-23 13:10:12 +00:00
|
|
|
int const x_366 = from_1;
|
|
|
|
param = x_366;
|
|
|
|
int const x_367 = mid_1;
|
|
|
|
param_1 = x_367;
|
|
|
|
int const x_368 = to_1;
|
|
|
|
param_2 = x_368;
|
2021-08-04 22:15:28 +00:00
|
|
|
merge_i1_i1_i1_(&(param), &(param_1), &(param_2), tint_symbol_5, tint_symbol_6);
|
2021-07-23 13:10:12 +00:00
|
|
|
{
|
|
|
|
int const x_370 = m;
|
|
|
|
int const x_372 = i_2;
|
2021-07-30 18:59:06 +00:00
|
|
|
i_2 = as_type<int>((as_type<uint>(x_372) + as_type<uint>(as_type<int>((as_type<uint>(2) * as_type<uint>(x_370))))));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
int const x_374 = m;
|
2021-07-30 18:59:06 +00:00
|
|
|
m = as_type<int>((as_type<uint>(2) * as_type<uint>(x_374)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
void main_1(constant buf0& x_28, thread tint_array_wrapper* const tint_symbol_7, thread tint_array_wrapper* const tint_symbol_8, thread float4* const tint_symbol_9, thread float4* const tint_symbol_10) {
|
2021-07-23 13:10:12 +00:00
|
|
|
int i_3 = 0;
|
|
|
|
int j_1 = 0;
|
|
|
|
float grey = 0.0f;
|
|
|
|
int int_i = 0;
|
|
|
|
float const x_85 = x_28.injectionSwitch.x;
|
|
|
|
i_3 = int(x_85);
|
|
|
|
while (true) {
|
|
|
|
int const x_91 = i_3;
|
|
|
|
switch(x_91) {
|
|
|
|
case 9: {
|
|
|
|
int const x_121 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_121] = -5;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 8: {
|
|
|
|
int const x_119 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_119] = -4;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7: {
|
|
|
|
int const x_117 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_117] = -3;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 6: {
|
|
|
|
int const x_115 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_115] = -2;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 5: {
|
|
|
|
int const x_113 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_113] = -1;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 4: {
|
|
|
|
int const x_111 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_111] = 0;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3: {
|
|
|
|
int const x_109 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_109] = 1;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2: {
|
|
|
|
int const x_107 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_107] = 2;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: {
|
|
|
|
int const x_105 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_105] = 3;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0: {
|
|
|
|
int const x_103 = i_3;
|
2021-08-04 22:15:28 +00:00
|
|
|
(*(tint_symbol_7)).arr[x_103] = 4;
|
2021-07-23 13:10:12 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int const x_123 = i_3;
|
2021-07-30 18:59:06 +00:00
|
|
|
i_3 = as_type<int>((as_type<uint>(x_123) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
{
|
|
|
|
int const x_125 = i_3;
|
|
|
|
if ((x_125 < 10)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
j_1 = 0;
|
|
|
|
while (true) {
|
|
|
|
int const x_131 = j_1;
|
|
|
|
if ((x_131 < 10)) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
int const x_134 = j_1;
|
|
|
|
int const x_135 = j_1;
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_137 = (*(tint_symbol_7)).arr[x_135];
|
|
|
|
(*(tint_symbol_8)).arr[x_134] = x_137;
|
2021-07-23 13:10:12 +00:00
|
|
|
{
|
|
|
|
int const x_139 = j_1;
|
2021-07-30 18:59:06 +00:00
|
|
|
j_1 = as_type<int>((as_type<uint>(x_139) + as_type<uint>(1)));
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-04 22:15:28 +00:00
|
|
|
mergeSort_(tint_symbol_7, tint_symbol_8);
|
|
|
|
float const x_143 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_143) < 30)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_150 = (*(tint_symbol_7)).arr[0];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_150) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_155 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_155) < 60)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_162 = (*(tint_symbol_7)).arr[1];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_162) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_167 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_167) < 90)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_174 = (*(tint_symbol_7)).arr[2];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_174) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_179 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_179) < 120)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_186 = (*(tint_symbol_7)).arr[3];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_186) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_191 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_191) < 150)) {
|
|
|
|
int_i = 1;
|
|
|
|
while (true) {
|
|
|
|
int const x_201 = int_i;
|
|
|
|
float const x_203 = x_28.injectionSwitch.x;
|
|
|
|
if ((x_201 > int(x_203))) {
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
discard_fragment();
|
|
|
|
}
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_208 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_208) < 180)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_215 = (*(tint_symbol_7)).arr[5];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_215) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_220 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_220) < 210)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_227 = (*(tint_symbol_7)).arr[6];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_227) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_232 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_232) < 240)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_239 = (*(tint_symbol_7)).arr[7];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_239) / 10.0f));
|
|
|
|
} else {
|
2021-08-04 22:15:28 +00:00
|
|
|
float const x_244 = (*(tint_symbol_9)).y;
|
2021-07-23 13:10:12 +00:00
|
|
|
if ((int(x_244) < 270)) {
|
2021-08-04 22:15:28 +00:00
|
|
|
int const x_251 = (*(tint_symbol_7)).arr[8];
|
2021-07-23 13:10:12 +00:00
|
|
|
grey = (0.5f + (float(x_251) / 10.0f));
|
|
|
|
} else {
|
|
|
|
discard_fragment();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
float const x_255 = grey;
|
|
|
|
float3 const x_256 = float3(x_255, x_255, x_255);
|
2021-08-04 22:15:28 +00:00
|
|
|
*(tint_symbol_10) = float4(x_256.x, x_256.y, x_256.z, 1.0f);
|
2021-07-23 13:10:12 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-08-04 22:15:28 +00:00
|
|
|
main_out tint_symbol_inner(constant buf0& x_28, float4 gl_FragCoord_param, thread float4* const tint_symbol_11, thread tint_array_wrapper* const tint_symbol_12, thread tint_array_wrapper* const tint_symbol_13, thread float4* const tint_symbol_14) {
|
|
|
|
*(tint_symbol_11) = gl_FragCoord_param;
|
|
|
|
main_1(x_28, tint_symbol_12, tint_symbol_13, tint_symbol_11, tint_symbol_14);
|
|
|
|
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_14)};
|
|
|
|
return tint_symbol_2;
|
|
|
|
}
|
|
|
|
|
|
|
|
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_28 [[buffer(0)]]) {
|
|
|
|
thread float4 tint_symbol_15 = 0.0f;
|
|
|
|
thread tint_array_wrapper tint_symbol_16 = {};
|
|
|
|
thread tint_array_wrapper tint_symbol_17 = {};
|
|
|
|
thread float4 tint_symbol_18 = 0.0f;
|
|
|
|
main_out const inner_result = tint_symbol_inner(x_28, gl_FragCoord_param, &(tint_symbol_15), &(tint_symbol_16), &(tint_symbol_17), &(tint_symbol_18));
|
|
|
|
tint_symbol_1 wrapper_result = {};
|
|
|
|
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
|
|
|
|
return wrapper_result;
|
2021-07-23 13:10:12 +00:00
|
|
|
}
|
|
|
|
|