#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 coord2mc_full(char **, double, double, int, int);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int coord2mc1(char *result, double lat, double lon, int tc) {
  char *v[2];
  int ret = coord2mc_full(v, lat, lon, tc, 1);
  *result = 0;
  if (ret > 0) {
    if (strcmp(v[1], "AAA") != 0) {
      strcpy(result, v[1]);
      strcat(result, " ");
    }
    strcat(result, v[0]);
  }
  return ret;
}


x86 assembly (clang, -O0):
<coord2mc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
lea    -0x30(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
mov    $0x1,%edx
call   1040 <coord2mc_full@plt>
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
cmpl   $0x0,-0x34(%rbp)
jle    11cc <coord2mc1+0x8c>
mov    -0x28(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11bf <coord2mc1+0x7f>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coord2mc1>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x1,%edx
call   1040 <coord2mc_full@plt>
mov    %eax,%ebp
movb   $0x0,(%rbx)
test   %eax,%eax
jle    119d <coord2mc1+0x5d>
mov    0x8(%rsp),%rdi
lea    0xe95(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1191 <coord2mc1+0x51>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe7b(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"AAA\00"
@.str.1 = [2 x i8] c" \00"
define i32 @coord2mc1(i8* %0, double %1, double %2, i32 %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca [2 x i8*]
%10 = alloca i32
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
store i32 %3, i32* %8
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %9, i64 0, i64 0
%12 = load double, double* %6
%13 = load double, double* %7
%14 = load i32, i32* %8
%15 = call i32 @coord2mc_full(i8** %11, double %12, double %13, i32 %14, i32 1)
store i32 %15, i32* %10
%16 = load i8*, i8** %5
store i8 0, i8* %16
%17 = load i32, i32* %10
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %36
19: ; preds = %4
%20 = getelementptr inbounds [2 x i8*], [2 x i8*]* %9, i64 0, i64 1
%21 = load i8*, i8** %20
%22 = call i64 @strcmp(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %19
%25 = load i8*, i8** %5
%26 = getelementptr inbounds [2 x i8*], [2 x i8*]* %9, i64 0, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strcpy(i8* %25, i8* %27)
%29 = load i8*, i8** %5
%30 = call i32 @strcat(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %24, %19
%32 = load i8*, i8** %5
%33 = getelementptr inbounds [2 x i8*], [2 x i8*]* %9, i64 0, i64 0
%34 = load i8*, i8** %33
%35 = call i32 @strcat(i8* %32, i8* %34)
br label %36
36: ; preds = %31, %4
%37 = load i32, i32* %10
ret i32 %37
}

LLVM IR (-O2):
@.str = [4 x i8] c"AAA\00"
@.str.1 = [2 x i8] c" \00"
define i32 @coord2mc1(i8* %0, double %1, double %2, i32 %3) {
%5 = alloca [2 x i8*]
%6 = bitcast [2 x i8*]* %5 to i8*
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 0
%8 = call i32 @coord2mc_full(i8** %7, double %1, double %2, i32 %3, i32 1)
store i8 0, i8* %0
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %4
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %5, i64 0, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = load i8*, i8** %11
%17 = call i32 @strcpy(i8* %0, i8* %16)
%18 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %15, %10
%20 = load i8*, i8** %7
%21 = call i32 @strcat(i8* %0, i8* %20)
br label %22
22: ; preds = %19, %4
ret i32 %8
}