#include <iostream>
#include <chrono>

constexpr size_t kSize = 1000000;

class Stopwatch {
public:
  using TimePoint = decltype(std::chrono::high_resolution_clock::now());
  Stopwatch(): start(std::chrono::high_resolution_clock::now()) {}
  ~Stopwatch() {
    end = std::chrono::high_resolution_clock::now();
    std::cout << std::chrono::duration_cast<std::chrono::microseconds>(end - start).count()
              << " us\n";
  }
private:
  TimePoint start;
  TimePoint end;
};


void Transfer0(float* orig, float* target0, float* target1, float* target2) {
  cudaMemcpy(target0, orig, kSize * sizeof(float), cudaMemcpyHostToDevice);
  cudaMemcpy(target1, orig, kSize * sizeof(float), cudaMemcpyHostToDevice);
  cudaMemcpy(target2, orig, kSize * sizeof(float), cudaMemcpyHostToDevice);
};

void Transfer1(float* orig, float* target0, float* target1, float* target2) {
  cudaStream_t stream[3];
  float* targets[3] = {target0, target1, target2};
  for (int i = 0; i < 3; ++i) {
    cudaStreamCreate(&stream[i]);
  }

  for (int i = 0; i < 3; ++i) {
    cudaMemcpyAsync(targets[i], orig, kSize * sizeof(float), cudaMemcpyHostToDevice, stream[i]);
  }

  for (int i = 0; i < 3; ++i) {
    cudaStreamDestroy(stream[i]);
  }
};

int main() {
  float* original = new float[kSize];
  float* target0, *target1, *target2;

  cudaMalloc(&target0, sizeof(float) * kSize);
  cudaMalloc(&target1, sizeof(float) * kSize);
  cudaMalloc(&target2, sizeof(float) * kSize);

  {
    Stopwatch s;
    Transfer0(original, target0, target1, target2);
  }

  {
    Stopwatch s;
    Transfer1(original, target0, target1, target2);
  }

  cudaFree(target0);
  cudaFree(target1);
  cudaFree(target2);
  
  return 0;
}
	.file	"tmpxft_001ff5b6_00000000-6_cuda-async-copy.cudafe1.cpp"
	.text
#APP
	.globl _ZSt21ios_base_library_initv

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB3746:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE3746:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata._ZN9StopwatchD2Ev.str1.1,"aMS",@progbits,1
.LC0:
	.string	" us\n"
	.section	.text._ZN9StopwatchD2Ev,"axG",@progbits,_ZN9StopwatchD5Ev,comdat
	.align 2
	.weak	_ZN9StopwatchD2Ev
	.type	_ZN9StopwatchD2Ev, @function
_ZN9StopwatchD2Ev:
.LFB3739:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3739
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	%rdi, %rbx
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movl	$1000, %ecx
	leaq	_ZSt4cout(%rip), %rdi
	movq	%rax, 8(%rbx)
	subq	(%rbx), %rax
	cqto
	idivq	%rcx
	movq	%rax, %rsi
	call	_ZNSo9_M_insertIlEERSoT_@PLT
	movl	$4, %edx
	leaq	.LC0(%rip), %rsi
	movq	%rax, %rdi
	call	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@PLT
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3739:
	.globl	__gxx_personality_v0
	.section	.gcc_except_table._ZN9StopwatchD2Ev,"aG",@progbits,_ZN9StopwatchD5Ev,comdat
.LLSDA3739:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3739-.LLSDACSB3739
.LLSDACSB3739:
.LLSDACSE3739:
	.section	.text._ZN9StopwatchD2Ev,"axG",@progbits,_ZN9StopwatchD5Ev,comdat
	.size	_ZN9StopwatchD2Ev, .-_ZN9StopwatchD2Ev
	.weak	_ZN9StopwatchD1Ev
	.set	_ZN9StopwatchD1Ev,_ZN9StopwatchD2Ev
	.text
	.globl	_Z9Transfer0PfS_S_S_
	.type	_Z9Transfer0PfS_S_S_, @function
_Z9Transfer0PfS_S_S_:
.LFB3741:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdx, %r12
	movl	$4000000, %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rcx, %rbp
	movl	$1, %ecx
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	movq	%rbx, %rsi
	call	cudaMemcpy@PLT
	movq	%rbx, %rsi
	movq	%r12, %rdi
	movl	$1, %ecx
	movl	$4000000, %edx
	call	cudaMemcpy@PLT
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	popq	%rbx
	.cfi_def_cfa_offset 24
	movl	$1, %ecx
	popq	%rbp
	.cfi_def_cfa_offset 16
	movl	$4000000, %edx
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	cudaMemcpy@PLT
	.cfi_endproc
.LFE3741:
	.size	_Z9Transfer0PfS_S_S_, .-_Z9Transfer0PfS_S_S_
	.globl	_Z9Transfer1PfS_S_S_
	.type	_Z9Transfer1PfS_S_S_, @function
_Z9Transfer1PfS_S_S_:
.LFB3742:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	xorl	%ebx, %ebx
	subq	$64, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r12
	movq	%rsi, 32(%rsp)
	movq	%r12, %rdi
	movq	%rdx, 40(%rsp)
	movq	%rcx, 48(%rsp)
	call	cudaStreamCreate@PLT
	leaq	16(%rsp), %rdi
	call	cudaStreamCreate@PLT
	leaq	24(%rsp), %rdi
	call	cudaStreamCreate@PLT
.L7:
	movq	32(%rsp,%rbx), %rdi
	movq	(%r12,%rbx), %r8
	movl	$1, %ecx
	movq	%rbp, %rsi
	movl	$4000000, %edx
	addq	$8, %rbx
	call	cudaMemcpyAsync@PLT
	cmpq	$24, %rbx
	jne	.L7
	movq	8(%rsp), %rdi
	call	cudaStreamDestroy@PLT
	movq	16(%rsp), %rdi
	call	cudaStreamDestroy@PLT
	movq	24(%rsp), %rdi
	call	cudaStreamDestroy@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	addq	$64, %rsp
	.cfi_def_cfa_offset 32
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3742:
	.size	_Z9Transfer1PfS_S_S_, .-_Z9Transfer1PfS_S_S_
	.section	.text.startup,"ax",@progbits
	.globl	main
	.type	main, @function
main:
.LFB3743:
	.cfi_startproc
	.cfi_personality 0x9b,DW.ref.__gxx_personality_v0
	.cfi_lsda 0x1b,.LLSDA3743
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	$4000000, %edi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rbx
.LEHB0:
	call	_Znam@PLT
	movq	%rsp, %rdi
	movl	$4000000, %esi
	movq	%rax, %rbp
	call	cudaMalloc@PLT
	leaq	8(%rsp), %rdi
	movl	$4000000, %esi
	call	cudaMalloc@PLT
	leaq	16(%rsp), %rdi
	movl	$4000000, %esi
	call	cudaMalloc@PLT
.LEHE0:
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	xorl	%edx, %edx
	movq	16(%rsp), %rcx
	movq	(%rsp), %rsi
	movq	%rdx, 32(%rsp)
	movq	8(%rsp), %rdx
	movq	%rbp, %rdi
	movq	%rax, 24(%rsp)
.LEHB1:
	call	_Z9Transfer0PfS_S_S_
.LEHE1:
	movq	%rbx, %rdi
	call	_ZN9StopwatchD1Ev
	call	_ZNSt6chrono3_V212system_clock3nowEv@PLT
	movq	16(%rsp), %rcx
	movq	8(%rsp), %rdx
	movq	%rbp, %rdi
	movq	(%rsp), %rsi
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	movq	%rax, 32(%rsp)
.LEHB2:
	call	_Z9Transfer1PfS_S_S_
.LEHE2:
	movq	%rbx, %rdi
	call	_ZN9StopwatchD1Ev
	movq	(%rsp), %rdi
.LEHB3:
	call	cudaFree@PLT
	movq	8(%rsp), %rdi
	call	cudaFree@PLT
	movq	16(%rsp), %rdi
	call	cudaFree@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	je	.L17
	jmp	.L20
.L18:
	endbr64
	jmp	.L23
.L19:
	endbr64
.L23:
	movq	%rax, %rbp
.L15:
	movq	%rbx, %rdi
	call	_ZN9StopwatchD1Ev
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	movq	%rbp, %rdi
	call	_Unwind_Resume@PLT
.LEHE3:
.L20:
	call	__stack_chk_fail@PLT
.L17:
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE3743:
	.section	.gcc_except_table,"a",@progbits
.LLSDA3743:
	.byte	0xff
	.byte	0xff
	.byte	0x1
	.uleb128 .LLSDACSE3743-.LLSDACSB3743
.LLSDACSB3743:
	.uleb128 .LEHB0-.LFB3743
	.uleb128 .LEHE0-.LEHB0
	.uleb128 0
	.uleb128 0
	.uleb128 .LEHB1-.LFB3743
	.uleb128 .LEHE1-.LEHB1
	.uleb128 .L18-.LFB3743
	.uleb128 0
	.uleb128 .LEHB2-.LFB3743
	.uleb128 .LEHE2-.LEHB2
	.uleb128 .L19-.LFB3743
	.uleb128 0
	.uleb128 .LEHB3-.LFB3743
	.uleb128 .LEHE3-.LEHB3
	.uleb128 0
	.uleb128 0
.LLSDACSE3743:
	.section	.text.startup
	.size	main, .-main
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB3769:
	.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
.LFE3769:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.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
	.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:


#include <hip/hip_runtime.h>
#include <iostream>
#include <chrono>

constexpr size_t kSize = 1000000;

class Stopwatch {
public:
  using TimePoint = decltype(std::chrono::high_resolution_clock::now());
  Stopwatch(): start(std::chrono::high_resolution_clock::now()) {}
  ~Stopwatch() {
    end = std::chrono::high_resolution_clock::now();
    std::cout << std::chrono::duration_cast<std::chrono::microseconds>(end - start).count()
              << " us\n";
  }
private:
  TimePoint start;
  TimePoint end;
};


void Transfer0(float* orig, float* target0, float* target1, float* target2) {
  hipMemcpy(target0, orig, kSize * sizeof(float), hipMemcpyHostToDevice);
  hipMemcpy(target1, orig, kSize * sizeof(float), hipMemcpyHostToDevice);
  hipMemcpy(target2, orig, kSize * sizeof(float), hipMemcpyHostToDevice);
};

void Transfer1(float* orig, float* target0, float* target1, float* target2) {
  hipStream_t stream[3];
  float* targets[3] = {target0, target1, target2};
  for (int i = 0; i < 3; ++i) {
    hipStreamCreate(&stream[i]);
  }

  for (int i = 0; i < 3; ++i) {
    hipMemcpyAsync(targets[i], orig, kSize * sizeof(float), hipMemcpyHostToDevice, stream[i]);
  }

  for (int i = 0; i < 3; ++i) {
    hipStreamDestroy(stream[i]);
  }
};

int main() {
  float* original = new float[kSize];
  float* target0, *target1, *target2;

  hipMalloc(&target0, sizeof(float) * kSize);
  hipMalloc(&target1, sizeof(float) * kSize);
  hipMalloc(&target2, sizeof(float) * kSize);

  {
    Stopwatch s;
    Transfer0(original, target0, target1, target2);
  }

  {
    Stopwatch s;
    Transfer1(original, target0, target1, target2);
  }

  hipFree(target0);
  hipFree(target1);
  hipFree(target2);
  
  return 0;
}
	.text
	.file	"cuda-async-copy.hip"
                                        # Start of file scope inline assembly
	.globl	_ZSt21ios_base_library_initv

                                        # End of file scope inline assembly
	.globl	_Z9Transfer0PfS_S_S_            # -- Begin function _Z9Transfer0PfS_S_S_
	.type	_Z9Transfer0PfS_S_S_,@function
_Z9Transfer0PfS_S_S_:                   # @_Z9Transfer0PfS_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movq	%rcx, %rbx
	movq	%rdx, %r14
	movq	%rdi, %r15
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rsi, %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	callq	hipMemcpy
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movl	$1, %ecx
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	jmp	hipMemcpy                       # TAILCALL
.Lfunc_end0:
	.size	_Z9Transfer0PfS_S_S_, .Lfunc_end0-_Z9Transfer0PfS_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	_Z9Transfer1PfS_S_S_            # -- Begin function _Z9Transfer1PfS_S_S_
	.type	_Z9Transfer1PfS_S_S_,@function
_Z9Transfer1PfS_S_S_:                   # @_Z9Transfer1PfS_S_S_
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$56, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rdi, %rbx
	movq	%rsi, (%rsp)
	movq	%rdx, 8(%rsp)
	movq	%rcx, 16(%rsp)
	xorl	%r14d, %r14d
.LBB1_1:                                # =>This Inner Loop Header: Depth=1
	leaq	(%rsp,%r14), %rdi
	addq	$32, %rdi
	callq	hipStreamCreate
	addq	$8, %r14
	cmpq	$24, %r14
	jne	.LBB1_1
# %bb.2:                                # %.preheader15.preheader
	xorl	%r14d, %r14d
.LBB1_3:                                # %.preheader15
                                        # =>This Inner Loop Header: Depth=1
	movq	(%rsp,%r14,8), %rdi
	movq	32(%rsp,%r14,8), %r8
	movl	$4000000, %edx                  # imm = 0x3D0900
	movq	%rbx, %rsi
	movl	$1, %ecx
	callq	hipMemcpyAsync
	incq	%r14
	cmpq	$3, %r14
	jne	.LBB1_3
# %bb.4:                                # %.preheader.preheader
	xorl	%ebx, %ebx
.LBB1_5:                                # %.preheader
                                        # =>This Inner Loop Header: Depth=1
	movq	32(%rsp,%rbx,8), %rdi
	callq	hipStreamDestroy
	incq	%rbx
	cmpq	$3, %rbx
	jne	.LBB1_5
# %bb.6:
	addq	$56, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end1:
	.size	_Z9Transfer1PfS_S_S_, .Lfunc_end1-_Z9Transfer1PfS_S_S_
	.cfi_endproc
                                        # -- End function
	.globl	main                            # -- Begin function main
	.type	main,@function
main:                                   # @main
.Lfunc_begin0:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception0
# %bb.0:
	pushq	%r15
	.cfi_def_cfa_offset 16
	pushq	%r14
	.cfi_def_cfa_offset 24
	pushq	%r12
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	subq	$40, %rsp
	.cfi_def_cfa_offset 80
	.cfi_offset %rbx, -40
	.cfi_offset %r12, -32
	.cfi_offset %r14, -24
	.cfi_offset %r15, -16
	movl	$4000000, %edi                  # imm = 0x3D0900
	callq	_Znam
	movq	%rax, %rbx
	leaq	32(%rsp), %r14
	movl	$4000000, %esi                  # imm = 0x3D0900
	movq	%r14, %rdi
	callq	hipMalloc
	leaq	24(%rsp), %r15
	movl	$4000000, %esi                  # imm = 0x3D0900
	movq	%r15, %rdi
	callq	hipMalloc
	leaq	16(%rsp), %r12
	movl	$4000000, %esi                  # imm = 0x3D0900
	movq	%r12, %rdi
	callq	hipMalloc
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, (%rsp)
	movq	$0, 8(%rsp)
	movq	(%r14), %rsi
	movq	(%r15), %rdx
	movq	(%r12), %rcx
.Ltmp0:
	movq	%rbx, %rdi
	callq	_Z9Transfer0PfS_S_S_
.Ltmp1:
# %bb.1:
	movq	%rsp, %r14
	movq	%r14, %rdi
	callq	_ZN9StopwatchD2Ev
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, (%r14)
	movq	$0, 8(%r14)
	movq	32(%rsp), %rsi
	movq	24(%rsp), %rdx
	movq	16(%rsp), %rcx
.Ltmp3:
	movq	%rbx, %rdi
	callq	_Z9Transfer1PfS_S_S_
.Ltmp4:
# %bb.2:
	movq	%rsp, %rdi
	callq	_ZN9StopwatchD2Ev
	movq	32(%rsp), %rdi
	callq	hipFree
	movq	24(%rsp), %rdi
	callq	hipFree
	movq	16(%rsp), %rdi
	callq	hipFree
	xorl	%eax, %eax
	addq	$40, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	retq
.LBB2_4:
	.cfi_def_cfa_offset 80
.Ltmp5:
	jmp	.LBB2_5
.LBB2_3:
.Ltmp2:
.LBB2_5:
	movq	%rax, %rbx
	movq	%rsp, %rdi
	callq	_ZN9StopwatchD2Ev
	movq	%rbx, %rdi
	callq	_Unwind_Resume@PLT
.Lfunc_end2:
	.size	main, .Lfunc_end2-main
	.cfi_endproc
	.section	.gcc_except_table,"a",@progbits
	.p2align	2, 0x0
GCC_except_table2:
.Lexception0:
	.byte	255                             # @LPStart Encoding = omit
	.byte	255                             # @TType Encoding = omit
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end0-.Lcst_begin0
.Lcst_begin0:
	.uleb128 .Lfunc_begin0-.Lfunc_begin0    # >> Call Site 1 <<
	.uleb128 .Ltmp0-.Lfunc_begin0           #   Call between .Lfunc_begin0 and .Ltmp0
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp0-.Lfunc_begin0           # >> Call Site 2 <<
	.uleb128 .Ltmp1-.Ltmp0                  #   Call between .Ltmp0 and .Ltmp1
	.uleb128 .Ltmp2-.Lfunc_begin0           #     jumps to .Ltmp2
	.byte	0                               #   On action: cleanup
	.uleb128 .Ltmp3-.Lfunc_begin0           # >> Call Site 3 <<
	.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 4 <<
	.uleb128 .Lfunc_end2-.Ltmp4             #   Call between .Ltmp4 and .Lfunc_end2
	.byte	0                               #     has no landing pad
	.byte	0                               #   On action: cleanup
.Lcst_end0:
	.p2align	2, 0x0
                                        # -- End function
	.section	.text._ZN9StopwatchD2Ev,"axG",@progbits,_ZN9StopwatchD2Ev,comdat
	.weak	_ZN9StopwatchD2Ev               # -- Begin function _ZN9StopwatchD2Ev
	.p2align	1, 0x90
	.type	_ZN9StopwatchD2Ev,@function
_ZN9StopwatchD2Ev:                      # @_ZN9StopwatchD2Ev
.Lfunc_begin1:
	.cfi_startproc
	.cfi_personality 3, __gxx_personality_v0
	.cfi_lsda 3, .Lexception1
# %bb.0:
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset %rbx, -16
	movq	%rdi, %rbx
	callq	_ZNSt6chrono3_V212system_clock3nowEv
	movq	%rax, 8(%rbx)
	subq	(%rbx), %rax
	movabsq	$2361183241434822607, %rcx      # imm = 0x20C49BA5E353F7CF
	imulq	%rcx
	movq	%rdx, %rsi
	shrq	$63, %rsi
	sarq	$7, %rdx
	addq	%rdx, %rsi
.Ltmp6:
	movl	$_ZSt4cout, %edi
	callq	_ZNSo9_M_insertIlEERSoT_
.Ltmp7:
# %bb.1:                                # %_ZNSolsEl.exit
.Ltmp8:
	movl	$.L.str, %esi
	movl	$4, %edx
	movq	%rax, %rdi
	callq	_ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
.Ltmp9:
# %bb.2:                                # %_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit
	popq	%rbx
	.cfi_def_cfa_offset 8
	retq
.LBB3_3:
	.cfi_def_cfa_offset 16
.Ltmp10:
	movq	%rax, %rdi
	callq	__clang_call_terminate
.Lfunc_end3:
	.size	_ZN9StopwatchD2Ev, .Lfunc_end3-_ZN9StopwatchD2Ev
	.cfi_endproc
	.section	.gcc_except_table._ZN9StopwatchD2Ev,"aG",@progbits,_ZN9StopwatchD2Ev,comdat
	.p2align	2, 0x0
GCC_except_table3:
.Lexception1:
	.byte	255                             # @LPStart Encoding = omit
	.byte	3                               # @TType Encoding = udata4
	.uleb128 .Lttbase0-.Lttbaseref0
.Lttbaseref0:
	.byte	1                               # Call site Encoding = uleb128
	.uleb128 .Lcst_end1-.Lcst_begin1
.Lcst_begin1:
	.uleb128 .Ltmp6-.Lfunc_begin1           # >> Call Site 1 <<
	.uleb128 .Ltmp9-.Ltmp6                  #   Call between .Ltmp6 and .Ltmp9
	.uleb128 .Ltmp10-.Lfunc_begin1          #     jumps to .Ltmp10
	.byte	1                               #   On action: 1
.Lcst_end1:
	.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_end4:
	.size	__clang_call_terminate, .Lfunc_end4-__clang_call_terminate
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	" us\n"
	.size	.L.str, 5

	.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
