// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x90(%rbp)
movq %rdi, -0x88(%rbp)
leaq 0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movq %rcx, -0x10(%rbp)
movq %r8, -0x8(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %r9, -0x28(%rbp)
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, -0x30(%rbp)
movq 0x20576bc(%rip), %rcx   # 0x2060a70
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq 0x20576bf(%rip), %rax   # 0x2060a82
movq %rax, -0x50(%rbp)
movq 0x20576bc(%rip), %rax   # 0x2060a8a
movq %rax, -0x48(%rbp)
movl 0x20576ba(%rip), %eax   # 0x2060a92
movl %eax, -0x40(%rbp)
leaq -0x50(%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, -0x38(%rbp)
movq 0x205766a(%rip), %rcx   # 0x2060a70
movq -0x38(%rbp), %rax
movq %rcx, 0x38(%rax)
leaq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9610
addq $0x5208, %rax           # imm = 0x5208
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x94d5
movq -0x58(%rbp), %rax
addq $0x960, %rax            # imm = 0x960
movq %rax, -0x58(%rbp)
movq -0x28(%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, -0x60(%rbp)
movq 0x2057609(%rip), %rcx   # 0x2060a70
movq -0x60(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x94c4
movq -0x58(%rbp), %rax
addq $0x76c, %rax            # imm = 0x76C
movq %rax, -0x58(%rbp)
movq 0x20575d9(%rip), %rax   # 0x2060a70
movq %rax, -0x98(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x8ef0
movq -0x98(%rbp), %rcx
movq %rcx, 0x60(%rax)
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x947b
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x9423
movq -0x18(%rbp), %rax
cmpq -0x58(%rbp), %rax
jae 0x953c
movq 0x16b12(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
movq -0x58(%rbp), %rcx
leaq 0x115ff(%rip), %rsi     # 0x1aaf7
movb $0x0, %al
callq 0x31e0
movq -0x90(%rbp), %rdi
movq $0x0, 0x30(%rdi)
addq $0x10, %rdi
callq 0xf8d0
movq -0x90(%rbp), %rax
movq $0x0, (%rax)
movq 0x2057544(%rip), %rax   # 0x2060a70
addq $0x1, %rax
movq %rax, 0x2057539(%rip)   # 0x2060a70
jmp 0x95f8
movq -0x80(%rbp), %rax
movq -0x58(%rbp), %rdx
movq -0x18(%rbp), %rcx
subq %rdx, %rcx
movq %rcx, -0x18(%rbp)
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 -0x90(%rbp), %rdi
movq -0x78(%rbp), %r9
movq %rax, %rcx
movq -0x80(%rbp), %rax
movq %rcx, -0x70(%rbp)
movq 0x20574e8(%rip), %rdx   # 0x2060a70
movq -0x70(%rbp), %rcx
movq %rdx, 0x38(%rcx)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %r8
movq (%r9), %r10
movq %r10, (%rsp)
movq 0x8(%r9), %r10
movq %r10, 0x8(%rsp)
movl 0x10(%r9), %r9d
movl %r9d, 0x10(%rsp)
movq (%rax), %r9
movq %r9, 0x18(%rsp)
movq 0x8(%rax), %r9
movq %r9, 0x20(%rsp)
movl 0x10(%rax), %eax
movl %eax, 0x28(%rsp)
callq 0x96b0
movq 0x2057493(%rip), %rax   # 0x2060a70
addq $0x1, %rax
movq %rax, 0x2057488(%rip)   # 0x2060a70
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rax)
movq -0x88(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopl (%rax,%rax)