// File: JRLamontagne[P]cdice_sa/CDICEInit.cpp
// Function: free_CDICE(DICE*)
void free_CDICE(DICE *dice)
{
	// Delete the allocated arrays
	delete dice->config.dateSeries;	
	delete dice->carb.forcoth;	
  delete dice->carb.forc;		
  delete dice->carb.mat;		
  delete dice->carb.mu;		
  delete dice->carb.ml;		
  delete dice->econ.l;		
  delete dice->econ.al;		
  delete dice->econ.rr ;		
  delete dice->econ.ga;		
  delete dice->econ.gl;		
  delete dice->econ.gcost;		
  delete dice->econ.cost1;		
  delete dice->econ.partfract;	
  delete dice->econ.pbacktime;	
  delete dice->econ.scc;		
  delete dice->econ.cpricebase;	
  delete dice->econ.photel;	
  delete dice->econ.gsig;		
  delete dice->econ.sigma;		
  delete dice->econ.etree;		
  delete dice->econ.c;		
  delete dice->econ.k;		
  delete dice->econ.cpc;		
  delete dice->econ.i;		
  delete dice->econ.ri;		
  delete dice->econ.y;		
  delete dice->econ.ygross;	
  delete dice->econ.ynet;		
  delete dice->econ.damages;	
  delete dice->econ.damfrac;	
  delete dice->econ.abatecost;	
  delete dice->econ.mcabate;	
  delete dice->econ.periodu;	
  delete dice->econ.cprice;	
  delete dice->econ.cemutotper;	
  delete dice->econ.ri_disc;	
  delete dice->econ.pv_damages;	
  delete dice->econ.pv_abatecost;	
  delete dice->econ.totalcost;	
  delete dice->econ.pv_totalcost;	
  delete dice->econ.e;		
  delete dice->econ.eind;		
  delete dice->econ.cca;		
  delete dice->econ.maxcca_vec;
  delete dice->econ.utility_vec;
  delete dice->dvars.miu;	
  delete dice->dvars.s;	
  delete dice->lims.miu_up;	

	if(dice->ctrl.use_doeclim == 1) {	
		delete dice->clim.forc;
    delete dice->clim.IB;
    delete dice->clim.A;
    delete dice->clim.Ker;
    delete dice->clim.temp;
    delete dice->clim.temp_landair;
    delete dice->clim.temp_sst;
    delete dice->clim.heat_mixed;
    delete dice->clim.heat_interior;
    delete dice->clim.heatflux_mixed;
    delete dice->clim.heatflux_interior;
    delete dice->clim.cs_cal;
    delete dice->clim.kv_cal;
    delete dice->clim.alpha_cal;
  } else {
    delete dice->clim.tatm;		
    delete dice->clim.tocean;	
  }
  
/*  // Delete the structures in the DICE object
  delete dice->config;
  delete dice->dvars;
  delete dice->ctrl;
  delete dice->clim;
  delete dice->econ;
  delete dice->carb;
  delete dice->lims;
*/  
  // Delete the parent structure of the DICE object
//  delete dice;
  
}

// Assembly:
subq $0x218, %rsp            # imm = 0x218
movq %rdi, 0x210(%rsp)
movq 0x210(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x208(%rsp)
cmpq $0x0, %rax
je 0x14b9b
movq 0x208(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x468(%rax), %rax
movq %rax, 0x200(%rsp)
cmpq $0x0, %rax
je 0x14bca
movq 0x200(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x470(%rax), %rax
movq %rax, 0x1f8(%rsp)
cmpq $0x0, %rax
je 0x14bf9
movq 0x1f8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x478(%rax), %rax
movq %rax, 0x1f0(%rsp)
cmpq $0x0, %rax
je 0x14c28
movq 0x1f0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x480(%rax), %rax
movq %rax, 0x1e8(%rsp)
cmpq $0x0, %rax
je 0x14c57
movq 0x1e8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x488(%rax), %rax
movq %rax, 0x1e0(%rsp)
cmpq $0x0, %rax
je 0x14c86
movq 0x1e0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x288(%rax), %rax
movq %rax, 0x1d8(%rsp)
cmpq $0x0, %rax
je 0x14cb5
movq 0x1d8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x290(%rax), %rax
movq %rax, 0x1d0(%rsp)
cmpq $0x0, %rax
je 0x14ce4
movq 0x1d0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2c8(%rax), %rax
movq %rax, 0x1c8(%rsp)
cmpq $0x0, %rax
je 0x14d13
movq 0x1c8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2d0(%rax), %rax
movq %rax, 0x1c0(%rsp)
cmpq $0x0, %rax
je 0x14d42
movq 0x1c0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2d8(%rax), %rax
movq %rax, 0x1b8(%rsp)
cmpq $0x0, %rax
je 0x14d71
movq 0x1b8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2e0(%rax), %rax
movq %rax, 0x1b0(%rsp)
cmpq $0x0, %rax
je 0x14da0
movq 0x1b0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x298(%rax), %rax
movq %rax, 0x1a8(%rsp)
cmpq $0x0, %rax
je 0x14dcf
movq 0x1a8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2a0(%rax), %rax
movq %rax, 0x1a0(%rsp)
cmpq $0x0, %rax
je 0x14dfe
movq 0x1a0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2a8(%rax), %rax
movq %rax, 0x198(%rsp)
cmpq $0x0, %rax
je 0x14e2d
movq 0x198(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2b0(%rax), %rax
movq %rax, 0x190(%rsp)
cmpq $0x0, %rax
je 0x14e5c
movq 0x190(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2b8(%rax), %rax
movq %rax, 0x188(%rsp)
cmpq $0x0, %rax
je 0x14e8b
movq 0x188(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2c0(%rax), %rax
movq %rax, 0x180(%rsp)
cmpq $0x0, %rax
je 0x14eba
movq 0x180(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2e8(%rax), %rax
movq %rax, 0x178(%rsp)
cmpq $0x0, %rax
je 0x14ee9
movq 0x178(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2f0(%rax), %rax
movq %rax, 0x170(%rsp)
cmpq $0x0, %rax
je 0x14f18
movq 0x170(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x2f8(%rax), %rax
movq %rax, 0x168(%rsp)
cmpq $0x0, %rax
je 0x14f47
movq 0x168(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x308(%rax), %rax
movq %rax, 0x160(%rsp)
cmpq $0x0, %rax
je 0x14f76
movq 0x160(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x310(%rax), %rax
movq %rax, 0x158(%rsp)
cmpq $0x0, %rax
je 0x14fa5
movq 0x158(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x318(%rax), %rax
movq %rax, 0x150(%rsp)
cmpq $0x0, %rax
je 0x14fd4
movq 0x150(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x320(%rax), %rax
movq %rax, 0x148(%rsp)
cmpq $0x0, %rax
je 0x15003
movq 0x148(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x328(%rax), %rax
movq %rax, 0x140(%rsp)
cmpq $0x0, %rax
je 0x15032
movq 0x140(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x330(%rax), %rax
movq %rax, 0x138(%rsp)
cmpq $0x0, %rax
je 0x15061
movq 0x138(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x338(%rax), %rax
movq %rax, 0x130(%rsp)
cmpq $0x0, %rax
je 0x15090
movq 0x130(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x340(%rax), %rax
movq %rax, 0x128(%rsp)
cmpq $0x0, %rax
je 0x150bf
movq 0x128(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x348(%rax), %rax
movq %rax, 0x120(%rsp)
cmpq $0x0, %rax
je 0x150ee
movq 0x120(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x350(%rax), %rax
movq %rax, 0x118(%rsp)
cmpq $0x0, %rax
je 0x1511d
movq 0x118(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x358(%rax), %rax
movq %rax, 0x110(%rsp)
cmpq $0x0, %rax
je 0x1514c
movq 0x110(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x360(%rax), %rax
movq %rax, 0x108(%rsp)
cmpq $0x0, %rax
je 0x1517b
movq 0x108(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x368(%rax), %rax
movq %rax, 0x100(%rsp)
cmpq $0x0, %rax
je 0x151aa
movq 0x100(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x370(%rax), %rax
movq %rax, 0xf8(%rsp)
cmpq $0x0, %rax
je 0x151d9
movq 0xf8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x378(%rax), %rax
movq %rax, 0xf0(%rsp)
cmpq $0x0, %rax
je 0x15208
movq 0xf0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x388(%rax), %rax
movq %rax, 0xe8(%rsp)
cmpq $0x0, %rax
je 0x15237
movq 0xe8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x390(%rax), %rax
movq %rax, 0xe0(%rsp)
cmpq $0x0, %rax
je 0x15266
movq 0xe0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x398(%rax), %rax
movq %rax, 0xd8(%rsp)
cmpq $0x0, %rax
je 0x15295
movq 0xd8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3a0(%rax), %rax
movq %rax, 0xd0(%rsp)
cmpq $0x0, %rax
je 0x152c4
movq 0xd0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3a8(%rax), %rax
movq %rax, 0xc8(%rsp)
cmpq $0x0, %rax
je 0x152f3
movq 0xc8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3b8(%rax), %rax
movq %rax, 0xc0(%rsp)
cmpq $0x0, %rax
je 0x15322
movq 0xc0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3c0(%rax), %rax
movq %rax, 0xb8(%rsp)
cmpq $0x0, %rax
je 0x15351
movq 0xb8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3c8(%rax), %rax
movq %rax, 0xb0(%rsp)
cmpq $0x0, %rax
je 0x15380
movq 0xb0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3d8(%rax), %rax
movq %rax, 0xa8(%rsp)
cmpq $0x0, %rax
je 0x153af
movq 0xa8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x3b0(%rax), %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, %rax
je 0x153de
movq 0xa0(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x48(%rax), %rax
movq %rax, 0x98(%rsp)
cmpq $0x0, %rax
je 0x1540a
movq 0x98(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x90(%rsp)
cmpq $0x0, %rax
je 0x15436
movq 0x90(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x528(%rax), %rax
movq %rax, 0x88(%rsp)
cmpq $0x0, %rax
je 0x15465
movq 0x88(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
cmpl $0x1, 0x58(%rax)
jne 0x156bd
movq 0x210(%rsp), %rax
movq 0xb0(%rax), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, %rax
je 0x154a6
movq 0x80(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x100(%rax), %rax
movq %rax, 0x78(%rsp)
cmpq $0x0, %rax
je 0x154cf
movq 0x78(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x108(%rax), %rax
movq %rax, 0x70(%rsp)
cmpq $0x0, %rax
je 0x154f8
movq 0x70(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x120(%rax), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, %rax
je 0x15521
movq 0x68(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x140(%rax), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, %rax
je 0x1554a
movq 0x60(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x148(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0x15573
movq 0x58(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x150(%rax), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0x1559c
movq 0x50(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x158(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x155c5
movq 0x48(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x160(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0x155ee
movq 0x40(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x168(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0x15617
movq 0x38(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x170(%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0x15640
movq 0x30(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x178(%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0x15669
movq 0x28(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x180(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0x15692
movq 0x20(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x188(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x156bb
movq 0x18(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
jmp 0x15711
movq 0x210(%rsp), %rax
movq 0x128(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x156e6
movq 0x10(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
movq 0x210(%rsp), %rax
movq 0x130(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1570f
movq 0x8(%rsp), %rdi
movl $0x8, %esi
callq 0x96a0
jmp 0x15711
addq $0x218, %rsp            # imm = 0x218
retq
nopl (%rax)