#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*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *wind_to_dndnfnfnfn(char *target, double dd, double ff) {
  int ix;
  if (dd == (1.7e38) || ff == (1.7e38)) {
    strcpy(target, "/////");
    return target;
  }
  ix = (int)((dd + 2.5) / 5) * 5 * 100 + (int)(ff + 0.5);
  sprintf(target, "%05d", ix);
  return target;
}


x86 assembly (clang, -O0):
<wind_to_dndnfnfnfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1158 <wind_to_dndnfnfnfn+0x38>
jp     1158 <wind_to_dndnfnfnfn+0x38>
jmp    1175 <wind_to_dndnfnfnfn+0x55>
movsd  -0x20(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1192 <wind_to_dndnfnfnfn+0x72>
jp     1192 <wind_to_dndnfnfnfn+0x72>
mov    -0x10(%rbp),%rdi
lea    0xea0(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11e6 <wind_to_dndnfnfnfn+0xc6>
movsd  0xe7e(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
imul   $0x5,%eax,%eax
imul   $0x64,%eax,%eax
movsd  0xe4b(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xe4d(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wind_to_dndnfnfnfn>:
push   %rbx
mov    %rdi,%rbx
ucomisd 0xed4(%rip),%xmm0
jne    1130 <wind_to_dndnfnfnfn+0x10>
jnp    1175 <wind_to_dndnfnfnfn+0x55>
ucomisd 0xec8(%rip),%xmm1
jne    113c <wind_to_dndnfnfnfn+0x1c>
jnp    1175 <wind_to_dndnfnfnfn+0x55>
addsd  0xec4(%rip),%xmm0
divsd  0xec4(%rip),%xmm0
cvttsd2si %xmm0,%eax
addsd  0xec0(%rip),%xmm1
imul   $0x1f4,%eax,%eax
cvttsd2si %xmm1,%edx
add    %eax,%edx
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
jmp    1184 <wind_to_dndnfnfnfn+0x64>
lea    0xea4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"/////\00"
@.str.1 = [5 x i8] c"%05d\00"
define i8* @wind_to_dndnfnfnfn(i8* %0, double %1, double %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store i8* %0, i8** %5
store double %1, double* %6
store double %2, double* %7
%9 = load double, double* %6
%10 = fcmp oeq double %9, 1.700000e+38
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load double, double* %7
%13 = fcmp oeq double %12, 1.700000e+38
br i1 %13, label %14, label %18
14: ; preds = %11, %3
%15 = load i8*, i8** %5
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %5
store i8* %17, i8** %4
br label %33
18: ; preds = %11
%19 = load double, double* %6
%20 = fadd double %19, 2.500000e+00
%21 = fdiv double %20, 5.000000e+00
%22 = fptosi double %21 to i32
%23 = mul nsw i32 %22, 5
%24 = mul nsw i32 %23, 100
%25 = load double, double* %7
%26 = fadd double %25, 5.000000e-01
%27 = fptosi double %26 to i32
%28 = add nsw i32 %24, %27
store i32 %28, i32* %8
%29 = load i8*, i8** %5
%30 = load i32, i32* %8
%31 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = load i8*, i8** %5
store i8* %32, i8** %4
br label %33
33: ; preds = %18, %14
%34 = load i8*, i8** %4
ret i8* %34
}

LLVM IR (-O2):
@.str = [6 x i8] c"/////\00"
@.str.1 = [5 x i8] c"%05d\00"
define i8* @wind_to_dndnfnfnfn(i8* returned %0, double %1, double %2) {
%4 = fcmp oeq double %1, 1.700000e+38
%5 = fcmp oeq double %2, 1.700000e+38
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %18
9: ; preds = %3
%10 = fadd double %1, 2.500000e+00
%11 = fdiv double %10, 5.000000e+00
%12 = fptosi double %11 to i32
%13 = mul i32 %12, 500
%14 = fadd double %2, 5.000000e-01
%15 = fptosi double %14 to i32
%16 = add nsw i32 %13, %15
%17 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %9, %7
ret i8* %0
}