// File: /workspace/github_c_makefile_star2_O2/agl[P]obstcp/curve25519/donna_c64/smult.c
// Function: curve25519
int
curve25519(u8 *mypublic, const u8 *secret, const u8 *basepoint) {
  felem bp[5], x[5], z[5], zmone[5];
  uint8_t e[32];
  int i;

  for (i = 0;i < 32;++i) e[i] = secret[i];
  e[0] &= 248;
  e[31] &= 127;
  e[31] |= 64;

  fexpand(bp, basepoint);
  cmult(x, z, e, bp);
  crecip(zmone, z);
  fmul(z, x, zmone);
  fcontract(mypublic, z);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, 0x30(%rsp)
xorl %eax, %eax
cmpq $0x20, %rax
je 0x11c5
movb (%rsi,%rax), %cl
movb %cl, 0x210(%rsp,%rax)
incq %rax
jmp 0x11b0
movabsq $0x7ffffffffffff, %rcx  # imm = 0x7FFFFFFFFFFFF
leaq 0x210(%rsp), %rsi
andb $-0x8, (%rsi)
movb 0x1f(%rsi), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%rsi)
movq (%rdx), %rax
andq %rcx, %rax
leaq 0x290(%rsp), %r8
movq %rax, (%r8)
movq 0x6(%rdx), %rax
shrq $0x3, %rax
andq %rcx, %rax
movq %rax, 0x8(%r8)
movq 0xc(%rdx), %rax
shrq $0x6, %rax
andq %rcx, %rax
movq %rax, 0x10(%r8)
movq 0x13(%rdx), %rax
shrq %rax
andq %rcx, %rax
movq %rax, 0x18(%r8)
movq 0x19(%rdx), %rax
shrq $0x4, %rax
andq %rcx, %rax
movq %rax, 0x20(%r8)
xorps %xmm0, %xmm0
leaq 0xc0(%rsp), %r15
andq $0x0, 0x20(%r15)
movaps %xmm0, (%r15)
movaps %xmm0, 0x10(%r15)
pushq $0x1
popq %rdi
movq %rdi, (%r15)
leaq 0x2c0(%rsp), %r13
andq $0x0, 0x20(%r13)
movaps %xmm0, (%r13)
movaps %xmm0, 0x10(%r13)
movq %rdi, (%r13)
leaq 0x3e0(%rsp), %r14
movaps %xmm0, 0x10(%r14)
andq $0x0, 0x20(%r14)
movaps %xmm0, (%r14)
leaq 0x3b0(%rsp), %rsi
movaps %xmm0, 0x10(%rsi)
movaps %xmm0, (%rsi)
andq $0x0, 0x20(%rsi)
leaq 0x380(%rsp), %r9
movaps %xmm0, (%r9)
andq $0x0, 0x20(%r9)
movaps %xmm0, 0x10(%r9)
movq %r9, 0x20(%rsp)
movq %rdi, (%r9)
leaq 0x350(%rsp), %r9
movaps %xmm0, 0x10(%r9)
movaps %xmm0, (%r9)
movq %r9, 0x18(%rsp)
andq $0x0, 0x20(%r9)
leaq 0x320(%rsp), %r9
andq $0x0, 0x20(%r9)
movaps %xmm0, (%r9)
movaps %xmm0, 0x10(%r9)
movq %r9, 0x10(%rsp)
movq %rdi, (%r9)
movq 0x20(%r8), %rdi
leaq 0xf0(%rsp), %r9
movq %rdi, 0x20(%r9)
movaps (%r8), %xmm0
movaps 0x10(%r8), %xmm1
movaps %xmm1, 0x10(%r9)
movaps %xmm0, (%r9)
xorl %edi, %edi
cmpq $0x20, %rdi
je 0x1662
movq %rdi, %r8
leaq 0x210(%rsp), %rdi
movq %r8, 0x38(%rsp)
subq %r8, %rdi
movb 0x1f(%rdi), %r8b
pushq $0x8
popq %rdi
movq %r13, %r12
subl $0x1, %edi
jb 0x1652
movl %r8d, %eax
shrb $0x7, %al
movzbl %al, %ebx
movq %rbx, 0x58(%rsp)
movl %edi, 0xc(%rsp)
movq %r12, %rdi
movq %rsi, 0x28(%rsp)
movq %r9, %rsi
movq %rbx, %rdx
movq %r9, %rbp
movb %r8b, 0xb(%rsp)
callq 0x1e20
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x1e20
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movaps %xmm0, 0x180(%rsp)
movaps %xmm1, 0x190(%rsp)
movq 0x20(%r12), %rax
movq %rax, 0x1a0(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0x1e4a
movq %r14, %rdi
leaq 0x180(%rsp), %rsi
callq 0x1e60
movq %rbp, %rdi
movq 0x20(%rbp), %rax
movq %rax, 0xb0(%rsp)
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movaps %xmm1, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movq %r15, %rbx
movq %rbp, %r15
movq %rbp, 0x50(%rsp)
movq %rbx, %rsi
callq 0x1e4a
movq %rbx, %rdi
movq %r14, %r13
movq %rbx, %r14
movq %rbx, 0x48(%rsp)
leaq 0x90(%rsp), %rsi
callq 0x1e60
leaq 0x150(%rsp), %rbp
movq %rbp, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r13, 0x40(%rsp)
callq 0x1a8a
leaq 0x1e0(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1a8a
movq 0x170(%rsp), %rax
movq %rax, 0xb0(%rsp)
movaps 0x150(%rsp), %xmm0
movaps 0x160(%rsp), %xmm1
movaps %xmm1, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1e4a
movq %rbx, %rdi
leaq 0x90(%rsp), %rsi
callq 0x1e60
movq 0x28(%rsp), %rdi
movq %rbp, %rsi
callq 0x1f73
leaq 0x230(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x1f73
movq 0x20(%rsp), %r15
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x290(%rsp), %rdx
callq 0x1a8a
leaq 0x2f0(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
callq 0x1f73
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1f73
movq 0x18(%rsp), %rdi
movq %rdi, %r14
movq %rbp, %rsi
movq %rbx, %rdx
callq 0x1a8a
movq %rbx, %rdi
movq %rbx, %r13
movq %rbp, %rsi
callq 0x1e60
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x60(%rsp)
movq %rdx, %rsi
movq %rax, %rcx
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x68(%rsp)
movq %rdx, %rdi
shldq $0xd, %rcx, %rsi
movabsq $0x7ffffffffffff, %r9   # imm = 0x7FFFFFFFFFFFF
andq %r9, %rcx
addq %rax, %rsi
adcq $0x0, %rdi
shldq $0xd, %rsi, %rdi
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x70(%rsp)
movq %rdx, %r8
andq %r9, %rsi
addq %rdi, %rax
adcq $0x0, %r8
shldq $0xd, %rax, %r8
movq %rsi, 0x128(%rsp)
andq %r9, %rax
movq %rax, 0x130(%rsp)
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x78(%rsp)
movq %rdx, %rsi
movq %rax, %rdi
addq %r8, %rdi
adcq $0x0, %rsi
shldq $0xd, %rdi, %rsi
andq %r9, %rdi
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x80(%rsp)
addq %rsi, %rax
adcq $0x0, %rdx
movq %rdi, 0x138(%rsp)
shldq $0xd, %rax, %rdx
andq %r9, %rax
movq %rax, 0x140(%rsp)
imulq $0x13, %rdx, %rax
addq %rcx, %rax
movq %rax, 0x120(%rsp)
leaq 0x120(%rsp), %rbx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x1e4a
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x1a8a
movq %r14, %r13
movq %r14, %rdi
movq 0x28(%rsp), %rbx
movq %rbx, %rsi
movq 0x58(%rsp), %r14
movq %r14, %rdx
callq 0x1e20
movq %rbp, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x1e20
movl 0xc(%rsp), %edi
movb 0xb(%rsp), %r8b
addb %r8b, %r8b
movq %rbp, %r14
movq 0x50(%rsp), %rsi
movq 0x48(%rsp), %r9
movq %r9, 0x20(%rsp)
movq %r12, 0x18(%rsp)
movq 0x40(%rsp), %r9
movq %r9, 0x10(%rsp)
movq %rbx, %r9
jmp 0x1333
movq 0x38(%rsp), %rdi
incq %rdi
movq %r12, %r13
jmp 0x130f
movq 0x20(%r13), %rdx
movq %rdx, 0x1d0(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm1, 0x1c0(%rsp)
movaps %xmm0, 0x1b0(%rsp)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
leaq 0x260(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm1, 0x10(%r15)
movq 0x20(%r14), %rax
movq %rax, 0x20(%r15)
leaq 0x180(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f73
leaq 0xc0(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1f73
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1a8a
leaq 0x120(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1a8a
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f73
leaq 0x2f0(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1a8a
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
leaq 0x60(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1a8a
movq %r14, %rdi
movq %r12, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
pushq $0x2
popq %rbp
cmpl $0x9, %ebp
ja 0x17b3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
addl $0x2, %ebp
jmp 0x1793
leaq 0x150(%rsp), %r15
leaq 0xc0(%rsp), %rbx
leaq 0x60(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1a8a
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
pushq $0x2
popq %rbp
cmpl $0x13, %ebp
ja 0x1814
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
addl $0x2, %ebp
jmp 0x17f4
leaq 0xf0(%rsp), %rbx
leaq 0xc0(%rsp), %r14
leaq 0x150(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a8a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
pushq $0x2
popq %rbp
cmpl $0x9, %ebp
ja 0x1870
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
addl $0x2, %ebp
jmp 0x1850
leaq 0x1e0(%rsp), %r14
leaq 0xf0(%rsp), %rbx
leaq 0x60(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1a8a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
pushq $0x2
popq %rbp
cmpl $0x31, %ebp
ja 0x18d1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
addl $0x2, %ebp
jmp 0x18b1
leaq 0x230(%rsp), %r14
leaq 0xc0(%rsp), %rbx
leaq 0x1e0(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1a8a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
pushq $0x2
popq %rbp
cmpl $0x63, %ebp
ja 0x1935
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
addl $0x2, %ebp
jmp 0x1915
leaq 0xc0(%rsp), %rbx
leaq 0xf0(%rsp), %r14
leaq 0x230(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a8a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
pushq $0x2
popq %rbp
cmpl $0x31, %ebp
ja 0x1991
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
addl $0x2, %ebp
jmp 0x1971
leaq 0xf0(%rsp), %r14
leaq 0xc0(%rsp), %rbx
leaq 0x1e0(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1a8a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f73
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f73
leaq 0x2c0(%rsp), %r14
leaq 0x120(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1a8a
leaq 0x260(%rsp), %rbx
leaq 0x1b0(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1a8a
movq 0x8(%rbx), %rax
movq %rax, %rcx
shlq $0x33, %rcx
orq (%rbx), %rcx
movq 0x30(%rsp), %rsi
movq %rcx, (%rsi)
shrq $0xd, %rax
movq 0x10(%rbx), %rcx
movq %rcx, %rdx
shlq $0x26, %rdx
orq %rax, %rdx
movq %rdx, 0x8(%rsi)
shrq $0x1a, %rcx
movq 0x18(%rbx), %rax
movq %rax, %rdx
shlq $0x19, %rdx
orq %rcx, %rdx
movq %rdx, 0x10(%rsi)
shrq $0x27, %rax
movq 0x20(%rbx), %rcx
shlq $0xc, %rcx
orq %rax, %rcx
movq %rcx, 0x18(%rsi)
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq