| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 47 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" %x_1 %value |
| OpExecutionMode %main OriginUpperLeft |
| OpName %tint_discarded "tint_discarded" |
| OpName %x_1 "x_1" |
| OpName %value "value" |
| OpName %f "f" |
| OpName %x "x" |
| OpName %main_inner "main_inner" |
| OpName %x_0 "x" |
| OpName %y "y" |
| OpName %main "main" |
| OpDecorate %x_1 Location 1 |
| OpDecorate %x_1 Flat |
| OpDecorate %value Location 2 |
| %bool = OpTypeBool |
| %2 = OpConstantNull %bool |
| %_ptr_Private_bool = OpTypePointer Private %bool |
| %tint_discarded = OpVariable %_ptr_Private_bool Private %2 |
| %int = OpTypeInt 32 1 |
| %v3int = OpTypeVector %int 3 |
| %_ptr_Input_v3int = OpTypePointer Input %v3int |
| %x_1 = OpVariable %_ptr_Input_v3int Input |
| %_ptr_Output_int = OpTypePointer Output %int |
| %11 = OpConstantNull %int |
| %value = OpVariable %_ptr_Output_int Output %11 |
| %12 = OpTypeFunction %int %int |
| %int_10 = OpConstant %int 10 |
| %true = OpConstantTrue %bool |
| %21 = OpTypeFunction %int %v3int |
| %_ptr_Function_int = OpTypePointer Function %int |
| %void = OpTypeVoid |
| %38 = OpTypeFunction %void |
| %f = OpFunction %int None %12 |
| %x = OpFunctionParameter %int |
| %15 = OpLabel |
| %17 = OpIEqual %bool %x %int_10 |
| OpSelectionMerge %18 None |
| OpBranchConditional %17 %19 %18 |
| %19 = OpLabel |
| OpStore %tint_discarded %true |
| OpBranch %18 |
| %18 = OpLabel |
| OpReturnValue %x |
| OpFunctionEnd |
| %main_inner = OpFunction %int None %21 |
| %x_0 = OpFunctionParameter %v3int |
| %24 = OpLabel |
| %y = OpVariable %_ptr_Function_int Function %11 |
| %25 = OpCompositeExtract %int %x_0 0 |
| OpStore %y %25 |
| OpBranch %28 |
| %28 = OpLabel |
| OpLoopMerge %29 %30 None |
| OpBranch %31 |
| %31 = OpLabel |
| %33 = OpLoad %int %y |
| %32 = OpFunctionCall %int %f %33 |
| %34 = OpIEqual %bool %32 %11 |
| OpSelectionMerge %35 None |
| OpBranchConditional %34 %36 %35 |
| %36 = OpLabel |
| OpBranch %29 |
| %35 = OpLabel |
| OpBranch %30 |
| %30 = OpLabel |
| OpBranch %28 |
| %29 = OpLabel |
| %37 = OpLoad %int %y |
| OpReturnValue %37 |
| OpFunctionEnd |
| %main = OpFunction %void None %38 |
| %41 = OpLabel |
| %43 = OpLoad %v3int %x_1 |
| %42 = OpFunctionCall %int %main_inner %43 |
| OpStore %value %42 |
| %44 = OpLoad %bool %tint_discarded |
| OpSelectionMerge %45 None |
| OpBranchConditional %44 %46 %45 |
| %46 = OpLabel |
| OpKill |
| %45 = OpLabel |
| OpReturn |
| OpFunctionEnd |