
    J/Ph                         d Z ddlmZmZmZ ddlmZ ddlmZ d
dZ	dd	Z
ej         ee          egej        j        _        dS )z$
A collection of analysis utilities
    )POINTERc_char_pc_int)ffi)parse_assemblyTc                 p   | J ddl m} t          | |j                  r;t	          t          | j                            }|                    | j                  } t          j
                    5 }t          j                            | ||           t          |          cddd           S # 1 swxY w Y   dS )a1  Return a string of the control-flow graph of the function in DOT
    format. If the input `func` is not a materialized function, the module
    containing the function is parsed to create an actual LLVM module.
    The `show_inst` flag controls whether the instructions of each block
    are printed.
    Nr   )ir)llvmliter	   
isinstanceFunctionr   strmoduleget_functionnamer   OutputStringlibLLVMPY_WriteCFG)func	show_instr	   moddotstrs        Y/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/llvmlite/binding/analysis.pyget_function_cfgr      s     $$$ +S--..	** 
			 vfi8886{{                 s   .0B++B/2B/NFc                     ddl }|                    |           }|r|                    ||          S 	 t           ddlm} d}|                    |                    |                    S # t          $ r |cY S w xY w)a  
    View the given DOT source.  If view is True, the image is rendered
    and viewed by the default application in the system.  The file path of
    the output is returned.  If view is False, a graphviz.Source object is
    returned.  If view is False and the environment is in a IPython session,
    an IPython image object is returned and can be displayed inline in the
    notebook.

    This function requires the graphviz package.

    Args
    ----
    - graph [str]: a DOT source code
    - filename [str]: optional.  if given and view is True, this specifies
                      the file path for the rendered output to write to.
    - view [bool]: if True, opens the rendered output file.

    r   N)viewsvg)data)	graphvizSourcerender__IPYTHON__IPython.displaydisplaySVGpipe	NameError)graphfilenamer   gvsrcr#   formats          r   view_dot_graphr,      s    ( 
))E

C 6zz(z...	6K .-----F;;CHHV$4$4;555  	 	 	JJJ	s   A, ,A;:A;)T)NF)__doc__ctypesr   r   r   llvmlite.bindingr   llvmlite.binding.moduler   r   r,   LLVMValueRefr   r   argtypes     r   <module>r5      s     , + + + + + + + + +             2 2 2 2 2 2   &#6 #6 #6 #6N %($4ggh6G6G#O       r4   