// File: /workspace/github_c_makefile_star2_O3/haxlang[P]hax/haxGet.c
// Function: Hax_GetBoolean
int
Hax_GetBoolean(
    Hax_Interp *interp,		/* Interpreter to use for error reporting. */
    char *string,		/* String containing a boolean number
				 * specified either as 1/0 or true/false or
				 * yes/no. */
    int *boolPtr		/* Place to store converted result, which
				 * will be 0 or 1. */)
{
    char c;
    char lowerCase[10];
    int i, length;

    /*
     * Convert the input string to all lower-case.
     */

    for (i = 0; i < 9; i++) {
	c = string[i];
	if (c == 0) {
	    break;
	}
	if ((c >= 'A') && (c <= 'Z')) {
	    c += 'a' - 'A';
	}
	lowerCase[i] = c;
    }
    lowerCase[i] = 0;

    length = strlen(lowerCase);
    c = lowerCase[0];
    if ((c == '0') && (lowerCase[1] == '\0')) {
	*boolPtr = 0;
    } else if ((c == '1') && (lowerCase[1] == '\0')) {
	*boolPtr = 1;
    } else if ((c == 'y') && (strncmp(lowerCase, "yes", length) == 0)) {
	*boolPtr = 1;
    } else if ((c == 'n') && (strncmp(lowerCase, "no", length) == 0)) {
	*boolPtr = 0;
    } else if ((c == 't') && (strncmp(lowerCase, "true", length) == 0)) {
	*boolPtr = 1;
    } else if ((c == 'f') && (strncmp(lowerCase, "false", length) == 0)) {
	*boolPtr = 0;
    } else if ((c == 'o') && (length >= 2)) {
	if (strncmp(lowerCase, "on", length) == 0) {
	    *boolPtr = 1;
	} else if (strncmp(lowerCase, "off", length) == 0) {
	    *boolPtr = 0;
	}
    } else {
	Hax_AppendResult(interp, "expected boolean value but got \"",
		string, "\"", (char *) NULL);
	return HAX_ERROR;
    }
    return HAX_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
movb (%r14,%rax), %cl
testb %cl, %cl
je 0xd0e8
leal -0x41(%rcx), %edx
movzbl %cl, %esi
orb $0x20, %cl
cmpb $0x1a, %dl
movzbl %cl, %ecx
cmovael %esi, %ecx
movb %cl, 0x6(%rsp,%rax)
incq %rax
cmpq $0x9, %rax
jne 0xd0bc
movl $0x9, %eax
movl %eax, %eax
movb $0x0, 0x6(%rsp,%rax)
leaq 0x6(%rsp), %r13
movq %r13, %rdi
callq 0x41d0
movq %rax, %r12
movzbl (%r13), %eax
movl %eax, %edx
xorb $0x30, %dl
movb 0x1(%r13), %cl
orb %cl, %dl
jne 0xd119
movl $0x0, (%rbx)
jmp 0xd128
movl %eax, %edx
xorb $0x31, %dl
orb %cl, %dl
jne 0xd138
movl $0x1, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x73, %eax
jg 0xd15a
cmpl $0x66, %eax
je 0xd1dd
cmpl $0x6e, %eax
jne 0xd177
movslq %r12d, %rdx
leaq 0x887d(%rip), %rsi      # 0x159d2
jmp 0xd1e7
cmpl $0x74, %eax
je 0xd1fa
cmpl $0x79, %eax
jne 0xd177
movslq %r12d, %rdx
leaq 0x885c(%rip), %rsi      # 0x159ce
jmp 0xd204
cmpl $0x6f, %eax
sete %al
cmpl $0x2, %r12d
setge %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0xd216
andl $0x7fffffff, %r12d      # imm = 0x7FFFFFFF
leaq 0x7c7e(%rip), %rsi      # 0x14e1b
leaq 0x6(%rsp), %rdi
movq %r12, %rdx
callq 0x40c0
testl %eax, %eax
je 0xd122
leaq 0x8827(%rip), %rsi      # 0x159e0
leaq 0x6(%rsp), %rdi
movq %r12, %rdx
callq 0x40c0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0xd12a
movl $0x0, (%rbx)
jmp 0xd12a
movslq %r12d, %rdx
leaq 0x87f3(%rip), %rsi      # 0x159da
leaq 0x6(%rsp), %rdi
callq 0x40c0
testl %eax, %eax
jne 0xd216
jmp 0xd111
movslq %r12d, %rdx
leaq 0x87d1(%rip), %rsi      # 0x159d5
leaq 0x6(%rsp), %rdi
callq 0x40c0
testl %eax, %eax
je 0xd122
leaq 0x87c7(%rip), %rsi      # 0x159e4
leaq 0x708b(%rip), %rcx      # 0x142af
movq %r15, %rdi
movq %r14, %rdx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x4510
movl $0x1, %eax
jmp 0xd12a
nop