#include <stdio.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include "cs_header.h"

int 
cs_put_header( int fd, char coding, char opt, char m,
	int x, int y,
	int xb, int yb, int zb,
	int xc0, int yc0, int zc0,
	int xc1, int yc1, int zc1,
	int xc2, int yc2, int zc2,
	int xo, int yo, int zo,
	int xe, int ye, int ze,
	int xa, int ya,
	int edge_x, int edge_y,
	int md_x, int md_y, int md_z,
	int weight )
{
	int i ;
	struct cs_header csh ;

	memset( &csh, 0, sizeof( csh )) ;

	csh.coding = coding ;
	csh.coding_opt = opt ;
	csh.matrix = m ;

	csh.frame.x = htonl( x );
	csh.frame.y = htonl( y );

	csh.block.x = htonl( xb );
	csh.block.y = htonl( yb );
	csh.block.z = htonl( zb );

	csh.select[0].x = htonl( xc0 );
	csh.select[0].y = htonl( yc0 );
	csh.select[0].z = htonl( zc0 );

	csh.select[1].x = htonl( xc1 );
	csh.select[1].y = htonl( yc1 );
	csh.select[1].z = htonl( zc1 );

	csh.select[2].x = htonl( xc2 );
	csh.select[2].y = htonl( yc2 );
	csh.select[2].z = htonl( zc2 );

	csh.overlap.x = htonl( xo );
	csh.overlap.y = htonl( yo );
	csh.overlap.z = htonl( zo );

	csh.expand.x = htonl( xe );
	csh.expand.y = htonl( ye );
	csh.expand.z = htonl( ze );

	csh.md.x = htonl( md_x );
	csh.md.y = htonl( md_y );
	csh.md.z = htonl( md_z );

	csh.edge.x = htonl( edge_x );
	csh.edge.y = htonl( edge_y );

	csh.append.x = htonl( xa );
	csh.append.y = htonl( ya );

	csh.weight = htons( weight ) ;

	i = write ( fd, &csh, sizeof ( csh )) ;

	if ( i != sizeof ( csh ))
	{
		fprintf( stderr, "cs_put_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}
	return ( 1 ) ;
}

int 
cs_get_header( int fd, struct cs_header *cshp )
{
	int i ;

	i = read ( fd, cshp, sizeof ( *cshp )) ;

	if ( i != sizeof ( *cshp ))
	{
		fprintf( stderr, "cs_get_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}

	cshp->frame.x = ntohl( cshp->frame.x );
	cshp->frame.y = ntohl( cshp->frame.y );

	cshp->block.x = ntohl( cshp->block.x );
	cshp->block.y = ntohl( cshp->block.y );
	cshp->block.z = ntohl( cshp->block.z );

	for ( i = 0 ; i < CUBE_INFO_CNT ; i++ )
	{
		cshp->select[i].x = ntohl( cshp->select[i].x );
		cshp->select[i].y = ntohl( cshp->select[i].y );
		cshp->select[i].z = ntohl( cshp->select[i].z );
	}

	cshp->overlap.x = ntohl( cshp->overlap.x );
	cshp->overlap.y = ntohl( cshp->overlap.y );
	cshp->overlap.z = ntohl( cshp->overlap.z );

	cshp->expand.x = ntohl( cshp->expand.x );
	cshp->expand.y = ntohl( cshp->expand.y );
	cshp->expand.z = ntohl( cshp->expand.z );

	cshp->append.x = ntohl( cshp->append.x );
	cshp->append.y = ntohl( cshp->append.y );

	cshp->md.x = ntohl( cshp->md.x );
	cshp->md.y = ntohl( cshp->md.y );
	cshp->md.z = ntohl( cshp->md.z );

	cshp->edge.x = ntohl( cshp->edge.x );
	cshp->edge.y = ntohl( cshp->edge.y );

	cshp->weight = ntohs( cshp->weight ) ;

	return ( 1 ) ;
}

int 
cs_put_block_header( int fd, int random_l, int random_r )
{
	int i ;
	struct cs_block_header csh ;

	memset( &csh, 0, sizeof( csh )) ;

	csh.random_l = htonl( random_l ) ;
	csh.random_r = htonl( random_r ) ;

	i = write ( fd, &csh, sizeof ( csh )) ;

	if ( i != sizeof ( csh ))
	{
		fprintf( stderr, "cs_put_block_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}
	return ( 1 ) ;
}

int 
cs_get_block_header( int fd, struct cs_block_header *cshp )
{
	int i ;

	i = read ( fd, cshp, sizeof ( *cshp )) ;

	if ( i != sizeof ( *cshp ))
	{
		fprintf( stderr, "cs_get_block_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}

	cshp->random_l = ntohl( cshp->random_l );
	cshp->random_r = ntohl( cshp->random_r );

	return ( 1 ) ;
}

	.file	"tmpxft_002d08e5_00000000-6_cs_header.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2048:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2048:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"cs_put_header failed errno %d\n"
	.text
	.globl	_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii
	.type	_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii, @function
_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii:
.LFB2042:
	.cfi_startproc
	endbr64
	subq	$136, %rsp
	.cfi_def_cfa_offset 144
	movl	%esi, %eax
	xorl	%r10d, %r10d
	bswap	%r8d
	movq	%fs:40, %rsi
	movq	%rsi, 120(%rsp)
	xorl	%esi, %esi
	movb	%al, 4(%rsp)
	movl	144(%rsp), %eax
	bswap	%r9d
	movl	%r10d, 116(%rsp)
	leaq	4(%rsp), %rsi
	bswap	%eax
	movl	%eax, 16(%rsp)
	movl	152(%rsp), %eax
	movb	%dl, 5(%rsp)
	movl	$116, %edx
	bswap	%eax
	movl	%eax, 20(%rsp)
	movl	160(%rsp), %eax
	movb	%cl, 6(%rsp)
	bswap	%eax
	movl	%eax, 24(%rsp)
	movl	168(%rsp), %eax
	movl	%r8d, 8(%rsp)
	bswap	%eax
	movl	%eax, 28(%rsp)
	movl	176(%rsp), %eax
	movl	%r9d, 12(%rsp)
	bswap	%eax
	movl	%eax, 32(%rsp)
	movl	184(%rsp), %eax
	bswap	%eax
	movl	%eax, 36(%rsp)
	movl	192(%rsp), %eax
	bswap	%eax
	movl	%eax, 40(%rsp)
	movl	200(%rsp), %eax
	bswap	%eax
	movl	%eax, 44(%rsp)
	movl	208(%rsp), %eax
	bswap	%eax
	movl	%eax, 48(%rsp)
	movl	216(%rsp), %eax
	bswap	%eax
	movl	%eax, 52(%rsp)
	movl	224(%rsp), %eax
	bswap	%eax
	movl	%eax, 56(%rsp)
	movl	232(%rsp), %eax
	bswap	%eax
	movl	%eax, 60(%rsp)
	movl	240(%rsp), %eax
	bswap	%eax
	movl	%eax, 64(%rsp)
	movl	248(%rsp), %eax
	bswap	%eax
	movl	%eax, 68(%rsp)
	movl	256(%rsp), %eax
	bswap	%eax
	movl	%eax, 72(%rsp)
	movl	264(%rsp), %eax
	bswap	%eax
	movl	%eax, 76(%rsp)
	movl	272(%rsp), %eax
	bswap	%eax
	movl	%eax, 80(%rsp)
	movl	280(%rsp), %eax
	bswap	%eax
	movl	%eax, 84(%rsp)
	movl	320(%rsp), %eax
	bswap	%eax
	movl	%eax, 104(%rsp)
	movl	328(%rsp), %eax
	bswap	%eax
	movl	%eax, 108(%rsp)
	movl	336(%rsp), %eax
	bswap	%eax
	movl	%eax, 112(%rsp)
	movl	304(%rsp), %eax
	bswap	%eax
	movl	%eax, 96(%rsp)
	movl	312(%rsp), %eax
	bswap	%eax
	movl	%eax, 100(%rsp)
	movl	288(%rsp), %eax
	bswap	%eax
	movl	%eax, 88(%rsp)
	movl	296(%rsp), %eax
	bswap	%eax
	movl	%eax, 92(%rsp)
	movzwl	344(%rsp), %eax
	xchgb	%ah, %al
	movb	%al, 7(%rsp)
	call	write@PLT
	movq	%rax, %rdx
	movl	$1, %eax
	cmpl	$116, %edx
	je	.L2
	call	__errno_location@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC0(%rip), %rdx
	movl	(%rax), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	xorl	%eax, %eax
.L2:
	movq	120(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L4
	call	__stack_chk_fail@PLT
.L4:
	addq	$136, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2042:
	.size	_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii, .-_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii
	.section	.rodata.str1.1
.LC1:
	.string	"cs_get_header failed errno %d\n"
	.text
	.globl	_Z13cs_get_headeriP9cs_header
	.type	_Z13cs_get_headeriP9cs_header, @function
_Z13cs_get_headeriP9cs_header:
.LFB2043:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	orq	$-1, %rcx
	movl	$116, %edx
	movq	%rsi, %rbx
	call	__read_chk@PLT
	cmpl	$116, %eax
	je	.L10
	call	__errno_location@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC1(%rip), %rdx
	movl	(%rax), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	xorl	%eax, %eax
	jmp	.L9
.L10:
	movl	4(%rbx), %eax
	leaq	60(%rbx), %rcx
	bswap	%eax
	movl	%eax, 4(%rbx)
	movl	8(%rbx), %eax
	bswap	%eax
	movl	%eax, 8(%rbx)
	movl	12(%rbx), %eax
	bswap	%eax
	movl	%eax, 12(%rbx)
	movl	16(%rbx), %eax
	bswap	%eax
	movl	%eax, 16(%rbx)
	movl	20(%rbx), %eax
	bswap	%eax
	movl	%eax, 20(%rbx)
	leaq	24(%rbx), %rax
.L12:
	movl	(%rax), %edx
	addq	$12, %rax
	bswap	%edx
	movl	%edx, -12(%rax)
	movl	-8(%rax), %edx
	bswap	%edx
	movl	%edx, -8(%rax)
	movl	-4(%rax), %edx
	bswap	%edx
	movl	%edx, -4(%rax)
	cmpq	%rax, %rcx
	jne	.L12
	movl	60(%rbx), %eax
	bswap	%eax
	movl	%eax, 60(%rbx)
	movl	64(%rbx), %eax
	bswap	%eax
	movl	%eax, 64(%rbx)
	movl	68(%rbx), %eax
	bswap	%eax
	movl	%eax, 68(%rbx)
	movl	72(%rbx), %eax
	bswap	%eax
	movl	%eax, 72(%rbx)
	movl	76(%rbx), %eax
	bswap	%eax
	movl	%eax, 76(%rbx)
	movl	80(%rbx), %eax
	bswap	%eax
	movl	%eax, 80(%rbx)
	movl	84(%rbx), %eax
	bswap	%eax
	movl	%eax, 84(%rbx)
	movl	88(%rbx), %eax
	bswap	%eax
	movl	%eax, 88(%rbx)
	movl	100(%rbx), %eax
	bswap	%eax
	movl	%eax, 100(%rbx)
	movl	104(%rbx), %eax
	bswap	%eax
	movl	%eax, 104(%rbx)
	movl	108(%rbx), %eax
	bswap	%eax
	movl	%eax, 108(%rbx)
	movl	92(%rbx), %eax
	bswap	%eax
	movl	%eax, 92(%rbx)
	movl	96(%rbx), %eax
	bswap	%eax
	movl	%eax, 96(%rbx)
	movsbw	3(%rbx), %ax
	xchgb	%ah, %al
	movb	%al, 3(%rbx)
	movl	$1, %eax
.L9:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2043:
	.size	_Z13cs_get_headeriP9cs_header, .-_Z13cs_get_headeriP9cs_header
	.section	.rodata.str1.1
.LC2:
	.string	"cs_put_block_header failed errno %d\n"
	.text
	.globl	_Z19cs_put_block_headeriii
	.type	_Z19cs_put_block_headeriii, @function
_Z19cs_put_block_headeriii:
.LFB2044:
	.cfi_startproc
	endbr64
	subq	$40, %rsp
	.cfi_def_cfa_offset 48
	xorl	%ecx, %ecx
	bswap	%esi
	bswap	%edx
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rax
	movl	%esi, 12(%rsp)
	movl	%edx, 8(%rsp)
	movq	%rax, %rsi
	movl	$16, %edx
	movq	%rcx, 16(%rsp)
	call	write@PLT
	movq	%rax, %rdx
	movl	$1, %eax
	cmpl	$16, %edx
	je	.L15
	call	__errno_location@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC2(%rip), %rdx
	movl	(%rax), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	xorl	%eax, %eax
.L15:
	movq	24(%rsp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	addq	$40, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2044:
	.size	_Z19cs_put_block_headeriii, .-_Z19cs_put_block_headeriii
	.section	.rodata.str1.1
.LC3:
	.string	"cs_get_block_header failed errno %d\n"
	.text
	.globl	_Z19cs_get_block_headeriP15cs_block_header
	.type	_Z19cs_get_block_headeriP15cs_block_header, @function
_Z19cs_get_block_headeriP15cs_block_header:
.LFB2045:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	orq	$-1, %rcx
	movl	$16, %edx
	movq	%rsi, %rbx
	call	__read_chk@PLT
	cmpl	$16, %eax
	je	.L22
	call	__errno_location@PLT
	movq	stderr(%rip), %rdi
	movl	$2, %esi
	leaq	.LC3(%rip), %rdx
	movl	(%rax), %ecx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	xorl	%eax, %eax
	jmp	.L21
.L22:
	movl	4(%rbx), %eax
	bswap	%eax
	movl	%eax, 4(%rbx)
	movl	(%rbx), %eax
	bswap	%eax
	movl	%eax, (%rbx)
	movl	$1, %eax
.L21:
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE2045:
	.size	_Z19cs_get_block_headeriP15cs_block_header, .-_Z19cs_get_block_headeriP15cs_block_header
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2071:
	.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
.LFE2071:
	.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
	.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 <stdio.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include "cs_header.h"

int 
cs_put_header( int fd, char coding, char opt, char m,
	int x, int y,
	int xb, int yb, int zb,
	int xc0, int yc0, int zc0,
	int xc1, int yc1, int zc1,
	int xc2, int yc2, int zc2,
	int xo, int yo, int zo,
	int xe, int ye, int ze,
	int xa, int ya,
	int edge_x, int edge_y,
	int md_x, int md_y, int md_z,
	int weight )
{
	int i ;
	struct cs_header csh ;

	memset( &csh, 0, sizeof( csh )) ;

	csh.coding = coding ;
	csh.coding_opt = opt ;
	csh.matrix = m ;

	csh.frame.x = htonl( x );
	csh.frame.y = htonl( y );

	csh.block.x = htonl( xb );
	csh.block.y = htonl( yb );
	csh.block.z = htonl( zb );

	csh.select[0].x = htonl( xc0 );
	csh.select[0].y = htonl( yc0 );
	csh.select[0].z = htonl( zc0 );

	csh.select[1].x = htonl( xc1 );
	csh.select[1].y = htonl( yc1 );
	csh.select[1].z = htonl( zc1 );

	csh.select[2].x = htonl( xc2 );
	csh.select[2].y = htonl( yc2 );
	csh.select[2].z = htonl( zc2 );

	csh.overlap.x = htonl( xo );
	csh.overlap.y = htonl( yo );
	csh.overlap.z = htonl( zo );

	csh.expand.x = htonl( xe );
	csh.expand.y = htonl( ye );
	csh.expand.z = htonl( ze );

	csh.md.x = htonl( md_x );
	csh.md.y = htonl( md_y );
	csh.md.z = htonl( md_z );

	csh.edge.x = htonl( edge_x );
	csh.edge.y = htonl( edge_y );

	csh.append.x = htonl( xa );
	csh.append.y = htonl( ya );

	csh.weight = htons( weight ) ;

	i = write ( fd, &csh, sizeof ( csh )) ;

	if ( i != sizeof ( csh ))
	{
		fprintf( stderr, "cs_put_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}
	return ( 1 ) ;
}

int 
cs_get_header( int fd, struct cs_header *cshp )
{
	int i ;

	i = read ( fd, cshp, sizeof ( *cshp )) ;

	if ( i != sizeof ( *cshp ))
	{
		fprintf( stderr, "cs_get_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}

	cshp->frame.x = ntohl( cshp->frame.x );
	cshp->frame.y = ntohl( cshp->frame.y );

	cshp->block.x = ntohl( cshp->block.x );
	cshp->block.y = ntohl( cshp->block.y );
	cshp->block.z = ntohl( cshp->block.z );

	for ( i = 0 ; i < CUBE_INFO_CNT ; i++ )
	{
		cshp->select[i].x = ntohl( cshp->select[i].x );
		cshp->select[i].y = ntohl( cshp->select[i].y );
		cshp->select[i].z = ntohl( cshp->select[i].z );
	}

	cshp->overlap.x = ntohl( cshp->overlap.x );
	cshp->overlap.y = ntohl( cshp->overlap.y );
	cshp->overlap.z = ntohl( cshp->overlap.z );

	cshp->expand.x = ntohl( cshp->expand.x );
	cshp->expand.y = ntohl( cshp->expand.y );
	cshp->expand.z = ntohl( cshp->expand.z );

	cshp->append.x = ntohl( cshp->append.x );
	cshp->append.y = ntohl( cshp->append.y );

	cshp->md.x = ntohl( cshp->md.x );
	cshp->md.y = ntohl( cshp->md.y );
	cshp->md.z = ntohl( cshp->md.z );

	cshp->edge.x = ntohl( cshp->edge.x );
	cshp->edge.y = ntohl( cshp->edge.y );

	cshp->weight = ntohs( cshp->weight ) ;

	return ( 1 ) ;
}

int 
cs_put_block_header( int fd, int random_l, int random_r )
{
	int i ;
	struct cs_block_header csh ;

	memset( &csh, 0, sizeof( csh )) ;

	csh.random_l = htonl( random_l ) ;
	csh.random_r = htonl( random_r ) ;

	i = write ( fd, &csh, sizeof ( csh )) ;

	if ( i != sizeof ( csh ))
	{
		fprintf( stderr, "cs_put_block_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}
	return ( 1 ) ;
}

int 
cs_get_block_header( int fd, struct cs_block_header *cshp )
{
	int i ;

	i = read ( fd, cshp, sizeof ( *cshp )) ;

	if ( i != sizeof ( *cshp ))
	{
		fprintf( stderr, "cs_get_block_header failed errno %d\n", errno ) ;
		return ( 0 ) ;
	}

	cshp->random_l = ntohl( cshp->random_l );
	cshp->random_r = ntohl( cshp->random_r );

	return ( 1 ) ;
}

	.text
	.file	"cs_header.hip"
	.globl	_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii # -- Begin function _Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii
	.type	_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii,@function
_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii: # @_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$120, %rsp
	.cfi_def_cfa_offset 144
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movl	%esi, %eax
	leaq	4(%rsp), %rsi
	movl	$0, 112(%rsi)
	movb	%al, (%rsi)
	movb	%dl, 1(%rsi)
	movb	%cl, 2(%rsi)
	bswapl	%r8d
	movl	%r8d, 4(%rsi)
	bswapl	%r9d
	movl	%r9d, 8(%rsi)
	movl	144(%rsp), %eax
	bswapl	%eax
	movl	%eax, 12(%rsi)
	movl	152(%rsp), %eax
	bswapl	%eax
	movl	%eax, 16(%rsi)
	movl	160(%rsp), %eax
	bswapl	%eax
	movl	%eax, 20(%rsi)
	movl	168(%rsp), %eax
	bswapl	%eax
	movl	%eax, 24(%rsi)
	movl	176(%rsp), %eax
	bswapl	%eax
	movl	%eax, 28(%rsi)
	movl	184(%rsp), %eax
	bswapl	%eax
	movl	%eax, 32(%rsi)
	movl	192(%rsp), %eax
	bswapl	%eax
	movl	%eax, 36(%rsi)
	movl	200(%rsp), %eax
	bswapl	%eax
	movl	%eax, 40(%rsi)
	movl	208(%rsp), %eax
	bswapl	%eax
	movl	%eax, 44(%rsi)
	movl	216(%rsp), %eax
	bswapl	%eax
	movl	%eax, 48(%rsi)
	movl	224(%rsp), %eax
	bswapl	%eax
	movl	%eax, 52(%rsi)
	movl	232(%rsp), %eax
	bswapl	%eax
	movl	%eax, 56(%rsi)
	movl	240(%rsp), %eax
	bswapl	%eax
	movl	%eax, 60(%rsi)
	movl	248(%rsp), %eax
	bswapl	%eax
	movl	%eax, 64(%rsi)
	movl	256(%rsp), %eax
	bswapl	%eax
	movl	%eax, 68(%rsi)
	movl	264(%rsp), %eax
	bswapl	%eax
	movl	%eax, 72(%rsi)
	movl	272(%rsp), %eax
	bswapl	%eax
	movl	%eax, 76(%rsi)
	movl	280(%rsp), %eax
	bswapl	%eax
	movl	%eax, 80(%rsi)
	movl	320(%rsp), %eax
	bswapl	%eax
	movl	%eax, 100(%rsi)
	movl	328(%rsp), %eax
	bswapl	%eax
	movl	%eax, 104(%rsi)
	movl	336(%rsp), %eax
	bswapl	%eax
	movl	%eax, 108(%rsi)
	movl	304(%rsp), %eax
	bswapl	%eax
	movl	%eax, 92(%rsi)
	movl	312(%rsp), %eax
	bswapl	%eax
	movl	%eax, 96(%rsi)
	movl	288(%rsp), %eax
	bswapl	%eax
	movl	%eax, 84(%rsi)
	movl	296(%rsp), %eax
	bswapl	%eax
	movl	%eax, 88(%rsi)
	movb	345(%rsp), %al
	movb	%al, 3(%rsi)
	movl	$116, %edx
	callq	write
	movl	$1, %ebx
	cmpl	$116, %eax
	jne	.LBB0_1
.LBB0_2:
	movl	%ebx, %eax
	addq	$120, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB0_1:
	.cfi_def_cfa_offset 144
	movq	stderr(%rip), %r14
	callq	__errno_location
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movl	$.L.str, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB0_2
.Lfunc_end0:
	.size	_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii, .Lfunc_end0-_Z13cs_put_headericcciiiiiiiiiiiiiiiiiiiiiiiiiiii
	.cfi_endproc
                                        # -- End function
	.globl	_Z13cs_get_headeriP9cs_header   # -- Begin function _Z13cs_get_headeriP9cs_header
	.type	_Z13cs_get_headeriP9cs_header,@function
_Z13cs_get_headeriP9cs_header:          # @_Z13cs_get_headeriP9cs_header
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %rbx
	movl	$116, %edx
	callq	read
	cmpl	$116, %eax
	jne	.LBB1_1
# %bb.2:
	movl	4(%rbx), %eax
	movl	8(%rbx), %ecx
	bswapl	%eax
	movl	%eax, 4(%rbx)
	bswapl	%ecx
	movl	%ecx, 8(%rbx)
	movl	12(%rbx), %eax
	bswapl	%eax
	movl	%eax, 12(%rbx)
	movl	16(%rbx), %eax
	bswapl	%eax
	movl	%eax, 16(%rbx)
	movl	20(%rbx), %eax
	bswapl	%eax
	movl	%eax, 20(%rbx)
	xorl	%eax, %eax
.LBB1_3:                                # =>This Inner Loop Header: Depth=1
	movl	24(%rbx,%rax), %ecx
	movl	28(%rbx,%rax), %edx
	bswapl	%ecx
	movl	%ecx, 24(%rbx,%rax)
	bswapl	%edx
	movl	%edx, 28(%rbx,%rax)
	movl	32(%rbx,%rax), %ecx
	bswapl	%ecx
	movl	%ecx, 32(%rbx,%rax)
	addq	$12, %rax
	cmpq	$36, %rax
	jne	.LBB1_3
# %bb.4:
	movl	60(%rbx), %eax
	movl	64(%rbx), %ecx
	bswapl	%eax
	movl	%eax, 60(%rbx)
	bswapl	%ecx
	movl	%ecx, 64(%rbx)
	movl	68(%rbx), %eax
	bswapl	%eax
	movl	%eax, 68(%rbx)
	movl	72(%rbx), %eax
	bswapl	%eax
	movl	%eax, 72(%rbx)
	movl	76(%rbx), %eax
	bswapl	%eax
	movl	%eax, 76(%rbx)
	movl	80(%rbx), %eax
	bswapl	%eax
	movl	%eax, 80(%rbx)
	movl	84(%rbx), %eax
	bswapl	%eax
	movl	%eax, 84(%rbx)
	movl	88(%rbx), %eax
	bswapl	%eax
	movl	%eax, 88(%rbx)
	movl	100(%rbx), %eax
	bswapl	%eax
	movl	%eax, 100(%rbx)
	movl	104(%rbx), %eax
	bswapl	%eax
	movl	%eax, 104(%rbx)
	movl	108(%rbx), %eax
	bswapl	%eax
	movl	%eax, 108(%rbx)
	movl	92(%rbx), %eax
	bswapl	%eax
	movl	%eax, 92(%rbx)
	movl	96(%rbx), %eax
	bswapl	%eax
	movl	%eax, 96(%rbx)
	sarb	$7, 3(%rbx)
	movl	$1, %ebx
.LBB1_5:
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB1_1:
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %r14
	callq	__errno_location
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movl	$.L.str.1, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_5
.Lfunc_end1:
	.size	_Z13cs_get_headeriP9cs_header, .Lfunc_end1-_Z13cs_get_headeriP9cs_header
	.cfi_endproc
                                        # -- End function
	.globl	_Z19cs_put_block_headeriii      # -- Begin function _Z19cs_put_block_headeriii
	.type	_Z19cs_put_block_headeriii,@function
_Z19cs_put_block_headeriii:             # @_Z19cs_put_block_headeriii
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	leaq	8(%rsp), %rax
	movq	$0, 8(%rax)
	bswapl	%esi
	movl	%esi, 4(%rax)
	bswapl	%edx
	movl	%edx, (%rax)
	movl	$16, %edx
	movq	%rax, %rsi
	callq	write
	movl	$1, %ebx
	cmpl	$16, %eax
	jne	.LBB2_1
.LBB2_2:
	movl	%ebx, %eax
	addq	$24, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB2_1:
	.cfi_def_cfa_offset 48
	movq	stderr(%rip), %r14
	callq	__errno_location
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movl	$.L.str.2, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB2_2
.Lfunc_end2:
	.size	_Z19cs_put_block_headeriii, .Lfunc_end2-_Z19cs_put_block_headeriii
	.cfi_endproc
                                        # -- End function
	.globl	_Z19cs_get_block_headeriP15cs_block_header # -- Begin function _Z19cs_get_block_headeriP15cs_block_header
	.type	_Z19cs_get_block_headeriP15cs_block_header,@function
_Z19cs_get_block_headeriP15cs_block_header: # @_Z19cs_get_block_headeriP15cs_block_header
	.cfi_startproc
# %bb.0:
	pushq	%r14
	.cfi_def_cfa_offset 16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	pushq	%rax
	.cfi_def_cfa_offset 32
	.cfi_offset %rbx, -24
	.cfi_offset %r14, -16
	movq	%rsi, %rbx
	movl	$16, %edx
	callq	read
	cmpl	$16, %eax
	jne	.LBB3_1
# %bb.2:
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	bswapl	%ecx
	movl	%ecx, 4(%rbx)
	bswapl	%eax
	movl	%eax, (%rbx)
	movl	$1, %ebx
.LBB3_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	retq
.LBB3_1:
	.cfi_def_cfa_offset 32
	movq	stderr(%rip), %r14
	callq	__errno_location
	movl	(%rax), %edx
	xorl	%ebx, %ebx
	movl	$.L.str.3, %esi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB3_3
.Lfunc_end3:
	.size	_Z19cs_get_block_headeriP15cs_block_header, .Lfunc_end3-_Z19cs_get_block_headeriP15cs_block_header
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"cs_put_header failed errno %d\n"
	.size	.L.str, 31

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"cs_get_header failed errno %d\n"
	.size	.L.str.1, 31

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"cs_put_block_header failed errno %d\n"
	.size	.L.str.2, 37

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"cs_get_block_header failed errno %d\n"
	.size	.L.str.3, 37

	.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 __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
