// File: /workspace/github_c_makefile_star2_O0/rongarret[P]clmm/tweetnacl.c
// Function: crypto_scalarmult_curve25519_tweet
int crypto_scalarmult(u8 *q,const u8 *n,const u8 *p)
{
  u8 z[32];
  i64 x[96],r,i;
  gf a,b,c,d,e,f;
  FOR(i,31) z[i]=n[i];
  z[31]=(n[31]&127)|64;
  z[0]&=248;
  unpack25519(x,p);
  FOR(i,16) {
    b[i]=x[i];
    d[i]=a[i]=c[i]=0;
  }
  a[0]=d[0]=1;
  for(i=254;i>=0;--i) {
    r=(z[i>>3]>>(i&7))&1;
    sel25519(a,b,r);
    sel25519(c,d,r);
    A(e,a,c);
    Z(a,a,c);
    A(c,b,d);
    Z(b,b,d);
    S(d,e);
    S(f,a);
    M(a,c,a);
    M(c,b,e);
    A(e,a,c);
    Z(a,a,c);
    S(b,a);
    Z(c,d,f);
    M(a,c,_121665);
    A(a,a,d);
    M(c,c,a);
    M(a,d,f);
    M(d,b,x);
    S(b,e);
    sel25519(a,b,r);
    sel25519(c,d,r);
  }
  FOR(i,16) {
    x[i+32]=a[i];
    x[i+48]=c[i];
    x[i+64]=b[i];
    x[i+80]=d[i];
  }
  inv25519(x+48,x+48);
  M(x+32,x+32,x+48);
  pack25519(q,x+32);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x650, %rsp            # imm = 0x650
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x350(%rbp)
cmpq $0x1f, -0x350(%rbp)
jge 0x3169
movq -0x10(%rbp), %rax
movq -0x350(%rbp), %rcx
movb (%rax,%rcx), %cl
movq -0x350(%rbp), %rax
movb %cl, -0x40(%rbp,%rax)
movq -0x350(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x350(%rbp)
jmp 0x3132
movq -0x10(%rbp), %rax
movzbl 0x1f(%rax), %eax
andl $0x7f, %eax
orl $0x40, %eax
movb %al, -0x21(%rbp)
movzbl -0x40(%rbp), %eax
andl $0xf8, %eax
movb %al, -0x40(%rbp)
leaq -0x340(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x35d0
movq $0x0, -0x350(%rbp)
cmpq $0x10, -0x350(%rbp)
jge 0x3216
movq -0x350(%rbp), %rax
movq -0x340(%rbp,%rax,8), %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0x450(%rbp,%rax,8)
movq -0x350(%rbp), %rax
movq $0x0, -0x4d0(%rbp,%rax,8)
movq -0x350(%rbp), %rax
movq $0x0, -0x3d0(%rbp,%rax,8)
movq -0x350(%rbp), %rax
movq $0x0, -0x550(%rbp,%rax,8)
movq -0x350(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x350(%rbp)
jmp 0x31a1
movq $0x1, -0x550(%rbp)
movq $0x1, -0x3d0(%rbp)
movq $0xfe, -0x350(%rbp)
cmpq $0x0, -0x350(%rbp)
jl 0x34ad
movq -0x350(%rbp), %rax
sarq $0x3, %rax
movzbl -0x40(%rbp,%rax), %eax
movq -0x350(%rbp), %rcx
andq $0x7, %rcx
sarl %cl, %eax
andl $0x1, %eax
cltq
movq %rax, -0x348(%rbp)
leaq -0x3d0(%rbp), %rdi
leaq -0x450(%rbp), %rsi
movq -0x348(%rbp), %rax
movl %eax, %edx
callq 0x3650
leaq -0x4d0(%rbp), %rdi
leaq -0x550(%rbp), %rsi
movq -0x348(%rbp), %rax
movl %eax, %edx
callq 0x3650
leaq -0x5d0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0x36e0
leaq -0x3d0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0x3730
leaq -0x4d0(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x550(%rbp), %rdx
callq 0x36e0
leaq -0x450(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x550(%rbp), %rdx
callq 0x3730
leaq -0x550(%rbp), %rdi
leaq -0x5d0(%rbp), %rsi
callq 0x3780
leaq -0x650(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0x3780
leaq -0x3d0(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
leaq -0x3d0(%rbp), %rdx
callq 0x37b0
leaq -0x4d0(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x5d0(%rbp), %rdx
callq 0x37b0
leaq -0x5d0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0x36e0
leaq -0x3d0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0x3730
leaq -0x450(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
callq 0x3780
leaq -0x4d0(%rbp), %rdi
leaq -0x550(%rbp), %rsi
leaq -0x650(%rbp), %rdx
callq 0x3730
leaq -0x3d0(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
leaq 0x3232(%rip), %rdx      # 0x6610
callq 0x37b0
leaq -0x3d0(%rbp), %rdi
leaq -0x3d0(%rbp), %rsi
leaq -0x550(%rbp), %rdx
callq 0x36e0
leaq -0x4d0(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
leaq -0x3d0(%rbp), %rdx
callq 0x37b0
leaq -0x3d0(%rbp), %rdi
leaq -0x550(%rbp), %rsi
leaq -0x650(%rbp), %rdx
callq 0x37b0
leaq -0x550(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x340(%rbp), %rdx
callq 0x37b0
leaq -0x450(%rbp), %rdi
leaq -0x5d0(%rbp), %rsi
callq 0x3780
leaq -0x3d0(%rbp), %rdi
leaq -0x450(%rbp), %rsi
movq -0x348(%rbp), %rax
movl %eax, %edx
callq 0x3650
leaq -0x4d0(%rbp), %rdi
leaq -0x550(%rbp), %rsi
movq -0x348(%rbp), %rax
movl %eax, %edx
callq 0x3650
movq -0x350(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x350(%rbp)
jmp 0x3237
movq $0x0, -0x350(%rbp)
cmpq $0x10, -0x350(%rbp)
jge 0x3555
movq -0x350(%rbp), %rax
movq -0x3d0(%rbp,%rax,8), %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0x240(%rbp,%rax,8)
movq -0x350(%rbp), %rax
movq -0x4d0(%rbp,%rax,8), %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0x1c0(%rbp,%rax,8)
movq -0x350(%rbp), %rax
movq -0x450(%rbp,%rax,8), %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0x140(%rbp,%rax,8)
movq -0x350(%rbp), %rax
movq -0x550(%rbp,%rax,8), %rcx
movq -0x350(%rbp), %rax
movq %rcx, -0xc0(%rbp,%rax,8)
movq -0x350(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x350(%rbp)
jmp 0x34b8
leaq -0x340(%rbp), %rdi
addq $0x180, %rdi            # imm = 0x180
leaq -0x340(%rbp), %rsi
addq $0x180, %rsi            # imm = 0x180
callq 0x38f0
leaq -0x340(%rbp), %rdi
addq $0x100, %rdi            # imm = 0x100
leaq -0x340(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
leaq -0x340(%rbp), %rdx
addq $0x180, %rdx            # imm = 0x180
callq 0x37b0
movq -0x8(%rbp), %rdi
leaq -0x340(%rbp), %rsi
addq $0x100, %rsi            # imm = 0x100
callq 0x3a00
xorl %eax, %eax
addq $0x650, %rsp            # imm = 0x650
popq %rbp
retq
nopw (%rax,%rax)