#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*/ print_decimal(int);
int /*<<< orphan*/ print_decimal_n(int, int);
int /*<<< orphan*/ putc(char);
void print_float_ss(float val) {
  int ip, fp, sg;
  sg = 0;
  if (val < 0.0f) {
    val = -val;
    sg = 1;
  }
  ip = (int)val;
  fp = (int)((val - ip) * 1000000);
  if (sg)
    putc('-');
  print_decimal(ip);
  putc('.');
  print_decimal_n(fp, 6);
}


x86 assembly (clang, -O0):
<print_float_ss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    116f <print_float_ss+0x3f>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0xe73(%rip),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     11ac <print_float_ss+0x7c>
mov    $0x2d,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%edi
call   1040 <print_decimal@plt>
mov    $0x2e,%edi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
mov    $0x6,%esi
call   1050 <print_decimal_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_float_ss>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
movaps 0xebd(%rip),%xmm2
xorps  %xmm0,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm1,%xmm3
andps  %xmm3,%xmm2
andnps %xmm0,%xmm3
orps   %xmm2,%xmm3
cvttss2si %xmm3,%ebx
jbe    116f <print_float_ss+0x3f>
mov    $0x2d,%edi
movaps %xmm3,(%rsp)
call   1030 <putc@plt>
movaps (%rsp),%xmm3
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
subss  %xmm0,%xmm3
mulss  0xe8e(%rip),%xmm3
cvttss2si %xmm3,%ebp
mov    %ebx,%edi
call   1040 <print_decimal@plt>
mov    $0x2e,%edi
call   1030 <putc@plt>
mov    %ebp,%edi
mov    $0x6,%esi
add    $0x18,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print_decimal_n@plt>

LLVM IR (-O0):
define void @print_float_ss(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
store i32 0, i32* %5
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %2
%10 = fneg float %9
store float %10, float* %2
store i32 1, i32* %5
br label %11
11: ; preds = %8, %1
%12 = load float, float* %2
%13 = fptosi float %12 to i32
store i32 %13, i32* %3
%14 = load float, float* %2
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to float
%17 = fsub float %14, %16
%18 = fmul float %17, 1.000000e+06
%19 = fptosi float %18 to i32
store i32 %19, i32* %4
%20 = load i32, i32* %5
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %11
%23 = call i32 @putc(i8 signext 45)
br label %24
24: ; preds = %22, %11
%25 = load i32, i32* %3
%26 = call i32 @print_decimal(i32 %25)
%27 = call i32 @putc(i8 signext 46)
%28 = load i32, i32* %4
%29 = call i32 @print_decimal_n(i32 %28, i32 6)
ret void
}

LLVM IR (-O2):
define void @print_float_ss(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fptosi float %4 to i32
br i1 %2, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @putc(i8 signext 45)
br label %8
8: ; preds = %6, %1
%9 = sitofp i32 %5 to float
%10 = fsub float %4, %9
%11 = fmul float %10, 1.000000e+06
%12 = fptosi float %11 to i32
%13 = tail call i32 @print_decimal(i32 %5)
%14 = tail call i32 @putc(i8 signext 46)
%15 = tail call i32 @print_decimal_n(i32 %12, i32 6)
ret void
}