blob: 0ab13c59f2d709de417e9effb0027b04aae88cd5 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 injectionSwitch;
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_2 {
float4 x_GLF_color_1 [[color(0)]];
};
void main_1(constant buf0& x_6, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
while (true) {
bool x_45 = false;
int x_48 = 0;
int x_49 = 0;
bool x_46 = false;
int x_115 = 0;
int x_116 = 0;
bool x_45_phi = false;
int x_48_phi = 0;
int x_50_phi = 0;
int x_52_phi = 0;
int x_111_phi = 0;
bool x_112_phi = false;
int x_115_phi = 0;
int x_118_phi = 0;
int x_120_phi = 0;
int x_161_phi = 0;
float const x_40 = x_6.injectionSwitch.x;
bool const x_41 = (x_40 < -1.0f);
x_45_phi = false;
x_48_phi = 0;
x_50_phi = 0;
x_52_phi = 0;
while (true) {
int x_62 = 0;
int x_65 = 0;
int x_66 = 0;
int x_63 = 0;
int x_53 = 0;
int x_62_phi = 0;
int x_65_phi = 0;
int x_67_phi = 0;
int x_51_phi = 0;
int x_49_phi = 0;
bool x_46_phi = false;
x_45 = x_45_phi;
x_48 = x_48_phi;
int const x_50 = x_50_phi;
int const x_52 = x_52_phi;
float const x_55 = (*(tint_symbol_5)).y;
x_111_phi = x_48;
x_112_phi = x_45;
if ((x_52 < select(100, 10, (x_55 > -1.0f)))) {
} else {
break;
}
x_62_phi = x_48;
x_65_phi = x_50;
x_67_phi = 0;
while (true) {
int x_97 = 0;
int x_68 = 0;
int x_66_phi = 0;
x_62 = x_62_phi;
x_65 = x_65_phi;
int const x_67 = x_67_phi;
x_51_phi = x_65;
x_49_phi = x_62;
x_46_phi = x_45;
if ((x_67 < 2)) {
} else {
break;
}
while (true) {
bool x_78 = false;
int x_86_phi = 0;
int x_97_phi = 0;
bool x_98_phi = false;
float const x_77 = (*(tint_symbol_5)).x;
x_78 = (x_77 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_78) {
x_66_phi = 0;
break;
}
x_86_phi = 1;
while (true) {
int x_87 = 0;
int const x_86 = x_86_phi;
x_97_phi = x_65;
x_98_phi = false;
if ((x_86 < 3)) {
} else {
break;
}
if (x_78) {
{
x_87 = as_type<int>((as_type<uint>(x_86) + as_type<uint>(1)));
x_86_phi = x_87;
}
continue;
}
if ((x_86 > 0)) {
x_97_phi = 1;
x_98_phi = true;
break;
}
{
x_87 = as_type<int>((as_type<uint>(x_86) + as_type<uint>(1)));
x_86_phi = x_87;
}
}
x_97 = x_97_phi;
bool const x_98 = x_98_phi;
x_66_phi = x_97;
if (x_98) {
break;
}
}
x_66_phi = 0;
break;
}
x_66 = x_66_phi;
x_63 = as_type<int>(as_type<int>((as_type<uint>(x_62) + as_type<uint>(x_66))));
if (x_41) {
while (true) {
if (x_41) {
} else {
break;
}
{
float const x_105 = float(x_52);
*(tint_symbol_6) = float4(x_105, x_105, x_105, x_105);
}
}
x_51_phi = x_66;
x_49_phi = x_63;
x_46_phi = true;
break;
}
{
x_68 = as_type<int>((as_type<uint>(x_67) + as_type<uint>(1)));
x_62_phi = x_63;
x_65_phi = x_66;
x_67_phi = x_68;
}
}
int const x_51 = x_51_phi;
x_49 = x_49_phi;
x_46 = x_46_phi;
x_111_phi = x_49;
x_112_phi = x_46;
if (x_46) {
break;
}
if (!(x_41)) {
x_111_phi = x_49;
x_112_phi = x_46;
break;
}
{
x_53 = as_type<int>((as_type<uint>(x_52) + as_type<uint>(1)));
x_45_phi = x_46;
x_48_phi = x_49;
x_50_phi = x_51;
x_52_phi = x_53;
}
}
int const x_111 = x_111_phi;
bool const x_112 = x_112_phi;
if (x_112) {
break;
}
x_115_phi = x_111;
x_118_phi = 0;
x_120_phi = 0;
while (true) {
int x_154 = 0;
int x_121 = 0;
int x_119_phi = 0;
x_115 = x_115_phi;
int const x_118 = x_118_phi;
int const x_120 = x_120_phi;
float const x_123 = x_6.injectionSwitch.y;
x_161_phi = x_115;
if ((x_120 < int((x_123 + 1.0f)))) {
} else {
break;
}
while (true) {
bool x_135 = false;
int x_143_phi = 0;
int x_154_phi = 0;
bool x_155_phi = false;
float const x_134 = (*(tint_symbol_5)).x;
x_135 = (x_134 < -1.0f);
if (!((x_40 < 0.0f))) {
if (x_135) {
x_119_phi = 0;
break;
}
x_143_phi = 1;
while (true) {
int x_144 = 0;
int const x_143 = x_143_phi;
x_154_phi = x_118;
x_155_phi = false;
if ((x_143 < 3)) {
} else {
break;
}
if (x_135) {
{
x_144 = as_type<int>((as_type<uint>(x_143) + as_type<uint>(1)));
x_143_phi = x_144;
}
continue;
}
if ((x_143 > 0)) {
x_154_phi = 1;
x_155_phi = true;
break;
}
{
x_144 = as_type<int>((as_type<uint>(x_143) + as_type<uint>(1)));
x_143_phi = x_144;
}
}
x_154 = x_154_phi;
bool const x_155 = x_155_phi;
x_119_phi = x_154;
if (x_155) {
break;
}
}
x_119_phi = 0;
break;
}
int x_119 = 0;
x_119 = x_119_phi;
x_116 = as_type<int>(as_type<int>((as_type<uint>(x_115) + as_type<uint>(x_119))));
if (select(x_41, false, !(x_41))) {
x_161_phi = x_116;
break;
}
{
x_121 = as_type<int>((as_type<uint>(x_120) + as_type<uint>(1)));
x_115_phi = x_116;
x_118_phi = x_119;
x_120_phi = x_121;
}
}
int const x_161 = x_161_phi;
if ((x_161 == 4)) {
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_6) = float4(0.0f, 0.0f, 0.0f, 0.0f);
}
break;
}
return;
}
fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_6 [[buffer(0)]]) {
thread float4 tint_symbol_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
tint_symbol_7 = gl_FragCoord_param;
main_1(x_6, &(tint_symbol_7), &(tint_symbol_8));
main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_8};
tint_symbol_2 const tint_symbol_4 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
return tint_symbol_4;
}