// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x1, -0x44(%rbp)
movl $0x1, -0x48(%rbp)
cmpl $0x2, -0x1c(%rbp)
jl 0x7704
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x3ed9(%rip), %rsi      # 0xb5c3
callq 0x3320
cmpl $0x0, %eax
jne 0x7704
movl $0x0, -0x48(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jl 0x7719
movl -0x44(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x774a
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x3a18(%rip), %rsi      # 0xb143
leaq 0x3e9c(%rip), %rcx      # 0xb5ce
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movl $0x1, -0x4(%rbp)
jmp 0x7925
movl -0x44(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jne 0x77e0
movq -0x28(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3190
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x3e30(%rip), %rsi      # 0xb5c4
callq 0x30b0
cmpl $0x0, %eax
je 0x77d9
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x3e33(%rip), %rsi      # 0xb5ed
leaq 0x3e3b(%rip), %rcx      # 0xb5fc
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movl $0x1, -0x4(%rbp)
jmp 0x7925
movl $0x0, -0x48(%rbp)
movl -0x44(%rbp), %eax
movl -0x1c(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x77fa
leaq 0x3e21(%rip), %rax      # 0xb615
movq %rax, -0x50(%rbp)
jmp 0x7813
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x50(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x3060
cmpl $0x0, %eax
je 0x7841
movl $0x1, -0x4(%rbp)
jmp 0x7925
movq -0x38(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jne 0x7879
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rdx
leaq 0x38c6(%rip), %rsi      # 0xb120
leaq 0x3bc8(%rip), %rcx      # 0xb429
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movl $0x1, -0x4(%rbp)
jmp 0x7925
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x7897
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x40(%rbp), %rsi
callq 0x3240
cmpl $0x0, -0x48(%rbp)
je 0x78c0
movq -0x40(%rbp), %rsi
movl $0xa, %edi
callq 0x32d0
movq -0x40(%rbp), %rdi
callq 0x3110
cmpl $0x0, %eax
je 0x791e
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x31b0
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movq %rax, %r8
leaq 0x3d23(%rip), %rsi      # 0xb61c
leaq 0x38eb(%rip), %rcx      # 0xb1eb
xorl %eax, %eax
movl %eax, %r9d
movb $0x0, %al
callq 0x3510
movq -0x40(%rbp), %rdi
callq 0x33a0
movl $0x1, -0x4(%rbp)
jmp 0x7925
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nop