// File: /workspace/github_c_makefile_star2_O2/haxlang[P]hax/haxUnixAZ.c
// Function: Hax_PutsCmd
int
Hax_PutsCmd(
    ClientData clientData,		/* Unix ClientData */
    Hax_Interp *interp,			/* Current interpreter. */
    int argc,				/* Number of arguments. */
    char **argv				/* Argument strings. */)
{
    UnixClientData *clientDataPtr;
    OpenFile *filePtr;
    FILE *f;
    int i, newline;
    char *fileId;

    i = 1;
    newline = 1;
    if ((argc >= 2) && (strcmp(argv[1], "-nonewline") == 0)) {
	newline = 0;
	i++;
    }
    if ((i < (argc-3)) || (i >= argc)) {
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		"\" ?-nonewline? ?fileId? string", (char *) NULL);
	return HAX_ERROR;
    }

    /*
     * The code below provides backwards compatibility with an old
     * form of the command that is no longer recommended or documented.
     */

    if (i == (argc-3)) {
	if (strncmp(argv[i+2], "nonewline", strlen(argv[i+2])) != 0) {
	    Hax_AppendResult(interp, "bad argument \"", argv[i+2],
		    "\": should be \"nonewline\"", (char *) NULL);
	    return HAX_ERROR;
	}
	newline = 0;
    }
    if (i == (argc-1)) {
	fileId = (char *) "stdout";
    } else {
	fileId = argv[i];
	i++;
    }

    clientDataPtr = (UnixClientData *) clientData;
    if (HaxGetOpenFile(interp, clientDataPtr, fileId, &filePtr) != HAX_OK) {
	return HAX_ERROR;
    }
    if (!filePtr->writable) {
	Hax_AppendResult(interp, "\"", fileId,
		"\" wasn't opened for writing", (char *) NULL);
	return HAX_ERROR;
    }
    f = filePtr->f2;
    if (f == NULL) {
	f = filePtr->f;
    }

    fputs(argv[i], f);
    if (newline) {
	fputc('\n', f);
    }
    if (ferror(f)) {
	Hax_AppendResult(interp, "error writing \"", fileId,
		"\": ", Hax_UnixError(interp), (char *) NULL);
	clearerr(f);
	return HAX_ERROR;
    }
    return HAX_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movl %edx, %r12d
movq %rsi, %rbp
movq %rdi, %r15
cmpl $0x2, %edx
jl 0x61a5
movq 0x8(%r14), %rdi
leaq 0x24c1(%rip), %rsi      # 0x8650
callq 0x3310
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
pushq $0x2
popq %rbx
subl %r13d, %ebx
jmp 0x61ab
pushq $0x1
popq %rbx
movl %ebx, %r13d
leal -0x3(%r12), %eax
cmpl %eax, %ebx
setge %cl
cmpl %r12d, %ebx
setl %dl
testb %dl, %cl
je 0x6205
movq %rbp, 0x8(%rsp)
movl %ebx, %ebp
cmpl %eax, %ebx
jne 0x622b
movq 0x10(%r14,%rbp,8), %r13
movq %r13, %rdi
callq 0x3190
leaq 0x2473(%rip), %rsi      # 0x8651
movq %r13, %rdi
movq %rax, %rdx
callq 0x30b0
testl %eax, %eax
je 0x6228
leaq 0x2486(%rip), %rsi      # 0x867a
leaq 0x248e(%rip), %rcx      # 0x8689
movq 0x8(%rsp), %rdi
movq %r13, %rdx
jmp 0x6219
movq (%r14), %rdx
leaq 0x1f34(%rip), %rsi      # 0x8143
leaq 0x2445(%rip), %rcx      # 0x865b
movq %rbp, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3500
pushq $0x1
popq %rbp
jmp 0x625e
xorl %r13d, %r13d
decl %r12d
cmpl %r12d, %ebx
jne 0x623c
leaq 0x2468(%rip), %r12      # 0x86a2
jmp 0x6242
movq (%r14,%rbp,8), %r12
incl %ebx
leaq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3060
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x626f
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x62eb
movq 0x8(%rax), %r15
testq %r15, %r15
jne 0x6286
movq (%rax), %r15
movl %ebx, %eax
movq (%r14,%rax,8), %rdi
movq %r15, %rsi
callq 0x3240
testl %r13d, %r13d
je 0x62a4
pushq $0xa
popq %rdi
movq %r15, %rsi
callq 0x32c0
movq %r15, %rdi
callq 0x3110
testl %eax, %eax
je 0x6310
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x31b0
leaq 0x23e5(%rip), %rsi      # 0x86a9
leaq 0x1f20(%rip), %rcx      # 0x81eb
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3500
movq %r15, %rdi
callq 0x3390
jmp 0x625e
leaq 0x1e2e(%rip), %rsi      # 0x8120
leaq 0x21bd(%rip), %rcx      # 0x84b6
movq 0x8(%rsp), %rdi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3500
jmp 0x625e
xorl %ebp, %ebp
jmp 0x625e