test: Remove many expected files

For these tests, we only really care that we can successfully consume
them and generate valid output for each backend. Having the expected
files in the tree generates significant churn for any change to how we
generate backend code, which makes it hard to inspect diffs.

Change-Id: Ic98c248081144c0fb1791f1303eaf6d459548e3d
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/62720
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
This commit is contained in:
James Price
2021-08-24 22:49:42 +00:00
committed by Tint LUCI CQ
parent 568136dd10
commit 87cce20f67
8526 changed files with 12 additions and 613699 deletions

View File

@@ -1,261 +0,0 @@
struct BST {
int data;
int leftIndex;
int rightIndex;
};
static BST tree_1[10] = (BST[10])0;
cbuffer cbuffer_x_16 : register(b0, space0) {
uint4 x_16[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void makeTreeNode_struct_BST_i1_i1_i11_i1_(inout BST tree, inout int data) {
const int x_165 = data;
tree.data = x_165;
tree.leftIndex = -1;
tree.rightIndex = -1;
return;
}
void insert_i1_i1_(inout int treeIndex, inout int data_1) {
int baseIndex = 0;
BST param = (BST)0;
int param_1 = 0;
int x_170 = 0;
BST param_2 = (BST)0;
int param_3 = 0;
baseIndex = 0;
while (true) {
const int x_175 = baseIndex;
const int x_176 = treeIndex;
if ((x_175 <= x_176)) {
} else {
break;
}
const int x_179 = data_1;
const int x_182 = tree_1[baseIndex].data;
if ((x_179 <= x_182)) {
const int x_189 = tree_1[baseIndex].leftIndex;
if ((x_189 == -1)) {
const int x_194 = baseIndex;
const int x_195 = treeIndex;
tree_1[x_194].leftIndex = x_195;
const float x_198 = asfloat(x_16[0].x);
const float x_200 = asfloat(x_16[0].y);
if ((x_198 < x_200)) {
const int x_204 = treeIndex;
const BST x_206 = tree_1[x_204];
param = x_206;
const int x_207 = data_1;
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(param, param_1);
tree_1[x_204] = param;
}
const float x_212 = asfloat(x_16[0].x);
const float x_214 = asfloat(x_16[0].y);
if ((x_212 < x_214)) {
return;
}
} else {
const int x_220 = tree_1[baseIndex].leftIndex;
baseIndex = x_220;
continue;
}
} else {
const float x_222 = asfloat(x_16[0].x);
const float x_224 = asfloat(x_16[0].y);
if ((x_222 < x_224)) {
const int x_231 = tree_1[baseIndex].rightIndex;
x_170 = x_231;
} else {
const int x_234 = tree_1[baseIndex].rightIndex;
x_170 = x_234;
}
if ((x_170 == -1)) {
const int x_240 = baseIndex;
const int x_241 = treeIndex;
tree_1[x_240].rightIndex = x_241;
const int x_243 = treeIndex;
const BST x_245 = tree_1[x_243];
param_2 = x_245;
const int x_246 = data_1;
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(param_2, param_3);
tree_1[x_243] = param_2;
return;
} else {
const int x_252 = tree_1[baseIndex].rightIndex;
baseIndex = x_252;
continue;
}
return;
}
const float x_254 = asfloat(x_16[0].x);
const float x_256 = asfloat(x_16[0].y);
if ((x_254 > x_256)) {
return;
}
}
return;
}
int search_i1_(inout int target) {
int index = 0;
BST currentNode = (BST)0;
int x_261 = 0;
index = 0;
while (true) {
if ((index != -1)) {
} else {
break;
}
const BST x_271 = tree_1[index];
currentNode = x_271;
const int x_273 = currentNode.data;
const int x_274 = target;
if ((x_273 == x_274)) {
const int x_278 = target;
return x_278;
}
const int x_279 = target;
const int x_281 = currentNode.data;
if ((x_279 > x_281)) {
const int x_287 = currentNode.rightIndex;
x_261 = x_287;
} else {
const int x_289 = currentNode.leftIndex;
x_261 = x_289;
}
index = x_261;
}
return -1;
}
void main_1() {
int treeIndex_1 = 0;
BST param_4 = (BST)0;
int param_5 = 0;
int param_6 = 0;
int param_7 = 0;
int param_8 = 0;
int param_9 = 0;
int param_10 = 0;
int param_11 = 0;
int param_12 = 0;
int param_13 = 0;
int param_14 = 0;
int param_15 = 0;
int param_16 = 0;
int param_17 = 0;
int param_18 = 0;
int param_19 = 0;
int param_20 = 0;
int param_21 = 0;
int param_22 = 0;
int param_23 = 0;
int count = 0;
int i = 0;
int result = 0;
int param_24 = 0;
treeIndex_1 = 0;
const BST x_91 = tree_1[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(param_4, param_5);
tree_1[0] = param_4;
treeIndex_1 = (treeIndex_1 + 1);
param_6 = treeIndex_1;
param_7 = 5;
insert_i1_i1_(param_6, param_7);
treeIndex_1 = (treeIndex_1 + 1);
param_8 = treeIndex_1;
param_9 = 12;
insert_i1_i1_(param_8, param_9);
treeIndex_1 = (treeIndex_1 + 1);
param_10 = treeIndex_1;
param_11 = 15;
insert_i1_i1_(param_10, param_11);
treeIndex_1 = (treeIndex_1 + 1);
param_12 = treeIndex_1;
param_13 = 7;
insert_i1_i1_(param_12, param_13);
treeIndex_1 = (treeIndex_1 + 1);
param_14 = treeIndex_1;
param_15 = 8;
insert_i1_i1_(param_14, param_15);
treeIndex_1 = (treeIndex_1 + 1);
param_16 = treeIndex_1;
param_17 = 2;
insert_i1_i1_(param_16, param_17);
treeIndex_1 = (treeIndex_1 + 1);
param_18 = treeIndex_1;
param_19 = 6;
insert_i1_i1_(param_18, param_19);
treeIndex_1 = (treeIndex_1 + 1);
param_20 = treeIndex_1;
param_21 = 17;
insert_i1_i1_(param_20, param_21);
treeIndex_1 = (treeIndex_1 + 1);
param_22 = treeIndex_1;
param_23 = 13;
insert_i1_i1_(param_22, param_23);
count = 0;
i = 0;
{
for(; (i < 20); i = (i + 1)) {
param_24 = i;
const int x_139 = search_i1_(param_24);
result = x_139;
switch(i) {
case 2:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case 13:
case 15:
case 17: {
if ((result == i)) {
count = (count + 1);
}
break;
}
default: {
if ((result == -1)) {
count = (count + 1);
}
break;
}
}
}
}
if ((count == 20)) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
main_out main_inner() {
main_1();
const main_out tint_symbol_2 = {x_GLF_color};
return tint_symbol_2;
}
tint_symbol main() {
const main_out inner_result = main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,312 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct BST {
int data;
int leftIndex;
int rightIndex;
};
struct buf0 {
/* 0x0000 */ float2 injectionSwitch;
};
struct tint_array_wrapper {
BST arr[10];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void makeTreeNode_struct_BST_i1_i1_i11_i1_(thread BST* const tree, thread int* const data) {
int const x_165 = *(data);
(*(tree)).data = x_165;
(*(tree)).leftIndex = -1;
(*(tree)).rightIndex = -1;
return;
}
void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int* const data_1, thread tint_array_wrapper* const tint_symbol_3) {
int baseIndex = 0;
BST param = {};
int param_1 = 0;
int x_170 = 0;
BST param_2 = {};
int param_3 = 0;
baseIndex = 0;
while (true) {
int const x_175 = baseIndex;
int const x_176 = *(treeIndex);
if ((x_175 <= x_176)) {
} else {
break;
}
int const x_179 = *(data_1);
int const x_180 = baseIndex;
int const x_182 = (*(tint_symbol_3)).arr[x_180].data;
if ((x_179 <= x_182)) {
int const x_187 = baseIndex;
int const x_189 = (*(tint_symbol_3)).arr[x_187].leftIndex;
if ((x_189 == -1)) {
int const x_194 = baseIndex;
int const x_195 = *(treeIndex);
(*(tint_symbol_3)).arr[x_194].leftIndex = x_195;
float const x_198 = x_16.injectionSwitch.x;
float const x_200 = x_16.injectionSwitch.y;
if ((x_198 < x_200)) {
int const x_204 = *(treeIndex);
BST const x_206 = (*(tint_symbol_3)).arr[x_204];
param = x_206;
int const x_207 = *(data_1);
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
BST const x_209 = param;
(*(tint_symbol_3)).arr[x_204] = x_209;
}
float const x_212 = x_16.injectionSwitch.x;
float const x_214 = x_16.injectionSwitch.y;
if ((x_212 < x_214)) {
return;
}
} else {
int const x_218 = baseIndex;
int const x_220 = (*(tint_symbol_3)).arr[x_218].leftIndex;
baseIndex = x_220;
continue;
}
} else {
float const x_222 = x_16.injectionSwitch.x;
float const x_224 = x_16.injectionSwitch.y;
if ((x_222 < x_224)) {
int const x_229 = baseIndex;
int const x_231 = (*(tint_symbol_3)).arr[x_229].rightIndex;
x_170 = x_231;
} else {
int const x_232 = baseIndex;
int const x_234 = (*(tint_symbol_3)).arr[x_232].rightIndex;
x_170 = x_234;
}
int const x_235 = x_170;
if ((x_235 == -1)) {
int const x_240 = baseIndex;
int const x_241 = *(treeIndex);
(*(tint_symbol_3)).arr[x_240].rightIndex = x_241;
int const x_243 = *(treeIndex);
BST const x_245 = (*(tint_symbol_3)).arr[x_243];
param_2 = x_245;
int const x_246 = *(data_1);
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
BST const x_248 = param_2;
(*(tint_symbol_3)).arr[x_243] = x_248;
return;
} else {
int const x_250 = baseIndex;
int const x_252 = (*(tint_symbol_3)).arr[x_250].rightIndex;
baseIndex = x_252;
continue;
}
return;
}
float const x_254 = x_16.injectionSwitch.x;
float const x_256 = x_16.injectionSwitch.y;
if ((x_254 > x_256)) {
return;
}
}
return;
}
int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_symbol_4) {
int index = 0;
BST currentNode = {};
int x_261 = 0;
index = 0;
while (true) {
int const x_266 = index;
if ((x_266 != -1)) {
} else {
break;
}
int const x_269 = index;
BST const x_271 = (*(tint_symbol_4)).arr[x_269];
currentNode = x_271;
int const x_273 = currentNode.data;
int const x_274 = *(target);
if ((x_273 == x_274)) {
int const x_278 = *(target);
return x_278;
}
int const x_279 = *(target);
int const x_281 = currentNode.data;
if ((x_279 > x_281)) {
int const x_287 = currentNode.rightIndex;
x_261 = x_287;
} else {
int const x_289 = currentNode.leftIndex;
x_261 = x_289;
}
int const x_290 = x_261;
index = x_290;
}
return -1;
}
void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_5, thread float4* const tint_symbol_6) {
int treeIndex_1 = 0;
BST param_4 = {};
int param_5 = 0;
int param_6 = 0;
int param_7 = 0;
int param_8 = 0;
int param_9 = 0;
int param_10 = 0;
int param_11 = 0;
int param_12 = 0;
int param_13 = 0;
int param_14 = 0;
int param_15 = 0;
int param_16 = 0;
int param_17 = 0;
int param_18 = 0;
int param_19 = 0;
int param_20 = 0;
int param_21 = 0;
int param_22 = 0;
int param_23 = 0;
int count = 0;
int i = 0;
int result = 0;
int param_24 = 0;
treeIndex_1 = 0;
BST const x_91 = (*(tint_symbol_5)).arr[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
BST const x_93 = param_4;
(*(tint_symbol_5)).arr[0] = x_93;
int const x_95 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_95) + as_type<uint>(1)));
int const x_97 = treeIndex_1;
param_6 = x_97;
param_7 = 5;
insert_i1_i1_(x_16, &(param_6), &(param_7), tint_symbol_5);
int const x_99 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_99) + as_type<uint>(1)));
int const x_101 = treeIndex_1;
param_8 = x_101;
param_9 = 12;
insert_i1_i1_(x_16, &(param_8), &(param_9), tint_symbol_5);
int const x_103 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1)));
int const x_105 = treeIndex_1;
param_10 = x_105;
param_11 = 15;
insert_i1_i1_(x_16, &(param_10), &(param_11), tint_symbol_5);
int const x_107 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_107) + as_type<uint>(1)));
int const x_109 = treeIndex_1;
param_12 = x_109;
param_13 = 7;
insert_i1_i1_(x_16, &(param_12), &(param_13), tint_symbol_5);
int const x_111 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_111) + as_type<uint>(1)));
int const x_113 = treeIndex_1;
param_14 = x_113;
param_15 = 8;
insert_i1_i1_(x_16, &(param_14), &(param_15), tint_symbol_5);
int const x_115 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_115) + as_type<uint>(1)));
int const x_117 = treeIndex_1;
param_16 = x_117;
param_17 = 2;
insert_i1_i1_(x_16, &(param_16), &(param_17), tint_symbol_5);
int const x_119 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_119) + as_type<uint>(1)));
int const x_121 = treeIndex_1;
param_18 = x_121;
param_19 = 6;
insert_i1_i1_(x_16, &(param_18), &(param_19), tint_symbol_5);
int const x_123 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_123) + as_type<uint>(1)));
int const x_125 = treeIndex_1;
param_20 = x_125;
param_21 = 17;
insert_i1_i1_(x_16, &(param_20), &(param_21), tint_symbol_5);
int const x_127 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_127) + as_type<uint>(1)));
int const x_129 = treeIndex_1;
param_22 = x_129;
param_23 = 13;
insert_i1_i1_(x_16, &(param_22), &(param_23), tint_symbol_5);
count = 0;
i = 0;
while (true) {
int const x_135 = i;
if ((x_135 < 20)) {
} else {
break;
}
int const x_138 = i;
param_24 = x_138;
int const x_139 = search_i1_(&(param_24), tint_symbol_5);
result = x_139;
int const x_140 = i;
switch(x_140) {
case 2:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case 13:
case 15:
case 17: {
int const x_150 = result;
int const x_151 = i;
if ((x_150 == x_151)) {
int const x_155 = count;
count = as_type<int>((as_type<uint>(x_155) + as_type<uint>(1)));
}
break;
}
default: {
int const x_144 = result;
if ((x_144 == -1)) {
int const x_148 = count;
count = as_type<int>((as_type<uint>(x_148) + as_type<uint>(1)));
}
break;
}
}
{
int const x_157 = i;
i = as_type<int>((as_type<uint>(x_157) + as_type<uint>(1)));
}
}
int const x_159 = count;
if ((x_159 == 20)) {
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_6) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_7, thread float4* const tint_symbol_8) {
main_1(x_16, tint_symbol_7, tint_symbol_8);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_8)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_16 [[buffer(0)]]) {
thread tint_array_wrapper tint_symbol_9 = {};
thread float4 tint_symbol_10 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_16, &(tint_symbol_9), &(tint_symbol_10));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,537 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 354
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %BST "BST"
OpMemberName %BST 0 "data"
OpMemberName %BST 1 "leftIndex"
OpMemberName %BST 2 "rightIndex"
OpName %tree_1 "tree_1"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_16 "x_16"
OpName %x_GLF_color "x_GLF_color"
OpName %makeTreeNode_struct_BST_i1_i1_i11_i1_ "makeTreeNode_struct_BST_i1_i1_i11_i1_"
OpName %tree "tree"
OpName %data "data"
OpName %insert_i1_i1_ "insert_i1_i1_"
OpName %treeIndex "treeIndex"
OpName %data_1 "data_1"
OpName %baseIndex "baseIndex"
OpName %param "param"
OpName %param_1 "param_1"
OpName %x_170 "x_170"
OpName %param_2 "param_2"
OpName %param_3 "param_3"
OpName %search_i1_ "search_i1_"
OpName %target "target"
OpName %index "index"
OpName %currentNode "currentNode"
OpName %x_261 "x_261"
OpName %main_1 "main_1"
OpName %treeIndex_1 "treeIndex_1"
OpName %param_4 "param_4"
OpName %param_5 "param_5"
OpName %param_6 "param_6"
OpName %param_7 "param_7"
OpName %param_8 "param_8"
OpName %param_9 "param_9"
OpName %param_10 "param_10"
OpName %param_11 "param_11"
OpName %param_12 "param_12"
OpName %param_13 "param_13"
OpName %param_14 "param_14"
OpName %param_15 "param_15"
OpName %param_16 "param_16"
OpName %param_17 "param_17"
OpName %param_18 "param_18"
OpName %param_19 "param_19"
OpName %param_20 "param_20"
OpName %param_21 "param_21"
OpName %param_22 "param_22"
OpName %param_23 "param_23"
OpName %count "count"
OpName %i "i"
OpName %result "result"
OpName %param_24 "param_24"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %main "main"
OpDecorate %x_GLF_color_1_1 Location 0
OpMemberDecorate %BST 0 Offset 0
OpMemberDecorate %BST 1 Offset 4
OpMemberDecorate %BST 2 Offset 8
OpDecorate %_arr_BST_uint_10 ArrayStride 12
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_16 NonWritable
OpDecorate %x_16 DescriptorSet 0
OpDecorate %x_16 Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
%int = OpTypeInt 32 1
%BST = OpTypeStruct %int %int %int
%uint = OpTypeInt 32 0
%uint_10 = OpConstant %uint 10
%_arr_BST_uint_10 = OpTypeArray %BST %uint_10
%_ptr_Private__arr_BST_uint_10 = OpTypePointer Private %_arr_BST_uint_10
%13 = OpConstantNull %_arr_BST_uint_10
%tree_1 = OpVariable %_ptr_Private__arr_BST_uint_10 Private %13
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_16 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%_ptr_Function_BST = OpTypePointer Function %BST
%_ptr_Function_int = OpTypePointer Function %int
%20 = OpTypeFunction %void %_ptr_Function_BST %_ptr_Function_int
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%int_n1 = OpConstant %int -1
%uint_2 = OpConstant %uint 2
%40 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
%46 = OpConstantNull %int
%48 = OpConstantNull %BST
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%_ptr_Uniform_float = OpTypePointer Uniform %float
%_ptr_Private_BST = OpTypePointer Private %BST
%161 = OpTypeFunction %int %_ptr_Function_int
%202 = OpTypeFunction %void
%int_9 = OpConstant %int 9
%int_1 = OpConstant %int 1
%int_5 = OpConstant %int 5
%int_12 = OpConstant %int 12
%int_15 = OpConstant %int 15
%int_7 = OpConstant %int 7
%int_8 = OpConstant %int 8
%int_2 = OpConstant %int 2
%int_6 = OpConstant %int 6
%int_17 = OpConstant %int 17
%int_13 = OpConstant %int 13
%int_20 = OpConstant %int 20
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%341 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%342 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%main_out = OpTypeStruct %v4float
%343 = OpTypeFunction %main_out
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = OpFunction %void None %20
%tree = OpFunctionParameter %_ptr_Function_BST
%data = OpFunctionParameter %_ptr_Function_int
%27 = OpLabel
%29 = OpLoad %int %data
%32 = OpAccessChain %_ptr_Function_int %tree %uint_0
OpStore %32 %29
%35 = OpAccessChain %_ptr_Function_int %tree %uint_1
OpStore %35 %int_n1
%39 = OpAccessChain %_ptr_Function_int %tree %uint_2
OpStore %39 %int_n1
OpReturn
OpFunctionEnd
%insert_i1_i1_ = OpFunction %void None %40
%treeIndex = OpFunctionParameter %_ptr_Function_int
%data_1 = OpFunctionParameter %_ptr_Function_int
%44 = OpLabel
%baseIndex = OpVariable %_ptr_Function_int Function %46
%param = OpVariable %_ptr_Function_BST Function %48
%param_1 = OpVariable %_ptr_Function_int Function %46
%x_170 = OpVariable %_ptr_Function_int Function %46
%param_2 = OpVariable %_ptr_Function_BST Function %48
%param_3 = OpVariable %_ptr_Function_int Function %46
OpStore %baseIndex %int_0
OpBranch %54
%54 = OpLabel
OpLoopMerge %55 %56 None
OpBranch %57
%57 = OpLabel
%58 = OpLoad %int %baseIndex
%60 = OpLoad %int %treeIndex
%61 = OpSLessThanEqual %bool %58 %60
OpSelectionMerge %63 None
OpBranchConditional %61 %64 %65
%64 = OpLabel
OpBranch %63
%65 = OpLabel
OpBranch %55
%63 = OpLabel
%67 = OpLoad %int %data_1
%68 = OpLoad %int %baseIndex
%70 = OpAccessChain %_ptr_Private_int %tree_1 %68 %uint_0
%71 = OpLoad %int %70
%72 = OpSLessThanEqual %bool %67 %71
OpSelectionMerge %73 None
OpBranchConditional %72 %74 %75
%74 = OpLabel
%76 = OpLoad %int %baseIndex
%77 = OpAccessChain %_ptr_Private_int %tree_1 %76 %uint_1
%78 = OpLoad %int %77
%79 = OpIEqual %bool %78 %int_n1
OpSelectionMerge %80 None
OpBranchConditional %79 %81 %82
%81 = OpLabel
%83 = OpLoad %int %baseIndex
%85 = OpLoad %int %treeIndex
%86 = OpAccessChain %_ptr_Private_int %tree_1 %83 %uint_1
OpStore %86 %85
%88 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%89 = OpLoad %float %88
%90 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%91 = OpLoad %float %90
%92 = OpFOrdLessThan %bool %89 %91
OpSelectionMerge %93 None
OpBranchConditional %92 %94 %93
%94 = OpLabel
%96 = OpLoad %int %treeIndex
%98 = OpAccessChain %_ptr_Private_BST %tree_1 %96
%99 = OpLoad %BST %98
OpStore %param %99
%101 = OpLoad %int %data_1
OpStore %param_1 %101
%102 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param %param_1
%105 = OpLoad %BST %param
%106 = OpAccessChain %_ptr_Private_BST %tree_1 %96
OpStore %106 %105
OpBranch %93
%93 = OpLabel
%107 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%108 = OpLoad %float %107
%109 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%110 = OpLoad %float %109
%111 = OpFOrdLessThan %bool %108 %110
OpSelectionMerge %112 None
OpBranchConditional %111 %113 %112
%113 = OpLabel
OpReturn
%112 = OpLabel
OpBranch %80
%82 = OpLabel
%114 = OpLoad %int %baseIndex
%115 = OpAccessChain %_ptr_Private_int %tree_1 %114 %uint_1
%116 = OpLoad %int %115
OpStore %baseIndex %116
OpBranch %56
%80 = OpLabel
OpBranch %73
%75 = OpLabel
%117 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%118 = OpLoad %float %117
%119 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%120 = OpLoad %float %119
%121 = OpFOrdLessThan %bool %118 %120
OpSelectionMerge %122 None
OpBranchConditional %121 %123 %124
%123 = OpLabel
%125 = OpLoad %int %baseIndex
%126 = OpAccessChain %_ptr_Private_int %tree_1 %125 %uint_2
%127 = OpLoad %int %126
OpStore %x_170 %127
OpBranch %122
%124 = OpLabel
%128 = OpLoad %int %baseIndex
%129 = OpAccessChain %_ptr_Private_int %tree_1 %128 %uint_2
%130 = OpLoad %int %129
OpStore %x_170 %130
OpBranch %122
%122 = OpLabel
%131 = OpLoad %int %x_170
%132 = OpIEqual %bool %131 %int_n1
OpSelectionMerge %133 None
OpBranchConditional %132 %134 %135
%134 = OpLabel
%136 = OpLoad %int %baseIndex
%138 = OpLoad %int %treeIndex
%139 = OpAccessChain %_ptr_Private_int %tree_1 %136 %uint_2
OpStore %139 %138
%141 = OpLoad %int %treeIndex
%142 = OpAccessChain %_ptr_Private_BST %tree_1 %141
%143 = OpLoad %BST %142
OpStore %param_2 %143
%145 = OpLoad %int %data_1
OpStore %param_3 %145
%146 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_2 %param_3
%149 = OpLoad %BST %param_2
%150 = OpAccessChain %_ptr_Private_BST %tree_1 %141
OpStore %150 %149
OpReturn
%135 = OpLabel
%151 = OpLoad %int %baseIndex
%152 = OpAccessChain %_ptr_Private_int %tree_1 %151 %uint_2
%153 = OpLoad %int %152
OpStore %baseIndex %153
OpBranch %56
%133 = OpLabel
OpReturn
%73 = OpLabel
%154 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%155 = OpLoad %float %154
%156 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%157 = OpLoad %float %156
%158 = OpFOrdGreaterThan %bool %155 %157
OpSelectionMerge %159 None
OpBranchConditional %158 %160 %159
%160 = OpLabel
OpReturn
%159 = OpLabel
OpBranch %56
%56 = OpLabel
OpBranch %54
%55 = OpLabel
OpReturn
OpFunctionEnd
%search_i1_ = OpFunction %int None %161
%target = OpFunctionParameter %_ptr_Function_int
%164 = OpLabel
%index = OpVariable %_ptr_Function_int Function %46
%currentNode = OpVariable %_ptr_Function_BST Function %48
%x_261 = OpVariable %_ptr_Function_int Function %46
OpStore %index %int_0
OpBranch %168
%168 = OpLabel
OpLoopMerge %169 %170 None
OpBranch %171
%171 = OpLabel
%172 = OpLoad %int %index
%173 = OpINotEqual %bool %172 %int_n1
OpSelectionMerge %174 None
OpBranchConditional %173 %175 %176
%175 = OpLabel
OpBranch %174
%176 = OpLabel
OpBranch %169
%174 = OpLabel
%177 = OpLoad %int %index
%178 = OpAccessChain %_ptr_Private_BST %tree_1 %177
%179 = OpLoad %BST %178
OpStore %currentNode %179
%180 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%181 = OpLoad %int %180
%183 = OpLoad %int %target
%184 = OpIEqual %bool %181 %183
OpSelectionMerge %185 None
OpBranchConditional %184 %186 %185
%186 = OpLabel
%188 = OpLoad %int %target
OpReturnValue %188
%185 = OpLabel
%190 = OpLoad %int %target
%191 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%192 = OpLoad %int %191
%193 = OpSGreaterThan %bool %190 %192
OpSelectionMerge %194 None
OpBranchConditional %193 %195 %196
%195 = OpLabel
%197 = OpAccessChain %_ptr_Function_int %currentNode %uint_2
%198 = OpLoad %int %197
OpStore %x_261 %198
OpBranch %194
%196 = OpLabel
%199 = OpAccessChain %_ptr_Function_int %currentNode %uint_1
%200 = OpLoad %int %199
OpStore %x_261 %200
OpBranch %194
%194 = OpLabel
%201 = OpLoad %int %x_261
OpStore %index %201
OpBranch %170
%170 = OpLabel
OpBranch %168
%169 = OpLabel
OpReturnValue %int_n1
OpFunctionEnd
%main_1 = OpFunction %void None %202
%204 = OpLabel
%treeIndex_1 = OpVariable %_ptr_Function_int Function %46
%param_4 = OpVariable %_ptr_Function_BST Function %48
%param_5 = OpVariable %_ptr_Function_int Function %46
%param_6 = OpVariable %_ptr_Function_int Function %46
%param_7 = OpVariable %_ptr_Function_int Function %46
%param_8 = OpVariable %_ptr_Function_int Function %46
%param_9 = OpVariable %_ptr_Function_int Function %46
%param_10 = OpVariable %_ptr_Function_int Function %46
%param_11 = OpVariable %_ptr_Function_int Function %46
%param_12 = OpVariable %_ptr_Function_int Function %46
%param_13 = OpVariable %_ptr_Function_int Function %46
%param_14 = OpVariable %_ptr_Function_int Function %46
%param_15 = OpVariable %_ptr_Function_int Function %46
%param_16 = OpVariable %_ptr_Function_int Function %46
%param_17 = OpVariable %_ptr_Function_int Function %46
%param_18 = OpVariable %_ptr_Function_int Function %46
%param_19 = OpVariable %_ptr_Function_int Function %46
%param_20 = OpVariable %_ptr_Function_int Function %46
%param_21 = OpVariable %_ptr_Function_int Function %46
%param_22 = OpVariable %_ptr_Function_int Function %46
%param_23 = OpVariable %_ptr_Function_int Function %46
%count = OpVariable %_ptr_Function_int Function %46
%i = OpVariable %_ptr_Function_int Function %46
%result = OpVariable %_ptr_Function_int Function %46
%param_24 = OpVariable %_ptr_Function_int Function %46
OpStore %treeIndex_1 %int_0
%230 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
%231 = OpLoad %BST %230
OpStore %param_4 %231
OpStore %param_5 %int_9
%233 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_4 %param_5
%236 = OpLoad %BST %param_4
%237 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
OpStore %237 %236
%238 = OpLoad %int %treeIndex_1
%240 = OpIAdd %int %238 %int_1
OpStore %treeIndex_1 %240
%241 = OpLoad %int %treeIndex_1
OpStore %param_6 %241
OpStore %param_7 %int_5
%243 = OpFunctionCall %void %insert_i1_i1_ %param_6 %param_7
%246 = OpLoad %int %treeIndex_1
%247 = OpIAdd %int %246 %int_1
OpStore %treeIndex_1 %247
%248 = OpLoad %int %treeIndex_1
OpStore %param_8 %248
OpStore %param_9 %int_12
%250 = OpFunctionCall %void %insert_i1_i1_ %param_8 %param_9
%253 = OpLoad %int %treeIndex_1
%254 = OpIAdd %int %253 %int_1
OpStore %treeIndex_1 %254
%255 = OpLoad %int %treeIndex_1
OpStore %param_10 %255
OpStore %param_11 %int_15
%257 = OpFunctionCall %void %insert_i1_i1_ %param_10 %param_11
%260 = OpLoad %int %treeIndex_1
%261 = OpIAdd %int %260 %int_1
OpStore %treeIndex_1 %261
%262 = OpLoad %int %treeIndex_1
OpStore %param_12 %262
OpStore %param_13 %int_7
%264 = OpFunctionCall %void %insert_i1_i1_ %param_12 %param_13
%267 = OpLoad %int %treeIndex_1
%268 = OpIAdd %int %267 %int_1
OpStore %treeIndex_1 %268
%269 = OpLoad %int %treeIndex_1
OpStore %param_14 %269
OpStore %param_15 %int_8
%271 = OpFunctionCall %void %insert_i1_i1_ %param_14 %param_15
%274 = OpLoad %int %treeIndex_1
%275 = OpIAdd %int %274 %int_1
OpStore %treeIndex_1 %275
%276 = OpLoad %int %treeIndex_1
OpStore %param_16 %276
OpStore %param_17 %int_2
%278 = OpFunctionCall %void %insert_i1_i1_ %param_16 %param_17
%281 = OpLoad %int %treeIndex_1
%282 = OpIAdd %int %281 %int_1
OpStore %treeIndex_1 %282
%283 = OpLoad %int %treeIndex_1
OpStore %param_18 %283
OpStore %param_19 %int_6
%285 = OpFunctionCall %void %insert_i1_i1_ %param_18 %param_19
%288 = OpLoad %int %treeIndex_1
%289 = OpIAdd %int %288 %int_1
OpStore %treeIndex_1 %289
%290 = OpLoad %int %treeIndex_1
OpStore %param_20 %290
OpStore %param_21 %int_17
%292 = OpFunctionCall %void %insert_i1_i1_ %param_20 %param_21
%295 = OpLoad %int %treeIndex_1
%296 = OpIAdd %int %295 %int_1
OpStore %treeIndex_1 %296
%297 = OpLoad %int %treeIndex_1
OpStore %param_22 %297
OpStore %param_23 %int_13
%299 = OpFunctionCall %void %insert_i1_i1_ %param_22 %param_23
OpStore %count %int_0
OpStore %i %int_0
OpBranch %302
%302 = OpLabel
OpLoopMerge %303 %304 None
OpBranch %305
%305 = OpLabel
%306 = OpLoad %int %i
%308 = OpSLessThan %bool %306 %int_20
OpSelectionMerge %309 None
OpBranchConditional %308 %310 %311
%310 = OpLabel
OpBranch %309
%311 = OpLabel
OpBranch %303
%309 = OpLabel
%312 = OpLoad %int %i
OpStore %param_24 %312
%313 = OpFunctionCall %int %search_i1_ %param_24
OpStore %result %313
%315 = OpLoad %int %i
OpSelectionMerge %316 None
OpSwitch %315 %317 2 %318 5 %318 6 %318 7 %318 8 %318 9 %318 12 %318 13 %318 15 %318 17 %318
%318 = OpLabel
%319 = OpLoad %int %result
%320 = OpLoad %int %i
%321 = OpIEqual %bool %319 %320
OpSelectionMerge %322 None
OpBranchConditional %321 %323 %322
%323 = OpLabel
%324 = OpLoad %int %count
%325 = OpIAdd %int %324 %int_1
OpStore %count %325
OpBranch %322
%322 = OpLabel
OpBranch %316
%317 = OpLabel
%326 = OpLoad %int %result
%327 = OpIEqual %bool %326 %int_n1
OpSelectionMerge %328 None
OpBranchConditional %327 %329 %328
%329 = OpLabel
%330 = OpLoad %int %count
%331 = OpIAdd %int %330 %int_1
OpStore %count %331
OpBranch %328
%328 = OpLabel
OpBranch %316
%316 = OpLabel
OpBranch %304
%304 = OpLabel
%332 = OpLoad %int %i
%333 = OpIAdd %int %332 %int_1
OpStore %i %333
OpBranch %302
%303 = OpLabel
%334 = OpLoad %int %count
%335 = OpIEqual %bool %334 %int_20
OpSelectionMerge %336 None
OpBranchConditional %335 %337 %338
%337 = OpLabel
OpStore %x_GLF_color %341
OpBranch %336
%338 = OpLabel
OpStore %x_GLF_color %342
OpBranch %336
%336 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %343
%346 = OpLabel
%347 = OpFunctionCall %void %main_1
%348 = OpLoad %v4float %x_GLF_color
%349 = OpCompositeConstruct %main_out %348
OpReturnValue %349
OpFunctionEnd
%main = OpFunction %void None %202
%351 = OpLabel
%352 = OpFunctionCall %main_out %main_inner
%353 = OpCompositeExtract %v4float %352 0
OpStore %x_GLF_color_1_1 %353
OpReturn
OpFunctionEnd

View File

@@ -1,293 +0,0 @@
struct BST {
data : i32;
leftIndex : i32;
rightIndex : i32;
};
[[block]]
struct buf0 {
injectionSwitch : vec2<f32>;
};
var<private> tree_1 : array<BST, 10>;
[[group(0), binding(0)]] var<uniform> x_16 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn makeTreeNode_struct_BST_i1_i1_i11_i1_(tree : ptr<function, BST>, data : ptr<function, i32>) {
let x_165 : i32 = *(data);
(*(tree)).data = x_165;
(*(tree)).leftIndex = -1;
(*(tree)).rightIndex = -1;
return;
}
fn insert_i1_i1_(treeIndex : ptr<function, i32>, data_1 : ptr<function, i32>) {
var baseIndex : i32;
var param : BST;
var param_1 : i32;
var x_170 : i32;
var param_2 : BST;
var param_3 : i32;
baseIndex = 0;
loop {
let x_175 : i32 = baseIndex;
let x_176 : i32 = *(treeIndex);
if ((x_175 <= x_176)) {
} else {
break;
}
let x_179 : i32 = *(data_1);
let x_180 : i32 = baseIndex;
let x_182 : i32 = tree_1[x_180].data;
if ((x_179 <= x_182)) {
let x_187 : i32 = baseIndex;
let x_189 : i32 = tree_1[x_187].leftIndex;
if ((x_189 == -1)) {
let x_194 : i32 = baseIndex;
let x_195 : i32 = *(treeIndex);
tree_1[x_194].leftIndex = x_195;
let x_198 : f32 = x_16.injectionSwitch.x;
let x_200 : f32 = x_16.injectionSwitch.y;
if ((x_198 < x_200)) {
let x_204 : i32 = *(treeIndex);
let x_206 : BST = tree_1[x_204];
param = x_206;
let x_207 : i32 = *(data_1);
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
let x_209 : BST = param;
tree_1[x_204] = x_209;
}
let x_212 : f32 = x_16.injectionSwitch.x;
let x_214 : f32 = x_16.injectionSwitch.y;
if ((x_212 < x_214)) {
return;
}
} else {
let x_218 : i32 = baseIndex;
let x_220 : i32 = tree_1[x_218].leftIndex;
baseIndex = x_220;
continue;
}
} else {
let x_222 : f32 = x_16.injectionSwitch.x;
let x_224 : f32 = x_16.injectionSwitch.y;
if ((x_222 < x_224)) {
let x_229 : i32 = baseIndex;
let x_231 : i32 = tree_1[x_229].rightIndex;
x_170 = x_231;
} else {
let x_232 : i32 = baseIndex;
let x_234 : i32 = tree_1[x_232].rightIndex;
x_170 = x_234;
}
let x_235 : i32 = x_170;
if ((x_235 == -1)) {
let x_240 : i32 = baseIndex;
let x_241 : i32 = *(treeIndex);
tree_1[x_240].rightIndex = x_241;
let x_243 : i32 = *(treeIndex);
let x_245 : BST = tree_1[x_243];
param_2 = x_245;
let x_246 : i32 = *(data_1);
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
let x_248 : BST = param_2;
tree_1[x_243] = x_248;
return;
} else {
let x_250 : i32 = baseIndex;
let x_252 : i32 = tree_1[x_250].rightIndex;
baseIndex = x_252;
continue;
}
return;
}
let x_254 : f32 = x_16.injectionSwitch.x;
let x_256 : f32 = x_16.injectionSwitch.y;
if ((x_254 > x_256)) {
return;
}
}
return;
}
fn search_i1_(target : ptr<function, i32>) -> i32 {
var index : i32;
var currentNode : BST;
var x_261 : i32;
index = 0;
loop {
let x_266 : i32 = index;
if ((x_266 != -1)) {
} else {
break;
}
let x_269 : i32 = index;
let x_271 : BST = tree_1[x_269];
currentNode = x_271;
let x_273 : i32 = currentNode.data;
let x_274 : i32 = *(target);
if ((x_273 == x_274)) {
let x_278 : i32 = *(target);
return x_278;
}
let x_279 : i32 = *(target);
let x_281 : i32 = currentNode.data;
if ((x_279 > x_281)) {
let x_287 : i32 = currentNode.rightIndex;
x_261 = x_287;
} else {
let x_289 : i32 = currentNode.leftIndex;
x_261 = x_289;
}
let x_290 : i32 = x_261;
index = x_290;
}
return -1;
}
fn main_1() {
var treeIndex_1 : i32;
var param_4 : BST;
var param_5 : i32;
var param_6 : i32;
var param_7 : i32;
var param_8 : i32;
var param_9 : i32;
var param_10 : i32;
var param_11 : i32;
var param_12 : i32;
var param_13 : i32;
var param_14 : i32;
var param_15 : i32;
var param_16 : i32;
var param_17 : i32;
var param_18 : i32;
var param_19 : i32;
var param_20 : i32;
var param_21 : i32;
var param_22 : i32;
var param_23 : i32;
var count : i32;
var i : i32;
var result : i32;
var param_24 : i32;
treeIndex_1 = 0;
let x_91 : BST = tree_1[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
let x_93 : BST = param_4;
tree_1[0] = x_93;
let x_95 : i32 = treeIndex_1;
treeIndex_1 = (x_95 + 1);
let x_97 : i32 = treeIndex_1;
param_6 = x_97;
param_7 = 5;
insert_i1_i1_(&(param_6), &(param_7));
let x_99 : i32 = treeIndex_1;
treeIndex_1 = (x_99 + 1);
let x_101 : i32 = treeIndex_1;
param_8 = x_101;
param_9 = 12;
insert_i1_i1_(&(param_8), &(param_9));
let x_103 : i32 = treeIndex_1;
treeIndex_1 = (x_103 + 1);
let x_105 : i32 = treeIndex_1;
param_10 = x_105;
param_11 = 15;
insert_i1_i1_(&(param_10), &(param_11));
let x_107 : i32 = treeIndex_1;
treeIndex_1 = (x_107 + 1);
let x_109 : i32 = treeIndex_1;
param_12 = x_109;
param_13 = 7;
insert_i1_i1_(&(param_12), &(param_13));
let x_111 : i32 = treeIndex_1;
treeIndex_1 = (x_111 + 1);
let x_113 : i32 = treeIndex_1;
param_14 = x_113;
param_15 = 8;
insert_i1_i1_(&(param_14), &(param_15));
let x_115 : i32 = treeIndex_1;
treeIndex_1 = (x_115 + 1);
let x_117 : i32 = treeIndex_1;
param_16 = x_117;
param_17 = 2;
insert_i1_i1_(&(param_16), &(param_17));
let x_119 : i32 = treeIndex_1;
treeIndex_1 = (x_119 + 1);
let x_121 : i32 = treeIndex_1;
param_18 = x_121;
param_19 = 6;
insert_i1_i1_(&(param_18), &(param_19));
let x_123 : i32 = treeIndex_1;
treeIndex_1 = (x_123 + 1);
let x_125 : i32 = treeIndex_1;
param_20 = x_125;
param_21 = 17;
insert_i1_i1_(&(param_20), &(param_21));
let x_127 : i32 = treeIndex_1;
treeIndex_1 = (x_127 + 1);
let x_129 : i32 = treeIndex_1;
param_22 = x_129;
param_23 = 13;
insert_i1_i1_(&(param_22), &(param_23));
count = 0;
i = 0;
loop {
let x_135 : i32 = i;
if ((x_135 < 20)) {
} else {
break;
}
let x_138 : i32 = i;
param_24 = x_138;
let x_139 : i32 = search_i1_(&(param_24));
result = x_139;
let x_140 : i32 = i;
switch(x_140) {
case 2, 5, 6, 7, 8, 9, 12, 13, 15, 17: {
let x_150 : i32 = result;
let x_151 : i32 = i;
if ((x_150 == x_151)) {
let x_155 : i32 = count;
count = (x_155 + 1);
}
}
default: {
let x_144 : i32 = result;
if ((x_144 == -1)) {
let x_148 : i32 = count;
count = (x_148 + 1);
}
}
}
continuing {
let x_157 : i32 = i;
i = (x_157 + 1);
}
}
let x_159 : i32 = count;
if ((x_159 == 20)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 1.0, 1.0);
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main() -> main_out {
main_1();
return main_out(x_GLF_color);
}

View File

@@ -1,261 +0,0 @@
struct BST {
int data;
int leftIndex;
int rightIndex;
};
static BST tree_1[10] = (BST[10])0;
cbuffer cbuffer_x_16 : register(b0, space0) {
uint4 x_16[1];
};
static float4 x_GLF_color = float4(0.0f, 0.0f, 0.0f, 0.0f);
void makeTreeNode_struct_BST_i1_i1_i11_i1_(inout BST tree, inout int data) {
const int x_165 = data;
tree.data = x_165;
tree.leftIndex = -1;
tree.rightIndex = -1;
return;
}
void insert_i1_i1_(inout int treeIndex, inout int data_1) {
int baseIndex = 0;
BST param = (BST)0;
int param_1 = 0;
int x_170 = 0;
BST param_2 = (BST)0;
int param_3 = 0;
baseIndex = 0;
while (true) {
const int x_175 = baseIndex;
const int x_176 = treeIndex;
if ((x_175 <= x_176)) {
} else {
break;
}
const int x_179 = data_1;
const int x_182 = tree_1[baseIndex].data;
if ((x_179 <= x_182)) {
const int x_189 = tree_1[baseIndex].leftIndex;
if ((x_189 == -1)) {
const int x_194 = baseIndex;
const int x_195 = treeIndex;
tree_1[x_194].leftIndex = x_195;
const float x_198 = asfloat(x_16[0].x);
const float x_200 = asfloat(x_16[0].y);
if ((x_198 < x_200)) {
const int x_204 = treeIndex;
const BST x_206 = tree_1[x_204];
param = x_206;
const int x_207 = data_1;
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(param, param_1);
tree_1[x_204] = param;
}
const float x_212 = asfloat(x_16[0].x);
const float x_214 = asfloat(x_16[0].y);
if ((x_212 < x_214)) {
return;
}
} else {
const int x_220 = tree_1[baseIndex].leftIndex;
baseIndex = x_220;
continue;
}
} else {
const float x_222 = asfloat(x_16[0].x);
const float x_224 = asfloat(x_16[0].y);
if ((x_222 < x_224)) {
const int x_231 = tree_1[baseIndex].rightIndex;
x_170 = x_231;
} else {
const int x_234 = tree_1[baseIndex].rightIndex;
x_170 = x_234;
}
if ((x_170 == -1)) {
const int x_240 = baseIndex;
const int x_241 = treeIndex;
tree_1[x_240].rightIndex = x_241;
const int x_243 = treeIndex;
const BST x_245 = tree_1[x_243];
param_2 = x_245;
const int x_246 = data_1;
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(param_2, param_3);
tree_1[x_243] = param_2;
return;
} else {
const int x_252 = tree_1[baseIndex].rightIndex;
baseIndex = x_252;
continue;
}
return;
}
const float x_254 = asfloat(x_16[0].x);
const float x_256 = asfloat(x_16[0].y);
if ((x_254 > x_256)) {
return;
}
}
return;
}
int search_i1_(inout int target) {
int index = 0;
BST currentNode = (BST)0;
int x_261 = 0;
index = 0;
while (true) {
if ((index != -1)) {
} else {
break;
}
const BST x_271 = tree_1[index];
currentNode = x_271;
const int x_273 = currentNode.data;
const int x_274 = target;
if ((x_273 == x_274)) {
const int x_278 = target;
return x_278;
}
const int x_279 = target;
const int x_281 = currentNode.data;
if ((x_279 > x_281)) {
const int x_287 = currentNode.rightIndex;
x_261 = x_287;
} else {
const int x_289 = currentNode.leftIndex;
x_261 = x_289;
}
index = x_261;
}
return -1;
}
void main_1() {
int treeIndex_1 = 0;
BST param_4 = (BST)0;
int param_5 = 0;
int param_6 = 0;
int param_7 = 0;
int param_8 = 0;
int param_9 = 0;
int param_10 = 0;
int param_11 = 0;
int param_12 = 0;
int param_13 = 0;
int param_14 = 0;
int param_15 = 0;
int param_16 = 0;
int param_17 = 0;
int param_18 = 0;
int param_19 = 0;
int param_20 = 0;
int param_21 = 0;
int param_22 = 0;
int param_23 = 0;
int count = 0;
int i = 0;
int result = 0;
int param_24 = 0;
treeIndex_1 = 0;
const BST x_91 = tree_1[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(param_4, param_5);
tree_1[0] = param_4;
treeIndex_1 = (treeIndex_1 + 1);
param_6 = treeIndex_1;
param_7 = 5;
insert_i1_i1_(param_6, param_7);
treeIndex_1 = (treeIndex_1 + 1);
param_8 = treeIndex_1;
param_9 = 12;
insert_i1_i1_(param_8, param_9);
treeIndex_1 = (treeIndex_1 + 1);
param_10 = treeIndex_1;
param_11 = 15;
insert_i1_i1_(param_10, param_11);
treeIndex_1 = (treeIndex_1 + 1);
param_12 = treeIndex_1;
param_13 = 7;
insert_i1_i1_(param_12, param_13);
treeIndex_1 = (treeIndex_1 + 1);
param_14 = treeIndex_1;
param_15 = 8;
insert_i1_i1_(param_14, param_15);
treeIndex_1 = (treeIndex_1 + 1);
param_16 = treeIndex_1;
param_17 = 2;
insert_i1_i1_(param_16, param_17);
treeIndex_1 = (treeIndex_1 + 1);
param_18 = treeIndex_1;
param_19 = 6;
insert_i1_i1_(param_18, param_19);
treeIndex_1 = (treeIndex_1 + 1);
param_20 = treeIndex_1;
param_21 = 17;
insert_i1_i1_(param_20, param_21);
treeIndex_1 = (treeIndex_1 + 1);
param_22 = treeIndex_1;
param_23 = 13;
insert_i1_i1_(param_22, param_23);
count = 0;
i = 0;
{
for(; (i < 20); i = (i + 1)) {
param_24 = i;
const int x_139 = search_i1_(param_24);
result = x_139;
switch(i) {
case 2:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case 13:
case 15:
case 17: {
if ((result == i)) {
count = (count + 1);
}
break;
}
default: {
if ((result == -1)) {
count = (count + 1);
}
break;
}
}
}
}
if ((count == 20)) {
x_GLF_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
x_GLF_color = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol {
float4 x_GLF_color_1 : SV_Target0;
};
main_out main_inner() {
main_1();
const main_out tint_symbol_2 = {x_GLF_color};
return tint_symbol_2;
}
tint_symbol main() {
const main_out inner_result = main_inner();
tint_symbol wrapper_result = (tint_symbol)0;
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,312 +0,0 @@
#include <metal_stdlib>
using namespace metal;
struct BST {
int data;
int leftIndex;
int rightIndex;
};
struct buf0 {
/* 0x0000 */ float2 injectionSwitch;
};
struct tint_array_wrapper {
BST arr[10];
};
struct main_out {
float4 x_GLF_color_1;
};
struct tint_symbol_1 {
float4 x_GLF_color_1 [[color(0)]];
};
void makeTreeNode_struct_BST_i1_i1_i11_i1_(thread BST* const tree, thread int* const data) {
int const x_165 = *(data);
(*(tree)).data = x_165;
(*(tree)).leftIndex = -1;
(*(tree)).rightIndex = -1;
return;
}
void insert_i1_i1_(constant buf0& x_16, thread int* const treeIndex, thread int* const data_1, thread tint_array_wrapper* const tint_symbol_3) {
int baseIndex = 0;
BST param = {};
int param_1 = 0;
int x_170 = 0;
BST param_2 = {};
int param_3 = 0;
baseIndex = 0;
while (true) {
int const x_175 = baseIndex;
int const x_176 = *(treeIndex);
if ((x_175 <= x_176)) {
} else {
break;
}
int const x_179 = *(data_1);
int const x_180 = baseIndex;
int const x_182 = (*(tint_symbol_3)).arr[x_180].data;
if ((x_179 <= x_182)) {
int const x_187 = baseIndex;
int const x_189 = (*(tint_symbol_3)).arr[x_187].leftIndex;
if ((x_189 == -1)) {
int const x_194 = baseIndex;
int const x_195 = *(treeIndex);
(*(tint_symbol_3)).arr[x_194].leftIndex = x_195;
float const x_198 = x_16.injectionSwitch.x;
float const x_200 = x_16.injectionSwitch.y;
if ((x_198 < x_200)) {
int const x_204 = *(treeIndex);
BST const x_206 = (*(tint_symbol_3)).arr[x_204];
param = x_206;
int const x_207 = *(data_1);
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
BST const x_209 = param;
(*(tint_symbol_3)).arr[x_204] = x_209;
}
float const x_212 = x_16.injectionSwitch.x;
float const x_214 = x_16.injectionSwitch.y;
if ((x_212 < x_214)) {
return;
}
} else {
int const x_218 = baseIndex;
int const x_220 = (*(tint_symbol_3)).arr[x_218].leftIndex;
baseIndex = x_220;
continue;
}
} else {
float const x_222 = x_16.injectionSwitch.x;
float const x_224 = x_16.injectionSwitch.y;
if ((x_222 < x_224)) {
int const x_229 = baseIndex;
int const x_231 = (*(tint_symbol_3)).arr[x_229].rightIndex;
x_170 = x_231;
} else {
int const x_232 = baseIndex;
int const x_234 = (*(tint_symbol_3)).arr[x_232].rightIndex;
x_170 = x_234;
}
int const x_235 = x_170;
if ((x_235 == -1)) {
int const x_240 = baseIndex;
int const x_241 = *(treeIndex);
(*(tint_symbol_3)).arr[x_240].rightIndex = x_241;
int const x_243 = *(treeIndex);
BST const x_245 = (*(tint_symbol_3)).arr[x_243];
param_2 = x_245;
int const x_246 = *(data_1);
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
BST const x_248 = param_2;
(*(tint_symbol_3)).arr[x_243] = x_248;
return;
} else {
int const x_250 = baseIndex;
int const x_252 = (*(tint_symbol_3)).arr[x_250].rightIndex;
baseIndex = x_252;
continue;
}
return;
}
float const x_254 = x_16.injectionSwitch.x;
float const x_256 = x_16.injectionSwitch.y;
if ((x_254 > x_256)) {
return;
}
}
return;
}
int search_i1_(thread int* const target, thread tint_array_wrapper* const tint_symbol_4) {
int index = 0;
BST currentNode = {};
int x_261 = 0;
index = 0;
while (true) {
int const x_266 = index;
if ((x_266 != -1)) {
} else {
break;
}
int const x_269 = index;
BST const x_271 = (*(tint_symbol_4)).arr[x_269];
currentNode = x_271;
int const x_273 = currentNode.data;
int const x_274 = *(target);
if ((x_273 == x_274)) {
int const x_278 = *(target);
return x_278;
}
int const x_279 = *(target);
int const x_281 = currentNode.data;
if ((x_279 > x_281)) {
int const x_287 = currentNode.rightIndex;
x_261 = x_287;
} else {
int const x_289 = currentNode.leftIndex;
x_261 = x_289;
}
int const x_290 = x_261;
index = x_290;
}
return -1;
}
void main_1(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_5, thread float4* const tint_symbol_6) {
int treeIndex_1 = 0;
BST param_4 = {};
int param_5 = 0;
int param_6 = 0;
int param_7 = 0;
int param_8 = 0;
int param_9 = 0;
int param_10 = 0;
int param_11 = 0;
int param_12 = 0;
int param_13 = 0;
int param_14 = 0;
int param_15 = 0;
int param_16 = 0;
int param_17 = 0;
int param_18 = 0;
int param_19 = 0;
int param_20 = 0;
int param_21 = 0;
int param_22 = 0;
int param_23 = 0;
int count = 0;
int i = 0;
int result = 0;
int param_24 = 0;
treeIndex_1 = 0;
BST const x_91 = (*(tint_symbol_5)).arr[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
BST const x_93 = param_4;
(*(tint_symbol_5)).arr[0] = x_93;
int const x_95 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_95) + as_type<uint>(1)));
int const x_97 = treeIndex_1;
param_6 = x_97;
param_7 = 5;
insert_i1_i1_(x_16, &(param_6), &(param_7), tint_symbol_5);
int const x_99 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_99) + as_type<uint>(1)));
int const x_101 = treeIndex_1;
param_8 = x_101;
param_9 = 12;
insert_i1_i1_(x_16, &(param_8), &(param_9), tint_symbol_5);
int const x_103 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_103) + as_type<uint>(1)));
int const x_105 = treeIndex_1;
param_10 = x_105;
param_11 = 15;
insert_i1_i1_(x_16, &(param_10), &(param_11), tint_symbol_5);
int const x_107 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_107) + as_type<uint>(1)));
int const x_109 = treeIndex_1;
param_12 = x_109;
param_13 = 7;
insert_i1_i1_(x_16, &(param_12), &(param_13), tint_symbol_5);
int const x_111 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_111) + as_type<uint>(1)));
int const x_113 = treeIndex_1;
param_14 = x_113;
param_15 = 8;
insert_i1_i1_(x_16, &(param_14), &(param_15), tint_symbol_5);
int const x_115 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_115) + as_type<uint>(1)));
int const x_117 = treeIndex_1;
param_16 = x_117;
param_17 = 2;
insert_i1_i1_(x_16, &(param_16), &(param_17), tint_symbol_5);
int const x_119 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_119) + as_type<uint>(1)));
int const x_121 = treeIndex_1;
param_18 = x_121;
param_19 = 6;
insert_i1_i1_(x_16, &(param_18), &(param_19), tint_symbol_5);
int const x_123 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_123) + as_type<uint>(1)));
int const x_125 = treeIndex_1;
param_20 = x_125;
param_21 = 17;
insert_i1_i1_(x_16, &(param_20), &(param_21), tint_symbol_5);
int const x_127 = treeIndex_1;
treeIndex_1 = as_type<int>((as_type<uint>(x_127) + as_type<uint>(1)));
int const x_129 = treeIndex_1;
param_22 = x_129;
param_23 = 13;
insert_i1_i1_(x_16, &(param_22), &(param_23), tint_symbol_5);
count = 0;
i = 0;
while (true) {
int const x_135 = i;
if ((x_135 < 20)) {
} else {
break;
}
int const x_138 = i;
param_24 = x_138;
int const x_139 = search_i1_(&(param_24), tint_symbol_5);
result = x_139;
int const x_140 = i;
switch(x_140) {
case 2:
case 5:
case 6:
case 7:
case 8:
case 9:
case 12:
case 13:
case 15:
case 17: {
int const x_150 = result;
int const x_151 = i;
if ((x_150 == x_151)) {
int const x_155 = count;
count = as_type<int>((as_type<uint>(x_155) + as_type<uint>(1)));
}
break;
}
default: {
int const x_144 = result;
if ((x_144 == -1)) {
int const x_148 = count;
count = as_type<int>((as_type<uint>(x_148) + as_type<uint>(1)));
}
break;
}
}
{
int const x_157 = i;
i = as_type<int>((as_type<uint>(x_157) + as_type<uint>(1)));
}
}
int const x_159 = count;
if ((x_159 == 20)) {
*(tint_symbol_6) = float4(1.0f, 0.0f, 0.0f, 1.0f);
} else {
*(tint_symbol_6) = float4(0.0f, 0.0f, 1.0f, 1.0f);
}
return;
}
main_out tint_symbol_inner(constant buf0& x_16, thread tint_array_wrapper* const tint_symbol_7, thread float4* const tint_symbol_8) {
main_1(x_16, tint_symbol_7, tint_symbol_8);
main_out const tint_symbol_2 = {.x_GLF_color_1=*(tint_symbol_8)};
return tint_symbol_2;
}
fragment tint_symbol_1 tint_symbol(constant buf0& x_16 [[buffer(0)]]) {
thread tint_array_wrapper tint_symbol_9 = {};
thread float4 tint_symbol_10 = 0.0f;
main_out const inner_result = tint_symbol_inner(x_16, &(tint_symbol_9), &(tint_symbol_10));
tint_symbol_1 wrapper_result = {};
wrapper_result.x_GLF_color_1 = inner_result.x_GLF_color_1;
return wrapper_result;
}

View File

@@ -1,537 +0,0 @@
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 354
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %x_GLF_color_1_1
OpExecutionMode %main OriginUpperLeft
OpName %x_GLF_color_1_1 "x_GLF_color_1_1"
OpName %BST "BST"
OpMemberName %BST 0 "data"
OpMemberName %BST 1 "leftIndex"
OpMemberName %BST 2 "rightIndex"
OpName %tree_1 "tree_1"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_16 "x_16"
OpName %x_GLF_color "x_GLF_color"
OpName %makeTreeNode_struct_BST_i1_i1_i11_i1_ "makeTreeNode_struct_BST_i1_i1_i11_i1_"
OpName %tree "tree"
OpName %data "data"
OpName %insert_i1_i1_ "insert_i1_i1_"
OpName %treeIndex "treeIndex"
OpName %data_1 "data_1"
OpName %baseIndex "baseIndex"
OpName %param "param"
OpName %param_1 "param_1"
OpName %x_170 "x_170"
OpName %param_2 "param_2"
OpName %param_3 "param_3"
OpName %search_i1_ "search_i1_"
OpName %target "target"
OpName %index "index"
OpName %currentNode "currentNode"
OpName %x_261 "x_261"
OpName %main_1 "main_1"
OpName %treeIndex_1 "treeIndex_1"
OpName %param_4 "param_4"
OpName %param_5 "param_5"
OpName %param_6 "param_6"
OpName %param_7 "param_7"
OpName %param_8 "param_8"
OpName %param_9 "param_9"
OpName %param_10 "param_10"
OpName %param_11 "param_11"
OpName %param_12 "param_12"
OpName %param_13 "param_13"
OpName %param_14 "param_14"
OpName %param_15 "param_15"
OpName %param_16 "param_16"
OpName %param_17 "param_17"
OpName %param_18 "param_18"
OpName %param_19 "param_19"
OpName %param_20 "param_20"
OpName %param_21 "param_21"
OpName %param_22 "param_22"
OpName %param_23 "param_23"
OpName %count "count"
OpName %i "i"
OpName %result "result"
OpName %param_24 "param_24"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %main_inner "main_inner"
OpName %main "main"
OpDecorate %x_GLF_color_1_1 Location 0
OpMemberDecorate %BST 0 Offset 0
OpMemberDecorate %BST 1 Offset 4
OpMemberDecorate %BST 2 Offset 8
OpDecorate %_arr_BST_uint_10 ArrayStride 12
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_16 NonWritable
OpDecorate %x_16 DescriptorSet 0
OpDecorate %x_16 Binding 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Output_v4float = OpTypePointer Output %v4float
%5 = OpConstantNull %v4float
%x_GLF_color_1_1 = OpVariable %_ptr_Output_v4float Output %5
%int = OpTypeInt 32 1
%BST = OpTypeStruct %int %int %int
%uint = OpTypeInt 32 0
%uint_10 = OpConstant %uint 10
%_arr_BST_uint_10 = OpTypeArray %BST %uint_10
%_ptr_Private__arr_BST_uint_10 = OpTypePointer Private %_arr_BST_uint_10
%13 = OpConstantNull %_arr_BST_uint_10
%tree_1 = OpVariable %_ptr_Private__arr_BST_uint_10 Private %13
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_16 = OpVariable %_ptr_Uniform_buf0 Uniform
%_ptr_Private_v4float = OpTypePointer Private %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%void = OpTypeVoid
%_ptr_Function_BST = OpTypePointer Function %BST
%_ptr_Function_int = OpTypePointer Function %int
%20 = OpTypeFunction %void %_ptr_Function_BST %_ptr_Function_int
%uint_0 = OpConstant %uint 0
%uint_1 = OpConstant %uint 1
%int_n1 = OpConstant %int -1
%uint_2 = OpConstant %uint 2
%40 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
%46 = OpConstantNull %int
%48 = OpConstantNull %BST
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%_ptr_Uniform_float = OpTypePointer Uniform %float
%_ptr_Private_BST = OpTypePointer Private %BST
%161 = OpTypeFunction %int %_ptr_Function_int
%202 = OpTypeFunction %void
%int_9 = OpConstant %int 9
%int_1 = OpConstant %int 1
%int_5 = OpConstant %int 5
%int_12 = OpConstant %int 12
%int_15 = OpConstant %int 15
%int_7 = OpConstant %int 7
%int_8 = OpConstant %int 8
%int_2 = OpConstant %int 2
%int_6 = OpConstant %int 6
%int_17 = OpConstant %int 17
%int_13 = OpConstant %int 13
%int_20 = OpConstant %int 20
%float_1 = OpConstant %float 1
%float_0 = OpConstant %float 0
%341 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%342 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%main_out = OpTypeStruct %v4float
%343 = OpTypeFunction %main_out
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = OpFunction %void None %20
%tree = OpFunctionParameter %_ptr_Function_BST
%data = OpFunctionParameter %_ptr_Function_int
%27 = OpLabel
%29 = OpLoad %int %data
%32 = OpAccessChain %_ptr_Function_int %tree %uint_0
OpStore %32 %29
%35 = OpAccessChain %_ptr_Function_int %tree %uint_1
OpStore %35 %int_n1
%39 = OpAccessChain %_ptr_Function_int %tree %uint_2
OpStore %39 %int_n1
OpReturn
OpFunctionEnd
%insert_i1_i1_ = OpFunction %void None %40
%treeIndex = OpFunctionParameter %_ptr_Function_int
%data_1 = OpFunctionParameter %_ptr_Function_int
%44 = OpLabel
%baseIndex = OpVariable %_ptr_Function_int Function %46
%param = OpVariable %_ptr_Function_BST Function %48
%param_1 = OpVariable %_ptr_Function_int Function %46
%x_170 = OpVariable %_ptr_Function_int Function %46
%param_2 = OpVariable %_ptr_Function_BST Function %48
%param_3 = OpVariable %_ptr_Function_int Function %46
OpStore %baseIndex %int_0
OpBranch %54
%54 = OpLabel
OpLoopMerge %55 %56 None
OpBranch %57
%57 = OpLabel
%58 = OpLoad %int %baseIndex
%60 = OpLoad %int %treeIndex
%61 = OpSLessThanEqual %bool %58 %60
OpSelectionMerge %63 None
OpBranchConditional %61 %64 %65
%64 = OpLabel
OpBranch %63
%65 = OpLabel
OpBranch %55
%63 = OpLabel
%67 = OpLoad %int %data_1
%68 = OpLoad %int %baseIndex
%70 = OpAccessChain %_ptr_Private_int %tree_1 %68 %uint_0
%71 = OpLoad %int %70
%72 = OpSLessThanEqual %bool %67 %71
OpSelectionMerge %73 None
OpBranchConditional %72 %74 %75
%74 = OpLabel
%76 = OpLoad %int %baseIndex
%77 = OpAccessChain %_ptr_Private_int %tree_1 %76 %uint_1
%78 = OpLoad %int %77
%79 = OpIEqual %bool %78 %int_n1
OpSelectionMerge %80 None
OpBranchConditional %79 %81 %82
%81 = OpLabel
%83 = OpLoad %int %baseIndex
%85 = OpLoad %int %treeIndex
%86 = OpAccessChain %_ptr_Private_int %tree_1 %83 %uint_1
OpStore %86 %85
%88 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%89 = OpLoad %float %88
%90 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%91 = OpLoad %float %90
%92 = OpFOrdLessThan %bool %89 %91
OpSelectionMerge %93 None
OpBranchConditional %92 %94 %93
%94 = OpLabel
%96 = OpLoad %int %treeIndex
%98 = OpAccessChain %_ptr_Private_BST %tree_1 %96
%99 = OpLoad %BST %98
OpStore %param %99
%101 = OpLoad %int %data_1
OpStore %param_1 %101
%102 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param %param_1
%105 = OpLoad %BST %param
%106 = OpAccessChain %_ptr_Private_BST %tree_1 %96
OpStore %106 %105
OpBranch %93
%93 = OpLabel
%107 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%108 = OpLoad %float %107
%109 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%110 = OpLoad %float %109
%111 = OpFOrdLessThan %bool %108 %110
OpSelectionMerge %112 None
OpBranchConditional %111 %113 %112
%113 = OpLabel
OpReturn
%112 = OpLabel
OpBranch %80
%82 = OpLabel
%114 = OpLoad %int %baseIndex
%115 = OpAccessChain %_ptr_Private_int %tree_1 %114 %uint_1
%116 = OpLoad %int %115
OpStore %baseIndex %116
OpBranch %56
%80 = OpLabel
OpBranch %73
%75 = OpLabel
%117 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%118 = OpLoad %float %117
%119 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%120 = OpLoad %float %119
%121 = OpFOrdLessThan %bool %118 %120
OpSelectionMerge %122 None
OpBranchConditional %121 %123 %124
%123 = OpLabel
%125 = OpLoad %int %baseIndex
%126 = OpAccessChain %_ptr_Private_int %tree_1 %125 %uint_2
%127 = OpLoad %int %126
OpStore %x_170 %127
OpBranch %122
%124 = OpLabel
%128 = OpLoad %int %baseIndex
%129 = OpAccessChain %_ptr_Private_int %tree_1 %128 %uint_2
%130 = OpLoad %int %129
OpStore %x_170 %130
OpBranch %122
%122 = OpLabel
%131 = OpLoad %int %x_170
%132 = OpIEqual %bool %131 %int_n1
OpSelectionMerge %133 None
OpBranchConditional %132 %134 %135
%134 = OpLabel
%136 = OpLoad %int %baseIndex
%138 = OpLoad %int %treeIndex
%139 = OpAccessChain %_ptr_Private_int %tree_1 %136 %uint_2
OpStore %139 %138
%141 = OpLoad %int %treeIndex
%142 = OpAccessChain %_ptr_Private_BST %tree_1 %141
%143 = OpLoad %BST %142
OpStore %param_2 %143
%145 = OpLoad %int %data_1
OpStore %param_3 %145
%146 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_2 %param_3
%149 = OpLoad %BST %param_2
%150 = OpAccessChain %_ptr_Private_BST %tree_1 %141
OpStore %150 %149
OpReturn
%135 = OpLabel
%151 = OpLoad %int %baseIndex
%152 = OpAccessChain %_ptr_Private_int %tree_1 %151 %uint_2
%153 = OpLoad %int %152
OpStore %baseIndex %153
OpBranch %56
%133 = OpLabel
OpReturn
%73 = OpLabel
%154 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_0
%155 = OpLoad %float %154
%156 = OpAccessChain %_ptr_Uniform_float %x_16 %uint_0 %uint_1
%157 = OpLoad %float %156
%158 = OpFOrdGreaterThan %bool %155 %157
OpSelectionMerge %159 None
OpBranchConditional %158 %160 %159
%160 = OpLabel
OpReturn
%159 = OpLabel
OpBranch %56
%56 = OpLabel
OpBranch %54
%55 = OpLabel
OpReturn
OpFunctionEnd
%search_i1_ = OpFunction %int None %161
%target = OpFunctionParameter %_ptr_Function_int
%164 = OpLabel
%index = OpVariable %_ptr_Function_int Function %46
%currentNode = OpVariable %_ptr_Function_BST Function %48
%x_261 = OpVariable %_ptr_Function_int Function %46
OpStore %index %int_0
OpBranch %168
%168 = OpLabel
OpLoopMerge %169 %170 None
OpBranch %171
%171 = OpLabel
%172 = OpLoad %int %index
%173 = OpINotEqual %bool %172 %int_n1
OpSelectionMerge %174 None
OpBranchConditional %173 %175 %176
%175 = OpLabel
OpBranch %174
%176 = OpLabel
OpBranch %169
%174 = OpLabel
%177 = OpLoad %int %index
%178 = OpAccessChain %_ptr_Private_BST %tree_1 %177
%179 = OpLoad %BST %178
OpStore %currentNode %179
%180 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%181 = OpLoad %int %180
%183 = OpLoad %int %target
%184 = OpIEqual %bool %181 %183
OpSelectionMerge %185 None
OpBranchConditional %184 %186 %185
%186 = OpLabel
%188 = OpLoad %int %target
OpReturnValue %188
%185 = OpLabel
%190 = OpLoad %int %target
%191 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%192 = OpLoad %int %191
%193 = OpSGreaterThan %bool %190 %192
OpSelectionMerge %194 None
OpBranchConditional %193 %195 %196
%195 = OpLabel
%197 = OpAccessChain %_ptr_Function_int %currentNode %uint_2
%198 = OpLoad %int %197
OpStore %x_261 %198
OpBranch %194
%196 = OpLabel
%199 = OpAccessChain %_ptr_Function_int %currentNode %uint_1
%200 = OpLoad %int %199
OpStore %x_261 %200
OpBranch %194
%194 = OpLabel
%201 = OpLoad %int %x_261
OpStore %index %201
OpBranch %170
%170 = OpLabel
OpBranch %168
%169 = OpLabel
OpReturnValue %int_n1
OpFunctionEnd
%main_1 = OpFunction %void None %202
%204 = OpLabel
%treeIndex_1 = OpVariable %_ptr_Function_int Function %46
%param_4 = OpVariable %_ptr_Function_BST Function %48
%param_5 = OpVariable %_ptr_Function_int Function %46
%param_6 = OpVariable %_ptr_Function_int Function %46
%param_7 = OpVariable %_ptr_Function_int Function %46
%param_8 = OpVariable %_ptr_Function_int Function %46
%param_9 = OpVariable %_ptr_Function_int Function %46
%param_10 = OpVariable %_ptr_Function_int Function %46
%param_11 = OpVariable %_ptr_Function_int Function %46
%param_12 = OpVariable %_ptr_Function_int Function %46
%param_13 = OpVariable %_ptr_Function_int Function %46
%param_14 = OpVariable %_ptr_Function_int Function %46
%param_15 = OpVariable %_ptr_Function_int Function %46
%param_16 = OpVariable %_ptr_Function_int Function %46
%param_17 = OpVariable %_ptr_Function_int Function %46
%param_18 = OpVariable %_ptr_Function_int Function %46
%param_19 = OpVariable %_ptr_Function_int Function %46
%param_20 = OpVariable %_ptr_Function_int Function %46
%param_21 = OpVariable %_ptr_Function_int Function %46
%param_22 = OpVariable %_ptr_Function_int Function %46
%param_23 = OpVariable %_ptr_Function_int Function %46
%count = OpVariable %_ptr_Function_int Function %46
%i = OpVariable %_ptr_Function_int Function %46
%result = OpVariable %_ptr_Function_int Function %46
%param_24 = OpVariable %_ptr_Function_int Function %46
OpStore %treeIndex_1 %int_0
%230 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
%231 = OpLoad %BST %230
OpStore %param_4 %231
OpStore %param_5 %int_9
%233 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_4 %param_5
%236 = OpLoad %BST %param_4
%237 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
OpStore %237 %236
%238 = OpLoad %int %treeIndex_1
%240 = OpIAdd %int %238 %int_1
OpStore %treeIndex_1 %240
%241 = OpLoad %int %treeIndex_1
OpStore %param_6 %241
OpStore %param_7 %int_5
%243 = OpFunctionCall %void %insert_i1_i1_ %param_6 %param_7
%246 = OpLoad %int %treeIndex_1
%247 = OpIAdd %int %246 %int_1
OpStore %treeIndex_1 %247
%248 = OpLoad %int %treeIndex_1
OpStore %param_8 %248
OpStore %param_9 %int_12
%250 = OpFunctionCall %void %insert_i1_i1_ %param_8 %param_9
%253 = OpLoad %int %treeIndex_1
%254 = OpIAdd %int %253 %int_1
OpStore %treeIndex_1 %254
%255 = OpLoad %int %treeIndex_1
OpStore %param_10 %255
OpStore %param_11 %int_15
%257 = OpFunctionCall %void %insert_i1_i1_ %param_10 %param_11
%260 = OpLoad %int %treeIndex_1
%261 = OpIAdd %int %260 %int_1
OpStore %treeIndex_1 %261
%262 = OpLoad %int %treeIndex_1
OpStore %param_12 %262
OpStore %param_13 %int_7
%264 = OpFunctionCall %void %insert_i1_i1_ %param_12 %param_13
%267 = OpLoad %int %treeIndex_1
%268 = OpIAdd %int %267 %int_1
OpStore %treeIndex_1 %268
%269 = OpLoad %int %treeIndex_1
OpStore %param_14 %269
OpStore %param_15 %int_8
%271 = OpFunctionCall %void %insert_i1_i1_ %param_14 %param_15
%274 = OpLoad %int %treeIndex_1
%275 = OpIAdd %int %274 %int_1
OpStore %treeIndex_1 %275
%276 = OpLoad %int %treeIndex_1
OpStore %param_16 %276
OpStore %param_17 %int_2
%278 = OpFunctionCall %void %insert_i1_i1_ %param_16 %param_17
%281 = OpLoad %int %treeIndex_1
%282 = OpIAdd %int %281 %int_1
OpStore %treeIndex_1 %282
%283 = OpLoad %int %treeIndex_1
OpStore %param_18 %283
OpStore %param_19 %int_6
%285 = OpFunctionCall %void %insert_i1_i1_ %param_18 %param_19
%288 = OpLoad %int %treeIndex_1
%289 = OpIAdd %int %288 %int_1
OpStore %treeIndex_1 %289
%290 = OpLoad %int %treeIndex_1
OpStore %param_20 %290
OpStore %param_21 %int_17
%292 = OpFunctionCall %void %insert_i1_i1_ %param_20 %param_21
%295 = OpLoad %int %treeIndex_1
%296 = OpIAdd %int %295 %int_1
OpStore %treeIndex_1 %296
%297 = OpLoad %int %treeIndex_1
OpStore %param_22 %297
OpStore %param_23 %int_13
%299 = OpFunctionCall %void %insert_i1_i1_ %param_22 %param_23
OpStore %count %int_0
OpStore %i %int_0
OpBranch %302
%302 = OpLabel
OpLoopMerge %303 %304 None
OpBranch %305
%305 = OpLabel
%306 = OpLoad %int %i
%308 = OpSLessThan %bool %306 %int_20
OpSelectionMerge %309 None
OpBranchConditional %308 %310 %311
%310 = OpLabel
OpBranch %309
%311 = OpLabel
OpBranch %303
%309 = OpLabel
%312 = OpLoad %int %i
OpStore %param_24 %312
%313 = OpFunctionCall %int %search_i1_ %param_24
OpStore %result %313
%315 = OpLoad %int %i
OpSelectionMerge %316 None
OpSwitch %315 %317 2 %318 5 %318 6 %318 7 %318 8 %318 9 %318 12 %318 13 %318 15 %318 17 %318
%318 = OpLabel
%319 = OpLoad %int %result
%320 = OpLoad %int %i
%321 = OpIEqual %bool %319 %320
OpSelectionMerge %322 None
OpBranchConditional %321 %323 %322
%323 = OpLabel
%324 = OpLoad %int %count
%325 = OpIAdd %int %324 %int_1
OpStore %count %325
OpBranch %322
%322 = OpLabel
OpBranch %316
%317 = OpLabel
%326 = OpLoad %int %result
%327 = OpIEqual %bool %326 %int_n1
OpSelectionMerge %328 None
OpBranchConditional %327 %329 %328
%329 = OpLabel
%330 = OpLoad %int %count
%331 = OpIAdd %int %330 %int_1
OpStore %count %331
OpBranch %328
%328 = OpLabel
OpBranch %316
%316 = OpLabel
OpBranch %304
%304 = OpLabel
%332 = OpLoad %int %i
%333 = OpIAdd %int %332 %int_1
OpStore %i %333
OpBranch %302
%303 = OpLabel
%334 = OpLoad %int %count
%335 = OpIEqual %bool %334 %int_20
OpSelectionMerge %336 None
OpBranchConditional %335 %337 %338
%337 = OpLabel
OpStore %x_GLF_color %341
OpBranch %336
%338 = OpLabel
OpStore %x_GLF_color %342
OpBranch %336
%336 = OpLabel
OpReturn
OpFunctionEnd
%main_inner = OpFunction %main_out None %343
%346 = OpLabel
%347 = OpFunctionCall %void %main_1
%348 = OpLoad %v4float %x_GLF_color
%349 = OpCompositeConstruct %main_out %348
OpReturnValue %349
OpFunctionEnd
%main = OpFunction %void None %202
%351 = OpLabel
%352 = OpFunctionCall %main_out %main_inner
%353 = OpCompositeExtract %v4float %352 0
OpStore %x_GLF_color_1_1 %353
OpReturn
OpFunctionEnd

View File

@@ -1,293 +0,0 @@
struct BST {
data : i32;
leftIndex : i32;
rightIndex : i32;
};
[[block]]
struct buf0 {
injectionSwitch : vec2<f32>;
};
var<private> tree_1 : array<BST, 10>;
[[group(0), binding(0)]] var<uniform> x_16 : buf0;
var<private> x_GLF_color : vec4<f32>;
fn makeTreeNode_struct_BST_i1_i1_i11_i1_(tree : ptr<function, BST>, data : ptr<function, i32>) {
let x_165 : i32 = *(data);
(*(tree)).data = x_165;
(*(tree)).leftIndex = -1;
(*(tree)).rightIndex = -1;
return;
}
fn insert_i1_i1_(treeIndex : ptr<function, i32>, data_1 : ptr<function, i32>) {
var baseIndex : i32;
var param : BST;
var param_1 : i32;
var x_170 : i32;
var param_2 : BST;
var param_3 : i32;
baseIndex = 0;
loop {
let x_175 : i32 = baseIndex;
let x_176 : i32 = *(treeIndex);
if ((x_175 <= x_176)) {
} else {
break;
}
let x_179 : i32 = *(data_1);
let x_180 : i32 = baseIndex;
let x_182 : i32 = tree_1[x_180].data;
if ((x_179 <= x_182)) {
let x_187 : i32 = baseIndex;
let x_189 : i32 = tree_1[x_187].leftIndex;
if ((x_189 == -1)) {
let x_194 : i32 = baseIndex;
let x_195 : i32 = *(treeIndex);
tree_1[x_194].leftIndex = x_195;
let x_198 : f32 = x_16.injectionSwitch.x;
let x_200 : f32 = x_16.injectionSwitch.y;
if ((x_198 < x_200)) {
let x_204 : i32 = *(treeIndex);
let x_206 : BST = tree_1[x_204];
param = x_206;
let x_207 : i32 = *(data_1);
param_1 = x_207;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param), &(param_1));
let x_209 : BST = param;
tree_1[x_204] = x_209;
}
let x_212 : f32 = x_16.injectionSwitch.x;
let x_214 : f32 = x_16.injectionSwitch.y;
if ((x_212 < x_214)) {
return;
}
} else {
let x_218 : i32 = baseIndex;
let x_220 : i32 = tree_1[x_218].leftIndex;
baseIndex = x_220;
continue;
}
} else {
let x_222 : f32 = x_16.injectionSwitch.x;
let x_224 : f32 = x_16.injectionSwitch.y;
if ((x_222 < x_224)) {
let x_229 : i32 = baseIndex;
let x_231 : i32 = tree_1[x_229].rightIndex;
x_170 = x_231;
} else {
let x_232 : i32 = baseIndex;
let x_234 : i32 = tree_1[x_232].rightIndex;
x_170 = x_234;
}
let x_235 : i32 = x_170;
if ((x_235 == -1)) {
let x_240 : i32 = baseIndex;
let x_241 : i32 = *(treeIndex);
tree_1[x_240].rightIndex = x_241;
let x_243 : i32 = *(treeIndex);
let x_245 : BST = tree_1[x_243];
param_2 = x_245;
let x_246 : i32 = *(data_1);
param_3 = x_246;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_2), &(param_3));
let x_248 : BST = param_2;
tree_1[x_243] = x_248;
return;
} else {
let x_250 : i32 = baseIndex;
let x_252 : i32 = tree_1[x_250].rightIndex;
baseIndex = x_252;
continue;
}
return;
}
let x_254 : f32 = x_16.injectionSwitch.x;
let x_256 : f32 = x_16.injectionSwitch.y;
if ((x_254 > x_256)) {
return;
}
}
return;
}
fn search_i1_(target : ptr<function, i32>) -> i32 {
var index : i32;
var currentNode : BST;
var x_261 : i32;
index = 0;
loop {
let x_266 : i32 = index;
if ((x_266 != -1)) {
} else {
break;
}
let x_269 : i32 = index;
let x_271 : BST = tree_1[x_269];
currentNode = x_271;
let x_273 : i32 = currentNode.data;
let x_274 : i32 = *(target);
if ((x_273 == x_274)) {
let x_278 : i32 = *(target);
return x_278;
}
let x_279 : i32 = *(target);
let x_281 : i32 = currentNode.data;
if ((x_279 > x_281)) {
let x_287 : i32 = currentNode.rightIndex;
x_261 = x_287;
} else {
let x_289 : i32 = currentNode.leftIndex;
x_261 = x_289;
}
let x_290 : i32 = x_261;
index = x_290;
}
return -1;
}
fn main_1() {
var treeIndex_1 : i32;
var param_4 : BST;
var param_5 : i32;
var param_6 : i32;
var param_7 : i32;
var param_8 : i32;
var param_9 : i32;
var param_10 : i32;
var param_11 : i32;
var param_12 : i32;
var param_13 : i32;
var param_14 : i32;
var param_15 : i32;
var param_16 : i32;
var param_17 : i32;
var param_18 : i32;
var param_19 : i32;
var param_20 : i32;
var param_21 : i32;
var param_22 : i32;
var param_23 : i32;
var count : i32;
var i : i32;
var result : i32;
var param_24 : i32;
treeIndex_1 = 0;
let x_91 : BST = tree_1[0];
param_4 = x_91;
param_5 = 9;
makeTreeNode_struct_BST_i1_i1_i11_i1_(&(param_4), &(param_5));
let x_93 : BST = param_4;
tree_1[0] = x_93;
let x_95 : i32 = treeIndex_1;
treeIndex_1 = (x_95 + 1);
let x_97 : i32 = treeIndex_1;
param_6 = x_97;
param_7 = 5;
insert_i1_i1_(&(param_6), &(param_7));
let x_99 : i32 = treeIndex_1;
treeIndex_1 = (x_99 + 1);
let x_101 : i32 = treeIndex_1;
param_8 = x_101;
param_9 = 12;
insert_i1_i1_(&(param_8), &(param_9));
let x_103 : i32 = treeIndex_1;
treeIndex_1 = (x_103 + 1);
let x_105 : i32 = treeIndex_1;
param_10 = x_105;
param_11 = 15;
insert_i1_i1_(&(param_10), &(param_11));
let x_107 : i32 = treeIndex_1;
treeIndex_1 = (x_107 + 1);
let x_109 : i32 = treeIndex_1;
param_12 = x_109;
param_13 = 7;
insert_i1_i1_(&(param_12), &(param_13));
let x_111 : i32 = treeIndex_1;
treeIndex_1 = (x_111 + 1);
let x_113 : i32 = treeIndex_1;
param_14 = x_113;
param_15 = 8;
insert_i1_i1_(&(param_14), &(param_15));
let x_115 : i32 = treeIndex_1;
treeIndex_1 = (x_115 + 1);
let x_117 : i32 = treeIndex_1;
param_16 = x_117;
param_17 = 2;
insert_i1_i1_(&(param_16), &(param_17));
let x_119 : i32 = treeIndex_1;
treeIndex_1 = (x_119 + 1);
let x_121 : i32 = treeIndex_1;
param_18 = x_121;
param_19 = 6;
insert_i1_i1_(&(param_18), &(param_19));
let x_123 : i32 = treeIndex_1;
treeIndex_1 = (x_123 + 1);
let x_125 : i32 = treeIndex_1;
param_20 = x_125;
param_21 = 17;
insert_i1_i1_(&(param_20), &(param_21));
let x_127 : i32 = treeIndex_1;
treeIndex_1 = (x_127 + 1);
let x_129 : i32 = treeIndex_1;
param_22 = x_129;
param_23 = 13;
insert_i1_i1_(&(param_22), &(param_23));
count = 0;
i = 0;
loop {
let x_135 : i32 = i;
if ((x_135 < 20)) {
} else {
break;
}
let x_138 : i32 = i;
param_24 = x_138;
let x_139 : i32 = search_i1_(&(param_24));
result = x_139;
let x_140 : i32 = i;
switch(x_140) {
case 2, 5, 6, 7, 8, 9, 12, 13, 15, 17: {
let x_150 : i32 = result;
let x_151 : i32 = i;
if ((x_150 == x_151)) {
let x_155 : i32 = count;
count = (x_155 + 1);
}
}
default: {
let x_144 : i32 = result;
if ((x_144 == -1)) {
let x_148 : i32 = count;
count = (x_148 + 1);
}
}
}
continuing {
let x_157 : i32 = i;
i = (x_157 + 1);
}
}
let x_159 : i32 = count;
if ((x_159 == 20)) {
x_GLF_color = vec4<f32>(1.0, 0.0, 0.0, 1.0);
} else {
x_GLF_color = vec4<f32>(0.0, 0.0, 1.0, 1.0);
}
return;
}
struct main_out {
[[location(0)]]
x_GLF_color_1 : vec4<f32>;
};
[[stage(fragment)]]
fn main() -> main_out {
main_1();
return main_out(x_GLF_color);
}