blob: 23d3b1c909cc1603f190e036ca71ee53ac2409c9 [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)]];
};
float compute_value_f1_f1_(thread float* const limit, thread float* const thirty_two) {
float result = 0.0f;
int i = 0;
result = -0.5f;
i = 1;
while (true) {
int const x_136 = i;
if ((x_136 < 800)) {
} else {
break;
}
int const x_139 = i;
if (((x_139 % 32) == 0)) {
float const x_145 = result;
result = (x_145 + 0.400000006f);
} else {
int const x_147 = i;
float const x_149 = *(thirty_two);
if (((float(x_147) - (rint(x_149) * floor((float(x_147) / rint(x_149))))) <= 0.01f)) {
float const x_155 = result;
result = (x_155 + 100.0f);
}
}
int const x_157 = i;
float const x_159 = *(limit);
if ((float(x_157) >= x_159)) {
float const x_163 = result;
return x_163;
}
{
int const x_164 = i;
i = as_type<int>((as_type<uint>(x_164) + as_type<uint>(1)));
}
}
float const x_166 = result;
return x_166;
}
void main_1(constant buf0& x_13, thread float4* const tint_symbol_3, thread float4* const tint_symbol_4) {
float3 c = 0.0f;
float thirty_two_1 = 0.0f;
float param = 0.0f;
float param_1 = 0.0f;
float param_2 = 0.0f;
float param_3 = 0.0f;
int i_1 = 0;
c = float3(7.0f, 8.0f, 9.0f);
float const x_63 = x_13.resolution.x;
thirty_two_1 = rint((x_63 / 8.0f));
float const x_67 = (*(tint_symbol_3)).x;
param = x_67;
float const x_68 = thirty_two_1;
param_1 = x_68;
float const x_69 = compute_value_f1_f1_(&(param), &(param_1));
c.x = x_69;
float const x_72 = (*(tint_symbol_3)).y;
param_2 = x_72;
float const x_73 = thirty_two_1;
param_3 = x_73;
float const x_74 = compute_value_f1_f1_(&(param_2), &(param_3));
c.y = x_74;
float3 const x_76 = c;
float3 const x_79 = c;
float4x2 const x_87 = float4x2(float2(x_79.x, x_79.y), float2(x_79.z, 1.0f), float2(1.0f, 0.0f), float2(1.0f, 0.0f));
c.z = (((x_76 * float3x3(float3(1.0f, 0.0f, 0.0f), float3(0.0f, 1.0f, 0.0f), float3(0.0f, 0.0f, 1.0f)))).x + float3(x_87[0u].x, x_87[0u].y, x_87[1u].x).y);
i_1 = 0;
while (true) {
int const x_99 = i_1;
if ((x_99 < 3)) {
} else {
break;
}
int const x_102 = i_1;
float const x_104 = c[x_102];
if ((x_104 >= 1.0f)) {
int const x_108 = i_1;
int const x_109 = i_1;
float const x_111 = c[x_109];
int const x_112 = i_1;
float const x_114 = c[x_112];
c[x_108] = (x_111 * x_114);
float const x_118 = (*(tint_symbol_3)).y;
if ((x_118 < 0.0f)) {
break;
}
}
{
int const x_122 = i_1;
i_1 = as_type<int>((as_type<uint>(x_122) + as_type<uint>(1)));
}
}
float3 const x_124 = c;
float3 const x_126 = normalize(fabs(x_124));
*(tint_symbol_4) = float4(x_126.x, x_126.y, x_126.z, 1.0f);
return;
}
main_out tint_symbol_inner(constant buf0& x_13, 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_13, 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_13 [[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_13, 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;
}