#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 */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int /*<<< orphan*/ IDLog(char *, char *);
int /*<<< orphan*/ getSexComponents(double, int *, int *, int *);
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int, int, int);
int setObjectDEC(double dec) {
  int d, m, s;
  char tempString[16];
  getSexComponents(dec, &d, &m, &s);
  if (!d && dec < 0)
    snprintf(tempString, sizeof(tempString), "#:Sd -%02d:%02d:%02d#", d, m, s);
  else
    snprintf(tempString, sizeof(tempString), "#:Sd %+03d:%02d:%02d#", d, m, s);
  IDLog("Set Object DEC String %s\n", tempString);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setObjectDEC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1060 <getSexComponents@plt>
cmpl   $0x0,-0xc(%rbp)
jne    11a0 <setObjectDEC+0x60>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11a0 <setObjectDEC+0x60>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    $0x10,%esi
lea    0xe6a(%rip),%rdx
call   1040 <snprintf@plt>
jmp    11c0 <setObjectDEC+0x80>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    $0x10,%esi
lea    0xe5b(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1050 <IDLog@plt>
lea    -0x30(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setObjectDEC>:
push   %rbx
sub    $0x30,%rsp
movsd  %xmm0,0x18(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1060 <getSexComponents@plt>
mov    0x14(%rsp),%ecx
xorpd  %xmm0,%xmm0
ucomisd 0x18(%rsp),%xmm0
mov    0x10(%rsp),%r8d
mov    0xc(%rsp),%r9d
jbe    1192 <setObjectDEC+0x52>
test   %ecx,%ecx
jne    1192 <setObjectDEC+0x52>
lea    0xe7c(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x10,%esi
xor    %ecx,%ecx
jmp    11a3 <setObjectDEC+0x63>
lea    0xe7d(%rip),%rdx
lea    0x20(%rsp),%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
lea    0xe7d(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <IDLog@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"#:Sd -%02d:%02d:%02d#\00"
@.str.1 = [22 x i8] c"#:Sd %+03d:%02d:%02d#\00"
@.str.2 = [26 x i8] c"Set Object DEC String %s\0A\00"
define i32 @setObjectDEC(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [16 x i8]
store double %0, double* %2
%7 = load double, double* %2
%8 = call i32 @getSexComponents(double %7, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, 0
br i1 %10, label %20, label %11
11: ; preds = %1
%12 = load double, double* %2
%13 = fcmp olt double %12, 0.000000e+00
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @snprintf(i8* %15, i32 16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %18)
br label %26
20: ; preds = %11, %1
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = call i32 @snprintf(i8* %21, i32 16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %20, %14
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%28 = call i32 @IDLog(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %27)
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%30 = call i32 @setStandardProcedure(i8* %29)
ret i32 %30
}

LLVM IR (-O2):
@.str = [22 x i8] c"#:Sd -%02d:%02d:%02d#\00"
@.str.1 = [22 x i8] c"#:Sd %+03d:%02d:%02d#\00"
@.str.2 = [26 x i8] c"Set Object DEC String %s\0A\00"
define i32 @setObjectDEC(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [16 x i8]
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%10 = call i32 @getSexComponents(double %0, i32* %2, i32* %3, i32* %4)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
%13 = fcmp olt double %0, 0.000000e+00
%14 = and i1 %13, %12
%15 = load i32, i32* %3
%16 = load i32, i32* %4
br i1 %14, label %17, label %19
17: ; preds = %1
%18 = call i32 @snprintf(i8* %9, i32 16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 0, i32 %15, i32 %16)
br label %21
19: ; preds = %1
%20 = call i32 @snprintf(i8* %9, i32 16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %15, i32 %16)
br label %21
21: ; preds = %19, %17
%22 = call i32 @IDLog(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%23 = call i32 @setStandardProcedure(i8* %9)
ret i32 %23
}