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

    if ((argc != 3) && (argc != 4)) {
	Hax_AppendResult(interp, "wrong # args: should be \"", argv[0],
		" fileId offset ?origin?\"", (char *) NULL);
	return HAX_ERROR;
    }

    clientDataPtr = (UnixClientData *) clientData;
    if (HaxGetOpenFile(interp, clientDataPtr, argv[1], &filePtr) != HAX_OK) {
	return HAX_ERROR;
    }
    if (Hax_GetLongLong(interp, argv[2], &offset) != HAX_OK) {
	return HAX_ERROR;
    }
    mode = SEEK_SET;
    if (argc == 4) {
	int length;
	char c;

	length = strlen(argv[3]);
	c = argv[3][0];
	if ((c == 's') && (strncmp(argv[3], "start", length) == 0)) {
	    mode = SEEK_SET;
	} else if ((c == 'c') && (strncmp(argv[3], "current", length) == 0)) {
	    mode = SEEK_CUR;
	} else if ((c == 'e') && (strncmp(argv[3], "end", length) == 0)) {
	    mode = SEEK_END;
	} else {
	    Hax_AppendResult(interp, "bad origin \"", argv[3],
		    "\": should be start, current, or end", (char *) NULL);
	    return HAX_ERROR;
	}
    }
    if (fseeko(filePtr->f, offset, mode) == -1) {
	Hax_AppendResult(interp, "error during seek: ",
		Hax_UnixError(interp), (char *) NULL);
	clearerr(filePtr->f);
	return HAX_ERROR;
    }

    return HAX_OK;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r14
movl %edx, %r15d
movq %rsi, %rbx
leal -0x5(%r15), %eax
cmpl $-0x3, %eax
ja 0x65db
movq (%r14), %rdx
leaq 0x1b81(%rip), %rsi      # 0x8143
leaq 0x211f(%rip), %rcx      # 0x86e8
movq %rbx, %rdi
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3500
pushq $0x1
popq %rbp
jmp 0x660d
movq %rdi, %rsi
movq 0x8(%r14), %rdx
movq %rsp, %rcx
movq %rbx, %rdi
callq 0x3060
pushq $0x1
popq %r12
testl %eax, %eax
jne 0x660a
movq 0x10(%r14), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x35b0
testl %eax, %eax
je 0x661c
movl %r12d, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movl $0x0, %edx
cmpl $0x4, %r15d
jne 0x66bf
movq 0x18(%r14), %r14
movq %r14, %rdi
callq 0x3190
movzbl (%r14), %ecx
cmpl $0x63, %ecx
je 0x6683
cmpl $0x65, %ecx
je 0x6669
cmpl $0x73, %ecx
jne 0x6699
movslq %eax, %rdx
leaq 0x283a(%rip), %rsi      # 0x8e90
movq %r14, %rdi
callq 0x30b0
movl $0x0, %edx
testl %eax, %eax
jne 0x6699
jmp 0x66bf
movslq %eax, %rdx
leaq 0x20c3(%rip), %rsi      # 0x8736
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
jne 0x6699
pushq $0x2
jmp 0x66be
movslq %eax, %rdx
leaq 0x2074(%rip), %rsi      # 0x8701
movq %r14, %rdi
callq 0x30b0
testl %eax, %eax
je 0x66bc
leaq 0x2069(%rip), %rsi      # 0x8709
leaq 0x206f(%rip), %rcx      # 0x8716
movq %rbx, %rdi
movq %r14, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3500
jmp 0x660a
pushq $0x1
popq %rdx
movq (%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x34f0
cmpl $-0x1, %eax
jne 0x660d
movq %rbx, %rdi
callq 0x31b0
leaq 0x2052(%rip), %rsi      # 0x873a
movq %rbx, %rdi
movq %rax, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x3500
movq (%rsp), %rax
movq (%rax), %rdi
callq 0x3390
jmp 0x660a