// File: /workspace/github_c_makefile_star2_O1/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 0x3a46
cmpq (%rbx), %r15
jno 0x22fc
cmpq %r14, 0x8(%rsp)
jne 0x231b
cmpq %r14, 0x10(%rsp)
jne 0x233a
cmpq %r14, 0x18(%rsp)
jne 0x2359
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x3a46
movabsq $-0x4000000000000000, %rax # imm = 0xC000000000000000
cmpq %rax, (%rbx)
jne 0x2378
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
cmpq %rax, 0x8(%rsp)
jne 0x2397
cmpq %rax, 0x10(%rsp)
jne 0x23b6
cmpq %rax, 0x18(%rsp)
jne 0x23d5
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x3a46
movabsq $-0x2000000000000000, %rax # imm = 0xE000000000000000
cmpq %rax, (%rbx)
jne 0x23f4
movabsq $0x2000000000000000, %rax # imm = 0x2000000000000000
cmpq %rax, 0x8(%rsp)
jne 0x2413
cmpq %rax, 0x10(%rsp)
jne 0x2432
cmpq %rax, 0x18(%rsp)
jne 0x2451
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x3a46
movabsq $-0x1000000000000000, %rax # imm = 0xF000000000000000
cmpq %rax, (%rbx)
jne 0x2470
movabsq $0x1000000000000000, %rax # imm = 0x1000000000000000
cmpq %rax, 0x8(%rsp)
jne 0x248f
cmpq %rax, 0x10(%rsp)
jne 0x24ae
cmpq %rax, 0x18(%rsp)
jne 0x24cd
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3c, %esi
movq %rbx, %rdx
callq 0x3a46
cmpq $-0x1, (%rbx)
jne 0x24ec
cmpq $0x1, 0x8(%rsp)
jne 0x250b
cmpq $0x1, 0x10(%rsp)
jne 0x252a
cmpq $0x1, 0x18(%rsp)
jne 0x2549
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3c, %esi
movq %rbx, %rdx
callq 0x3a46
cmpq $-0x1, (%rbx)
jne 0x2568
cmpq $-0x10, 0x8(%rsp)
jne 0x2587
cmpq $0x10, 0x10(%rsp)
jne 0x25a6
cmpq $0x10, 0x18(%rsp)
jne 0x25c5
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x80, %esi
movq %rbx, %rdx
callq 0x3a46
cmpq $-0x1, (%rbx)
jne 0x25e4
cmpq $-0x1, 0x8(%rsp)
jne 0x2603
cmpq $-0x1, 0x10(%rsp)
jne 0x2622
cmpq $-0x10, 0x18(%rsp)
jne 0x2641
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x1, %esi
movq %rbx, %rdx
callq 0x3a46
cmpq $-0x1, (%rbx)
jne 0x2660
cmpq $-0x1, 0x8(%rsp)
jne 0x267f
cmpq $-0x1, 0x10(%rsp)
jne 0x269e
cmpq $-0x8, 0x18(%rsp)
jne 0x26bd
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 0x3a46
cmpq $-0x1, (%rbx)
jne 0x26dc
cmpq $-0x1, 0x8(%rsp)
jne 0x26fb
cmpq $-0x1, 0x10(%rsp)
jne 0x271a
movabsq $-0x78a000000000000, %rax # imm = 0xF876000000000000
cmpq %rax, 0x18(%rsp)
jne 0x2739
leaq 0x8(%rsp), %rax
movq %r14, -0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdx
callq 0x3a46
cmpq $-0x1, (%rbx)
jne 0x2758
cmpq $-0x1, 0x8(%rsp)
jne 0x2777
cmpq $-0x1, 0x10(%rsp)
jne 0x2796
cmpq $-0x1, 0x18(%rsp)
jne 0x27b5
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x45fa(%rip), %rdi      # 0x68fd
leaq 0x3d6d(%rip), %rsi      # 0x6077
leaq 0x4612(%rip), %rcx      # 0x6923
movl $0xa0, %edx
callq 0x1030
leaq 0x4615(%rip), %rdi      # 0x6937
leaq 0x3d4e(%rip), %rsi      # 0x6077
leaq 0x45f3(%rip), %rcx      # 0x6923
movl $0xa1, %edx
callq 0x1030
leaq 0x461c(%rip), %rdi      # 0x695d
leaq 0x3d2f(%rip), %rsi      # 0x6077
leaq 0x45d4(%rip), %rcx      # 0x6923
movl $0xa2, %edx
callq 0x1030
leaq 0x4623(%rip), %rdi      # 0x6983
leaq 0x3d10(%rip), %rsi      # 0x6077
leaq 0x45b5(%rip), %rcx      # 0x6923
movl $0xa3, %edx
callq 0x1030
leaq 0x462a(%rip), %rdi      # 0x69a9
leaq 0x3cf1(%rip), %rsi      # 0x6077
leaq 0x4596(%rip), %rcx      # 0x6923
movl $0xa7, %edx
callq 0x1030
leaq 0x4631(%rip), %rdi      # 0x69cf
leaq 0x3cd2(%rip), %rsi      # 0x6077
leaq 0x4577(%rip), %rcx      # 0x6923
movl $0xa8, %edx
callq 0x1030
leaq 0x4638(%rip), %rdi      # 0x69f5
leaq 0x3cb3(%rip), %rsi      # 0x6077
leaq 0x4558(%rip), %rcx      # 0x6923
movl $0xa9, %edx
callq 0x1030
leaq 0x463f(%rip), %rdi      # 0x6a1b
leaq 0x3c94(%rip), %rsi      # 0x6077
leaq 0x4539(%rip), %rcx      # 0x6923
movl $0xaa, %edx
callq 0x1030
leaq 0x4646(%rip), %rdi      # 0x6a41
leaq 0x3c75(%rip), %rsi      # 0x6077
leaq 0x451a(%rip), %rcx      # 0x6923
movl $0xae, %edx
callq 0x1030
leaq 0x464d(%rip), %rdi      # 0x6a67
leaq 0x3c56(%rip), %rsi      # 0x6077
leaq 0x44fb(%rip), %rcx      # 0x6923
movl $0xaf, %edx
callq 0x1030
leaq 0x4654(%rip), %rdi      # 0x6a8d
leaq 0x3c37(%rip), %rsi      # 0x6077
leaq 0x44dc(%rip), %rcx      # 0x6923
movl $0xb0, %edx
callq 0x1030
leaq 0x465b(%rip), %rdi      # 0x6ab3
leaq 0x3c18(%rip), %rsi      # 0x6077
leaq 0x44bd(%rip), %rcx      # 0x6923
movl $0xb1, %edx
callq 0x1030
leaq 0x4662(%rip), %rdi      # 0x6ad9
leaq 0x3bf9(%rip), %rsi      # 0x6077
leaq 0x449e(%rip), %rcx      # 0x6923
movl $0xb5, %edx
callq 0x1030
leaq 0x4669(%rip), %rdi      # 0x6aff
leaq 0x3bda(%rip), %rsi      # 0x6077
leaq 0x447f(%rip), %rcx      # 0x6923
movl $0xb6, %edx
callq 0x1030
leaq 0x4670(%rip), %rdi      # 0x6b25
leaq 0x3bbb(%rip), %rsi      # 0x6077
leaq 0x4460(%rip), %rcx      # 0x6923
movl $0xb7, %edx
callq 0x1030
leaq 0x4677(%rip), %rdi      # 0x6b4b
leaq 0x3b9c(%rip), %rsi      # 0x6077
leaq 0x4441(%rip), %rcx      # 0x6923
movl $0xb8, %edx
callq 0x1030
leaq 0x467e(%rip), %rdi      # 0x6b71
leaq 0x3b7d(%rip), %rsi      # 0x6077
leaq 0x4422(%rip), %rcx      # 0x6923
movl $0xbc, %edx
callq 0x1030
leaq 0x4685(%rip), %rdi      # 0x6b97
leaq 0x3b5e(%rip), %rsi      # 0x6077
leaq 0x4403(%rip), %rcx      # 0x6923
movl $0xbd, %edx
callq 0x1030
leaq 0x468c(%rip), %rdi      # 0x6bbd
leaq 0x3b3f(%rip), %rsi      # 0x6077
leaq 0x43e4(%rip), %rcx      # 0x6923
movl $0xbe, %edx
callq 0x1030
leaq 0x4693(%rip), %rdi      # 0x6be3
leaq 0x3b20(%rip), %rsi      # 0x6077
leaq 0x43c5(%rip), %rcx      # 0x6923
movl $0xbf, %edx
callq 0x1030
leaq 0x4602(%rip), %rdi      # 0x6b71
leaq 0x3b01(%rip), %rsi      # 0x6077
leaq 0x43a6(%rip), %rcx      # 0x6923
movl $0xc3, %edx
callq 0x1030
leaq 0x467b(%rip), %rdi      # 0x6c09
leaq 0x3ae2(%rip), %rsi      # 0x6077
leaq 0x4387(%rip), %rcx      # 0x6923
movl $0xc4, %edx
callq 0x1030
leaq 0x4682(%rip), %rdi      # 0x6c2f
leaq 0x3ac3(%rip), %rsi      # 0x6077
leaq 0x4368(%rip), %rcx      # 0x6923
movl $0xc5, %edx
callq 0x1030
leaq 0x4689(%rip), %rdi      # 0x6c55
leaq 0x3aa4(%rip), %rsi      # 0x6077
leaq 0x4349(%rip), %rcx      # 0x6923
movl $0xc6, %edx
callq 0x1030
leaq 0x4586(%rip), %rdi      # 0x6b71
leaq 0x3a85(%rip), %rsi      # 0x6077
leaq 0x432a(%rip), %rcx      # 0x6923
movl $0xca, %edx
callq 0x1030
leaq 0x4671(%rip), %rdi      # 0x6c7b
leaq 0x3a66(%rip), %rsi      # 0x6077
leaq 0x430b(%rip), %rcx      # 0x6923
movl $0xcb, %edx
callq 0x1030
leaq 0x4678(%rip), %rdi      # 0x6ca1
leaq 0x3a47(%rip), %rsi      # 0x6077
leaq 0x42ec(%rip), %rcx      # 0x6923
movl $0xcc, %edx
callq 0x1030
leaq 0x467f(%rip), %rdi      # 0x6cc7
leaq 0x3a28(%rip), %rsi      # 0x6077
leaq 0x42cd(%rip), %rcx      # 0x6923
movl $0xcd, %edx
callq 0x1030
leaq 0x450a(%rip), %rdi      # 0x6b71
leaq 0x3a09(%rip), %rsi      # 0x6077
leaq 0x42ae(%rip), %rcx      # 0x6923
movl $0xd1, %edx
callq 0x1030
leaq 0x45f5(%rip), %rdi      # 0x6c7b
leaq 0x39ea(%rip), %rsi      # 0x6077
leaq 0x428f(%rip), %rcx      # 0x6923
movl $0xd2, %edx
callq 0x1030
leaq 0x45fc(%rip), %rdi      # 0x6ca1
leaq 0x39cb(%rip), %rsi      # 0x6077
leaq 0x4270(%rip), %rcx      # 0x6923
movl $0xd3, %edx
callq 0x1030
leaq 0x4629(%rip), %rdi      # 0x6ced
leaq 0x39ac(%rip), %rsi      # 0x6077
leaq 0x4251(%rip), %rcx      # 0x6923
movl $0xd4, %edx
callq 0x1030
leaq 0x448e(%rip), %rdi      # 0x6b71
leaq 0x398d(%rip), %rsi      # 0x6077
leaq 0x4232(%rip), %rcx      # 0x6923
movl $0xdd, %edx
callq 0x1030
leaq 0x4579(%rip), %rdi      # 0x6c7b
leaq 0x396e(%rip), %rsi      # 0x6077
leaq 0x4213(%rip), %rcx      # 0x6923
movl $0xde, %edx
callq 0x1030
leaq 0x4580(%rip), %rdi      # 0x6ca1
leaq 0x394f(%rip), %rsi      # 0x6077
leaq 0x41f4(%rip), %rcx      # 0x6923
movl $0xdf, %edx
callq 0x1030
leaq 0x45d3(%rip), %rdi      # 0x6d13
leaq 0x3930(%rip), %rsi      # 0x6077
leaq 0x41d5(%rip), %rcx      # 0x6923
movl $0xe0, %edx
callq 0x1030
leaq 0x4412(%rip), %rdi      # 0x6b71
leaq 0x3911(%rip), %rsi      # 0x6077
leaq 0x41b6(%rip), %rcx      # 0x6923
movl $0xe9, %edx
callq 0x1030
leaq 0x44fd(%rip), %rdi      # 0x6c7b
leaq 0x38f2(%rip), %rsi      # 0x6077
leaq 0x4197(%rip), %rcx      # 0x6923
movl $0xea, %edx
callq 0x1030
leaq 0x4504(%rip), %rdi      # 0x6ca1
leaq 0x38d3(%rip), %rsi      # 0x6077
leaq 0x4178(%rip), %rcx      # 0x6923
movl $0xeb, %edx
callq 0x1030
leaq 0x457d(%rip), %rdi      # 0x6d39
leaq 0x38b4(%rip), %rsi      # 0x6077
leaq 0x4159(%rip), %rcx      # 0x6923
movl $0xec, %edx
callq 0x1030