| #include <metal_stdlib> |
| |
| using namespace metal; |
| struct buf0 { |
| /* 0x0000 */ packed_float2 injectionSwitch; |
| }; |
| struct tint_array_wrapper { |
| int arr[10]; |
| }; |
| 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_8, thread float4* const tint_symbol_4, thread float4* const tint_symbol_5) { |
| tint_array_wrapper temp = {}; |
| tint_array_wrapper data = {}; |
| float x_190 = 0.0f; |
| float x_262 = 0.0f; |
| int x_63_phi = 0; |
| int x_103_phi = 0; |
| int x_112_phi = 0; |
| float x_263_phi = 0.0f; |
| float const x_60 = x_8.injectionSwitch.x; |
| int const x_61 = int(x_60); |
| x_63_phi = x_61; |
| while (true) { |
| int x_100 = 0; |
| int x_98 = 0; |
| int x_96 = 0; |
| int x_94 = 0; |
| int x_92 = 0; |
| int x_90 = 0; |
| int x_88 = 0; |
| int x_86 = 0; |
| int x_84 = 0; |
| int x_82 = 0; |
| int x_64_phi = 0; |
| int const x_63 = x_63_phi; |
| tint_array_wrapper const x_68 = data; |
| tint_array_wrapper const tint_symbol_2 = {.arr={0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; |
| data = tint_symbol_2; |
| data = x_68; |
| int const x_69 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_69; |
| switch(x_63) { |
| case 9: { |
| data.arr[x_63] = -5; |
| x_100 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_100; |
| break; |
| } |
| case 8: { |
| data.arr[x_63] = -4; |
| x_98 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_98; |
| break; |
| } |
| case 7: { |
| data.arr[x_63] = -3; |
| x_96 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_96; |
| break; |
| } |
| case 6: { |
| data.arr[x_63] = -2; |
| x_94 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_94; |
| break; |
| } |
| case 5: { |
| data.arr[x_63] = -1; |
| x_92 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_92; |
| break; |
| } |
| case 4: { |
| data.arr[x_63] = 0; |
| x_90 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_90; |
| break; |
| } |
| case 3: { |
| data.arr[x_63] = 1; |
| x_88 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_88; |
| break; |
| } |
| case 2: { |
| data.arr[x_63] = 2; |
| x_86 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_86; |
| break; |
| } |
| case 1: { |
| data.arr[x_63] = 3; |
| x_84 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_84; |
| break; |
| } |
| case 0: { |
| data.arr[x_63] = 4; |
| x_82 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1))); |
| x_64_phi = x_82; |
| break; |
| } |
| default: { |
| break; |
| } |
| } |
| int const x_64 = x_64_phi; |
| { |
| x_63_phi = x_64; |
| if ((x_64 < 10)) { |
| } else { |
| break; |
| } |
| } |
| } |
| x_103_phi = 0; |
| while (true) { |
| int x_104 = 0; |
| int const x_103 = x_103_phi; |
| if ((x_103 < 10)) { |
| } else { |
| break; |
| } |
| { |
| int const x_109 = data.arr[x_103]; |
| temp.arr[x_103] = x_109; |
| x_104 = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1))); |
| x_103_phi = x_104; |
| } |
| } |
| x_112_phi = 1; |
| while (true) { |
| int x_113 = 0; |
| int x_119_phi = 0; |
| int const x_112 = x_112_phi; |
| if ((x_112 <= 9)) { |
| } else { |
| break; |
| } |
| x_119_phi = 0; |
| while (true) { |
| int x_131 = 0; |
| int x_136 = 0; |
| int x_131_phi = 0; |
| int x_134_phi = 0; |
| int x_136_phi = 0; |
| int x_158_phi = 0; |
| int x_161_phi = 0; |
| int x_171_phi = 0; |
| int const x_119 = x_119_phi; |
| if ((x_119 < 9)) { |
| } else { |
| break; |
| } |
| int const x_125 = as_type<int>((as_type<uint>(x_119) + as_type<uint>(x_112))); |
| int const x_126 = as_type<int>((as_type<uint>(x_125) - as_type<uint>(1))); |
| int const x_120 = as_type<int>((as_type<uint>(x_119) + as_type<uint>(as_type<int>((as_type<uint>(2) * as_type<uint>(x_112)))))); |
| int const x_129 = min(as_type<int>((as_type<uint>(x_120) - as_type<uint>(1))), 9); |
| x_131_phi = x_119; |
| x_134_phi = x_125; |
| x_136_phi = x_119; |
| while (true) { |
| int x_151 = 0; |
| int x_154 = 0; |
| int x_135_phi = 0; |
| int x_137_phi = 0; |
| x_131 = x_131_phi; |
| int const x_134 = x_134_phi; |
| x_136 = x_136_phi; |
| if (((x_136 <= x_126) & (x_134 <= x_129))) { |
| } else { |
| break; |
| } |
| int const x_143_save = x_136; |
| int const x_144 = data.arr[x_143_save]; |
| int const x_145_save = x_134; |
| int const x_146 = data.arr[x_145_save]; |
| int const x_132 = as_type<int>(as_type<int>((as_type<uint>(x_131) + as_type<uint>(as_type<int>(1))))); |
| if ((x_144 < x_146)) { |
| x_151 = as_type<int>(as_type<int>((as_type<uint>(x_136) + as_type<uint>(as_type<int>(1))))); |
| int const x_152 = data.arr[x_143_save]; |
| temp.arr[x_131] = x_152; |
| x_135_phi = x_134; |
| x_137_phi = x_151; |
| } else { |
| x_154 = as_type<int>((as_type<uint>(x_134) + as_type<uint>(1))); |
| int const x_155 = data.arr[x_145_save]; |
| temp.arr[x_131] = x_155; |
| x_135_phi = x_154; |
| x_137_phi = x_136; |
| } |
| int const x_135 = x_135_phi; |
| int const x_137 = x_137_phi; |
| { |
| x_131_phi = x_132; |
| x_134_phi = x_135; |
| x_136_phi = x_137; |
| } |
| } |
| x_158_phi = x_131; |
| x_161_phi = x_136; |
| while (true) { |
| int x_159 = 0; |
| int x_162 = 0; |
| int const x_158 = x_158_phi; |
| int const x_161 = x_161_phi; |
| if (((x_161 < 10) & (x_161 <= x_126))) { |
| } else { |
| break; |
| } |
| { |
| x_159 = as_type<int>((as_type<uint>(x_158) + as_type<uint>(1))); |
| x_162 = as_type<int>((as_type<uint>(x_161) + as_type<uint>(1))); |
| int const x_168 = data.arr[x_161]; |
| temp.arr[x_158] = x_168; |
| x_158_phi = x_159; |
| x_161_phi = x_162; |
| } |
| } |
| x_171_phi = x_119; |
| while (true) { |
| int x_172 = 0; |
| int const x_171 = x_171_phi; |
| if ((x_171 <= x_129)) { |
| } else { |
| break; |
| } |
| { |
| int const x_177 = temp.arr[x_171]; |
| data.arr[x_171] = x_177; |
| x_172 = as_type<int>((as_type<uint>(x_171) + as_type<uint>(1))); |
| x_171_phi = x_172; |
| } |
| } |
| { |
| x_119_phi = x_120; |
| } |
| } |
| { |
| x_113 = as_type<int>((as_type<uint>(2) * as_type<uint>(x_112))); |
| x_112_phi = x_113; |
| } |
| } |
| int x_181 = 0; |
| float x_199 = 0.0f; |
| float x_261 = 0.0f; |
| float x_262_phi = 0.0f; |
| float const x_180 = (*(tint_symbol_4)).y; |
| x_181 = int(x_180); |
| if ((x_181 < 30)) { |
| int const x_187 = data.arr[0]; |
| x_190 = (0.5f + (float(x_187) * 0.100000001f)); |
| x_263_phi = x_190; |
| } else { |
| float x_208 = 0.0f; |
| float x_260 = 0.0f; |
| float x_261_phi = 0.0f; |
| if ((x_181 < 60)) { |
| int const x_196 = data.arr[1]; |
| x_199 = (0.5f + (float(x_196) * 0.100000001f)); |
| x_262_phi = x_199; |
| } else { |
| float x_217 = 0.0f; |
| float x_259 = 0.0f; |
| float x_260_phi = 0.0f; |
| if ((x_181 < 90)) { |
| int const x_205 = data.arr[2]; |
| x_208 = (0.5f + (float(x_205) * 0.100000001f)); |
| x_261_phi = x_208; |
| } else { |
| if ((x_181 < 120)) { |
| int const x_214 = data.arr[3]; |
| x_217 = (0.5f + (float(x_214) * 0.100000001f)); |
| x_260_phi = x_217; |
| } else { |
| float x_230 = 0.0f; |
| float x_258 = 0.0f; |
| float x_259_phi = 0.0f; |
| if ((x_181 < 150)) { |
| discard_fragment(); |
| } else { |
| float x_239 = 0.0f; |
| float x_257 = 0.0f; |
| float x_258_phi = 0.0f; |
| if ((x_181 < 180)) { |
| int const x_227 = data.arr[5]; |
| x_230 = (0.5f + (float(x_227) * 0.100000001f)); |
| x_259_phi = x_230; |
| } else { |
| float x_248 = 0.0f; |
| float x_256 = 0.0f; |
| float x_257_phi = 0.0f; |
| if ((x_181 < 210)) { |
| int const x_236 = data.arr[6]; |
| x_239 = (0.5f + (float(x_236) * 0.100000001f)); |
| x_258_phi = x_239; |
| } else { |
| if ((x_181 < 240)) { |
| int const x_245 = data.arr[7]; |
| x_248 = (0.5f + (float(x_245) * 0.100000001f)); |
| x_257_phi = x_248; |
| } else { |
| if ((x_181 < 270)) { |
| } else { |
| discard_fragment(); |
| } |
| int const x_253 = data.arr[8]; |
| x_256 = (0.5f + (float(x_253) * 0.100000001f)); |
| x_257_phi = x_256; |
| } |
| x_257 = x_257_phi; |
| x_258_phi = x_257; |
| } |
| x_258 = x_258_phi; |
| x_259_phi = x_258; |
| } |
| x_259 = x_259_phi; |
| } |
| x_260_phi = x_259; |
| } |
| x_260 = x_260_phi; |
| x_261_phi = x_260; |
| } |
| x_261 = x_261_phi; |
| x_262_phi = x_261; |
| } |
| x_262 = x_262_phi; |
| x_263_phi = x_262; |
| } |
| float const x_263 = x_263_phi; |
| *(tint_symbol_5) = float4(x_263, x_263, x_263, 1.0f); |
| return; |
| } |
| |
| main_out tint_symbol_inner(constant buf0& x_8, float4 gl_FragCoord_param, thread float4* const tint_symbol_6, thread float4* const tint_symbol_7) { |
| *(tint_symbol_6) = gl_FragCoord_param; |
| main_1(x_8, tint_symbol_6, tint_symbol_7); |
| main_out const tint_symbol_3 = {.x_GLF_color_1=*(tint_symbol_7)}; |
| return tint_symbol_3; |
| } |
| |
| fragment tint_symbol_1 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_8 [[buffer(0)]]) { |
| thread float4 tint_symbol_8 = 0.0f; |
| thread float4 tint_symbol_9 = 0.0f; |
| main_out const inner_result = tint_symbol_inner(x_8, gl_FragCoord_param, &(tint_symbol_8), &(tint_symbol_9)); |
| tint_symbol_1 wrapper_result = {}; |
| wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1; |
| return wrapper_result; |
| } |
| |