blob: b62cb2f27c2a6cdf3e8c87a05edf7eb1265ad543 [file] [log] [blame]
; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 333
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %BST "BST"
OpMemberName %BST 0 "data"
OpMemberName %BST 1 "leftIndex"
OpMemberName %BST 2 "rightIndex"
OpName %tree_1 "tree_1"
OpName %gl_FragCoord "gl_FragCoord"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
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 %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_231 "x_231"
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 %x_155 "x_155"
OpName %x_156_phi "x_156_phi"
OpName %main_out "main_out"
OpMemberName %main_out 0 "x_GLF_color_1"
OpName %tint_symbol_3 "tint_symbol_3"
OpName %tint_symbol_1 "tint_symbol_1"
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 BuiltIn FragCoord
OpDecorate %tint_symbol_2 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_1 = 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
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %13
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %13
%_ptr_Input_v4float = OpTypePointer Input %v4float
%tint_symbol = OpVariable %_ptr_Input_v4float Input
%_ptr_Output_v4float = OpTypePointer Output %v4float
%tint_symbol_2 = OpVariable %_ptr_Output_v4float Output %13
%void = OpTypeVoid
%_ptr_Function_BST = OpTypePointer Function %BST
%_ptr_Function_int = OpTypePointer Function %int
%19 = 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
%39 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
%45 = OpConstantNull %int
%47 = OpConstantNull %BST
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%_ptr_Private_BST = OpTypePointer Private %BST
%125 = OpTypeFunction %int %_ptr_Function_int
%166 = 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
%_ptr_Function_bool = OpTypePointer Function %bool
%278 = OpConstantNull %bool
%_ptr_Private_float = OpTypePointer Private %float
%float_0 = OpConstant %float 0
%float_1 = OpConstant %float 1
%318 = OpConstantComposite %v4float %float_1 %float_0 %float_0 %float_1
%319 = OpConstantComposite %v4float %float_0 %float_0 %float_1 %float_1
%main_out = OpTypeStruct %v4float
%320 = OpTypeFunction %void %main_out
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = OpFunction %void None %19
%tree = OpFunctionParameter %_ptr_Function_BST
%data = OpFunctionParameter %_ptr_Function_int
%26 = OpLabel
%28 = OpLoad %int %data
%31 = OpAccessChain %_ptr_Function_int %tree %uint_0
OpStore %31 %28
%34 = OpAccessChain %_ptr_Function_int %tree %uint_1
OpStore %34 %int_n1
%38 = OpAccessChain %_ptr_Function_int %tree %uint_2
OpStore %38 %int_n1
OpReturn
OpFunctionEnd
%insert_i1_i1_ = OpFunction %void None %39
%treeIndex = OpFunctionParameter %_ptr_Function_int
%data_1 = OpFunctionParameter %_ptr_Function_int
%43 = OpLabel
%baseIndex = OpVariable %_ptr_Function_int Function %45
%param = OpVariable %_ptr_Function_BST Function %47
%param_1 = OpVariable %_ptr_Function_int Function %45
%param_2 = OpVariable %_ptr_Function_BST Function %47
%param_3 = OpVariable %_ptr_Function_int Function %45
OpStore %baseIndex %int_0
OpBranch %52
%52 = OpLabel
OpLoopMerge %53 %54 None
OpBranch %55
%55 = OpLabel
%56 = OpLoad %int %baseIndex
%58 = OpLoad %int %treeIndex
%59 = OpSLessThanEqual %bool %56 %58
OpSelectionMerge %61 None
OpBranchConditional %59 %62 %63
%62 = OpLabel
OpBranch %61
%63 = OpLabel
OpBranch %53
%61 = OpLabel
%65 = OpLoad %int %data_1
%66 = OpLoad %int %baseIndex
%68 = OpAccessChain %_ptr_Private_int %tree_1 %66 %uint_0
%69 = OpLoad %int %68
%70 = OpSLessThanEqual %bool %65 %69
OpSelectionMerge %71 None
OpBranchConditional %70 %72 %73
%72 = OpLabel
%74 = OpLoad %int %baseIndex
%75 = OpAccessChain %_ptr_Private_int %tree_1 %74 %uint_1
%76 = OpLoad %int %75
%77 = OpIEqual %bool %76 %int_n1
OpSelectionMerge %78 None
OpBranchConditional %77 %79 %80
%79 = OpLabel
%81 = OpLoad %int %baseIndex
%83 = OpLoad %int %treeIndex
%84 = OpAccessChain %_ptr_Private_int %tree_1 %81 %uint_1
OpStore %84 %83
%86 = OpLoad %int %treeIndex
%88 = OpAccessChain %_ptr_Private_BST %tree_1 %86
%89 = OpLoad %BST %88
OpStore %param %89
%91 = OpLoad %int %data_1
OpStore %param_1 %91
%92 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param %param_1
%95 = OpLoad %BST %param
%96 = OpAccessChain %_ptr_Private_BST %tree_1 %86
OpStore %96 %95
OpReturn
%80 = OpLabel
%97 = OpLoad %int %baseIndex
%98 = OpAccessChain %_ptr_Private_int %tree_1 %97 %uint_1
%99 = OpLoad %int %98
OpStore %baseIndex %99
OpBranch %54
%78 = OpLabel
OpReturn
%73 = OpLabel
%100 = OpLoad %int %baseIndex
%101 = OpAccessChain %_ptr_Private_int %tree_1 %100 %uint_2
%102 = OpLoad %int %101
%103 = OpIEqual %bool %102 %int_n1
OpSelectionMerge %104 None
OpBranchConditional %103 %105 %106
%105 = OpLabel
%107 = OpLoad %int %baseIndex
%109 = OpLoad %int %treeIndex
%110 = OpAccessChain %_ptr_Private_int %tree_1 %107 %uint_2
OpStore %110 %109
%112 = OpLoad %int %treeIndex
%113 = OpAccessChain %_ptr_Private_BST %tree_1 %112
%114 = OpLoad %BST %113
OpStore %param_2 %114
%116 = OpLoad %int %data_1
OpStore %param_3 %116
%117 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_2 %param_3
%120 = OpLoad %BST %param_2
%121 = OpAccessChain %_ptr_Private_BST %tree_1 %112
OpStore %121 %120
OpReturn
%106 = OpLabel
%122 = OpLoad %int %baseIndex
%123 = OpAccessChain %_ptr_Private_int %tree_1 %122 %uint_2
%124 = OpLoad %int %123
OpStore %baseIndex %124
OpBranch %54
%104 = OpLabel
OpReturn
%71 = OpLabel
OpReturn
%54 = OpLabel
OpBranch %52
%53 = OpLabel
OpReturn
OpFunctionEnd
%search_i1_ = OpFunction %int None %125
%target = OpFunctionParameter %_ptr_Function_int
%128 = OpLabel
%index = OpVariable %_ptr_Function_int Function %45
%currentNode = OpVariable %_ptr_Function_BST Function %47
%x_231 = OpVariable %_ptr_Function_int Function %45
OpStore %index %int_0
OpBranch %132
%132 = OpLabel
OpLoopMerge %133 %134 None
OpBranch %135
%135 = OpLabel
%136 = OpLoad %int %index
%137 = OpINotEqual %bool %136 %int_n1
OpSelectionMerge %138 None
OpBranchConditional %137 %139 %140
%139 = OpLabel
OpBranch %138
%140 = OpLabel
OpBranch %133
%138 = OpLabel
%141 = OpLoad %int %index
%142 = OpAccessChain %_ptr_Private_BST %tree_1 %141
%143 = OpLoad %BST %142
OpStore %currentNode %143
%144 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%145 = OpLoad %int %144
%147 = OpLoad %int %target
%148 = OpIEqual %bool %145 %147
OpSelectionMerge %149 None
OpBranchConditional %148 %150 %149
%150 = OpLabel
%152 = OpLoad %int %target
OpReturnValue %152
%149 = OpLabel
%154 = OpLoad %int %target
%155 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%156 = OpLoad %int %155
%157 = OpSGreaterThan %bool %154 %156
OpSelectionMerge %158 None
OpBranchConditional %157 %159 %160
%159 = OpLabel
%161 = OpAccessChain %_ptr_Function_int %currentNode %uint_2
%162 = OpLoad %int %161
OpStore %x_231 %162
OpBranch %158
%160 = OpLabel
%163 = OpAccessChain %_ptr_Function_int %currentNode %uint_1
%164 = OpLoad %int %163
OpStore %x_231 %164
OpBranch %158
%158 = OpLabel
%165 = OpLoad %int %x_231
OpStore %index %165
OpBranch %134
%134 = OpLabel
OpBranch %132
%133 = OpLabel
OpReturnValue %int_n1
OpFunctionEnd
%main_1 = OpFunction %void None %166
%168 = OpLabel
%treeIndex_1 = OpVariable %_ptr_Function_int Function %45
%param_4 = OpVariable %_ptr_Function_BST Function %47
%param_5 = OpVariable %_ptr_Function_int Function %45
%param_6 = OpVariable %_ptr_Function_int Function %45
%param_7 = OpVariable %_ptr_Function_int Function %45
%param_8 = OpVariable %_ptr_Function_int Function %45
%param_9 = OpVariable %_ptr_Function_int Function %45
%param_10 = OpVariable %_ptr_Function_int Function %45
%param_11 = OpVariable %_ptr_Function_int Function %45
%param_12 = OpVariable %_ptr_Function_int Function %45
%param_13 = OpVariable %_ptr_Function_int Function %45
%param_14 = OpVariable %_ptr_Function_int Function %45
%param_15 = OpVariable %_ptr_Function_int Function %45
%param_16 = OpVariable %_ptr_Function_int Function %45
%param_17 = OpVariable %_ptr_Function_int Function %45
%param_18 = OpVariable %_ptr_Function_int Function %45
%param_19 = OpVariable %_ptr_Function_int Function %45
%param_20 = OpVariable %_ptr_Function_int Function %45
%param_21 = OpVariable %_ptr_Function_int Function %45
%param_22 = OpVariable %_ptr_Function_int Function %45
%param_23 = OpVariable %_ptr_Function_int Function %45
%count = OpVariable %_ptr_Function_int Function %45
%i = OpVariable %_ptr_Function_int Function %45
%result = OpVariable %_ptr_Function_int Function %45
%param_24 = OpVariable %_ptr_Function_int Function %45
%x_155 = OpVariable %_ptr_Function_bool Function %278
%x_156_phi = OpVariable %_ptr_Function_bool Function %278
OpStore %treeIndex_1 %int_0
%194 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
%195 = OpLoad %BST %194
OpStore %param_4 %195
OpStore %param_5 %int_9
%197 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_4 %param_5
%200 = OpLoad %BST %param_4
%201 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
OpStore %201 %200
%202 = OpLoad %int %treeIndex_1
%204 = OpIAdd %int %202 %int_1
OpStore %treeIndex_1 %204
%205 = OpLoad %int %treeIndex_1
OpStore %param_6 %205
OpStore %param_7 %int_5
%207 = OpFunctionCall %void %insert_i1_i1_ %param_6 %param_7
%210 = OpLoad %int %treeIndex_1
%211 = OpIAdd %int %210 %int_1
OpStore %treeIndex_1 %211
%212 = OpLoad %int %treeIndex_1
OpStore %param_8 %212
OpStore %param_9 %int_12
%214 = OpFunctionCall %void %insert_i1_i1_ %param_8 %param_9
%217 = OpLoad %int %treeIndex_1
%218 = OpIAdd %int %217 %int_1
OpStore %treeIndex_1 %218
%219 = OpLoad %int %treeIndex_1
OpStore %param_10 %219
OpStore %param_11 %int_15
%221 = OpFunctionCall %void %insert_i1_i1_ %param_10 %param_11
%224 = OpLoad %int %treeIndex_1
%225 = OpIAdd %int %224 %int_1
OpStore %treeIndex_1 %225
%226 = OpLoad %int %treeIndex_1
OpStore %param_12 %226
OpStore %param_13 %int_7
%228 = OpFunctionCall %void %insert_i1_i1_ %param_12 %param_13
%231 = OpLoad %int %treeIndex_1
%232 = OpIAdd %int %231 %int_1
OpStore %treeIndex_1 %232
%233 = OpLoad %int %treeIndex_1
OpStore %param_14 %233
OpStore %param_15 %int_8
%235 = OpFunctionCall %void %insert_i1_i1_ %param_14 %param_15
%238 = OpLoad %int %treeIndex_1
%239 = OpIAdd %int %238 %int_1
OpStore %treeIndex_1 %239
%240 = OpLoad %int %treeIndex_1
OpStore %param_16 %240
OpStore %param_17 %int_2
%242 = OpFunctionCall %void %insert_i1_i1_ %param_16 %param_17
%245 = OpLoad %int %treeIndex_1
%246 = OpIAdd %int %245 %int_1
OpStore %treeIndex_1 %246
%247 = OpLoad %int %treeIndex_1
OpStore %param_18 %247
OpStore %param_19 %int_6
%249 = OpFunctionCall %void %insert_i1_i1_ %param_18 %param_19
%252 = OpLoad %int %treeIndex_1
%253 = OpIAdd %int %252 %int_1
OpStore %treeIndex_1 %253
%254 = OpLoad %int %treeIndex_1
OpStore %param_20 %254
OpStore %param_21 %int_17
%256 = OpFunctionCall %void %insert_i1_i1_ %param_20 %param_21
%259 = OpLoad %int %treeIndex_1
%260 = OpIAdd %int %259 %int_1
OpStore %treeIndex_1 %260
%261 = OpLoad %int %treeIndex_1
OpStore %param_22 %261
OpStore %param_23 %int_13
%263 = OpFunctionCall %void %insert_i1_i1_ %param_22 %param_23
OpStore %count %int_0
OpStore %i %int_0
OpBranch %266
%266 = OpLabel
OpLoopMerge %267 %268 None
OpBranch %269
%269 = OpLabel
%270 = OpLoad %int %i
%272 = OpSLessThan %bool %270 %int_20
OpSelectionMerge %273 None
OpBranchConditional %272 %274 %275
%274 = OpLabel
OpBranch %273
%275 = OpLabel
OpBranch %267
%273 = OpLabel
%280 = OpLoad %int %i
OpStore %param_24 %280
%281 = OpFunctionCall %int %search_i1_ %param_24
OpStore %result %281
%283 = OpLoad %int %i
OpSelectionMerge %284 None
OpSwitch %283 %285 2 %286 5 %286 6 %286 7 %286 8 %286 9 %286 12 %286 13 %286 15 %286 17 %286
%286 = OpLabel
%287 = OpLoad %int %result
%288 = OpLoad %int %i
%289 = OpIEqual %bool %287 %288
OpStore %x_156_phi %289
%290 = OpLogicalNot %bool %289
OpSelectionMerge %291 None
OpBranchConditional %290 %292 %291
%292 = OpLabel
%294 = OpAccessChain %_ptr_Private_float %gl_FragCoord %uint_0
%295 = OpLoad %float %294
%297 = OpFOrdLessThan %bool %295 %float_0
OpStore %x_155 %297
%298 = OpLoad %bool %x_155
OpStore %x_156_phi %298
OpBranch %291
%291 = OpLabel
%299 = OpLoad %bool %x_156_phi
OpSelectionMerge %300 None
OpBranchConditional %299 %301 %300
%301 = OpLabel
%302 = OpLoad %int %count
%303 = OpIAdd %int %302 %int_1
OpStore %count %303
OpBranch %300
%300 = OpLabel
OpBranch %284
%285 = OpLabel
%304 = OpLoad %int %result
%305 = OpIEqual %bool %304 %int_n1
OpSelectionMerge %306 None
OpBranchConditional %305 %307 %306
%307 = OpLabel
%308 = OpLoad %int %count
%309 = OpIAdd %int %308 %int_1
OpStore %count %309
OpBranch %306
%306 = OpLabel
OpBranch %284
%284 = OpLabel
OpBranch %268
%268 = OpLabel
%310 = OpLoad %int %i
%311 = OpIAdd %int %310 %int_1
OpStore %i %311
OpBranch %266
%267 = OpLabel
%312 = OpLoad %int %count
%313 = OpIEqual %bool %312 %int_20
OpSelectionMerge %314 None
OpBranchConditional %313 %315 %316
%315 = OpLabel
OpStore %x_GLF_color %318
OpBranch %314
%316 = OpLabel
OpStore %x_GLF_color %319
OpBranch %314
%314 = OpLabel
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %320
%tint_symbol_1 = OpFunctionParameter %main_out
%324 = OpLabel
%325 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %325
OpReturn
OpFunctionEnd
%main = OpFunction %void None %166
%327 = OpLabel
%328 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %328
%329 = OpFunctionCall %void %main_1
%331 = OpLoad %v4float %x_GLF_color
%332 = OpCompositeConstruct %main_out %331
%330 = OpFunctionCall %void %tint_symbol_3 %332
OpReturn
OpFunctionEnd