#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*/ jstp_tx_char(int);
int /*<<< orphan*/ jstp_tx_long(unsigned long);
void jstp_tx_float(float v) {
  unsigned long tmp;
  int digit;
  int i;
  if (v < 0)
    jstp_tx_char('-');
  tmp = (unsigned long)v;
  jstp_tx_long(tmp);
  v -= (float)tmp;
  jstp_tx_char('.');
  i = 0;
  while (v > 0 && i < 6) {
    digit = v * 10;
    jstp_tx_char('0' + digit);
    v = (float)v * 10.0F - (float)digit;
    i++;
  }
}


x86 assembly (clang, -O0):
<jstp_tx_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1144 <jstp_tx_float+0x24>
mov    $0x2d,%edi
call   1040 <jstp_tx_char@plt>
movss  -0x4(%rbp),%xmm0
movss  0xeaf(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <jstp_tx_long@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x20(%rbp)
test   %rax,%rax
movss  %xmm0,-0x1c(%rbp)
js     11b9 <jstp_tx_float+0x99>
movss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    $0x2e,%edi
call   1040 <jstp_tx_char@plt>
movl   $0x0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
mov    %al,-0x21(%rbp)
jbe    11fd <jstp_tx_float+0xdd>
cmpl   $0x6,-0x18(%rbp)
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    120d <jstp_tx_float+0xed>
jmp    1266 <jstp_tx_float+0x146>
movss  0xdef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x30,%edi
call   1040 <jstp_tx_char@plt>
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x14(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xdb9(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11dd <jstp_tx_float+0xbd>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jstp_tx_float>:
push   %rbx
sub    $0x10,%rsp
xorps  %xmm1,%xmm1
movaps %xmm0,(%rsp)
ucomiss %xmm0,%xmm1
jbe    113b <jstp_tx_float+0x1b>
mov    $0x2d,%edi
call   1040 <jstp_tx_char@plt>
movaps (%rsp),%xmm0
cvttss2si %xmm0,%rax
mov    %rax,%rcx
sar    $0x3f,%rcx
subss  0xead(%rip),%xmm0
cvttss2si %xmm0,%rbx
and    %rcx,%rbx
or     %rax,%rbx
mov    %rbx,%rdi
call   1030 <jstp_tx_long@plt>
test   %rbx,%rbx
js     1175 <jstp_tx_float+0x55>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
jmp    118d <jstp_tx_float+0x6d>
mov    %rbx,%rax
shr    %rax
and    $0x1,%ebx
or     %rax,%rbx
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
addss  %xmm0,%xmm0
movaps (%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,(%rsp)
mov    $0x2e,%edi
call   1040 <jstp_tx_char@plt>
xorps  %xmm1,%xmm1
movaps (%rsp),%xmm2
ucomiss %xmm1,%xmm2
jbe    11fd <jstp_tx_float+0xdd>
movaps %xmm2,%xmm0
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mulss  0xe3c(%rip),%xmm0
movaps %xmm0,(%rsp)
cvttss2si %xmm0,%edi
add    $0x30,%edi
call   1040 <jstp_tx_char@plt>
movaps (%rsp),%xmm1
cvttps2dq %xmm1,%xmm0
cvtdq2ps %xmm0,%xmm0
subss  %xmm0,%xmm1
ucomiss 0xe1a(%rip),%xmm1
jbe    11fd <jstp_tx_float+0xdd>
movaps %xmm1,%xmm0
lea    0x1(%rbx),%eax
cmp    $0x5,%ebx
mov    %eax,%ebx
jb     11c0 <jstp_tx_float+0xa0>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @jstp_tx_float(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store float %0, float* %2
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @jstp_tx_char(i32 45)
br label %10
10: ; preds = %8, %1
%11 = load float, float* %2
%12 = fptoui float %11 to i64
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = call i32 @jstp_tx_long(i64 %13)
%15 = load i64, i64* %3
%16 = uitofp i64 %15 to float
%17 = load float, float* %2
%18 = fsub float %17, %16
store float %18, float* %2
%19 = call i32 @jstp_tx_char(i32 46)
store i32 0, i32* %5
br label %20
20: ; preds = %28, %10
%21 = load float, float* %2
%22 = fcmp ogt float %21, 0.000000e+00
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %5
%25 = icmp slt i32 %24, 6
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ false, %20 ], [ %25, %23 ]
br i1 %27, label %28, label %42
28: ; preds = %26
%29 = load float, float* %2
%30 = fmul float %29, 1.000000e+01
%31 = fptosi float %30 to i32
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = add nsw i32 48, %32
%34 = call i32 @jstp_tx_char(i32 %33)
%35 = load float, float* %2
%36 = load i32, i32* %4
%37 = sitofp i32 %36 to float
%38 = fneg float %37
%39 = call float @llvm.fmuladd.f32(float %35, float 1.000000e+01, float %38)
store float %39, float* %2
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %20
42: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @jstp_tx_float(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @jstp_tx_char(i32 45)
br label %5
5: ; preds = %3, %1
%6 = fptoui float %0 to i64
%7 = tail call i32 @jstp_tx_long(i64 %6)
%8 = uitofp i64 %6 to float
%9 = fsub float %0, %8
%10 = tail call i32 @jstp_tx_char(i32 46)
%11 = fcmp ogt float %9, 0.000000e+00
br i1 %11, label %12, label %26
12: ; preds = %5, %12
%13 = phi i32 [ %22, %12 ], [ 0, %5 ]
%14 = phi float [ %21, %12 ], [ %9, %5 ]
%15 = fmul float %14, 1.000000e+01
%16 = fptosi float %15 to i32
%17 = add nsw i32 %16, 48
%18 = tail call i32 @jstp_tx_char(i32 %17)
%19 = sitofp i32 %16 to float
%20 = fneg float %19
%21 = tail call float @llvm.fmuladd.f32(float %14, float 1.000000e+01, float %20)
%22 = add nuw nsw i32 %13, 1
%23 = fcmp ogt float %21, 0.000000e+00
%24 = icmp ult i32 %13, 5
%25 = select i1 %23, i1 %24, i1 false
br i1 %25, label %12, label %26
26: ; preds = %12, %5
ret void
}