// File: /workspace/github_c_makefile_star2_O2/wjmelements[P]evm/tst/uint256.c
// Function: test_shiftar
void test_shiftar() {
    uint256_t a;

    UPPER(UPPER(a)) = 0x8000000000000000;
    LOWER(UPPER(a)) = 0x8000000000000000;
    UPPER(LOWER(a)) = 0x8000000000000000;
    LOWER(LOWER(a)) = 0x8000000000000000;

    shiftar256(&a, 0, &a);

    assert(UPPER(UPPER(a)) == 0x8000000000000000);
    assert(LOWER(UPPER(a)) == 0x8000000000000000);
    assert(UPPER(LOWER(a)) == 0x8000000000000000);
    assert(LOWER(LOWER(a)) == 0x8000000000000000);

    shiftar256(&a, 1, &a);

    assert(UPPER(UPPER(a)) == 0xc000000000000000);
    assert(LOWER(UPPER(a)) == 0x4000000000000000);
    assert(UPPER(LOWER(a)) == 0x4000000000000000);
    assert(LOWER(LOWER(a)) == 0x4000000000000000);

    shiftar256(&a, 1, &a);

    assert(UPPER(UPPER(a)) == 0xe000000000000000);
    assert(LOWER(UPPER(a)) == 0x2000000000000000);
    assert(UPPER(LOWER(a)) == 0x2000000000000000);
    assert(LOWER(LOWER(a)) == 0x2000000000000000);

    shiftar256(&a, 1, &a);

    assert(UPPER(UPPER(a)) == 0xf000000000000000);
    assert(LOWER(UPPER(a)) == 0x1000000000000000);
    assert(UPPER(LOWER(a)) == 0x1000000000000000);
    assert(LOWER(LOWER(a)) == 0x1000000000000000);

    shiftar256(&a, 60, &a);

    assert(UPPER(UPPER(a)) == 0xffffffffffffffff);
    assert(LOWER(UPPER(a)) == 0x0000000000000001);
    assert(UPPER(LOWER(a)) == 0x0000000000000001);
    assert(LOWER(LOWER(a)) == 0x0000000000000001);

    shiftar256(&a, 60, &a);

    assert(UPPER(UPPER(a)) == 0xffffffffffffffff);
    assert(LOWER(UPPER(a)) == 0xfffffffffffffff0);
    assert(UPPER(LOWER(a)) == 0x0000000000000010);
    assert(LOWER(LOWER(a)) == 0x0000000000000010);

    shiftar256(&a, 128, &a);

    assert(UPPER(UPPER(a)) == 0xffffffffffffffff);
    assert(LOWER(UPPER(a)) == 0xffffffffffffffff);
    assert(UPPER(LOWER(a)) == 0xffffffffffffffff);
    assert(LOWER(LOWER(a)) == 0xfffffffffffffff0);

    shiftar256(&a, 1, &a);

    assert(UPPER(UPPER(a)) == 0xffffffffffffffff);
    assert(LOWER(UPPER(a)) == 0xffffffffffffffff);
    assert(UPPER(LOWER(a)) == 0xffffffffffffffff);
    assert(LOWER(LOWER(a)) == 0xfffffffffffffff8);

    UPPER(UPPER(a)) = 0x8760000000000000;
    LOWER(UPPER(a)) = 0x0800000000000000;
    UPPER(LOWER(a)) = 0x0080000000000000;
    LOWER(LOWER(a)) = 0x0008000000000000;

    shiftar256(&a, 196, &a);

    assert(UPPER(UPPER(a)) == 0xffffffffffffffff);
    assert(LOWER(UPPER(a)) == 0xffffffffffffffff);
    assert(UPPER(LOWER(a)) == 0xffffffffffffffff);
    assert(LOWER(LOWER(a)) == 0xf876000000000000);

    UPPER(UPPER(a)) = 0x8000000000000000;
    LOWER(UPPER(a)) = 0x0000000000000000;
    UPPER(LOWER(a)) = 0x0000000000000000;
    LOWER(LOWER(a)) = 0x0000000000000000;

    shiftar256(&a, 256, &a);

    assert(UPPER(UPPER(a)) == 0xffffffffffffffff);
    assert(LOWER(UPPER(a)) == 0xffffffffffffffff);
    assert(UPPER(LOWER(a)) == 0xffffffffffffffff);
    assert(LOWER(LOWER(a)) == 0xffffffffffffffff);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movabsq $-0x8000000000000000, %r14 # imm = 0x8000000000000000
movq %rsp, %rbx
movq %r14, (%rbx)
movq %r14, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movq %r14, 0x18(%rbx)
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x388e
cmpq (%rbx), %r15
jno 0x2227
cmpq %r14, 0x8(%rsp)
jne 0x2246
cmpq %r14, 0x10(%rsp)
jne 0x2265
cmpq %r14, 0x18(%rsp)
jne 0x2284
pushq $0x1
popq %rsi
movq %rsp, %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x388e
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
cmpq %rax, (%rbx)
jne 0x22a3
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
cmpq %rax, 0x8(%rsp)
jne 0x22c2
cmpq %rax, 0x10(%rsp)
jne 0x22e1
cmpq %rax, 0x18(%rsp)
jne 0x2300
pushq $0x1
popq %rsi
movq %rsp, %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x388e
movabsq $-0x2000000000000000, %rax # imm = 0xE000000000000000
cmpq %rax, (%rbx)
jne 0x231f
movabsq $0x2000000000000000, %rax # imm = 0x2000000000000000
cmpq %rax, 0x8(%rsp)
jne 0x233e
cmpq %rax, 0x10(%rsp)
jne 0x235d
cmpq %rax, 0x18(%rsp)
jne 0x237c
pushq $0x1
popq %rsi
movq %rsp, %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x388e
movabsq $-0x1000000000000000, %rax # imm = 0xF000000000000000
cmpq %rax, (%rbx)
jne 0x239b
movabsq $0x1000000000000000, %rax # imm = 0x1000000000000000
cmpq %rax, 0x8(%rsp)
jne 0x23ba
cmpq %rax, 0x10(%rsp)
jne 0x23d9
cmpq %rax, 0x18(%rsp)
jne 0x23f8
pushq $0x3c
popq %rsi
movq %rsp, %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x388e
cmpq $-0x1, (%rbx)
jne 0x2417
cmpq $0x1, 0x8(%rsp)
jne 0x2436
cmpq $0x1, 0x10(%rsp)
jne 0x2455
cmpq $0x1, 0x18(%rsp)
jne 0x2474
pushq $0x3c
popq %rsi
movq %rsp, %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x388e
cmpq $-0x1, (%rbx)
jne 0x2493
cmpq $-0x10, 0x8(%rsp)
jne 0x24b2
cmpq $0x10, 0x10(%rsp)
jne 0x24d1
cmpq $0x10, 0x18(%rsp)
jne 0x24f0
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x80, %esi
movq %rbx, %rdx
callq 0x388e
cmpq $-0x1, (%rbx)
jne 0x250f
cmpq $-0x1, 0x8(%rsp)
jne 0x252e
cmpq $-0x1, 0x10(%rsp)
jne 0x254d
cmpq $-0x10, 0x18(%rsp)
jne 0x256c
pushq $0x1
popq %rsi
movq %rsp, %rbx
movq %rbx, %rdi
movq %rbx, %rdx
callq 0x388e
cmpq $-0x1, (%rbx)
jne 0x258b
cmpq $-0x1, 0x8(%rsp)
jne 0x25aa
cmpq $-0x1, 0x10(%rsp)
jne 0x25c9
cmpq $-0x8, 0x18(%rsp)
jne 0x25e8
movabsq $-0x78a0000000000000, %rax # imm = 0x8760000000000000
movq %rsp, %rbx
movq %rax, (%rbx)
movabsq $0x800000000000000, %rax # imm = 0x800000000000000
movq %rax, 0x8(%rbx)
movabsq $0x80000000000000, %rax # imm = 0x80000000000000
movq %rax, 0x10(%rbx)
movabsq $0x8000000000000, %rax  # imm = 0x8000000000000
movq %rax, 0x18(%rbx)
movq %rbx, %rdi
movl $0xc4, %esi
movq %rbx, %rdx
callq 0x388e
cmpq $-0x1, (%rbx)
jne 0x2607
cmpq $-0x1, 0x8(%rsp)
jne 0x2626
cmpq $-0x1, 0x10(%rsp)
jne 0x2645
movabsq $-0x78a000000000000, %rax # imm = 0xF876000000000000
cmpq %rax, 0x18(%rsp)
jne 0x2664
leaq 0x8(%rsp), %rax
movq %r14, -0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdx
callq 0x388e
cmpq $-0x1, (%rbx)
jne 0x2683
cmpq $-0x1, 0x8(%rsp)
jne 0x26a2
cmpq $-0x1, 0x10(%rsp)
jne 0x26c1
cmpq $-0x1, 0x18(%rsp)
jne 0x26e0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x36cf(%rip), %rdi      # 0x58fd
leaq 0x2e42(%rip), %rsi      # 0x5077
leaq 0x36e7(%rip), %rcx      # 0x5923
movl $0xa0, %edx
callq 0x1030
leaq 0x36ea(%rip), %rdi      # 0x5937
leaq 0x2e23(%rip), %rsi      # 0x5077
leaq 0x36c8(%rip), %rcx      # 0x5923
movl $0xa1, %edx
callq 0x1030
leaq 0x36f1(%rip), %rdi      # 0x595d
leaq 0x2e04(%rip), %rsi      # 0x5077
leaq 0x36a9(%rip), %rcx      # 0x5923
movl $0xa2, %edx
callq 0x1030
leaq 0x36f8(%rip), %rdi      # 0x5983
leaq 0x2de5(%rip), %rsi      # 0x5077
leaq 0x368a(%rip), %rcx      # 0x5923
movl $0xa3, %edx
callq 0x1030
leaq 0x36ff(%rip), %rdi      # 0x59a9
leaq 0x2dc6(%rip), %rsi      # 0x5077
leaq 0x366b(%rip), %rcx      # 0x5923
movl $0xa7, %edx
callq 0x1030
leaq 0x3706(%rip), %rdi      # 0x59cf
leaq 0x2da7(%rip), %rsi      # 0x5077
leaq 0x364c(%rip), %rcx      # 0x5923
movl $0xa8, %edx
callq 0x1030
leaq 0x370d(%rip), %rdi      # 0x59f5
leaq 0x2d88(%rip), %rsi      # 0x5077
leaq 0x362d(%rip), %rcx      # 0x5923
movl $0xa9, %edx
callq 0x1030
leaq 0x3714(%rip), %rdi      # 0x5a1b
leaq 0x2d69(%rip), %rsi      # 0x5077
leaq 0x360e(%rip), %rcx      # 0x5923
movl $0xaa, %edx
callq 0x1030
leaq 0x371b(%rip), %rdi      # 0x5a41
leaq 0x2d4a(%rip), %rsi      # 0x5077
leaq 0x35ef(%rip), %rcx      # 0x5923
movl $0xae, %edx
callq 0x1030
leaq 0x3722(%rip), %rdi      # 0x5a67
leaq 0x2d2b(%rip), %rsi      # 0x5077
leaq 0x35d0(%rip), %rcx      # 0x5923
movl $0xaf, %edx
callq 0x1030
leaq 0x3729(%rip), %rdi      # 0x5a8d
leaq 0x2d0c(%rip), %rsi      # 0x5077
leaq 0x35b1(%rip), %rcx      # 0x5923
movl $0xb0, %edx
callq 0x1030
leaq 0x3730(%rip), %rdi      # 0x5ab3
leaq 0x2ced(%rip), %rsi      # 0x5077
leaq 0x3592(%rip), %rcx      # 0x5923
movl $0xb1, %edx
callq 0x1030
leaq 0x3737(%rip), %rdi      # 0x5ad9
leaq 0x2cce(%rip), %rsi      # 0x5077
leaq 0x3573(%rip), %rcx      # 0x5923
movl $0xb5, %edx
callq 0x1030
leaq 0x373e(%rip), %rdi      # 0x5aff
leaq 0x2caf(%rip), %rsi      # 0x5077
leaq 0x3554(%rip), %rcx      # 0x5923
movl $0xb6, %edx
callq 0x1030
leaq 0x3745(%rip), %rdi      # 0x5b25
leaq 0x2c90(%rip), %rsi      # 0x5077
leaq 0x3535(%rip), %rcx      # 0x5923
movl $0xb7, %edx
callq 0x1030
leaq 0x374c(%rip), %rdi      # 0x5b4b
leaq 0x2c71(%rip), %rsi      # 0x5077
leaq 0x3516(%rip), %rcx      # 0x5923
movl $0xb8, %edx
callq 0x1030
leaq 0x3753(%rip), %rdi      # 0x5b71
leaq 0x2c52(%rip), %rsi      # 0x5077
leaq 0x34f7(%rip), %rcx      # 0x5923
movl $0xbc, %edx
callq 0x1030
leaq 0x375a(%rip), %rdi      # 0x5b97
leaq 0x2c33(%rip), %rsi      # 0x5077
leaq 0x34d8(%rip), %rcx      # 0x5923
movl $0xbd, %edx
callq 0x1030
leaq 0x3761(%rip), %rdi      # 0x5bbd
leaq 0x2c14(%rip), %rsi      # 0x5077
leaq 0x34b9(%rip), %rcx      # 0x5923
movl $0xbe, %edx
callq 0x1030
leaq 0x3768(%rip), %rdi      # 0x5be3
leaq 0x2bf5(%rip), %rsi      # 0x5077
leaq 0x349a(%rip), %rcx      # 0x5923
movl $0xbf, %edx
callq 0x1030
leaq 0x36d7(%rip), %rdi      # 0x5b71
leaq 0x2bd6(%rip), %rsi      # 0x5077
leaq 0x347b(%rip), %rcx      # 0x5923
movl $0xc3, %edx
callq 0x1030
leaq 0x3750(%rip), %rdi      # 0x5c09
leaq 0x2bb7(%rip), %rsi      # 0x5077
leaq 0x345c(%rip), %rcx      # 0x5923
movl $0xc4, %edx
callq 0x1030
leaq 0x3757(%rip), %rdi      # 0x5c2f
leaq 0x2b98(%rip), %rsi      # 0x5077
leaq 0x343d(%rip), %rcx      # 0x5923
movl $0xc5, %edx
callq 0x1030
leaq 0x375e(%rip), %rdi      # 0x5c55
leaq 0x2b79(%rip), %rsi      # 0x5077
leaq 0x341e(%rip), %rcx      # 0x5923
movl $0xc6, %edx
callq 0x1030
leaq 0x365b(%rip), %rdi      # 0x5b71
leaq 0x2b5a(%rip), %rsi      # 0x5077
leaq 0x33ff(%rip), %rcx      # 0x5923
movl $0xca, %edx
callq 0x1030
leaq 0x3746(%rip), %rdi      # 0x5c7b
leaq 0x2b3b(%rip), %rsi      # 0x5077
leaq 0x33e0(%rip), %rcx      # 0x5923
movl $0xcb, %edx
callq 0x1030
leaq 0x374d(%rip), %rdi      # 0x5ca1
leaq 0x2b1c(%rip), %rsi      # 0x5077
leaq 0x33c1(%rip), %rcx      # 0x5923
movl $0xcc, %edx
callq 0x1030
leaq 0x3754(%rip), %rdi      # 0x5cc7
leaq 0x2afd(%rip), %rsi      # 0x5077
leaq 0x33a2(%rip), %rcx      # 0x5923
movl $0xcd, %edx
callq 0x1030
leaq 0x35df(%rip), %rdi      # 0x5b71
leaq 0x2ade(%rip), %rsi      # 0x5077
leaq 0x3383(%rip), %rcx      # 0x5923
movl $0xd1, %edx
callq 0x1030
leaq 0x36ca(%rip), %rdi      # 0x5c7b
leaq 0x2abf(%rip), %rsi      # 0x5077
leaq 0x3364(%rip), %rcx      # 0x5923
movl $0xd2, %edx
callq 0x1030
leaq 0x36d1(%rip), %rdi      # 0x5ca1
leaq 0x2aa0(%rip), %rsi      # 0x5077
leaq 0x3345(%rip), %rcx      # 0x5923
movl $0xd3, %edx
callq 0x1030
leaq 0x36fe(%rip), %rdi      # 0x5ced
leaq 0x2a81(%rip), %rsi      # 0x5077
leaq 0x3326(%rip), %rcx      # 0x5923
movl $0xd4, %edx
callq 0x1030
leaq 0x3563(%rip), %rdi      # 0x5b71
leaq 0x2a62(%rip), %rsi      # 0x5077
leaq 0x3307(%rip), %rcx      # 0x5923
movl $0xdd, %edx
callq 0x1030
leaq 0x364e(%rip), %rdi      # 0x5c7b
leaq 0x2a43(%rip), %rsi      # 0x5077
leaq 0x32e8(%rip), %rcx      # 0x5923
movl $0xde, %edx
callq 0x1030
leaq 0x3655(%rip), %rdi      # 0x5ca1
leaq 0x2a24(%rip), %rsi      # 0x5077
leaq 0x32c9(%rip), %rcx      # 0x5923
movl $0xdf, %edx
callq 0x1030
leaq 0x36a8(%rip), %rdi      # 0x5d13
leaq 0x2a05(%rip), %rsi      # 0x5077
leaq 0x32aa(%rip), %rcx      # 0x5923
movl $0xe0, %edx
callq 0x1030
leaq 0x34e7(%rip), %rdi      # 0x5b71
leaq 0x29e6(%rip), %rsi      # 0x5077
leaq 0x328b(%rip), %rcx      # 0x5923
movl $0xe9, %edx
callq 0x1030
leaq 0x35d2(%rip), %rdi      # 0x5c7b
leaq 0x29c7(%rip), %rsi      # 0x5077
leaq 0x326c(%rip), %rcx      # 0x5923
movl $0xea, %edx
callq 0x1030
leaq 0x35d9(%rip), %rdi      # 0x5ca1
leaq 0x29a8(%rip), %rsi      # 0x5077
leaq 0x324d(%rip), %rcx      # 0x5923
movl $0xeb, %edx
callq 0x1030
leaq 0x3652(%rip), %rdi      # 0x5d39
leaq 0x2989(%rip), %rsi      # 0x5077
leaq 0x322e(%rip), %rcx      # 0x5923
movl $0xec, %edx
callq 0x1030