// File: /workspace/github_c_makefile_star2_O1/mloar[P]charset/cstable.c
// Function: main
int main(int argc, char **argv)
{
    long int c;
    int internal_names = FALSE;
    int verbose = FALSE;

    while (--argc) {
        char *p = *++argv;
        if (!strcmp(p, "-i"))
            internal_names = TRUE;
        else if (!strcmp(p, "-v"))
            verbose = TRUE;
    }

    for (c = 0; c < 0x30000; c++) {
	int i, plane, row, col, chr;
	char const *sep = "";

	printf("U+%04x:", (unsigned)c);

	/*
	 * Look up in SBCSes.
	 */
	for (i = 0; i < lenof(cs_table); i++)
	    if (cs_table[i]->read == read_sbcs &&
		(chr = sbcs_from_unicode(cs_table[i]->data, c)) != ERROR) {
		printf("%s %s", sep,
		       (internal_names ? cs_names[i] :
			charset_to_localenc(cs_table[i]->charset)));
		if (verbose)
		    printf("[%d]", chr);
		sep = ";";
	    }

	/*
	 * Look up individually in MBCS base charsets. The
	 * `internal_names' flag does not affect these, because
	 * MBCS base charsets aren't directly encoded by CS_*
	 * constants.
	 */
	if (unicode_to_big5(c, &row, &col)) {
	    printf("%s Big5", sep);
	    if (verbose)
		printf("[%d,%d]", row, col);
	    sep = ";";
	}

	if (unicode_to_gb2312(c, &row, &col)) {
	    printf("%s GB2312", sep);
	    if (verbose)
		printf("[%d,%d]", row, col);
	    sep = ";";
	}

	if (unicode_to_jisx0208(c, &row, &col)) {
	    printf("%s JIS X 0208", sep);
	    if (verbose)
		printf("[%d,%d]", row, col);
	    sep = ";";
	}

	if (unicode_to_ksx1001(c, &row, &col)) {
	    printf("%s KS X 1001", sep);
	    if (verbose)
		printf("[%d,%d]", row, col);
	    sep = ";";
	}

	if (unicode_to_cp949(c, &row, &col)) {
	    printf("%s CP949", sep);
	    if (verbose)
		printf("[%d,%d]", row, col);
	    sep = ";";
	}

	if (unicode_to_cns11643(c, &plane, &row, &col)) {
	    printf("%s CNS11643", sep);
	    if (verbose)
		printf("[%d,%d,%d]", plane, row, col);
	    sep = ";";
	}

	if (!*sep)
	    printf(" unicode-only");

	printf("\n");
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x1, %edi
je 0x621d
movq %rsi, %rbx
movl %edi, %r13d
xorl %ebp, %ebp
movl $0x1, %r15d
leaq 0x9df86(%rip), %r14     # 0xa414a
movl $0x0, 0x4(%rsp)
movq (%rbx,%r15,8), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x6070
testl %eax, %eax
je 0x61fa
movq %r12, %rdi
leaq 0x4e1b(%rip), %rsi      # 0xb004
callq 0x6070
testl %eax, %eax
movl $0x1, %eax
cmovel %eax, %ebp
jmp 0x6202
movl $0x1, 0x4(%rsp)
incq %r15
cmpl %r15d, %r13d
jne 0x61cc
cmpl $0x0, 0x4(%rsp)
sete 0xb(%rsp)
testl %ebp, %ebp
sete 0x4(%rsp)
jmp 0x6227
movb $0x1, 0xb(%rsp)
movb $0x1, 0x4(%rsp)
xorl %ebp, %ebp
leaq 0x4dd7(%rip), %rdi      # 0xb007
movl %ebp, %esi
xorl %eax, %eax
callq 0x6050
leaq 0xa0c70(%rip), %r14     # 0xa6eb0
xorl %r12d, %r12d
leaq 0x56ba8(%rip), %rbx     # 0x5cdf2
movq (%r14), %r13
leaq 0x3371(%rip), %rax      # 0x95c5
cmpq %rax, 0x8(%r13)
jne 0x62cc
movq 0x18(%r13), %rdi
movq %rbp, %rsi
callq 0x95d2
movq %rax, %r15
cmpl $0xffff, %r15d          # imm = 0xFFFF
je 0x62cc
cmpb $0x0, 0xb(%rsp)
je 0x6287
movl (%r13), %edi
callq 0x93f4
movq %rax, %rdx
jmp 0x6295
leaq 0x51ca(%rip), %rax      # 0xb458
movslq (%r12,%rax), %rdx
addq %rax, %rdx
leaq 0x4d73(%rip), %rdi      # 0xb00f
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4d6d(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x62cc
leaq 0x4d5a(%rip), %rdi      # 0xb015
movl %r15d, %esi
xorl %eax, %eax
callq 0x6050
leaq 0x4d4e(%rip), %rbx      # 0xb01a
addq $0x4, %r12
addq $0x8, %r14
cmpq $0x13c, %r12            # imm = 0x13C
jne 0x624a
movq %rbp, %rdi
leaq 0x10(%rsp), %r14
movq %r14, %rsi
leaq 0xc(%rsp), %r15
movq %r15, %rdx
callq 0x665f
testl %eax, %eax
je 0x6339
leaq 0x4d18(%rip), %rdi      # 0xb01c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4d05(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x6339
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x4cf9(%rip), %rdi      # 0xb024
xorl %eax, %eax
callq 0x6050
leaq 0x4ce1(%rip), %rbx      # 0xb01a
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x6e20
testl %eax, %eax
je 0x6387
leaq 0x4cda(%rip), %rdi      # 0xb02c
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4cb7(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x6387
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x4cab(%rip), %rdi      # 0xb024
xorl %eax, %eax
callq 0x6050
leaq 0x4c93(%rip), %rbx      # 0xb01a
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x90b0
testl %eax, %eax
je 0x63d5
leaq 0x4c96(%rip), %rdi      # 0xb036
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4c69(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x63d5
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x4c5d(%rip), %rdi      # 0xb024
xorl %eax, %eax
callq 0x6050
leaq 0x4c45(%rip), %rbx      # 0xb01a
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x935b
testl %eax, %eax
je 0x6423
leaq 0x4c56(%rip), %rdi      # 0xb044
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4c1b(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x6423
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x4c0f(%rip), %rdi      # 0xb024
xorl %eax, %eax
callq 0x6050
leaq 0x4bf7(%rip), %rbx      # 0xb01a
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x9277
testl %eax, %eax
je 0x6471
leaq 0x4c15(%rip), %rdi      # 0xb051
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4bcd(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x6471
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
leaq 0x4bc1(%rip), %rdi      # 0xb024
xorl %eax, %eax
callq 0x6050
leaq 0x4ba9(%rip), %rbx      # 0xb01a
movq %rbp, %rdi
leaq 0x14(%rsp), %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x6777
testl %eax, %eax
je 0x64c8
leaq 0x4bcb(%rip), %rdi      # 0xb05a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x6050
leaq 0x4b7a(%rip), %rbx      # 0xb01a
cmpb $0x0, 0x4(%rsp)
jne 0x64c8
movl 0x14(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0xc(%rsp), %ecx
leaq 0x4bac(%rip), %rdi      # 0xb066
xorl %eax, %eax
callq 0x6050
leaq 0x4b52(%rip), %rbx      # 0xb01a
cmpb $0x0, (%rbx)
jne 0x64db
leaq 0x4b9d(%rip), %rdi      # 0xb071
xorl %eax, %eax
callq 0x6050
movl $0xa, %edi
callq 0x6030
incq %rbp
cmpq $0x30000, %rbp          # imm = 0x30000
jne 0x6229
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop