// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x30(%rbp)
cmpl $0x9, -0x30(%rbp)
jge 0x11ebc
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x0, %eax
jne 0x11e8a
jmp 0x11ebc
movsbl -0x21(%rbp), %eax
cmpl $0x41, %eax
jl 0x11ea6
movsbl -0x21(%rbp), %eax
cmpl $0x5a, %eax
jg 0x11ea6
movsbl -0x21(%rbp), %eax
addl $0x20, %eax
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %cl
movslq -0x30(%rbp), %rax
movb %cl, -0x2b(%rbp,%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x11e6b
movslq -0x30(%rbp), %rax
movb $0x0, -0x2b(%rbp,%rax)
leaq -0x2b(%rbp), %rdi
callq 0x41b0
movl %eax, -0x34(%rbp)
movb -0x2b(%rbp), %al
movb %al, -0x21(%rbp)
movsbl -0x21(%rbp), %eax
cmpl $0x30, %eax
jne 0x11ef8
movsbl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jne 0x11ef8
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
jmp 0x1206f
movsbl -0x21(%rbp), %eax
cmpl $0x31, %eax
jne 0x11f19
movsbl -0x2a(%rbp), %eax
cmpl $0x0, %eax
jne 0x11f19
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
jmp 0x1206d
movsbl -0x21(%rbp), %eax
cmpl $0x79, %eax
jne 0x11f4a
leaq -0x2b(%rbp), %rdi
movslq -0x34(%rbp), %rdx
leaq 0xcd32(%rip), %rsi      # 0x1ec63
callq 0x40a0
cmpl $0x0, %eax
jne 0x11f4a
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
jmp 0x1206b
movsbl -0x21(%rbp), %eax
cmpl $0x6e, %eax
jne 0x11f7b
leaq -0x2b(%rbp), %rdi
movslq -0x34(%rbp), %rdx
leaq 0xcd05(%rip), %rsi      # 0x1ec67
callq 0x40a0
cmpl $0x0, %eax
jne 0x11f7b
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
jmp 0x12069
movsbl -0x21(%rbp), %eax
cmpl $0x74, %eax
jne 0x11fac
leaq -0x2b(%rbp), %rdi
movslq -0x34(%rbp), %rdx
leaq 0xccd7(%rip), %rsi      # 0x1ec6a
callq 0x40a0
cmpl $0x0, %eax
jne 0x11fac
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
jmp 0x12067
movsbl -0x21(%rbp), %eax
cmpl $0x66, %eax
jne 0x11fdd
leaq -0x2b(%rbp), %rdi
movslq -0x34(%rbp), %rdx
leaq 0xccab(%rip), %rsi      # 0x1ec6f
callq 0x40a0
cmpl $0x0, %eax
jne 0x11fdd
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
jmp 0x12065
movsbl -0x21(%rbp), %eax
cmpl $0x6f, %eax
jne 0x12038
cmpl $0x2, -0x34(%rbp)
jl 0x12038
leaq -0x2b(%rbp), %rdi
movslq -0x34(%rbp), %rdx
leaq 0xbeda(%rip), %rsi      # 0x1ded5
callq 0x40a0
cmpl $0x0, %eax
jne 0x12011
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
jmp 0x12036
leaq -0x2b(%rbp), %rdi
movslq -0x34(%rbp), %rdx
leaq 0xcc55(%rip), %rsi      # 0x1ec75
callq 0x40a0
cmpl $0x0, %eax
jne 0x12034
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
jmp 0x12036
jmp 0x12063
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0xcc32(%rip), %rsi      # 0x1ec79
leaq 0xb222(%rip), %rcx      # 0x1d270
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x4500
movl $0x1, -0x4(%rbp)
jmp 0x12076
jmp 0x12065
jmp 0x12067
jmp 0x12069
jmp 0x1206b
jmp 0x1206d
jmp 0x1206f
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop