The objective of this study is to test two hypotheses : ( 1 ) the analgesic effect of opioids improves cognitive function by decreasing pain , and ( 2 ) pain antagonizes cognitive effects of opioids .