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


x86 assembly (clang, -O0):
<timlib_latitude_longitude_degrees_minutes_to_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1146 <timlib_latitude_longitude_degrees_minutes_to_decimal+0x26>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11f8 <timlib_latitude_longitude_degrees_minutes_to_decimal+0xd8>
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <column@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1040 <column@plt>
cmpb   $0x0,-0x30(%rbp)
jne    117e <timlib_latitude_longitude_degrees_minutes_to_decimal+0x5e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11f8 <timlib_latitude_longitude_degrees_minutes_to_decimal+0xd8>
movsbl -0x20(%rbp),%eax
cmp    $0x2d,%eax
jne    11c4 <timlib_latitude_longitude_degrees_minutes_to_decimal+0xa4>
lea    -0x20(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <atof@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
movsd  0xe4e(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11f8 <timlib_latitude_longitude_degrees_minutes_to_decimal+0xd8>
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  0xe15(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_latitude_longitude_degrees_minutes_to_decimal>:
push   %rbx
sub    $0x30,%rsp
xorpd  %xmm0,%xmm0
cmpb   $0x0,(%rdi)
je     11a2 <timlib_latitude_longitude_degrees_minutes_to_decimal+0x82>
mov    %rdi,%rbx
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <column@plt>
lea    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1040 <column@plt>
xorpd  %xmm0,%xmm0
cmpb   $0x0,0x10(%rsp)
je     11a2 <timlib_latitude_longitude_degrees_minutes_to_decimal+0x82>
mov    0x20(%rsp),%bl
lea    0x20(%rsp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <atof@plt>
divsd  0xe7d(%rip),%xmm0
cmp    $0x2d,%bl
jne    1194 <timlib_latitude_longitude_degrees_minutes_to_decimal+0x74>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
jmp    119e <timlib_latitude_longitude_degrees_minutes_to_decimal+0x7e>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define double @timlib_latitude_longitude_degrees_minutes_to_decimal(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 %23, label %8
8: ; preds = %1
%9 = call i32 @column(i8* %4, i32 0, i8* %0)
%10 = call i32 @column(i8* %5, i32 1, i8* %0)
%11 = load i8, i8* %5
%12 = icmp eq i8 %11, 0
br i1 %12, label %23, label %13
13: ; preds = %8
%14 = load i8, i8* %4
%15 = icmp eq i8 %14, 45
%16 = call double @atof(i8* %4)
%17 = call double @atof(i8* %5)
%18 = fdiv double %17, 6.000000e+01
br i1 %15, label %19, label %21
19: ; preds = %13
%20 = fsub double %16, %18
br label %23
21: ; preds = %13
%22 = fadd double %16, %18
br label %23
23: ; preds = %8, %1, %21, %19
%24 = phi double [ %20, %19 ], [ %22, %21 ], [ 0.000000e+00, %1 ], [ 0.000000e+00, %8 ]
ret double %24
}