"""
Auto-generated Python stub file from lib.core.Handles.HandlesExprCall.py
Module: lib.core.Handles.HandlesExprCall
"""


import t, c
from stdint import *
import ast
import llvmlite
import memhub
import string
import stdio
import stdlib
import sys
import viperlib
import lib.core.Handles.HandlesBase as HandlesBase
import lib.core.Handles.HandlesTranslator as HT
import lib.core.Handles.HandlesExpr as HandlesExpr
import lib.core.Handles.HandlesVar as HandlesVar
import lib.core.Handles.HandlesType as HandlesType
import lib.core.Handles.HandlesStruct as HandlesStruct
import lib.core.Handles.HandlesImports as HandlesImports
import lib.core.Handles.HandlesClassDef as HandlesClassDef

_g_sha1_arr: t.CExtern | bytes
_g_mod_arr: t.CExtern | bytes
_g_sha1_count: t.CExtern | int

def set_module_sha1_map(sha1_arr: bytes, mod_arr: bytes, count: int) -> int: pass

def _lookup_module_sha1(mod_name: str) -> str: pass

def _lookup_module_sha1_suffix(mod_suffix: str) -> str: pass


_g_cexport_sha1_arr: t.CExtern | bytes
_g_cexport_func_arr: t.CExtern | bytes
_g_cexport_count: t.CExtern | int
_CEXPORT_MAX: t.CDefine = 256

def register_cexport_func(sha1: str, func_name: str) -> int: pass

def is_cexport_func(sha1: str, func_name: str) -> int: pass

def _lookup_mod_sha1(pool: memhub.MemBuddy | t.CPtr, from_imports: str, class_name: str, allow_star_fallback: int) -> str: pass

def find_func_in_module(mod: llvmlite.LLVMModule | t.CPtr, name: str) -> llvmlite.Function | t.CPtr: pass

def _infer_external_func_ret_ty(pool: memhub.MemBuddy | t.CPtr, func_name: str) -> llvmlite.LLVMType | t.CPtr: pass

def _get_external_func_param_ty(pool: memhub.MemBuddy | t.CPtr, func_name: str, param_idx: int) -> llvmlite.LLVMType | t.CPtr: pass

def _emit_llvm_memcpy_intrinsic(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, dst_val: llvmlite.Value | t.CPtr, src_val: llvmlite.Value | t.CPtr, num_val: llvmlite.Value | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def translate_c_deref(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def translate_c_derefas(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def translate_c_addr(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def translate_c_load(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass


ASM_MAX_OPERANDS: t.CDefine = 16
ASM_TEXT_BUF_SIZE: t.CDefine = 2048
ASM_CONST_BUF_SIZE: t.CDefine = 512
ASM_ARGS_BUF_SIZE: t.CDefine = 512
ASM_LINE_BUF_SIZE: t.CDefine = 4096

@t.NoVTable
class AsmOperand:
    Value: llvmlite.Value | t.CPtr
    Constraint: str
    IsOutput: int

def _asm_append_cstr(dst: t.CChar | t.CPtr, dst_size: t.CSizeT, src: t.CChar | t.CPtr) -> t.CInt: pass

def _asm_escape_for_ir(pool: memhub.MemBuddy | t.CPtr, src: t.CChar | t.CPtr) -> t.CChar | t.CPtr: pass

def _resolve_register(attr_name: str) -> str: pass

def _resolve_asm_descr(pool: memhub.MemBuddy | t.CPtr, node: ast.AST | t.CPtr) -> str: pass

def _asm_get_operand(base: AsmOperand | t.CPtr, idx: int) -> AsmOperand | t.CPtr: pass

def _asm_is_c_call(node: ast.Call | t.CPtr) -> str: pass

def _asm_add_operand(operands: AsmOperand | t.CPtr, count: int, val: llvmlite.Value | t.CPtr, constraint: str, is_output: int) -> int: pass

def translate_c_asm(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass


LLVMIR_MAX_OPS: t.CDefine = 16
LLVMIR_TEMPLATE_BUF: t.CDefine = 512

def _llvmir_get_op(buf: AsmOperand | t.CPtr, i: int) -> AsmOperand | t.CPtr: pass

def _llvmir_find_op_marker(s: t.CChar | t.CPtr) -> t.CPtr: pass

def _llvmir_parse_op_num(marker: t.CChar | t.CPtr) -> int: pass

def _llvmir_match_icmp_pred(pred: str) -> int: pass

def _llvmir_match_fcmp_pred(pred: str) -> int: pass

def _llvmir_extract_two_ops(template: t.CChar | t.CPtr, out_nums: int | t.CPtr) -> int: pass

def _llvmir_resolve_op(op_num: int, all_kinds: int | t.CPtr, all_indices: int | t.CPtr, input_ops: AsmOperand | t.CPtr, output_targets: AsmOperand | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _llvmir_store_outputs(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, result: llvmlite.Value | t.CPtr, output_targets: AsmOperand | t.CPtr, output_count: int) -> llvmlite.Value | t.CPtr: pass

def translate_c_llvmir(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _apply_struct_defaults(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, struct_ty: llvmlite.LLVMType | t.CPtr, class_name: str, tmp: llvmlite.Value | t.CPtr, trans: HT.Translator | t.CPtr) -> t.CInt: pass

def _translate_struct_ctor(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, struct_ty: llvmlite.LLVMType | t.CPtr, class_name: str, cargs: list[ast.AST | t.CPtr] | t.CPtr, can: t.CSizeT, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _do_virtual_call(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, class_name: str, method_name: str, self_ptr: llvmlite.Value | t.CPtr, args_head: llvmlite.Value | t.CPtr, args_count: int, found_func: llvmlite.Function | t.CPtr, ret_ty: llvmlite.LLVMType | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _call_method_on_ptr(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, class_name: str, method_name: str, self_ptr: llvmlite.Value | t.CPtr, extra_args: t.CSizeT | t.CPtr, extra_count: int, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _infer_method_ret_ty(pool: memhub.MemBuddy | t.CPtr, method_name: str) -> llvmlite.LLVMType | t.CPtr: pass

def _translate_method_call(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, class_name: str, method_name: str, obj_ptr: llvmlite.Value | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _kwarg_name_matches(kw_arg: str, param_name: t.CChar | t.CPtr) -> int: pass

def _translate_struct_ctor_kw(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, struct_ty: llvmlite.LLVMType | t.CPtr, class_name: str, cargs: list[ast.AST | t.CPtr] | t.CPtr, can: t.CSizeT, keywords: list[ast.AST | t.CPtr] | t.CPtr, kw_count: t.CSizeT, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _translate_call_with_kwargs(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, func_name: str, found_func: llvmlite.Function | t.CPtr, cargs: list[ast.AST | t.CPtr] | t.CPtr, can: t.CSizeT, keywords: list[ast.AST | t.CPtr] | t.CPtr, kw_count: t.CSizeT, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _translate_t_type_cast(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, val: llvmlite.Value | t.CPtr, target_ty: llvmlite.LLVMType | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def _extract_type_args_from_slice(pool: memhub.MemBuddy | t.CPtr, slice_node: ast.AST | t.CPtr) -> list[str] | t.CPtr: pass

def translate_call(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, node: ast.AST | t.CPtr, funcs_ptr: t.CPtr, func_count: int, trans: HT.Translator | t.CPtr) -> llvmlite.Value | t.CPtr: pass

def translate_closure_call(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, closure_alloca: llvmlite.Value | t.CPtr, cargs: list[ast.AST | t.CPtr] | t.CPtr, can: t.CSizeT) -> llvmlite.Value | t.CPtr: pass

def translate_printf_call(pool: memhub.MemBuddy | t.CPtr, builder: llvmlite.IRBuilder | t.CPtr, mod: llvmlite.LLVMModule | t.CPtr, cl: ast.Call | t.CPtr, trans: HT.Translator | t.CPtr) -> t.CInt: pass


@t.NoVTable
class FuncEntry:
    Name: str
    Func: llvmlite.Function | t.CPtr

def init_func_table(pool: memhub.MemBuddy | t.CPtr, max_count: int) -> FuncEntry | t.CPtr: pass

def find_func_in_table(funcs: FuncEntry | t.CPtr, func_count: int, name: str) -> llvmlite.Function | t.CPtr: pass

def add_func_to_table(funcs: FuncEntry | t.CPtr, func_count: int, name: str, func: llvmlite.Function | t.CPtr, max_count: int) -> int: pass


GLOBAL_FUNC_MAX: t.CDefine = 8192
_global_funcs: t.CExtern | FuncEntry | t.CPtr
_global_func_count: t.CExtern | int

def _init_global_func_table() -> int: pass

def _register_global_func(name: str, func: llvmlite.Function | t.CPtr) -> int: pass

def find_func_global(name: str) -> llvmlite.Function | t.CPtr: pass


@t.NoVTable
class ExprCallHandle(HandlesBase.Mixin):
    def __init__(self: ExprCallHandle, trans: HT.Translator | t.CPtr) -> t.CInt: pass
    def HandleCall(self: ExprCallHandle, node: ast.AST | t.CPtr) -> llvmlite.Value | t.CPtr: pass
    def HandlePrintfCall(self: ExprCallHandle, cl: ast.Call | t.CPtr) -> t.CInt: pass

def NewExprCallHandle(pool: memhub.MemBuddy | t.CPtr, trans: HT.Translator | t.CPtr) -> ExprCallHandle | t.CPtr: pass
