blob: a2b94a394940e70426b7205e30e1e5bbebcaeb18 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct tint_padded_array_element {
/* 0x0000 */ int el;
/* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
/* 0x0000 */ tint_padded_array_element arr[7];
};
struct buf0 {
/* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values;
};
struct tint_padded_array_element_1 {
/* 0x0000 */ float el;
/* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
/* 0x0000 */ tint_padded_array_element_1 arr[3];
};
struct buf1 {
/* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_float_values;
};
struct tint_array_wrapper_2 {
float arr[2];
};
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_6, constant buf1& x_8, thread float4* const tint_symbol_3) {
tint_array_wrapper_2 sums = {};
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int e = 0;
int f = 0;
int g = 0;
int h = 0;
int i = 0;
int j = 0;
bool x_215 = false;
bool x_216_phi = false;
int const x_20 = x_6.x_GLF_uniform_int_values.arr[1].el;
float const x_110 = x_8.x_GLF_uniform_float_values.arr[0].el;
sums.arr[x_20] = x_110;
int const x_22 = x_6.x_GLF_uniform_int_values.arr[2].el;
float const x_114 = x_8.x_GLF_uniform_float_values.arr[0].el;
sums.arr[x_22] = x_114;
int const x_23 = x_6.x_GLF_uniform_int_values.arr[1].el;
a = x_23;
while (true) {
int const x_24 = a;
int const x_25 = x_6.x_GLF_uniform_int_values.arr[0].el;
if ((x_24 < x_25)) {
} else {
break;
}
int const x_26 = x_6.x_GLF_uniform_int_values.arr[5].el;
b = x_26;
while (true) {
int const x_27 = b;
int const x_28 = x_6.x_GLF_uniform_int_values.arr[3].el;
if ((x_27 < x_28)) {
} else {
break;
}
int const x_29 = x_6.x_GLF_uniform_int_values.arr[6].el;
c = x_29;
while (true) {
int const x_30 = c;
int const x_31 = x_6.x_GLF_uniform_int_values.arr[4].el;
if ((x_30 <= x_31)) {
} else {
break;
}
int const x_32 = x_6.x_GLF_uniform_int_values.arr[1].el;
d = x_32;
while (true) {
int const x_33 = d;
int const x_34 = x_6.x_GLF_uniform_int_values.arr[6].el;
if ((x_33 < x_34)) {
} else {
break;
}
int const x_35 = x_6.x_GLF_uniform_int_values.arr[0].el;
e = x_35;
while (true) {
int const x_36 = e;
int const x_37 = x_6.x_GLF_uniform_int_values.arr[4].el;
if ((x_36 <= x_37)) {
} else {
break;
}
int const x_38 = x_6.x_GLF_uniform_int_values.arr[1].el;
f = x_38;
while (true) {
int const x_39 = f;
int const x_40 = x_6.x_GLF_uniform_int_values.arr[0].el;
if ((x_39 < x_40)) {
} else {
break;
}
int const x_41 = x_6.x_GLF_uniform_int_values.arr[1].el;
g = x_41;
while (true) {
int const x_42 = g;
int const x_43 = x_6.x_GLF_uniform_int_values.arr[6].el;
if ((x_42 < x_43)) {
} else {
break;
}
int const x_44 = x_6.x_GLF_uniform_int_values.arr[1].el;
h = x_44;
while (true) {
int const x_45 = h;
int const x_46 = x_6.x_GLF_uniform_int_values.arr[0].el;
if ((x_45 < x_46)) {
} else {
break;
}
int const x_47 = x_6.x_GLF_uniform_int_values.arr[1].el;
i = x_47;
while (true) {
int const x_48 = i;
int const x_49 = x_6.x_GLF_uniform_int_values.arr[4].el;
if ((x_48 < x_49)) {
} else {
break;
}
int const x_50 = x_6.x_GLF_uniform_int_values.arr[0].el;
j = x_50;
while (true) {
int const x_51 = j;
int const x_52 = x_6.x_GLF_uniform_int_values.arr[1].el;
if ((x_51 > x_52)) {
} else {
break;
}
int const x_53 = a;
float const x_197 = x_8.x_GLF_uniform_float_values.arr[2].el;
float const x_199 = sums.arr[x_53];
sums.arr[x_53] = (x_199 + x_197);
{
int const x_54 = j;
j = as_type<int>((as_type<uint>(x_54) - as_type<uint>(1)));
}
}
{
int const x_56 = i;
i = as_type<int>((as_type<uint>(x_56) + as_type<uint>(1)));
}
}
{
int const x_58 = h;
h = as_type<int>((as_type<uint>(x_58) + as_type<uint>(1)));
}
}
{
int const x_60 = g;
g = as_type<int>((as_type<uint>(x_60) + as_type<uint>(1)));
}
}
{
int const x_62 = f;
f = as_type<int>((as_type<uint>(x_62) + as_type<uint>(1)));
}
}
{
int const x_64 = e;
e = as_type<int>((as_type<uint>(x_64) + as_type<uint>(1)));
}
}
{
int const x_66 = d;
d = as_type<int>((as_type<uint>(x_66) + as_type<uint>(1)));
}
}
{
int const x_68 = c;
c = as_type<int>((as_type<uint>(x_68) + as_type<uint>(1)));
}
}
{
int const x_70 = b;
b = as_type<int>((as_type<uint>(x_70) + as_type<uint>(1)));
}
}
{
int const x_72 = a;
a = as_type<int>((as_type<uint>(x_72) + as_type<uint>(1)));
}
}
int const x_74 = x_6.x_GLF_uniform_int_values.arr[1].el;
float const x_204 = sums.arr[x_74];
float const x_206 = x_8.x_GLF_uniform_float_values.arr[1].el;
bool const x_207 = (x_204 == x_206);
x_216_phi = x_207;
if (x_207) {
int const x_75 = x_6.x_GLF_uniform_int_values.arr[2].el;
float const x_212 = sums.arr[x_75];
float const x_214 = x_8.x_GLF_uniform_float_values.arr[1].el;
x_215 = (x_212 == x_214);
x_216_phi = x_215;
}
bool const x_216 = x_216_phi;
if (x_216) {
int const x_76 = x_6.x_GLF_uniform_int_values.arr[2].el;
int const x_77 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_78 = x_6.x_GLF_uniform_int_values.arr[1].el;
int const x_79 = x_6.x_GLF_uniform_int_values.arr[2].el;
*(tint_symbol_3) = float4(float(x_76), float(x_77), float(x_78), float(x_79));
} else {
int const x_80 = x_6.x_GLF_uniform_int_values.arr[1].el;
float const x_230 = float(x_80);
*(tint_symbol_3) = float4(x_230, x_230, x_230, x_230);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_6, constant buf1& x_8, thread float4* const tint_symbol_4) {
main_1(x_6, x_8, tint_symbol_4);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_4)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]], constant buf1& x_8 [[buffer(1)]]) {
thread float4 tint_symbol_5 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_6, x_8, &(tint_symbol_5));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}