1; SPIR-V
2; Version: 1.0
3; Generator: Khronos SPIR-V Tools Assembler; 0
4; Bound: 36
5; Schema: 0
6               OpCapability Addresses
7               OpCapability Linkage
8               OpCapability Kernel
9               OpCapability Int64
10               OpMemoryModel Physical64 OpenCL
11               OpEntryPoint Kernel %1 "branch_conditional" %gl_GlobalInvocationID
12               OpName %res "res"
13               OpName %lhs "lhs"
14               OpName %rhs "rhs"
15               OpDecorate %5 FuncParamAttr NoCapture
16          %5 = OpDecorationGroup
17               OpDecorate %gl_GlobalInvocationID BuiltIn GlobalInvocationId
18               OpDecorate %gl_GlobalInvocationID Constant
19               OpDecorate %gl_GlobalInvocationID LinkageAttributes "__spirv_GlobalInvocationId" Import
20               OpGroupDecorate %5 %res %lhs %rhs
21      %ulong = OpTypeInt 64 0
22    %v3ulong = OpTypeVector %ulong 3
23%_ptr_Input_v3ulong = OpTypePointer Input %v3ulong
24       %bool = OpTypeBool
25       %void = OpTypeVoid
26       %uint = OpTypeInt 32 0
27   %ulong_32 = OpConstant %ulong 32
28     %uint_0 = OpConstant %uint 0
29%_ptr_CrossWorkgroup_uint = OpTypePointer CrossWorkgroup %uint
30%_ptr_Function_uint = OpTypePointer Function %uint
31         %17 = OpTypeFunction %void %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint %_ptr_CrossWorkgroup_uint
32%gl_GlobalInvocationID = OpVariable %_ptr_Input_v3ulong Input
33          %1 = OpFunction %void None %17
34        %res = OpFunctionParameter %_ptr_CrossWorkgroup_uint
35        %lhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
36        %rhs = OpFunctionParameter %_ptr_CrossWorkgroup_uint
37         %18 = OpLabel
38         %19 = OpVariable %_ptr_Function_uint Function
39         %20 = OpLoad %v3ulong %gl_GlobalInvocationID Aligned 0
40         %21 = OpCompositeExtract %ulong %20 0
41         %22 = OpShiftLeftLogical %ulong %21 %ulong_32
42         %23 = OpShiftRightArithmetic %ulong %22 %ulong_32
43         %24 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %lhs %23
44         %25 = OpLoad %uint %24 Aligned 4
45         %26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23
46         %27 = OpLoad %uint %26 Aligned 4
47               OpStore %19 %uint_0
48         %28 = OpSLessThan %bool %25 %27
49               OpBranchConditional %28 %29 %30
50         %29 = OpLabel
51         %31 = OpISub %uint %27 %25
52               OpStore %19 %31
53               OpBranch %32
54         %30 = OpLabel
55         %33 = OpISub %uint %25 %27
56               OpStore %19 %33
57               OpBranch %32
58         %32 = OpLabel
59         %34 = OpLoad %uint %19
60         %35 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %res %23
61               OpStore %35 %34 Aligned 4
62               OpReturn
63               OpFunctionEnd
64