Ë
    øÇ:j¦+  ã                   óf  — d dl mZmZmZmZmZmZmZ d dlm	Z	 d dl
mZ d dlmZmZ d dlmZmZ d dlmZ dd„Zdd	„Z G d
„ de	j,                  «      Z G d„ de	j,                  «      Z G d„ de«      Z G d„ de«      Z G d„ de«      Ze	j8                  e ee«      ge	j:                  j<                  _        e	j@                  e	j:                  j<                  _!        e	j8                  ee ee«      ge	j:                  jD                  _        e	j@                  e	j:                  jD                  _!        e	j@                  ge	j:                  jF                  _        e	j@                   ee«      ge	j:                  jH                  _        e	j@                   ee«       ee«      ge	j:                  jJ                  _        e	j@                  ege	j:                  jL                  _        e	jN                  e	j:                  jL                  _!        e	j@                   ee«      ge	j:                  jP                  _        ee	j:                  jP                  _!        e	j@                   ee«      ge	j:                  jR                  _        e	j@                  ege	j:                  jT                  _        e	j@                   ee«      ge	j:                  jV                  _        e	j@                  ege	j:                  jX                  _        e	j@                  ege	j:                  jZ                  _        e	jN                  e	j:                  jZ                  _!        e	j@                  ege	j:                  j\                  _        e	j^                  e	j:                  j\                  _!        e	j@                  ge	j:                  j`                  _        e	jb                  e	j:                  j`                  _!        e	jb                  ge	j:                  jd                  _        e	jb                  ge	j:                  jf                  _        e	jN                  e	j:                  jf                  _!        e	j@                  ge	j:                  jh                  _        e	jj                  e	j:                  jh                  _!        e	j@                  ge	j:                  jl                  _        e	jn                  e	j:                  jl                  _!        e	jj                  ge	j:                  jp                  _        e	jn                  ge	j:                  jr                  _        e	jj                  ge	j:                  jt                  _        e	jN                  e	j:                  jt                  _!        e	jn                  ge	j:                  jv                  _        e	j^                  e	j:                  jv                  _!        e	j@                  ge	j:                  jx                  _        e	j@                  e	j:                  jx                  _!        e	j@                  ge	j:                  jz                  _        ee	j:                  jz                  _!        e	j@                  ege	j:                  j|                  _        e	j@                  ge	j:                  j~                  _        ee	j:                  j~                  _!        y)é    )Úc_char_pÚbyrefÚPOINTERÚc_boolÚcreate_string_bufferÚc_size_tÚ	string_at)Úffi)Úlink_modules)Ú_decode_stringÚ_encode_string)ÚValueRefÚTypeRef)Úget_global_contextNc                 óN  — |€
t        «       }t        | «      } t        | «      }t        j                  «       5 }t        t        j                  j                  |||«      |«      }|r*|j                  «        t        dj                  |«      «      ‚	 ddd«       |S # 1 sw Y   S xY w)z-
    Create Module from a LLVM IR string
    NzLLVM IR parsing error
{0})r   r   r   r
   ÚOutputStringÚ	ModuleRefÚlibÚLLVMPY_ParseAssemblyÚcloseÚRuntimeErrorÚformat)ÚllvmirÚcontextÚstrbufÚerrmsgÚmods        úl/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/llvmlite/binding/module.pyÚparse_assemblyr      s¡   € ð €Ü$Ó&ˆÜ˜FÓ#€FÜ�fÓ€FÜ	×	Ñ	Ó	ð L˜vÜÜ�G‰G×(Ñ(¨°&¸&ÓAØóˆñ Ø�I‰IŒKÜÐ;×BÑBÀ6ÓJÓKÐKð ÷	Lð €J÷Lð €Jús   ·ABÂB$c           	      óP  — |€
t        «       }t        | «      }t        | «      }t        j                  «       5 }t        t        j                  j                  ||||«      |«      }|r*|j                  «        t        dj                  |«      «      ‚	 ddd«       |S # 1 sw Y   S xY w)z?
    Create Module from a LLVM *bitcode* (a bytes object).
    NzLLVM bitcode parsing error
{0})r   r   Úlenr
   r   r   r   ÚLLVMPY_ParseBitcoder   r   r   )Úbitcoder   ÚbufÚbufsizer   r   s         r   Úparse_bitcoder&      s¨   € ð €Ü$Ó&ˆÜ
�7Ó
€CÜ�'‹l€GÜ	×	Ñ	Ó	ð B˜vÜœŸ™×3Ñ3Ø�S˜' 6ó+Ø,3ó5ˆáØ�I‰IŒKÜØ1×8Ñ8¸Ó@óBð Bð ÷Bð €J÷Bð €Jús   ·ABÂB%c                   ó6  ‡ — e Zd ZdZˆ fd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zed
„ «       Zej                  d„ «       Zed„ «       Zed„ «       Zej                  d„ «       Zed„ «       Zej                  d„ «       Zdd„Zed„ «       Zed„ «       Zed„ «       Zd„ Zˆ xZS )r   z'
    A reference to a LLVM module.
    c                 ó:   •— t         t        | �  |«       || _        y ©N)Úsuperr   Ú__init__Ú_context)ÚselfÚ
module_ptrr   Ú	__class__s      €r   r+   zModuleRef.__init__4   s   ø€ ÜŒi˜Ñ'¨
Ô3Øˆ�ó    c                 ó¬   — t        j                  «       5 }t         j                  j                  | |«       t	        |«      cd d d «       S # 1 sw Y   y xY wr)   )r
   r   r   ÚLLVMPY_PrintModuleToStringÚstr)r-   Úoutstrs     r   Ú__str__zModuleRef.__str__8   s@   € Ü×ÑÓð 	 6Ü�G‰G×.Ñ.¨t°VÔ<Ü�v“;÷	÷ 	ò 	ús   •+A
Á
Ac                 óz  — t        d«      }t        d«      }t        j                  j	                  | t        |«      t        |«      «       |st        ‚	 |j                  dk\  sJ ‚t        ||j                  «      t        j                  j                  |«       S # t        j                  j                  |«       w xY w)zF
        Return the module's LLVM bitcode, as a bytes object.
        Néÿÿÿÿr   )
r   r   r
   r   ÚLLVMPY_WriteBitcodeToStringr   ÚMemoryErrorÚvaluer	   ÚLLVMPY_DisposeString)r-   ÚptrÚsizes      r   Ú
as_bitcodezModuleRef.as_bitcode=   s…   € ô �t‹nˆÜ˜‹|ˆÜ�‰×+Ñ+¨D´%¸³*¼eÀD»kÔJÙÜÐð	.Ø—:‘: ’?Ð"�?Ü˜S $§*¡*Ó-ä�G‰G×(Ñ(¨Õ-øŒC�G‰G×(Ñ(¨Õ-ús   Á&B Â!B:c                 ó:   — | j                   j                  | «       y r)   )Ú_capiÚLLVMPY_DisposeModule©r-   s    r   Ú_disposezModuleRef._disposeL   s   € Ø�
‰
×'Ñ'¨Õ-r0   c                 óœ   — t         j                  j                  | t        |«      «      }|st	        |«      ‚t        |dt        | ¬«      «      S )z~
        Get a ValueRef pointing to the function named *name*.
        NameError is raised if the symbol isn't found.
        Úfunction©Úmodule)r
   r   ÚLLVMPY_GetNamedFunctionr   Ú	NameErrorr   Údict©r-   ÚnameÚps      r   Úget_functionzModuleRef.get_functionO   s@   € ô
 �G‰G×+Ñ+¨D´.ÀÓ2FÓGˆÙÜ˜D“/Ð!Ü˜˜:¤t°4Ô'8Ó9Ð9r0   c                 óœ   — t         j                  j                  | t        |«      «      }|st	        |«      ‚t        |dt        | ¬«      «      S )z…
        Get a ValueRef pointing to the global variable named *name*.
        NameError is raised if the symbol isn't found.
        ÚglobalrF   )r
   r   ÚLLVMPY_GetNamedGlobalVariabler   rI   r   rJ   rK   s      r   Úget_global_variablezModuleRef.get_global_variableY   s@   € ô
 �G‰G×1Ñ1°$¼ÀtÓ8LÓMˆÙÜ˜D“/Ð!Ü˜˜8¤T°Ô%6Ó7Ð7r0   c                 ó„   — t         j                  j                  | t        |«      «      }|st	        |«      ‚t        |«      S )z†
        Get a TypeRef pointing to a structure type named *name*.
        NameError is raised if the struct type isn't found.
        )r
   r   ÚLLVMPY_GetNamedStructTyper   rI   r   rK   s      r   Úget_struct_typezModuleRef.get_struct_typec   s6   € ô
 �G‰G×-Ñ-¨d´NÀ4Ó4HÓIˆÙÜ˜D“/Ð!Ü�q‹zÐr0   c                 óÀ   — t        j                  «       5 }t         j                  j                  | |«      rt	        t        |«      «      ‚	 ddd«       y# 1 sw Y   yxY w)zW
        Verify the module IR's correctness.  RuntimeError is raised on error.
        N)r
   r   r   ÚLLVMPY_VerifyModuler   r3   ©r-   Úoutmsgs     r   ÚverifyzModuleRef.verifym   sO   € ô ×ÑÓð 	0 6Ü�w‰w×*Ñ*¨4°Ô8Ü"¤3 v£;Ó/Ð/ð 9÷	0÷ 	0ñ 	0ús   •5AÁAc                 óR   — t        t        j                  j                  | «      «      S )z*
        The module's identifier.
        )r   r
   r   ÚLLVMPY_GetModuleNamerB   s    r   rL   zModuleRef.nameu   s   € ô
 œcŸg™g×:Ñ:¸4Ó@ÓAÐAr0   c                 óV   — t         j                  j                  | t        |«      «       y r)   )r
   r   ÚLLVMPY_SetModuleNamer   )r-   r:   s     r   rL   zModuleRef.name|   s   € ä�‰×$Ñ$ T¬>¸%Ó+@ÕAr0   c                 óR   — t        t        j                  j                  | «      «      S )z8
        The module's original source file name
        )r   r
   r   ÚLLVMPY_GetModuleSourceFileNamerB   s    r   Úsource_filezModuleRef.source_file€   s   € ô
 œcŸg™g×DÑDÀTÓJÓKÐKr0   c                 ó°   — t        j                  d¬«      5 }t         j                  j                  | |«       t	        |«      cddd«       S # 1 sw Y   yxY w)zG
        This module's data layout specification, as a string.
        F©ÚownedN)r
   r   r   ÚLLVMPY_GetDataLayoutr3   rX   s     r   Údata_layoutzModuleRef.data_layout‡   sD   € ô ×Ñ EÔ*ð 	¨fÜ�G‰G×(Ñ(¨¨vÔ6Ü�v“;÷	÷ 	ò 	úó   —+AÁAc                 ót   — t         j                  j                  | t        |j	                  d«      «      «       y ©NÚutf8)r
   r   ÚLLVMPY_SetDataLayoutr   Úencode©r-   Ústrreps     r   rf   zModuleRef.data_layout‘   s,   € ä�‰×$Ñ$ TÜ%9Ø)/¯©°vÓ)>ó&@õ	Ar0   c                 ó°   — t        j                  d¬«      5 }t         j                  j                  | |«       t	        |«      cddd«       S # 1 sw Y   yxY w)zK
        This module's target "triple" specification, as a string.
        Frc   N)r
   r   r   ÚLLVMPY_GetTargetr3   rX   s     r   ÚtriplezModuleRef.triple—   sD   € ô ×Ñ EÔ*ð 	¨fÜ�G‰G×$Ñ$ T¨6Ô2Ü�v“;÷	÷ 	ò 	úrg   c                 ót   — t         j                  j                  | t        |j	                  d«      «      «       y ri   )r
   r   ÚLLVMPY_SetTargetr   rl   rm   s     r   rq   zModuleRef.triple¡   s*   € ä�‰× Ñ  Ü!5Ø%+§]¡]°6Ó%:ó"<õ	=r0   c                 ó@   — |r|j                  «       }t        | |«       y)z�
        Link the *other* module into this one.  The *other* module will
        be destroyed unless *preserve* is true.
        N)Úcloner   )r-   ÚotherÚpreserves      r   Úlink_inzModuleRef.link_in§   s   € ñ
 Ø—K‘K“MˆEÜ�T˜5Õ!r0   c                 ól   — t         j                  j                  | «      }t        |t	        | ¬«      «      S )a)  
        Return an iterator over this module's global variables.
        The iterator will yield a ValueRef for each global variable.

        Note that global variables don't include functions
        (a function is a "global value" but not a "global variable" in
         LLVM parlance)
        rF   )r
   r   ÚLLVMPY_ModuleGlobalsIterÚ_GlobalsIteratorrJ   ©r-   Úits     r   Úglobal_variableszModuleRef.global_variables°   s*   € ô �W‰W×-Ñ-¨dÓ3ˆÜ ¤D°Ô$5Ó6Ð6r0   c                 ól   — t         j                  j                  | «      }t        |t	        | ¬«      «      S )z€
        Return an iterator over this module's functions.
        The iterator will yield a ValueRef for each function.
        rF   )r
   r   ÚLLVMPY_ModuleFunctionsIterÚ_FunctionsIteratorrJ   r|   s     r   Ú	functionszModuleRef.functions½   s*   € ô �W‰W×/Ñ/°Ó5ˆÜ! "¤d°$Ô&7Ó8Ð8r0   c                 ól   — t         j                  j                  | «      }t        |t	        | ¬«      «      S )z|
        Return an iterator over the struct types defined in
        the module. The iterator will yield a TypeRef.
        rF   )r
   r   ÚLLVMPY_ModuleTypesIterÚ_TypesIteratorrJ   r|   s     r   Ústruct_typeszModuleRef.struct_typesÆ   s*   € ô �W‰W×+Ñ+¨DÓ1ˆÜ˜b¤$¨dÔ"3Ó4Ð4r0   c                 óh   — t        t        j                  j                  | «      | j                  «      S r)   )r   r
   r   ÚLLVMPY_CloneModuler,   rB   s    r   ru   zModuleRef.cloneÏ   s"   € ÜœŸ™×3Ñ3°DÓ9¸4¿=¹=ÓIÐIr0   )F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r+   r5   r>   rC   rN   rR   rU   rZ   ÚpropertyrL   Úsetterra   rf   rq   rx   r~   r‚   r†   ru   Ú__classcell__)r/   s   @r   r   r   /   s  ø„ ñô òò
.ò.ò:ò8òò0ð ñBó ðBð 
‡[�[ñBó ðBð ñLó ðLð ñó ðð ×ÑñAó ðAð
 ñó ðð ‡]�]ñ=ó ð=ó
"ð ñ
7ó ð
7ð ñ9ó ð9ð ñ5ó ð5öJr0   r   c                   ó&   — e Zd ZdZd„ Zd„ ZeZd„ Zy)Ú	_IteratorNc                 ón   — t         j                  j                  | |«       || _        | j                  €J ‚y r)   )r
   Ú	ObjectRefr+   Ú_parentsÚkind)r-   r<   Úparentss      r   r+   z_Iterator.__init__×   s-   € Ü�‰×Ñ˜t SÔ)ØˆŒØ�y‰yÐ$Ð$Ñ$r0   c                 ót   — | j                  «       }|r!t        || j                  | j                  «      S t        ‚r)   )Ú_nextr   r•   r”   ÚStopIteration©r-   Úvps     r   Ú__next__z_Iterator.__next__Ü   s-   € Ø�Z‰Z‹\ˆÙÜ˜B §	¡	¨4¯=©=Ó9Ð9äÐr0   c                 ó   — | S r)   © rB   s    r   Ú__iter__z_Iterator.__iter__å   s   € Øˆr0   )r‰   rŠ   r‹   r•   r+   rœ   ÚnextrŸ   rž   r0   r   r‘   r‘   Ó   s   „ à€Dò%ò
 ð €Dór0   r‘   c                   ó   — e Zd ZdZd„ Zd„ Zy)r{   rP   c                 ó:   — | j                   j                  | «       y r)   )r@   ÚLLVMPY_DisposeGlobalsIterrB   s    r   rC   z_GlobalsIterator._disposeí   s   € Ø�
‰
×,Ñ,¨TÕ2r0   c                 ó@   — t         j                  j                  | «      S r)   )r
   r   ÚLLVMPY_GlobalsIterNextrB   s    r   r˜   z_GlobalsIterator._nextð   s   € Ü�w‰w×-Ñ-¨dÓ3Ð3r0   N©r‰   rŠ   r‹   r•   rC   r˜   rž   r0   r   r{   r{   é   s   „ à€Dò3ó4r0   r{   c                   ó   — e Zd ZdZd„ Zd„ Zy)r�   rE   c                 ó:   — | j                   j                  | «       y r)   )r@   ÚLLVMPY_DisposeFunctionsIterrB   s    r   rC   z_FunctionsIterator._disposeø   s   € Ø�
‰
×.Ñ.¨tÕ4r0   c                 ó@   — t         j                  j                  | «      S r)   )r
   r   ÚLLVMPY_FunctionsIterNextrB   s    r   r˜   z_FunctionsIterator._nextû   s   € Ü�w‰w×/Ñ/°Ó5Ð5r0   Nr¦   rž   r0   r   r�   r�   ô   s   „ à€Dò5ó6r0   r�   c                   ó&   — e Zd ZdZd„ Zd„ Zd„ ZeZy)r…   Útypec                 ó:   — | j                   j                  | «       y r)   )r@   ÚLLVMPY_DisposeTypesIterrB   s    r   rC   z_TypesIterator._dispose  s   € Ø�
‰
×*Ñ*¨4Õ0r0   c                 óH   — | j                  «       }|rt        |«      S t        ‚r)   )r˜   r   r™   rš   s     r   rœ   z_TypesIterator.__next__  s    € Ø�Z‰Z‹\ˆÙÜ˜2“;ÐäÐr0   c                 ó@   — t         j                  j                  | «      S r)   )r
   r   ÚLLVMPY_TypesIterNextrB   s    r   r˜   z_TypesIterator._next  s   € Ü�w‰w×+Ñ+¨DÓ1Ð1r0   N)r‰   rŠ   r‹   r•   rC   rœ   r˜   r    rž   r0   r   r…   r…   ÿ   s   „ à€Dò1ò ò2ð �Dr0   r…   r)   )@Úctypesr   r   r   r   r   r   r	   Úllvmlite.bindingr
   Úllvmlite.binding.linkerr   Úllvmlite.binding.commonr   r   Úllvmlite.binding.valuer   r   Úllvmlite.binding.contextr   r   r&   r“   r   r‘   r{   r�   r…   ÚLLVMContextRefr   r   ÚargtypesÚLLVMModuleRefÚrestyper"   rA   r2   r8   rH   ÚLLVMValueRefrW   re   rk   rp   rs   rQ   rT   ÚLLVMTypeRefrz   ÚLLVMGlobalsIteratorr£   r¥   r€   ÚLLVMFunctionsIteratorr„   ÚLLVMTypesIteratorr©   r¯   r«   r²   rˆ   r\   r^   r`   rž   r0   r   ú<module>rÂ      sñ  ð÷)÷ )ñ )õ !Ý 0ß Bß 4Ý 7óó$ô$aJ�—‘ô aJôH�—‘ô ô,4�yô 4ô6˜ô 6ô�Yô ð. *-×);Ñ);Ø)1Ù)0°Ó):ð)<€‡�× Ñ Ô %ð (+×'8Ñ'8€‡�× Ñ Ô $à(+×(:Ñ(:Ø(0°(Ù(/°Ó(9ð(;€‡�× Ñ Ô $ð '*×&7Ñ&7€‡�× Ñ Ô #à),×):Ñ):Ð(;€‡�× Ñ Ô %à/2×/@Ñ/@Ù/6°xÓ/@ð/B€‡�× "Ñ "Ô +à03×0AÑ0AÙ07¸Ó0AÙ07¸Ó0Að0C€‡�× #Ñ #Ô ,ð -0×,=Ñ,=Ø,4ð,6€‡�× Ñ Ô (à*-×*:Ñ*:€‡�× Ñ Ô 'à(+×(9Ñ(9Ù(/°Ó(9ð(;€‡�× Ñ Ô $à&,€‡�× Ñ Ô #à),×):Ñ):¹GÀHÓ<MÐ(N€‡�× Ñ Ô %Ø),×):Ñ):¸HÐ(E€‡�× Ñ Ô %à%(×%6Ñ%6¹ÀÓ8IÐ$J€‡�× Ñ Ô !Ø%(×%6Ñ%6¸Ð$A€‡�× Ñ Ô !à25×2CÑ2CÀXÐ1N€‡�× %Ñ %Ô .Ø03×0@Ñ0@€‡�× %Ñ %Ô -à.1×.?Ñ.?ÀÐ-J€‡�× !Ñ !Ô *Ø,/¯O©O€‡�× !Ñ !Ô )à-0×->Ñ->Ð,?€‡�×  Ñ  Ô )Ø+.×+BÑ+B€‡�×  Ñ  Ô (à.1×.EÑ.EÐ-F€‡�× !Ñ !Ô *à+.×+BÑ+BÐ*C€‡�× Ñ Ô 'Ø),×)9Ñ)9€‡�× Ñ Ô &à/2×/@Ñ/@Ð.A€‡�× "Ñ "Ô +Ø-0×-FÑ-F€‡�× "Ñ "Ô *à+.×+<Ñ+<Ð*=€‡�× Ñ Ô 'Ø),×)>Ñ)>€‡�× Ñ Ô &à03×0IÑ0IÐ/J€‡�× #Ñ #Ô ,à,/×,AÑ,AÐ+B€‡�× Ñ Ô (à-0×-FÑ-FÐ,G€‡�×  Ñ  Ô )Ø+.×+;Ñ+;€‡�×  Ñ  Ô (à),×)>Ñ)>Ð(?€‡�× Ñ Ô %Ø'*§¡€‡�× Ñ Ô $à'*×'8Ñ'8Ð&9€‡�× Ñ Ô #Ø%(×%6Ñ%6€‡�× Ñ Ô "à),×):Ñ):Ð(;€‡�× Ñ Ô %Ø'/€‡�× Ñ Ô $à),×):Ñ):¸HÐ(E€‡�× Ñ Ô %à36×3DÑ3DÐ2E€‡�× &Ñ &Ô /Ø19€‡�× &Ñ &Õ .r0   