#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 */
int /*<<< orphan*/ asdms1(unsigned char *, double, int, unsigned char);
int /*<<< orphan*/ strcat(unsigned char *, char *);
int strlen(unsigned char *);
unsigned char *asdms(unsigned char *r, double lat, double lon,
                     unsigned char degsym) {
  asdms1(r, lat, 90 * 3600, degsym);
  strcat(r, ",");
  asdms1(r + strlen(r), lon, 180 * 3600, degsym);
  return r;
}


x86 assembly (clang, -O0):
<asdms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    $0x4f1a0,%esi
movzbl -0x19(%rbp),%edx
call   1040 <asdms1@plt>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
cltq
add    %rax,%rdi
movsd  -0x18(%rbp),%xmm0
mov    $0x9e340,%esi
movzbl -0x19(%rbp),%edx
call   1040 <asdms1@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asdms>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movsd  %xmm1,(%rsp)
mov    %rdi,%rbx
mov    $0x4f1a0,%esi
mov    %ebp,%edx
call   1040 <asdms1@plt>
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
movsd  (%rsp),%xmm0
mov    $0x9e340,%esi
mov    %ebp,%edx
call   1040 <asdms1@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define i8* @asdms(i8* %0, double %1, double %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca i8
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = load double, double* %6
%11 = load i8, i8* %8
%12 = call i32 @asdms1(i8* %9, double %10, i32 324000, i8 zeroext %11)
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %5
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
%20 = load double, double* %7
%21 = load i8, i8* %8
%22 = call i32 @asdms1(i8* %19, double %20, i32 648000, i8 zeroext %21)
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
@.str = [2 x i8] c",\00"
define i8* @asdms(i8* returned %0, double %1, double %2, i8 zeroext %3) {
%5 = tail call i32 @asdms1(i8* %0, double %1, i32 324000, i8 zeroext %3)
%6 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strlen(i8* %0)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = tail call i32 @asdms1(i8* %9, double %2, i32 648000, i8 zeroext %3)
ret i8* %0
}