<s> from llvm . core import * <EOL> module = Module . new ( "<STR_LIT>" ) <EOL> ty_int = Type . int ( <NUM_LIT:32> ) <EOL> func_type = Type . function ( ty_int , ( ty_int , ty_int ) ) <EOL> gcd = Function . new ( module , func_type , "<STR_LIT>" ) <EOL> x = gcd . args [ <NUM_LIT:0> ] ; x . name = "<STR_LIT:x>" <EOL> y = gcd . args [ <NUM_LIT:1> ] ; y . name = "<STR_LIT:y>" <EOL> entry = gcd . append_basic_block ( "<STR_LIT>" ) <EOL> ret = gcd . append_basic_block ( "<STR_LIT>" ) <EOL> cond_false = gcd . append_basic_block ( "<STR_LIT>" ) <EOL> cond_true = gcd . append_basic_block ( "<STR_LIT>" ) <EOL> cond_false_2 = gcd . append_basic_block ( "<STR_LIT>" ) <EOL> bldr = Builder . new ( entry ) <EOL> x_eq_y = bldr . icmp ( IPRED_EQ , x , y , "<STR_LIT>" ) <EOL> bldr . cbranch ( x_eq_y , ret , cond_false ) <EOL> bldr . position_at_end ( ret ) <EOL> bldr . ret ( x ) <EOL> bldr . position_at_end ( cond_false ) <EOL> x_lt_y = bldr . icmp ( IPRED_ULT , x , y , "<STR_LIT>" ) <EOL> bldr . cbranch ( x_lt_y , cond_true , cond_false_2 ) <EOL> bldr . position_at_end ( cond_true ) <EOL> y_sub_x = bldr . sub ( y , x , "<STR_LIT>" ) <EOL> recur_1 = bldr . call ( gcd , ( x , y_sub_x , ) , "<STR_LIT>" ) <EOL> bldr . ret ( recur_1 ) <EOL> bldr . position_at_end ( cond_false_2 ) <EOL> x_sub_y = bldr . sub ( x , y , "<STR_LIT>" ) <EOL> recur_2 = bldr . call ( gcd , ( x_sub_y , y , ) , "<STR_LIT>" ) <EOL> bldr . ret ( recur_2 ) <EOL> print module </s>
