// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, %eax
je 0x6217
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, -0x10(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0x9ff76(%rip), %rsi     # 0xa615a
callq 0x6070
cmpl $0x0, %eax
jne 0x61f7
movl $0x1, -0x1c(%rbp)
jmp 0x6215
movq -0x28(%rbp), %rdi
leaq 0x6e02(%rip), %rsi      # 0xd004
callq 0x6070
cmpl $0x0, %eax
jne 0x6213
movl $0x1, -0x20(%rbp)
jmp 0x6215
jmp 0x61b4
movq $0x0, -0x18(%rbp)
cmpq $0x30000, -0x18(%rbp)   # imm = 0x30000
jge 0x653a
leaq 0x58bd2(%rip), %rax     # 0x5ee06
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movl %eax, %esi
leaq 0x6dc2(%rip), %rdi      # 0xd007
movb $0x0, %al
callq 0x6040
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpq $0x4f, %rax
jae 0x632f
movslq -0x2c(%rbp), %rcx
leaq 0xa29c4(%rip), %rax     # 0xa8c30
movq (%rax,%rcx,8), %rax
leaq 0x4fc9(%rip), %rcx      # 0xb240
cmpq %rcx, 0x8(%rax)
jne 0x631f
movslq -0x2c(%rbp), %rcx
leaq 0xa29a4(%rip), %rax     # 0xa8c30
movq (%rax,%rcx,8), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0xb2a0
movl %eax, -0x3c(%rbp)
cltq
cmpq $0xffff, %rax           # imm = 0xFFFF
je 0x631f
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x62cd
movslq -0x2c(%rbp), %rcx
leaq 0xa2bed(%rip), %rax     # 0xa8eb0
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
jmp 0x62e7
movslq -0x2c(%rbp), %rcx
leaq 0xa2958(%rip), %rax     # 0xa8c30
movq (%rax,%rcx,8), %rax
movl (%rax), %edi
callq 0xae80
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
leaq 0x6d19(%rip), %rdi      # 0xd00f
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x6314
movl -0x3c(%rbp), %esi
leaq 0x6d08(%rip), %rdi      # 0xd015
movb $0x0, %al
callq 0x6040
leaq 0x6cff(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
jmp 0x6321
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x6253
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x6780
cmpl $0x0, %eax
je 0x637c
movq -0x48(%rbp), %rsi
leaq 0x6ccc(%rip), %rdi      # 0xd01c
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x6371
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0x6cba(%rip), %rdi      # 0xd024
movb $0x0, %al
callq 0x6040
leaq 0x6ca2(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0x7460
cmpl $0x0, %eax
je 0x63c9
movq -0x48(%rbp), %rsi
leaq 0x6c8f(%rip), %rdi      # 0xd02c
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x63be
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0x6c6d(%rip), %rdi      # 0xd024
movb $0x0, %al
callq 0x6040
leaq 0x6c55(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xa980
cmpl $0x0, %eax
je 0x6416
movq -0x48(%rbp), %rsi
leaq 0x6c4c(%rip), %rdi      # 0xd036
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x640b
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0x6c20(%rip), %rdi      # 0xd024
movb $0x0, %al
callq 0x6040
leaq 0x6c08(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xadf0
cmpl $0x0, %eax
je 0x6463
movq -0x48(%rbp), %rsi
leaq 0x6c0d(%rip), %rdi      # 0xd044
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x6458
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0x6bd3(%rip), %rdi      # 0xd024
movb $0x0, %al
callq 0x6040
leaq 0x6bbb(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x34(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xac70
cmpl $0x0, %eax
je 0x64b0
movq -0x48(%rbp), %rsi
leaq 0x6bcd(%rip), %rdi      # 0xd051
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x64a5
movl -0x34(%rbp), %esi
movl -0x38(%rbp), %edx
leaq 0x6b86(%rip), %rdi      # 0xd024
movb $0x0, %al
callq 0x6040
leaq 0x6b6e(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x34(%rbp), %rdx
leaq -0x38(%rbp), %rcx
callq 0x6970
cmpl $0x0, %eax
je 0x6504
movq -0x48(%rbp), %rsi
leaq 0x6b85(%rip), %rdi      # 0xd05a
movb $0x0, %al
callq 0x6040
cmpl $0x0, -0x20(%rbp)
je 0x64f9
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
leaq 0x6b74(%rip), %rdi      # 0xd066
movb $0x0, %al
callq 0x6040
leaq 0x6b1a(%rip), %rax      # 0xd01a
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpb $0x0, (%rax)
jne 0x651b
leaq 0x6b5d(%rip), %rdi      # 0xd071
movb $0x0, %al
callq 0x6040
leaq 0x6b5d(%rip), %rdi      # 0xd07f
movb $0x0, %al
callq 0x6040
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x621f
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)