// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x468(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x470(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x478(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x480(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x488(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x288(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x290(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2c8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2d0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2d8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2e0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x298(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2a0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2a8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2b0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2b8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2c0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2e8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2f0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x2f8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x308(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x310(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x318(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x320(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x328(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x330(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x338(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x340(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x348(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x350(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x358(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x360(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x368(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x370(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x378(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x388(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x390(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x398(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3a0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3a8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3b8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3c0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3c8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3d8(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x3b0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x48(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x50(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x528(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
cmpl $0x1, 0x58(%rbx)
jne 0x4ab8
movq 0xb0(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x100(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x108(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x120(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x140(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x148(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x150(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x158(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x160(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x168(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x170(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movq 0x178(%rbx), %rdi
movl $0x8, %esi
callq 0x21e0
movl $0x188, %r14d           # imm = 0x188
movl $0x180, %eax            # imm = 0x180
jmp 0x4ac3
movl $0x130, %r14d           # imm = 0x130
movl $0x128, %eax            # imm = 0x128
movq (%rbx,%rax), %rdi
movl $0x8, %esi
callq 0x21e0
movq (%rbx,%r14), %rdi
movl $0x8, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x21e0
nop