#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*/ doub2unico(double, char *);
int /*<<< orphan*/ int2unico(int, char *);
int /*<<< orphan*/ strcat(char *, char *);
void weidu(char c, int d, int f, double m, char ch[]) {
  char *s = "7EAC";
  char *s1[2] = {"5357", "5317"};
  if (c == 'S')
    strcat(ch, s1[0]);
  else if (c == 'N')
    strcat(ch, s1[1]);
  strcat(ch, s);
  int2unico(d, ch);
  strcat(ch, "00B0");
  int2unico(f, ch);
  strcat(ch, "0027");
  doub2unico(m, ch);
  strcat(ch, "0020");
}


x86 assembly (clang, -O0):
<weidu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2cb1(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2cae(%rip),%rax
mov    %rax,-0x38(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x53,%eax
jne    118d <weidu+0x5d>
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1050 <strcat@plt>
jmp    11ac <weidu+0x7c>
movsbl -0x1(%rbp),%eax
cmp    $0x4e,%eax
jne    11a7 <weidu+0x77>
mov    -0x20(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1050 <strcat@plt>
jmp    11ac <weidu+0x7c>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <int2unico@plt>
mov    -0x20(%rbp),%rdi
lea    0xe3f(%rip),%rsi
call   1050 <strcat@plt>
mov    -0xc(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <int2unico@plt>
mov    -0x20(%rbp),%rdi
lea    0xe28(%rip),%rsi
call   1050 <strcat@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rdi
call   1030 <doub2unico@plt>
mov    -0x20(%rbp),%rdi
lea    0xe0f(%rip),%rsi
call   1050 <strcat@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weidu>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
movsd  %xmm0,0x8(%rsp)
mov    %edx,%r14d
mov    %esi,%ebp
cmp    $0x53,%dil
je     115b <weidu+0x2b>
cmp    $0x4e,%dil
jne    116a <weidu+0x3a>
lea    0xeb1(%rip),%rsi
jmp    1162 <weidu+0x32>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
lea    0xe8f(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <int2unico@plt>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1040 <int2unico@plt>
lea    0xe70(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <doub2unico@plt>
lea    0xe58(%rip),%rsi
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"7EAC\00"
@.str.1 = [5 x i8] c"5357\00"
@.str.2 = [5 x i8] c"5317\00"
@__const.weidu.s1 = [2 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0)]
@.str.3 = [5 x i8] c"00B0\00"
@.str.4 = [5 x i8] c"0027\00"
@.str.5 = [5 x i8] c"0020\00"
define void @weidu(i8 signext %0, i32 %1, i32 %2, double %3, i8* %4) {
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca [2 x i8*]
store i8 %0, i8* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store i8* %4, i8** %10
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %11
%13 = bitcast [2 x i8*]* %12 to i8*
%14 = load i8, i8* %6
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 83
br i1 %16, label %17, label %22
17: ; preds = %5
%18 = load i8*, i8** %10
%19 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @strcat(i8* %18, i8* %20)
br label %32
22: ; preds = %5
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 78
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i8*, i8** %10
%28 = getelementptr inbounds [2 x i8*], [2 x i8*]* %12, i64 0, i64 1
%29 = load i8*, i8** %28
%30 = call i32 @strcat(i8* %27, i8* %29)
br label %31
31: ; preds = %26, %22
br label %32
32: ; preds = %31, %17
%33 = load i8*, i8** %10
%34 = load i8*, i8** %11
%35 = call i32 @strcat(i8* %33, i8* %34)
%36 = load i32, i32* %7
%37 = load i8*, i8** %10
%38 = call i32 @int2unico(i32 %36, i8* %37)
%39 = load i8*, i8** %10
%40 = call i32 @strcat(i8* %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%41 = load i32, i32* %8
%42 = load i8*, i8** %10
%43 = call i32 @int2unico(i32 %41, i8* %42)
%44 = load i8*, i8** %10
%45 = call i32 @strcat(i8* %44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%46 = load double, double* %9
%47 = load i8*, i8** %10
%48 = call i32 @doub2unico(double %46, i8* %47)
%49 = load i8*, i8** %10
%50 = call i32 @strcat(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"7EAC\00"
@.str.1 = [5 x i8] c"5357\00"
@.str.2 = [5 x i8] c"5317\00"
@.str.3 = [5 x i8] c"00B0\00"
@.str.4 = [5 x i8] c"0027\00"
@.str.5 = [5 x i8] c"0020\00"
define void @weidu(i8 signext %0, i32 %1, i32 %2, double %3, i8* %4) {
switch i8 %0, label %10 [
i8 83, label %7
i8 78, label %6
]
6: ; preds = %5
br label %7
7: ; preds = %5, %6
%8 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), %6 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %5 ]
%9 = tail call i32 @strcat(i8* %4, i8* %8)
br label %10
10: ; preds = %7, %5
%11 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @int2unico(i32 %1, i8* %4)
%13 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @int2unico(i32 %2, i8* %4)
%15 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%16 = tail call i32 @doub2unico(double %3, i8* %4)
%17 = tail call i32 @strcat(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret void
}