// File: JRLamontagne[P]cdice_sa/CDICEInit.cpp
// Function: allocateEcon(DICE*)
void allocateEcon(DICE *dice)
{
  // Allocate the economic model structure---------------------------------------------
  dice->econ.l = new double[dice->config.nPeriods];		// Level of population and labor (millions)
  dice->econ.al = new double[dice->config.nPeriods];		// Level of total factor productivity
  dice->econ.rr  = new double [dice->config.nPeriods];		// Average utility social discount rate
  dice->econ.ga = new double[dice->config.nPeriods];		// Growth rate of productivity from (sic)
  dice->econ.gl = new double[dice->config.nPeriods];		// Growth rate of labor
  dice->econ.gcost = new double[dice->config.nPeriods];		// Growth of cost factor
  dice->econ.cost1 = new double[dice->config.nPeriods];		// Adjusted cost for backup
  dice->econ.partfract = new double[dice->config.nPeriods];	// Fraction of emissions in control regime
  //dice->econ.gfacpop = new double[dice->config.nPeriods];	// Growth factor population (Appears in GAMS version, but never used
  dice->econ.pbacktime = new double[dice->config.nPeriods];	// Backstop price
  dice->econ.scc = new double[dice->config.nPeriods];		// Social cost of carbon
  dice->econ.cpricebase = new double[dice->config.nPeriods];	// Carbon price in base case
  dice->econ.photel = new double[dice->config.nPeriods];	// Carbon price under no damages (Hotelling rent condition)
  dice->econ.gsig = new double[dice->config.nPeriods];		// Change in sigma (cumulative improvement of energy efficiency)
  dice->econ.sigma = new double[dice->config.nPeriods];		// CO2-equivalent-emissions output ratio 
  dice->econ.etree = new double[dice->config.nPeriods];		// Emissions from deforestation
  dice->econ.cumetree = new double[dice->config.nPeriods];

  dice->econ.c = new double[dice->config.nPeriods];		// Consumption [Trillions 2005 US$ per year]
  dice->econ.k = new double[dice->config.nPeriods];		// Capital stock [Trillions 2005 US$]
  dice->econ.cpc = new double[dice->config.nPeriods];		// Per capita consumption [Thousands 2005 US$ per year]
  dice->econ.i = new double[dice->config.nPeriods];		// Investment [trillions 2005 US$ per year]
  dice->econ.ri = new double[dice->config.nPeriods];		// Real interest rate (per annum)
  dice->econ.y = new double[dice->config.nPeriods];		// Gross world product net of abatement and damages [Trillions 2005 US$ per year]
  dice->econ.ygross = new double[dice->config.nPeriods];	// Gross world product GROSS of abatement and damages [Trillions 2005 US$ per year]
  dice->econ.ynet = new double[dice->config.nPeriods];		// Output net of damages equation [Trillions of 2005 US$ per year]
  dice->econ.damages = new double[dice->config.nPeriods];	// Damages [Trillions 2005 US$ per year]
  dice->econ.damfrac = new double[dice->config.nPeriods];	// Damages as fraction of gross output
  dice->econ.abatecost = new double[dice->config.nPeriods];	// Cost of emissions reductions [Trillions 2005 US$ per year]
  dice->econ.mcabate = new double[dice->config.nPeriods];	// Marginal cost of abatement [2005 US$ per ton CO2]
  dice->econ.periodu = new double[dice->config.nPeriods];	// One period utility function
  dice->econ.cprice = new double[dice->config.nPeriods];	// Carbon price [2005 US$ per ton CO2]
  dice->econ.cemutotper = new double[dice->config.nPeriods];	// Period utility
  dice->econ.ri_disc = new double[dice->config.nPeriods];	// Real interest rate (discounted) for present value calculations
  dice->econ.pv_damages = new double[dice->config.nPeriods];	// Present value of damages
  dice->econ.pv_abatecost = new double[dice->config.nPeriods];	// Present value of abatement costs
  dice->econ.totalcost = new double[dice->config.nPeriods];	// Total costs (abatement + damages)
  dice->econ.pv_totalcost = new double[dice->config.nPeriods];	// Present value of total costs (abatement + damages)
  dice->econ.e = new double[dice->config.nPeriods];		// Total CO2 emissions [GtCO2 per year]
  dice->econ.eind = new double[dice->config.nPeriods];		// Industrial emissions [GtCO2 per year]
  dice->econ.cca = new double[dice->config.nPeriods];		// Cumulative industrial carbon emissions [GtC]
  dice->econ.ccatot = new double[dice->config.nPeriods];

  return;
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x288(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x290(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2c8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2d0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2d8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2e0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x298(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2a0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2a8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2b0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2b8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2c0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2e8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2f0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x2f8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x300(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x308(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x310(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x318(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x320(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x328(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x330(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x338(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x340(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x348(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x350(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x358(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x360(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x368(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x370(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x378(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x388(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x390(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x398(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x3a0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x3a8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x3b8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x3c0(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x3c8(%rax)
movq (%rsp), %rax
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x9030
movq %rax, %rcx
movq (%rsp), %rax
movq %rcx, 0x3d0(%rax)
popq %rax
retq
nopw (%rax,%rax)