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

849 lines
35 KiB
Plaintext

; SPIR-V
; Version: 1.3
; Generator: Google Tint Compiler; 0
; Bound: 545
; Schema: 0
OpCapability Shader
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %main "main" %tint_symbol %tint_symbol_2
OpExecutionMode %main OriginUpperLeft
OpName %gl_FragCoord "gl_FragCoord"
OpName %buf0 "buf0"
OpMemberName %buf0 0 "resolution"
OpName %x_7 "x_7"
OpName %map "map"
OpName %x_GLF_color "x_GLF_color"
OpName %tint_symbol "tint_symbol"
OpName %tint_symbol_2 "tint_symbol_2"
OpName %main_1 "main_1"
OpName %pos "pos"
OpName %ipos "ipos"
OpName %i "i"
OpName %p "p"
OpName %canwalk "canwalk"
OpName %v "v"
OpName %directions "directions"
OpName %j "j"
OpName %d "d"
OpName %x_104 "x_104"
OpName %x_124 "x_124"
OpName %x_144 "x_144"
OpName %x_164 "x_164"
OpName %x_105_phi "x_105_phi"
OpName %x_125_phi "x_125_phi"
OpName %x_145_phi "x_145_phi"
OpName %x_165_phi "x_165_phi"
OpName %x_229 "x_229"
OpName %x_242 "x_242"
OpName %x_281 "x_281"
OpName %x_288 "x_288"
OpName %x_289 "x_289"
OpName %x_295 "x_295"
OpName %x_296 "x_296"
OpName %x_303 "x_303"
OpName %x_304 "x_304"
OpName %x_315 "x_315"
OpName %x_316 "x_316"
OpName %x_359 "x_359"
OpName %x_372 "x_372"
OpName %x_411 "x_411"
OpName %x_424 "x_424"
OpName %x_230_phi "x_230_phi"
OpName %x_243_phi "x_243_phi"
OpName %x_282_phi "x_282_phi"
OpName %x_290_phi "x_290_phi"
OpName %x_297_phi "x_297_phi"
OpName %x_305_phi "x_305_phi"
OpName %x_317_phi "x_317_phi"
OpName %x_360_phi "x_360_phi"
OpName %x_373_phi "x_373_phi"
OpName %x_412_phi "x_412_phi"
OpName %x_425_phi "x_425_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"
OpDecorate %buf0 Block
OpMemberDecorate %buf0 0 Offset 0
OpDecorate %x_7 NonWritable
OpDecorate %x_7 DescriptorSet 0
OpDecorate %x_7 Binding 0
OpDecorate %_arr_int_uint_256 ArrayStride 4
OpDecorate %tint_symbol BuiltIn FragCoord
OpDecorate %tint_symbol_2 Location 0
OpMemberDecorate %main_out 0 Offset 0
%float = OpTypeFloat 32
%v4float = OpTypeVector %float 4
%_ptr_Private_v4float = OpTypePointer Private %v4float
%5 = OpConstantNull %v4float
%gl_FragCoord = OpVariable %_ptr_Private_v4float Private %5
%v2float = OpTypeVector %float 2
%buf0 = OpTypeStruct %v2float
%_ptr_Uniform_buf0 = OpTypePointer Uniform %buf0
%x_7 = OpVariable %_ptr_Uniform_buf0 Uniform
%int = OpTypeInt 32 1
%uint = OpTypeInt 32 0
%uint_256 = OpConstant %uint 256
%_arr_int_uint_256 = OpTypeArray %int %uint_256
%_ptr_Private__arr_int_uint_256 = OpTypePointer Private %_arr_int_uint_256
%16 = OpConstantNull %_arr_int_uint_256
%map = OpVariable %_ptr_Private__arr_int_uint_256 Private %16
%x_GLF_color = OpVariable %_ptr_Private_v4float Private %5
%_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 %5
%void = OpTypeVoid
%22 = OpTypeFunction %void
%_ptr_Function_v2float = OpTypePointer Function %v2float
%28 = OpConstantNull %v2float
%v2int = OpTypeVector %int 2
%_ptr_Function_v2int = OpTypePointer Function %v2int
%32 = OpConstantNull %v2int
%_ptr_Function_int = OpTypePointer Function %int
%35 = OpConstantNull %int
%bool = OpTypeBool
%_ptr_Function_bool = OpTypePointer Function %bool
%40 = OpConstantNull %bool
%uint_0 = OpConstant %uint 0
%_ptr_Uniform_v2float = OpTypePointer Uniform %v2float
%_ptr_Function_float = OpTypePointer Function %float
%uint_1 = OpConstant %uint 1
%float_16 = OpConstant %float 16
%int_0 = OpConstant %int 0
%int_256 = OpConstant %int 256
%_ptr_Private_int = OpTypePointer Private %int
%int_1 = OpConstant %int 1
%83 = OpConstantComposite %v2int %int_0 %int_0
%true = OpConstantTrue %bool
%int_2 = OpConstant %int 2
%int_16 = OpConstant %int 16
%int_14 = OpConstant %int 14
%_ptr_Function__arr_int_uint_256 = OpTypePointer Function %_arr_int_uint_256
%false = OpConstantFalse %bool
%int_8 = OpConstant %int 8
%358 = OpConstantComposite %_arr_int_uint_256 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0 %int_0
%float_1 = OpConstant %float 1
%528 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1
%float_0 = OpConstant %float 0
%531 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_1
%main_out = OpTypeStruct %v4float
%532 = OpTypeFunction %void %main_out
%main_1 = OpFunction %void None %22
%25 = OpLabel
%pos = OpVariable %_ptr_Function_v2float Function %28
%ipos = OpVariable %_ptr_Function_v2int Function %32
%i = OpVariable %_ptr_Function_int Function %35
%p = OpVariable %_ptr_Function_v2int Function %32
%canwalk = OpVariable %_ptr_Function_bool Function %40
%v = OpVariable %_ptr_Function_int Function %35
%directions = OpVariable %_ptr_Function_int Function %35
%j = OpVariable %_ptr_Function_int Function %35
%d = OpVariable %_ptr_Function_int Function %35
%x_104 = OpVariable %_ptr_Function_bool Function %40
%x_124 = OpVariable %_ptr_Function_bool Function %40
%x_144 = OpVariable %_ptr_Function_bool Function %40
%x_164 = OpVariable %_ptr_Function_bool Function %40
%x_105_phi = OpVariable %_ptr_Function_bool Function %40
%x_125_phi = OpVariable %_ptr_Function_bool Function %40
%x_145_phi = OpVariable %_ptr_Function_bool Function %40
%x_165_phi = OpVariable %_ptr_Function_bool Function %40
%x_229 = OpVariable %_ptr_Function_bool Function %40
%x_242 = OpVariable %_ptr_Function_bool Function %40
%x_281 = OpVariable %_ptr_Function_bool Function %40
%x_288 = OpVariable %_ptr_Function_int Function %35
%x_289 = OpVariable %_ptr_Function_int Function %35
%x_295 = OpVariable %_ptr_Function_int Function %35
%x_296 = OpVariable %_ptr_Function_int Function %35
%x_303 = OpVariable %_ptr_Function__arr_int_uint_256 Function %16
%x_304 = OpVariable %_ptr_Function__arr_int_uint_256 Function %16
%x_315 = OpVariable %_ptr_Function_int Function %35
%x_316 = OpVariable %_ptr_Function_int Function %35
%x_359 = OpVariable %_ptr_Function_bool Function %40
%x_372 = OpVariable %_ptr_Function_bool Function %40
%x_411 = OpVariable %_ptr_Function_bool Function %40
%x_424 = OpVariable %_ptr_Function_bool Function %40
%x_230_phi = OpVariable %_ptr_Function_bool Function %40
%x_243_phi = OpVariable %_ptr_Function_bool Function %40
%x_282_phi = OpVariable %_ptr_Function_bool Function %40
%x_290_phi = OpVariable %_ptr_Function_int Function %35
%x_297_phi = OpVariable %_ptr_Function_int Function %35
%x_305_phi = OpVariable %_ptr_Function__arr_int_uint_256 Function %16
%x_317_phi = OpVariable %_ptr_Function_int Function %35
%x_360_phi = OpVariable %_ptr_Function_bool Function %40
%x_373_phi = OpVariable %_ptr_Function_bool Function %40
%x_412_phi = OpVariable %_ptr_Function_bool Function %40
%x_425_phi = OpVariable %_ptr_Function_bool Function %40
%45 = OpLoad %v4float %gl_FragCoord
%48 = OpAccessChain %_ptr_Uniform_v2float %x_7 %uint_0
%49 = OpLoad %v2float %48
%50 = OpCompositeExtract %float %45 0
%51 = OpCompositeExtract %float %45 1
%52 = OpCompositeConstruct %v2float %50 %51
%53 = OpFDiv %v2float %52 %49
OpStore %pos %53
%55 = OpAccessChain %_ptr_Function_float %pos %uint_0
%56 = OpLoad %float %55
%58 = OpAccessChain %_ptr_Function_float %pos %uint_1
%59 = OpLoad %float %58
%62 = OpFMul %float %56 %float_16
%60 = OpConvertFToS %int %62
%64 = OpFMul %float %59 %float_16
%63 = OpConvertFToS %int %64
%65 = OpCompositeConstruct %v2int %60 %63
OpStore %ipos %65
OpStore %i %int_0
OpBranch %67
%67 = OpLabel
OpLoopMerge %68 %69 None
OpBranch %70
%70 = OpLabel
%71 = OpLoad %int %i
%73 = OpSLessThan %bool %71 %int_256
OpSelectionMerge %74 None
OpBranchConditional %73 %75 %76
%75 = OpLabel
OpBranch %74
%76 = OpLabel
OpBranch %68
%74 = OpLabel
%77 = OpLoad %int %i
%79 = OpAccessChain %_ptr_Private_int %map %77
OpStore %79 %int_0
OpBranch %69
%69 = OpLabel
%80 = OpLoad %int %i
%82 = OpIAdd %int %80 %int_1
OpStore %i %82
OpBranch %67
%68 = OpLabel
OpStore %p %83
OpStore %canwalk %true
OpStore %v %int_0
OpBranch %85
%85 = OpLabel
OpLoopMerge %86 %87 None
OpBranch %88
%88 = OpLabel
%97 = OpLoad %int %v
%98 = OpIAdd %int %97 %int_1
OpStore %v %98
OpStore %directions %int_0
%99 = OpAccessChain %_ptr_Function_int %p %uint_0
%100 = OpLoad %int %99
%101 = OpSGreaterThan %bool %100 %int_0
OpStore %x_105_phi %101
OpSelectionMerge %102 None
OpBranchConditional %101 %103 %102
%103 = OpLabel
%104 = OpAccessChain %_ptr_Function_int %p %uint_0
%105 = OpLoad %int %104
%106 = OpAccessChain %_ptr_Function_int %p %uint_1
%107 = OpLoad %int %106
%109 = OpISub %int %105 %int_2
%111 = OpIMul %int %107 %int_16
%112 = OpIAdd %int %109 %111
%113 = OpAccessChain %_ptr_Private_int %map %112
%114 = OpLoad %int %113
%115 = OpIEqual %bool %114 %int_0
OpStore %x_104 %115
%116 = OpLoad %bool %x_104
OpStore %x_105_phi %116
OpBranch %102
%102 = OpLabel
%117 = OpLoad %bool %x_105_phi
OpSelectionMerge %118 None
OpBranchConditional %117 %119 %118
%119 = OpLabel
%120 = OpLoad %int %directions
%121 = OpIAdd %int %120 %int_1
OpStore %directions %121
OpBranch %118
%118 = OpLabel
%122 = OpAccessChain %_ptr_Function_int %p %uint_1
%123 = OpLoad %int %122
%124 = OpSGreaterThan %bool %123 %int_0
OpStore %x_125_phi %124
OpSelectionMerge %125 None
OpBranchConditional %124 %126 %125
%126 = OpLabel
%127 = OpAccessChain %_ptr_Function_int %p %uint_0
%128 = OpLoad %int %127
%129 = OpAccessChain %_ptr_Function_int %p %uint_1
%130 = OpLoad %int %129
%131 = OpISub %int %130 %int_2
%132 = OpIMul %int %131 %int_16
%133 = OpIAdd %int %128 %132
%134 = OpAccessChain %_ptr_Private_int %map %133
%135 = OpLoad %int %134
%136 = OpIEqual %bool %135 %int_0
OpStore %x_124 %136
%137 = OpLoad %bool %x_124
OpStore %x_125_phi %137
OpBranch %125
%125 = OpLabel
%138 = OpLoad %bool %x_125_phi
OpSelectionMerge %139 None
OpBranchConditional %138 %140 %139
%140 = OpLabel
%141 = OpLoad %int %directions
%142 = OpIAdd %int %141 %int_1
OpStore %directions %142
OpBranch %139
%139 = OpLabel
%143 = OpAccessChain %_ptr_Function_int %p %uint_0
%144 = OpLoad %int %143
%146 = OpSLessThan %bool %144 %int_14
OpStore %x_145_phi %146
OpSelectionMerge %147 None
OpBranchConditional %146 %148 %147
%148 = OpLabel
%149 = OpAccessChain %_ptr_Function_int %p %uint_0
%150 = OpLoad %int %149
%151 = OpAccessChain %_ptr_Function_int %p %uint_1
%152 = OpLoad %int %151
%153 = OpIAdd %int %150 %int_2
%154 = OpIMul %int %152 %int_16
%155 = OpIAdd %int %153 %154
%156 = OpAccessChain %_ptr_Private_int %map %155
%157 = OpLoad %int %156
%158 = OpIEqual %bool %157 %int_0
OpStore %x_144 %158
%159 = OpLoad %bool %x_144
OpStore %x_145_phi %159
OpBranch %147
%147 = OpLabel
%160 = OpLoad %bool %x_145_phi
OpSelectionMerge %161 None
OpBranchConditional %160 %162 %161
%162 = OpLabel
%163 = OpLoad %int %directions
%164 = OpIAdd %int %163 %int_1
OpStore %directions %164
OpBranch %161
%161 = OpLabel
%165 = OpAccessChain %_ptr_Function_int %p %uint_1
%166 = OpLoad %int %165
%167 = OpSLessThan %bool %166 %int_14
OpStore %x_165_phi %167
OpSelectionMerge %168 None
OpBranchConditional %167 %169 %168
%169 = OpLabel
%170 = OpAccessChain %_ptr_Function_int %p %uint_0
%171 = OpLoad %int %170
%172 = OpAccessChain %_ptr_Function_int %p %uint_1
%173 = OpLoad %int %172
%174 = OpIAdd %int %173 %int_2
%175 = OpIMul %int %174 %int_16
%176 = OpIAdd %int %171 %175
%177 = OpAccessChain %_ptr_Private_int %map %176
%178 = OpLoad %int %177
%179 = OpIEqual %bool %178 %int_0
OpStore %x_164 %179
%180 = OpLoad %bool %x_164
OpStore %x_165_phi %180
OpBranch %168
%168 = OpLabel
%181 = OpLoad %bool %x_165_phi
OpSelectionMerge %182 None
OpBranchConditional %181 %183 %182
%183 = OpLabel
%184 = OpLoad %int %directions
%185 = OpIAdd %int %184 %int_1
OpStore %directions %185
OpBranch %182
%182 = OpLabel
%213 = OpLoad %int %directions
%214 = OpIEqual %bool %213 %int_0
OpSelectionMerge %215 None
OpBranchConditional %214 %216 %217
%216 = OpLabel
OpStore %canwalk %false
OpStore %i %int_0
OpBranch %219
%219 = OpLabel
OpLoopMerge %220 %221 None
OpBranch %222
%222 = OpLabel
%223 = OpLoad %int %i
%225 = OpSLessThan %bool %223 %int_8
OpSelectionMerge %226 None
OpBranchConditional %225 %227 %228
%227 = OpLabel
OpBranch %226
%228 = OpLabel
OpBranch %220
%226 = OpLabel
OpStore %j %int_0
OpBranch %229
%229 = OpLabel
OpLoopMerge %230 %231 None
OpBranch %232
%232 = OpLabel
%233 = OpLoad %int %j
%234 = OpSLessThan %bool %233 %int_8
OpSelectionMerge %235 None
OpBranchConditional %234 %236 %237
%236 = OpLabel
OpBranch %235
%237 = OpLabel
OpBranch %230
%235 = OpLabel
%238 = OpLoad %int %j
%239 = OpLoad %int %i
%240 = OpIMul %int %238 %int_2
%241 = OpIMul %int %239 %int_2
%242 = OpIMul %int %241 %int_16
%243 = OpIAdd %int %240 %242
%244 = OpAccessChain %_ptr_Private_int %map %243
%245 = OpLoad %int %244
%246 = OpIEqual %bool %245 %int_0
OpSelectionMerge %247 None
OpBranchConditional %246 %248 %247
%248 = OpLabel
%249 = OpLoad %int %j
%250 = OpAccessChain %_ptr_Function_int %p %uint_0
%251 = OpIMul %int %249 %int_2
OpStore %250 %251
%252 = OpLoad %int %i
%253 = OpAccessChain %_ptr_Function_int %p %uint_1
%254 = OpIMul %int %252 %int_2
OpStore %253 %254
OpStore %canwalk %true
OpBranch %247
%247 = OpLabel
OpBranch %231
%231 = OpLabel
%255 = OpLoad %int %j
%256 = OpIAdd %int %255 %int_1
OpStore %j %256
OpBranch %229
%230 = OpLabel
OpBranch %221
%221 = OpLabel
%257 = OpLoad %int %i
%258 = OpIAdd %int %257 %int_1
OpStore %i %258
OpBranch %219
%220 = OpLabel
%259 = OpAccessChain %_ptr_Function_int %p %uint_0
%260 = OpLoad %int %259
%261 = OpAccessChain %_ptr_Function_int %p %uint_1
%262 = OpLoad %int %261
%263 = OpIMul %int %262 %int_16
%264 = OpIAdd %int %260 %263
%265 = OpAccessChain %_ptr_Private_int %map %264
OpStore %265 %int_1
OpBranch %215
%217 = OpLabel
%266 = OpLoad %int %v
%267 = OpLoad %int %directions
%268 = OpSMod %int %266 %267
OpStore %d %268
%269 = OpLoad %int %directions
%270 = OpLoad %int %v
%271 = OpIAdd %int %270 %269
OpStore %v %271
%272 = OpLoad %int %d
%273 = OpSGreaterThanEqual %bool %272 %int_0
OpStore %x_230_phi %273
OpSelectionMerge %274 None
OpBranchConditional %273 %275 %274
%275 = OpLabel
%276 = OpAccessChain %_ptr_Function_int %p %uint_0
%277 = OpLoad %int %276
%278 = OpSGreaterThan %bool %277 %int_0
OpStore %x_229 %278
%279 = OpLoad %bool %x_229
OpStore %x_230_phi %279
OpBranch %274
%274 = OpLabel
%280 = OpLoad %bool %x_230_phi
OpStore %x_243_phi %280
OpSelectionMerge %281 None
OpBranchConditional %280 %282 %281
%282 = OpLabel
%283 = OpAccessChain %_ptr_Function_int %p %uint_0
%284 = OpLoad %int %283
%285 = OpAccessChain %_ptr_Function_int %p %uint_1
%286 = OpLoad %int %285
%287 = OpISub %int %284 %int_2
%288 = OpIMul %int %286 %int_16
%289 = OpIAdd %int %287 %288
%290 = OpAccessChain %_ptr_Private_int %map %289
%291 = OpLoad %int %290
%292 = OpIEqual %bool %291 %int_0
OpStore %x_242 %292
%293 = OpLoad %bool %x_242
OpStore %x_243_phi %293
OpBranch %281
%281 = OpLabel
%294 = OpLoad %bool %x_243_phi
OpSelectionMerge %295 None
OpBranchConditional %294 %296 %295
%296 = OpLabel
%297 = OpLoad %int %d
%298 = OpISub %int %297 %int_1
OpStore %d %298
%299 = OpAccessChain %_ptr_Function_int %p %uint_0
%300 = OpLoad %int %299
%301 = OpAccessChain %_ptr_Function_int %p %uint_1
%302 = OpLoad %int %301
%303 = OpIMul %int %302 %int_16
%304 = OpIAdd %int %300 %303
%305 = OpAccessChain %_ptr_Private_int %map %304
OpStore %305 %int_1
%306 = OpAccessChain %_ptr_Function_int %p %uint_0
%307 = OpLoad %int %306
%308 = OpAccessChain %_ptr_Function_int %p %uint_1
%309 = OpLoad %int %308
%310 = OpISub %int %307 %int_1
%311 = OpIMul %int %309 %int_16
%312 = OpIAdd %int %310 %311
%313 = OpAccessChain %_ptr_Private_int %map %312
OpStore %313 %int_1
%314 = OpAccessChain %_ptr_Function_int %p %uint_0
%315 = OpLoad %int %314
%316 = OpAccessChain %_ptr_Function_int %p %uint_1
%317 = OpLoad %int %316
%318 = OpISub %int %315 %int_2
%319 = OpIMul %int %317 %int_16
%320 = OpIAdd %int %318 %319
%321 = OpAccessChain %_ptr_Private_int %map %320
OpStore %321 %int_1
%322 = OpAccessChain %_ptr_Function_int %p %uint_0
%323 = OpLoad %int %322
%324 = OpAccessChain %_ptr_Function_int %p %uint_0
%325 = OpISub %int %323 %int_2
OpStore %324 %325
OpBranch %295
%295 = OpLabel
%326 = OpLoad %int %d
%327 = OpSGreaterThanEqual %bool %326 %int_0
OpStore %x_282_phi %327
OpSelectionMerge %328 None
OpBranchConditional %327 %329 %328
%329 = OpLabel
%330 = OpAccessChain %_ptr_Function_int %p %uint_1
%331 = OpLoad %int %330
%332 = OpSGreaterThan %bool %331 %int_0
OpStore %x_281 %332
%333 = OpLoad %bool %x_281
OpStore %x_282_phi %333
OpBranch %328
%328 = OpLabel
%334 = OpLoad %bool %x_282_phi
OpSelectionMerge %335 None
OpBranchConditional %334 %336 %337
%336 = OpLabel
%338 = OpAccessChain %_ptr_Function_int %p %uint_0
%339 = OpLoad %int %338
OpStore %x_288 %339
%340 = OpLoad %int %x_288
OpStore %x_290_phi %340
OpBranch %335
%337 = OpLabel
OpStore %x_289 %int_0
%341 = OpLoad %int %x_289
OpStore %x_290_phi %341
OpBranch %335
%335 = OpLabel
%342 = OpLoad %int %x_290_phi
OpSelectionMerge %343 None
OpBranchConditional %334 %344 %345
%344 = OpLabel
%346 = OpAccessChain %_ptr_Function_int %p %uint_1
%347 = OpLoad %int %346
OpStore %x_295 %347
%348 = OpLoad %int %x_295
OpStore %x_297_phi %348
OpBranch %343
%345 = OpLabel
OpStore %x_296 %int_0
%349 = OpLoad %int %x_296
OpStore %x_297_phi %349
OpBranch %343
%343 = OpLabel
%350 = OpLoad %int %x_297_phi
%351 = OpISub %int %350 %int_2
%352 = OpIMul %int %351 %int_16
OpSelectionMerge %353 None
OpBranchConditional %334 %354 %355
%354 = OpLabel
%356 = OpLoad %_arr_int_uint_256 %map
OpStore %x_303 %356
%357 = OpLoad %_arr_int_uint_256 %x_303
OpStore %x_305_phi %357
OpBranch %353
%355 = OpLabel
OpStore %x_304 %358
%359 = OpLoad %_arr_int_uint_256 %x_304
OpStore %x_305_phi %359
OpBranch %353
%353 = OpLabel
%360 = OpLoad %_arr_int_uint_256 %x_305_phi
OpSelectionMerge %361 None
OpBranchConditional %334 %362 %361
%362 = OpLabel
OpStore %map %358
OpBranch %361
%361 = OpLabel
OpSelectionMerge %363 None
OpBranchConditional %334 %364 %363
%364 = OpLabel
OpStore %map %360
OpBranch %363
%363 = OpLabel
OpSelectionMerge %365 None
OpBranchConditional %334 %366 %367
%366 = OpLabel
%368 = OpIAdd %int %342 %352
%369 = OpAccessChain %_ptr_Private_int %map %368
%370 = OpLoad %int %369
OpStore %x_315 %370
%371 = OpLoad %int %x_315
OpStore %x_317_phi %371
OpBranch %365
%367 = OpLabel
OpStore %x_316 %int_0
%372 = OpLoad %int %x_316
OpStore %x_317_phi %372
OpBranch %365
%365 = OpLabel
%373 = OpLoad %int %x_317_phi
%374 = OpIEqual %bool %373 %int_0
%375 = OpSelect %bool %334 %374 %334
OpSelectionMerge %376 None
OpBranchConditional %375 %377 %376
%377 = OpLabel
%378 = OpLoad %int %d
%379 = OpISub %int %378 %int_1
OpStore %d %379
%380 = OpAccessChain %_ptr_Function_int %p %uint_0
%381 = OpLoad %int %380
%382 = OpAccessChain %_ptr_Function_int %p %uint_1
%383 = OpLoad %int %382
%384 = OpIMul %int %383 %int_16
%385 = OpIAdd %int %381 %384
%386 = OpAccessChain %_ptr_Private_int %map %385
OpStore %386 %int_1
%387 = OpAccessChain %_ptr_Function_int %p %uint_0
%388 = OpLoad %int %387
%389 = OpAccessChain %_ptr_Function_int %p %uint_1
%390 = OpLoad %int %389
%391 = OpISub %int %390 %int_1
%392 = OpIMul %int %391 %int_16
%393 = OpIAdd %int %388 %392
%394 = OpAccessChain %_ptr_Private_int %map %393
OpStore %394 %int_1
%395 = OpAccessChain %_ptr_Function_int %p %uint_0
%396 = OpLoad %int %395
%397 = OpAccessChain %_ptr_Function_int %p %uint_1
%398 = OpLoad %int %397
%399 = OpLoad %_arr_int_uint_256 %map
OpStore %map %358
OpStore %map %399
%400 = OpISub %int %398 %int_2
%401 = OpIMul %int %400 %int_16
%402 = OpIAdd %int %396 %401
%403 = OpAccessChain %_ptr_Private_int %map %402
OpStore %403 %int_1
%404 = OpAccessChain %_ptr_Function_int %p %uint_1
%405 = OpLoad %int %404
%406 = OpAccessChain %_ptr_Function_int %p %uint_1
%407 = OpISub %int %405 %int_2
OpStore %406 %407
OpBranch %376
%376 = OpLabel
%408 = OpLoad %int %d
%409 = OpSGreaterThanEqual %bool %408 %int_0
OpStore %x_360_phi %409
OpSelectionMerge %410 None
OpBranchConditional %409 %411 %410
%411 = OpLabel
%412 = OpAccessChain %_ptr_Function_int %p %uint_0
%413 = OpLoad %int %412
%414 = OpSLessThan %bool %413 %int_14
OpStore %x_359 %414
%415 = OpLoad %bool %x_359
OpStore %x_360_phi %415
OpBranch %410
%410 = OpLabel
%416 = OpLoad %bool %x_360_phi
OpStore %x_373_phi %416
OpSelectionMerge %417 None
OpBranchConditional %416 %418 %417
%418 = OpLabel
%419 = OpAccessChain %_ptr_Function_int %p %uint_0
%420 = OpLoad %int %419
%421 = OpAccessChain %_ptr_Function_int %p %uint_1
%422 = OpLoad %int %421
%423 = OpIAdd %int %420 %int_2
%424 = OpIMul %int %422 %int_16
%425 = OpIAdd %int %423 %424
%426 = OpAccessChain %_ptr_Private_int %map %425
%427 = OpLoad %int %426
%428 = OpIEqual %bool %427 %int_0
OpStore %x_372 %428
%429 = OpLoad %bool %x_372
OpStore %x_373_phi %429
OpBranch %417
%417 = OpLabel
%430 = OpLoad %bool %x_373_phi
OpSelectionMerge %431 None
OpBranchConditional %430 %432 %431
%432 = OpLabel
%433 = OpLoad %int %d
%434 = OpISub %int %433 %int_1
OpStore %d %434
%435 = OpAccessChain %_ptr_Function_int %p %uint_0
%436 = OpLoad %int %435
%437 = OpAccessChain %_ptr_Function_int %p %uint_1
%438 = OpLoad %int %437
%439 = OpIMul %int %438 %int_16
%440 = OpIAdd %int %436 %439
%441 = OpAccessChain %_ptr_Private_int %map %440
OpStore %441 %int_1
%442 = OpAccessChain %_ptr_Function_int %p %uint_0
%443 = OpLoad %int %442
%444 = OpAccessChain %_ptr_Function_int %p %uint_1
%445 = OpLoad %int %444
%446 = OpIAdd %int %443 %int_1
%447 = OpIMul %int %445 %int_16
%448 = OpIAdd %int %446 %447
%449 = OpAccessChain %_ptr_Private_int %map %448
OpStore %449 %int_1
%450 = OpAccessChain %_ptr_Function_int %p %uint_0
%451 = OpLoad %int %450
%452 = OpAccessChain %_ptr_Function_int %p %uint_1
%453 = OpLoad %int %452
%454 = OpIAdd %int %451 %int_2
%455 = OpIMul %int %453 %int_16
%456 = OpIAdd %int %454 %455
%457 = OpAccessChain %_ptr_Private_int %map %456
OpStore %457 %int_1
%458 = OpAccessChain %_ptr_Function_int %p %uint_0
%459 = OpLoad %int %458
%460 = OpAccessChain %_ptr_Function_int %p %uint_0
%461 = OpIAdd %int %459 %int_2
OpStore %460 %461
OpBranch %431
%431 = OpLabel
%462 = OpLoad %int %d
%463 = OpSGreaterThanEqual %bool %462 %int_0
OpStore %x_412_phi %463
OpSelectionMerge %464 None
OpBranchConditional %463 %465 %464
%465 = OpLabel
%466 = OpAccessChain %_ptr_Function_int %p %uint_1
%467 = OpLoad %int %466
%468 = OpSLessThan %bool %467 %int_14
OpStore %x_411 %468
%469 = OpLoad %bool %x_411
OpStore %x_412_phi %469
OpBranch %464
%464 = OpLabel
%470 = OpLoad %bool %x_412_phi
OpStore %x_425_phi %470
OpSelectionMerge %471 None
OpBranchConditional %470 %472 %471
%472 = OpLabel
%473 = OpAccessChain %_ptr_Function_int %p %uint_0
%474 = OpLoad %int %473
%475 = OpAccessChain %_ptr_Function_int %p %uint_1
%476 = OpLoad %int %475
%477 = OpIAdd %int %476 %int_2
%478 = OpIMul %int %477 %int_16
%479 = OpIAdd %int %474 %478
%480 = OpAccessChain %_ptr_Private_int %map %479
%481 = OpLoad %int %480
%482 = OpIEqual %bool %481 %int_0
OpStore %x_424 %482
%483 = OpLoad %bool %x_424
OpStore %x_425_phi %483
OpBranch %471
%471 = OpLabel
%484 = OpLoad %bool %x_425_phi
OpSelectionMerge %485 None
OpBranchConditional %484 %486 %485
%486 = OpLabel
%487 = OpLoad %int %d
%488 = OpISub %int %487 %int_1
OpStore %d %488
%489 = OpAccessChain %_ptr_Function_int %p %uint_0
%490 = OpLoad %int %489
%491 = OpAccessChain %_ptr_Function_int %p %uint_1
%492 = OpLoad %int %491
%493 = OpIMul %int %492 %int_16
%494 = OpIAdd %int %490 %493
%495 = OpAccessChain %_ptr_Private_int %map %494
OpStore %495 %int_1
%496 = OpAccessChain %_ptr_Function_int %p %uint_0
%497 = OpLoad %int %496
%498 = OpAccessChain %_ptr_Function_int %p %uint_1
%499 = OpLoad %int %498
%500 = OpIAdd %int %499 %int_1
%501 = OpIMul %int %500 %int_16
%502 = OpIAdd %int %497 %501
%503 = OpAccessChain %_ptr_Private_int %map %502
OpStore %503 %int_1
%504 = OpAccessChain %_ptr_Function_int %p %uint_0
%505 = OpLoad %int %504
%506 = OpAccessChain %_ptr_Function_int %p %uint_1
%507 = OpLoad %int %506
%508 = OpIAdd %int %507 %int_2
%509 = OpIMul %int %508 %int_16
%510 = OpIAdd %int %505 %509
%511 = OpAccessChain %_ptr_Private_int %map %510
OpStore %511 %int_1
%512 = OpAccessChain %_ptr_Function_int %p %uint_1
%513 = OpLoad %int %512
%514 = OpAccessChain %_ptr_Function_int %p %uint_1
%515 = OpIAdd %int %513 %int_2
OpStore %514 %515
OpBranch %485
%485 = OpLabel
OpBranch %215
%215 = OpLabel
%516 = OpAccessChain %_ptr_Function_int %ipos %uint_1
%517 = OpLoad %int %516
%518 = OpAccessChain %_ptr_Function_int %ipos %uint_0
%519 = OpLoad %int %518
%520 = OpIMul %int %517 %int_16
%521 = OpIAdd %int %520 %519
%522 = OpAccessChain %_ptr_Private_int %map %521
%523 = OpLoad %int %522
%524 = OpIEqual %bool %523 %int_1
OpSelectionMerge %525 None
OpBranchConditional %524 %526 %525
%526 = OpLabel
OpStore %x_GLF_color %528
OpReturn
%525 = OpLabel
OpBranch %87
%87 = OpLabel
%529 = OpLoad %bool %canwalk
OpBranchConditional %529 %85 %86
%86 = OpLabel
OpStore %x_GLF_color %531
OpReturn
OpFunctionEnd
%tint_symbol_3 = OpFunction %void None %532
%tint_symbol_1 = OpFunctionParameter %main_out
%536 = OpLabel
%537 = OpCompositeExtract %v4float %tint_symbol_1 0
OpStore %tint_symbol_2 %537
OpReturn
OpFunctionEnd
%main = OpFunction %void None %22
%539 = OpLabel
%540 = OpLoad %v4float %tint_symbol
OpStore %gl_FragCoord %540
%541 = OpFunctionCall %void %main_1
%543 = OpLoad %v4float %x_GLF_color
%544 = OpCompositeConstruct %main_out %543
%542 = OpFunctionCall %void %tint_symbol_3 %544
OpReturn
OpFunctionEnd