// ME 759 Spring 2021 Final Project
// driver.cu
// Author: Jason Zhou

#include <cstdio>
#include <random>
#include <iostream>
#include <string>

#include "BWTerrain.cuh"

int main(int argc, char* argv[]) {
    // Note: Currently the minimum resolution tested to be working 0.05f
    // Experiments have shown that when goes below 0.05f, Bulldozing algorithm has flaws

    // declare a terrain with size 5 m x 5 m with resolution 0.05 m
    BWTerrain terrain = BWTerrain(5.f, 5.f, 0.05f);
    // declare a wheel with radius of 0.5 m, a width of 1 m, and a mass of 10 kg
    BWWheel wheel = BWWheel(0.5f, 1.f, 10.f);

    // initialize the wheel object
    wheel.Initialize(1.0f, 2.5f, 0.5f);
    // set z direction acceleration to -9.8, simulate gravity effect
    wheel.acc_z = -9.8;
    // single - wheel constant x direction velocity set to 0.5
    wheel.vel_x = 0.5;

    std::cout << "Terrain: " << terrain.Get_X_Size() << "," << terrain.Get_Y_Size() << "," << terrain.Get_Resolution()
              << std::endl;
    std::cout << "Wheel: " << wheel.Get_R() << "," << wheel.Get_W() << std::endl;

    // enable bulldozing effect - defaultly it's turned off
    terrain.Set_Bulldozing(false);

    // intialize the terrain
    terrain.Initialize();

    // perform simulation
    // step size set to 0.01 s
    // total simulation time is 5 s
    for (int i = 0; i < 500; i++) {
        wheel.Advance(0.01);
        terrain.Advance(0.01, &wheel);
        if (i < 10) {
            terrain.WriteOutput("ter-000" + std::to_string(i));
            wheel.WriteOutput("whe-000" + std::to_string(i));
        } else if (i < 100) {
            terrain.WriteOutput("ter-00" + std::to_string(i));
            wheel.WriteOutput("whe-00" + std::to_string(i));
        } else {
            terrain.WriteOutput("ter-0" + std::to_string(i));
            wheel.WriteOutput("whe-0" + std::to_string(i));
        }

        std::cout << "time: " << i * 0.01 << " s" << std::endl;
        std::cout << "wheel pos:" << wheel.pos_x << "," << wheel.pos_y << "," << wheel.pos_z << std::endl;
        std::cout << "wheel acc_z:" << wheel.acc_z << std::endl;
        std::cout << "==============================================" << std::endl;
    }

    // safely free up all GPU memory
    terrain.Destroy();
}
	.file	"tmpxft_002f6e39_00000000-6_driver.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB4729:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE4729:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.align 2
	.type	_ZNSolsEPFRSoS_E.isra.0, @function
_ZNSolsEPFRSoS_E.isra.0:
.LFB5419:
	.cfi_startproc
	jmp	*%rsi
	.cfi_endproc
.LFE5419:
	.size	_ZNSolsEPFRSoS_E.isra.0, .-_ZNSolsEPFRSoS_E.isra.0
	.section	.rodata._ZNSt7__cxx119to_stringEi.str1.1,"aMS",@progbits,1
.LC0:
	.string	"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
	.section	.text._ZNSt7__cxx119to_stringEi,"axG",@progbits,_ZNSt7__cxx119to_stringEi,comdat
	.weak	_ZNSt7__cxx119to_stringEi
	.type	_ZNSt7__cxx119to_stringEi, @function
_ZNSt7__cxx119to_stringEi:
.LFB2731:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA2731
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	%esi, %r13d
	movl	$10000, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	shrl	$31, %r13d
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movl	$1, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%esi, %ebx
	subq	$232, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 216(%rsp)
	xorl	%eax, %eax
	negl	%ebx
	cmovs	%esi, %ebx
	movl	%ebx, %eax
.L9:
	cmpl	$9, %eax
	jbe	.L5
	cmpl	$99, %eax
	ja	.L6
	incl	%ebp
	jmp	.L5
.L6:
	cmpl	$999, %eax
	ja	.L7
	addl	$2, %ebp
	jmp	.L5
.L7:
	cmpl	$9999, %eax
	ja	.L8
	addl	$3, %ebp
	jmp	.L5
.L8:
	movl	%eax, %eax
	xorl	%edx, %edx
	addl	$4, %ebp
	divq	%rcx
	jmp	.L9
.L5:
	leaq	16(%r12), %rax
	leal	0(%r13,%rbp), %esi
	movq	%r12, %rdi
	decl	%ebp
	movq	%rax, (%r12)
	movl	$45, %edx
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc@PLT
	movzbl	%r13b, %r8d
	leaq	15(%rsp), %rdi
	leaq	.LC0(%rip), %rsi
	movl	$201, %ecx
	addq	(%r12), %r8
	rep movsb
	movl	$100, %ecx
.L10:
	cmpl	$99, %ebx
	jbe	.L17
	movl	%ebx, %eax
	xorl	%edx, %edx
	movl	%ebp, %esi
	divl	%ecx
	addl	%edx, %edx
	movl	%eax, %ebx
	leal	1(%rdx), %eax
	movb	15(%rsp,%rdx), %dl
	movb	15(%rsp,%rax), %al
	movb	%al, (%r8,%rsi)
	leal	-1(%rbp), %eax
	subl	$2, %ebp
	movb	%dl, (%r8,%rax)
	jmp	.L10
.L17:
	leal	48(%rbx), %eax
	cmpl	$9, %ebx
	jbe	.L13
	addl	%ebx, %ebx
	leal	1(%rbx), %eax
	movb	15(%rsp,%rax), %al
	movb	%al, 1(%r8)
	movb	15(%rsp,%rbx), %al
.L13:
	movb	%al, (%r8)
	movq	216(%rsp), %rax
	subq	%fs:40, %rax
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	addq	$232, %rsp
	.cfi_def_cfa_offset 40
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2731:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZNSt7__cxx119to_stringEi,"aG",@progbits,_ZNSt7__cxx119to_stringEi,comdat
.LLSDA2731:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE2731-.LLSDACSB2731
.LLSDACSB2731:
.LLSDACSE2731:
	.section	.text._ZNSt7__cxx119to_stringEi,"axG",@progbits,_ZNSt7__cxx119to_stringEi,comdat
	.size	_ZNSt7__cxx119to_stringEi, .-_ZNSt7__cxx119to_stringEi
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB4752:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE4752:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.text._ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_,"axG",@progbits,_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_,comdat
	.weak	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
	.type	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_, @function
_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_:
.LFB5064:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	movq	%rdx, %rdi
	movq	%rsi, %rdx
	xorl	%esi, %esi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6insertEmPKc@PLT
	movq	%rbx, %rdi
	movq	%rax, %rsi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_@PLT
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE5064:
	.size	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_, .-_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC8:
	.string	"Terrain: "
.LC9:
	.string	","
.LC10:
	.string	"Wheel: "
.LC12:
	.string	"ter-000"
.LC13:
	.string	"whe-000"
.LC14:
	.string	"ter-00"
.LC15:
	.string	"whe-00"
.LC16:
	.string	"ter-0"
.LC17:
	.string	"whe-0"
.LC18:
	.string	"time: "
.LC20:
	.string	" s"
.LC21:
	.string	"wheel pos:"
.LC22:
	.string	"wheel acc_z:"
.LC23:
	.string	"=============================================="
	.section	.text.startup
	.globl	main
	.type	main, @function
main:
.LFB4726:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA4726
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC9(%rip), %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	_ZSt4cout(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movss	.LC2(%rip), %xmm1
	movss	.LC1(%rip), %xmm2
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	64(%rsp), %r12
	leaq	16(%rsp), %r13
	movaps	%xmm1, %xmm0
	movq	%r12, %rdi
.LEHB0:
	call	_ZN9BWTerrainC1Efff@PLT
	movss	.LC3(%rip), %xmm2
	movss	.LC4(%rip), %xmm1
	movq	%r13, %rdi
	movss	.LC5(%rip), %xmm0
	call	_ZN7BWWheelC1Efff@PLT
	movss	.LC5(%rip), %xmm2
	movss	.LC6(%rip), %xmm1
	movq	%r13, %rdi
	movss	.LC4(%rip), %xmm0
	call	_ZN7BWWheel10InitializeEfff@PLT
	leaq	.LC8(%rip), %rsi
	movq	%r14, %rdi
	movl	$0xc11ccccd, 60(%rsp)
	movl	$0x3f000000, 40(%rsp)
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	64(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	68(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	72(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC10(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	16(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	20(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	movq	%r12, %rdi
	movb	$0, 152(%rsp)
	call	_ZN9BWTerrain10InitializeEv@PLT
.L26:
	movss	.LC11(%rip), %xmm0
	movq	%r13, %rdi
	leaq	200(%rsp), %rbx
	call	_ZN7BWWheel7AdvanceEf@PLT
	movss	.LC11(%rip), %xmm0
	movq	%r13, %rsi
	movq	%r12, %rdi
	call	_ZN9BWTerrain7AdvanceEfP7BWWheel@PLT
.LEHE0:
	leaq	168(%rsp), %rax
	cmpl	$9, %ebp
	movl	%ebp, %esi
	movq	%rax, 8(%rsp)
	jg	.L23
	movq	%rax, %rdi
	call	_ZNSt7__cxx119to_stringEi
	movq	8(%rsp), %rdx
	leaq	.LC12(%rip), %rsi
	movq	%rbx, %rdi
.LEHB1:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
.LEHE1:
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB2:
	call	_ZN9BWTerrain11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE2:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	movl	%ebp, %esi
	call	_ZNSt7__cxx119to_stringEi
	movq	8(%rsp), %rdx
	leaq	.LC13(%rip), %rsi
	movq	%rbx, %rdi
.LEHB3:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
.LEHE3:
	movq	%rbx, %rsi
	movq	%r13, %rdi
.LEHB4:
	call	_ZN7BWWheel11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE4:
	jmp	.L61
.L23:
	movq	8(%rsp), %rdi
	cmpl	$99, %ebp
	jg	.L25
	call	_ZNSt7__cxx119to_stringEi
	movq	8(%rsp), %rdx
	leaq	.LC14(%rip), %rsi
	movq	%rbx, %rdi
.LEHB5:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
.LEHE5:
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB6:
	call	_ZN9BWTerrain11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE6:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	movl	%ebp, %esi
	call	_ZNSt7__cxx119to_stringEi
	movq	8(%rsp), %rdx
	leaq	.LC15(%rip), %rsi
	movq	%rbx, %rdi
.LEHB7:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
.LEHE7:
	movq	%rbx, %rsi
	movq	%r13, %rdi
.LEHB8:
	call	_ZN7BWWheel11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE8:
	jmp	.L61
.L25:
	call	_ZNSt7__cxx119to_stringEi
	movq	8(%rsp), %rdx
	leaq	.LC16(%rip), %rsi
	movq	%rbx, %rdi
.LEHB9:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
.LEHE9:
	movq	%rbx, %rsi
	movq	%r12, %rdi
.LEHB10:
	call	_ZN9BWTerrain11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE10:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	movl	%ebp, %esi
	call	_ZNSt7__cxx119to_stringEi
	movq	8(%rsp), %rdx
	leaq	.LC17(%rip), %rsi
	movq	%rbx, %rdi
.LEHB11:
	call	_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EEPKS5_OS8_
.LEHE11:
	movq	%rbx, %rsi
	movq	%r13, %rdi
.LEHB12:
	call	_ZN7BWWheel11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE@PLT
.LEHE12:
.L61:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	leaq	.LC18(%rip), %rsi
	movq	%r14, %rdi
.LEHB13:
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtsi2sdl	%ebp, %xmm0
	incl	%ebp
	mulsd	.LC19(%rip), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	leaq	.LC20(%rip), %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC21(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	28(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	32(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	%r15, %rsi
	movq	%rax, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	36(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC22(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	cvtss2sd	60(%rsp), %xmm0
	movq	%rax, %rdi
	call	_ZNSo9_M_insertIdEERSoT_@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	leaq	.LC23(%rip), %rsi
	movq	%r14, %rdi
	call	_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc@PLT
	movq	_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	call	_ZNSolsEPFRSoS_E.isra.0
	cmpl	$500, %ebp
	jne	.L26
	movq	%r12, %rdi
	call	_ZN9BWTerrain7DestroyEv@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	je	.L45
	jmp	.L59
.L47:
	endbr64
	jmp	.L64
.L46:
	endbr64
	jmp	.L63
.L49:
	endbr64
	jmp	.L64
.L48:
	endbr64
	jmp	.L63
.L51:
	endbr64
	jmp	.L64
.L50:
	endbr64
	jmp	.L63
.L53:
	endbr64
	jmp	.L64
.L52:
	endbr64
	jmp	.L63
.L55:
	endbr64
	jmp	.L64
.L54:
	endbr64
	jmp	.L63
.L57:
	endbr64
.L64:
	movq	%rax, %rbp
.L42:
	movq	%rbx, %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	jmp	.L43
.L56:
	endbr64
.L63:
	movq	%rax, %rbp
.L43:
	movq	8(%rsp), %rdi
	call	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_disposeEv@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L59
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE13:
.L59:
	call	__stack_chk_fail@PLT
.L45:
	addq	$248, %rsp
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE4726:
	.section	.gcc_except_table,"a",@progbits
.LLSDA4726:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE4726-.LLSDACSB4726
.LLSDACSB4726:
	.uleb128 .LEHB0-.LFB4726
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB4726
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L46-.LFB4726
	.uleb128 0
	.uleb128 .LEHB2-.LFB4726
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L47-.LFB4726
	.uleb128 0
	.uleb128 .LEHB3-.LFB4726
	.uleb128 .LEHE3-.LEHB3
	.uleb128 .L48-.LFB4726
	.uleb128 0
	.uleb128 .LEHB4-.LFB4726
	.uleb128 .LEHE4-.LEHB4
	.uleb128 .L49-.LFB4726
	.uleb128 0
	.uleb128 .LEHB5-.LFB4726
	.uleb128 .LEHE5-.LEHB5
	.uleb128 .L50-.LFB4726
	.uleb128 0
	.uleb128 .LEHB6-.LFB4726
	.uleb128 .LEHE6-.LEHB6
	.uleb128 .L51-.LFB4726
	.uleb128 0
	.uleb128 .LEHB7-.LFB4726
	.uleb128 .LEHE7-.LEHB7
	.uleb128 .L52-.LFB4726
	.uleb128 0
	.uleb128 .LEHB8-.LFB4726
	.uleb128 .LEHE8-.LEHB8
	.uleb128 .L53-.LFB4726
	.uleb128 0
	.uleb128 .LEHB9-.LFB4726
	.uleb128 .LEHE9-.LEHB9
	.uleb128 .L54-.LFB4726
	.uleb128 0
	.uleb128 .LEHB10-.LFB4726
	.uleb128 .LEHE10-.LEHB10
	.uleb128 .L55-.LFB4726
	.uleb128 0
	.uleb128 .LEHB11-.LFB4726
	.uleb128 .LEHE11-.LEHB11
	.uleb128 .L56-.LFB4726
	.uleb128 0
	.uleb128 .LEHB12-.LFB4726
	.uleb128 .LEHE12-.LEHB12
	.uleb128 .L57-.LFB4726
	.uleb128 0
	.uleb128 .LEHB13-.LFB4726
	.uleb128 .LEHE13-.LEHB13
	.uleb128 0
	.uleb128 0
.LLSDACSE4726:
	.section	.text.startup
	.size	main, .-main
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC1:
	.long	1028443341
	.align 4
.LC2:
	.long	1084227584
	.align 4
.LC3:
	.long	1092616192
	.align 4
.LC4:
	.long	1065353216
	.align 4
.LC5:
	.long	1056964608
	.align 4
.LC6:
	.long	1075838976
	.align 4
.LC11:
	.long	1008981770
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC19:
	.long	1202590843
	.long	1065646817
	.hidden	DW.ref.__gxx_personality_v0
	.weak	DW.ref.__gxx_personality_v0
	.section	.data.rel.local.DW.ref.__gxx_personality_v0,"awG",@progbits,DW.ref.__gxx_personality_v0,comdat
	.align 8
	.type	DW.ref.__gxx_personality_v0, @object
	.size	DW.ref.__gxx_personality_v0, 8
DW.ref.__gxx_personality_v0:
	.quad	__gxx_personality_v0
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

// ME 759 Spring 2021 Final Project
// driver.cu
// Author: Jason Zhou


#include <hip/hip_runtime.h>
#include <cstdio>
#include <random>
#include <iostream>
#include <string>

#include "BWTerrain.cuh"

int main(int argc, char* argv[]) {
    // Note: Currently the minimum resolution tested to be working 0.05f
    // Experiments have shown that when goes below 0.05f, Bulldozing algorithm has flaws

    // declare a terrain with size 5 m x 5 m with resolution 0.05 m
    BWTerrain terrain = BWTerrain(5.f, 5.f, 0.05f);
    // declare a wheel with radius of 0.5 m, a width of 1 m, and a mass of 10 kg
    BWWheel wheel = BWWheel(0.5f, 1.f, 10.f);

    // initialize the wheel object
    wheel.Initialize(1.0f, 2.5f, 0.5f);
    // set z direction acceleration to -9.8, simulate gravity effect
    wheel.acc_z = -9.8;
    // single - wheel constant x direction velocity set to 0.5
    wheel.vel_x = 0.5;

    std::cout << "Terrain: " << terrain.Get_X_Size() << "," << terrain.Get_Y_Size() << "," << terrain.Get_Resolution()
              << std::endl;
    std::cout << "Wheel: " << wheel.Get_R() << "," << wheel.Get_W() << std::endl;

    // enable bulldozing effect - defaultly it's turned off
    terrain.Set_Bulldozing(false);

    // intialize the terrain
    terrain.Initialize();

    // perform simulation
    // step size set to 0.01 s
    // total simulation time is 5 s
    for (int i = 0; i < 500; i++) {
        wheel.Advance(0.01);
        terrain.Advance(0.01, &wheel);
        if (i < 10) {
            terrain.WriteOutput("ter-000" + std::to_string(i));
            wheel.WriteOutput("whe-000" + std::to_string(i));
        } else if (i < 100) {
            terrain.WriteOutput("ter-00" + std::to_string(i));
            wheel.WriteOutput("whe-00" + std::to_string(i));
        } else {
            terrain.WriteOutput("ter-0" + std::to_string(i));
            wheel.WriteOutput("whe-0" + std::to_string(i));
        }

        std::cout << "time: " << i * 0.01 << " s" << std::endl;
        std::cout << "wheel pos:" << wheel.pos_x << "," << wheel.pos_y << "," << wheel.pos_z << std::endl;
        std::cout << "wheel acc_z:" << wheel.acc_z << std::endl;
        std::cout << "==============================================" << std::endl;
    }

    // safely free up all GPU memory
    terrain.Destroy();
}
	.text
	.file	"driver.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.section	.rodata.cst4,"aM",@progbits,4
	.p2align	2, 0x0                          # -- Begin function main
.LCPI0_0:
	.long	0x40a00000                      # float 5
.LCPI0_1:
	.long	0x3d4ccccd                      # float 0.0500000007
.LCPI0_2:
	.long	0x3f000000                      # float 0.5
.LCPI0_3:
	.long	0x3f800000                      # float 1
.LCPI0_4:
	.long	0x41200000                      # float 10
.LCPI0_5:
	.long	0x40200000                      # float 2.5
.LCPI0_6:
	.long	0x3c23d70a                      # float 0.00999999977
	.section	.rodata.cst8,"aM",@progbits,8
	.p2align	3, 0x0
.LCPI0_7:
	.quad	0x3f847ae147ae147b              # double 0.01
	.text
	.globl	main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%r13
	.cfi_def_cfa_offset 40
	pushq	%r12
	.cfi_def_cfa_offset 48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	subq	$376, %rsp                      # imm = 0x178
	.cfi_def_cfa_offset 432
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	leaq	272(%rsp), %rbx
	movss	.LCPI0_0(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI0_1(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movq	%rbx, %rdi
	movaps	%xmm0, %xmm1
	callq	_ZN9BWTerrainC1Efff
	leaq	224(%rsp), %r14
	movss	.LCPI0_2(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI0_3(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movss	.LCPI0_4(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	movq	%r14, %rdi
	callq	_ZN7BWWheelC1Efff
	movss	.LCPI0_5(%rip), %xmm1           # xmm1 = mem[0],zero,zero,zero
	movq	%r14, %rdi
	movss	.LCPI0_3(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movss	.LCPI0_2(%rip), %xmm2           # xmm2 = mem[0],zero,zero,zero
	callq	_ZN7BWWheel10InitializeEfff
	movl	$-1055077171, 44(%r14)          # imm = 0xC11CCCCD
	movl	$1056964608, 24(%r14)           # imm = 0x3F000000
	movl	$_ZSt4cout, %edi
	movl	$.L.str, %esi
	movl	$9, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	(%rbx), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%rbx), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	8(%rbx), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.2, %esi
	movl	$7, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	(%r14), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	4(%r14), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movb	$0, 88(%rbx)
	movq	%rbx, %rdi
	callq	_ZN9BWTerrain10InitializeEv
	leaq	16(%rsp), %r12
	xorl	%r13d, %r13d
	movq	%rsp, %rbp
.LBB0_1:                                # =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movss	.LCPI0_6(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	callq	_ZN7BWWheel7AdvanceEf
	leaq	272(%rsp), %rdi
	movss	.LCPI0_6(%rip), %xmm0           # xmm0 = mem[0],zero,zero,zero
	movq	%r14, %rsi
	callq	_ZN9BWTerrain7AdvanceEfP7BWWheel
	cmpl	$9, %r13d
	ja	.LBB0_6
# %bb.2:                                # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%r12, (%rsp)
.Ltmp36:
	movl	$1, %esi
	movq	%rbp, %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp37:
# %bb.3:                                # %_ZNSt7__cxx119to_stringEi.exit
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	movl	$1, %esi
	movl	%r13d, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp39:
	movl	$.L.str.3, %ecx
	movl	$7, %r8d
	movq	%rbp, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp40:
# %bb.4:                                # %.noexc
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	leaq	208(%rsp), %rdi
	movq	%rdi, 192(%rsp)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB0_15
# %bb.5:                                # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, 192(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 208(%rsp)
	movq	8(%r15), %r14
	jmp	.LBB0_16
.LBB0_6:                                #   in Loop: Header=BB0_1 Depth=1
	cmpl	$99, %r13d
	ja	.LBB0_11
# %bb.7:                                # %.lr.ph.i.i67
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%r12, (%rsp)
.Ltmp18:
	movl	$2, %esi
	movq	%rbp, %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp19:
# %bb.8:                                # %_ZNSt7__cxx119to_stringEi.exit73
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	movl	$2, %esi
	movl	%r13d, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp21:
	movl	$.L.str.5, %ecx
	movl	$6, %r8d
	movq	%rbp, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp22:
# %bb.9:                                # %.noexc77
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	leaq	144(%rsp), %rdi
	movq	%rdi, 128(%rsp)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB0_28
# %bb.10:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i74
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, 128(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 144(%rsp)
	movq	8(%r15), %r14
	jmp	.LBB0_29
.LBB0_11:                               # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i118
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%r12, (%rsp)
.Ltmp0:
	movl	$3, %esi
	movq	%rbp, %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp1:
# %bb.12:                               # %_ZNSt7__cxx119to_stringEi.exit121
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	movl	$3, %esi
	movl	%r13d, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp3:
	movl	$.L.str.7, %ecx
	movl	$5, %r8d
	movq	%rbp, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp4:
# %bb.13:                               # %.noexc125
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	leaq	80(%rsp), %rdi
	movq	%rdi, 64(%rsp)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB0_38
# %bb.14:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i122
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, 64(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 80(%rsp)
	movq	8(%r15), %r14
	jmp	.LBB0_39
.LBB0_15:                               #   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %r14
	leaq	1(%r14), %rdx
	callq	memcpy@PLT
.LBB0_16:                               #   in Loop: Header=BB0_1 Depth=1
	movq	%r14, 200(%rsp)
	movq	%rbx, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp42:
	leaq	272(%rsp), %rdi
	leaq	192(%rsp), %rsi
	callq	_ZN9BWTerrain11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp43:
# %bb.17:                               #   in Loop: Header=BB0_1 Depth=1
	movq	192(%rsp), %rdi
	leaq	208(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_19
# %bb.18:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i33
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_19:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_21
# %bb.20:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i34
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_21:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit36
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%r12, (%rsp)
.Ltmp45:
	movl	$1, %esi
	movq	%rbp, %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp46:
# %bb.22:                               # %_ZNSt7__cxx119to_stringEi.exit43
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	movl	$1, %esi
	movl	%r13d, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp48:
	movl	$.L.str.4, %ecx
	movl	$7, %r8d
	movq	%rbp, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp49:
# %bb.23:                               # %.noexc47
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	leaq	176(%rsp), %rdi
	movq	%rdi, 160(%rsp)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB0_25
# %bb.24:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i44
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, 160(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 176(%rsp)
	movq	8(%r15), %r14
	jmp	.LBB0_26
.LBB0_25:                               #   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %r14
	leaq	1(%r14), %rdx
	callq	memcpy@PLT
.LBB0_26:                               #   in Loop: Header=BB0_1 Depth=1
	movq	%r14, 168(%rsp)
	movq	%rbx, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp51:
	leaq	224(%rsp), %r14
	movq	%r14, %rdi
	leaq	160(%rsp), %rsi
	callq	_ZN7BWWheel11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp52:
# %bb.27:                               #   in Loop: Header=BB0_1 Depth=1
	movq	160(%rsp), %rdi
	leaq	176(%rsp), %rax
	jmp	.LBB0_54
.LBB0_28:                               #   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %r14
	leaq	1(%r14), %rdx
	callq	memcpy@PLT
.LBB0_29:                               #   in Loop: Header=BB0_1 Depth=1
	movq	%r14, 136(%rsp)
	movq	%rbx, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp24:
	leaq	272(%rsp), %rdi
	leaq	128(%rsp), %rsi
	callq	_ZN9BWTerrain11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp25:
# %bb.30:                               #   in Loop: Header=BB0_1 Depth=1
	movq	128(%rsp), %rdi
	leaq	144(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_32
# %bb.31:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i79
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_32:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit81
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_34
# %bb.33:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i82
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_34:                               # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i88
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%r12, (%rsp)
.Ltmp27:
	movl	$2, %esi
	movq	%rbp, %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp28:
# %bb.35:                               # %_ZNSt7__cxx119to_stringEi.exit91
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	movl	$2, %esi
	movl	%r13d, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp30:
	movl	$.L.str.6, %ecx
	movl	$6, %r8d
	movq	%rbp, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp31:
# %bb.36:                               # %.noexc95
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	leaq	112(%rsp), %rdi
	movq	%rdi, 96(%rsp)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB0_48
# %bb.37:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i92
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, 96(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 112(%rsp)
	movq	8(%r15), %r14
	jmp	.LBB0_49
.LBB0_38:                               #   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %r14
	leaq	1(%r14), %rdx
	callq	memcpy@PLT
.LBB0_39:                               #   in Loop: Header=BB0_1 Depth=1
	movq	%r14, 72(%rsp)
	movq	%rbx, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp6:
	leaq	272(%rsp), %rdi
	leaq	64(%rsp), %rsi
	callq	_ZN9BWTerrain11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp7:
# %bb.40:                               #   in Loop: Header=BB0_1 Depth=1
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	cmpq	%rax, %rdi
	je	.LBB0_42
# %bb.41:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i127
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_42:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit129
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_44
# %bb.43:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i130
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_44:                               # %_ZNSt8__detail14__to_chars_lenIjEEjT_i.exit.i136
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%r12, (%rsp)
.Ltmp9:
	movl	$3, %esi
	movq	%rbp, %rdi
	movl	$45, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructEmc
.Ltmp10:
# %bb.45:                               # %_ZNSt7__cxx119to_stringEi.exit139
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	movl	$3, %esi
	movl	%r13d, %edx
	callq	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
.Ltmp12:
	movl	$.L.str.8, %ecx
	movl	$5, %r8d
	movq	%rbp, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmPKcm
.Ltmp13:
# %bb.46:                               # %.noexc143
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rax, %r15
	leaq	48(%rsp), %rdi
	movq	%rdi, 32(%rsp)
	movq	(%rax), %rsi
	movq	%rax, %rbx
	addq	$16, %rbx
	cmpq	%rbx, %rsi
	je	.LBB0_51
# %bb.47:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i140
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, 32(%rsp)
	movq	16(%r15), %rax
	movq	%rax, 48(%rsp)
	movq	8(%r15), %r14
	jmp	.LBB0_52
.LBB0_48:                               #   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %r14
	leaq	1(%r14), %rdx
	callq	memcpy@PLT
.LBB0_49:                               #   in Loop: Header=BB0_1 Depth=1
	movq	%r14, 104(%rsp)
	movq	%rbx, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp33:
	leaq	224(%rsp), %r14
	movq	%r14, %rdi
	leaq	96(%rsp), %rsi
	callq	_ZN7BWWheel11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp34:
# %bb.50:                               #   in Loop: Header=BB0_1 Depth=1
	movq	96(%rsp), %rdi
	leaq	112(%rsp), %rax
	jmp	.LBB0_54
.LBB0_51:                               #   in Loop: Header=BB0_1 Depth=1
	movq	8(%r15), %r14
	leaq	1(%r14), %rdx
	callq	memcpy@PLT
.LBB0_52:                               #   in Loop: Header=BB0_1 Depth=1
	movq	%r14, 40(%rsp)
	movq	%rbx, (%r15)
	movq	$0, 8(%r15)
	movb	$0, 16(%r15)
.Ltmp15:
	leaq	224(%rsp), %r14
	movq	%r14, %rdi
	leaq	32(%rsp), %rsi
	callq	_ZN7BWWheel11WriteOutputENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
.Ltmp16:
# %bb.53:                               #   in Loop: Header=BB0_1 Depth=1
	movq	32(%rsp), %rdi
	leaq	48(%rsp), %rax
.LBB0_54:                               #   in Loop: Header=BB0_1 Depth=1
	cmpq	%rax, %rdi
	je	.LBB0_56
# %bb.55:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i49
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_56:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit51
                                        #   in Loop: Header=BB0_1 Depth=1
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_58
# %bb.57:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i52
                                        #   in Loop: Header=BB0_1 Depth=1
	callq	_ZdlPv
.LBB0_58:                               #   in Loop: Header=BB0_1 Depth=1
	movl	$_ZSt4cout, %edi
	movl	$.L.str.9, %esi
	movl	$6, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	cvtsi2sd	%r13d, %xmm0
	mulsd	.LCPI0_7(%rip), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.10, %esi
	movl	$2, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	(%r15), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.11, %esi
	movl	$10, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	236(%rsp), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	240(%rsp), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movl	$.L.str.1, %esi
	movl	$1, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	244(%rsp), %xmm0
	movq	%r15, %rdi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.12, %esi
	movl	$12, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	xorps	%xmm0, %xmm0
	cvtss2sd	268(%rsp), %xmm0
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIdEERSoT_
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	-24(%rax), %rdi
	addq	%r15, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movq	%r15, %rdi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	movl	$_ZSt4cout, %edi
	movl	$.L.str.13, %esi
	movl	$46, %edx
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
	movq	_ZSt4cout(%rip), %rax
	movq	-24(%rax), %rdi
	movl	$_ZSt4cout, %eax
	addq	%rax, %rdi
	movl	$10, %esi
	callq	_ZNKSt9basic_iosIcSt11char_traitsIcEE5widenEc
	movsbl	%al, %esi
	movl	$_ZSt4cout, %edi
	callq	_ZNSo3putEc
	movq	%rax, %rdi
	callq	_ZNSo5flushEv
	incl	%r13d
	cmpl	$500, %r13d                     # imm = 0x1F4
	jne	.LBB0_1
# %bb.59:
	leaq	272(%rsp), %rdi
	callq	_ZN9BWTerrain7DestroyEv
	xorl	%eax, %eax
	addq	$376, %rsp                      # imm = 0x178
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%r12
	.cfi_def_cfa_offset 40
	popq	%r13
	.cfi_def_cfa_offset 32
	popq	%r14
	.cfi_def_cfa_offset 24
	popq	%r15
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	retq
.LBB0_60:
	.cfi_def_cfa_offset 432
.Ltmp11:
	jmp	.LBB0_67
.LBB0_61:
.Ltmp35:
	movq	%rax, %rbx
	movq	96(%rsp), %rdi
	leaq	112(%rsp), %rax
	jmp	.LBB0_80
.LBB0_62:
.Ltmp8:
	movq	%rax, %rbx
	movq	64(%rsp), %rdi
	leaq	80(%rsp), %rax
	jmp	.LBB0_80
.LBB0_63:
.Ltmp32:
	jmp	.LBB0_77
.LBB0_64:
.Ltmp5:
	jmp	.LBB0_77
.LBB0_65:
.Ltmp29:
	jmp	.LBB0_67
.LBB0_66:
.Ltmp2:
	jmp	.LBB0_67
.LBB0_68:
.Ltmp26:
	movq	%rax, %rbx
	movq	128(%rsp), %rdi
	leaq	144(%rsp), %rax
	jmp	.LBB0_80
.LBB0_69:
.Ltmp23:
	jmp	.LBB0_77
.LBB0_70:
.Ltmp20:
	jmp	.LBB0_67
.LBB0_71:
.Ltmp17:
	movq	%rax, %rbx
	movq	32(%rsp), %rdi
	leaq	48(%rsp), %rax
	jmp	.LBB0_80
.LBB0_72:
.Ltmp14:
	jmp	.LBB0_77
.LBB0_73:
.Ltmp38:
	jmp	.LBB0_67
.LBB0_74:
.Ltmp44:
	movq	%rax, %rbx
	movq	192(%rsp), %rdi
	leaq	208(%rsp), %rax
	jmp	.LBB0_80
.LBB0_75:
.Ltmp50:
	jmp	.LBB0_77
.LBB0_76:
.Ltmp41:
.LBB0_77:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit159
	movq	%rax, %rbx
	jmp	.LBB0_82
.LBB0_78:
.Ltmp47:
.LBB0_67:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.LBB0_79:
.Ltmp53:
	movq	%rax, %rbx
	movq	160(%rsp), %rdi
	leaq	176(%rsp), %rax
.LBB0_80:
	cmpq	%rax, %rdi
	je	.LBB0_82
# %bb.81:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i157
	callq	_ZdlPv
.LBB0_82:                               # %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit159
	movq	(%rsp), %rdi
	cmpq	%r12, %rdi
	je	.LBB0_84
# %bb.83:                               # %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i160
	callq	_ZdlPv
.LBB0_84:
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end0:
	.size	main, .Lfunc_end0-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table0:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp36-.Lfunc_begin0          #   Call between .Lfunc_begin0 and .Ltmp36
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp36-.Lfunc_begin0          # >> Call Site 2 <<
	.uleb128 .Ltmp37-.Ltmp36                #   Call between .Ltmp36 and .Ltmp37
	.uleb128 .Ltmp38-.Lfunc_begin0          #     jumps to .Ltmp38
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp39-.Lfunc_begin0          # >> Call Site 3 <<
	.uleb128 .Ltmp40-.Ltmp39                #   Call between .Ltmp39 and .Ltmp40
	.uleb128 .Ltmp41-.Lfunc_begin0          #     jumps to .Ltmp41
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp18-.Lfunc_begin0          # >> Call Site 4 <<
	.uleb128 .Ltmp19-.Ltmp18                #   Call between .Ltmp18 and .Ltmp19
	.uleb128 .Ltmp20-.Lfunc_begin0          #     jumps to .Ltmp20
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp21-.Lfunc_begin0          # >> Call Site 5 <<
	.uleb128 .Ltmp22-.Ltmp21                #   Call between .Ltmp21 and .Ltmp22
	.uleb128 .Ltmp23-.Lfunc_begin0          #     jumps to .Ltmp23
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 6 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 7 <<
	.uleb128 .Ltmp4-.Ltmp3                  #   Call between .Ltmp3 and .Ltmp4
	.uleb128 .Ltmp5-.Lfunc_begin0           #     jumps to .Ltmp5
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp4-.Lfunc_begin0           # >> Call Site 8 <<
	.uleb128 .Ltmp42-.Ltmp4                 #   Call between .Ltmp4 and .Ltmp42
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp42-.Lfunc_begin0          # >> Call Site 9 <<
	.uleb128 .Ltmp43-.Ltmp42                #   Call between .Ltmp42 and .Ltmp43
	.uleb128 .Ltmp44-.Lfunc_begin0          #     jumps to .Ltmp44
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp45-.Lfunc_begin0          # >> Call Site 10 <<
	.uleb128 .Ltmp46-.Ltmp45                #   Call between .Ltmp45 and .Ltmp46
	.uleb128 .Ltmp47-.Lfunc_begin0          #     jumps to .Ltmp47
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp48-.Lfunc_begin0          # >> Call Site 11 <<
	.uleb128 .Ltmp49-.Ltmp48                #   Call between .Ltmp48 and .Ltmp49
	.uleb128 .Ltmp50-.Lfunc_begin0          #     jumps to .Ltmp50
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp49-.Lfunc_begin0          # >> Call Site 12 <<
	.uleb128 .Ltmp51-.Ltmp49                #   Call between .Ltmp49 and .Ltmp51
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp51-.Lfunc_begin0          # >> Call Site 13 <<
	.uleb128 .Ltmp52-.Ltmp51                #   Call between .Ltmp51 and .Ltmp52
	.uleb128 .Ltmp53-.Lfunc_begin0          #     jumps to .Ltmp53
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp52-.Lfunc_begin0          # >> Call Site 14 <<
	.uleb128 .Ltmp24-.Ltmp52                #   Call between .Ltmp52 and .Ltmp24
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp24-.Lfunc_begin0          # >> Call Site 15 <<
	.uleb128 .Ltmp25-.Ltmp24                #   Call between .Ltmp24 and .Ltmp25
	.uleb128 .Ltmp26-.Lfunc_begin0          #     jumps to .Ltmp26
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp27-.Lfunc_begin0          # >> Call Site 16 <<
	.uleb128 .Ltmp28-.Ltmp27                #   Call between .Ltmp27 and .Ltmp28
	.uleb128 .Ltmp29-.Lfunc_begin0          #     jumps to .Ltmp29
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp30-.Lfunc_begin0          # >> Call Site 17 <<
	.uleb128 .Ltmp31-.Ltmp30                #   Call between .Ltmp30 and .Ltmp31
	.uleb128 .Ltmp32-.Lfunc_begin0          #     jumps to .Ltmp32
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp31-.Lfunc_begin0          # >> Call Site 18 <<
	.uleb128 .Ltmp6-.Ltmp31                 #   Call between .Ltmp31 and .Ltmp6
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp6-.Lfunc_begin0           # >> Call Site 19 <<
	.uleb128 .Ltmp7-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp7
	.uleb128 .Ltmp8-.Lfunc_begin0           #     jumps to .Ltmp8
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp9-.Lfunc_begin0           # >> Call Site 20 <<
	.uleb128 .Ltmp10-.Ltmp9                 #   Call between .Ltmp9 and .Ltmp10
	.uleb128 .Ltmp11-.Lfunc_begin0          #     jumps to .Ltmp11
	.byte	1                               #   On action: 1
	.uleb128 .Ltmp12-.Lfunc_begin0          # >> Call Site 21 <<
	.uleb128 .Ltmp13-.Ltmp12                #   Call between .Ltmp12 and .Ltmp13
	.uleb128 .Ltmp14-.Lfunc_begin0          #     jumps to .Ltmp14
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp13-.Lfunc_begin0          # >> Call Site 22 <<
	.uleb128 .Ltmp33-.Ltmp13                #   Call between .Ltmp13 and .Ltmp33
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp33-.Lfunc_begin0          # >> Call Site 23 <<
	.uleb128 .Ltmp34-.Ltmp33                #   Call between .Ltmp33 and .Ltmp34
	.uleb128 .Ltmp35-.Lfunc_begin0          #     jumps to .Ltmp35
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp34-.Lfunc_begin0          # >> Call Site 24 <<
	.uleb128 .Ltmp15-.Ltmp34                #   Call between .Ltmp34 and .Ltmp15
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp15-.Lfunc_begin0          # >> Call Site 25 <<
	.uleb128 .Ltmp16-.Ltmp15                #   Call between .Ltmp15 and .Ltmp16
	.uleb128 .Ltmp17-.Lfunc_begin0          #     jumps to .Ltmp17
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp16-.Lfunc_begin0          # >> Call Site 26 <<
	.uleb128 .Lfunc_end0-.Ltmp16            #   Call between .Ltmp16 and .Lfunc_end0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.byte	1                               # >> Action Record 1 <<
                                        #   Catch TypeInfo 1
	.byte	0                               #   No further actions
	.p2align	2, 0x0
                                        # >> Catch TypeInfos <<
	.long	0                               # TypeInfo 1
.Lttbase0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text.__clang_call_terminate,"axG",@progbits,__clang_call_terminate,comdat
	.hidden	__clang_call_terminate          # -- Begin function __clang_call_terminate
	.weak	__clang_call_terminate
	.type	__clang_call_terminate,@function
__clang_call_terminate:                 # @__clang_call_terminate
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	callq	__cxa_begin_catch
	callq	_ZSt9terminatev
.Lfunc_end1:
	.size	__clang_call_terminate, .Lfunc_end1-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.section	.text._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,"axG",@progbits,_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,comdat
	.weak	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_ # -- Begin function _ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.type	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_,@function
_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_: # @_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.cfi_startproc
# %bb.0:
                                        # kill: def $esi killed $esi def $rsi
	cmpl	$100, %edx
	jb	.LBB2_1
# %bb.2:                                # %.lr.ph.preheader
	decl	%esi
.LBB2_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movl	%edx, %eax
	imulq	$1374389535, %rax, %rax         # imm = 0x51EB851F
	shrq	$37, %rax
	imull	$100, %eax, %ecx
	movl	%edx, %r8d
	subl	%ecx, %r8d
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits+1(%r8,%r8), %cl
	movl	%esi, %r9d
	movb	%cl, (%rdi,%r9)
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits(%r8,%r8), %cl
	leal	-1(%rsi), %r8d
	movb	%cl, (%rdi,%r8)
	addl	$-2, %esi
	cmpl	$9999, %edx                     # imm = 0x270F
	movl	%eax, %edx
	ja	.LBB2_3
	jmp	.LBB2_4
.LBB2_1:
	movl	%edx, %eax
.LBB2_4:                                # %._crit_edge
	cmpl	$10, %eax
	jb	.LBB2_6
# %bb.5:
	movl	%eax, %eax
	leaq	(%rax,%rax), %rcx
	movl	%ecx, %ecx
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits+1(%rcx), %cl
	movb	%cl, 1(%rdi)
	movb	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits(%rax,%rax), %al
	jmp	.LBB2_7
.LBB2_6:
	orb	$48, %al
.LBB2_7:
	movb	%al, (%rdi)
	retq
.Lfunc_end2:
	.size	_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_, .Lfunc_end2-_ZNSt8__detail18__to_chars_10_implIjEEvPcjT_
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"Terrain: "
	.size	.L.str, 10

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	","
	.size	.L.str.1, 2

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Wheel: "
	.size	.L.str.2, 8

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"ter-000"
	.size	.L.str.3, 8

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"whe-000"
	.size	.L.str.4, 8

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"ter-00"
	.size	.L.str.5, 7

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"whe-00"
	.size	.L.str.6, 7

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"ter-0"
	.size	.L.str.7, 6

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"whe-0"
	.size	.L.str.8, 6

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"time: "
	.size	.L.str.9, 7

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	" s"
	.size	.L.str.10, 3

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"wheel pos:"
	.size	.L.str.11, 11

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"wheel acc_z:"
	.size	.L.str.12, 13

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"=============================================="
	.size	.L.str.13, 47

	.type	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits,@object # @__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits
	.section	.rodata.str1.16,"aMS",@progbits,1
	.p2align	4, 0x0
.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits:
	.asciz	"00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899"
	.size	.L__const._ZNSt8__detail18__to_chars_10_implIjEEvPcjT_.__digits, 201

	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __gxx_personality_v0
	.addrsig_sym _Unwind_Resume
	.addrsig_sym _ZSt4cout
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
