// File: /workspace/github_c_makefile_star2_O1/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 $0x3d8, %rsp            # imm = 0x3D8
movq %rdi, 0x50(%rsp)
movups (%rsi), %xmm0
movups 0x10(%rsi), %xmm1
leaq 0x240(%rsp), %rcx
movaps %xmm0, (%rcx)
andb $-0x8, (%rcx)
movabsq $0x7ffffffffffff, %rsi  # imm = 0x7FFFFFFFFFFFF
movaps %xmm1, 0x10(%rcx)
movb 0x1f(%rcx), %al
andb $0x3f, %al
orb $0x40, %al
movb %al, 0x1f(%rcx)
movq (%rdx), %rax
andq %rsi, %rax
leaq 0x290(%rsp), %rcx
movq %rax, (%rcx)
movq 0x6(%rdx), %rax
shrq $0x3, %rax
andq %rsi, %rax
movq %rax, 0x8(%rcx)
movq 0xc(%rdx), %rax
shrq $0x6, %rax
andq %rsi, %rax
movq %rax, 0x10(%rcx)
movq 0x13(%rdx), %rax
shrq %rax
andq %rsi, %rax
movq %rax, 0x18(%rcx)
movq 0x19(%rdx), %rax
shrq $0x4, %rax
andq %rsi, %rax
movq %rax, 0x20(%rcx)
xorps %xmm0, %xmm0
leaq 0xc0(%rsp), %rdi
movaps %xmm0, (%rdi)
xorl %edx, %edx
movq %rdx, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movl $0x1, %eax
movq %rax, (%rdi)
leaq 0x2c0(%rsp), %r9
movaps %xmm0, (%r9)
movq %rdx, 0x20(%r9)
movaps %xmm0, 0x10(%r9)
movq %rax, (%r9)
leaq 0x3b0(%rsp), %r8
movq %rdx, 0x20(%r8)
movaps %xmm0, 0x10(%r8)
movaps %xmm0, (%r8)
leaq 0x380(%rsp), %rbp
movq %rdx, 0x20(%rbp)
movaps %xmm0, 0x10(%rbp)
movaps %xmm0, (%rbp)
leaq 0x350(%rsp), %r15
movaps %xmm0, (%r15)
movq %rdx, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movq %rax, (%r15)
leaq 0x320(%rsp), %r13
movq %rdx, 0x20(%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, (%r13)
leaq 0x2f0(%rsp), %r12
movaps %xmm0, (%r12)
movq %rdx, 0x20(%r12)
movaps %xmm0, 0x10(%r12)
movq %rax, (%r12)
movq 0x20(%rcx), %rax
leaq 0xf0(%rsp), %rbx
movq %rax, 0x20(%rbx)
movaps (%rcx), %xmm0
movaps 0x10(%rcx), %xmm1
movaps %xmm1, 0x10(%rbx)
movaps %xmm0, (%rbx)
leaq 0x240(%rsp), %rax
movq %rdx, 0x58(%rsp)
subq %rdx, %rax
movb 0x1f(%rax), %r10b
movq %rbx, %rax
xorl %r11d, %r11d
movq %r12, %rcx
movq %r13, %rdx
movq %r15, %rsi
movq %r9, %r13
movq %r8, %r12
movq %rdi, %r15
movq %rbp, %rbx
movq %rsi, %rdi
movq %rdx, %r9
movq %rcx, %r8
movq %rax, %rbp
movl %r10d, %eax
sarb $0x7, %al
movsbq %al, %r14
xorl %eax, %eax
movq (%r13,%rax,8), %rcx
movq (%rbp,%rax,8), %rdx
movq %rdx, %rsi
xorq %rcx, %rsi
andq %r14, %rsi
xorq %rsi, %rcx
movq %rcx, (%r13,%rax,8)
xorq %rdx, %rsi
movq %rsi, (%rbp,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1337
xorl %eax, %eax
movq (%r12,%rax,8), %rcx
movq (%r15,%rax,8), %rdx
movq %rdx, %rsi
xorq %rcx, %rsi
andq %r14, %rsi
xorq %rsi, %rcx
movq %rcx, (%r12,%rax,8)
xorq %rdx, %rsi
movq %rsi, (%r15,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1365
movl %r11d, 0x4(%rsp)
movb %r10b, 0x3(%rsp)
movq %r9, 0x8(%rsp)
movq %r8, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm0, 0x1b0(%rsp)
movaps %xmm1, 0x1c0(%rsp)
movq 0x20(%r13), %rax
movq %rax, 0x1d0(%rsp)
xorl %eax, %eax
movq (%r12,%rax,8), %rcx
addq %rcx, (%r13,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x13ce
movq %r12, %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x1e7f
movq 0x20(%rbp), %rax
movq %rax, 0xb0(%rsp)
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movaps %xmm1, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq (%r15,%rax,8), %rcx
addq %rcx, (%rbp,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1416
movq %r15, %rdi
leaq 0x90(%rsp), %rsi
callq 0x1e7f
leaq 0x120(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x1ad5
leaq 0x150(%rsp), %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1ad5
movq 0x140(%rsp), %rax
movq %rax, 0xb0(%rsp)
movaps 0x120(%rsp), %xmm0
movaps 0x130(%rsp), %xmm1
movaps %xmm1, 0xa0(%rsp)
movaps %xmm0, 0x90(%rsp)
xorl %eax, %eax
movq 0x150(%rsp,%rax,8), %rcx
addq %rcx, 0x120(%rsp,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1490
leaq 0x150(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x1e7f
movq %rbx, %rdi
leaq 0x120(%rsp), %rsi
callq 0x1f92
leaq 0x210(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x1f92
movq 0x18(%rsp), %rdi
leaq 0x210(%rsp), %rsi
leaq 0x290(%rsp), %rdx
callq 0x1ad5
leaq 0x180(%rsp), %rdi
movq %r13, %rsi
callq 0x1f92
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0x1f92
movq 0x8(%rsp), %rdi
leaq 0x180(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x1ad5
leaq 0x20(%rsp), %rdi
leaq 0x180(%rsp), %rsi
callq 0x1e7f
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x20(%rsp)
movq %rdx, %rsi
movq %rax, %rcx
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x28(%rsp)
movq %rdx, %rdi
shldq $0xd, %rcx, %rsi
movabsq $0x7ffffffffffff, %r10  # imm = 0x7FFFFFFFFFFFF
andq %r10, %rcx
addq %rax, %rsi
adcq $0x0, %rdi
shldq $0xd, %rsi, %rdi
andq %r10, %rsi
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x30(%rsp)
movq %rdx, %r8
movq %rax, %r9
addq %rdi, %r9
adcq $0x0, %r8
movq %rsi, 0x68(%rsp)
shldq $0xd, %r9, %r8
andq %r10, %r9
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x38(%rsp)
movq %rax, %rsi
movq %rdx, %rdi
movq %r9, 0x70(%rsp)
addq %r8, %rsi
adcq $0x0, %rdi
shldq $0xd, %rsi, %rdi
movl $0x1db41, %eax          # imm = 0x1DB41
mulq 0x40(%rsp)
andq %r10, %rsi
addq %rdi, %rax
adcq $0x0, %rdx
shldq $0xd, %rax, %rdx
movq %rsi, 0x78(%rsp)
andq %r10, %rax
movq %rax, 0x80(%rsp)
leaq (%rdx,%rdx,8), %rax
leaq (%rdx,%rax,2), %rax
addq %rcx, %rax
movq %rax, 0x60(%rsp)
xorl %eax, %eax
movq 0x180(%rsp,%rax,8), %rcx
addq %rcx, 0x60(%rsp,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1601
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x1ad5
xorl %eax, %eax
movq 0x8(%rsp), %r9
movq (%r9,%rax,8), %rcx
movq (%rbx,%rax,8), %rdx
movq %rdx, %rsi
xorq %rcx, %rsi
andq %r14, %rsi
xorq %rsi, %rcx
movq %rcx, (%r9,%rax,8)
xorq %rdx, %rsi
movq %rsi, (%rbx,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1632
xorl %eax, %eax
movq 0x18(%rsp), %rdi
movq 0x10(%rsp), %r8
movb 0x3(%rsp), %r10b
movl 0x4(%rsp), %r11d
movq (%r8,%rax,8), %rcx
movq (%rdi,%rax,8), %rdx
movq %rdx, %rsi
xorq %rcx, %rsi
andq %r14, %rsi
xorq %rsi, %rcx
movq %rcx, (%r8,%rax,8)
xorq %rdx, %rsi
movq %rsi, (%rdi,%rax,8)
incq %rax
cmpq $0x5, %rax
jne 0x1670
addb %r10b, %r10b
incl %r11d
movq %rbx, %rax
movq %r12, %rcx
movq %r13, %rdx
movq %r15, %rsi
cmpl $0x8, %r11d
jne 0x1313
movq 0x58(%rsp), %rdx
incq %rdx
cmpq $0x20, %rdx
jne 0x12f0
movq 0x20(%r9), %rax
movq %rax, 0x200(%rsp)
movups (%r9), %xmm0
movups 0x10(%r9), %xmm1
movaps %xmm1, 0x1f0(%rsp)
movaps %xmm0, 0x1e0(%rsp)
movups (%r8), %xmm0
movups 0x10(%r8), %xmm1
leaq 0x260(%rsp), %r15
movaps %xmm0, (%r15)
movaps %xmm1, 0x10(%r15)
movq 0x20(%r8), %rax
movq %rax, 0x20(%r15)
leaq 0x1b0(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x1f92
leaq 0xc0(%rsp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1f92
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
leaq 0x90(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1ad5
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x1ad5
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f92
leaq 0x180(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1ad5
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
leaq 0x20(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1ad5
movq %r14, %rdi
movq %r12, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
addl $0x2, %ebp
cmpl $0x8, %ebp
jb 0x17f2
leaq 0x120(%rsp), %r15
leaq 0xc0(%rsp), %rbx
leaq 0x20(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1ad5
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
addl $0x2, %ebp
cmpl $0x12, %ebp
jb 0x1850
leaq 0xf0(%rsp), %rbx
leaq 0xc0(%rsp), %r14
leaq 0x120(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ad5
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
addl $0x2, %ebp
cmpl $0x8, %ebp
jb 0x18a9
leaq 0x150(%rsp), %r14
leaq 0xf0(%rsp), %rbx
leaq 0x20(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ad5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
leaq 0xc0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
addl $0x2, %ebp
cmpl $0x30, %ebp
jb 0x1907
leaq 0x210(%rsp), %r14
leaq 0xc0(%rsp), %rbx
leaq 0x150(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ad5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
leaq 0xf0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
addl $0x2, %ebp
cmpl $0x62, %ebp
jb 0x1968
leaq 0xc0(%rsp), %rbx
leaq 0xf0(%rsp), %r14
leaq 0x210(%rsp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ad5
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
xorl %ebp, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
addl $0x2, %ebp
cmpl $0x30, %ebp
jb 0x19c1
leaq 0xf0(%rsp), %r14
leaq 0xc0(%rsp), %rbx
leaq 0x150(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ad5
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1f92
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1f92
leaq 0x2c0(%rsp), %r14
leaq 0x60(%rsp), %rdx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ad5
leaq 0x260(%rsp), %rbx
leaq 0x1e0(%rsp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1ad5
movq 0x8(%rbx), %rax
movq %rax, %rcx
shlq $0x33, %rcx
orq (%rbx), %rcx
movq 0x50(%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 $0x3d8, %rsp            # imm = 0x3D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq