dawn-cmake/test/vk-gl-cts/graphicsfuzz/spv-stable-mergesort-O-prop.../2.spvasm.expected.msl

353 lines
9.9 KiB
Plaintext

#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_3, thread float4* const tint_symbol_4) {
tint_array_wrapper temp = {};
tint_array_wrapper data = {};
float x_189 = 0.0f;
float x_261 = 0.0f;
int x_63_phi = 0;
int x_102_phi = 0;
int x_111_phi = 0;
float x_262_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_99 = 0;
int x_97 = 0;
int x_95 = 0;
int x_93 = 0;
int x_91 = 0;
int x_89 = 0;
int x_87 = 0;
int x_85 = 0;
int x_83 = 0;
int x_81 = 0;
int x_64_phi = 0;
int const x_63 = x_63_phi;
int const x_68 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_68;
switch(x_63) {
case 9: {
data.arr[x_63] = -5;
x_99 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_99;
break;
}
case 8: {
data.arr[x_63] = -4;
x_97 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_97;
break;
}
case 7: {
data.arr[x_63] = -3;
x_95 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_95;
break;
}
case 6: {
data.arr[x_63] = -2;
x_93 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_93;
break;
}
case 5: {
data.arr[x_63] = -1;
x_91 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_91;
break;
}
case 4: {
data.arr[x_63] = 0;
x_89 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_89;
break;
}
case 3: {
data.arr[x_63] = 1;
x_87 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_87;
break;
}
case 2: {
data.arr[x_63] = 2;
x_85 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_85;
break;
}
case 1: {
data.arr[x_63] = 3;
x_83 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_83;
break;
}
case 0: {
data.arr[x_63] = 4;
x_81 = as_type<int>((as_type<uint>(x_63) + as_type<uint>(1)));
x_64_phi = x_81;
break;
}
default: {
break;
}
}
int const x_64 = x_64_phi;
{
x_63_phi = x_64;
if ((x_64 < 10)) {
} else {
break;
}
}
}
x_102_phi = 0;
while (true) {
int x_103 = 0;
int const x_102 = x_102_phi;
if ((x_102 < 10)) {
} else {
break;
}
{
int const x_108 = data.arr[x_102];
temp.arr[x_102] = x_108;
x_103 = as_type<int>((as_type<uint>(x_102) + as_type<uint>(1)));
x_102_phi = x_103;
}
}
x_111_phi = 1;
while (true) {
int x_112 = 0;
int x_118_phi = 0;
int const x_111 = x_111_phi;
if ((x_111 <= 9)) {
} else {
break;
}
x_118_phi = 0;
while (true) {
int x_130 = 0;
int x_135 = 0;
int x_130_phi = 0;
int x_133_phi = 0;
int x_135_phi = 0;
int x_157_phi = 0;
int x_160_phi = 0;
int x_170_phi = 0;
int const x_118 = x_118_phi;
if ((x_118 < 9)) {
} else {
break;
}
int const x_124 = as_type<int>((as_type<uint>(x_118) + as_type<uint>(x_111)));
int const x_125 = as_type<int>((as_type<uint>(x_124) - as_type<uint>(1)));
int const x_119 = as_type<int>((as_type<uint>(x_118) + as_type<uint>(as_type<int>((as_type<uint>(2) * as_type<uint>(x_111))))));
int const x_128 = min(as_type<int>((as_type<uint>(x_119) - as_type<uint>(1))), 9);
x_130_phi = x_118;
x_133_phi = x_124;
x_135_phi = x_118;
while (true) {
int x_150 = 0;
int x_153 = 0;
int x_134_phi = 0;
int x_136_phi = 0;
x_130 = x_130_phi;
int const x_133 = x_133_phi;
x_135 = x_135_phi;
if (((x_135 <= x_125) & (x_133 <= x_128))) {
} else {
break;
}
int const x_142_save = x_135;
int const x_143 = data.arr[x_142_save];
int const x_144_save = x_133;
int const x_145 = data.arr[x_144_save];
int const x_131 = as_type<int>(as_type<int>((as_type<uint>(x_130) + as_type<uint>(as_type<int>(1)))));
if ((x_143 < x_145)) {
x_150 = as_type<int>(as_type<int>((as_type<uint>(x_135) + as_type<uint>(as_type<int>(1)))));
int const x_151 = data.arr[x_142_save];
temp.arr[x_130] = x_151;
x_134_phi = x_133;
x_136_phi = x_150;
} else {
x_153 = as_type<int>((as_type<uint>(x_133) + as_type<uint>(1)));
int const x_154 = data.arr[x_144_save];
temp.arr[x_130] = x_154;
x_134_phi = x_153;
x_136_phi = x_135;
}
int const x_134 = x_134_phi;
int const x_136 = x_136_phi;
{
x_130_phi = x_131;
x_133_phi = x_134;
x_135_phi = x_136;
}
}
x_157_phi = x_130;
x_160_phi = x_135;
while (true) {
int x_158 = 0;
int x_161 = 0;
int const x_157 = x_157_phi;
int const x_160 = x_160_phi;
if (((x_160 < 10) & (x_160 <= x_125))) {
} else {
break;
}
{
x_158 = as_type<int>((as_type<uint>(x_157) + as_type<uint>(1)));
x_161 = as_type<int>((as_type<uint>(x_160) + as_type<uint>(1)));
int const x_167 = data.arr[x_160];
temp.arr[x_157] = x_167;
x_157_phi = x_158;
x_160_phi = x_161;
}
}
x_170_phi = x_118;
while (true) {
int x_171 = 0;
int const x_170 = x_170_phi;
if ((x_170 <= x_128)) {
} else {
break;
}
{
int const x_176 = temp.arr[x_170];
data.arr[x_170] = x_176;
x_171 = as_type<int>((as_type<uint>(x_170) + as_type<uint>(1)));
x_170_phi = x_171;
}
}
{
x_118_phi = x_119;
}
}
{
x_112 = as_type<int>((as_type<uint>(2) * as_type<uint>(x_111)));
x_111_phi = x_112;
}
}
int x_180 = 0;
float x_198 = 0.0f;
float x_260 = 0.0f;
float x_261_phi = 0.0f;
float const x_179 = (*(tint_symbol_3)).y;
x_180 = int(x_179);
if ((x_180 < 30)) {
int const x_186 = data.arr[0];
x_189 = (0.5f + (float(x_186) * 0.100000001f));
x_262_phi = x_189;
} else {
float x_207 = 0.0f;
float x_259 = 0.0f;
float x_260_phi = 0.0f;
if ((x_180 < 60)) {
int const x_195 = data.arr[1];
x_198 = (0.5f + (float(x_195) * 0.100000001f));
x_261_phi = x_198;
} else {
float x_216 = 0.0f;
float x_258 = 0.0f;
float x_259_phi = 0.0f;
if ((x_180 < 90)) {
int const x_204 = data.arr[2];
x_207 = (0.5f + (float(x_204) * 0.100000001f));
x_260_phi = x_207;
} else {
if ((x_180 < 120)) {
int const x_213 = data.arr[3];
x_216 = (0.5f + (float(x_213) * 0.100000001f));
x_259_phi = x_216;
} else {
float x_229 = 0.0f;
float x_257 = 0.0f;
float x_258_phi = 0.0f;
if ((x_180 < 150)) {
discard_fragment();
} else {
float x_238 = 0.0f;
float x_256 = 0.0f;
float x_257_phi = 0.0f;
if ((x_180 < 180)) {
int const x_226 = data.arr[5];
x_229 = (0.5f + (float(x_226) * 0.100000001f));
x_258_phi = x_229;
} else {
float x_247 = 0.0f;
float x_255 = 0.0f;
float x_256_phi = 0.0f;
if ((x_180 < 210)) {
int const x_235 = data.arr[6];
x_238 = (0.5f + (float(x_235) * 0.100000001f));
x_257_phi = x_238;
} else {
if ((x_180 < 240)) {
int const x_244 = data.arr[7];
x_247 = (0.5f + (float(x_244) * 0.100000001f));
x_256_phi = x_247;
} else {
if ((x_180 < 270)) {
} else {
discard_fragment();
}
int const x_252 = data.arr[8];
x_255 = (0.5f + (float(x_252) * 0.100000001f));
x_256_phi = x_255;
}
x_256 = x_256_phi;
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;
}
float const x_262 = x_262_phi;
*(tint_symbol_4) = float4(x_262, x_262, x_262, 1.0f);
return;
}
main_out tint_symbol_inner(constant buf0& x_8, 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_8, 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_8 [[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_8, 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;
}