#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*/ sla_dd2tf_(int *, double *, char *, int *, int const);
void slaDd2tf(int ndp, double days, char *sign, int ihmsf[4]) {
  int NDP;
  double DAYS;
  char SIGN[2];
  const int SIGN_length = 2;
  int IHMSF[4];
  int i;
  NDP = ndp;
  DAYS = days;
  sla_dd2tf_(&NDP, &DAYS, SIGN, (int *)IHMSF, SIGN_length);
  sign[0] = SIGN[0];
  sign[1] = 0;
  for (i = 0; i < 4; i++)
    ihmsf[i] = IHMSF[i];
}


x86 assembly (clang, -O0):
<slaDd2tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x32(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    -0x24(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x2,%r8d
call   1030 <sla_dd2tf_@plt>
mov    -0x32(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
movl   $0x0,-0x54(%rbp)
cmpl   $0x4,-0x54(%rbp)
jge    119d <slaDd2tf+0x8d>
movslq -0x54(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%edx
mov    -0x20(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1172 <slaDd2tf+0x62>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaDd2tf>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
movsd  %xmm0,0x8(%rsp)
lea    0x4(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x2(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    $0x2,%r8d
call   1030 <sla_dd2tf_@plt>
mov    0x2(%rsp),%al
mov    %al,(%rbx)
movb   $0x0,0x1(%rbx)
movaps 0x10(%rsp),%xmm0
movups %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @slaDd2tf(i32 %0, double %1, i8* %2, i32* %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca double
%11 = alloca [2 x i8]
%12 = alloca i32
%13 = alloca [4 x i32]
%14 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
store i32 2, i32* %12
%15 = load i32, i32* %5
store i32 %15, i32* %9
%16 = load double, double* %6
store double %16, double* %10
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%19 = call i32 @sla_dd2tf_(i32* %9, double* %10, i8* %17, i32* %18, i32 2)
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %11, i64 0, i64 0
%21 = load i8, i8* %20
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
%24 = load i8*, i8** %7
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8 0, i8* %25
store i32 0, i32* %14
br label %26
26: ; preds = %38, %4
%27 = load i32, i32* %14
%28 = icmp slt i32 %27, 4
br i1 %28, label %29, label %41
29: ; preds = %26
%30 = load i32, i32* %14
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = load i32*, i32** %8
%35 = load i32, i32* %14
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
store i32 %33, i32* %37
br label %38
38: ; preds = %29
%39 = load i32, i32* %14
%40 = add nsw i32 %39, 1
store i32 %40, i32* %14
br label %26
41: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @slaDd2tf(i32 %0, double %1, i8* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = bitcast i32* %3 to i8*
%6 = alloca i32
%7 = alloca double
%8 = alloca [2 x i8]
%9 = alloca [4 x i32]
%10 = bitcast [4 x i32]* %9 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast double* %7 to i8*
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
store i32 %0, i32* %6
store double %1, double* %7
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%15 = call i32 @sla_dd2tf_(i32* %6, double* %7, i8* %13, i32* %14, i32 2)
%16 = load i8, i8* %13
store i8 %16, i8* %2
%17 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %17
ret void
}