#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 */
double atof(char *);
int character_count(char, char *);
double google_map_convert_base_60(char *);
double google_map_convert_base_60_with_float(char *);
double google_map_convert_coordinate(char *latitude_longitude) {
  if (character_count(' ', latitude_longitude) == 1) {
    return google_map_convert_base_60_with_float(latitude_longitude);
  } else if (character_count(' ', latitude_longitude) == 2) {
    return google_map_convert_base_60(latitude_longitude);
  } else {
    return atof(latitude_longitude);
  }
}


x86 assembly (clang, -O0):
<google_map_convert_coordinate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1060 <character_count@plt>
cmp    $0x1,%eax
jne    1176 <google_map_convert_coordinate+0x36>
mov    -0x10(%rbp),%rdi
call   1050 <google_map_convert_base_60_with_float@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11ae <google_map_convert_coordinate+0x6e>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1060 <character_count@plt>
cmp    $0x2,%eax
jne    11a0 <google_map_convert_coordinate+0x60>
mov    -0x10(%rbp),%rdi
call   1040 <google_map_convert_base_60@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11ae <google_map_convert_coordinate+0x6e>
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<google_map_convert_coordinate>:
push   %rbx
mov    %rdi,%rbx
mov    $0x20,%edi
mov    %rbx,%rsi
call   1060 <character_count@plt>
cmp    $0x1,%eax
jne    115f <google_map_convert_coordinate+0x1f>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <google_map_convert_base_60_with_float@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1060 <character_count@plt>
mov    %rbx,%rdi
cmp    $0x2,%eax
jne    117a <google_map_convert_coordinate+0x3a>
pop    %rbx
jmp    1040 <google_map_convert_base_60@plt>
pop    %rbx
jmp    1030 <atof@plt>

LLVM IR (-O0):
define double @google_map_convert_coordinate(i8* %0) {
%2 = alloca double
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @character_count(i8 signext 32, i8* %4)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call double @google_map_convert_base_60_with_float(i8* %8)
store double %9, double* %2
br label %20
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @character_count(i8 signext 32, i8* %11)
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = call double @google_map_convert_base_60(i8* %15)
store double %16, double* %2
br label %20
17: ; preds = %10
%18 = load i8*, i8** %3
%19 = call double @atof(i8* %18)
store double %19, double* %2
br label %20
20: ; preds = %17, %14, %7
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @google_map_convert_coordinate(i8* %0) {
%2 = tail call i32 @character_count(i8 signext 32, i8* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call double @google_map_convert_base_60_with_float(i8* %0)
br label %13
6: ; preds = %1
%7 = tail call i32 @character_count(i8 signext 32, i8* %0)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call double @google_map_convert_base_60(i8* %0)
br label %13
11: ; preds = %6
%12 = tail call double @atof(i8* %0)
br label %13
13: ; preds = %11, %9, %4
%14 = phi double [ %5, %4 ], [ %10, %9 ], [ %12, %11 ]
ret double %14
}