// File: /workspace/github_c_makefile_star2_O3/wjmelements[P]evm/tst/address.c
// Function: main
int main() {
    address_t address = AddressFromHex40("123456789a123456789a123456789a123456789a");
    address_t equal = AddressFromHex42("0x123456789a123456789a123456789a123456789a");
    assert(AddressEqual(&address, &equal));
    assert(address.address[0] == 0x12);
    assert(address.address[9] == 0x9a);
    assert(address.address[10] == 0x12);
    assert(address.address[19] == 0x9a);
    uint256_t stacked;
    AddressToUint256(&stacked, &address);
    address_t unstacked = AddressFromUint256(&stacked);
    assert(AddressEqual(&address, &unstacked));

    address_t precompile = AddressFromHex42("0x0000000000000000000000000000000000000001");
    assert(AddressToPrecompile(precompile) == ECRECOVER);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq $-0x2, %r15
leaq 0x4(%rsp), %r12
leaq 0x2e99(%rip), %r13      # 0x4006
movq 0x5e84(%rip), %r14      # 0x6ff8
leaq 0x2fd5(%rip), %rbx      # 0x4150
movzbl 0x2(%r15,%r13), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x11a2
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x1196
addb $-0x57, %cl
jmp 0x11a0
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x11e1
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x3(%r15,%r13), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x11c7
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x11bb
addb $-0x57, %cl
jmp 0x11c5
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x11f5
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r12)
addq $0x2, %r15
incq %r12
cmpq $0x26, %r15
jb 0x117b
jmp 0x1208
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %bpl
jmp 0x11a2
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %al
jmp 0x11c7
movq $-0x2, %r15
leaq 0x2c(%rsp), %r12
leaq 0x2de9(%rip), %r13      # 0x4004
leaq 0x2f2e(%rip), %rbx      # 0x4150
movzbl 0x4(%r15,%r13), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x1249
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x123d
addb $-0x57, %cl
jmp 0x1247
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x1288
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x5(%r15,%r13), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x126e
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x1262
addb $-0x57, %cl
jmp 0x126c
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x129c
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r12)
addq $0x2, %r15
incq %r12
cmpq $0x26, %r15
jb 0x1222
jmp 0x12af
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %bpl
jmp 0x1249
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %al
jmp 0x126e
movb 0x4(%rsp), %al
cmpb 0x2c(%rsp), %al
jne 0x1423
movq $-0x1, %rcx
cmpq $0x12, %rcx
je 0x12e7
movb 0x6(%rsp,%rcx), %sil
leaq 0x1(%rcx), %rdx
cmpb 0x2e(%rsp,%rcx), %sil
movq %rdx, %rcx
je 0x12c4
cmpq $0x12, %rdx
jbe 0x1423
cmpb $0x12, %al
jne 0x1442
cmpb $-0x66, 0xd(%rsp)
jne 0x1461
cmpb $0x12, 0xe(%rsp)
jne 0x1480
cmpb $-0x66, 0x17(%rsp)
jne 0x149f
movq 0x5(%rsp), %rax
movq 0xf(%rsp), %rcx
movq %rax, 0x19(%rsp)
movw $0x129a, 0x21(%rsp)     # imm = 0x129A
movq %rcx, 0x23(%rsp)
movb $-0x66, 0x2b(%rsp)
movq $-0x1, %rax
cmpq $0x12, %rax
je 0x1358
movb 0x6(%rsp,%rax), %dl
leaq 0x1(%rax), %rcx
cmpb 0x1a(%rsp,%rax), %dl
movq %rcx, %rax
je 0x1337
cmpq $0x12, %rcx
jbe 0x14dd
movq $-0x2, %r15
leaq 0x40(%rsp), %r12
leaq 0x2d8d(%rip), %r13      # 0x40f8
leaq 0x2dde(%rip), %rbx      # 0x4150
movzbl 0x4(%r15,%r13), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x1399
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x138d
addb $-0x57, %cl
jmp 0x1397
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x13d8
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x5(%r15,%r13), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x13be
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x13b2
addb $-0x57, %cl
jmp 0x13bc
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x13ec
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r12)
addq $0x2, %r15
incq %r12
cmpq $0x26, %r15
jb 0x1372
jmp 0x13ff
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %bpl
jmp 0x1399
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %al
jmp 0x13be
movzwl 0x52(%rsp), %eax
rolw $0x8, %ax
cmpw $0x1, %ax
jne 0x14be
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2c05(%rip), %rdi      # 0x402f
leaq 0x2c1d(%rip), %rsi      # 0x404e
leaq 0x2c24(%rip), %rcx      # 0x405c
movl $0x8, %edx
callq 0x1030
leaq 0x2c1e(%rip), %rdi      # 0x4067
leaq 0x2bfe(%rip), %rsi      # 0x404e
leaq 0x2c05(%rip), %rcx      # 0x405c
movl $0x9, %edx
callq 0x1030
leaq 0x2c1a(%rip), %rdi      # 0x4082
leaq 0x2bdf(%rip), %rsi      # 0x404e
leaq 0x2be6(%rip), %rcx      # 0x405c
movl $0xa, %edx
callq 0x1030
leaq 0x2c16(%rip), %rdi      # 0x409d
leaq 0x2bc0(%rip), %rsi      # 0x404e
leaq 0x2bc7(%rip), %rcx      # 0x405c
movl $0xb, %edx
callq 0x1030
leaq 0x2c13(%rip), %rdi      # 0x40b9
leaq 0x2ba1(%rip), %rsi      # 0x404e
leaq 0x2ba8(%rip), %rcx      # 0x405c
movl $0xc, %edx
callq 0x1030
leaq 0x2c5e(%rip), %rdi      # 0x4123
leaq 0x2b82(%rip), %rsi      # 0x404e
leaq 0x2b89(%rip), %rcx      # 0x405c
movl $0x13, %edx
callq 0x1030
leaq 0x2bf1(%rip), %rdi      # 0x40d5
leaq 0x2b63(%rip), %rsi      # 0x404e
leaq 0x2b6a(%rip), %rcx      # 0x405c
movl $0x10, %edx
callq 0x1030