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

    clear256(&a);
    LOWER(LOWER(a)) = 3;
    clear256(&b);
    LOWER(LOWER(b)) = 8;
    clear256(&c);

    exp256(&b, &c, &c);
    assert(LOWER(LOWER(c)) == 1);
    assert(UPPER(LOWER(c)) == 0);
    assert(LOWER(UPPER(c)) == 0);
    assert(UPPER(UPPER(c)) == 0);

    exp256(&a, &b, &c);
    assert(LOWER(LOWER(c)) == 6561);
    assert(UPPER(LOWER(c)) == 0);
    assert(LOWER(UPPER(c)) == 0);
    assert(UPPER(UPPER(c)) == 0);

    exp256(&b, &a, &c);
    assert(LOWER(LOWER(c)) == 512);
    assert(UPPER(LOWER(c)) == 0);
    assert(LOWER(UPPER(c)) == 0);
    assert(UPPER(UPPER(c)) == 0);

    LOWER(LOWER(c)) = 160;

    exp256(&a, &c, &c);
    assert(UPPER(UPPER(c)) == 0x304d37f120d696c8);
    assert(LOWER(UPPER(c)) == 0x34550e63d9bb9c14);
    assert(UPPER(LOWER(c)) == 0xb4f9165c9ede434e);
    assert(LOWER(LOWER(c)) == 0x4644e3998d6db881);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
leaq 0x28(%rsp), %rbx
movq %rbx, %rdi
callq 0x33ce
movq $0x3, 0x18(%rbx)
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x33ce
movq $0x8, 0x18(%rbx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x33ce
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x4885
cmpq $0x1, 0x18(%r14)
jne 0x2958
cmpq $0x0, 0x18(%rsp)
jne 0x2977
cmpq $0x0, 0x10(%rsp)
jne 0x2996
cmpq $0x0, 0x8(%rsp)
jne 0x29b5
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdx
callq 0x4885
cmpq $0x19a1, 0x18(%rbx)     # imm = 0x19A1
jne 0x29d4
cmpq $0x0, 0x18(%rsp)
jne 0x29f3
cmpq $0x0, 0x10(%rsp)
jne 0x2a12
cmpq $0x0, 0x8(%rsp)
jne 0x2a31
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdx
callq 0x4885
cmpq $0x200, 0x18(%rbx)      # imm = 0x200
jne 0x2a50
cmpq $0x0, 0x18(%rsp)
jne 0x2a6f
cmpq $0x0, 0x10(%rsp)
jne 0x2a8e
cmpq $0x0, 0x8(%rsp)
jne 0x2aad
leaq 0x8(%rsp), %rbx
movq $0xa0, 0x18(%rbx)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x4885
movabsq $0x304d37f120d696c8, %rax # imm = 0x304D37F120D696C8
cmpq %rax, (%rbx)
jne 0x2acc
movabsq $0x34550e63d9bb9c14, %rax # imm = 0x34550E63D9BB9C14
cmpq %rax, 0x10(%rsp)
jne 0x2aeb
movabsq $-0x4b06e9a36121bcb2, %rax # imm = 0xB4F9165C9EDE434E
cmpq %rax, 0x18(%rsp)
jne 0x2b0a
movabsq $0x4644e3998d6db881, %rax # imm = 0x4644E3998D6DB881
cmpq %rax, 0x20(%rsp)
jne 0x2b29
addq $0x68, %rsp
popq %rbx
popq %r14
retq
leaq 0x4400(%rip), %rdi      # 0x6d5f
leaq 0x3711(%rip), %rsi      # 0x6077
leaq 0x4407(%rip), %rcx      # 0x6d74
movl $0xf9, %edx
callq 0x1030
leaq 0x4406(%rip), %rdi      # 0x6d84
leaq 0x36f2(%rip), %rsi      # 0x6077
leaq 0x43e8(%rip), %rcx      # 0x6d74
movl $0xfa, %edx
callq 0x1030
leaq 0x43fc(%rip), %rdi      # 0x6d99
leaq 0x36d3(%rip), %rsi      # 0x6077
leaq 0x43c9(%rip), %rcx      # 0x6d74
movl $0xfb, %edx
callq 0x1030
leaq 0x43f2(%rip), %rdi      # 0x6dae
leaq 0x36b4(%rip), %rsi      # 0x6077
leaq 0x43aa(%rip), %rcx      # 0x6d74
movl $0xfc, %edx
callq 0x1030
leaq 0x43e8(%rip), %rdi      # 0x6dc3
leaq 0x3695(%rip), %rsi      # 0x6077
leaq 0x438b(%rip), %rcx      # 0x6d74
movl $0xff, %edx
callq 0x1030
leaq 0x438a(%rip), %rdi      # 0x6d84
leaq 0x3676(%rip), %rsi      # 0x6077
leaq 0x436c(%rip), %rcx      # 0x6d74
movl $0x100, %edx            # imm = 0x100
callq 0x1030
leaq 0x4380(%rip), %rdi      # 0x6d99
leaq 0x3657(%rip), %rsi      # 0x6077
leaq 0x434d(%rip), %rcx      # 0x6d74
movl $0x101, %edx            # imm = 0x101
callq 0x1030
leaq 0x4376(%rip), %rdi      # 0x6dae
leaq 0x3638(%rip), %rsi      # 0x6077
leaq 0x432e(%rip), %rcx      # 0x6d74
movl $0x102, %edx            # imm = 0x102
callq 0x1030
leaq 0x4384(%rip), %rdi      # 0x6ddb
leaq 0x3619(%rip), %rsi      # 0x6077
leaq 0x430f(%rip), %rcx      # 0x6d74
movl $0x105, %edx            # imm = 0x105
callq 0x1030
leaq 0x430e(%rip), %rdi      # 0x6d84
leaq 0x35fa(%rip), %rsi      # 0x6077
leaq 0x42f0(%rip), %rcx      # 0x6d74
movl $0x106, %edx            # imm = 0x106
callq 0x1030
leaq 0x4304(%rip), %rdi      # 0x6d99
leaq 0x35db(%rip), %rsi      # 0x6077
leaq 0x42d1(%rip), %rcx      # 0x6d74
movl $0x107, %edx            # imm = 0x107
callq 0x1030
leaq 0x42fa(%rip), %rdi      # 0x6dae
leaq 0x35bc(%rip), %rsi      # 0x6077
leaq 0x42b2(%rip), %rcx      # 0x6d74
movl $0x108, %edx            # imm = 0x108
callq 0x1030
leaq 0x431f(%rip), %rdi      # 0x6df2
leaq 0x359d(%rip), %rsi      # 0x6077
leaq 0x4293(%rip), %rcx      # 0x6d74
movl $0x10d, %edx            # imm = 0x10D
callq 0x1030
leaq 0x4326(%rip), %rdi      # 0x6e18
leaq 0x357e(%rip), %rsi      # 0x6077
leaq 0x4274(%rip), %rcx      # 0x6d74
movl $0x10e, %edx            # imm = 0x10E
callq 0x1030
leaq 0x432d(%rip), %rdi      # 0x6e3e
leaq 0x355f(%rip), %rsi      # 0x6077
leaq 0x4255(%rip), %rcx      # 0x6d74
movl $0x10f, %edx            # imm = 0x10F
callq 0x1030
leaq 0x4334(%rip), %rdi      # 0x6e64
leaq 0x3540(%rip), %rsi      # 0x6077
leaq 0x4236(%rip), %rcx      # 0x6d74
movl $0x110, %edx            # imm = 0x110
callq 0x1030