#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*/ piece(char *, char, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
char *timlib_latitude_longitude_degrees_decimal_to_minutes(
    char *latitude_longitude_decimal) {
  static char degrees_minutes[32];
  char degrees[16];
  char decimal_integer_string[16];
  char decimal_float_string[16];
  double decimal_double;
  piece(degrees, '.', latitude_longitude_decimal, 0);
  if (!piece(decimal_integer_string, '.', latitude_longitude_decimal, 1)) {
    *decimal_integer_string = '0';
  }
  sprintf(decimal_float_string, "0.%s", decimal_integer_string);
  decimal_double = atof(decimal_float_string) * 60.0;
  sprintf(degrees_minutes, "%s %.5lf", degrees, decimal_double);
  return degrees_minutes;
}


x86 assembly (clang, -O0):
<timlib_latitude_longitude_degrees_decimal_to_minutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x2e,%esi
xor    %ecx,%ecx
call   1050 <piece@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x2e,%esi
mov    $0x1,%ecx
call   1050 <piece@plt>
cmp    $0x0,%eax
jne    1174 <timlib_latitude_longitude_degrees_decimal_to_minutes+0x44>
movb   $0x30,-0x30(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <atof@plt>
movsd  0xe65(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
lea    -0x20(%rbp),%rdx
movsd  -0x48(%rbp),%xmm0
lea    0x2e9c(%rip),%rdi
lea    0xe52(%rip),%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    0x2e87(%rip),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_latitude_longitude_degrees_decimal_to_minutes>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
lea    0x10(%rsp),%rdi
mov    $0x2e,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1050 <piece@plt>
mov    %rsp,%rdi
mov    $0x2e,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
call   1050 <piece@plt>
test   %eax,%eax
jne    1169 <timlib_latitude_longitude_degrees_decimal_to_minutes+0x39>
movb   $0x30,(%rsp)
lea    0xe98(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rsp,%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
mulsd  0xe6e(%rip),%xmm0
lea    0x2eb7(%rip),%rbx
lea    0xe6d(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@timlib_latitude_longitude_degrees_decimal_to_minutes.degrees_minutes = internal global [32 x i8] zeroinitializer
@.str = [5 x i8] c"0.%s\00"
@.str.1 = [9 x i8] c"%s %.5lf\00"
define i8* @timlib_latitude_longitude_degrees_decimal_to_minutes(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = alloca [16 x i8]
%6 = alloca double
store i8* %0, i8** %2
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @piece(i8* %7, i8 signext 46, i8* %8, i32 0)
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%11 = load i8*, i8** %2
%12 = call i32 @piece(i8* %10, i8 signext 46, i8* %11, i32 1)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %1
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
store i8 48, i8* %15
br label %16
16: ; preds = %14, %1
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%19 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%21 = call double @atof(i8* %20)
%22 = fmul double %21, 6.000000e+01
store double %22, double* %6
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%24 = load double, double* %6
%25 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timlib_latitude_longitude_degrees_decimal_to_minutes.degrees_minutes, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %23, double %24)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timlib_latitude_longitude_degrees_decimal_to_minutes.degrees_minutes, i64 0, i64 0)
}

LLVM IR (-O2):
@timlib_latitude_longitude_degrees_decimal_to_minutes.degrees_minutes = internal global [32 x i8] zeroinitializer
@.str = [5 x i8] c"0.%s\00"
@.str.1 = [9 x i8] c"%s %.5lf\00"
define i8* @timlib_latitude_longitude_degrees_decimal_to_minutes(i8* %0) {
%2 = alloca [16 x i8]
%3 = alloca [16 x i8]
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%8 = call i32 @piece(i8* %5, i8 signext 46, i8* %0, i32 0)
%9 = call i32 @piece(i8* %6, i8 signext 46, i8* %0, i32 1)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %1
store i8 48, i8* %6
br label %12
12: ; preds = %11, %1
%13 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
%14 = call double @atof(i8* %7)
%15 = fmul double %14, 6.000000e+01
%16 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @timlib_latitude_longitude_degrees_decimal_to_minutes.degrees_minutes, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %5, double %15)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @timlib_latitude_longitude_degrees_decimal_to_minutes.degrees_minutes, i64 0, i64 0)
}