// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/tst/uint256.c
// Function: test_bitwise
void test_bitwise() {
    uint256_t a, b, c, d;

    LOWER(LOWER(a)) = 2ull;
    UPPER(LOWER(a)) = 3ull << 8;
    LOWER(UPPER(a)) = 5ull << 16;
    UPPER(UPPER(a)) = 7ull << 24;

    LOWER(LOWER(b)) = 11ull << 32;
    UPPER(LOWER(b)) = (13ull << 40) + (7ull << 8);
    LOWER(UPPER(b)) = 17ull << 48;
    UPPER(UPPER(b)) = 19ull << 56;

    LOWER(LOWER(c)) = 23ull;
    UPPER(LOWER(c)) = 29ull;
    LOWER(UPPER(c)) = 31ull;
    UPPER(UPPER(c)) = 37ull;

    and256(&a, &b, &d);
    assert((LOWER(LOWER(a)) & LOWER(LOWER(b))) == LOWER(LOWER(d)));
    assert((UPPER(LOWER(a)) & UPPER(LOWER(b))) == UPPER(LOWER(d)));
    assert((LOWER(UPPER(a)) & LOWER(UPPER(b))) == LOWER(UPPER(d)));
    assert((UPPER(UPPER(a)) & UPPER(UPPER(b))) == UPPER(UPPER(d)));

    and256(&a, &c, &d);
    assert((LOWER(LOWER(a)) & LOWER(LOWER(c))) == LOWER(LOWER(d)));
    assert((UPPER(LOWER(a)) & UPPER(LOWER(c))) == UPPER(LOWER(d)));
    assert((LOWER(UPPER(a)) & LOWER(UPPER(c))) == LOWER(UPPER(d)));
    assert((UPPER(UPPER(a)) & UPPER(UPPER(c))) == UPPER(UPPER(d)));

    or256(&a, &b, &d);
    assert((LOWER(LOWER(a)) | LOWER(LOWER(b))) == LOWER(LOWER(d)));
    assert((UPPER(LOWER(a)) | UPPER(LOWER(b))) == UPPER(LOWER(d)));
    assert((LOWER(UPPER(a)) | LOWER(UPPER(b))) == LOWER(UPPER(d)));
    assert((UPPER(UPPER(a)) | UPPER(UPPER(b))) == UPPER(UPPER(d)));

    or256(&a, &c, &d);
    assert((LOWER(LOWER(a)) | LOWER(LOWER(c))) == LOWER(LOWER(d)));
    assert((UPPER(LOWER(a)) | UPPER(LOWER(c))) == UPPER(LOWER(d)));
    assert((LOWER(UPPER(a)) | LOWER(UPPER(c))) == LOWER(UPPER(d)));
    assert((UPPER(UPPER(a)) | UPPER(UPPER(c))) == UPPER(UPPER(d)));

    xor256(&a, &b, &d);
    assert((LOWER(LOWER(a)) ^ LOWER(LOWER(b))) == LOWER(LOWER(d)));
    assert((UPPER(LOWER(a)) ^ UPPER(LOWER(b))) == UPPER(LOWER(d)));
    assert((LOWER(UPPER(a)) ^ LOWER(UPPER(b))) == LOWER(UPPER(d)));
    assert((UPPER(UPPER(a)) ^ UPPER(UPPER(b))) == UPPER(UPPER(d)));

    xor256(&a, &c, &d);
    assert((LOWER(LOWER(a)) ^ LOWER(LOWER(c))) == LOWER(LOWER(d)));
    assert((UPPER(LOWER(a)) ^ UPPER(LOWER(c))) == UPPER(LOWER(d)));
    assert((LOWER(UPPER(a)) ^ LOWER(UPPER(c))) == LOWER(UPPER(d)));
    assert((UPPER(UPPER(a)) ^ UPPER(UPPER(c))) == UPPER(UPPER(d)));

    xor256(&a, &b, &a);
    xor256(&a, &b, &b);
    xor256(&a, &b, &a);
    assert(LOWER(LOWER(b)) == 2ull);
    assert(UPPER(LOWER(b)) == 3ull << 8);
    assert(LOWER(UPPER(b)) == 5ull << 16);
    assert(UPPER(UPPER(b)) == 7ull << 24);
    assert(LOWER(LOWER(a)) == 11ull << 32);
    assert(UPPER(LOWER(a)) == (13ull << 40) + (7ull << 8));
    assert(LOWER(UPPER(a)) == 17ull << 48);
    assert(UPPER(UPPER(a)) == 19ull << 56);

    clear256(&d);
    assert(LOWER(LOWER(d)) == 0);
    assert(UPPER(LOWER(d)) == 0);
    assert(LOWER(UPPER(d)) == 0);
    assert(UPPER(UPPER(d)) == 0);

    assert(!zero256(&a));
    assert(!zero256(&b));
    assert(!zero256(&c));
    assert(zero256(&d));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq $0x2, -0x8(%rbp)
movq $0x300, -0x10(%rbp)     # imm = 0x300
movq $0x50000, -0x18(%rbp)   # imm = 0x50000
movq $0x7000000, -0x20(%rbp) # imm = 0x7000000
movabsq $0xb00000000, %rax      # imm = 0xB00000000
movq %rax, -0x28(%rbp)
movabsq $0xd0000000700, %rax    # imm = 0xD0000000700
movq %rax, -0x30(%rbp)
movabsq $0x11000000000000, %rax # imm = 0x11000000000000
movq %rax, -0x38(%rbp)
movabsq $0x1300000000000000, %rax # imm = 0x1300000000000000
movq %rax, -0x40(%rbp)
movq $0x17, -0x48(%rbp)
movq $0x1d, -0x50(%rbp)
movq $0x1f, -0x58(%rbp)
movq $0x25, -0x60(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x47f0
movq -0x8(%rbp), %rax
andq -0x28(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x11f4
jmp 0x1213
leaq 0x5e09(%rip), %rdi      # 0x7004
leaq 0x5e39(%rip), %rsi      # 0x703b
movl $0x1a, %edx
leaq 0x5e3b(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x10(%rbp), %rax
andq -0x30(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x1223
jmp 0x1242
leaq 0x5e33(%rip), %rdi      # 0x705d
leaq 0x5e0a(%rip), %rsi      # 0x703b
movl $0x1b, %edx
leaq 0x5e0c(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x18(%rbp), %rax
andq -0x38(%rbp), %rax
cmpq -0x78(%rbp), %rax
jne 0x1252
jmp 0x1271
leaq 0x5e3b(%rip), %rdi      # 0x7094
leaq 0x5ddb(%rip), %rsi      # 0x703b
movl $0x1c, %edx
leaq 0x5ddd(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x20(%rbp), %rax
andq -0x40(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x1281
jmp 0x12a0
leaq 0x5e43(%rip), %rdi      # 0x70cb
leaq 0x5dac(%rip), %rsi      # 0x703b
movl $0x1d, %edx
leaq 0x5dae(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x47f0
movq -0x8(%rbp), %rax
andq -0x48(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x12c1
jmp 0x12e0
leaq 0x5e3a(%rip), %rdi      # 0x7102
leaq 0x5d6c(%rip), %rsi      # 0x703b
movl $0x20, %edx
leaq 0x5d6e(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x10(%rbp), %rax
andq -0x50(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x12f0
jmp 0x130f
leaq 0x5e42(%rip), %rdi      # 0x7139
leaq 0x5d3d(%rip), %rsi      # 0x703b
movl $0x21, %edx
leaq 0x5d3f(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x18(%rbp), %rax
andq -0x58(%rbp), %rax
cmpq -0x78(%rbp), %rax
jne 0x131f
jmp 0x133e
leaq 0x5e4a(%rip), %rdi      # 0x7170
leaq 0x5d0e(%rip), %rsi      # 0x703b
movl $0x22, %edx
leaq 0x5d10(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x20(%rbp), %rax
andq -0x60(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x134e
jmp 0x136d
leaq 0x5e52(%rip), %rdi      # 0x71a7
leaq 0x5cdf(%rip), %rsi      # 0x703b
movl $0x23, %edx
leaq 0x5ce1(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x4710
movq -0x8(%rbp), %rax
orq -0x28(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x138e
jmp 0x13ad
leaq 0x5e49(%rip), %rdi      # 0x71de
leaq 0x5c9f(%rip), %rsi      # 0x703b
movl $0x26, %edx
leaq 0x5ca1(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x10(%rbp), %rax
orq -0x30(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x13bd
jmp 0x13dc
leaq 0x5e51(%rip), %rdi      # 0x7215
leaq 0x5c70(%rip), %rsi      # 0x703b
movl $0x27, %edx
leaq 0x5c72(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x18(%rbp), %rax
orq -0x38(%rbp), %rax
cmpq -0x78(%rbp), %rax
jne 0x13ec
jmp 0x140b
leaq 0x5e59(%rip), %rdi      # 0x724c
leaq 0x5c41(%rip), %rsi      # 0x703b
movl $0x28, %edx
leaq 0x5c43(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x20(%rbp), %rax
orq -0x40(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x141b
jmp 0x143a
leaq 0x5e61(%rip), %rdi      # 0x7283
leaq 0x5c12(%rip), %rsi      # 0x703b
movl $0x29, %edx
leaq 0x5c14(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x4710
movq -0x8(%rbp), %rax
orq -0x48(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x145b
jmp 0x147a
leaq 0x5e58(%rip), %rdi      # 0x72ba
leaq 0x5bd2(%rip), %rsi      # 0x703b
movl $0x2c, %edx
leaq 0x5bd4(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x10(%rbp), %rax
orq -0x50(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x148a
jmp 0x14a9
leaq 0x5e60(%rip), %rdi      # 0x72f1
leaq 0x5ba3(%rip), %rsi      # 0x703b
movl $0x2d, %edx
leaq 0x5ba5(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x18(%rbp), %rax
orq -0x58(%rbp), %rax
cmpq -0x78(%rbp), %rax
jne 0x14b9
jmp 0x14d8
leaq 0x5e68(%rip), %rdi      # 0x7328
leaq 0x5b74(%rip), %rsi      # 0x703b
movl $0x2e, %edx
leaq 0x5b76(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x20(%rbp), %rax
orq -0x60(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x14e8
jmp 0x1507
leaq 0x5e70(%rip), %rdi      # 0x735f
leaq 0x5b45(%rip), %rsi      # 0x703b
movl $0x2f, %edx
leaq 0x5b47(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x4880
movq -0x8(%rbp), %rax
xorq -0x28(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x1528
jmp 0x1547
leaq 0x5e67(%rip), %rdi      # 0x7396
leaq 0x5b05(%rip), %rsi      # 0x703b
movl $0x32, %edx
leaq 0x5b07(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x10(%rbp), %rax
xorq -0x30(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x1557
jmp 0x1576
leaq 0x5e6f(%rip), %rdi      # 0x73cd
leaq 0x5ad6(%rip), %rsi      # 0x703b
movl $0x33, %edx
leaq 0x5ad8(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x18(%rbp), %rax
xorq -0x38(%rbp), %rax
cmpq -0x78(%rbp), %rax
jne 0x1586
jmp 0x15a5
leaq 0x5e77(%rip), %rdi      # 0x7404
leaq 0x5aa7(%rip), %rsi      # 0x703b
movl $0x34, %edx
leaq 0x5aa9(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x20(%rbp), %rax
xorq -0x40(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x15b5
jmp 0x15d4
leaq 0x5e7f(%rip), %rdi      # 0x743b
leaq 0x5a78(%rip), %rsi      # 0x703b
movl $0x35, %edx
leaq 0x5a7a(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0x4880
movq -0x8(%rbp), %rax
xorq -0x48(%rbp), %rax
cmpq -0x68(%rbp), %rax
jne 0x15f5
jmp 0x1614
leaq 0x5e76(%rip), %rdi      # 0x7472
leaq 0x5a38(%rip), %rsi      # 0x703b
movl $0x38, %edx
leaq 0x5a3a(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x10(%rbp), %rax
xorq -0x50(%rbp), %rax
cmpq -0x70(%rbp), %rax
jne 0x1624
jmp 0x1643
leaq 0x5e7e(%rip), %rdi      # 0x74a9
leaq 0x5a09(%rip), %rsi      # 0x703b
movl $0x39, %edx
leaq 0x5a0b(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x18(%rbp), %rax
xorq -0x58(%rbp), %rax
cmpq -0x78(%rbp), %rax
jne 0x1653
jmp 0x1672
leaq 0x5e86(%rip), %rdi      # 0x74e0
leaq 0x59da(%rip), %rsi      # 0x703b
movl $0x3a, %edx
leaq 0x59dc(%rip), %rcx      # 0x7049
callq 0x1030
movq -0x20(%rbp), %rax
xorq -0x60(%rbp), %rax
cmpq -0x80(%rbp), %rax
jne 0x1682
jmp 0x16a1
leaq 0x5e8e(%rip), %rdi      # 0x7517
leaq 0x59ab(%rip), %rsi      # 0x703b
movl $0x3b, %edx
leaq 0x59ad(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rsi
movq %rdx, %rdi
callq 0x4880
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rdx
movq %rdx, %rsi
callq 0x4880
leaq -0x20(%rbp), %rdx
leaq -0x40(%rbp), %rsi
movq %rdx, %rdi
callq 0x4880
cmpq $0x2, -0x28(%rbp)
jne 0x16da
jmp 0x16f9
leaq 0x5e6d(%rip), %rdi      # 0x754e
leaq 0x5953(%rip), %rsi      # 0x703b
movl $0x40, %edx
leaq 0x5955(%rip), %rcx      # 0x7049
callq 0x1030
cmpq $0x300, -0x30(%rbp)     # imm = 0x300
jne 0x1705
jmp 0x1724
leaq 0x5e5a(%rip), %rdi      # 0x7566
leaq 0x5928(%rip), %rsi      # 0x703b
movl $0x41, %edx
leaq 0x592a(%rip), %rcx      # 0x7049
callq 0x1030
cmpq $0x50000, -0x38(%rbp)   # imm = 0x50000
jne 0x1730
jmp 0x174f
leaq 0x5e4c(%rip), %rdi      # 0x7583
leaq 0x58fd(%rip), %rsi      # 0x703b
movl $0x42, %edx
leaq 0x58ff(%rip), %rcx      # 0x7049
callq 0x1030
cmpq $0x7000000, -0x40(%rbp) # imm = 0x7000000
jne 0x175b
jmp 0x177a
leaq 0x5e3f(%rip), %rdi      # 0x75a1
leaq 0x58d2(%rip), %rsi      # 0x703b
movl $0x43, %edx
leaq 0x58d4(%rip), %rcx      # 0x7049
callq 0x1030
movabsq $0xb00000000, %rax      # imm = 0xB00000000
cmpq %rax, -0x8(%rbp)
jne 0x178c
jmp 0x17ab
leaq 0x5e2c(%rip), %rdi      # 0x75bf
leaq 0x58a1(%rip), %rsi      # 0x703b
movl $0x44, %edx
leaq 0x58a3(%rip), %rcx      # 0x7049
callq 0x1030
movabsq $0xd0000000700, %rax    # imm = 0xD0000000700
cmpq %rax, -0x10(%rbp)
jne 0x17bd
jmp 0x17dc
leaq 0x5e1a(%rip), %rdi      # 0x75de
leaq 0x5870(%rip), %rsi      # 0x703b
movl $0x45, %edx
leaq 0x5872(%rip), %rcx      # 0x7049
callq 0x1030
movabsq $0x11000000000000, %rax # imm = 0x11000000000000
cmpq %rax, -0x18(%rbp)
jne 0x17ee
jmp 0x180d
leaq 0x5e18(%rip), %rdi      # 0x760d
leaq 0x583f(%rip), %rsi      # 0x703b
movl $0x46, %edx
leaq 0x5841(%rip), %rcx      # 0x7049
callq 0x1030
movabsq $0x1300000000000000, %rax # imm = 0x1300000000000000
cmpq %rax, -0x20(%rbp)
jne 0x181f
jmp 0x183e
leaq 0x5e06(%rip), %rdi      # 0x762c
leaq 0x580e(%rip), %rsi      # 0x703b
movl $0x47, %edx
leaq 0x5810(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x80(%rbp), %rdi
callq 0x35f0
cmpq $0x0, -0x68(%rbp)
jne 0x1850
jmp 0x186f
leaq 0x5df4(%rip), %rdi      # 0x764b
leaq 0x57dd(%rip), %rsi      # 0x703b
movl $0x4a, %edx
leaq 0x57df(%rip), %rcx      # 0x7049
callq 0x1030
cmpq $0x0, -0x70(%rbp)
jne 0x1878
jmp 0x1897
leaq 0x5de1(%rip), %rdi      # 0x7660
leaq 0x57b5(%rip), %rsi      # 0x703b
movl $0x4b, %edx
leaq 0x57b7(%rip), %rcx      # 0x7049
callq 0x1030
cmpq $0x0, -0x78(%rbp)
jne 0x18a0
jmp 0x18bf
leaq 0x5dce(%rip), %rdi      # 0x7675
leaq 0x578d(%rip), %rsi      # 0x703b
movl $0x4c, %edx
leaq 0x578f(%rip), %rcx      # 0x7049
callq 0x1030
cmpq $0x0, -0x80(%rbp)
jne 0x18c8
jmp 0x18e7
leaq 0x5dbb(%rip), %rdi      # 0x768a
leaq 0x5765(%rip), %rsi      # 0x703b
movl $0x4d, %edx
leaq 0x5767(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x20(%rbp), %rdi
callq 0x34d0
testb $0x1, %al
jne 0x18f6
jmp 0x1915
leaq 0x5da2(%rip), %rdi      # 0x769f
leaq 0x5737(%rip), %rsi      # 0x703b
movl $0x4f, %edx
leaq 0x5739(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x40(%rbp), %rdi
callq 0x34d0
testb $0x1, %al
jne 0x1924
jmp 0x1943
leaq 0x5d81(%rip), %rdi      # 0x76ac
leaq 0x5709(%rip), %rsi      # 0x703b
movl $0x50, %edx
leaq 0x570b(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x60(%rbp), %rdi
callq 0x34d0
testb $0x1, %al
jne 0x1952
jmp 0x1971
leaq 0x5d60(%rip), %rdi      # 0x76b9
leaq 0x56db(%rip), %rsi      # 0x703b
movl $0x51, %edx
leaq 0x56dd(%rip), %rcx      # 0x7049
callq 0x1030
leaq -0x80(%rbp), %rdi
callq 0x34d0
testb $0x1, %al
jne 0x1980
jmp 0x1982
jmp 0x19a1
leaq 0x5e7c(%rip), %rdi      # 0x7805
leaq 0x56ab(%rip), %rsi      # 0x703b
movl $0x52, %edx
leaq 0x56ad(%rip), %rcx      # 0x7049
callq 0x1030
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)