blob: 752c6ed0be732eb607dbacc06c8febdf65a13bdb [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct BST {
int data;
int leftIndex;
int rightIndex;
};
struct tint_array_wrapper {
BST arr[10];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(thread float4* const tint_symbol_23) {
tint_array_wrapper tree = {};
int x_356 = 0;
int x_58_phi = 0;
bool x_86_phi = false;
int x_353_phi = 0;
int x_356_phi = 0;
int x_358_phi = 0;
BST const tint_symbol_3 = {.data=9, .leftIndex=-1, .rightIndex=-1};
tree.arr[0] = tint_symbol_3;
switch(0u) {
default: {
x_58_phi = 0;
while (true) {
int x_84 = 0;
int x_76 = 0;
int x_59 = 0;
int x_59_phi = 0;
int const x_58 = x_58_phi;
x_86_phi = false;
if ((x_58 <= 1)) {
} else {
break;
}
int const x_65 = tree.arr[x_58].data;
if ((5 <= x_65)) {
int const x_78_save = x_58;
int const x_79 = tree.arr[x_78_save].leftIndex;
if ((x_79 == -1)) {
tree.arr[x_78_save].leftIndex = 1;
BST const tint_symbol_4 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_4;
x_86_phi = true;
break;
} else {
x_84 = tree.arr[x_78_save].leftIndex;
x_59_phi = x_84;
{
x_59 = x_59_phi;
x_58_phi = x_59;
}
continue;
}
return;
} else {
int const x_70_save = x_58;
int const x_71 = tree.arr[x_70_save].rightIndex;
if ((x_71 == -1)) {
tree.arr[x_70_save].rightIndex = 1;
BST const tint_symbol_5 = {.data=5, .leftIndex=-1, .rightIndex=-1};
tree.arr[1] = tint_symbol_5;
x_86_phi = true;
break;
} else {
x_76 = tree.arr[x_70_save].rightIndex;
x_59_phi = x_76;
{
x_59 = x_59_phi;
x_58_phi = x_59;
}
continue;
}
return;
}
return;
{
x_59 = x_59_phi;
x_58_phi = x_59;
}
}
bool const x_86 = x_86_phi;
if (x_86) {
break;
}
break;
}
}
int x_91_phi = 0;
bool x_119_phi = false;
switch(0u) {
default: {
x_91_phi = 0;
while (true) {
int x_117 = 0;
int x_109 = 0;
int x_92 = 0;
int x_92_phi = 0;
int const x_91 = x_91_phi;
x_119_phi = false;
if ((x_91 <= 2)) {
} else {
break;
}
int const x_98 = tree.arr[x_91].data;
if ((12 <= x_98)) {
int const x_111_save = x_91;
int const x_112 = tree.arr[x_111_save].leftIndex;
if ((x_112 == -1)) {
tree.arr[x_111_save].leftIndex = 2;
BST const tint_symbol_6 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_6;
x_119_phi = true;
break;
} else {
x_117 = tree.arr[x_111_save].leftIndex;
x_92_phi = x_117;
{
x_92 = x_92_phi;
x_91_phi = x_92;
}
continue;
}
return;
} else {
int const x_103_save = x_91;
int const x_104 = tree.arr[x_103_save].rightIndex;
if ((x_104 == -1)) {
tree.arr[x_103_save].rightIndex = 2;
BST const tint_symbol_7 = {.data=12, .leftIndex=-1, .rightIndex=-1};
tree.arr[2] = tint_symbol_7;
x_119_phi = true;
break;
} else {
x_109 = tree.arr[x_103_save].rightIndex;
x_92_phi = x_109;
{
x_92 = x_92_phi;
x_91_phi = x_92;
}
continue;
}
return;
}
return;
{
x_92 = x_92_phi;
x_91_phi = x_92;
}
}
bool const x_119 = x_119_phi;
if (x_119) {
break;
}
break;
}
}
int x_124_phi = 0;
bool x_152_phi = false;
switch(0u) {
default: {
x_124_phi = 0;
while (true) {
int x_150 = 0;
int x_142 = 0;
int x_125 = 0;
int x_125_phi = 0;
int const x_124 = x_124_phi;
x_152_phi = false;
if ((x_124 <= 3)) {
} else {
break;
}
int const x_131 = tree.arr[x_124].data;
if ((15 <= x_131)) {
int const x_144_save = x_124;
int const x_145 = tree.arr[x_144_save].leftIndex;
if ((x_145 == -1)) {
tree.arr[x_144_save].leftIndex = 3;
BST const tint_symbol_8 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_8;
x_152_phi = true;
break;
} else {
x_150 = tree.arr[x_144_save].leftIndex;
x_125_phi = x_150;
{
x_125 = x_125_phi;
x_124_phi = x_125;
}
continue;
}
return;
} else {
int const x_136_save = x_124;
int const x_137 = tree.arr[x_136_save].rightIndex;
if ((x_137 == -1)) {
tree.arr[x_136_save].rightIndex = 3;
BST const tint_symbol_9 = {.data=15, .leftIndex=-1, .rightIndex=-1};
tree.arr[3] = tint_symbol_9;
x_152_phi = true;
break;
} else {
x_142 = tree.arr[x_136_save].rightIndex;
x_125_phi = x_142;
{
x_125 = x_125_phi;
x_124_phi = x_125;
}
continue;
}
return;
}
return;
{
x_125 = x_125_phi;
x_124_phi = x_125;
}
}
bool const x_152 = x_152_phi;
if (x_152) {
break;
}
break;
}
}
int x_157_phi = 0;
bool x_185_phi = false;
switch(0u) {
default: {
x_157_phi = 0;
while (true) {
int x_183 = 0;
int x_175 = 0;
int x_158 = 0;
int x_158_phi = 0;
int const x_157 = x_157_phi;
x_185_phi = false;
if ((x_157 <= 4)) {
} else {
break;
}
int const x_164 = tree.arr[x_157].data;
if ((7 <= x_164)) {
int const x_177_save = x_157;
int const x_178 = tree.arr[x_177_save].leftIndex;
if ((x_178 == -1)) {
tree.arr[x_177_save].leftIndex = 4;
BST const tint_symbol_10 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_10;
x_185_phi = true;
break;
} else {
x_183 = tree.arr[x_177_save].leftIndex;
x_158_phi = x_183;
{
x_158 = x_158_phi;
x_157_phi = x_158;
}
continue;
}
return;
} else {
int const x_169_save = x_157;
int const x_170 = tree.arr[x_169_save].rightIndex;
if ((x_170 == -1)) {
tree.arr[x_169_save].rightIndex = 4;
BST const tint_symbol_11 = {.data=7, .leftIndex=-1, .rightIndex=-1};
tree.arr[4] = tint_symbol_11;
x_185_phi = true;
break;
} else {
x_175 = tree.arr[x_169_save].rightIndex;
x_158_phi = x_175;
{
x_158 = x_158_phi;
x_157_phi = x_158;
}
continue;
}
return;
}
return;
{
x_158 = x_158_phi;
x_157_phi = x_158;
}
}
bool const x_185 = x_185_phi;
if (x_185) {
break;
}
break;
}
}
int x_190_phi = 0;
bool x_218_phi = false;
switch(0u) {
default: {
x_190_phi = 0;
while (true) {
int x_216 = 0;
int x_208 = 0;
int x_191 = 0;
int x_191_phi = 0;
int const x_190 = x_190_phi;
x_218_phi = false;
if ((x_190 <= 5)) {
} else {
break;
}
int const x_197 = tree.arr[x_190].data;
if ((8 <= x_197)) {
int const x_210_save = x_190;
int const x_211 = tree.arr[x_210_save].leftIndex;
if ((x_211 == -1)) {
tree.arr[x_210_save].leftIndex = 5;
BST const tint_symbol_12 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_12;
x_218_phi = true;
break;
} else {
x_216 = tree.arr[x_210_save].leftIndex;
x_191_phi = x_216;
{
x_191 = x_191_phi;
x_190_phi = x_191;
}
continue;
}
return;
} else {
int const x_202_save = x_190;
int const x_203 = tree.arr[x_202_save].rightIndex;
if ((x_203 == -1)) {
tree.arr[x_202_save].rightIndex = 5;
BST const tint_symbol_13 = {.data=8, .leftIndex=-1, .rightIndex=-1};
tree.arr[5] = tint_symbol_13;
x_218_phi = true;
break;
} else {
x_208 = tree.arr[x_202_save].rightIndex;
x_191_phi = x_208;
{
x_191 = x_191_phi;
x_190_phi = x_191;
}
continue;
}
return;
}
return;
{
x_191 = x_191_phi;
x_190_phi = x_191;
}
}
bool const x_218 = x_218_phi;
if (x_218) {
break;
}
break;
}
}
int x_223_phi = 0;
bool x_251_phi = false;
switch(0u) {
default: {
x_223_phi = 0;
while (true) {
int x_249 = 0;
int x_241 = 0;
int x_224 = 0;
int x_224_phi = 0;
int const x_223 = x_223_phi;
x_251_phi = false;
if ((x_223 <= 6)) {
} else {
break;
}
int const x_230 = tree.arr[x_223].data;
if ((2 <= x_230)) {
int const x_243_save = x_223;
int const x_244 = tree.arr[x_243_save].leftIndex;
if ((x_244 == -1)) {
tree.arr[x_243_save].leftIndex = 6;
BST const tint_symbol_14 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_14;
x_251_phi = true;
break;
} else {
x_249 = tree.arr[x_243_save].leftIndex;
x_224_phi = x_249;
{
x_224 = x_224_phi;
x_223_phi = x_224;
}
continue;
}
return;
} else {
int const x_235_save = x_223;
int const x_236 = tree.arr[x_235_save].rightIndex;
if ((x_236 == -1)) {
tree.arr[x_235_save].rightIndex = 6;
BST const tint_symbol_15 = {.data=2, .leftIndex=-1, .rightIndex=-1};
tree.arr[6] = tint_symbol_15;
x_251_phi = true;
break;
} else {
x_241 = tree.arr[x_235_save].rightIndex;
x_224_phi = x_241;
{
x_224 = x_224_phi;
x_223_phi = x_224;
}
continue;
}
return;
}
return;
{
x_224 = x_224_phi;
x_223_phi = x_224;
}
}
bool const x_251 = x_251_phi;
if (x_251) {
break;
}
break;
}
}
int x_256_phi = 0;
bool x_284_phi = false;
switch(0u) {
default: {
x_256_phi = 0;
while (true) {
int x_282 = 0;
int x_274 = 0;
int x_257 = 0;
int x_257_phi = 0;
int const x_256 = x_256_phi;
x_284_phi = false;
if ((x_256 <= 7)) {
} else {
break;
}
int const x_263 = tree.arr[x_256].data;
if ((6 <= x_263)) {
int const x_276_save = x_256;
int const x_277 = tree.arr[x_276_save].leftIndex;
if ((x_277 == -1)) {
tree.arr[x_276_save].leftIndex = 7;
BST const tint_symbol_16 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_16;
x_284_phi = true;
break;
} else {
x_282 = tree.arr[x_276_save].leftIndex;
x_257_phi = x_282;
{
x_257 = x_257_phi;
x_256_phi = x_257;
}
continue;
}
return;
} else {
int const x_268_save = x_256;
int const x_269 = tree.arr[x_268_save].rightIndex;
if ((x_269 == -1)) {
tree.arr[x_268_save].rightIndex = 7;
BST const tint_symbol_17 = {.data=6, .leftIndex=-1, .rightIndex=-1};
tree.arr[7] = tint_symbol_17;
x_284_phi = true;
break;
} else {
x_274 = tree.arr[x_268_save].rightIndex;
x_257_phi = x_274;
{
x_257 = x_257_phi;
x_256_phi = x_257;
}
continue;
}
return;
}
return;
{
x_257 = x_257_phi;
x_256_phi = x_257;
}
}
bool const x_284 = x_284_phi;
if (x_284) {
break;
}
break;
}
}
int x_289_phi = 0;
bool x_317_phi = false;
switch(0u) {
default: {
x_289_phi = 0;
while (true) {
int x_315 = 0;
int x_307 = 0;
int x_290 = 0;
int x_290_phi = 0;
int const x_289 = x_289_phi;
x_317_phi = false;
if ((x_289 <= 8)) {
} else {
break;
}
int const x_296 = tree.arr[x_289].data;
if ((17 <= x_296)) {
int const x_309_save = x_289;
int const x_310 = tree.arr[x_309_save].leftIndex;
if ((x_310 == -1)) {
tree.arr[x_309_save].leftIndex = 8;
BST const tint_symbol_18 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_18;
x_317_phi = true;
break;
} else {
x_315 = tree.arr[x_309_save].leftIndex;
x_290_phi = x_315;
{
x_290 = x_290_phi;
x_289_phi = x_290;
}
continue;
}
return;
} else {
int const x_301_save = x_289;
int const x_302 = tree.arr[x_301_save].rightIndex;
if ((x_302 == -1)) {
tree.arr[x_301_save].rightIndex = 8;
BST const tint_symbol_19 = {.data=17, .leftIndex=-1, .rightIndex=-1};
tree.arr[8] = tint_symbol_19;
x_317_phi = true;
break;
} else {
x_307 = tree.arr[x_301_save].rightIndex;
x_290_phi = x_307;
{
x_290 = x_290_phi;
x_289_phi = x_290;
}
continue;
}
return;
}
return;
{
x_290 = x_290_phi;
x_289_phi = x_290;
}
}
bool const x_317 = x_317_phi;
if (x_317) {
break;
}
break;
}
}
int x_322_phi = 0;
bool x_350_phi = false;
switch(0u) {
default: {
x_322_phi = 0;
while (true) {
int x_348 = 0;
int x_340 = 0;
int x_323 = 0;
int x_323_phi = 0;
int const x_322 = x_322_phi;
x_350_phi = false;
if ((x_322 <= 9)) {
} else {
break;
}
int const x_329 = tree.arr[x_322].data;
if ((13 <= x_329)) {
int const x_342_save = x_322;
int const x_343 = tree.arr[x_342_save].leftIndex;
if ((x_343 == -1)) {
tree.arr[x_342_save].leftIndex = 9;
BST const tint_symbol_20 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_20;
x_350_phi = true;
break;
} else {
x_348 = tree.arr[x_342_save].leftIndex;
x_323_phi = x_348;
{
x_323 = x_323_phi;
x_322_phi = x_323;
}
continue;
}
return;
} else {
int const x_334_save = x_322;
int const x_335 = tree.arr[x_334_save].rightIndex;
if ((x_335 == -1)) {
tree.arr[x_334_save].rightIndex = 9;
BST const tint_symbol_21 = {.data=13, .leftIndex=-1, .rightIndex=-1};
tree.arr[9] = tint_symbol_21;
x_350_phi = true;
break;
} else {
x_340 = tree.arr[x_334_save].rightIndex;
x_323_phi = x_340;
{
x_323 = x_323_phi;
x_322_phi = x_323;
}
continue;
}
return;
}
return;
{
x_323 = x_323_phi;
x_322_phi = x_323;
}
}
bool const x_350 = x_350_phi;
if (x_350) {
break;
}
break;
}
}
x_353_phi = 0;
x_356_phi = 0;
x_358_phi = 0;
while (true) {
int x_381 = 0;
int x_391 = 0;
int x_396 = 0;
int x_359 = 0;
int x_354_phi = 0;
int x_357_phi = 0;
int const x_353 = x_353_phi;
x_356 = x_356_phi;
int const x_358 = x_358_phi;
if ((x_358 < 20)) {
} else {
break;
}
int x_366_phi = 0;
int x_381_phi = 0;
bool x_382_phi = false;
switch(0u) {
default: {
x_366_phi = 0;
while (true) {
int const x_366 = x_366_phi;
x_381_phi = x_353;
x_382_phi = false;
if ((x_366 != -1)) {
} else {
break;
}
BST const x_373 = tree.arr[x_366];
int const x_374 = x_373.data;
int const x_375 = x_373.leftIndex;
int const x_376 = x_373.rightIndex;
if ((x_374 == x_358)) {
x_381_phi = x_358;
x_382_phi = true;
break;
}
{
x_366_phi = select(x_375, x_376, (x_358 > x_374));
}
}
x_381 = x_381_phi;
bool const x_382 = x_382_phi;
x_354_phi = x_381;
if (x_382) {
break;
}
x_354_phi = -1;
break;
}
}
int x_354 = 0;
int x_390 = 0;
int x_395 = 0;
int x_391_phi = 0;
int x_396_phi = 0;
x_354 = x_354_phi;
switch(x_358) {
case 2:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case 13:
case 15:
case 17: {
x_391_phi = x_356;
if ((x_354 == as_type<int>(x_358))) {
x_390 = as_type<int>((x_356 + as_type<int>(1)));
x_391_phi = x_390;
}
x_391 = x_391_phi;
x_357_phi = x_391;
break;
}
default: {
x_396_phi = x_356;
if ((x_354 == as_type<int>(-1))) {
x_395 = as_type<int>((x_356 + as_type<int>(1)));
x_396_phi = x_395;
}
x_396 = x_396_phi;
x_357_phi = x_396;
break;
}
}
int const x_357 = x_357_phi;
{
x_359 = (x_358 + 1);
x_353_phi = x_354;
x_356_phi = x_357;
x_358_phi = x_359;
}
}
if ((x_356 == as_type<int>(20))) {
*(tint_symbol_23) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_23) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
fragment tint_symbol_1 tint_symbol() {
thread float4 tint_symbol_24 = 0.0f;
main_1(&(tint_symbol_24));
main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_24};
tint_symbol_1 const tint_symbol_22 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1};
return tint_symbol_22;
}