#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rindex(char *, char);
void usage(char *s_program) {
  char *p = (char *)rindex(s_program, '/');
  printf("\n");
  printf("Chinese-Convert Tool. Version %s (inside libcconv version %s).\n",
         "0.0.1", "0.0.1");
  printf("Copyright (c) 2008-2009, China. %s \n", "xiaoyjy@gmail.com");
  printf("\n");
  printf("Usage: %s [OPTION...] [FILE]\n", (p ? p + 1 : s_program));
  printf("\n");
  printf("Convert encoding of given files from one encoding to another.\n");
  printf("\n");
  printf(" Input/Output format specification:\n");
  printf("  -f [NAME] encoding of original text! at this you can use GBK, BIG5 "
         "or UTF8\n");
  printf("  -t [NAME] encoding for output! at this you can use GBK, BIG5, "
         "UTF8-CN, UTF8-HK or UTF-TW\n");
  printf("\n");
  printf(" Information:\n");
  printf("  -l list coded character sets can used \n");
  printf("\n");
  printf(" Output control:\n");
  printf("  -o [FILE] output file\n");
  printf("\n");
  printf("  -?, -h, -v  Show this help page.\n");
  printf("Report bugs to <%s>\n", "xiaoyjy@gmail.com");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <rindex@plt>
mov    %rax,-0x10(%rbp)
lea    0x109b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
lea    0xee6(%rip),%rdx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
lea    0xef9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1060(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     11a3 <usage+0x83>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    11ab <usage+0x8b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x101c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1000(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa9(%rip),%rdi
lea    0xddc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x2f,%esi
call   1060 <rindex@plt>
mov    %rax,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe9a(%rip),%rdi
lea    0xed3(%rip),%rdx
mov    %rdx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xee6(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%rsi
test   %rbx,%rbx
cmove  %r15,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeed(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf15(%rip),%rdi
call   1040 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1040 <puts@plt>
lea    0xf6e(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfb3(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb5(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfc8(%rip),%rdi
call   1040 <puts@plt>
lea    0xfcd(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfcf(%rip),%rdi
call   1040 <puts@plt>
lea    0xe44(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [64 x i8] c"Chinese-Convert Tool. Version %s (inside libcconv version %s).\0A\00"
@.str.2 = [6 x i8] c"0.0.1\00"
@.str.3 = [37 x i8] c"Copyright (c) 2008-2009, China. %s \0A\00"
@.str.4 = [18 x i8] c"xiaoyjy@gmail.com\00"
@.str.5 = [30 x i8] c"Usage: %s [OPTION...] [FILE]\0A\00"
@.str.6 = [63 x i8] c"Convert encoding of given files from one encoding to another.\0A\00"
@.str.7 = [37 x i8] c" Input/Output format specification:\0A\00"
@.str.8 = [78 x i8] c" -f [NAME] encoding of original text! at this you can use GBK, BIG5 or UTF8\0A\00"
@.str.9 = [92 x i8] c" -t [NAME] encoding for output! at this you can use GBK, BIG5, UTF8-CN, UTF8-HK or UTF-TW\0A\00"
@.str.10 = [15 x i8] c" Information:\0A\00"
@.str.11 = [42 x i8] c" -l list coded character sets can used \0A\00"
@.str.12 = [18 x i8] c" Output control:\0A\00"
@.str.13 = [25 x i8] c" -o [FILE] output file\0A\00"
@.str.14 = [36 x i8] c" -?, -h, -v Show this help page.\0A\00"
@.str.15 = [21 x i8] c"Report bugs to <%s>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @rindex(i8* %4, i8 signext 47)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
br label %18
16: ; preds = %1
%17 = load i8*, i8** %2
br label %18
18: ; preds = %16, %13
%19 = phi i8* [ %15, %13 ], [ %17, %16 ]
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.9, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.14, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [64 x i8] c"Chinese-Convert Tool. Version %s (inside libcconv version %s).\0A\00"
@.str.2 = [6 x i8] c"0.0.1\00"
@.str.3 = [37 x i8] c"Copyright (c) 2008-2009, China. %s \0A\00"
@.str.4 = [18 x i8] c"xiaoyjy@gmail.com\00"
@.str.5 = [30 x i8] c"Usage: %s [OPTION...] [FILE]\0A\00"
@.str.15 = [21 x i8] c"Report bugs to <%s>\0A\00"
@str = [62 x i8] c"Convert encoding of given files from one encoding to another.\00"
@str.16 = [36 x i8] c" Input/Output format specification:\00"
@str.17 = [77 x i8] c" -f [NAME] encoding of original text! at this you can use GBK, BIG5 or UTF8\00"
@str.18 = [91 x i8] c" -t [NAME] encoding for output! at this you can use GBK, BIG5, UTF8-CN, UTF8-HK or UTF-TW\00"
@str.19 = [14 x i8] c" Information:\00"
@str.20 = [41 x i8] c" -l list coded character sets can used \00"
@str.21 = [17 x i8] c" Output control:\00"
@str.22 = [24 x i8] c" -o [FILE] output file\00"
@str.23 = [35 x i8] c" -?, -h, -v Show this help page.\00"
define void @usage(i8* %0) {
%2 = tail call i64 @rindex(i8* %0, i8 signext 47)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 10)
%8 = icmp eq i64 %2, 0
%9 = getelementptr inbounds i8, i8* %3, i64 1
%10 = select i1 %8, i8* %0, i8* %9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i8* %10)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.16, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str.17, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str.18, i64 0, i64 0))
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.19, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.20, i64 0, i64 0))
%21 = tail call i32 @putchar(i32 10)
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.21, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.22, i64 0, i64 0))
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.23, i64 0, i64 0))
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
ret void
}