// File: /workspace/github_c_makefile_star2_O1/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 0x63bb
movq 0x8(%r14), %rdi
leaq 0x3287(%rip), %rsi      # 0x962c
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 0x640e
cmpl %eax, %ebx
jne 0x6436
movl %ebx, %eax
movq 0x10(%r14,%rax,8), %r13
movq %r13, %rdi
callq 0x3190
leaq 0x3244(%rip), %rsi      # 0x962d
movq %r13, %rdi
movq %rax, %rdx
callq 0x30b0
testl %eax, %eax
je 0x6433
leaq 0x3257(%rip), %rsi      # 0x9656
leaq 0x325f(%rip), %rcx      # 0x9665
movq %rbp, %rdi
movq %r13, %rdx
jmp 0x6422
movq (%r14), %rdx
leaq 0x2d2b(%rip), %rsi      # 0x9143
leaq 0x3218(%rip), %rcx      # 0x9637
movq %rbp, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3510
movl $0x1, %ebp
jmp 0x646e
xorl %r13d, %r13d
decl %r12d
cmpl %r12d, %ebx
jne 0x6447
leaq 0x3239(%rip), %r12      # 0x967e
jmp 0x644f
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 0x647f
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 0x6502
movq 0x8(%rax), %r15
testq %r15, %r15
jne 0x649b
movq (%rax), %r15
movl %ebx, %eax
movq (%r14,%rax,8), %rdi
movq %r15, %rsi
callq 0x3240
testl %r13d, %r13d
je 0x64bb
movl $0xa, %edi
movq %r15, %rsi
callq 0x32d0
movq %r15, %rdi
callq 0x3110
testl %eax, %eax
je 0x6527
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x31b0
leaq 0x31aa(%rip), %rsi      # 0x9685
leaq 0x2d09(%rip), %rcx      # 0x91eb
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x3510
movq %r15, %rdi
callq 0x33a0
jmp 0x646e
leaq 0x2c17(%rip), %rsi      # 0x9120
leaq 0x2f82(%rip), %rcx      # 0x9492
movq 0x8(%rsp), %rdi
movq %r12, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3510
jmp 0x646e
xorl %ebp, %ebp
jmp 0x646e