blob: 68b226ddeec6715ff1b076220f221dcad2d33447 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 316
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol_1
OpExecutionMode %main OriginUpperLeft
OpName %BST "BST"
OpMemberName %BST 0 "data"
OpMemberName %BST 1 "leftIndex"
OpMemberName %BST 2 "rightIndex"
OpName %tree "tree"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol_1 "tint_symbol_1"
OpName %makeTreeNode_struct_BST_i1_i1_i11_i1_ "makeTreeNode_struct_BST_i1_i1_i11_i1_"
OpName %node "node"
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 %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_220 "x_220"
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 %tint_symbol_2 "tint_symbol_2"
OpName %tint_symbol "tint_symbol"
OpName %main "main"
OpMemberDecorate %BST 0 Offset 0
OpMemberDecorate %BST 1 Offset 4
OpMemberDecorate %BST 2 Offset 8
OpDecorate %_arr_BST_uint_10 ArrayStride 12
OpDecorate %tint_symbol_1 Location 0
OpMemberDecorate %main_out 0 Offset 0
%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
%8 = OpConstantNull %_arr_BST_uint_10
%tree = OpVariable %_ptr_Private__arr_BST_uint_10 Private %8
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%13 = OpConstantNull %v4float
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %13
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_1 = OpVariable %_ptr_Output_v4float Output %13
%void = OpTypeVoid
%_ptr_Function_BST = OpTypePointer Function %BST
%_ptr_Function_int = OpTypePointer Function %int
%16 = 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
%36 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
%42 = OpConstantNull %int
%44 = OpConstantNull %BST
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%_ptr_Private_BST = OpTypePointer Private %BST
%122 = OpTypeFunction %int %_ptr_Function_int
%163 = 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
%302 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%303 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%main_out = OpTypeStruct %v4float
%304 = OpTypeFunction %void %main_out
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = OpFunction %void None %16
%node = OpFunctionParameter %_ptr_Function_BST
%data = OpFunctionParameter %_ptr_Function_int
%23 = OpLabel
%25 = OpLoad %int %data
%28 = OpAccessChain %_ptr_Function_int %node %uint_0
OpStore %28 %25
%31 = OpAccessChain %_ptr_Function_int %node %uint_1
OpStore %31 %int_n1
%35 = OpAccessChain %_ptr_Function_int %node %uint_2
OpStore %35 %int_n1
OpReturn
OpFunctionEnd
%insert_i1_i1_ = OpFunction %void None %36
%treeIndex = OpFunctionParameter %_ptr_Function_int
%data_1 = OpFunctionParameter %_ptr_Function_int
%40 = OpLabel
%baseIndex = OpVariable %_ptr_Function_int Function %42
%param = OpVariable %_ptr_Function_BST Function %44
%param_1 = OpVariable %_ptr_Function_int Function %42
%param_2 = OpVariable %_ptr_Function_BST Function %44
%param_3 = OpVariable %_ptr_Function_int Function %42
OpStore %baseIndex %int_0
OpBranch %49
%49 = OpLabel
OpLoopMerge %50 %51 None
OpBranch %52
%52 = OpLabel
%53 = OpLoad %int %baseIndex
%55 = OpLoad %int %treeIndex
%56 = OpSLessThanEqual %bool %53 %55
OpSelectionMerge %58 None
OpBranchConditional %56 %59 %60
%59 = OpLabel
OpBranch %58
%60 = OpLabel
OpBranch %50
%58 = OpLabel
%62 = OpLoad %int %data_1
%63 = OpLoad %int %baseIndex
%65 = OpAccessChain %_ptr_Private_int %tree %63 %uint_0
%66 = OpLoad %int %65
%67 = OpSLessThanEqual %bool %62 %66
OpSelectionMerge %68 None
OpBranchConditional %67 %69 %70
%69 = OpLabel
%71 = OpLoad %int %baseIndex
%72 = OpAccessChain %_ptr_Private_int %tree %71 %uint_1
%73 = OpLoad %int %72
%74 = OpIEqual %bool %73 %int_n1
OpSelectionMerge %75 None
OpBranchConditional %74 %76 %77
%76 = OpLabel
%78 = OpLoad %int %baseIndex
%80 = OpLoad %int %treeIndex
%81 = OpAccessChain %_ptr_Private_int %tree %78 %uint_1
OpStore %81 %80
%83 = OpLoad %int %treeIndex
%85 = OpAccessChain %_ptr_Private_BST %tree %83
%86 = OpLoad %BST %85
OpStore %param %86
%88 = OpLoad %int %data_1
OpStore %param_1 %88
%89 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param %param_1
%92 = OpLoad %BST %param
%93 = OpAccessChain %_ptr_Private_BST %tree %83
OpStore %93 %92
OpReturn
%77 = OpLabel
%94 = OpLoad %int %baseIndex
%95 = OpAccessChain %_ptr_Private_int %tree %94 %uint_1
%96 = OpLoad %int %95
OpStore %baseIndex %96
OpBranch %51
%75 = OpLabel
OpReturn
%70 = OpLabel
%97 = OpLoad %int %baseIndex
%98 = OpAccessChain %_ptr_Private_int %tree %97 %uint_2
%99 = OpLoad %int %98
%100 = OpIEqual %bool %99 %int_n1
OpSelectionMerge %101 None
OpBranchConditional %100 %102 %103
%102 = OpLabel
%104 = OpLoad %int %baseIndex
%106 = OpLoad %int %treeIndex
%107 = OpAccessChain %_ptr_Private_int %tree %104 %uint_2
OpStore %107 %106
%109 = OpLoad %int %treeIndex
%110 = OpAccessChain %_ptr_Private_BST %tree %109
%111 = OpLoad %BST %110
OpStore %param_2 %111
%113 = OpLoad %int %data_1
OpStore %param_3 %113
%114 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_2 %param_3
%117 = OpLoad %BST %param_2
%118 = OpAccessChain %_ptr_Private_BST %tree %109
OpStore %118 %117
OpReturn
%103 = OpLabel
%119 = OpLoad %int %baseIndex
%120 = OpAccessChain %_ptr_Private_int %tree %119 %uint_2
%121 = OpLoad %int %120
OpStore %baseIndex %121
OpBranch %51
%101 = OpLabel
OpReturn
%68 = OpLabel
OpReturn
%51 = OpLabel
OpBranch %49
%50 = OpLabel
OpReturn
OpFunctionEnd
%search_i1_ = OpFunction %int None %122
%target = OpFunctionParameter %_ptr_Function_int
%125 = OpLabel
%index = OpVariable %_ptr_Function_int Function %42
%currentNode = OpVariable %_ptr_Function_BST Function %44
%x_220 = OpVariable %_ptr_Function_int Function %42
OpStore %index %int_0
OpBranch %129
%129 = OpLabel
OpLoopMerge %130 %131 None
OpBranch %132
%132 = OpLabel
%133 = OpLoad %int %index
%134 = OpINotEqual %bool %133 %int_n1
OpSelectionMerge %135 None
OpBranchConditional %134 %136 %137
%136 = OpLabel
OpBranch %135
%137 = OpLabel
OpBranch %130
%135 = OpLabel
%138 = OpLoad %int %index
%139 = OpAccessChain %_ptr_Private_BST %tree %138
%140 = OpLoad %BST %139
OpStore %currentNode %140
%141 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%142 = OpLoad %int %141
%144 = OpLoad %int %target
%145 = OpIEqual %bool %142 %144
OpSelectionMerge %146 None
OpBranchConditional %145 %147 %146
%147 = OpLabel
%149 = OpLoad %int %target
OpReturnValue %149
%146 = OpLabel
%151 = OpLoad %int %target
%152 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%153 = OpLoad %int %152
%154 = OpSGreaterThan %bool %151 %153
OpSelectionMerge %155 None
OpBranchConditional %154 %156 %157
%156 = OpLabel
%158 = OpAccessChain %_ptr_Function_int %currentNode %uint_2
%159 = OpLoad %int %158
OpStore %x_220 %159
OpBranch %155
%157 = OpLabel
%160 = OpAccessChain %_ptr_Function_int %currentNode %uint_1
%161 = OpLoad %int %160
OpStore %x_220 %161
OpBranch %155
%155 = OpLabel
%162 = OpLoad %int %x_220
OpStore %index %162
OpBranch %131
%131 = OpLabel
OpBranch %129
%130 = OpLabel
OpReturnValue %int_n1
OpFunctionEnd
%main_1 = OpFunction %void None %163
%165 = OpLabel
%treeIndex_1 = OpVariable %_ptr_Function_int Function %42
%param_4 = OpVariable %_ptr_Function_BST Function %44
%param_5 = OpVariable %_ptr_Function_int Function %42
%param_6 = OpVariable %_ptr_Function_int Function %42
%param_7 = OpVariable %_ptr_Function_int Function %42
%param_8 = OpVariable %_ptr_Function_int Function %42
%param_9 = OpVariable %_ptr_Function_int Function %42
%param_10 = OpVariable %_ptr_Function_int Function %42
%param_11 = OpVariable %_ptr_Function_int Function %42
%param_12 = OpVariable %_ptr_Function_int Function %42
%param_13 = OpVariable %_ptr_Function_int Function %42
%param_14 = OpVariable %_ptr_Function_int Function %42
%param_15 = OpVariable %_ptr_Function_int Function %42
%param_16 = OpVariable %_ptr_Function_int Function %42
%param_17 = OpVariable %_ptr_Function_int Function %42
%param_18 = OpVariable %_ptr_Function_int Function %42
%param_19 = OpVariable %_ptr_Function_int Function %42
%param_20 = OpVariable %_ptr_Function_int Function %42
%param_21 = OpVariable %_ptr_Function_int Function %42
%param_22 = OpVariable %_ptr_Function_int Function %42
%param_23 = OpVariable %_ptr_Function_int Function %42
%count = OpVariable %_ptr_Function_int Function %42
%i = OpVariable %_ptr_Function_int Function %42
%result = OpVariable %_ptr_Function_int Function %42
%param_24 = OpVariable %_ptr_Function_int Function %42
OpStore %treeIndex_1 %int_0
%191 = OpAccessChain %_ptr_Private_BST %tree %int_0
%192 = OpLoad %BST %191
OpStore %param_4 %192
OpStore %param_5 %int_9
%194 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_4 %param_5
%197 = OpLoad %BST %param_4
%198 = OpAccessChain %_ptr_Private_BST %tree %int_0
OpStore %198 %197
%199 = OpLoad %int %treeIndex_1
%201 = OpIAdd %int %199 %int_1
OpStore %treeIndex_1 %201
%202 = OpLoad %int %treeIndex_1
OpStore %param_6 %202
OpStore %param_7 %int_5
%204 = OpFunctionCall %void %insert_i1_i1_ %param_6 %param_7
%207 = OpLoad %int %treeIndex_1
%208 = OpIAdd %int %207 %int_1
OpStore %treeIndex_1 %208
%209 = OpLoad %int %treeIndex_1
OpStore %param_8 %209
OpStore %param_9 %int_12
%211 = OpFunctionCall %void %insert_i1_i1_ %param_8 %param_9
%214 = OpLoad %int %treeIndex_1
%215 = OpIAdd %int %214 %int_1
OpStore %treeIndex_1 %215
%216 = OpLoad %int %treeIndex_1
OpStore %param_10 %216
OpStore %param_11 %int_15
%218 = OpFunctionCall %void %insert_i1_i1_ %param_10 %param_11
%221 = OpLoad %int %treeIndex_1
%222 = OpIAdd %int %221 %int_1
OpStore %treeIndex_1 %222
%223 = OpLoad %int %treeIndex_1
OpStore %param_12 %223
OpStore %param_13 %int_7
%225 = OpFunctionCall %void %insert_i1_i1_ %param_12 %param_13
%228 = OpLoad %int %treeIndex_1
%229 = OpIAdd %int %228 %int_1
OpStore %treeIndex_1 %229
%230 = OpLoad %int %treeIndex_1
OpStore %param_14 %230
OpStore %param_15 %int_8
%232 = OpFunctionCall %void %insert_i1_i1_ %param_14 %param_15
%235 = OpLoad %int %treeIndex_1
%236 = OpIAdd %int %235 %int_1
OpStore %treeIndex_1 %236
%237 = OpLoad %int %treeIndex_1
OpStore %param_16 %237
OpStore %param_17 %int_2
%239 = OpFunctionCall %void %insert_i1_i1_ %param_16 %param_17
%242 = OpLoad %int %treeIndex_1
%243 = OpIAdd %int %242 %int_1
OpStore %treeIndex_1 %243
%244 = OpLoad %int %treeIndex_1
OpStore %param_18 %244
OpStore %param_19 %int_6
%246 = OpFunctionCall %void %insert_i1_i1_ %param_18 %param_19
%249 = OpLoad %int %treeIndex_1
%250 = OpIAdd %int %249 %int_1
OpStore %treeIndex_1 %250
%251 = OpLoad %int %treeIndex_1
OpStore %param_20 %251
OpStore %param_21 %int_17
%253 = OpFunctionCall %void %insert_i1_i1_ %param_20 %param_21
%256 = OpLoad %int %treeIndex_1
%257 = OpIAdd %int %256 %int_1
OpStore %treeIndex_1 %257
%258 = OpLoad %int %treeIndex_1
OpStore %param_22 %258
OpStore %param_23 %int_13
%260 = OpFunctionCall %void %insert_i1_i1_ %param_22 %param_23
OpStore %count %int_0
OpStore %i %int_0
OpBranch %263
%263 = OpLabel
OpLoopMerge %264 %265 None
OpBranch %266
%266 = OpLabel
%267 = OpLoad %int %i
%269 = OpSLessThan %bool %267 %int_20
OpSelectionMerge %270 None
OpBranchConditional %269 %271 %272
%271 = OpLabel
OpBranch %270
%272 = OpLabel
OpBranch %264
%270 = OpLabel
%273 = OpLoad %int %i
OpStore %param_24 %273
%274 = OpFunctionCall %int %search_i1_ %param_24
OpStore %result %274
%276 = OpLoad %int %i
OpSelectionMerge %277 None
OpSwitch %276 %278 2 %279 5 %279 6 %279 7 %279 8 %279 9 %279 12 %279 13 %279 15 %279 17 %279
%279 = OpLabel
%280 = OpLoad %int %result
%281 = OpLoad %int %i
%282 = OpIEqual %bool %280 %281
OpSelectionMerge %283 None
OpBranchConditional %282 %284 %283
%284 = OpLabel
%285 = OpLoad %int %count
%286 = OpIAdd %int %285 %int_1
OpStore %count %286
OpBranch %283
%283 = OpLabel
OpBranch %277
%278 = OpLabel
%287 = OpLoad %int %result
%288 = OpIEqual %bool %287 %int_n1
OpSelectionMerge %289 None
OpBranchConditional %288 %290 %289
%290 = OpLabel
%291 = OpLoad %int %count
%292 = OpIAdd %int %291 %int_1
OpStore %count %292
OpBranch %289
%289 = OpLabel
OpBranch %277
%277 = OpLabel
OpBranch %265
%265 = OpLabel
%293 = OpLoad %int %i
%294 = OpIAdd %int %293 %int_1
OpStore %i %294
OpBranch %263
%264 = OpLabel
%295 = OpLoad %int %count
%296 = OpIEqual %bool %295 %int_20
OpSelectionMerge %297 None
OpBranchConditional %296 %298 %299
%298 = OpLabel
OpStore %x_GLF_color %302
OpBranch %297
%299 = OpLabel
OpStore %x_GLF_color %303
OpBranch %297
%297 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_2 = OpFunction %void None %304
%tint_symbol = OpFunctionParameter %main_out
%308 = OpLabel
%309 = OpCompositeExtract %v4float %tint_symbol 0
OpStore %tint_symbol_1 %309
OpReturn
OpFunctionEnd
%main = OpFunction %void None %163
%311 = OpLabel
%312 = OpFunctionCall %void %main_1
%314 = OpLoad %v4float %x_GLF_color
%315 = OpCompositeConstruct %main_out %314
%313 = OpFunctionCall %void %tint_symbol_2 %315
OpReturn
OpFunctionEnd