// File: /workspace/github_c_makefile_star2_O1/wjmelements[P]evm/src/evm.c
// Function: txCall
result_t txCall(address_t from, uint64_t gas, address_t to, val_t value, data_t input, const accessList_t *accessList) {
    account_t *fromAccount = getAccount(from);
    fromAccount->warm = evmIteration;
    account_t *coinbaseAccount = getAccount(coinbase);
    coinbaseAccount->warm = evmIteration;
    uint64_t intrinsicGas = G_TX + calldataGas(&input, false);
    while (accessList) {
        intrinsicGas += G_ACCESSLIST_ACCOUNT;
        account_t *account = getAccount(accessList->address);
        account->warm = evmIteration;
        accessListStorage_t *accessListStorage = accessList->storage;
        while (accessListStorage) {
            intrinsicGas += G_ACCESSLIST_STORAGE;
            getAccountStorage(account, &accessListStorage->key)->warm = evmIteration;
            accessListStorage = accessListStorage->prev;
        }
        accessList = accessList->prev;
    }
    if (gas < intrinsicGas) {
        fprintf(stderr, "Insufficient intrinsic gas %" PRIu64 " (need %" PRIu64 ")\n", gas, intrinsicGas);
        result_t result;
        result.gasRemaining = 0;
        clear256(&result.status);
        result.returnData.size = 0;
        evmIteration++;
        return result;
    }
    gas -= intrinsicGas;
    account_t *toAccount = getAccount(to);
    toAccount->warm = evmIteration;
    result_t result = evmCall(from, gas, to, value, input);
    evmIteration++;
    fromAccount->nonce++;
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, %r13
movq %r8, %r14
movq %rcx, %r12
movq %rdx, 0x38(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdi, %rbx
movl 0xa0(%rsp), %eax
movl %eax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x82ed
movq 0x20510a9(%rip), %rcx   # 0x2059a80
movq %rax, 0x40(%rsp)
movq %rcx, 0x38(%rax)
movl 0x20510c2(%rip), %eax   # 0x2059aa8
movl %eax, 0x10(%rsp)
movups 0x20510a7(%rip), %xmm0  # 0x2059a98
movups %xmm0, (%rsp)
callq 0x82ed
movq 0x205107f(%rip), %rcx   # 0x2059a80
movq %rcx, 0x38(%rax)
leaq (,%r12,4), %rbp
testq %r12, %r12
je 0x8a29
xorl %eax, %eax
leaq 0xc(%rbp), %rcx
cmpb $0x0, (%r14,%rax)
cmovneq %rcx, %rbp
incq %rax
cmpq %rax, %r12
jne 0x8a14
movq %r14, 0x48(%rsp)
movq %rbx, 0x30(%rsp)
addq $0x5208, %rbp           # imm = 0x5208
testq %r13, %r13
je 0x8a9c
addq $0x960, %rbp            # imm = 0x960
movl 0x10(%r13), %eax
movl %eax, 0x10(%rsp)
movups (%r13), %xmm0
movups %xmm0, (%rsp)
callq 0x82ed
movq %rax, %rbx
movq 0x205101a(%rip), %rax   # 0x2059a80
movq %rax, 0x38(%rbx)
movq 0x18(%r13), %r15
testq %r15, %r15
je 0x8a96
addq $0x76c, %rbp            # imm = 0x76C
movq 0x2050fff(%rip), %r14   # 0x2059a80
movq %rbx, %rdi
movq %r15, %rsi
callq 0x867f
movq %r14, 0x60(%rax)
movq 0x20(%r15), %r15
jmp 0x8a6e
movq 0x20(%r13), %r13
jmp 0x8a3a
movq 0x50(%rsp), %rdx
movq %rdx, %rbx
subq %rbp, %rbx
jb 0x8b40
leaq 0xa8(%rsp), %r14
leaq 0x90(%rsp), %r15
movl 0x10(%r14), %eax
movl %eax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x82ed
movq 0x2050fa7(%rip), %rcx   # 0x2059a80
movq %rcx, 0x38(%rax)
movl 0x10(%r14), %eax
movl %eax, 0x28(%rsp)
movups (%r14), %xmm0
movups %xmm0, 0x18(%rsp)
movl 0x10(%r15), %eax
movl %eax, 0x10(%rsp)
movups (%r15), %xmm0
movups %xmm0, (%rsp)
movq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x38(%rsp), %rdx
movq %r12, %rcx
movq 0x48(%rsp), %r8
callq 0x8b7b
incq 0x2050f5e(%rip)         # 0x2059a80
movq 0x40(%rsp), %rax
addq $0x30, %rax
incq (%rax)
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x104b1(%rip), %rax     # 0x18ff8
movq (%rax), %rdi
leaq 0x9e96(%rip), %rsi      # 0x129e7
xorl %ebx, %ebx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x31d0
movq 0x30(%rsp), %r14
movq %rbx, 0x30(%r14)
leaq 0x10(%r14), %rdi
callq 0xca1a
movq %rbx, (%r14)
leaq 0x2050f07(%rip), %rax   # 0x2059a80
jmp 0x8b2b