/* $Id: print.c,v 1.1 2019/12/12 15:03:38 gbarbd Exp gbarbd $ */
#include <stdio.h>
#include <inttypes.h>

static int
is_little_endian(void) {
    int num = 1;
    return (*((char *)&num) == 1);
}

void
print_binary(char *fname, int num, double *u) {

    FILE *f_ptr;
    size_t written;
    size_t items = num*num*num;

    if ( (f_ptr = fopen(fname, "w")) == NULL ) {
       perror("No output! fopen()");
       return;
    }

    written = fwrite(u, sizeof(double), items, f_ptr);

    if ( written != items ) {
	    fprintf(stderr, "Writing failed:  only %lu of %lu items saved!\n",
		written, items);
    }

    fclose(f_ptr);
}

void
print_vtk(const char *fname, int n, double *u) {

    FILE *f_ptr;
    size_t written;
    size_t items = n * n * n;
    size_t i;
    int b;
    unsigned char tmp;

    if ( (f_ptr = fopen(fname, "w")) == NULL ) {
       perror("No output! fopen()");
       return;
    }

    // Write VTK file header
    fprintf(f_ptr, "# vtk DataFile Version 3.0\n");
    fprintf(f_ptr, "saved from function print_vtk.\n");
    fprintf(f_ptr, "BINARY\n");
    fprintf(f_ptr, "DATASET STRUCTURED_POINTS\n");
    fprintf(f_ptr, "DIMENSIONS %d %d %d\n", n, n, n);
    fprintf(f_ptr, "ORIGIN %d %d %d\n", 0, 0, 0);
    fprintf(f_ptr, "SPACING %d %d %d\n", 1, 1, 1);
    fprintf(f_ptr, "POINT_DATA %lu\n", items);
    fprintf(f_ptr, "SCALARS %s %s 1\n", "gray", "double");
    fprintf(f_ptr, "LOOKUP_TABLE default\n");

    if ( is_little_endian() ) {
        // System is little endian, so we need to reverse the byte order.
        written = 0;
        for (i = 0; i < items; ++i) {
            uint64_t crnt = *(uint64_t *)(u + i); // Get double as int

            // Reverse byte order and write to file
            crnt = (crnt & 0x00000000FFFFFFFF) << 32 | (crnt & 0xFFFFFFFF00000000) >> 32;
            crnt = (crnt & 0x0000FFFF0000FFFF) << 16 | (crnt & 0xFFFF0000FFFF0000) >> 16;
            crnt = (crnt & 0x00FF00FF00FF00FF) << 8  | (crnt & 0xFF00FF00FF00FF00) >> 8;
            written += fwrite(&crnt, sizeof(uint64_t), 1, f_ptr);
        }
    } else {
        // System is big endian, so just dump the data.
        written = fwrite(u, sizeof(double), items, f_ptr);
    }

    if ( written != items ) {
	    fprintf(stderr, "Writing failed:  only %lu of %lu items saved!\n",
		written, items);
    }

    fclose(f_ptr);
}

	.file	"tmpxft_0026d568_00000000-6_print.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2032:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2032:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"w"
.LC1:
	.string	"No output! fopen()"
.LC2:
	.string	"Writing failed:  only %lu of %lu items saved!\n"
	.text
	.globl	_Z12print_binaryPciPd
	.type	_Z12print_binaryPciPd, @function
_Z12print_binaryPciPd:
.LFB2028:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movq	%rdx, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movl	%esi, %ebx
	imull	%esi, %ebx
	imull	%esi, %ebx
	leaq	.LC0(%rip), %rsi
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L3
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	leaq	.LC1(%rip), %rdi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	perror@PLT
.L3:
	.cfi_restore_state
	movslq	%ebx, %rbx
	movq	%rax, %rcx
	movl	$8, %esi
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movq	%rax, %rbp
	call	fwrite@PLT
	movq	%rax, %rcx
	cmpq	%rax, %rbx
	je	.L4
	movq	stderr(%rip), %rdi
	movq	%rbx, %r8
	movl	$2, %esi
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	call	__fprintf_chk@PLT
.L4:
	popq	%rbx
	.cfi_def_cfa_offset 24
	movq	%rbp, %rdi
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	jmp	fclose@PLT
	.cfi_endproc
.LFE2028:
	.size	_Z12print_binaryPciPd, .-_Z12print_binaryPciPd
	.section	.rodata.str1.1
.LC3:
	.string	"# vtk DataFile Version 3.0\n"
.LC4:
	.string	"saved from function print_vtk.\n"
.LC5:
	.string	"BINARY\n"
.LC6:
	.string	"DATASET STRUCTURED_POINTS\n"
.LC7:
	.string	"DIMENSIONS %d %d %d\n"
.LC8:
	.string	"ORIGIN %d %d %d\n"
.LC9:
	.string	"SPACING %d %d %d\n"
.LC10:
	.string	"POINT_DATA %lu\n"
.LC11:
	.string	"double"
.LC12:
	.string	"gray"
.LC13:
	.string	"SCALARS %s %s 1\n"
.LC14:
	.string	"LOOKUP_TABLE default\n"
	.text
	.globl	_Z9print_vtkPKciPd
	.type	_Z9print_vtkPKciPd, @function
_Z9print_vtkPKciPd:
.LFB2029:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%esi, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	imull	%esi, %ebp
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	imull	%esi, %ebp
	leaq	.LC0(%rip), %rsi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	fopen@PLT
	testq	%rax, %rax
	jne	.L8
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	leaq	.LC1(%rip), %rdi
	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
	jmp	perror@PLT
.L8:
	.cfi_restore_state
	movq	%rax, %rbx
	movq	%rax, %rdi
	leaq	.LC3(%rip), %rdx
	xorl	%eax, %eax
	movl	$2, %esi
	movslq	%ebp, %rbp
	xorl	%r13d, %r13d
	movq	%rsp, %r15
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC4(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC5(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC6(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	%r12d, %r9d
	movl	%r12d, %r8d
	movl	%r12d, %ecx
	leaq	.LC7(%rip), %rdx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	movl	$2, %esi
	call	__fprintf_chk@PLT
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	leaq	.LC8(%rip), %rdx
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$1, %r9d
	movq	%rbx, %rdi
	xorl	%eax, %eax
	movl	$1, %r8d
	movl	$1, %ecx
	movl	$2, %esi
	leaq	.LC9(%rip), %rdx
	call	__fprintf_chk@PLT
	movq	%rbp, %rcx
	movl	$2, %esi
	movq	%rbx, %rdi
	leaq	.LC10(%rip), %rdx
	xorl	%eax, %eax
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC11(%rip), %r8
	leaq	.LC12(%rip), %rcx
	leaq	.LC13(%rip), %rdx
	call	__fprintf_chk@PLT
	movl	$2, %esi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	leaq	.LC14(%rip), %rdx
	call	__fprintf_chk@PLT
.L10:
	cmpq	%rbp, %r13
	jnb	.L17
	movq	(%r14,%r13,8), %rax
	movq	%rbx, %rcx
	movl	$1, %edx
	movq	%r15, %rdi
	movl	$8, %esi
	incq	%r13
	bswap	%rax
	movq	%rax, (%rsp)
	call	fwrite@PLT
	addq	%rax, %r12
	jmp	.L10
.L17:
	cmpq	%rbp, %r12
	je	.L12
	movq	stderr(%rip), %rdi
	movq	%rbp, %r8
	movq	%r12, %rcx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdx
	movl	$2, %esi
	call	__fprintf_chk@PLT
.L12:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	je	.L13
.L16:
	call	__stack_chk_fail@PLT
.L13:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	movq	%rbx, %rdi
	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
	jmp	fclose@PLT
	.cfi_endproc
.LFE2029:
	.size	_Z9print_vtkPKciPd, .-_Z9print_vtkPKciPd
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2055:
	.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
.LFE2055:
	.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:

/* $Id: print.c,v 1.1 2019/12/12 15:03:38 gbarbd Exp gbarbd $ */

#include <hip/hip_runtime.h>
#include <stdio.h>
#include <inttypes.h>

static int
is_little_endian(void) {
    int num = 1;
    return (*((char *)&num) == 1);
}

void
print_binary(char *fname, int num, double *u) {

    FILE *f_ptr;
    size_t written;
    size_t items = num*num*num;

    if ( (f_ptr = fopen(fname, "w")) == NULL ) {
       perror("No output! fopen()");
       return;
    }

    written = fwrite(u, sizeof(double), items, f_ptr);

    if ( written != items ) {
	    fprintf(stderr, "Writing failed:  only %lu of %lu items saved!\n",
		written, items);
    }

    fclose(f_ptr);
}

void
print_vtk(const char *fname, int n, double *u) {

    FILE *f_ptr;
    size_t written;
    size_t items = n * n * n;
    size_t i;
    int b;
    unsigned char tmp;

    if ( (f_ptr = fopen(fname, "w")) == NULL ) {
       perror("No output! fopen()");
       return;
    }

    // Write VTK file header
    fprintf(f_ptr, "# vtk DataFile Version 3.0\n");
    fprintf(f_ptr, "saved from function print_vtk.\n");
    fprintf(f_ptr, "BINARY\n");
    fprintf(f_ptr, "DATASET STRUCTURED_POINTS\n");
    fprintf(f_ptr, "DIMENSIONS %d %d %d\n", n, n, n);
    fprintf(f_ptr, "ORIGIN %d %d %d\n", 0, 0, 0);
    fprintf(f_ptr, "SPACING %d %d %d\n", 1, 1, 1);
    fprintf(f_ptr, "POINT_DATA %lu\n", items);
    fprintf(f_ptr, "SCALARS %s %s 1\n", "gray", "double");
    fprintf(f_ptr, "LOOKUP_TABLE default\n");

    if ( is_little_endian() ) {
        // System is little endian, so we need to reverse the byte order.
        written = 0;
        for (i = 0; i < items; ++i) {
            uint64_t crnt = *(uint64_t *)(u + i); // Get double as int

            // Reverse byte order and write to file
            crnt = (crnt & 0x00000000FFFFFFFF) << 32 | (crnt & 0xFFFFFFFF00000000) >> 32;
            crnt = (crnt & 0x0000FFFF0000FFFF) << 16 | (crnt & 0xFFFF0000FFFF0000) >> 16;
            crnt = (crnt & 0x00FF00FF00FF00FF) << 8  | (crnt & 0xFF00FF00FF00FF00) >> 8;
            written += fwrite(&crnt, sizeof(uint64_t), 1, f_ptr);
        }
    } else {
        // System is big endian, so just dump the data.
        written = fwrite(u, sizeof(double), items, f_ptr);
    }

    if ( written != items ) {
	    fprintf(stderr, "Writing failed:  only %lu of %lu items saved!\n",
		written, items);
    }

    fclose(f_ptr);
}

	.text
	.file	"print.hip"
	.globl	_Z12print_binaryPciPd           # -- Begin function _Z12print_binaryPciPd
	.type	_Z12print_binaryPciPd,@function
_Z12print_binaryPciPd:                  # @_Z12print_binaryPciPd
	.cfi_startproc
# %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	pushq	%r15
	.cfi_def_cfa_offset 24
	pushq	%r14
	.cfi_def_cfa_offset 32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	pushq	%rax
	.cfi_def_cfa_offset 48
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, %r15
	movl	%esi, %ebp
	movl	$.L.str, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB0_4
# %bb.1:
	movq	%rax, %rbx
	movl	%ebp, %eax
	imull	%ebp, %eax
	imull	%ebp, %eax
	movslq	%eax, %r14
	movl	$8, %esi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movq	%rbx, %rcx
	callq	fwrite
	cmpq	%r14, %rax
	jne	.LBB0_2
.LBB0_3:
	movq	%rbx, %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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
	jmp	fclose                          # TAILCALL
.LBB0_4:
	.cfi_def_cfa_offset 48
	movl	$.L.str.1, %edi
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.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
	jmp	perror                          # TAILCALL
.LBB0_2:
	.cfi_def_cfa_offset 48
	movq	stderr(%rip), %rdi
	movl	$.L.str.2, %esi
	movq	%rax, %rdx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB0_3
.Lfunc_end0:
	.size	_Z12print_binaryPciPd, .Lfunc_end0-_Z12print_binaryPciPd
	.cfi_endproc
                                        # -- End function
	.globl	_Z9print_vtkPKciPd              # -- Begin function _Z9print_vtkPKciPd
	.type	_Z9print_vtkPKciPd,@function
_Z9print_vtkPKciPd:                     # @_Z9print_vtkPKciPd
	.cfi_startproc
# %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
	pushq	%rax
	.cfi_def_cfa_offset 64
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	.cfi_offset %rbp, -16
	movq	%rdx, %r15
	movl	%esi, %ebp
	movl	$.L.str, %esi
	callq	fopen
	testq	%rax, %rax
	je	.LBB1_7
# %bb.1:
	movq	%rax, %rbx
	movl	%ebp, %eax
	imull	%ebp, %eax
	imull	%ebp, %eax
	movslq	%eax, %r14
	movl	$.L.str.3, %edi
	movl	$27, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	movl	$.L.str.4, %edi
	movl	$31, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	movl	$.L.str.5, %edi
	movl	$7, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	movl	$.L.str.6, %edi
	movl	$26, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	xorl	%r12d, %r12d
	movl	$.L.str.7, %esi
	movq	%rbx, %rdi
	movl	%ebp, %edx
	movl	%ebp, %ecx
	movl	%ebp, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.8, %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.9, %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	movl	$1, %ecx
	movl	$1, %r8d
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.10, %esi
	movq	%rbx, %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.11, %esi
	movl	$.L.str.12, %edx
	movl	$.L.str.13, %ecx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	callq	fprintf
	movl	$.L.str.14, %edi
	movl	$21, %esi
	movl	$1, %edx
	movq	%rbx, %rcx
	callq	fwrite
	testl	%r14d, %r14d
	je	.LBB1_4
# %bb.2:                                # %.lr.ph.preheader
	xorl	%r12d, %r12d
	movq	%rsp, %r13
	xorl	%ebp, %ebp
.LBB1_3:                                # %.lr.ph
                                        # =>This Inner Loop Header: Depth=1
	movq	(%r15,%rbp,8), %rax
	bswapq	%rax
	movq	%rax, (%rsp)
	movl	$8, %esi
	movl	$1, %edx
	movq	%r13, %rdi
	movq	%rbx, %rcx
	callq	fwrite
	addq	%rax, %r12
	incq	%rbp
	cmpq	%rbp, %r14
	jne	.LBB1_3
.LBB1_4:                                # %._crit_edge
	cmpq	%r14, %r12
	jne	.LBB1_5
.LBB1_6:
	movq	%rbx, %rdi
	addq	$8, %rsp
	.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
	jmp	fclose                          # TAILCALL
.LBB1_7:
	.cfi_def_cfa_offset 64
	movl	$.L.str.1, %edi
	addq	$8, %rsp
	.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
	jmp	perror                          # TAILCALL
.LBB1_5:
	.cfi_def_cfa_offset 64
	movq	stderr(%rip), %rdi
	movl	$.L.str.2, %esi
	movq	%r12, %rdx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	fprintf
	jmp	.LBB1_6
.Lfunc_end1:
	.size	_Z9print_vtkPKciPd, .Lfunc_end1-_Z9print_vtkPKciPd
	.cfi_endproc
                                        # -- End function
	.type	.L.str,@object                  # @.str
	.section	.rodata.str1.1,"aMS",@progbits,1
.L.str:
	.asciz	"w"
	.size	.L.str, 2

	.type	.L.str.1,@object                # @.str.1
.L.str.1:
	.asciz	"No output! fopen()"
	.size	.L.str.1, 19

	.type	.L.str.2,@object                # @.str.2
.L.str.2:
	.asciz	"Writing failed:  only %lu of %lu items saved!\n"
	.size	.L.str.2, 47

	.type	.L.str.3,@object                # @.str.3
.L.str.3:
	.asciz	"# vtk DataFile Version 3.0\n"
	.size	.L.str.3, 28

	.type	.L.str.4,@object                # @.str.4
.L.str.4:
	.asciz	"saved from function print_vtk.\n"
	.size	.L.str.4, 32

	.type	.L.str.5,@object                # @.str.5
.L.str.5:
	.asciz	"BINARY\n"
	.size	.L.str.5, 8

	.type	.L.str.6,@object                # @.str.6
.L.str.6:
	.asciz	"DATASET STRUCTURED_POINTS\n"
	.size	.L.str.6, 27

	.type	.L.str.7,@object                # @.str.7
.L.str.7:
	.asciz	"DIMENSIONS %d %d %d\n"
	.size	.L.str.7, 21

	.type	.L.str.8,@object                # @.str.8
.L.str.8:
	.asciz	"ORIGIN %d %d %d\n"
	.size	.L.str.8, 17

	.type	.L.str.9,@object                # @.str.9
.L.str.9:
	.asciz	"SPACING %d %d %d\n"
	.size	.L.str.9, 18

	.type	.L.str.10,@object               # @.str.10
.L.str.10:
	.asciz	"POINT_DATA %lu\n"
	.size	.L.str.10, 16

	.type	.L.str.11,@object               # @.str.11
.L.str.11:
	.asciz	"SCALARS %s %s 1\n"
	.size	.L.str.11, 17

	.type	.L.str.12,@object               # @.str.12
.L.str.12:
	.asciz	"gray"
	.size	.L.str.12, 5

	.type	.L.str.13,@object               # @.str.13
.L.str.13:
	.asciz	"double"
	.size	.L.str.13, 7

	.type	.L.str.14,@object               # @.str.14
.L.str.14:
	.asciz	"LOOKUP_TABLE default\n"
	.size	.L.str.14, 22

	.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
