// File: /workspace/github_c_makefile_star2_O3/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
movl $0x1, %ebx
movl $0x1, %r13d
cmpl $0x2, %edx
jl 0x629d
movq 0x8(%r14), %rdi
leaq 0x23c9(%rip), %rsi      # 0x8650
callq 0x3320
xorl %r13d, %r13d
testl %eax, %eax
setne %r13b
movl $0x2, %ebx
subl %r13d, %ebx
leal -0x3(%r12), %eax
cmpl %eax, %ebx
setge %cl
cmpl %r12d, %ebx
setl %dl
testb %dl, %cl
je 0x62f0
cmpl %eax, %ebx
jne 0x6318
movl %ebx, %eax
movq 0x10(%r14,%rax,8), %r13
movq %r13, %rdi
callq 0x3190
leaq 0x2386(%rip), %rsi      # 0x8651
movq %r13, %rdi
movq %rax, %rdx
callq 0x30b0
testl %eax, %eax
je 0x6315
leaq 0x2399(%rip), %rsi      # 0x867a
leaq 0x23a1(%rip), %rcx      # 0x8689
movq %rbp, %rdi
movq %r13, %rdx
jmp 0x6304
movq (%r14), %rdx
leaq 0x1e49(%rip), %rsi      # 0x8143
leaq 0x235a(%rip), %rcx      # 0x865b
movq %rbp, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3510
movl $0x1, %ebp
jmp 0x6350
xorl %r13d, %r13d
decl %r12d
cmpl %r12d, %ebx
jne 0x6329
leaq 0x237b(%rip), %r12      # 0x86a2
jmp 0x6331
movl %ebx, %eax
movq (%r14,%rax,8), %r12
incl %ebx
leaq 0x10(%rsp), %rcx
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3060
movq %rbp, %rcx
movl $0x1, %ebp
testl %eax, %eax
je 0x6361
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rcx, 0x8(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x0, 0x14(%rax)
je 0x63e4
movq 0x8(%rax), %r15
testq %r15, %r15
jne 0x637d
movq (%rax), %r15
movl %ebx, %eax
movq (%r14,%rax,8), %rdi
movq %r15, %rsi
callq 0x3240
testl %r13d, %r13d
je 0x639d
movl $0xa, %edi
movq %r15, %rsi
callq 0x32d0
movq %r15, %rdi
callq 0x3110
testl %eax, %eax
je 0x6409
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x31b0
leaq 0x22ec(%rip), %rsi      # 0x86a9
leaq 0x1e27(%rip), %rcx      # 0x81eb
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3510
movq %r15, %rdi
callq 0x33a0
jmp 0x6350
leaq 0x1d35(%rip), %rsi      # 0x8120
leaq 0x20c4(%rip), %rcx      # 0x84b6
movq 0x8(%rsp), %rdi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3510
jmp 0x6350
xorl %ebp, %ebp
jmp 0x6350