// File: /workspace/github_cpp_makefile_star2_O1/manikandan5[P]Image-Matching-Stitching-Warping/./CImg.h
// Function: void cimg_library::CImgDisplay::_resize<unsigned char>(unsigned char, unsigned int, unsigned int, bool)
void _resize(T pixel_type, const unsigned int ndimx, const unsigned int ndimy, const bool force_redraw) {
      Display *const dpy = cimg::X11_attr().display;
      cimg::unused(pixel_type);

#ifdef cimg_use_xshm
      if (_shminfo) {
        XShmSegmentInfo *const nshminfo = new XShmSegmentInfo;
        XImage *const nimage = XShmCreateImage(dpy,DefaultVisual(dpy,DefaultScreen(dpy)),
                                               cimg::X11_attr().nb_bits,ZPixmap,0,nshminfo,ndimx,ndimy);
        if (!nimage) { delete nshminfo; return; }
        else {
          nshminfo->shmid = shmget(IPC_PRIVATE,ndimx*ndimy*sizeof(T),IPC_CREAT | 0777);
          if (nshminfo->shmid==-1) { XDestroyImage(nimage); delete nshminfo; return; }
          else {
            nshminfo->shmaddr = nimage->data = (char*)shmat(nshminfo->shmid,0,0);
            if (nshminfo->shmaddr==(char*)-1) {
              shmctl(nshminfo->shmid,IPC_RMID,0); XDestroyImage(nimage); delete nshminfo; return;
            } else {
              nshminfo->readOnly = 0;
              cimg::X11_attr().is_shm_enabled = true;
              XErrorHandler oldXErrorHandler = XSetErrorHandler(_assign_xshm);
              XShmAttach(dpy,nshminfo);
              XFlush(dpy);
              XSetErrorHandler(oldXErrorHandler);
              if (!cimg::X11_attr().is_shm_enabled) {
                shmdt(nshminfo->shmaddr);
                shmctl(nshminfo->shmid,IPC_RMID,0);
                XDestroyImage(nimage);
                delete nshminfo;
                return;
              } else {
                T *const ndata = (T*)nimage->data;
                if (force_redraw) _render_resize((T*)_data,_width,_height,ndata,ndimx,ndimy);
                else std::memset(ndata,0,sizeof(T)*ndimx*ndimy);
                XShmDetach(dpy,_shminfo);
                XDestroyImage(_image);
                shmdt(_shminfo->shmaddr);
                shmctl(_shminfo->shmid,IPC_RMID,0);
                delete _shminfo;
                _shminfo = nshminfo;
                _image = nimage;
                _data = (void*)ndata;
              }
            }
          }
        }
      } else
#endif
        {
          T *ndata = (T*)std::malloc(ndimx*ndimy*sizeof(T));
          if (force_redraw) _render_resize((T*)_data,_width,_height,ndata,ndimx,ndimy);
          else std::memset(ndata,0,sizeof(T)*ndimx*ndimy);
          _data = (void*)ndata;
          XDestroyImage(_image);
          _image = XCreateImage(dpy,DefaultVisual(dpy,DefaultScreen(dpy)),
                                cimg::X11_attr().nb_bits,ZPixmap,0,(char*)_data,ndimx,ndimy,8,0);
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r14d
movq %rdi, %rbx
movb 0x785b9(%rip), %al      # 0xafcf0
testb %al, %al
je 0x37805
movq 0x7859a(%rip), %r12     # 0xafce0
movl %r15d, %edi
imull %r14d, %edi
callq 0x46a0
movq %rax, %r13
testb %bpl, %bpl
je 0x37777
movq 0x4f0(%rbx), %rdi
movl 0x18(%rbx), %esi
movl 0x1c(%rbx), %edx
movq %r13, %rcx
movl %r14d, %r8d
movl %r15d, %r9d
callq 0x28fec
jmp 0x3778b
movl %r14d, %eax
movl %r15d, %edx
imulq %rax, %rdx
movq %r13, %rdi
xorl %esi, %esi
callq 0x4290
movq %r13, 0x4f0(%rbx)
movq 0x4e8(%rbx), %rdi
callq *0x60(%rdi)
movq 0xe8(%r12), %rax
movslq 0xe0(%r12), %rcx
shlq $0x7, %rcx
movq 0x40(%rax,%rcx), %r13
movb 0x78535(%rip), %al      # 0xafcf0
testb %al, %al
je 0x37850
movl 0x7851f(%rip), %edx     # 0xafce8
movq 0x4f0(%rbx), %r9
movq %r12, %rdi
movq %r13, %rsi
movl $0x2, %ecx
xorl %r8d, %r8d
pushq $0x0
pushq $0x8
pushq %r15
pushq %r14
callq 0x4620
addq $0x20, %rsp
movq %rax, 0x4e8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x784e4(%rip), %rdi     # 0xafcf0
callq 0x49b0
testl %eax, %eax
je 0x3773f
leaq 0x76458(%rip), %rdi     # 0xadc78
callq 0x21188
leaq -0x16666(%rip), %rdi    # 0x211c6
leaq 0x76445(%rip), %rsi     # 0xadc78
leaq 0x75d1e(%rip), %rdx     # 0xad558
callq 0x44b0
leaq 0x784aa(%rip), %rdi     # 0xafcf0
callq 0x4330
jmp 0x3773f
leaq 0x78499(%rip), %rdi     # 0xafcf0
callq 0x49b0
testl %eax, %eax
je 0x377c3
leaq 0x7640d(%rip), %rdi     # 0xadc78
callq 0x21188
leaq -0x166b1(%rip), %rdi    # 0x211c6
leaq 0x763fa(%rip), %rsi     # 0xadc78
leaq 0x75cd3(%rip), %rdx     # 0xad558
callq 0x44b0
leaq 0x7845f(%rip), %rdi     # 0xafcf0
callq 0x4330
jmp 0x377c3
jmp 0x3789d
movq %rax, %rbx
leaq 0x78449(%rip), %rdi     # 0xafcf0
callq 0x4310
movq %rbx, %rdi
callq 0x4950