// File: /workspace/github_c_makefile_star2_O1/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 0x142a
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0x13, %rcx
je 0x12d6
movb 0x5(%rsp,%rax), %dl
leaq 0x1(%rax), %rcx
cmpb 0x2d(%rsp,%rax), %dl
je 0x12bf
cmpq $0x12, %rax
jbe 0x142a
cmpb $0x12, 0x4(%rsp)
jne 0x1468
cmpb $-0x66, 0xd(%rsp)
jne 0x1487
cmpb $0x12, 0xe(%rsp)
jne 0x14a6
cmpb $-0x66, 0x17(%rsp)
jne 0x14c5
movq 0x5(%rsp), %rax
movq 0xf(%rsp), %rcx
movb $0x12, 0x18(%rsp)
movq %rax, 0x19(%rsp)
movw $0x129a, 0x21(%rsp)     # imm = 0x129A
movq %rcx, 0x23(%rsp)
movb $-0x66, 0x2b(%rsp)
cmpb $0x12, 0x4(%rsp)
jne 0x1449
xorl %ecx, %ecx
movq %rcx, %rax
cmpq $0x13, %rcx
je 0x1355
movb 0x5(%rsp,%rax), %dl
leaq 0x1(%rax), %rcx
cmpb 0x19(%rsp,%rax), %dl
je 0x133e
cmpq $0x12, %rax
jbe 0x1449
movq $-0x2, %r15
leaq 0x40(%rsp), %r12
leaq 0x2d86(%rip), %r13      # 0x40f8
leaq 0x2dd7(%rip), %rbx      # 0x4150
movzbl 0x4(%r15,%r13), %ecx
leal -0x30(%rcx), %ebp
cmpb $0xa, %bpl
jb 0x13a0
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x1394
addb $-0x57, %cl
jmp 0x139e
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x13df
addb $-0x37, %cl
movl %ecx, %ebp
movzbl 0x5(%r15,%r13), %ecx
leal -0x30(%rcx), %eax
cmpb $0xa, %al
jb 0x13c5
leal -0x61(%rcx), %eax
cmpb $0x5, %al
ja 0x13b9
addb $-0x57, %cl
jmp 0x13c3
leal -0x41(%rcx), %eax
cmpb $0x5, %al
ja 0x13f3
addb $-0x37, %cl
movl %ecx, %eax
shlb $0x4, %bpl
addb %al, %bpl
movb %bpl, (%r12)
addq $0x2, %r15
incq %r12
cmpq $0x26, %r15
jb 0x1379
jmp 0x1406
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %bpl
jmp 0x13a0
movq (%r14), %rdi
movq %rbx, %rsi
movl %ecx, %edx
xorl %eax, %eax
callq 0x1040
movb $-0x1, %al
jmp 0x13c5
movzwl 0x52(%rsp), %eax
rolw $0x8, %ax
cmpw $0x1, %ax
jne 0x14e4
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2bfe(%rip), %rdi      # 0x402f
leaq 0x2c16(%rip), %rsi      # 0x404e
leaq 0x2c1d(%rip), %rcx      # 0x405c
movl $0x8, %edx
callq 0x1030
leaq 0x2c85(%rip), %rdi      # 0x40d5
leaq 0x2bf7(%rip), %rsi      # 0x404e
leaq 0x2bfe(%rip), %rcx      # 0x405c
movl $0x10, %edx
callq 0x1030
leaq 0x2bf8(%rip), %rdi      # 0x4067
leaq 0x2bd8(%rip), %rsi      # 0x404e
leaq 0x2bdf(%rip), %rcx      # 0x405c
movl $0x9, %edx
callq 0x1030
leaq 0x2bf4(%rip), %rdi      # 0x4082
leaq 0x2bb9(%rip), %rsi      # 0x404e
leaq 0x2bc0(%rip), %rcx      # 0x405c
movl $0xa, %edx
callq 0x1030
leaq 0x2bf0(%rip), %rdi      # 0x409d
leaq 0x2b9a(%rip), %rsi      # 0x404e
leaq 0x2ba1(%rip), %rcx      # 0x405c
movl $0xb, %edx
callq 0x1030
leaq 0x2bed(%rip), %rdi      # 0x40b9
leaq 0x2b7b(%rip), %rsi      # 0x404e
leaq 0x2b82(%rip), %rcx      # 0x405c
movl $0xc, %edx
callq 0x1030
leaq 0x2c38(%rip), %rdi      # 0x4123
leaq 0x2b5c(%rip), %rsi      # 0x404e
leaq 0x2b63(%rip), %rcx      # 0x405c
movl $0x13, %edx
callq 0x1030
nop