David Neto dffa60ca98 spir-writer: handle break continuing block
The continuing block can exit the loop in very constrained ways:

When a break statement is placed such that it would exit from a loop’s
§ 7.3.8 Continuing Statement, then:

   - The break statement must appear as either:
     - The only statement in the if clause of an if statement that has:
       - no else clause or an empty else clause
       - no elseif clauses
     - The only statement in the else clause of an if statement that has an
       empty if clause and no elseif clauses.
   - That if statement must appear last in the continuing clause.

By design, this allows a lossless round-trip from SPIR-V to WGSL and
back to SPIR-V.  But that requires this special case construct in WGSL
to be translated to an OpBranchConditional with one target being
the loop's megre block (which is where 'break' branches to), and the
other targets the loop header (which is the loop backedge).  That
OpBranchConditional takes the place of the normal case of an
unconditional backedge.

Avoids errors like this:
 continue construct with the continue target X is not
 post dominated by the back-edge block Y

Fixed: 1034
Change-Id: If472a179380b8d77af746a3cd8e279c8a5e56b37
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59800
Auto-Submit: David Neto <dneto@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: David Neto <dneto@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-07-27 15:12:27 +00:00

804 lines
33 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 533
; 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 %buf0 "buf0"
OpMemberName %buf0 0 "injectionSwitch"
OpName %x_27 "x_27"
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 %GLF_live8i "GLF_live8i"
OpName %GLF_live8A "GLF_live8A"
OpName %search_i1_ "search_i1_"
OpName %target "target"
OpName %index "index"
OpName %currentNode "currentNode"
OpName %x_387 "x_387"
OpName %makeFrame_f1_ "makeFrame_f1_"
OpName %v "v"
OpName %param_5 "param_5"
OpName %param_6 "param_6"
OpName %param_7 "param_7"
OpName %hueColor_f1_ "hueColor_f1_"
OpName %angle "angle"
OpName %nodeData "nodeData"
OpName %param_4 "param_4"
OpName %main_1 "main_1"
OpName %treeIndex_1 "treeIndex_1"
OpName %param_8 "param_8"
OpName %param_9 "param_9"
OpName %param_10 "param_10"
OpName %param_11 "param_11"
OpName %GLF_live1_looplimiter2 "GLF_live1_looplimiter2"
OpName %GLF_live1i "GLF_live1i"
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 %GLF_live4_looplimiter3 "GLF_live4_looplimiter3"
OpName %GLF_live4i "GLF_live4i"
OpName %GLF_live4index "GLF_live4index"
OpName %Obj "Obj"
OpMemberName %Obj 0 "odd_numbers"
OpMemberName %Obj 1 "even_numbers"
OpName %GLF_live4obj "GLF_live4obj"
OpName %param_24 "param_24"
OpName %param_25 "param_25"
OpName %param_26 "param_26"
OpName %param_27 "param_27"
OpName %z "z"
OpName %x "x"
OpName %param_28 "param_28"
OpName %y "y"
OpName %param_29 "param_29"
OpName %sum "sum"
OpName %target_1 "target_1"
OpName %result "result"
OpName %param_30 "param_30"
OpName %a "a"
OpName %x_235 "x_235"
OpName %param_31 "param_31"
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 %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_27 NonWritable
OpDecorate %x_27 DescriptorSet 0
OpDecorate %x_27 Binding 0
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpDecorate %_arr_float_uint_50 ArrayStride 4
OpMemberDecorate %Obj 0 Offset 0
OpDecorate %_arr_float_uint_10 ArrayStride 4
OpMemberDecorate %Obj 1 Offset 40
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
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_27 = OpVariable %_ptr_Uniform_buf0 Uniform
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%17 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %17
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %17
%_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 %17
%void = OpTypeVoid
%_ptr_Function_BST = OpTypePointer Function %BST
%_ptr_Function_int = OpTypePointer Function %int
%23 = 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
%43 = OpTypeFunction %void %_ptr_Function_int %_ptr_Function_int
%49 = OpConstantNull %int
%51 = OpConstantNull %BST
%uint_50 = OpConstant %uint 50
%_arr_float_uint_50 = OpTypeArray %float %uint_50
%_ptr_Function__arr_float_uint_50 = OpTypePointer Function %_arr_float_uint_50
%60 = OpConstantNull %_arr_float_uint_50
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%_ptr_Private_int = OpTypePointer Private %int
%_ptr_Private_BST = OpTypePointer Private %BST
%int_1 = OpConstant %int 1
%int_50 = OpConstant %int 50
%_ptr_Function_float = OpTypePointer Function %float
%_ptr_Uniform_float = OpTypePointer Uniform %float
%163 = OpTypeFunction %int %_ptr_Function_int
%204 = OpTypeFunction %float %_ptr_Function_float
%float_6_5 = OpConstant %float 6.5
%float_1_5 = OpConstant %float 1.5
%int_100 = OpConstant %int 100
%float_4 = OpConstant %float 4
%float_0 = OpConstant %float 0
%int_6 = OpConstant %int 6
%float_1 = OpConstant %float 1
%int_30 = OpConstant %int 30
%float_10 = OpConstant %float 10
%v3float = OpTypeVector %float 3
%249 = OpTypeFunction %v3float %_ptr_Function_float
%255 = OpConstantNull %float
%int_15 = OpConstant %int 15
%float_30 = OpConstant %float 30
%265 = OpConstantComposite %v3float %float_30 %float_30 %float_30
%float_5 = OpConstant %float 5
%float_50 = OpConstant %float 50
%271 = OpConstantComposite %v3float %float_50 %float_50 %float_50
%273 = OpTypeFunction %void
%_arr_float_uint_10 = OpTypeArray %float %uint_10
%Obj = OpTypeStruct %_arr_float_uint_10 %_arr_float_uint_10
%_ptr_Function_Obj = OpTypePointer Function %Obj
%302 = OpConstantNull %Obj
%_ptr_Function_v2float = OpTypePointer Function %v2float
%309 = OpConstantNull %v2float
%_ptr_Function_v3float = OpTypePointer Function %v3float
%321 = OpConstantNull %v3float
%int_9 = OpConstant %int 9
%int_5 = OpConstant %int 5
%true = OpConstantTrue %bool
%int_7 = OpConstant %int 7
%int_12 = OpConstant %int 12
%int_8 = OpConstant %int 8
%int_2 = OpConstant %int 2
%int_3 = OpConstant %int 3
%int_10 = OpConstant %int 10
%int_17 = OpConstant %int 17
%int_13 = OpConstant %int 13
%float_256 = OpConstant %float 256
%459 = OpConstantComposite %v2float %float_256 %float_256
%int_n100 = OpConstant %int -100
%int_20 = OpConstant %int 20
%511 = OpConstantComposite %v3float %float_1 %float_0 %float_0
%main_out = OpTypeStruct %v4float
%520 = OpTypeFunction %void %main_out
%makeTreeNode_struct_BST_i1_i1_i11_i1_ = OpFunction %void None %23
%tree = OpFunctionParameter %_ptr_Function_BST
%data = OpFunctionParameter %_ptr_Function_int
%30 = OpLabel
%32 = OpLoad %int %data
%35 = OpAccessChain %_ptr_Function_int %tree %uint_0
OpStore %35 %32
%38 = OpAccessChain %_ptr_Function_int %tree %uint_1
OpStore %38 %int_n1
%42 = OpAccessChain %_ptr_Function_int %tree %uint_2
OpStore %42 %int_n1
OpReturn
OpFunctionEnd
%insert_i1_i1_ = OpFunction %void None %43
%treeIndex = OpFunctionParameter %_ptr_Function_int
%data_1 = OpFunctionParameter %_ptr_Function_int
%47 = OpLabel
%baseIndex = OpVariable %_ptr_Function_int Function %49
%param = OpVariable %_ptr_Function_BST Function %51
%param_1 = OpVariable %_ptr_Function_int Function %49
%param_2 = OpVariable %_ptr_Function_BST Function %51
%param_3 = OpVariable %_ptr_Function_int Function %49
%GLF_live8i = OpVariable %_ptr_Function_int Function %49
%GLF_live8A = OpVariable %_ptr_Function__arr_float_uint_50 Function %60
OpStore %baseIndex %int_0
OpBranch %62
%62 = OpLabel
OpLoopMerge %63 %64 None
OpBranch %65
%65 = OpLabel
%66 = OpLoad %int %baseIndex
%68 = OpLoad %int %treeIndex
%69 = OpSLessThanEqual %bool %66 %68
OpSelectionMerge %71 None
OpBranchConditional %69 %72 %73
%72 = OpLabel
OpBranch %71
%73 = OpLabel
OpBranch %63
%71 = OpLabel
%75 = OpLoad %int %data_1
%76 = OpLoad %int %baseIndex
%78 = OpAccessChain %_ptr_Private_int %tree_1 %76 %uint_0
%79 = OpLoad %int %78
%80 = OpSLessThanEqual %bool %75 %79
OpSelectionMerge %81 None
OpBranchConditional %80 %82 %83
%82 = OpLabel
%84 = OpLoad %int %baseIndex
%85 = OpAccessChain %_ptr_Private_int %tree_1 %84 %uint_1
%86 = OpLoad %int %85
%87 = OpIEqual %bool %86 %int_n1
OpSelectionMerge %88 None
OpBranchConditional %87 %89 %90
%89 = OpLabel
%91 = OpLoad %int %baseIndex
%93 = OpLoad %int %treeIndex
%94 = OpAccessChain %_ptr_Private_int %tree_1 %91 %uint_1
OpStore %94 %93
%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
OpReturn
%90 = OpLabel
%107 = OpLoad %int %baseIndex
%108 = OpAccessChain %_ptr_Private_int %tree_1 %107 %uint_1
%109 = OpLoad %int %108
OpStore %baseIndex %109
OpBranch %64
%88 = OpLabel
OpBranch %81
%83 = OpLabel
%110 = OpLoad %int %baseIndex
%111 = OpAccessChain %_ptr_Private_int %tree_1 %110 %uint_2
%112 = OpLoad %int %111
%113 = OpIEqual %bool %112 %int_n1
OpSelectionMerge %114 None
OpBranchConditional %113 %115 %116
%115 = OpLabel
%117 = OpLoad %int %baseIndex
%119 = OpLoad %int %treeIndex
%120 = OpAccessChain %_ptr_Private_int %tree_1 %117 %uint_2
OpStore %120 %119
%122 = OpLoad %int %treeIndex
%123 = OpAccessChain %_ptr_Private_BST %tree_1 %122
%124 = OpLoad %BST %123
OpStore %param_2 %124
%126 = OpLoad %int %data_1
OpStore %param_3 %126
%127 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_2 %param_3
%130 = OpLoad %BST %param_2
%131 = OpAccessChain %_ptr_Private_BST %tree_1 %122
OpStore %131 %130
OpReturn
%116 = OpLabel
OpStore %GLF_live8i %int_1
%133 = OpLoad %int %GLF_live8i
%134 = OpLoad %int %GLF_live8i
%135 = OpLoad %int %GLF_live8i
%137 = OpSGreaterThanEqual %bool %133 %int_0
OpSelectionMerge %138 None
OpBranchConditional %137 %139 %138
%139 = OpLabel
%141 = OpSLessThan %bool %134 %int_50
OpBranch %138
%138 = OpLabel
%142 = OpPhi %bool %137 %116 %141 %139
%136 = OpSelect %int %142 %135 %int_0
%144 = OpAccessChain %_ptr_Function_float %GLF_live8A %int_0
%145 = OpLoad %float %144
%146 = OpAccessChain %_ptr_Function_float %GLF_live8A %136
%147 = OpLoad %float %146
%148 = OpAccessChain %_ptr_Function_float %GLF_live8A %136
%149 = OpFAdd %float %147 %145
OpStore %148 %149
OpBranch %150
%150 = OpLabel
OpLoopMerge %151 %152 None
OpBranch %153
%153 = OpLabel
%154 = OpLoad %int %baseIndex
%155 = OpAccessChain %_ptr_Private_int %tree_1 %154 %uint_2
%156 = OpLoad %int %155
OpStore %baseIndex %156
OpBranch %152
%152 = OpLabel
%158 = OpAccessChain %_ptr_Uniform_float %x_27 %uint_0 %uint_0
%159 = OpLoad %float %158
%160 = OpAccessChain %_ptr_Uniform_float %x_27 %uint_0 %uint_1
%161 = OpLoad %float %160
%162 = OpFOrdGreaterThan %bool %159 %161
OpBranchConditional %162 %150 %151
%151 = OpLabel
OpBranch %64
%114 = OpLabel
OpBranch %81
%81 = OpLabel
OpBranch %64
%64 = OpLabel
OpBranch %62
%63 = OpLabel
OpReturn
OpFunctionEnd
%search_i1_ = OpFunction %int None %163
%target = OpFunctionParameter %_ptr_Function_int
%166 = OpLabel
%index = OpVariable %_ptr_Function_int Function %49
%currentNode = OpVariable %_ptr_Function_BST Function %51
%x_387 = OpVariable %_ptr_Function_int Function %49
OpStore %index %int_0
OpBranch %170
%170 = OpLabel
OpLoopMerge %171 %172 None
OpBranch %173
%173 = OpLabel
%174 = OpLoad %int %index
%175 = OpINotEqual %bool %174 %int_n1
OpSelectionMerge %176 None
OpBranchConditional %175 %177 %178
%177 = OpLabel
OpBranch %176
%178 = OpLabel
OpBranch %171
%176 = OpLabel
%179 = OpLoad %int %index
%180 = OpAccessChain %_ptr_Private_BST %tree_1 %179
%181 = OpLoad %BST %180
OpStore %currentNode %181
%182 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%183 = OpLoad %int %182
%185 = OpLoad %int %target
%186 = OpIEqual %bool %183 %185
OpSelectionMerge %187 None
OpBranchConditional %186 %188 %187
%188 = OpLabel
%190 = OpLoad %int %target
OpReturnValue %190
%187 = OpLabel
%192 = OpLoad %int %target
%193 = OpAccessChain %_ptr_Function_int %currentNode %uint_0
%194 = OpLoad %int %193
%195 = OpSGreaterThan %bool %192 %194
OpSelectionMerge %196 None
OpBranchConditional %195 %197 %198
%197 = OpLabel
%199 = OpAccessChain %_ptr_Function_int %currentNode %uint_2
%200 = OpLoad %int %199
OpStore %x_387 %200
OpBranch %196
%198 = OpLabel
%201 = OpAccessChain %_ptr_Function_int %currentNode %uint_1
%202 = OpLoad %int %201
OpStore %x_387 %202
OpBranch %196
%196 = OpLabel
%203 = OpLoad %int %x_387
OpStore %index %203
OpBranch %172
%172 = OpLabel
OpBranch %170
%171 = OpLabel
OpReturnValue %int_n1
OpFunctionEnd
%makeFrame_f1_ = OpFunction %float None %204
%v = OpFunctionParameter %_ptr_Function_float
%207 = OpLabel
%param_5 = OpVariable %_ptr_Function_int Function %49
%param_6 = OpVariable %_ptr_Function_int Function %49
%param_7 = OpVariable %_ptr_Function_int Function %49
%212 = OpLoad %float %v
%215 = OpFMul %float %212 %float_6_5
OpStore %v %215
%217 = OpLoad %float %v
%219 = OpFOrdLessThan %bool %217 %float_1_5
OpSelectionMerge %220 None
OpBranchConditional %219 %221 %220
%221 = OpLabel
OpStore %param_5 %int_100
%223 = OpFunctionCall %int %search_i1_ %param_5
%225 = OpConvertSToF %float %223
OpReturnValue %225
%220 = OpLabel
%227 = OpLoad %float %v
%229 = OpFOrdLessThan %bool %227 %float_4
OpSelectionMerge %230 None
OpBranchConditional %229 %231 %230
%231 = OpLabel
OpReturnValue %float_0
%230 = OpLabel
%234 = OpLoad %float %v
OpStore %param_6 %int_6
%236 = OpFunctionCall %int %search_i1_ %param_6
%238 = OpConvertSToF %float %236
%239 = OpFOrdLessThan %bool %234 %238
OpSelectionMerge %240 None
OpBranchConditional %239 %241 %240
%241 = OpLabel
OpReturnValue %float_1
%240 = OpLabel
OpStore %param_7 %int_30
%244 = OpFunctionCall %int %search_i1_ %param_7
%247 = OpConvertSToF %float %244
%248 = OpFAdd %float %float_10 %247
OpReturnValue %248
OpFunctionEnd
%hueColor_f1_ = OpFunction %v3float None %249
%angle = OpFunctionParameter %_ptr_Function_float
%253 = OpLabel
%nodeData = OpVariable %_ptr_Function_float Function %255
%param_4 = OpVariable %_ptr_Function_int Function %49
OpStore %param_4 %int_15
%258 = OpFunctionCall %int %search_i1_ %param_4
%260 = OpConvertSToF %float %258
OpStore %nodeData %260
%262 = OpLoad %float %angle
%263 = OpLoad %float %nodeData
%267 = OpCompositeConstruct %v3float %float_1 %float_5 %263
%268 = OpVectorTimesScalar %v3float %267 %262
%269 = OpFAdd %v3float %265 %268
%272 = OpFDiv %v3float %269 %271
OpReturnValue %272
OpFunctionEnd
%main_1 = OpFunction %void None %273
%275 = OpLabel
%treeIndex_1 = OpVariable %_ptr_Function_int Function %49
%param_8 = OpVariable %_ptr_Function_BST Function %51
%param_9 = OpVariable %_ptr_Function_int Function %49
%param_10 = OpVariable %_ptr_Function_int Function %49
%param_11 = OpVariable %_ptr_Function_int Function %49
%GLF_live1_looplimiter2 = OpVariable %_ptr_Function_int Function %49
%GLF_live1i = OpVariable %_ptr_Function_int Function %49
%param_12 = OpVariable %_ptr_Function_int Function %49
%param_13 = OpVariable %_ptr_Function_int Function %49
%param_14 = OpVariable %_ptr_Function_int Function %49
%param_15 = OpVariable %_ptr_Function_int Function %49
%param_16 = OpVariable %_ptr_Function_int Function %49
%param_17 = OpVariable %_ptr_Function_int Function %49
%param_18 = OpVariable %_ptr_Function_int Function %49
%param_19 = OpVariable %_ptr_Function_int Function %49
%param_20 = OpVariable %_ptr_Function_int Function %49
%param_21 = OpVariable %_ptr_Function_int Function %49
%param_22 = OpVariable %_ptr_Function_int Function %49
%param_23 = OpVariable %_ptr_Function_int Function %49
%GLF_live4_looplimiter3 = OpVariable %_ptr_Function_int Function %49
%GLF_live4i = OpVariable %_ptr_Function_int Function %49
%GLF_live4index = OpVariable %_ptr_Function_int Function %49
%GLF_live4obj = OpVariable %_ptr_Function_Obj Function %302
%param_24 = OpVariable %_ptr_Function_int Function %49
%param_25 = OpVariable %_ptr_Function_int Function %49
%param_26 = OpVariable %_ptr_Function_int Function %49
%param_27 = OpVariable %_ptr_Function_int Function %49
%z = OpVariable %_ptr_Function_v2float Function %309
%x = OpVariable %_ptr_Function_float Function %255
%param_28 = OpVariable %_ptr_Function_float Function %255
%y = OpVariable %_ptr_Function_float Function %255
%param_29 = OpVariable %_ptr_Function_float Function %255
%sum = OpVariable %_ptr_Function_int Function %49
%target_1 = OpVariable %_ptr_Function_int Function %49
%result = OpVariable %_ptr_Function_int Function %49
%param_30 = OpVariable %_ptr_Function_int Function %49
%a = OpVariable %_ptr_Function_float Function %255
%x_235 = OpVariable %_ptr_Function_v3float Function %321
%param_31 = OpVariable %_ptr_Function_float Function %255
OpStore %treeIndex_1 %int_0
%323 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
%324 = OpLoad %BST %323
OpStore %param_8 %324
OpStore %param_9 %int_9
%326 = OpFunctionCall %void %makeTreeNode_struct_BST_i1_i1_i11_i1_ %param_8 %param_9
%329 = OpLoad %BST %param_8
%330 = OpAccessChain %_ptr_Private_BST %tree_1 %int_0
OpStore %330 %329
%331 = OpLoad %int %treeIndex_1
%332 = OpIAdd %int %331 %int_1
OpStore %treeIndex_1 %332
%333 = OpLoad %int %treeIndex_1
OpStore %param_10 %333
OpStore %param_11 %int_5
%335 = OpFunctionCall %void %insert_i1_i1_ %param_10 %param_11
%338 = OpLoad %int %treeIndex_1
%339 = OpIAdd %int %338 %int_1
OpStore %treeIndex_1 %339
OpStore %GLF_live1_looplimiter2 %int_0
OpStore %GLF_live1i %int_0
OpBranch %340
%340 = OpLabel
OpLoopMerge %341 %342 None
OpBranch %343
%343 = OpLabel
OpSelectionMerge %345 None
OpBranchConditional %true %346 %347
%346 = OpLabel
OpBranch %345
%347 = OpLabel
OpBranch %341
%345 = OpLabel
%348 = OpLoad %int %GLF_live1_looplimiter2
%350 = OpSGreaterThanEqual %bool %348 %int_7
OpSelectionMerge %351 None
OpBranchConditional %350 %352 %351
%352 = OpLabel
OpBranch %341
%351 = OpLabel
%353 = OpLoad %int %GLF_live1_looplimiter2
%354 = OpIAdd %int %353 %int_1
OpStore %GLF_live1_looplimiter2 %354
OpBranch %342
%342 = OpLabel
%355 = OpLoad %int %GLF_live1i
%356 = OpIAdd %int %355 %int_1
OpStore %GLF_live1i %356
OpBranch %340
%341 = OpLabel
%357 = OpLoad %int %treeIndex_1
OpStore %param_12 %357
OpStore %param_13 %int_12
%359 = OpFunctionCall %void %insert_i1_i1_ %param_12 %param_13
%362 = OpLoad %int %treeIndex_1
%363 = OpIAdd %int %362 %int_1
OpStore %treeIndex_1 %363
%364 = OpLoad %int %treeIndex_1
OpStore %param_14 %364
OpStore %param_15 %int_15
%365 = OpFunctionCall %void %insert_i1_i1_ %param_14 %param_15
%368 = OpLoad %int %treeIndex_1
%369 = OpIAdd %int %368 %int_1
OpStore %treeIndex_1 %369
%370 = OpLoad %int %treeIndex_1
OpStore %param_16 %370
OpStore %param_17 %int_7
%371 = OpFunctionCall %void %insert_i1_i1_ %param_16 %param_17
%374 = OpLoad %int %treeIndex_1
%375 = OpIAdd %int %374 %int_1
OpStore %treeIndex_1 %375
%376 = OpLoad %int %treeIndex_1
OpStore %param_18 %376
OpStore %param_19 %int_8
%378 = OpFunctionCall %void %insert_i1_i1_ %param_18 %param_19
%381 = OpLoad %int %treeIndex_1
%382 = OpIAdd %int %381 %int_1
OpStore %treeIndex_1 %382
%383 = OpLoad %int %treeIndex_1
OpStore %param_20 %383
OpStore %param_21 %int_2
%385 = OpFunctionCall %void %insert_i1_i1_ %param_20 %param_21
%388 = OpLoad %int %treeIndex_1
%389 = OpIAdd %int %388 %int_1
OpStore %treeIndex_1 %389
%390 = OpLoad %int %treeIndex_1
OpStore %param_22 %390
OpStore %param_23 %int_6
%391 = OpFunctionCall %void %insert_i1_i1_ %param_22 %param_23
%394 = OpLoad %int %treeIndex_1
%395 = OpIAdd %int %394 %int_1
OpStore %treeIndex_1 %395
OpStore %GLF_live4_looplimiter3 %int_0
OpStore %GLF_live4i %int_0
OpBranch %396
%396 = OpLabel
OpLoopMerge %397 %398 None
OpBranch %399
%399 = OpLabel
OpSelectionMerge %400 None
OpBranchConditional %true %401 %402
%401 = OpLabel
OpBranch %400
%402 = OpLabel
OpBranch %397
%400 = OpLabel
%403 = OpLoad %int %GLF_live4_looplimiter3
%405 = OpSGreaterThanEqual %bool %403 %int_3
OpSelectionMerge %406 None
OpBranchConditional %405 %407 %406
%407 = OpLabel
OpBranch %397
%406 = OpLabel
%408 = OpLoad %int %GLF_live4_looplimiter3
%409 = OpIAdd %int %408 %int_1
OpStore %GLF_live4_looplimiter3 %409
OpStore %GLF_live4index %int_1
%410 = OpLoad %int %GLF_live4index
%411 = OpLoad %int %GLF_live4index
%412 = OpLoad %int %GLF_live4index
%413 = OpAccessChain %_ptr_Function_float %GLF_live4obj %uint_1 %int_1
%414 = OpLoad %float %413
%416 = OpSGreaterThanEqual %bool %410 %int_0
OpSelectionMerge %417 None
OpBranchConditional %416 %418 %417
%418 = OpLabel
%420 = OpSLessThan %bool %411 %int_10
OpBranch %417
%417 = OpLabel
%421 = OpPhi %bool %416 %406 %420 %418
%415 = OpSelect %int %421 %412 %int_0
%422 = OpAccessChain %_ptr_Function_float %GLF_live4obj %uint_1 %415
OpStore %422 %414
%423 = OpLoad %int %GLF_live4i
%424 = OpLoad %int %GLF_live4i
%425 = OpLoad %int %GLF_live4i
%427 = OpSGreaterThanEqual %bool %423 %int_0
OpSelectionMerge %428 None
OpBranchConditional %427 %429 %428
%429 = OpLabel
%430 = OpSLessThan %bool %424 %int_10
OpBranch %428
%428 = OpLabel
%431 = OpPhi %bool %427 %417 %430 %429
%426 = OpSelect %int %431 %425 %int_0
%432 = OpAccessChain %_ptr_Function_float %GLF_live4obj %uint_1 %426
OpStore %432 %float_1
OpBranch %398
%398 = OpLabel
%433 = OpLoad %int %GLF_live4i
%434 = OpIAdd %int %433 %int_1
OpStore %GLF_live4i %434
OpBranch %396
%397 = OpLabel
%435 = OpLoad %int %treeIndex_1
OpStore %param_24 %435
OpStore %param_25 %int_17
%437 = OpFunctionCall %void %insert_i1_i1_ %param_24 %param_25
%440 = OpAccessChain %_ptr_Uniform_float %x_27 %uint_0 %uint_0
%441 = OpLoad %float %440
%442 = OpAccessChain %_ptr_Uniform_float %x_27 %uint_0 %uint_1
%443 = OpLoad %float %442
%444 = OpFOrdGreaterThan %bool %441 %443
OpSelectionMerge %445 None
OpBranchConditional %444 %446 %445
%446 = OpLabel
OpReturn
%445 = OpLabel
%447 = OpLoad %int %treeIndex_1
%448 = OpIAdd %int %447 %int_1
OpStore %treeIndex_1 %448
%449 = OpLoad %int %treeIndex_1
OpStore %param_26 %449
OpStore %param_27 %int_13
%451 = OpFunctionCall %void %insert_i1_i1_ %param_26 %param_27
%454 = OpLoad %v4float %gl_FragCoord
%455 = OpCompositeExtract %float %454 1
%456 = OpCompositeExtract %float %454 0
%457 = OpCompositeConstruct %v2float %455 %456
%460 = OpFDiv %v2float %457 %459
OpStore %z %460
%461 = OpAccessChain %_ptr_Function_float %z %uint_0
%462 = OpLoad %float %461
OpStore %param_28 %462
%463 = OpFunctionCall %float %makeFrame_f1_ %param_28
OpStore %x %463
%465 = OpAccessChain %_ptr_Function_float %z %uint_1
%466 = OpLoad %float %465
OpStore %param_29 %466
%467 = OpFunctionCall %float %makeFrame_f1_ %param_29
OpStore %y %467
OpStore %sum %int_n100
OpStore %target_1 %int_0
OpBranch %470
%470 = OpLabel
OpLoopMerge %471 %472 None
OpBranch %473
%473 = OpLabel
%474 = OpLoad %int %target_1
%476 = OpSLessThan %bool %474 %int_20
OpSelectionMerge %477 None
OpBranchConditional %476 %478 %479
%478 = OpLabel
OpBranch %477
%479 = OpLabel
OpBranch %471
%477 = OpLabel
%480 = OpLoad %int %target_1
OpStore %param_30 %480
%481 = OpFunctionCall %int %search_i1_ %param_30
OpStore %result %481
%483 = OpLoad %int %result
%484 = OpSGreaterThan %bool %483 %int_0
OpSelectionMerge %485 None
OpBranchConditional %484 %486 %487
%486 = OpLabel
OpBranch %485
%487 = OpLabel
%488 = OpLoad %int %result
OpSelectionMerge %489 None
OpSwitch %488 %490 0 %491 -1 %492
%491 = OpLabel
OpReturn
%492 = OpLabel
%493 = OpLoad %int %sum
%494 = OpIAdd %int %493 %int_1
OpStore %sum %494
OpBranch %489
%490 = OpLabel
OpBranch %489
%489 = OpLabel
OpBranch %485
%485 = OpLabel
OpBranch %472
%472 = OpLabel
%495 = OpLoad %int %target_1
%496 = OpIAdd %int %495 %int_1
OpStore %target_1 %496
OpBranch %470
%471 = OpLabel
%497 = OpLoad %float %x
%498 = OpLoad %float %y
%499 = OpLoad %int %sum
%500 = OpConvertSToF %float %499
%501 = OpFMul %float %498 %500
%502 = OpFAdd %float %497 %501
OpStore %a %502
%503 = OpAccessChain %_ptr_Uniform_float %x_27 %uint_0 %uint_0
%504 = OpLoad %float %503
%505 = OpAccessChain %_ptr_Uniform_float %x_27 %uint_0 %uint_1
%506 = OpLoad %float %505
%507 = OpFOrdLessThan %bool %504 %506
OpSelectionMerge %508 None
OpBranchConditional %507 %509 %510
%509 = OpLabel
OpStore %x_235 %511
OpBranch %508
%510 = OpLabel
%512 = OpLoad %float %a
OpStore %param_31 %512
%513 = OpFunctionCall %v3float %hueColor_f1_ %param_31
OpStore %x_235 %513
OpBranch %508
%508 = OpLabel
%515 = OpLoad %v3float %x_235
%516 = OpCompositeExtract %float %515 0
%517 = OpCompositeExtract %float %515 1
%518 = OpCompositeExtract %float %515 2
%519 = OpCompositeConstruct %v4float %516 %517 %518 %float_1
OpStore %x_GLF_color %519
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %520
%tint_symbol_1 = OpFunctionParameter %main_out
%524 = OpLabel
%525 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %525
OpReturn
OpFunctionEnd
%main = OpFunction %void None %273
%527 = OpLabel
%528 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %528
%529 = OpFunctionCall %void %main_1
%531 = OpLoad %v4float %x_GLF_color
%532 = OpCompositeConstruct %main_out %531
%530 = OpFunctionCall %void %tint_symbol_3 %532
OpReturn
OpFunctionEnd