// File: /workspace/github_c_makefile_star2_O0/sbp[P]tweetnacl-tools/tweetnacl.c
// Function: unpackneg
static int unpackneg(gf r[4],const u8 p[32])
{
  gf t, chk, num, den, den2, den4, den6;
  set25519(r[2],gf1);
  unpack25519(r[1],p);
  S(num,r[1]);
  M(den,num,D);
  Z(num,num,r[2]);
  A(den,r[2],den);

  S(den2,den);
  S(den4,den2);
  M(den6,den4,den2);
  M(t,den6,num);
  M(t,t,den);

  pow2523(t,t);
  M(t,t,num);
  M(t,t,den);
  M(t,t,den);
  M(r[0],t,den);

  S(chk,r[0]);
  M(chk,chk,den);
  if (neq25519(chk, num)) M(r[0],r[0],I);

  S(chk,r[0]);
  M(chk,chk,den);
  if (neq25519(chk, num)) return -1;

  if (par25519(r[0]) == (p[31]>>7)) Z(r[0],gf0,r[0]);

  M(r[3],r[0],r[1]);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3a0, %rsp            # imm = 0x3A0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0x1ebb(%rip), %rsi      # 0x6590
callq 0x4e50
movq -0x10(%rbp), %rdi
addq $0x80, %rdi
movq -0x18(%rbp), %rsi
callq 0x2c70
leaq -0x1a0(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x80, %rsi
callq 0x2e20
leaq -0x220(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
leaq 0x1ff6(%rip), %rdx      # 0x6710
callq 0x2e50
leaq -0x1a0(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x100, %rdx            # imm = 0x100
callq 0x2dd0
leaq -0x220(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
leaq -0x220(%rbp), %rdx
callq 0x2d80
leaq -0x2a0(%rbp), %rdi
leaq -0x220(%rbp), %rsi
callq 0x2e20
leaq -0x320(%rbp), %rdi
leaq -0x2a0(%rbp), %rsi
callq 0x2e20
leaq -0x3a0(%rbp), %rdi
leaq -0x320(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
callq 0x2e50
leaq -0xa0(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0x2e50
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x2e50
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x4ec0
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
callq 0x2e50
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x2e50
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x2e50
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x2e50
leaq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2e20
leaq -0x120(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x2e50
leaq -0x120(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x4fc0
cmpl $0x0, %eax
je 0x489d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x1ef8(%rip), %rdx      # 0x6790
callq 0x2e50
leaq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x2e20
leaq -0x120(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x220(%rbp), %rdx
callq 0x2e50
leaq -0x120(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x4fc0
cmpl $0x0, %eax
je 0x48e8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x493d
movq -0x10(%rbp), %rdi
callq 0x4e90
movzbl %al, %eax
movq -0x18(%rbp), %rcx
movzbl 0x1f(%rcx), %ecx
sarl $0x7, %ecx
cmpl %ecx, %eax
jne 0x4917
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1efe(%rip), %rsi      # 0x6810
callq 0x2dd0
movq -0x10(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x80, %rdx
callq 0x2e50
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x3a0, %rsp            # imm = 0x3A0
popq %rbp
retq
nopl (%rax)