// File: /workspace/github_c_makefile_star2_O2/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 0x32c1
movq $0x3, 0x18(%rbx)
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
callq 0x32c1
movq $0x8, 0x18(%rbx)
leaq 0x8(%rsp), %r14
movq %r14, %rdi
callq 0x32c1
movq %rbx, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x451a
cmpq $0x1, 0x18(%r14)
jne 0x2883
cmpq $0x0, 0x18(%rsp)
jne 0x28a2
cmpq $0x0, 0x10(%rsp)
jne 0x28c1
cmpq $0x0, 0x8(%rsp)
jne 0x28e0
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdx
callq 0x451a
cmpq $0x19a1, 0x18(%rbx)     # imm = 0x19A1
jne 0x28ff
cmpq $0x0, 0x18(%rsp)
jne 0x291e
cmpq $0x0, 0x10(%rsp)
jne 0x293d
cmpq $0x0, 0x8(%rsp)
jne 0x295c
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rbx
movq %rbx, %rdx
callq 0x451a
cmpq $0x200, 0x18(%rbx)      # imm = 0x200
jne 0x297b
cmpq $0x0, 0x18(%rsp)
jne 0x299a
cmpq $0x0, 0x10(%rsp)
jne 0x29b9
cmpq $0x0, 0x8(%rsp)
jne 0x29d8
leaq 0x8(%rsp), %rbx
movq $0xa0, 0x18(%rbx)
leaq 0x28(%rsp), %rdi
movq %rbx, %rsi
movq %rbx, %rdx
callq 0x451a
movabsq $0x304d37f120d696c8, %rax # imm = 0x304D37F120D696C8
cmpq %rax, (%rbx)
jne 0x29f7
movabsq $0x34550e63d9bb9c14, %rax # imm = 0x34550E63D9BB9C14
cmpq %rax, 0x10(%rsp)
jne 0x2a16
movabsq $-0x4b06e9a36121bcb2, %rax # imm = 0xB4F9165C9EDE434E
cmpq %rax, 0x18(%rsp)
jne 0x2a35
movabsq $0x4644e3998d6db881, %rax # imm = 0x4644E3998D6DB881
cmpq %rax, 0x20(%rsp)
jne 0x2a54
addq $0x68, %rsp
popq %rbx
popq %r14
retq
leaq 0x34d5(%rip), %rdi      # 0x5d5f
leaq 0x27e6(%rip), %rsi      # 0x5077
leaq 0x34dc(%rip), %rcx      # 0x5d74
movl $0xf9, %edx
callq 0x1030
leaq 0x34db(%rip), %rdi      # 0x5d84
leaq 0x27c7(%rip), %rsi      # 0x5077
leaq 0x34bd(%rip), %rcx      # 0x5d74
movl $0xfa, %edx
callq 0x1030
leaq 0x34d1(%rip), %rdi      # 0x5d99
leaq 0x27a8(%rip), %rsi      # 0x5077
leaq 0x349e(%rip), %rcx      # 0x5d74
movl $0xfb, %edx
callq 0x1030
leaq 0x34c7(%rip), %rdi      # 0x5dae
leaq 0x2789(%rip), %rsi      # 0x5077
leaq 0x347f(%rip), %rcx      # 0x5d74
movl $0xfc, %edx
callq 0x1030
leaq 0x34bd(%rip), %rdi      # 0x5dc3
leaq 0x276a(%rip), %rsi      # 0x5077
leaq 0x3460(%rip), %rcx      # 0x5d74
movl $0xff, %edx
callq 0x1030
leaq 0x345f(%rip), %rdi      # 0x5d84
leaq 0x274b(%rip), %rsi      # 0x5077
leaq 0x3441(%rip), %rcx      # 0x5d74
movl $0x100, %edx            # imm = 0x100
callq 0x1030
leaq 0x3455(%rip), %rdi      # 0x5d99
leaq 0x272c(%rip), %rsi      # 0x5077
leaq 0x3422(%rip), %rcx      # 0x5d74
movl $0x101, %edx            # imm = 0x101
callq 0x1030
leaq 0x344b(%rip), %rdi      # 0x5dae
leaq 0x270d(%rip), %rsi      # 0x5077
leaq 0x3403(%rip), %rcx      # 0x5d74
movl $0x102, %edx            # imm = 0x102
callq 0x1030
leaq 0x3459(%rip), %rdi      # 0x5ddb
leaq 0x26ee(%rip), %rsi      # 0x5077
leaq 0x33e4(%rip), %rcx      # 0x5d74
movl $0x105, %edx            # imm = 0x105
callq 0x1030
leaq 0x33e3(%rip), %rdi      # 0x5d84
leaq 0x26cf(%rip), %rsi      # 0x5077
leaq 0x33c5(%rip), %rcx      # 0x5d74
movl $0x106, %edx            # imm = 0x106
callq 0x1030
leaq 0x33d9(%rip), %rdi      # 0x5d99
leaq 0x26b0(%rip), %rsi      # 0x5077
leaq 0x33a6(%rip), %rcx      # 0x5d74
movl $0x107, %edx            # imm = 0x107
callq 0x1030
leaq 0x33cf(%rip), %rdi      # 0x5dae
leaq 0x2691(%rip), %rsi      # 0x5077
leaq 0x3387(%rip), %rcx      # 0x5d74
movl $0x108, %edx            # imm = 0x108
callq 0x1030
leaq 0x33f4(%rip), %rdi      # 0x5df2
leaq 0x2672(%rip), %rsi      # 0x5077
leaq 0x3368(%rip), %rcx      # 0x5d74
movl $0x10d, %edx            # imm = 0x10D
callq 0x1030
leaq 0x33fb(%rip), %rdi      # 0x5e18
leaq 0x2653(%rip), %rsi      # 0x5077
leaq 0x3349(%rip), %rcx      # 0x5d74
movl $0x10e, %edx            # imm = 0x10E
callq 0x1030
leaq 0x3402(%rip), %rdi      # 0x5e3e
leaq 0x2634(%rip), %rsi      # 0x5077
leaq 0x332a(%rip), %rcx      # 0x5d74
movl $0x10f, %edx            # imm = 0x10F
callq 0x1030
leaq 0x3409(%rip), %rdi      # 0x5e64
leaq 0x2615(%rip), %rsi      # 0x5077
leaq 0x330b(%rip), %rcx      # 0x5d74
movl $0x110, %edx            # imm = 0x110
callq 0x1030