// File: /workspace/github_c_makefile_star2_O0/haxlang[P]hax/haxUtil.c
// Function: Hax_ConvertElement
int
Hax_ConvertElement(
    char *src,		/* Source information for list element. */
    char *dst,			/* Place to put list-ified element. */
    int flags			/* Flags produced by Hax_ScanElement. */)
{
    char *p = dst;

    /*
     * See the comment block at the beginning of the Hax_ScanElement
     * code for details of how this works.
     */

    if (src == NULL) {
	src = (char *) "";
    }
    if ((flags & USE_BRACES) && !(flags & HAX_DONT_USE_BRACES)) {
	*p = '{';
	p++;
	for ( ; *src != 0; src++, p++) {
	    *p = *src;
	}
	*p = '}';
	p++;
    } else if (*src == 0) {
	/*
	 * If string is empty but can't use braces, then use special
	 * backslash sequence that maps to empty string.
	 */

	p[0] = '\\';
	p[1] = '0';
	p += 2;
    } else {
	for (; *src != 0 ; src++) {
	    switch (*src) {
		case ']':
		case '[':
		case '$':
		case ';':
		case ' ':
		case '\\':
		case '"':
		    *p = '\\';
		    p++;
		    break;
		case '{':
		case '}':
		    if (flags & BRACES_UNMATCHED) {
			*p = '\\';
			p++;
		    }
		    break;
		case '\f':
		    *p = '\\';
		    p++;
		    *p = 'f';
		    p++;
		    continue;
		case '\n':
		    *p = '\\';
		    p++;
		    *p = 'n';
		    p++;
		    continue;
		case '\r':
		    *p = '\\';
		    p++;
		    *p = 'r';
		    p++;
		    continue;
		case '\t':
		    *p = '\\';
		    p++;
		    *p = 't';
		    p++;
		    continue;
		case '\v':
		    *p = '\\';
		    p++;
		    *p = 'v';
		    p++;
		    continue;
	    }
	    *p = *src;
	    p++;
	}
    }
    *p = '\0';
    return p-dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x181c9
leaq 0x6cae(%rip), %rax      # 0x1ee73
movq %rax, -0x8(%rbp)
movl -0x14(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1823c
movl -0x14(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1823c
movq -0x20(%rbp), %rax
movb $0x7b, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x18224
movq -0x8(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x181f2
movq -0x20(%rbp), %rax
movb $0x7d, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183dd
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x18268
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
movb $0x30, 0x1(%rax)
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
jmp 0x183db
jmp 0x1826a
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x183d9
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x74, %eax
ja 0x183b0
movq -0x28(%rbp), %rax
leaq 0x7316(%rip), %rcx      # 0x1f5b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183b0
movl -0x14(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x182dd
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183b0
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x66, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183c8
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x6e, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183c8
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x72, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183c8
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x74, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183c8
movq -0x20(%rbp), %rax
movb $0x5c, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movb $0x76, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x183c8
movq -0x8(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x1826a
jmp 0x183db
jmp 0x183dd
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)