#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*/ LC_ALL;
int /*<<< orphan*/ gbcode_get_full_pinyin(char *, int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  char *in = NULL;
  if (argc >= 2) {
    in = argv[1];
  } else {
    printf("Please enter the string to be converted...\n");
    return 1;
  }
  setlocale(LC_ALL, "");
  char pinyin[3072] = {
      0,
  };
  gbcode_get_full_pinyin(in, 1, pinyin, 3072);
  printf("%s\n", pinyin);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     117c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1196 <main+0x56>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11f4 <main+0xb4>
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1060 <setlocale@plt>
lea    -0xc20(%rbp),%rdi
xor    %esi,%esi
mov    $0xc00,%edx
call   1050 <memset@plt>
mov    -0x18(%rbp),%rdi
lea    -0xc20(%rbp),%rdx
mov    $0x1,%esi
mov    $0xc00,%ecx
call   1030 <gbcode_get_full_pinyin@plt>
lea    -0xc20(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc00,%rsp
cmp    $0x2,%edi
jl     119d <main+0x5d>
mov    0x8(%rsi),%r14
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rsp,%r15
xor    %ebx,%ebx
mov    $0xc00,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    $0xc00,%ecx
call   1030 <gbcode_get_full_pinyin@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
jmp    11ae <main+0x6e>
lea    0xe5c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0xc00,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Please enter the string to be converted...\0A\00"
@LC_ALL = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [3072 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
store i8* %13, i8** %6
br label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %25
16: ; preds = %10
%17 = load i32, i32* @LC_ALL
%18 = call i32 @setlocale(i32 %17, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%19 = bitcast [3072 x i8]* %7 to i8*
%20 = load i8*, i8** %6
%21 = getelementptr inbounds [3072 x i8], [3072 x i8]* %7, i64 0, i64 0
%22 = call i32 @gbcode_get_full_pinyin(i8* %20, i32 1, i8* %21, i32 3072)
%23 = getelementptr inbounds [3072 x i8], [3072 x i8]* %7, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %23)
store i32 0, i32* %3
br label %25
25: ; preds = %16, %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str.1 = [1 x i8] zeroinitializer
@str = [43 x i8] c"Please enter the string to be converted...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3072 x i8]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = load i32, i32* @LC_ALL
%9 = tail call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [3072 x i8], [3072 x i8]* %3, i64 0, i64 0
%11 = call i32 @gbcode_get_full_pinyin(i8* %7, i32 1, i8* %10, i32 3072)
%12 = call i32 @puts(i8* %10)
br label %15
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %5, %13
%16 = phi i32 [ 0, %5 ], [ 1, %13 ]
ret i32 %16
}