// File: /workspace/github_cpp_makefile_star2_O1/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq (%rdi), %rax
leaq (,%rax,8), %rcx
testq %rax, %rax
movq $-0x1, %r14
cmovnsq %rcx, %r14
movq %r14, %rdi
callq 0x2030
movq %rax, 0x288(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x290(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2c8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2d0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2d8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2e0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x298(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2a0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2a8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2b0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2b8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2c0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2e8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2f0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x2f8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x300(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x308(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x310(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x318(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x320(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x328(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x330(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x338(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x340(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x348(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x350(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x358(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x360(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x368(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x370(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x378(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x388(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x390(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x398(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x3a0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x3a8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x3b8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x3c0(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x3c8(%rbx)
movq %r14, %rdi
callq 0x2030
movq %rax, 0x3d0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq