#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 *);
int /*<<< orphan*/ column(char *, int, char *);
double google_map_convert_base_60_with_float(char *latitude_longitude) {
  char degrees[16];
  char minutes_float[16];
  double results;
  if (!*latitude_longitude)
    return 0.0;
  if (character_count(' ', latitude_longitude) != 1)
    return atof(latitude_longitude);
  column(degrees, 0, latitude_longitude);
  column(minutes_float, 1, latitude_longitude);
  if (!*degrees)
    return 0.0;
  if (*degrees == '-') {
    results = atof(degrees) - (atof(minutes_float) / 60.0);
  } else {
    results = atof(degrees) + (atof(minutes_float) / 60.0);
  }
  return results;
}


x86 assembly (clang, -O0):
<google_map_convert_base_60_with_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1156 <google_map_convert_base_60_with_float+0x26>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    123c <google_map_convert_base_60_with_float+0x10c>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1040 <character_count@plt>
cmp    $0x1,%eax
je     1180 <google_map_convert_base_60_with_float+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    123c <google_map_convert_base_60_with_float+0x10c>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1050 <column@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1050 <column@plt>
cmpb   $0x0,-0x20(%rbp)
jne    11b8 <google_map_convert_base_60_with_float+0x88>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    123c <google_map_convert_base_60_with_float+0x10c>
movsbl -0x20(%rbp),%eax
cmp    $0x2d,%eax
jne    11fe <google_map_convert_base_60_with_float+0xce>
lea    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0xe14(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1232 <google_map_convert_base_60_with_float+0x102>
lea    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x48(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
movsd  0xddb(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<google_map_convert_base_60_with_float>:
push   %rbx
sub    $0x30,%rsp
xorpd  %xmm0,%xmm0
cmpb   $0x0,(%rdi)
je     11dc <google_map_convert_base_60_with_float+0xac>
mov    %rdi,%rbx
mov    $0x20,%edi
mov    %rbx,%rsi
call   1040 <character_count@plt>
cmp    $0x1,%eax
jne    11ac <google_map_convert_base_60_with_float+0x7c>
lea    0x10(%rsp),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <column@plt>
lea    0x20(%rsp),%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <column@plt>
mov    0x10(%rsp),%al
test   %al,%al
xorpd  %xmm0,%xmm0
je     11dc <google_map_convert_base_60_with_float+0xac>
lea    0x10(%rsp),%rdi
cmp    $0x2d,%al
jne    11b9 <google_map_convert_base_60_with_float+0x89>
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x20(%rsp),%rdi
call   1030 <atof@plt>
divsd  0xe56(%rip),%xmm0
jmp    11d6 <google_map_convert_base_60_with_float+0xa6>
mov    %rbx,%rdi
add    $0x30,%rsp
pop    %rbx
jmp    1030 <atof@plt>
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x20(%rsp),%rdi
call   1030 <atof@plt>
divsd  0xe32(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @google_map_convert_base_60_with_float(i8* %0) {
%2 = alloca double
%3 = alloca i8*
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca double
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %1
store double 0.000000e+00, double* %2
br label %50
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @character_count(i8 signext 32, i8* %12)
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = call double @atof(i8* %16)
store double %17, double* %2
br label %50
18: ; preds = %11
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = call i32 @column(i8* %19, i32 0, i8* %20)
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%23 = load i8*, i8** %3
%24 = call i32 @column(i8* %22, i32 1, i8* %23)
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%26 = load i8, i8* %25
%27 = icmp ne i8 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %18
store double 0.000000e+00, double* %2
br label %50
29: ; preds = %18
%30 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 45
br i1 %33, label %34, label %41
34: ; preds = %29
%35 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%36 = call double @atof(i8* %35)
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%38 = call double @atof(i8* %37)
%39 = fdiv double %38, 6.000000e+01
%40 = fsub double %36, %39
store double %40, double* %6
br label %48
41: ; preds = %29
%42 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%43 = call double @atof(i8* %42)
%44 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%45 = call double @atof(i8* %44)
%46 = fdiv double %45, 6.000000e+01
%47 = fadd double %43, %46
store double %47, double* %6
br label %48
48: ; preds = %41, %34
%49 = load double, double* %6
store double %49, double* %2
br label %50
50: ; preds = %48, %28, %15, %10
%51 = load double, double* %2
ret double %51
}

LLVM IR (-O2):
define double @google_map_convert_base_60_with_float(i8* %0) {
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %27, label %8
8: ; preds = %1
%9 = tail call i32 @character_count(i8 signext 32, i8* %0)
%10 = icmp eq i32 %9, 1
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call double @atof(i8* %0)
br label %27
13: ; preds = %8
%14 = call i32 @column(i8* %4, i32 0, i8* %0)
%15 = call i32 @column(i8* %5, i32 1, i8* %0)
%16 = load i8, i8* %4
switch i8 %16, label %22 [
i8 0, label %27
i8 45, label %17
]
17: ; preds = %13
%18 = call double @atof(i8* %4)
%19 = call double @atof(i8* %5)
%20 = fdiv double %19, 6.000000e+01
%21 = fsub double %18, %20
br label %27
22: ; preds = %13
%23 = call double @atof(i8* %4)
%24 = call double @atof(i8* %5)
%25 = fdiv double %24, 6.000000e+01
%26 = fadd double %23, %25
br label %27
27: ; preds = %17, %22, %13, %1, %11
%28 = phi double [ %12, %11 ], [ 0.000000e+00, %1 ], [ 0.000000e+00, %13 ], [ %21, %17 ], [ %26, %22 ]
ret double %28
}