// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x4556
movl $0x8, %esi
callq 0x21e0
movq 0x468(%rbx), %rdi
testq %rdi, %rdi
je 0x456c
movl $0x8, %esi
callq 0x21e0
movq 0x470(%rbx), %rdi
testq %rdi, %rdi
je 0x4582
movl $0x8, %esi
callq 0x21e0
movq 0x478(%rbx), %rdi
testq %rdi, %rdi
je 0x4598
movl $0x8, %esi
callq 0x21e0
movq 0x480(%rbx), %rdi
testq %rdi, %rdi
je 0x45ae
movl $0x8, %esi
callq 0x21e0
movq 0x488(%rbx), %rdi
testq %rdi, %rdi
je 0x45c4
movl $0x8, %esi
callq 0x21e0
movq 0x288(%rbx), %rdi
testq %rdi, %rdi
je 0x45da
movl $0x8, %esi
callq 0x21e0
movq 0x290(%rbx), %rdi
testq %rdi, %rdi
je 0x45f0
movl $0x8, %esi
callq 0x21e0
movq 0x2c8(%rbx), %rdi
testq %rdi, %rdi
je 0x4606
movl $0x8, %esi
callq 0x21e0
movq 0x2d0(%rbx), %rdi
testq %rdi, %rdi
je 0x461c
movl $0x8, %esi
callq 0x21e0
movq 0x2d8(%rbx), %rdi
testq %rdi, %rdi
je 0x4632
movl $0x8, %esi
callq 0x21e0
movq 0x2e0(%rbx), %rdi
testq %rdi, %rdi
je 0x4648
movl $0x8, %esi
callq 0x21e0
movq 0x298(%rbx), %rdi
testq %rdi, %rdi
je 0x465e
movl $0x8, %esi
callq 0x21e0
movq 0x2a0(%rbx), %rdi
testq %rdi, %rdi
je 0x4674
movl $0x8, %esi
callq 0x21e0
movq 0x2a8(%rbx), %rdi
testq %rdi, %rdi
je 0x468a
movl $0x8, %esi
callq 0x21e0
movq 0x2b0(%rbx), %rdi
testq %rdi, %rdi
je 0x46a0
movl $0x8, %esi
callq 0x21e0
movq 0x2b8(%rbx), %rdi
testq %rdi, %rdi
je 0x46b6
movl $0x8, %esi
callq 0x21e0
movq 0x2c0(%rbx), %rdi
testq %rdi, %rdi
je 0x46cc
movl $0x8, %esi
callq 0x21e0
movq 0x2e8(%rbx), %rdi
testq %rdi, %rdi
je 0x46e2
movl $0x8, %esi
callq 0x21e0
movq 0x2f0(%rbx), %rdi
testq %rdi, %rdi
je 0x46f8
movl $0x8, %esi
callq 0x21e0
movq 0x2f8(%rbx), %rdi
testq %rdi, %rdi
je 0x470e
movl $0x8, %esi
callq 0x21e0
movq 0x308(%rbx), %rdi
testq %rdi, %rdi
je 0x4724
movl $0x8, %esi
callq 0x21e0
movq 0x310(%rbx), %rdi
testq %rdi, %rdi
je 0x473a
movl $0x8, %esi
callq 0x21e0
movq 0x318(%rbx), %rdi
testq %rdi, %rdi
je 0x4750
movl $0x8, %esi
callq 0x21e0
movq 0x320(%rbx), %rdi
testq %rdi, %rdi
je 0x4766
movl $0x8, %esi
callq 0x21e0
movq 0x328(%rbx), %rdi
testq %rdi, %rdi
je 0x477c
movl $0x8, %esi
callq 0x21e0
movq 0x330(%rbx), %rdi
testq %rdi, %rdi
je 0x4792
movl $0x8, %esi
callq 0x21e0
movq 0x338(%rbx), %rdi
testq %rdi, %rdi
je 0x47a8
movl $0x8, %esi
callq 0x21e0
movq 0x340(%rbx), %rdi
testq %rdi, %rdi
je 0x47be
movl $0x8, %esi
callq 0x21e0
movq 0x348(%rbx), %rdi
testq %rdi, %rdi
je 0x47d4
movl $0x8, %esi
callq 0x21e0
movq 0x350(%rbx), %rdi
testq %rdi, %rdi
je 0x47ea
movl $0x8, %esi
callq 0x21e0
movq 0x358(%rbx), %rdi
testq %rdi, %rdi
je 0x4800
movl $0x8, %esi
callq 0x21e0
movq 0x360(%rbx), %rdi
testq %rdi, %rdi
je 0x4816
movl $0x8, %esi
callq 0x21e0
movq 0x368(%rbx), %rdi
testq %rdi, %rdi
je 0x482c
movl $0x8, %esi
callq 0x21e0
movq 0x370(%rbx), %rdi
testq %rdi, %rdi
je 0x4842
movl $0x8, %esi
callq 0x21e0
movq 0x378(%rbx), %rdi
testq %rdi, %rdi
je 0x4858
movl $0x8, %esi
callq 0x21e0
movq 0x388(%rbx), %rdi
testq %rdi, %rdi
je 0x486e
movl $0x8, %esi
callq 0x21e0
movq 0x390(%rbx), %rdi
testq %rdi, %rdi
je 0x4884
movl $0x8, %esi
callq 0x21e0
movq 0x398(%rbx), %rdi
testq %rdi, %rdi
je 0x489a
movl $0x8, %esi
callq 0x21e0
movq 0x3a0(%rbx), %rdi
testq %rdi, %rdi
je 0x48b0
movl $0x8, %esi
callq 0x21e0
movq 0x3a8(%rbx), %rdi
testq %rdi, %rdi
je 0x48c6
movl $0x8, %esi
callq 0x21e0
movq 0x3b8(%rbx), %rdi
testq %rdi, %rdi
je 0x48dc
movl $0x8, %esi
callq 0x21e0
movq 0x3c0(%rbx), %rdi
testq %rdi, %rdi
je 0x48f2
movl $0x8, %esi
callq 0x21e0
movq 0x3c8(%rbx), %rdi
testq %rdi, %rdi
je 0x4908
movl $0x8, %esi
callq 0x21e0
movq 0x3d8(%rbx), %rdi
testq %rdi, %rdi
je 0x491e
movl $0x8, %esi
callq 0x21e0
movq 0x3b0(%rbx), %rdi
testq %rdi, %rdi
je 0x4934
movl $0x8, %esi
callq 0x21e0
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x4947
movl $0x8, %esi
callq 0x21e0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x495a
movl $0x8, %esi
callq 0x21e0
movq 0x528(%rbx), %rdi
testq %rdi, %rdi
je 0x4970
movl $0x8, %esi
callq 0x21e0
cmpl $0x1, 0x58(%rbx)
jne 0x4aa1
movq 0xb0(%rbx), %rdi
testq %rdi, %rdi
je 0x4990
movl $0x8, %esi
callq 0x21e0
movq 0x100(%rbx), %rdi
testq %rdi, %rdi
je 0x49a6
movl $0x8, %esi
callq 0x21e0
movq 0x108(%rbx), %rdi
testq %rdi, %rdi
je 0x49bc
movl $0x8, %esi
callq 0x21e0
movq 0x120(%rbx), %rdi
testq %rdi, %rdi
je 0x49d2
movl $0x8, %esi
callq 0x21e0
movq 0x140(%rbx), %rdi
testq %rdi, %rdi
je 0x49e8
movl $0x8, %esi
callq 0x21e0
movq 0x148(%rbx), %rdi
testq %rdi, %rdi
je 0x49fe
movl $0x8, %esi
callq 0x21e0
movq 0x150(%rbx), %rdi
testq %rdi, %rdi
je 0x4a14
movl $0x8, %esi
callq 0x21e0
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
je 0x4a2a
movl $0x8, %esi
callq 0x21e0
movq 0x160(%rbx), %rdi
testq %rdi, %rdi
je 0x4a40
movl $0x8, %esi
callq 0x21e0
movq 0x168(%rbx), %rdi
testq %rdi, %rdi
je 0x4a56
movl $0x8, %esi
callq 0x21e0
movq 0x170(%rbx), %rdi
testq %rdi, %rdi
je 0x4a6c
movl $0x8, %esi
callq 0x21e0
movq 0x178(%rbx), %rdi
testq %rdi, %rdi
je 0x4a82
movl $0x8, %esi
callq 0x21e0
movq 0x180(%rbx), %rdi
testq %rdi, %rdi
je 0x4a98
movl $0x8, %esi
callq 0x21e0
movq 0x188(%rbx), %rdi
jmp 0x4abe
movq 0x128(%rbx), %rdi
testq %rdi, %rdi
je 0x4ab7
movl $0x8, %esi
callq 0x21e0
movq 0x130(%rbx), %rdi
testq %rdi, %rdi
je 0x4ace
movl $0x8, %esi
popq %rbx
jmp 0x21e0
popq %rbx
retq