// File: /workspace/github_c_makefile_star2_O0/LoupVaillant[P]Monocypher-Utils/src/monocypher.c
// Function: ge_frombytes_neg_vartime
static int ge_frombytes_neg_vartime(ge *h, const u8 s[32])
{
    static const fe d = {
        -10913610, 13857413, -15372611, 6949391, 114729,
        -8787816, -6275908, -3247719, -18696448, -12055116
    } ;
    static const fe sqrtm1 = {
        -32595792, -7943725, 9377950, 3500415, 12389472,
        -272473, -25146209, -2005654, 326686, 11406482
    } ;
    fe u, v, v3, vxx, check; // no secret, no wipe
    fe_frombytes(h->Y, s);
    fe_1(h->Z);
    fe_sq(u, h->Y);            // y^2
    fe_mul(v, u, d);
    fe_sub(u, u, h->Z);        // u = y^2-1
    fe_add(v, v, h->Z);        // v = dy^2+1

    fe_sq(v3, v);
    fe_mul(v3, v3, v);         // v3 = v^3
    fe_sq(h->X, v3);
    fe_mul(h->X, h->X, v);
    fe_mul(h->X, h->X, u);     // x = uv^7

    fe_pow22523(h->X, h->X);   // x = (uv^7)^((q-5)/8)
    fe_mul(h->X, h->X, v3);
    fe_mul(h->X, h->X, u);     // x = uv^3(uv^7)^((q-5)/8)

    fe_sq(vxx, h->X);
    fe_mul(vxx, vxx, v);
    fe_sub(check, vxx, u);     // vx^2-u
    if (fe_isnonzero(check)) {
        fe_add(check, vxx, u); // vx^2+u
        if (fe_isnonzero(check)) {
            return -1;
        }
        fe_mul(h->X, h->X, sqrtm1);
    }
    if (fe_isnegative(h->X) == (s[31] >> 7)) {
        fe_neg(h->X, h->X);
    }
    fe_mul(h->T, h->X, h->Y);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x28, %rdi
movq -0x18(%rbp), %rsi
callq 0x8b80
movq -0x10(%rbp), %rdi
addq $0x50, %rdi
callq 0x8f60
leaq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rsi
callq 0x9d80
leaq -0x70(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq 0x771f(%rip), %rdx      # 0x12fb0
callq 0x9180
leaq -0x40(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x50, %rdx
callq 0x90e0
leaq -0x70(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x50, %rdx
callq 0x9130
leaq -0xa0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x9d80
leaq -0xa0(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x9180
movq -0x10(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x9d80
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x9180
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x9180
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xfff0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x9180
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x9180
leaq -0xd0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x9d80
leaq -0xd0(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x70(%rbp), %rdx
callq 0x9180
leaq -0x100(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x90e0
leaq -0x100(%rbp), %rdi
callq 0x10360
cmpl $0x0, %eax
je 0xb9df
leaq -0x100(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x9130
leaq -0x100(%rbp), %rdi
callq 0x10360
cmpl $0x0, %eax
je 0xb9cb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xba24
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq 0x7606(%rip), %rdx      # 0x12fe0
callq 0x9180
movq -0x10(%rbp), %rdi
callq 0xfd80
movq -0x18(%rbp), %rcx
movzbl 0x1f(%rcx), %ecx
sarl $0x7, %ecx
cmpl %ecx, %eax
jne 0xba04
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xfb90
movq -0x10(%rbp), %rdi
addq $0x78, %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rdx
addq $0x28, %rdx
callq 0x9180
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq