#NEWLINE# @ lower_builtin ( '/?' , types . Integer , types . Integer ) #NEWLINE# @ lower_builtin ( '//' , types . Integer , types . Integer ) #NEWLINE# def int_floordiv_impl( context , builder , sig , args ) : #NEWLINE# #INDENT# [ va , vb ] = args #NEWLINE# [ ta , tb ] = sig . args #NEWLINE# a = context . cast ( builder , va , ta , sig . return_type ) #NEWLINE# b = context . cast ( builder , vb , tb , sig . return_type ) #NEWLINE# res = cgutils . alloca_once ( builder , a . type ) #NEWLINE# with builder . if_else ( cgutils . is_scalar_zero ( builder , b ) , likely = False ) as ( if_zero , if_non_zero ) : #NEWLINE# #INDENT# with if_zero : #NEWLINE# #INDENT# if ( not context . error_model . fp_zero_division ( builder , ( 'integer division by zero' , ) ) ) : #NEWLINE# #INDENT# builder . store ( b , res ) #NEWLINE# #UNINDENT# #UNINDENT# with if_non_zero : #NEWLINE# #INDENT# if sig . return_type . signed : #NEWLINE# #INDENT# ( quot , _ ) = int_divmod ( context , builder , a , b ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# quot = builder . udiv ( a , b ) #NEWLINE# #UNINDENT# builder . store ( quot , res ) #NEWLINE# #UNINDENT# #UNINDENT# return impl_ret_untracked ( context , builder , sig . return_type , builder . load ( res ) )