// File: /workspace/github_c_makefile_star2_O0/JimKent[P]linearSat/lib/linefile.c
// Function: lineFileCheckAllIntsNoAbort
int lineFileCheckAllIntsNoAbort(char *s, void *val, 
    boolean isSigned, int byteCount, char *typeString, boolean noNeg, 
    char *errMsg, int errMsgSize)
/* Convert string to (signed) integer of the size specified.  
 * Unlike atol assumes all of string is number, no trailing trash allowed.
 * Returns 0 if conversion possible, and value is returned in 'val'
 * Otherwise 1 for empty string or trailing chars, and 2 for numeric overflow,
 * and 3 for (-) sign in unsigned number.
 * Error messages if any are written into the provided buffer.
 * Pass NULL val if you only want validation.
 * Use noNeg if negative values are not allowed despite the type being signed,
 * returns 4. */
{
unsigned long long res = 0, oldRes = 0;
boolean isMinus = FALSE;

if ((byteCount != 1) 
 && (byteCount != 2)
 && (byteCount != 4)
 && (byteCount != 8))
    errAbort("Unexpected error: Invalid byte count for integer size in lineFileCheckAllIntsNoAbort, expected 1 2 4 or 8, got %d.", byteCount);

unsigned long long limit = 0xFFFFFFFFFFFFFFFFULL >> (8*(8-byteCount));

if (isSigned) 
    limit >>= 1;

char *p, *p0 = s;

if (*p0 == '-')
    {
    if (isSigned)
	{
	if (noNeg)
	    {
	    safef(errMsg, errMsgSize, "Negative value not allowed");
	    return 4; 
	    }
	p0++;
	++limit;
	isMinus = TRUE;
	}
    else
	{
	safef(errMsg, errMsgSize, "Unsigned %s may not begin with minus sign (-)", typeString);
	return 3; 
	}
    }
p = p0;
while ((*p >= '0') && (*p <= '9'))
    {
    res *= 10;
    if (res < oldRes)
	{
	safef(errMsg, errMsgSize, "%s%s overflowed", isSigned ? "signed ":"", typeString);
	return 2; 
	}
    oldRes = res;
    res += *p - '0';
    if (res < oldRes)
	{
	safef(errMsg, errMsgSize, "%s%s overflowed", isSigned ? "signed ":"", typeString);
	return 2; 
	}
    if (res > limit)
	{
	safef(errMsg, errMsgSize, "%s%s overflowed, limit=%s%llu", isSigned ? "signed ":"", typeString, isMinus ? "-" : "", limit);
	return 2; 
	}
    oldRes = res;
    p++;
    }
/* test for invalid character, empty, or just a minus */
if (*p != '\0')
    {
    safef(errMsg, errMsgSize, "Trailing characters parsing %s%s", isSigned ? "signed ":"", typeString);
    return 1;
    }
if (p == p0)
    {
    safef(errMsg, errMsgSize, "Empty string parsing %s%s", isSigned ? "signed ":"", typeString);
    return 1;
    }

if (!val)
    return 0;  // only validation required

switch (byteCount)
    {
    case 1:
	if (isSigned)
	    {
	    if (isMinus)
		*(char *)val = -res;
	    else
		*(char *)val = res;
	    }
	else
	    *(unsigned char *)val = res;
	break;
    case 2:
	if (isSigned)
	    {
	    if (isMinus)
		*(short *)val = -res;
	    else
		*(short *)val = res;
	    }
	else
	    *(unsigned short *)val = res;
	break;
    case 4:
	if (isSigned)
	    {
	    if (isMinus)
		*(int *)val = -res;
	    else
		*(int *)val = res;
	    }
	else
	    *(unsigned *)val = res;
	break;
    case 8:
	if (isSigned)
	    {
	    if (isMinus)
		*(long long *)val = -res;
	    else
		*(long long *) val =res;
	    }
	else
	    *(unsigned long long *)val = res;
	break;
    }


return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
cmpl $0x1, -0x20(%rbp)
je 0x13a28
cmpl $0x2, -0x20(%rbp)
je 0x13a28
cmpl $0x4, -0x20(%rbp)
je 0x13a28
cmpl $0x8, -0x20(%rbp)
je 0x13a28
movl -0x20(%rbp), %esi
leaq 0x11686(%rip), %rdi     # 0x250a7
movb $0x0, %al
callq 0xfd50
movl $0x8, %eax
subl -0x20(%rbp), %eax
shll $0x3, %eax
movl %eax, %eax
movl %eax, %ecx
movq $-0x1, %rax
shrq %cl, %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x13a56
movq -0x50(%rbp), %rax
shrq %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x13adf
cmpl $0x0, -0x1c(%rbp)
je 0x13ab8
cmpl $0x0, -0x2c(%rbp)
je 0x13a97
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
leaq 0x11696(%rip), %rdx     # 0x2511a
movb $0x0, %al
callq 0xdc90
movl $0x4, -0x4(%rbp)
jmp 0x13e01
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movl $0x1, -0x44(%rbp)
jmp 0x13add
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
movq -0x28(%rbp), %rcx
leaq 0x1166b(%rip), %rdx     # 0x25135
movb $0x0, %al
callq 0xdc90
movl $0x3, -0x4(%rbp)
jmp 0x13e01
jmp 0x13adf
movq -0x60(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x61(%rbp)
jl 0x13b08
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x13b14
jmp 0x13c47
imulq $0xa, -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x13b64
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq 0x111c2(%rip), %rcx     # 0x24cfa
leaq 0x11634(%rip), %rax     # 0x25173
cmpl $0x0, %edx
cmovneq %rax, %rcx
movq -0x28(%rbp), %r8
leaq 0x11612(%rip), %rdx     # 0x25163
movb $0x0, %al
callq 0xdc90
movl $0x2, -0x4(%rbp)
jmp 0x13e01
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
cltq
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x40(%rbp), %rax
jae 0x13bc7
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq 0x1115f(%rip), %rcx     # 0x24cfa
leaq 0x115d1(%rip), %rax     # 0x25173
cmpl $0x0, %edx
cmovneq %rax, %rcx
movq -0x28(%rbp), %r8
leaq 0x115af(%rip), %rdx     # 0x25163
movb $0x0, %al
callq 0xdc90
movl $0x2, -0x4(%rbp)
jmp 0x13e01
movq -0x38(%rbp), %rax
cmpq -0x50(%rbp), %rax
jbe 0x13c2e
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq 0x11118(%rip), %rcx     # 0x24cfa
leaq 0x1158a(%rip), %rax     # 0x25173
cmpl $0x0, %edx
cmovneq %rax, %rcx
movq -0x28(%rbp), %r8
movl -0x44(%rbp), %edx
leaq 0x110fc(%rip), %r9      # 0x24cfa
leaq 0x1200f(%rip), %rax     # 0x25c14
cmpl $0x0, %edx
cmovneq %rax, %r9
movq -0x50(%rbp), %rax
leaq 0x11564(%rip), %rdx     # 0x2517b
movq %rax, (%rsp)
movb $0x0, %al
callq 0xdc90
movl $0x2, -0x4(%rbp)
jmp 0x13e01
movq -0x38(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0x13ae7
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x13c90
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq 0x11096(%rip), %rcx     # 0x24cfa
leaq 0x11508(%rip), %rax     # 0x25173
cmpl $0x0, %edx
cmovneq %rax, %rcx
movq -0x28(%rbp), %r8
leaq 0x1151c(%rip), %rdx     # 0x25199
movb $0x0, %al
callq 0xdc90
movl $0x1, -0x4(%rbp)
jmp 0x13e01
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jne 0x13cd7
movq 0x10(%rbp), %rdi
movl 0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq 0x1104f(%rip), %rcx     # 0x24cfa
leaq 0x114c1(%rip), %rax     # 0x25173
cmpl $0x0, %edx
cmovneq %rax, %rcx
movq -0x28(%rbp), %r8
leaq 0x114f6(%rip), %rdx     # 0x251ba
movb $0x0, %al
callq 0xdc90
movl $0x1, -0x4(%rbp)
jmp 0x13e01
cmpq $0x0, -0x18(%rbp)
jne 0x13cea
movl $0x0, -0x4(%rbp)
jmp 0x13e01
movl -0x20(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x70(%rbp)
subl $0x7, %eax
ja 0x13dfa
movq -0x70(%rbp), %rax
leaq 0x10fc3(%rip), %rcx     # 0x24ccc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, -0x1c(%rbp)
je 0x13d3c
cmpl $0x0, -0x44(%rbp)
je 0x13d2e
xorl %eax, %eax
subq -0x38(%rbp), %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
jmp 0x13d3a
movq -0x38(%rbp), %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
jmp 0x13d48
movq -0x38(%rbp), %rax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
jmp 0x13dfa
cmpl $0x0, -0x1c(%rbp)
je 0x13d7b
cmpl $0x0, -0x44(%rbp)
je 0x13d6b
xorl %eax, %eax
subq -0x38(%rbp), %rax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13d79
movq -0x38(%rbp), %rax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13d89
movq -0x38(%rbp), %rax
movw %ax, %cx
movq -0x18(%rbp), %rax
movw %cx, (%rax)
jmp 0x13dfa
cmpl $0x0, -0x1c(%rbp)
je 0x13db5
cmpl $0x0, -0x44(%rbp)
je 0x13da7
xorl %eax, %eax
subq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x13db3
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x13dc1
movq -0x38(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x13dfa
cmpl $0x0, -0x1c(%rbp)
je 0x13ded
cmpl $0x0, -0x44(%rbp)
je 0x13de0
xorl %eax, %eax
movl %eax, %ecx
subq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x13deb
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x13df8
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x13dfa
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)