// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
cmpl $0x3, -0x1c(%rbp)
je 0x7d64
cmpl $0x4, -0x1c(%rbp)
je 0x7d64
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq (%rax), %rdx
leaq 0x33fe(%rip), %rsi      # 0xb143
leaq 0x390f(%rip), %rcx      # 0xb65b
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movl $0x1, -0x4(%rbp)
jmp 0x7f0d
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdx
leaq -0x38(%rbp), %rcx
callq 0x3060
cmpl $0x0, %eax
je 0x7d96
movl $0x1, -0x4(%rbp)
jmp 0x7f0d
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x40(%rbp), %rdx
callq 0x35c0
cmpl $0x0, %eax
je 0x7dbc
movl $0x1, -0x4(%rbp)
jmp 0x7f0d
movl $0x0, -0x44(%rbp)
cmpl $0x4, -0x1c(%rbp)
jne 0x7eaf
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3190
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movb (%rax), %al
movb %al, -0x49(%rbp)
movsbl -0x49(%rbp), %eax
cmpl $0x73, %eax
jne 0x7e1c
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x48(%rbp), %rdx
leaq 0x42e0(%rip), %rsi      # 0xc0e6
callq 0x30b0
cmpl $0x0, %eax
jne 0x7e1c
movl $0x0, -0x44(%rbp)
jmp 0x7ead
movsbl -0x49(%rbp), %eax
cmpl $0x63, %eax
jne 0x7e4b
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x48(%rbp), %rdx
leaq 0x383c(%rip), %rsi      # 0xb674
callq 0x30b0
cmpl $0x0, %eax
jne 0x7e4b
movl $0x1, -0x44(%rbp)
jmp 0x7eab
movsbl -0x49(%rbp), %eax
cmpl $0x65, %eax
jne 0x7e7a
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movslq -0x48(%rbp), %rdx
leaq 0x3842(%rip), %rsi      # 0xb6a9
callq 0x30b0
cmpl $0x0, %eax
jne 0x7e7a
movl $0x2, -0x44(%rbp)
jmp 0x7ea9
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
leaq 0x37ef(%rip), %rsi      # 0xb67c
leaq 0x37f5(%rip), %rcx      # 0xb689
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x3510
movl $0x1, -0x4(%rbp)
jmp 0x7f0d
jmp 0x7eab
jmp 0x7ead
jmp 0x7eaf
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
movl -0x44(%rbp), %edx
callq 0x3500
cmpl $-0x1, %eax
jne 0x7f06
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x18(%rbp), %rdi
callq 0x31b0
movq -0x58(%rbp), %rdi
movq %rax, %rdx
leaq 0x37c7(%rip), %rsi      # 0xb6ad
xorl %eax, %eax
movl %eax, %ecx
movb $0x0, %al
callq 0x3510
movq -0x38(%rbp), %rax
movq (%rax), %rdi
callq 0x33a0
movl $0x1, -0x4(%rbp)
jmp 0x7f0d
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)