// File: /workspace/github_c_makefile_star2_O2/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 $0x68, %rsp
movq %r9, %r12
movq %rdx, 0x38(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdi, 0x30(%rsp)
leaq 0xa0(%rsp), %rdx
leaq 0x58(%rsp), %rbx
movq %rcx, 0x40(%rsp)
movq %rcx, (%rbx)
movq %r8, 0x48(%rsp)
movq %r8, 0x8(%rbx)
movl 0x10(%rdx), %eax
movl %eax, 0x10(%rsp)
movaps (%rdx), %xmm0
movups %xmm0, (%rsp)
callq 0x6a99
movq %rax, %r13
movq 0x204fa28(%rip), %rax   # 0x2056a80
movq %rax, 0x38(%r13)
movl 0x204fa46(%rip), %eax   # 0x2056aa8
movl %eax, 0x10(%rsp)
movups 0x204fa2b(%rip), %xmm0  # 0x2056a98
movups %xmm0, (%rsp)
callq 0x6a99
movq 0x204fa03(%rip), %rcx   # 0x2056a80
movq %rcx, 0x38(%rax)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x71de
movq %rax, %rbp
addq $0x5208, %rbp           # imm = 0x5208
testq %r12, %r12
je 0x70fd
addq $0x960, %rbp            # imm = 0x960
movl 0x10(%r12), %eax
movl %eax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x6a99
movq %rax, %rbx
movq 0x204f9be(%rip), %rax   # 0x2056a80
movq %rax, 0x38(%rbx)
leaq 0x18(%r12), %r14
movq (%r14), %r14
testq %r14, %r14
je 0x70f6
addq $0x76c, %rbp            # imm = 0x76C
movq 0x204f99f(%rip), %r15   # 0x2056a80
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6d42
movq %r15, 0x60(%rax)
addq $0x20, %r14
jmp 0x70cb
movq 0x20(%r12), %r12
jmp 0x7095
movq 0x50(%rsp), %rdx
movq %rdx, %rbx
subq %rbp, %rbx
jb 0x71a3
leaq 0xb8(%rsp), %r14
movl 0x10(%r14), %eax
movl %eax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
callq 0x6a99
movq 0x204f94e(%rip), %rcx   # 0x2056a80
movq %rcx, 0x38(%rax)
movl 0x10(%r14), %eax
movl %eax, 0x28(%rsp)
movups (%r14), %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xa0(%rsp), %rcx
movl 0x10(%rcx), %eax
movl %eax, 0x10(%rsp)
movups (%rcx), %xmm0
movups %xmm0, (%rsp)
movq 0x30(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x38(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x48(%rsp), %r8
callq 0x7214
movq 0x204f8fd(%rip), %rax   # 0x2056a80
incq 0x30(%r13)
incq %rax
movq %rax, 0x204f8ef(%rip)   # 0x2056a80
movq %r14, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xee4e(%rip), %rax      # 0x15ff8
movq (%rax), %rdi
leaq 0x8833(%rip), %rsi      # 0xf9e7
movq %rbp, %rcx
xorl %eax, %eax
callq 0x31d0
movq 0x30(%rsp), %r14
andq $0x0, 0x30(%r14)
leaq 0x10(%r14), %rdi
callq 0x9f49
andq $0x0, (%r14)
movq 0x204f8a4(%rip), %rax   # 0x2056a80
jmp 0x7187