Skip to content

Instantly share code, notes, and snippets.

@nox
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nox/655450660d148095071c to your computer and use it in GitHub Desktop.
Save nox/655450660d148095071c to your computer and use it in GitHub Desktop.
{module, conjunctions}. %% version = 0
{exports, [{',',2},{'and',2},{'andalso',2},{module_info,0},{module_info,1}]}.
{attributes, []}.
{labels, 28}.
{function, ',', 2, 2}.
{label,1}.
{line,[{location,"conjunctions.erl",4}]}.
{func_info,{atom,conjunctions},{atom,','},2}.
{label,2}.
{bif,'=:=',{f,5},[{x,0},{atom,true}],{x,2}}.
{bif,'=:=',{f,5},[{x,1},{atom,true}],{x,3}}.
{bif,'and',{f,5},[{x,2},{x,3}],{x,2}}.
{test,is_eq_exact,{f,5},[{x,2},{atom,true}]}.
{move,{atom,ok},{x,0}}.
return.
{label,5}.
{test_heap,4,2}.
{put_list,{x,1},nil,{x,2}}.
{put_list,{x,0},{x,2},{x,1}}.
{move,{atom,function_clause},{x,0}}.
{line,[{location,"conjunctions.erl",4}]}.
{call_ext_only,2,{extfunc,erlang,error,2}}.
{label,4}.
{label,3}.
if_end.
{function, 'and', 2, 7}.
{label,6}.
{line,[{location,"conjunctions.erl",7}]}.
{func_info,{atom,conjunctions},{atom,'and'},2}.
{label,7}.
{bif,'=:=',{f,10},[{x,0},{atom,true}],{x,2}}.
{bif,'=:=',{f,10},[{x,1},{atom,true}],{x,3}}.
{bif,'and',{f,10},[{x,2},{x,3}],{x,2}}.
{test,is_eq_exact,{f,10},[{x,2},{atom,true}]}.
{move,{atom,ok},{x,0}}.
return.
{label,10}.
{test_heap,4,2}.
{put_list,{x,1},nil,{x,2}}.
{put_list,{x,0},{x,2},{x,1}}.
{move,{atom,function_clause},{x,0}}.
{line,[{location,"conjunctions.erl",7}]}.
{call_ext_only,2,{extfunc,erlang,error,2}}.
{label,9}.
{label,8}.
if_end.
{function, 'andalso', 2, 12}.
{label,11}.
{line,[{location,"conjunctions.erl",10}]}.
{func_info,{atom,conjunctions},{atom,'andalso'},2}.
{label,12}.
{test,is_atom,{f,17},[{x,0}]}.
{select_val,{x,0},{f,17},{list,[{atom,true},{f,19},{atom,false},{f,18}]}}.
{label,19}.
{move,{x,1},{x,2}}.
{jump,{f,16}}.
{label,18}.
{move,{atom,false},{x,2}}.
{jump,{f,16}}.
{label,17}.
{move,{x,0},{x,2}}.
{jump,{f,16}}.
{label,16}.
{test,is_eq_exact,{f,15},[{x,2},{atom,true}]}.
{move,{atom,ok},{x,0}}.
return.
{label,15}.
{test_heap,4,2}.
{put_list,{x,1},nil,{x,2}}.
{put_list,{x,0},{x,2},{x,1}}.
{move,{atom,function_clause},{x,0}}.
{line,[{location,"conjunctions.erl",10}]}.
{call_ext_only,2,{extfunc,erlang,error,2}}.
{label,14}.
{label,13}.
if_end.
{function, module_info, 0, 21}.
{label,20}.
{line,[]}.
{func_info,{atom,conjunctions},{atom,module_info},0}.
{label,21}.
{move,{atom,conjunctions},{x,0}}.
{line,[]}.
{call_ext_only,1,{extfunc,erlang,get_module_info,1}}.
{label,23}.
{label,22}.
if_end.
{function, module_info, 1, 25}.
{label,24}.
{line,[]}.
{func_info,{atom,conjunctions},{atom,module_info},1}.
{label,25}.
{move,{x,0},{x,1}}.
{move,{atom,conjunctions},{x,0}}.
{line,[]}.
{call_ext_only,2,{extfunc,erlang,get_module_info,2}}.
{label,27}.
{label,26}.
if_end.
-module(conjunctions).
-compile(export_all).
','(A, B) when A, B ->
ok.
'and'(A, B) when A and B ->
ok.
'andalso'(A, B) when A andalso B ->
ok.
{module, conjunctions}. %% version = 0
{exports, [{',',2},{'and',2},{'andalso',2},{module_info,0},{module_info,1}]}.
{attributes, []}.
{labels, 14}.
{function, ',', 2, 2}.
{label,1}.
{line,[{location,"conjunctions.erl",4}]}.
{func_info,{atom,conjunctions},{atom,','},2}.
{label,2}.
{test,is_eq_exact,{f,1},[{x,0},{atom,true}]}.
{test,is_eq_exact,{f,1},[{x,1},{atom,true}]}.
{move,{atom,ok},{x,0}}.
return.
{function, 'and', 2, 4}.
{label,3}.
{line,[{location,"conjunctions.erl",7}]}.
{func_info,{atom,conjunctions},{atom,'and'},2}.
{label,4}.
{test,is_eq_exact,{f,3},[{x,0},{atom,true}]}.
{test,is_eq_exact,{f,3},[{x,1},{atom,true}]}.
{move,{atom,ok},{x,0}}.
return.
{function, 'andalso', 2, 6}.
{label,5}.
{line,[{location,"conjunctions.erl",10}]}.
{func_info,{atom,conjunctions},{atom,'andalso'},2}.
{label,6}.
{test,is_atom,{f,8},[{x,0}]}.
{select_val,{x,0},{f,8},{list,[{atom,true},{f,7},{atom,false},{f,5}]}}.
{label,7}.
{move,{x,1},{x,2}}.
{jump,{f,9}}.
{label,8}.
{move,{x,0},{x,2}}.
{label,9}.
{test,is_eq_exact,{f,5},[{x,2},{atom,true}]}.
{move,{atom,ok},{x,0}}.
return.
{function, module_info, 0, 11}.
{label,10}.
{line,[]}.
{func_info,{atom,conjunctions},{atom,module_info},0}.
{label,11}.
{move,{atom,conjunctions},{x,0}}.
{line,[]}.
{call_ext_only,1,{extfunc,erlang,get_module_info,1}}.
{function, module_info, 1, 13}.
{label,12}.
{line,[]}.
{func_info,{atom,conjunctions},{atom,module_info},1}.
{label,13}.
{move,{x,0},{x,1}}.
{move,{atom,conjunctions},{x,0}}.
{line,[]}.
{call_ext_only,2,{extfunc,erlang,get_module_info,2}}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment