#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 gps_deg_dec(double);
void gps_convert_deg_to_dec(double *latitude, char ns, double *longitude,
                            char we) {
  double lat = (ns == 'N') ? *latitude : -1 * (*latitude);
  double lon = (we == 'E') ? *longitude : -1 * (*longitude);
  *latitude = gps_deg_dec(lat);
  *longitude = gps_deg_dec(lon);
  return;
}


x86 assembly (clang, -O0):
<gps_convert_deg_to_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %cl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x4e,%eax
jne    114a <gps_convert_deg_to_dec+0x3a>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    115f <gps_convert_deg_to_dec+0x4f>
mov    -0x8(%rbp),%rax
movsd  0xeaa(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x45,%eax
jne    1188 <gps_convert_deg_to_dec+0x78>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    119d <gps_convert_deg_to_dec+0x8d>
mov    -0x18(%rbp),%rax
movsd  0xe6c(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <gps_deg_dec@plt>
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
call   1030 <gps_deg_dec@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gps_convert_deg_to_dec>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movaps 0xed8(%rip),%xmm1
cmp    $0x4e,%sil
je     1131 <gps_convert_deg_to_dec+0x21>
xorps  %xmm1,%xmm0
movsd  (%r14),%xmm2
cmp    $0x45,%cl
je     113e <gps_convert_deg_to_dec+0x2e>
xorps  %xmm1,%xmm2
movaps %xmm2,(%rsp)
call   1030 <gps_deg_dec@plt>
movsd  %xmm0,(%rbx)
movaps (%rsp),%xmm0
call   1030 <gps_deg_dec@plt>
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @gps_convert_deg_to_dec(double* %0, i8 signext %1, double* %2, i8 signext %3) {
%5 = alloca double*
%6 = alloca i8
%7 = alloca double*
%8 = alloca i8
%9 = alloca double
%10 = alloca double
store double* %0, double** %5
store i8 %1, i8* %6
store double* %2, double** %7
store i8 %3, i8* %8
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 78
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load double*, double** %5
%16 = load double, double* %15
br label %21
17: ; preds = %4
%18 = load double*, double** %5
%19 = load double, double* %18
%20 = fmul double -1.000000e+00, %19
br label %21
21: ; preds = %17, %14
%22 = phi double [ %16, %14 ], [ %20, %17 ]
store double %22, double* %9
%23 = load i8, i8* %8
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 69
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = load double*, double** %7
%28 = load double, double* %27
br label %33
29: ; preds = %21
%30 = load double*, double** %7
%31 = load double, double* %30
%32 = fmul double -1.000000e+00, %31
br label %33
33: ; preds = %29, %26
%34 = phi double [ %28, %26 ], [ %32, %29 ]
store double %34, double* %10
%35 = load double, double* %9
%36 = call double @gps_deg_dec(double %35)
%37 = load double*, double** %5
store double %36, double* %37
%38 = load double, double* %10
%39 = call double @gps_deg_dec(double %38)
%40 = load double*, double** %7
store double %39, double* %40
ret void
}

LLVM IR (-O2):
define void @gps_convert_deg_to_dec(double* nocapture %0, i8 signext %1, double* nocapture %2, i8 signext %3) {
%5 = icmp eq i8 %1, 78
%6 = load double, double* %0
%7 = fneg double %6
%8 = select i1 %5, double %6, double %7
%9 = icmp eq i8 %3, 69
%10 = load double, double* %2
%11 = fneg double %10
%12 = select i1 %9, double %10, double %11
%13 = tail call double @gps_deg_dec(double %8)
store double %13, double* %0
%14 = tail call double @gps_deg_dec(double %12)
store double %14, double* %2
ret void
}