| #include <metal_stdlib> |
| |
| using namespace metal; |
| struct S { |
| int data; |
| }; |
| struct buf1 { |
| /* 0x0000 */ packed_float2 v1; |
| }; |
| 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 { |
| S arr[3]; |
| }; |
| struct main_out { |
| float4 x_GLF_color_1; |
| }; |
| struct tint_symbol_1 { |
| float4 x_GLF_color_1 [[color(0)]]; |
| }; |
| |
| void func_struct_S_i11_(constant buf1& x_8, constant buf0& x_10, thread S* const s) { |
| float const x_166 = x_8.v1.x; |
| float const x_168 = x_8.v1.y; |
| if ((x_166 > x_168)) { |
| return; |
| } |
| int const x_173 = x_10.x_GLF_uniform_int_values.arr[0].el; |
| (*(s)).data = x_173; |
| return; |
| } |
| |
| void main_1(constant buf0& x_10, constant buf1& x_8, thread float4* const tint_symbol_4) { |
| int i = 0; |
| tint_array_wrapper_1 arr = {}; |
| int i_1 = 0; |
| S param = {}; |
| int j = 0; |
| bool x_132 = false; |
| bool x_142 = false; |
| bool x_133_phi = false; |
| bool x_143_phi = false; |
| int const x_46 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| i = x_46; |
| while (true) { |
| int const x_51 = i; |
| int const x_53 = x_10.x_GLF_uniform_int_values.arr[0].el; |
| if ((x_51 < x_53)) { |
| } else { |
| break; |
| } |
| int const x_56 = i; |
| int const x_57 = i; |
| arr.arr[x_56].data = x_57; |
| { |
| int const x_59 = i; |
| i = as_type<int>((as_type<uint>(x_59) + as_type<uint>(1))); |
| } |
| } |
| int const x_62 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| i_1 = x_62; |
| while (true) { |
| int const x_67 = i_1; |
| int const x_69 = x_10.x_GLF_uniform_int_values.arr[0].el; |
| if ((x_67 < x_69)) { |
| } else { |
| break; |
| } |
| float const x_73 = x_8.v1.x; |
| float const x_75 = x_8.v1.y; |
| if ((x_73 > x_75)) { |
| break; |
| } |
| int const x_79 = i_1; |
| int const x_81 = arr.arr[x_79].data; |
| int const x_83 = x_10.x_GLF_uniform_int_values.arr[3].el; |
| if ((x_81 == x_83)) { |
| int const x_88 = i_1; |
| S const x_90 = arr.arr[x_88]; |
| param = x_90; |
| func_struct_S_i11_(x_8, x_10, &(param)); |
| S const x_92 = param; |
| arr.arr[x_88] = x_92; |
| } else { |
| int const x_95 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| j = x_95; |
| while (true) { |
| int const x_100 = j; |
| int const x_102 = x_10.x_GLF_uniform_int_values.arr[0].el; |
| if ((x_100 < x_102)) { |
| } else { |
| break; |
| } |
| int const x_105 = j; |
| int const x_107 = arr.arr[x_105].data; |
| int const x_109 = x_10.x_GLF_uniform_int_values.arr[4].el; |
| if ((x_107 > x_109)) { |
| discard_fragment(); |
| } |
| { |
| int const x_113 = j; |
| j = as_type<int>((as_type<uint>(x_113) + as_type<uint>(1))); |
| } |
| } |
| } |
| { |
| int const x_115 = i_1; |
| i_1 = as_type<int>((as_type<uint>(x_115) + as_type<uint>(1))); |
| } |
| } |
| int const x_118 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| int const x_120 = arr.arr[x_118].data; |
| int const x_122 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| bool const x_123 = (x_120 == x_122); |
| x_133_phi = x_123; |
| if (x_123) { |
| int const x_127 = x_10.x_GLF_uniform_int_values.arr[3].el; |
| int const x_129 = arr.arr[x_127].data; |
| int const x_131 = x_10.x_GLF_uniform_int_values.arr[0].el; |
| x_132 = (x_129 == x_131); |
| x_133_phi = x_132; |
| } |
| bool const x_133 = x_133_phi; |
| x_143_phi = x_133; |
| if (x_133) { |
| int const x_137 = x_10.x_GLF_uniform_int_values.arr[1].el; |
| int const x_139 = arr.arr[x_137].data; |
| int const x_141 = x_10.x_GLF_uniform_int_values.arr[1].el; |
| x_142 = (x_139 == x_141); |
| x_143_phi = x_142; |
| } |
| bool const x_143 = x_143_phi; |
| if (x_143) { |
| int const x_148 = x_10.x_GLF_uniform_int_values.arr[3].el; |
| int const x_151 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| int const x_154 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| int const x_157 = x_10.x_GLF_uniform_int_values.arr[3].el; |
| *(tint_symbol_4) = float4(float(x_148), float(x_151), float(x_154), float(x_157)); |
| } else { |
| int const x_161 = x_10.x_GLF_uniform_int_values.arr[2].el; |
| float const x_162 = float(x_161); |
| *(tint_symbol_4) = float4(x_162, x_162, x_162, x_162); |
| } |
| return; |
| } |
| |
| fragment tint_symbol_1 tint_symbol(constant buf0& x_10 [[buffer(0)]], constant buf1& x_8 [[buffer(1)]]) { |
| thread float4 tint_symbol_5 = 0.0f; |
| main_1(x_10, x_8, &(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; |
| } |
| |