// File: /workspace/github_cpp_makefile_star2_O3/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 0x75181(%rip), %al      # 0xaad00
testb %al, %al
je 0x35c4d
movq 0x75162(%rip), %r12     # 0xaacf0
movl %r15d, %edi
imull %r14d, %edi
callq 0x46b0
movq %rax, %r13
testb %bpl, %bpl
je 0x35bbf
movq 0x4f0(%rbx), %rdi
movl 0x18(%rbx), %esi
movl 0x1c(%rbx), %edx
movq %r13, %rcx
movl %r14d, %r8d
movl %r15d, %r9d
callq 0x273c8
jmp 0x35bd3
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 0x750fd(%rip), %al      # 0xaad00
testb %al, %al
je 0x35c98
movl 0x750e7(%rip), %edx     # 0xaacf8
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 0x4630
addq $0x20, %rsp
movq %rax, 0x4e8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x750ac(%rip), %rdi     # 0xaad00
callq 0x49c0
testl %eax, %eax
je 0x35b87
leaq 0x73020(%rip), %rdi     # 0xa8c88
callq 0x211ec
leaq -0x14a4a(%rip), %rdi    # 0x2122a
leaq 0x7300d(%rip), %rsi     # 0xa8c88
leaq 0x728de(%rip), %rdx     # 0xa8560
callq 0x44c0
leaq 0x75072(%rip), %rdi     # 0xaad00
callq 0x4330
jmp 0x35b87
leaq 0x75061(%rip), %rdi     # 0xaad00
callq 0x49c0
testl %eax, %eax
je 0x35c0b
leaq 0x72fd5(%rip), %rdi     # 0xa8c88
callq 0x211ec
leaq -0x14a95(%rip), %rdi    # 0x2122a
leaq 0x72fc2(%rip), %rsi     # 0xa8c88
leaq 0x72893(%rip), %rdx     # 0xa8560
callq 0x44c0
leaq 0x75027(%rip), %rdi     # 0xaad00
callq 0x4330
jmp 0x35c0b
jmp 0x35ce5
movq %rax, %rbx
leaq 0x75011(%rip), %rdi     # 0xaad00
callq 0x4310
movq %rbx, %rdi
callq 0x4960