| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 0 |
| ; Bound: 58 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint Fragment %main "main" %x_1 %value |
| OpExecutionMode %main OriginUpperLeft |
| OpName %x_1 "x_1" |
| OpName %value "value" |
| OpName %tint_discard "tint_discard" |
| OpName %f "f" |
| OpName %x "x" |
| OpName %tint_return_flag "tint_return_flag" |
| OpName %tint_return_value "tint_return_value" |
| OpName %tint_discard_func "tint_discard_func" |
| 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 |
| %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 |
| %7 = OpConstantNull %int |
| %value = OpVariable %_ptr_Output_int Output %7 |
| %bool = OpTypeBool |
| %9 = OpConstantNull %bool |
| %_ptr_Private_bool = OpTypePointer Private %bool |
| %tint_discard = OpVariable %_ptr_Private_bool Private %9 |
| %12 = OpTypeFunction %int %int |
| %_ptr_Function_bool = OpTypePointer Function %bool |
| %_ptr_Function_int = OpTypePointer Function %int |
| %int_10 = OpConstant %int 10 |
| %true = OpConstantTrue %bool |
| %void = OpTypeVoid |
| %30 = OpTypeFunction %void |
| %34 = OpTypeFunction %int %v3int |
| %f = OpFunction %int None %12 |
| %x = OpFunctionParameter %int |
| %15 = OpLabel |
| %tint_return_flag = OpVariable %_ptr_Function_bool Function %9 |
| %tint_return_value = OpVariable %_ptr_Function_int Function %7 |
| %21 = OpIEqual %bool %x %int_10 |
| OpSelectionMerge %22 None |
| OpBranchConditional %21 %23 %22 |
| %23 = OpLabel |
| OpStore %tint_discard %true |
| OpStore %tint_return_flag %true |
| OpStore %tint_return_value %7 |
| OpBranch %22 |
| %22 = OpLabel |
| %26 = OpLoad %bool %tint_return_flag |
| %25 = OpLogicalNot %bool %26 |
| OpSelectionMerge %27 None |
| OpBranchConditional %25 %28 %27 |
| %28 = OpLabel |
| OpStore %tint_return_flag %true |
| OpStore %tint_return_value %x |
| OpBranch %27 |
| %27 = OpLabel |
| %29 = OpLoad %int %tint_return_value |
| OpReturnValue %29 |
| OpFunctionEnd |
| %tint_discard_func = OpFunction %void None %30 |
| %33 = OpLabel |
| OpKill |
| OpFunctionEnd |
| %main_inner = OpFunction %int None %34 |
| %x_0 = OpFunctionParameter %v3int |
| %37 = OpLabel |
| %y = OpVariable %_ptr_Function_int Function %7 |
| %38 = OpCompositeExtract %int %x_0 0 |
| OpStore %y %38 |
| OpBranch %40 |
| %40 = OpLabel |
| OpLoopMerge %41 %42 None |
| OpBranch %43 |
| %43 = OpLabel |
| %45 = OpLoad %int %y |
| %44 = OpFunctionCall %int %f %45 |
| %46 = OpLoad %bool %tint_discard |
| OpSelectionMerge %47 None |
| OpBranchConditional %46 %48 %47 |
| %48 = OpLabel |
| %49 = OpFunctionCall %void %tint_discard_func |
| OpReturnValue %7 |
| %47 = OpLabel |
| %50 = OpIEqual %bool %44 %7 |
| OpSelectionMerge %51 None |
| OpBranchConditional %50 %52 %51 |
| %52 = OpLabel |
| OpBranch %41 |
| %51 = OpLabel |
| OpBranch %42 |
| %42 = OpLabel |
| OpBranch %40 |
| %41 = OpLabel |
| %53 = OpLoad %int %y |
| OpReturnValue %53 |
| OpFunctionEnd |
| %main = OpFunction %void None %30 |
| %55 = OpLabel |
| %57 = OpLoad %v3int %x_1 |
| %56 = OpFunctionCall %int %main_inner %57 |
| OpStore %value %56 |
| OpReturn |
| OpFunctionEnd |