// File: /workspace/github_c_makefile_star2_O0/ComplexNetworks-DCC-FCUP[P]fase/Isomorphism.cpp
// Function: Isomorphism::canonicalStrNauty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*)
void Isomorphism::canonicalStrNauty(std::string v, char *s) {

  int i, j, aux;

  for (int i=0; i<n; i++) {
    gv = GRAPHROW(g,i,m);
    EMPTYSET(gv,m);

    for (int j=0; j<n; j++)
      if(v[i*n + j] == '1')
        ADDELEMENT(gv,j);
  }

  nauty(g,lab,ptn,NULL,orbits,&options,&stats,
        workspace,WORKSPACE_SIZE,m,n,mm);
  
  aux=0;
  for (i=0; i<n; i++) {
    gv = GRAPHROW(mm,i,m); 
    for (j=0; j<n; j++)
      s[aux++] = ISELEMENT(gv,j)?'1':'0';
  }
  s[aux]=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rsi, -0x58(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rcx
movl -0x38(%rbp), %eax
cmpl 0x4b04(%rcx), %eax
jge 0xa06d
movq -0x50(%rbp), %rcx
movq %rcx, %rax
addq $0x4c80, %rax           # imm = 0x4C80
movslq -0x38(%rbp), %rdx
movslq 0x4b08(%rcx), %rsi
imulq %rsi, %rdx
shlq $0x2, %rdx
addq %rdx, %rax
movq %rax, 0x4c78(%rcx)
movq 0x4c78(%rcx), %rax
movslq 0x4b08(%rcx), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rcx
movq -0x40(%rbp), %rax
addq $-0x4, %rax
movq %rax, -0x40(%rbp)
cmpq 0x4c78(%rcx), %rax
jb 0x9fe8
movq -0x40(%rbp), %rax
movl $0x0, (%rax)
jmp 0x9fc3
movl $0x0, -0x44(%rbp)
movq -0x50(%rbp), %rcx
movl -0x44(%rbp), %eax
cmpl 0x4b04(%rcx), %eax
jge 0xa05d
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rcx
movl -0x38(%rbp), %eax
imull 0x4b04(%rcx), %eax
addl -0x44(%rbp), %eax
movslq %eax, %rsi
callq 0x3410
movsbl (%rax), %eax
cmpl $0x31, %eax
jne 0xa050
movq -0x50(%rbp), %rax
movl -0x44(%rbp), %ecx
andl $0x1f, %ecx
movslq %ecx, %rdx
leaq 0x18269(%rip), %rcx     # 0x222a0
movl (%rcx,%rdx,4), %edx
movq 0x4c78(%rax), %rax
movl -0x44(%rbp), %ecx
sarl $0x5, %ecx
movslq %ecx, %rcx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
jmp 0xa052
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x9fef
jmp 0xa05f
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x9f6d
movq -0x50(%rbp), %rax
movq %rax, %rdi
addq $0x4c80, %rdi           # imm = 0x4C80
movq %rax, %rsi
addq $0x4b0c, %rsi           # imm = 0x4B0C
movq %rax, %rdx
addq $0x4b84, %rdx           # imm = 0x4B84
movq %rax, %r8
addq $0x4bfc, %r8            # imm = 0x4BFC
movq %rax, %rbx
addq $0x4, %rbx
movl 0x4b08(%rax), %r11d
movl 0x4b04(%rax), %r10d
movq %fs:0x0, %rax
leaq -0x80(%rax), %rax
xorl %ecx, %ecx
leaq 0x18169(%rip), %r9      # 0x22230
leaq 0x18c5a(%rip), %r14     # 0x22d28
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movl $0x12c0, 0x10(%rsp)     # imm = 0x12C0
movl %r11d, 0x18(%rsp)
movl %r10d, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x11d70
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x50(%rbp), %rcx
movl -0x2c(%rbp), %eax
cmpl 0x4b04(%rcx), %eax
jge 0xa1cd
movq -0x50(%rbp), %rax
movq %fs:0x0, %rcx
leaq -0x80(%rcx), %rcx
movslq -0x2c(%rbp), %rdx
movslq 0x4b08(%rax), %rsi
imulq %rsi, %rdx
shlq $0x2, %rdx
addq %rdx, %rcx
movq %rcx, 0x4c78(%rax)
movl $0x0, -0x30(%rbp)
movq -0x50(%rbp), %rcx
movl -0x30(%rbp), %eax
cmpl 0x4b04(%rcx), %eax
jge 0xa1bd
movq -0x50(%rbp), %rax
movq 0x4c78(%rax), %rax
movl -0x30(%rbp), %ecx
sarl $0x5, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %ecx
movl -0x30(%rbp), %eax
andl $0x1f, %eax
movslq %eax, %rdx
leaq 0x1811e(%rip), %rax     # 0x222a0
andl (%rax,%rdx,4), %ecx
movb $0x31, %al
movb $0x30, %dl
movb %dl, -0x5a(%rbp)
cmpl $0x0, %ecx
movb %al, -0x59(%rbp)
jne 0xa19a
movb -0x5a(%rbp), %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %dl
movq -0x28(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x34(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xa14c
jmp 0xa1bf
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa101
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb $0x0, (%rax,%rcx)
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop