// File: ushitora-anqou[P]aqtfhe2/./aqtfhe2.hpp
// Function: aqtfhe2::trlwe_lvl1<aqtfhe2::params::CGGI16>::polynomial_mul_by_xai_minus_one_impl(aqtfhe2::detail::nd_array<unsigned int, 1024ul>&, unsigned int, aqtfhe2::detail::nd_array<unsigned int, 1024ul> const&)
static void polynomial_mul_by_xai_minus_one_impl(container &out, uint32_t a,
                                                     const container &poly)
    {
        if (a == 0) {
            out = poly;
            return;
        }

        constexpr uint32_t N = P::N();
        if (a < N) {
            for (size_t i = 0; i < a; i++)
                out[i] = -poly[i - a + N] - poly[i];
            for (size_t i = a; i < N; i++)
                out[i] = poly[i - a] - poly[i];
        }
        else {
            const uint32_t aa = a - N;
            for (size_t i = 0; i < aa; i++)
                out[i] = poly[i - aa + N] - poly[i];
            for (size_t i = aa; i < N; i++)
                out[i] = -poly[i - aa] - poly[i];
        }
    }

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
movq %rdx, 0x50(%rsp)
cmpl $0x0, 0x5c(%rsp)
jne 0xde22
movq 0x50(%rsp), %rsi
movq 0x60(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
callq 0x2160
jmp 0xe02c
movl $0x400, 0x4c(%rsp)      # imm = 0x400
cmpl $0x400, 0x5c(%rsp)      # imm = 0x400
jae 0xdf2e
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
movl 0x5c(%rsp), %ecx
cmpq %rcx, %rax
jae 0xdeb8
movq 0x50(%rsp), %rdi
movq 0x40(%rsp), %rsi
movl 0x5c(%rsp), %eax
subq %rax, %rsi
addq $0x400, %rsi            # imm = 0x400
callq 0x5de0
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, 0x18(%rsp)
movq 0x50(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0x5de0
movq %rax, %rcx
movl 0x18(%rsp), %eax
subl (%rcx), %eax
movl %eax, 0x1c(%rsp)
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xdba0
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0xde41
movl 0x5c(%rsp), %eax
movq %rax, 0x38(%rsp)
cmpq $0x400, 0x38(%rsp)      # imm = 0x400
jae 0xdf29
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl 0x5c(%rsp), %eax
subq %rax, %rsi
callq 0x5de0
movl (%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0x5de0
movq %rax, %rcx
movl 0x10(%rsp), %eax
subl (%rcx), %eax
movl %eax, 0x14(%rsp)
movq 0x60(%rsp), %rdi
movq 0x38(%rsp), %rsi
callq 0xdba0
movl 0x14(%rsp), %ecx
movl %ecx, (%rax)
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0xdec1
jmp 0xe02c
movl 0x5c(%rsp), %eax
subl $0x400, %eax            # imm = 0x400
movl %eax, 0x34(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movl 0x34(%rsp), %ecx
cmpq %rcx, %rax
jae 0xdfb6
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl 0x34(%rsp), %eax
subq %rax, %rsi
addq $0x400, %rsi            # imm = 0x400
callq 0x5de0
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x5de0
movq %rax, %rcx
movl 0x8(%rsp), %eax
subl (%rcx), %eax
movl %eax, 0xc(%rsp)
movq 0x60(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xdba0
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0xdf44
movl 0x34(%rsp), %eax
movq %rax, 0x20(%rsp)
cmpq $0x400, 0x20(%rsp)      # imm = 0x400
jae 0xe02a
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x34(%rsp), %eax
subq %rax, %rsi
callq 0x5de0
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, (%rsp)
movq 0x50(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x5de0
movq %rax, %rcx
movl (%rsp), %eax
subl (%rcx), %eax
movl %eax, 0x4(%rsp)
movq 0x60(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xdba0
movl 0x4(%rsp), %ecx
movl %ecx, (%rax)
movq 0x20(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x20(%rsp)
jmp 0xdfbf
jmp 0xe02c
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)