// File: /workspace/github_c_makefile_star2_O3/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, %r12
movq %r8, %r14
movq %rcx, %r15
movq %rdx, 0x40(%rsp)
movq %rsi, 0x50(%rsp)
movq %rdi, %rbx
movl 0xa0(%rsp), %eax
movl %eax, 0x10(%rsp)
movaps 0x90(%rsp), %xmm0
movups %xmm0, (%rsp)
callq 0x82de
movq 0x2050273(%rip), %rcx   # 0x2058a80
movq %rax, 0x38(%rsp)
movq %rcx, 0x38(%rax)
movl 0x205028c(%rip), %eax   # 0x2058aa8
movl %eax, 0x10(%rsp)
movups 0x2050271(%rip), %xmm0  # 0x2058a98
movups %xmm0, (%rsp)
callq 0x82de
movq 0x2050249(%rip), %rcx   # 0x2058a80
movq %rcx, 0x38(%rax)
testq %r15, %r15
je 0x886b
leaq (,%r15,4), %rbp
xorl %eax, %eax
movq %rbp, %rcx
addq $0xc, %rbp
cmpb $0x0, (%r14,%rax)
cmoveq %rcx, %rbp
incq %rax
cmpq %rax, %r15
jne 0x884a
addq $0x5208, %rbp           # imm = 0x5208
jmp 0x8870
movl $0x5208, %ebp           # imm = 0x5208
movq %r14, 0x48(%rsp)
movq %rbx, 0x30(%rsp)
testq %r12, %r12
je 0x88df
addq $0x960, %rbp            # imm = 0x960
movl 0x10(%r12), %eax
movl %eax, 0x10(%rsp)
movups (%r12), %xmm0
movups %xmm0, (%rsp)
callq 0x82de
movq %rax, %rbx
movq 0x20501d9(%rip), %rax   # 0x2058a80
movq %rax, 0x38(%rbx)
movq 0x18(%r12), %r13
testq %r13, %r13
je 0x88d8
addq $0x76c, %rbp            # imm = 0x76C
movq 0x20501bd(%rip), %r14   # 0x2058a80
movq %rbx, %rdi
movq %r13, %rsi
callq 0x84bb
movq %r14, 0x60(%rax)
movq 0x20(%r13), %r13
jmp 0x88b0
movq 0x20(%r12), %r12
jmp 0x887a
movq 0x50(%rsp), %rdx
movq %rdx, %r12
subq %rbp, %r12
jb 0x8986
leaq 0xa8(%rsp), %rbx
leaq 0x90(%rsp), %r14
movl 0x10(%rbx), %eax
movl %eax, 0x10(%rsp)
movups (%rbx), %xmm0
movups %xmm0, (%rsp)
callq 0x82de
movq 0x2050166(%rip), %rcx   # 0x2058a80
movq %rcx, 0x38(%rax)
movl 0x10(%rbx), %eax
movl %eax, 0x28(%rsp)
movups (%rbx), %xmm0
movups %xmm0, 0x18(%rsp)
movl 0x10(%r14), %eax
movl %eax, 0x10(%rsp)
movups (%r14), %xmm0
movups %xmm0, (%rsp)
movq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movq 0x40(%rsp), %rdx
movq %r15, %rcx
movq 0x48(%rsp), %r8
callq 0x89c1
movq 0x205011f(%rip), %rax   # 0x2058a80
movq 0x38(%rsp), %rcx
incq 0x30(%rcx)
incq %rax
movq %rax, 0x205010c(%rip)   # 0x2058a80
movq %r14, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xf66b(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
leaq 0xa050(%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 0xc6ae
movq %rbx, (%r14)
movq 0x20500c1(%rip), %rax   # 0x2058a80
jmp 0x896a