// File: zgimbutas[P]mwrap/src/mwrap-cgen.cc
// Function: mex_define_copiers(_IO_FILE*, char const*)
void mex_define_copiers(FILE* fp, const char* name)
{
  /* Skip C99 int32_t, int64_t, uint32_t, uint64_t, if not detected */
  if( (strcmp(name, "int32_t") == 0 ) && ( mw_use_int32_t == 0 ) ) return;
  if( (strcmp(name, "int64_t") == 0 ) && ( mw_use_int64_t == 0 ) ) return;
  if( (strcmp(name, "uint32_t") == 0 ) && ( mw_use_uint32_t == 0 ) ) return;
  if( (strcmp(name, "uint64_t") == 0 ) && ( mw_use_uint64_t == 0 ) ) return;

  if( (strcmp(name, "ulong") == 0 ) && ( mw_use_ulong == 0 ) ) return;
  if( (strcmp(name, "uint") == 0 ) && ( mw_use_uint == 0 ) ) return;
  if( (strcmp(name, "ushort") == 0 ) && ( mw_use_ushort == 0 ) ) return;
  if( (strcmp(name, "uchar") == 0 ) && ( mw_use_uchar == 0 ) ) return;

  /* Define copiers */
  fprintf(fp, "mxWrapGetArrayDef(mxWrapGetArray_%s, %s)\n", name, name);
  fprintf(fp, "mxWrapCopyDef    (mxWrapCopy_%s,     %s)\n", name, name);
  fprintf(fp, "mxWrapReturnDef  (mxWrapReturn_%s,   %s)\n", name, name);

  /* Single precision */
  fprintf(fp, "mxWrapGetArrayDef_single(mxWrapGetArray_single_%s, %s)\n", name, name);
  fprintf(fp, "mxWrapCopyDef_single    (mxWrapCopy_single_%s,     %s)\n", name, name);
  fprintf(fp, "mxWrapReturnDef_single  (mxWrapReturn_single_%s,   %s)\n", name, name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x7b87(%rip), %rsi      # 0x14b42
callq 0x3390
cmpl $0x0, %eax
jne 0xcfd6
leaq 0x1830c(%rip), %rax     # 0x252d8
cmpl $0x0, (%rax)
jne 0xcfd6
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7b6a(%rip), %rsi      # 0x14b4b
callq 0x3390
cmpl $0x0, %eax
jne 0xcffc
leaq 0x182ea(%rip), %rax     # 0x252dc
cmpl $0x0, (%rax)
jne 0xcffc
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7b3a(%rip), %rsi      # 0x14b41
callq 0x3390
cmpl $0x0, %eax
jne 0xd022
leaq 0x182c8(%rip), %rax     # 0x252e0
cmpl $0x0, (%rax)
jne 0xd022
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7b1d(%rip), %rsi      # 0x14b4a
callq 0x3390
cmpl $0x0, %eax
jne 0xd048
leaq 0x182a6(%rip), %rax     # 0x252e4
cmpl $0x0, (%rax)
jne 0xd048
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7ad6(%rip), %rsi      # 0x14b29
callq 0x3390
cmpl $0x0, %eax
jne 0xd06e
leaq 0x18284(%rip), %rax     # 0x252e8
cmpl $0x0, (%rax)
jne 0xd06e
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7ab6(%rip), %rsi      # 0x14b2f
callq 0x3390
cmpl $0x0, %eax
jne 0xd094
leaq 0x18262(%rip), %rax     # 0x252ec
cmpl $0x0, (%rax)
jne 0xd094
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7a95(%rip), %rsi      # 0x14b34
callq 0x3390
cmpl $0x0, %eax
jne 0xd0ba
leaq 0x18240(%rip), %rax     # 0x252f0
cmpl $0x0, (%rax)
jne 0xd0ba
jmp 0xd17c
movq -0x10(%rbp), %rdi
leaq 0x7a76(%rip), %rsi      # 0x14b3b
callq 0x3390
cmpl $0x0, %eax
jne 0xd0e0
leaq 0x1821e(%rip), %rax     # 0x252f4
cmpl $0x0, (%rax)
jne 0xd0e0
jmp 0xd17c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xdc9d(%rip), %rsi      # 0x1ad90
movb $0x0, %al
callq 0x33a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xdcad(%rip), %rsi      # 0x1adba
movb $0x0, %al
callq 0x33a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xdcbd(%rip), %rsi      # 0x1ade4
movb $0x0, %al
callq 0x33a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xdccd(%rip), %rsi      # 0x1ae0e
movb $0x0, %al
callq 0x33a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xdceb(%rip), %rsi      # 0x1ae46
movb $0x0, %al
callq 0x33a0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
leaq 0xdd09(%rip), %rsi      # 0x1ae7e
movb $0x0, %al
callq 0x33a0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)