// File: GouMinghao[P]graspnms/grasp_nms.cpp
// Function: _Pyx_InitCachedConstants()
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "grasp_nms.pyx":20
 * def arg_sort_grasp(np.ndarray grasps):
 *     cdef int num_grasp = grasps.shape[0]
 *     cdef np.ndarray grasp_score  = grasps[:,1]             # <<<<<<<<<<<<<<
 *     cdef np.ndarray sorted_arg = np.argsort(grasp_score)
 *     return sorted_arg
 */
  __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice_);
  __Pyx_GIVEREF(__pyx_slice_);
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_slice_, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "grasp_nms.pyx":54
 *     # BGR -> RGB
 *     if ary.ndim == 3 and ary.shape[2] == 3:
 *         ary = np.dstack((ary[...,2], ary[...,1], ary[...,0]))             # <<<<<<<<<<<<<<
 *     # Convert to numpy array
 *     pyarr = np.asarray(ary)
 */
  __pyx_tuple__3 = PyTuple_Pack(2, Py_Ellipsis, __pyx_int_2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);
  __pyx_tuple__4 = PyTuple_Pack(2, Py_Ellipsis, __pyx_int_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);
  __pyx_tuple__5 = PyTuple_Pack(2, Py_Ellipsis, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "grasp_nms.pyx":58
 *     pyarr = np.asarray(ary)
 *     if pyarr.ndim == 3 and pyarr.shape[2] == 1:
 *         pyarr = np.reshape(pyarr, pyarr.shape[:-1])             # <<<<<<<<<<<<<<
 *     return pyarr
 */
  __pyx_slice__6 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__6)) __PYX_ERR(0, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__6);
  __Pyx_GIVEREF(__pyx_slice__6);

  /* "../../../../home/gmh/anaconda3/envs/t/lib/python3.8/site-packages/numpy/__init__.pxd":947
 *         __pyx_import_array()
 *     except Exception:
 *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_umath() except -1:
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "../../../../home/gmh/anaconda3/envs/t/lib/python3.8/site-packages/numpy/__init__.pxd":953
 *         _import_umath()
 *     except Exception:
 *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
 * 
 * cdef inline int import_ufunc() except -1:
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "grasp_nms.pyx":18
 *     return da
 * 
 * def arg_sort_grasp(np.ndarray grasps):             # <<<<<<<<<<<<<<
 *     cdef int num_grasp = grasps.shape[0]
 *     cdef np.ndarray grasp_score  = grasps[:,1]
 */
  __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_grasps, __pyx_n_s_num_grasp, __pyx_n_s_grasp_score, __pyx_n_s_sorted_arg); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_grasp_nms_pyx, __pyx_n_s_arg_sort_grasp, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 18, __pyx_L1_error)

  /* "grasp_nms.pyx":24
 *     return sorted_arg
 * 
 * def print_data(ary):             # <<<<<<<<<<<<<<
 *     a = np2array(ary)
 *     a.print_data()
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_ary, __pyx_n_s_a); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_grasp_nms_pyx, __pyx_n_s_print_data, 24, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 24, __pyx_L1_error)

  /* "grasp_nms.pyx":28
 *     a.print_data()
 * 
 * def nms_grasp(np.ndarray grasps,double t,double r):             # <<<<<<<<<<<<<<
 *     a = np2array(grasps)
 *     return array2np(grasp_nms(a,tuple_thresh(t,r)))
 */
  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_grasps, __pyx_n_s_t, __pyx_n_s_r, __pyx_n_s_a); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_grasp_nms_pyx, __pyx_n_s_nms_grasp, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 28, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq 0x14e08(%rip), %rdx     # 0x22f40
movq %rdx, %rdi
movq %rdx, %rsi
callq 0xb440
movq %rax, 0x15bae(%rip)     # 0x23cf8
cmpq $0x0, 0x15ba6(%rip)     # 0x23cf8
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe161
jmp 0xe188
movq 0x152a8(%rip), %rax     # 0x23410
movq %rax, 0x15a71(%rip)     # 0x23be0
movl $0x14, 0x15a6f(%rip)    # 0x23be8
movl $0xef5, 0x15a69(%rip)   # imm = 0xEF5
jmp 0xe7b0
movq 0x15b69(%rip), %rsi     # 0x23cf8
movq 0x15a62(%rip), %rdx     # 0x23bf8
movl $0x2, %edi
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x15b57(%rip)     # 0x23d00
cmpq $0x0, 0x15b4f(%rip)     # 0x23d00
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe1c0
jmp 0xe1e7
movq 0x15249(%rip), %rax     # 0x23410
movq %rax, 0x15a12(%rip)     # 0x23be0
movl $0x14, 0x15a10(%rip)    # 0x23be8
movl $0xef8, 0x15a0a(%rip)   # imm = 0xEF8
jmp 0xe7b0
movq 0x15a12(%rip), %rdx     # 0x23c00
movl $0x2, %edi
movq 0x14d3e(%rip), %rsi     # 0x22f38
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x15b00(%rip)     # 0x23d08
cmpq $0x0, 0x15af8(%rip)     # 0x23d08
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe21f
jmp 0xe246
movq 0x151ea(%rip), %rax     # 0x23410
movq %rax, 0x159b3(%rip)     # 0x23be0
movl $0x36, 0x159b1(%rip)    # 0x23be8
movl $0xf03, 0x159ab(%rip)   # imm = 0xF03
jmp 0xe7b0
movq 0x159ab(%rip), %rdx     # 0x23bf8
movl $0x2, %edi
movq 0x14cdf(%rip), %rsi     # 0x22f38
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x15aa9(%rip)     # 0x23d10
cmpq $0x0, 0x15aa1(%rip)     # 0x23d10
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe27e
jmp 0xe2a5
movq 0x1518b(%rip), %rax     # 0x23410
movq %rax, 0x15954(%rip)     # 0x23be0
movl $0x36, 0x15952(%rip)    # 0x23be8
movl $0xf06, 0x1594c(%rip)   # imm = 0xF06
jmp 0xe7b0
movq 0x15944(%rip), %rdx     # 0x23bf0
movl $0x2, %edi
movq 0x14c80(%rip), %rsi     # 0x22f38
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x15a52(%rip)     # 0x23d18
cmpq $0x0, 0x15a4a(%rip)     # 0x23d18
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe2dd
jmp 0xe304
movq 0x1512c(%rip), %rax     # 0x23410
movq %rax, 0x158f5(%rip)     # 0x23be0
movl $0x36, 0x158f3(%rip)    # 0x23be8
movl $0xf09, 0x158ed(%rip)   # imm = 0xF09
jmp 0xe7b0
movq 0x15905(%rip), %rsi     # 0x23c10
movq 0x14c2e(%rip), %rdx     # 0x22f40
movq %rdx, %rdi
callq 0xb440
movq %rax, 0x159ff(%rip)     # 0x23d20
cmpq $0x0, 0x159f7(%rip)     # 0x23d20
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe338
jmp 0xe35f
movq 0x150d1(%rip), %rax     # 0x23410
movq %rax, 0x1589a(%rip)     # 0x23be0
movl $0x3a, 0x15898(%rip)    # 0x23be8
movl $0xf13, 0x15892(%rip)   # imm = 0xF13
jmp 0xe7b0
movq 0x1594a(%rip), %rsi     # 0x23cb0
movl $0x1, %edi
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x159af(%rip)     # 0x23d28
cmpq $0x0, 0x159a7(%rip)     # 0x23d28
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe390
jmp 0xe3b7
movq 0x15081(%rip), %rax     # 0x23418
movq %rax, 0x15842(%rip)     # 0x23be0
movl $0x3b3, 0x15840(%rip)   # imm = 0x3B3
movl $0xf1e, 0x1583a(%rip)   # imm = 0xF1E
jmp 0xe7b0
movq 0x158fa(%rip), %rsi     # 0x23cb8
movl $0x1, %edi
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x1595f(%rip)     # 0x23d30
cmpq $0x0, 0x15957(%rip)     # 0x23d30
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe3e8
jmp 0xe40f
movq 0x15029(%rip), %rax     # 0x23418
movq %rax, 0x157ea(%rip)     # 0x23be0
movl $0x3b9, 0x157e8(%rip)   # imm = 0x3B9
movl $0xf29, 0x157e2(%rip)   # imm = 0xF29
jmp 0xe7b0
movq 0x1587a(%rip), %rsi     # 0x23c90
movq 0x1588b(%rip), %rdx     # 0x23ca8
movq 0x15864(%rip), %rcx     # 0x23c88
movq 0x158b5(%rip), %r8      # 0x23ce0
movl $0x4, %edi
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x158fa(%rip)     # 0x23d38
cmpq $0x0, 0x158f2(%rip)     # 0x23d38
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe455
jmp 0xe47c
movq 0x14fb4(%rip), %rax     # 0x23410
movq %rax, 0x1577d(%rip)     # 0x23be0
movl $0x12, 0x1577b(%rip)    # 0x23be8
movl $0xf34, 0x15775(%rip)   # imm = 0xF34
jmp 0xe7b0
movq 0x156e5(%rip), %r9      # 0x23b68
movq 0x156d6(%rip), %r13     # 0x23b60
movq 0x156cf(%rip), %r12     # 0x23b60
movq 0x158a0(%rip), %r15     # 0x23d38
movq 0x156c1(%rip), %r14     # 0x23b60
movq 0x156ba(%rip), %rbx     # 0x23b60
movq 0x157d3(%rip), %r11     # 0x23c80
movq 0x1570c(%rip), %r10     # 0x23bc0
movq 0x156ad(%rip), %rax     # 0x23b68
movl $0x1, %edi
xorl %ecx, %ecx
movl $0x4, %edx
movl $0x3, %r8d
movl %ecx, %esi
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl $0x12, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0xb170
movq %rax, 0x15836(%rip)     # 0x23d40
cmpq $0x0, 0x1582e(%rip)     # 0x23d40
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe521
jmp 0xe548
movq 0x14ee8(%rip), %rax     # 0x23410
movq %rax, 0x156b1(%rip)     # 0x23be0
movl $0x12, 0x156af(%rip)    # 0x23be8
movl $0xf37, 0x156a9(%rip)   # imm = 0xF37
jmp 0xe7b0
movq 0x156e1(%rip), %rsi     # 0x23c30
movq 0x156ca(%rip), %rdx     # 0x23c20
movl $0x2, %edi
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x157df(%rip)     # 0x23d48
cmpq $0x0, 0x157d7(%rip)     # 0x23d48
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe580
jmp 0xe5a7
movq 0x14e89(%rip), %rax     # 0x23410
movq %rax, 0x15652(%rip)     # 0x23be0
movl $0x18, 0x15650(%rip)    # 0x23be8
movl $0xf40, 0x1564a(%rip)   # imm = 0xF40
jmp 0xe7b0
movq 0x155ba(%rip), %r9      # 0x23b68
movq 0x155ab(%rip), %r13     # 0x23b60
movq 0x155a4(%rip), %r12     # 0x23b60
movq 0x15785(%rip), %r15     # 0x23d48
movq 0x15596(%rip), %r14     # 0x23b60
movq 0x1558f(%rip), %rbx     # 0x23b60
movq 0x156a8(%rip), %r11     # 0x23c80
movq 0x155e9(%rip), %r10     # 0x23bc8
movq 0x15582(%rip), %rax     # 0x23b68
movl $0x1, %edi
xorl %ecx, %ecx
movl $0x2, %edx
movl $0x3, %r8d
movl %ecx, %esi
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl $0x18, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0xb170
movq %rax, 0x1571b(%rip)     # 0x23d50
cmpq $0x0, 0x15713(%rip)     # 0x23d50
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe64c
jmp 0xe673
movq 0x14dbd(%rip), %rax     # 0x23410
movq %rax, 0x15586(%rip)     # 0x23be0
movl $0x18, 0x15584(%rip)    # 0x23be8
movl $0xf43, 0x1557e(%rip)   # imm = 0xF43
jmp 0xe7b0
movq 0x15616(%rip), %rsi     # 0x23c90
movq 0x15667(%rip), %rdx     # 0x23ce8
movq 0x15640(%rip), %rcx     # 0x23cc8
movq 0x15591(%rip), %r8      # 0x23c20
movl $0x4, %edi
movb $0x0, %al
callq 0xb0e0
movq %rax, 0x156b6(%rip)     # 0x23d58
cmpq $0x0, 0x156ae(%rip)     # 0x23d58
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe6b9
jmp 0xe6e0
movq 0x14d50(%rip), %rax     # 0x23410
movq %rax, 0x15519(%rip)     # 0x23be0
movl $0x1c, 0x15517(%rip)    # 0x23be8
movl $0xf4c, 0x15511(%rip)   # imm = 0xF4C
jmp 0xe7b0
movq 0x15481(%rip), %r9      # 0x23b68
movq 0x15472(%rip), %r13     # 0x23b60
movq 0x1546b(%rip), %r12     # 0x23b60
movq 0x1565c(%rip), %r15     # 0x23d58
movq 0x1545d(%rip), %r14     # 0x23b60
movq 0x15456(%rip), %rbx     # 0x23b60
movq 0x1556f(%rip), %r11     # 0x23c80
movq 0x154b8(%rip), %r10     # 0x23bd0
movq 0x15449(%rip), %rax     # 0x23b68
movl $0x3, %r8d
xorl %ecx, %ecx
movl $0x4, %edx
movl %r8d, %edi
movl %ecx, %esi
movq %r13, (%rsp)
movq %r12, 0x8(%rsp)
movq %r15, 0x10(%rsp)
movq %r14, 0x18(%rsp)
movq %rbx, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movl $0x1c, 0x38(%rsp)
movq %rax, 0x40(%rsp)
callq 0xb170
movq %rax, 0x155f4(%rip)     # 0x23d60
cmpq $0x0, 0x155ec(%rip)     # 0x23d60
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xe783
jmp 0xe7a7
movq 0x14c86(%rip), %rax     # 0x23410
movq %rax, 0x1544f(%rip)     # 0x23be0
movl $0x1c, 0x1544d(%rip)    # 0x23be8
movl $0xf4f, 0x15447(%rip)   # imm = 0xF4F
jmp 0xe7b0
movl $0x0, -0x2c(%rbp)
jmp 0xe7b7
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl -0x2c(%rbp), %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)