blob: 98a5d7f385326fde3b2d6ed403f5ddbd9fd9c3ae [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
struct tint_array_wrapper {
int arr[256];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_7, thread float4* const tint_symbol_3, thread tint_array_wrapper* const tint_symbol_4, thread float4* const tint_symbol_5) {
float2 pos = 0.0f;
int2 ipos = 0;
int i = 0;
int2 p = 0;
bool canwalk = false;
int v = 0;
int directions = 0;
int j = 0;
int d = 0;
float4 const x_57 = *(tint_symbol_3);
float2 const x_60 = x_7.resolution;
pos = (float2(x_57.x, x_57.y) / x_60);
float const x_63 = pos.x;
float const x_67 = pos.y;
ipos = int2(int((x_63 * 16.0f)), int((x_67 * 16.0f)));
i = 0;
while (true) {
int const x_75 = i;
if ((x_75 < 256)) {
} else {
break;
}
int const x_78 = i;
(*(tint_symbol_4)).arr[x_78] = 0;
{
int const x_80 = i;
i = as_type<int>((as_type<uint>(x_80) + as_type<uint>(1)));
}
}
p = int2(0, 0);
canwalk = true;
v = 0;
while (true) {
bool x_102 = false;
bool x_122 = false;
bool x_142 = false;
bool x_162 = false;
bool x_103_phi = false;
bool x_123_phi = false;
bool x_143_phi = false;
bool x_163_phi = false;
int const x_86 = v;
v = as_type<int>((as_type<uint>(x_86) + as_type<uint>(1)));
directions = 0;
int const x_89 = p.x;
bool const x_90 = (x_89 > 0);
x_103_phi = x_90;
if (x_90) {
int const x_94 = p.x;
int const x_97 = p.y;
int const x_101 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_94) - as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(x_97) * as_type<uint>(16))))))];
x_102 = (x_101 == 0);
x_103_phi = x_102;
}
bool const x_103 = x_103_phi;
if (x_103) {
int const x_106 = directions;
directions = as_type<int>((as_type<uint>(x_106) + as_type<uint>(1)));
}
int const x_109 = p.y;
bool const x_110 = (x_109 > 0);
x_123_phi = x_110;
if (x_110) {
int const x_114 = p.x;
int const x_116 = p.y;
int const x_121 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_114) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_116) - as_type<uint>(2)))) * as_type<uint>(16))))))];
x_122 = (x_121 == 0);
x_123_phi = x_122;
}
bool const x_123 = x_123_phi;
if (x_123) {
int const x_126 = directions;
directions = as_type<int>((as_type<uint>(x_126) + as_type<uint>(1)));
}
int const x_129 = p.x;
bool const x_130 = (x_129 < 14);
x_143_phi = x_130;
if (x_130) {
int const x_134 = p.x;
int const x_137 = p.y;
int const x_141 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_134) + as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(x_137) * as_type<uint>(16))))))];
x_142 = (x_141 == 0);
x_143_phi = x_142;
}
bool const x_143 = x_143_phi;
if (x_143) {
int const x_146 = directions;
directions = as_type<int>((as_type<uint>(x_146) + as_type<uint>(1)));
}
int const x_149 = p.y;
bool const x_150 = (x_149 < 14);
x_163_phi = x_150;
if (x_150) {
int const x_154 = p.x;
int const x_156 = p.y;
int const x_161 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_154) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_156) + as_type<uint>(2)))) * as_type<uint>(16))))))];
x_162 = (x_161 == 0);
x_163_phi = x_162;
}
bool const x_163 = x_163_phi;
if (x_163) {
int const x_166 = directions;
directions = as_type<int>((as_type<uint>(x_166) + as_type<uint>(1)));
}
bool x_227 = false;
bool x_240 = false;
bool x_279 = false;
bool x_292 = false;
bool x_331 = false;
bool x_344 = false;
bool x_383 = false;
bool x_396 = false;
bool x_228_phi = false;
bool x_241_phi = false;
bool x_280_phi = false;
bool x_293_phi = false;
bool x_332_phi = false;
bool x_345_phi = false;
bool x_384_phi = false;
bool x_397_phi = false;
int const x_168 = directions;
if ((x_168 == 0)) {
canwalk = false;
i = 0;
while (true) {
int const x_177 = i;
if ((x_177 < 8)) {
} else {
break;
}
j = 0;
while (true) {
int const x_184 = j;
if ((x_184 < 8)) {
} else {
break;
}
int const x_187 = j;
int const x_189 = i;
int const x_194 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_187) * as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_189) * as_type<uint>(2)))) * as_type<uint>(16))))))];
if ((x_194 == 0)) {
int const x_198 = j;
p.x = as_type<int>((as_type<uint>(x_198) * as_type<uint>(2)));
int const x_201 = i;
p.y = as_type<int>((as_type<uint>(x_201) * as_type<uint>(2)));
canwalk = true;
}
{
int const x_204 = j;
j = as_type<int>((as_type<uint>(x_204) + as_type<uint>(1)));
}
}
{
int const x_206 = i;
i = as_type<int>((as_type<uint>(x_206) + as_type<uint>(1)));
}
}
int const x_209 = p.x;
int const x_211 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_209) + as_type<uint>(as_type<int>((as_type<uint>(x_211) * as_type<uint>(16))))))] = 1;
} else {
int const x_215 = v;
int const x_216 = directions;
d = (x_215 % x_216);
int const x_218 = directions;
int const x_219 = v;
v = as_type<int>((as_type<uint>(x_219) + as_type<uint>(x_218)));
int const x_221 = d;
bool const x_222 = (x_221 >= 0);
x_228_phi = x_222;
if (x_222) {
int const x_226 = p.x;
x_227 = (x_226 > 0);
x_228_phi = x_227;
}
bool const x_228 = x_228_phi;
x_241_phi = x_228;
if (x_228) {
int const x_232 = p.x;
int const x_235 = p.y;
int const x_239 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_232) - as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(x_235) * as_type<uint>(16))))))];
x_240 = (x_239 == 0);
x_241_phi = x_240;
}
bool const x_241 = x_241_phi;
if (x_241) {
int const x_244 = d;
d = as_type<int>((as_type<uint>(x_244) - as_type<uint>(1)));
int const x_247 = p.x;
int const x_249 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_247) + as_type<uint>(as_type<int>((as_type<uint>(x_249) * as_type<uint>(16))))))] = 1;
int const x_254 = p.x;
int const x_257 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_254) - as_type<uint>(1)))) + as_type<uint>(as_type<int>((as_type<uint>(x_257) * as_type<uint>(16))))))] = 1;
int const x_262 = p.x;
int const x_265 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_262) - as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(x_265) * as_type<uint>(16))))))] = 1;
int const x_270 = p.x;
p.x = as_type<int>((as_type<uint>(x_270) - as_type<uint>(2)));
}
int const x_273 = d;
bool const x_274 = (x_273 >= 0);
x_280_phi = x_274;
if (x_274) {
int const x_278 = p.y;
x_279 = (x_278 > 0);
x_280_phi = x_279;
}
bool const x_280 = x_280_phi;
x_293_phi = x_280;
if (x_280) {
int const x_284 = p.x;
int const x_286 = p.y;
int const x_291 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_284) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_286) - as_type<uint>(2)))) * as_type<uint>(16))))))];
x_292 = (x_291 == 0);
x_293_phi = x_292;
}
bool const x_293 = x_293_phi;
if (x_293) {
int const x_296 = d;
d = as_type<int>((as_type<uint>(x_296) - as_type<uint>(1)));
int const x_299 = p.x;
int const x_301 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_299) + as_type<uint>(as_type<int>((as_type<uint>(x_301) * as_type<uint>(16))))))] = 1;
int const x_306 = p.x;
int const x_308 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_306) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_308) - as_type<uint>(1)))) * as_type<uint>(16))))))] = 1;
int const x_314 = p.x;
int const x_316 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_314) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_316) - as_type<uint>(2)))) * as_type<uint>(16))))))] = 1;
int const x_322 = p.y;
p.y = as_type<int>((as_type<uint>(x_322) - as_type<uint>(2)));
}
int const x_325 = d;
bool const x_326 = (x_325 >= 0);
x_332_phi = x_326;
if (x_326) {
int const x_330 = p.x;
x_331 = (x_330 < 14);
x_332_phi = x_331;
}
bool const x_332 = x_332_phi;
x_345_phi = x_332;
if (x_332) {
int const x_336 = p.x;
int const x_339 = p.y;
int const x_343 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_336) + as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(x_339) * as_type<uint>(16))))))];
x_344 = (x_343 == 0);
x_345_phi = x_344;
}
bool const x_345 = x_345_phi;
if (x_345) {
int const x_348 = d;
d = as_type<int>((as_type<uint>(x_348) - as_type<uint>(1)));
int const x_351 = p.x;
int const x_353 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_351) + as_type<uint>(as_type<int>((as_type<uint>(x_353) * as_type<uint>(16))))))] = 1;
int const x_358 = p.x;
int const x_361 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_358) + as_type<uint>(1)))) + as_type<uint>(as_type<int>((as_type<uint>(x_361) * as_type<uint>(16))))))] = 1;
int const x_366 = p.x;
int const x_369 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_366) + as_type<uint>(2)))) + as_type<uint>(as_type<int>((as_type<uint>(x_369) * as_type<uint>(16))))))] = 1;
int const x_374 = p.x;
p.x = as_type<int>((as_type<uint>(x_374) + as_type<uint>(2)));
}
int const x_377 = d;
bool const x_378 = (x_377 >= 0);
x_384_phi = x_378;
if (x_378) {
int const x_382 = p.y;
x_383 = (x_382 < 14);
x_384_phi = x_383;
}
bool const x_384 = x_384_phi;
x_397_phi = x_384;
if (x_384) {
int const x_388 = p.x;
int const x_390 = p.y;
int const x_395 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_388) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_390) + as_type<uint>(2)))) * as_type<uint>(16))))))];
x_396 = (x_395 == 0);
x_397_phi = x_396;
}
bool const x_397 = x_397_phi;
if (x_397) {
int const x_400 = d;
d = as_type<int>((as_type<uint>(x_400) - as_type<uint>(1)));
int const x_403 = p.x;
int const x_405 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_403) + as_type<uint>(as_type<int>((as_type<uint>(x_405) * as_type<uint>(16))))))] = 1;
int const x_410 = p.x;
int const x_412 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_410) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_412) + as_type<uint>(1)))) * as_type<uint>(16))))))] = 1;
int const x_418 = p.x;
int const x_420 = p.y;
(*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(x_418) + as_type<uint>(as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_420) + as_type<uint>(2)))) * as_type<uint>(16))))))] = 1;
int const x_426 = p.y;
p.y = as_type<int>((as_type<uint>(x_426) + as_type<uint>(2)));
}
}
int const x_430 = ipos.y;
int const x_433 = ipos.x;
int const x_436 = (*(tint_symbol_4)).arr[as_type<int>((as_type<uint>(as_type<int>((as_type<uint>(x_430) * as_type<uint>(16)))) + as_type<uint>(x_433)))];
if ((x_436 == 1)) {
*(tint_symbol_5) = float4(1.0f, 1.0f, 1.0f, 1.0f);
return;
}
{
bool const x_440 = canwalk;
if (x_440) {
} else {
break;
}
}
}
*(tint_symbol_5) = float4(0.0f, 0.0f, 0.0f, 1.0f);
return;
}
main_out tint_symbol_inner(constant buf0& x_7, float4 gl_FragCoord_param, thread float4* const tint_symbol_6, thread tint_array_wrapper* const tint_symbol_7, thread float4* const tint_symbol_8) {
*(tint_symbol_6) = gl_FragCoord_param;
main_1(x_7, tint_symbol_6, tint_symbol_7, tint_symbol_8);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_8)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_7 [[buffer(0)]]) {
thread float4 tint_symbol_9 = 0.0f;
thread tint_array_wrapper tint_symbol_10 = {};
thread float4 tint_symbol_11 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_7, gl_FragCoord_param, &(tint_symbol_9), &(tint_symbol_10), &(tint_symbol_11));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}