// File: /workspace/github_c_makefile_star2_O0/wjmelements[P]evm/src/evm.c
// Function: createNewAccount
static account_t *createNewAccount(account_t *from) {
    uint64_t nonce = from->nonce++;
    uint8_t inputBuffer[28];
    if (nonce < 1) {
        // d6 94 address20 80
        inputBuffer[0] = 0xd6;
        inputBuffer[22] = 0x80;
    } else if (nonce < 0x80) {
        // d6 94 address20 nonce1
        inputBuffer[0] = 0xd6;
        inputBuffer[22] = nonce;
    } else if (nonce < 0x100) {
        // d7 94 address20 81 nonce1
        inputBuffer[0] = 0xd7;
        inputBuffer[22] = 0x81;
        inputBuffer[23] = nonce;
    } else if (nonce < 0x10000) {
        // d8 94 address20 82 nonce2
        inputBuffer[0] = 0xd8;
        inputBuffer[22] = 0x82;
        inputBuffer[23] = nonce >> 8;
        inputBuffer[24] = nonce;
    } else if (nonce < 0x1000000) {
        // d9 94 address20 83 nonce3
        inputBuffer[0] = 0xd9;
        inputBuffer[22] = 0x83;
        inputBuffer[23] = nonce >> 16;
        inputBuffer[24] = nonce >> 8;
        inputBuffer[25] = nonce;
    } else if (nonce < 0x100000000) {
        // da 94 address20 84 nonce4
        inputBuffer[0] = 0xda;
        inputBuffer[22] = 0x84;
        inputBuffer[23] = nonce >> 24;
        inputBuffer[24] = nonce >> 16;
        inputBuffer[25] = nonce >> 8;
        inputBuffer[26] = nonce;
    } else {
        fprintf(stderr, "Unsupported nonce %" PRIu64 "\n", nonce);
        return NULL;
    }
    inputBuffer[1] = 0x94;
    memcpy(inputBuffer + 2, from->address.address, 20);
    addressHashResult_t hashResult;
    keccak_256((uint8_t *)&hashResult, sizeof(hashResult), inputBuffer, inputBuffer[0] - 0xbf);
    account_t *result = getAccount(hashResult.bottom160);
    result->warm = evmIteration;
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rcx
movq 0x30(%rcx), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x30(%rcx)
movq %rax, -0x18(%rbp)
cmpq $0x1, -0x18(%rbp)
jae 0x997a
movb $-0x2a, -0x40(%rbp)
movb $-0x80, -0x2a(%rbp)
jmp 0x9a81
cmpq $0x80, -0x18(%rbp)
jae 0x9994
movb $-0x2a, -0x40(%rbp)
movq -0x18(%rbp), %rax
movb %al, -0x2a(%rbp)
jmp 0x9a7f
cmpq $0x100, -0x18(%rbp)     # imm = 0x100
jae 0x99b2
movb $-0x29, -0x40(%rbp)
movb $-0x7f, -0x2a(%rbp)
movq -0x18(%rbp), %rax
movb %al, -0x29(%rbp)
jmp 0x9a7d
cmpq $0x10000, -0x18(%rbp)   # imm = 0x10000
jae 0x99db
movb $-0x28, -0x40(%rbp)
movb $-0x7e, -0x2a(%rbp)
movq -0x18(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
movb %al, -0x28(%rbp)
jmp 0x9a7b
cmpq $0x1000000, -0x18(%rbp) # imm = 0x1000000
jae 0x9a0c
movb $-0x27, -0x40(%rbp)
movb $-0x7d, -0x2a(%rbp)
movq -0x18(%rbp), %rax
shrq $0x10, %rax
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x28(%rbp)
movq -0x18(%rbp), %rax
movb %al, -0x27(%rbp)
jmp 0x9a79
movabsq $0x100000000, %rax      # imm = 0x100000000
cmpq %rax, -0x18(%rbp)
jae 0x9a4e
movb $-0x26, -0x40(%rbp)
movb $-0x7c, -0x2a(%rbp)
movq -0x18(%rbp), %rax
shrq $0x18, %rax
movb %al, -0x29(%rbp)
movq -0x18(%rbp), %rax
shrq $0x10, %rax
movb %al, -0x28(%rbp)
movq -0x18(%rbp), %rax
shrq $0x8, %rax
movb %al, -0x27(%rbp)
movq -0x18(%rbp), %rax
movb %al, -0x26(%rbp)
jmp 0x9a77
movq 0x165a3(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x11385(%rip), %rsi     # 0x1ade8
movb $0x0, %al
callq 0x31e0
movq $0x0, -0x8(%rbp)
jmp 0x9b0d
jmp 0x9a79
jmp 0x9a7b
jmp 0x9a7d
jmp 0x9a7f
jmp 0x9a81
movb $-0x6c, -0x3f(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq %rcx, -0x3e(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x36(%rbp)
movl 0x10(%rax), %eax
movl %eax, -0x2e(%rbp)
leaq -0x40(%rbp), %rdx
movzbl -0x40(%rbp), %eax
subl $0xbf, %eax
movslq %eax, %rcx
leaq -0x60(%rbp), %rdi
movl $0x20, %esi
callq 0x127d0
movq -0x54(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x4c(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x70(%rbp)
leaq -0x80(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl 0x10(%rax), %eax
movl %eax, 0x10(%rsp)
callq 0x8ac0
movq %rax, -0x68(%rbp)
movq 0x2056f73(%rip), %rcx   # 0x2060a70
movq -0x68(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x68(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)