| ; SPIR-V |
| ; Version: 1.3 |
| ; Generator: Google Tint Compiler; 1 |
| ; Bound: 38 |
| ; Schema: 0 |
| OpCapability Shader |
| OpMemoryModel Logical GLSL450 |
| OpEntryPoint GLCompute %f "f" |
| OpExecutionMode %f LocalSize 1 1 1 |
| OpName %f "f" |
| OpName %a "a" |
| OpName %b "b" |
| OpName %r "r" |
| OpName %tint_mod_i32 "tint_mod_i32" |
| OpName %lhs "lhs" |
| OpName %rhs "rhs" |
| %void = OpTypeVoid |
| %3 = OpTypeFunction %void |
| %int = OpTypeInt 32 1 |
| %_ptr_Function_int = OpTypePointer Function %int |
| %int_1 = OpConstant %int 1 |
| %int_0 = OpConstant %int 0 |
| %17 = OpTypeFunction %int %int %int |
| %bool = OpTypeBool |
| %int_n2147483648 = OpConstant %int -2147483648 |
| %int_n1 = OpConstant %int -1 |
| %uint = OpTypeInt 32 0 |
| %f = OpFunction %void None %3 |
| %4 = OpLabel |
| %a = OpVariable %_ptr_Function_int Function |
| %b = OpVariable %_ptr_Function_int Function |
| OpStore %a %int_1 |
| OpStore %b %int_0 |
| %11 = OpLoad %int %a None |
| %12 = OpLoad %int %b None |
| %r = OpFunctionCall %int %tint_mod_i32 %11 %12 |
| OpReturn |
| OpFunctionEnd |
| %tint_mod_i32 = OpFunction %int None %17 |
| %lhs = OpFunctionParameter %int |
| %rhs = OpFunctionParameter %int |
| %18 = OpLabel |
| %19 = OpIEqual %bool %rhs %int_0 |
| %21 = OpIEqual %bool %lhs %int_n2147483648 |
| %23 = OpIEqual %bool %rhs %int_n1 |
| %25 = OpLogicalAnd %bool %21 %23 |
| %26 = OpLogicalOr %bool %19 %25 |
| %27 = OpSelect %int %26 %int_1 %rhs |
| %28 = OpSDiv %int %lhs %27 |
| %30 = OpBitcast %uint %28 |
| %31 = OpBitcast %uint %27 |
| %32 = OpIMul %uint %30 %31 |
| %33 = OpBitcast %int %32 |
| %34 = OpBitcast %uint %lhs |
| %35 = OpBitcast %uint %33 |
| %36 = OpISub %uint %34 %35 |
| %37 = OpBitcast %int %36 |
| OpReturnValue %37 |
| OpFunctionEnd |