| #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[5]; |
| }; |
| struct buf0 { |
| /* 0x0000 */ tint_array_wrapper x_GLF_uniform_int_values; |
| }; |
| struct tint_array_wrapper_1 { |
| int arr[4]; |
| }; |
| 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, thread float4* const tint_symbol_4) { |
| int i = 0; |
| tint_array_wrapper_1 A = {}; |
| bool x_77 = false; |
| bool x_87 = false; |
| bool x_97 = false; |
| bool x_78_phi = false; |
| bool x_88_phi = false; |
| bool x_98_phi = false; |
| int const x_33 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| i = x_33; |
| while (true) { |
| int const x_38 = i; |
| int const x_40 = x_6.x_GLF_uniform_int_values.arr[4].el; |
| if ((x_38 < x_40)) { |
| } else { |
| break; |
| } |
| int const x_43 = i; |
| int const x_45 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| A.arr[x_43] = x_45; |
| int const x_47 = i; |
| int const x_50 = x_6.x_GLF_uniform_int_values.arr[3].el; |
| int const x_54 = x_6.x_GLF_uniform_int_values.arr[1].el; |
| if ((max((2 * x_47), (2 * x_50)) == x_54)) { |
| int const x_58 = i; |
| A.arr[x_58] = 1; |
| } |
| { |
| int const x_60 = i; |
| i = (x_60 + 1); |
| } |
| } |
| int const x_63 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| int const x_65 = A.arr[x_63]; |
| int const x_67 = x_6.x_GLF_uniform_int_values.arr[3].el; |
| bool const x_68 = (x_65 == x_67); |
| x_78_phi = x_68; |
| if (x_68) { |
| int const x_72 = x_6.x_GLF_uniform_int_values.arr[3].el; |
| int const x_74 = A.arr[x_72]; |
| int const x_76 = x_6.x_GLF_uniform_int_values.arr[3].el; |
| x_77 = (x_74 == x_76); |
| x_78_phi = x_77; |
| } |
| bool const x_78 = x_78_phi; |
| x_88_phi = x_78; |
| if (x_78) { |
| int const x_82 = x_6.x_GLF_uniform_int_values.arr[1].el; |
| int const x_84 = A.arr[x_82]; |
| int const x_86 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| x_87 = (x_84 == x_86); |
| x_88_phi = x_87; |
| } |
| bool const x_88 = x_88_phi; |
| x_98_phi = x_88; |
| if (x_88) { |
| int const x_92 = x_6.x_GLF_uniform_int_values.arr[2].el; |
| int const x_94 = A.arr[x_92]; |
| int const x_96 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| x_97 = (x_94 == x_96); |
| x_98_phi = x_97; |
| } |
| bool const x_98 = x_98_phi; |
| if (x_98) { |
| int const x_103 = x_6.x_GLF_uniform_int_values.arr[3].el; |
| int const x_106 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| int const x_109 = x_6.x_GLF_uniform_int_values.arr[0].el; |
| int const x_112 = x_6.x_GLF_uniform_int_values.arr[3].el; |
| *(tint_symbol_4) = float4(float(x_103), float(x_106), float(x_109), float(x_112)); |
| } else { |
| *(tint_symbol_4) = float4(1.0f, 1.0f, 1.0f, 1.0f); |
| } |
| return; |
| } |
| |
| fragment tint_symbol_1 tint_symbol(constant buf0& x_6 [[buffer(0)]]) { |
| thread float4 tint_symbol_5 = 0.0f; |
| main_1(x_6, &(tint_symbol_5)); |
| main_out const tint_symbol_2 = {.x_GLF_color_1=tint_symbol_5}; |
| tint_symbol_1 const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_2.x_GLF_color_1}; |
| return tint_symbol_3; |
| } |
| |