blob: c60e9073f0709c6f5668b5419a1aeea8c7b9fe2a [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct buf0 {
/* 0x0000 */ packed_float2 resolution;
};
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 float4* const tint_symbol_4) {
float3 c = 0.0f;
float x_51 = 0.0f;
float x_55 = 0.0f;
float x_56 = 0.0f;
float x_81 = 0.0f;
float x_82 = 0.0f;
float x_118 = 0.0f;
float x_119 = 0.0f;
float x_55_phi = 0.0f;
int x_58_phi = 0;
float x_81_phi = 0.0f;
float x_82_phi = 0.0f;
bool x_83_phi = false;
float x_85_phi = 0.0f;
float x_122_phi = 0.0f;
int x_129_phi = 0;
c = float3(7.0f, 8.0f, 9.0f);
float const x_47 = x_7.resolution.x;
float const x_49 = rint((x_47 * 0.125f));
x_51 = (*(tint_symbol_3)).x;
switch(0u) {
default: {
x_55_phi = -0.5f;
x_58_phi = 1;
while (true) {
float x_68 = 0.0f;
float x_76 = 0.0f;
int x_59 = 0;
float x_56_phi = 0.0f;
x_55 = x_55_phi;
int const x_58 = x_58_phi;
x_81_phi = 0.0f;
x_82_phi = x_55;
x_83_phi = false;
if ((x_58 < 800)) {
} else {
break;
}
float x_75 = 0.0f;
float x_76_phi = 0.0f;
if (((x_58 % 32) == 0)) {
x_68 = (x_55 + 0.400000006f);
x_56_phi = x_68;
} else {
x_76_phi = x_55;
if (((float(x_58) - (rint(x_49) * floor((float(x_58) / rint(x_49))))) <= 0.01f)) {
x_75 = (x_55 + 100.0f);
x_76_phi = x_75;
}
x_76 = x_76_phi;
x_56_phi = x_76;
}
x_56 = x_56_phi;
if ((float(x_58) >= x_51)) {
x_81_phi = x_56;
x_82_phi = x_56;
x_83_phi = true;
break;
}
{
x_59 = as_type<int>((as_type<uint>(x_58) + as_type<uint>(1)));
x_55_phi = x_56;
x_58_phi = x_59;
}
}
x_81 = x_81_phi;
x_82 = x_82_phi;
bool const x_83 = x_83_phi;
x_85_phi = x_81;
if (x_83) {
break;
}
x_85_phi = x_82;
break;
}
}
float x_88 = 0.0f;
float x_92 = 0.0f;
float x_93 = 0.0f;
float x_92_phi = 0.0f;
int x_95_phi = 0;
float x_118_phi = 0.0f;
float x_119_phi = 0.0f;
bool x_120_phi = false;
float const x_85 = x_85_phi;
c.x = x_85;
x_88 = (*(tint_symbol_3)).y;
switch(0u) {
default: {
x_92_phi = -0.5f;
x_95_phi = 1;
while (true) {
float x_105 = 0.0f;
float x_113 = 0.0f;
int x_96 = 0;
float x_93_phi = 0.0f;
x_92 = x_92_phi;
int const x_95 = x_95_phi;
x_118_phi = 0.0f;
x_119_phi = x_92;
x_120_phi = false;
if ((x_95 < 800)) {
} else {
break;
}
float x_112 = 0.0f;
float x_113_phi = 0.0f;
if (((x_95 % 32) == 0)) {
x_105 = (x_92 + 0.400000006f);
x_93_phi = x_105;
} else {
x_113_phi = x_92;
if (((float(x_95) - (rint(x_49) * floor((float(x_95) / rint(x_49))))) <= 0.01f)) {
x_112 = (x_92 + 100.0f);
x_113_phi = x_112;
}
x_113 = x_113_phi;
x_93_phi = x_113;
}
x_93 = x_93_phi;
if ((float(x_95) >= x_88)) {
x_118_phi = x_93;
x_119_phi = x_93;
x_120_phi = true;
break;
}
{
x_96 = as_type<int>((as_type<uint>(x_95) + as_type<uint>(1)));
x_92_phi = x_93;
x_95_phi = x_96;
}
}
x_118 = x_118_phi;
x_119 = x_119_phi;
bool const x_120 = x_120_phi;
x_122_phi = x_118;
if (x_120) {
break;
}
x_122_phi = x_119;
break;
}
}
float const x_122 = x_122_phi;
c.y = x_122;
float const x_124 = c.x;
float const x_125 = c.y;
c.z = (x_124 + x_125);
x_129_phi = 0;
while (true) {
int x_130 = 0;
int const x_129 = x_129_phi;
if ((x_129 < 3)) {
} else {
break;
}
int const x_135_save = x_129;
float const x_136 = c[x_135_save];
if ((x_136 >= 1.0f)) {
float const x_140 = c[x_135_save];
float const x_141 = c[x_135_save];
c[x_135_save] = (x_140 * x_141);
}
{
x_130 = as_type<int>((as_type<uint>(x_129) + as_type<uint>(1)));
x_129_phi = x_130;
}
}
float3 const x_143 = c;
float3 const x_145 = normalize(fabs(x_143));
*(tint_symbol_4) = float4(x_145.x, x_145.y, x_145.z, 1.0f);
return;
}
main_out tint_symbol_inner(constant buf0& x_7, float4 gl_FragCoord_param, thread float4* const tint_symbol_5, thread float4* const tint_symbol_6) {
*(tint_symbol_5) = gl_FragCoord_param;
main_1(x_7, tint_symbol_5, tint_symbol_6);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_6)};
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_7 = 0.0f;
thread float4 tint_symbol_8 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_7, gl_FragCoord_param, &(tint_symbol_7), &(tint_symbol_8));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}