#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 screen_id;
typedef int control_id;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetTextFloat(unsigned short int screen_id, unsigned short int control_id,
                  float value, unsigned char precision,
                  unsigned char show_zeros) {
  unsigned char i = 0;
  SendChar((0XEE) & 0xFF);
  SendChar((0xB1) & 0xFF);
  SendChar((0x07) & 0xFF);
  SendChar(((screen_id) >> 8) & 0xFF);
  SendChar((screen_id)&0xFF);
  SendChar(((control_id) >> 8) & 0xFF);
  SendChar((control_id)&0xFF);
  SendChar((0x02) & 0xFF);
  SendChar(((precision & 0x0f) | (show_zeros ? 0x80 : 0x00)) & 0xFF);
  for (i = 0; i < 4; ++i) {
    SendChar((((unsigned char *)&value)[i]) & 0xFF);
  }
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetTextFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movb   $0x0,-0xb(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb1,%edi
call   1030 <SendChar@plt>
mov    $0x7,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movzwl -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0x2,%edi
call   1030 <SendChar@plt>
movzbl -0x9(%rbp),%edi
and    $0xf,%edi
movzbl -0xa(%rbp),%edx
xor    %eax,%eax
mov    $0x80,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
or     %eax,%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
movb   $0x0,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
cmp    $0x4,%eax
jge    11fa <SetTextFloat+0xea>
movzbl -0xb(%rbp),%eax
movzbl -0x8(%rbp,%rax,1),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    -0xb(%rbp),%al
add    $0x1,%al
mov    %al,-0xb(%rbp)
jmp    11cc <SetTextFloat+0xbc>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTextFloat>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
movss  %xmm0,0x4(%rsp)
mov    %esi,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
test   %ecx,%ecx
setne  %bpl
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0xb1,%edi
call   1030 <SendChar@plt>
mov    $0x7,%edi
call   1030 <SendChar@plt>
mov    %ebx,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
call   1030 <SendChar@plt>
mov    %r14d,%edi
shr    $0x8,%edi
call   1030 <SendChar@plt>
movzbl %r14b,%edi
call   1030 <SendChar@plt>
mov    $0x2,%edi
call   1030 <SendChar@plt>
and    $0xf,%r15d
shl    $0x7,%ebp
or     %r15d,%ebp
mov    %ebp,%edi
call   1030 <SendChar@plt>
movd   0x4(%rsp),%xmm0
movd   %xmm0,%ebx
movzbl %bl,%edi
call   1030 <SendChar@plt>
movzbl %bh,%edi
call   1030 <SendChar@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <SendChar@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetTextFloat(i16 zeroext %0, i16 zeroext %1, float %2, i8 zeroext %3, i8 zeroext %4) {
%6 = alloca i16
%7 = alloca i16
%8 = alloca float
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
store i16 %0, i16* %6
store i16 %1, i16* %7
store float %2, float* %8
store i8 %3, i8* %9
store i8 %4, i8* %10
store i8 0, i8* %11
%12 = call i32 @SendChar(i32 238)
%13 = call i32 @SendChar(i32 177)
%14 = call i32 @SendChar(i32 7)
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 8
%18 = and i32 %17, 255
%19 = call i32 @SendChar(i32 %18)
%20 = load i16, i16* %6
%21 = zext i16 %20 to i32
%22 = and i32 %21, 255
%23 = call i32 @SendChar(i32 %22)
%24 = load i16, i16* %7
%25 = zext i16 %24 to i32
%26 = ashr i32 %25, 8
%27 = and i32 %26, 255
%28 = call i32 @SendChar(i32 %27)
%29 = load i16, i16* %7
%30 = zext i16 %29 to i32
%31 = and i32 %30, 255
%32 = call i32 @SendChar(i32 %31)
%33 = call i32 @SendChar(i32 2)
%34 = load i8, i8* %9
%35 = zext i8 %34 to i32
%36 = and i32 %35, 15
%37 = load i8, i8* %10
%38 = zext i8 %37 to i32
%39 = icmp ne i32 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i32 128, i32 0
%42 = or i32 %36, %41
%43 = and i32 %42, 255
%44 = call i32 @SendChar(i32 %43)
store i8 0, i8* %11
br label %45
45: ; preds = %58, %5
%46 = load i8, i8* %11
%47 = zext i8 %46 to i32
%48 = icmp slt i32 %47, 4
br i1 %48, label %49, label %61
49: ; preds = %45
%50 = bitcast float* %8 to i8*
%51 = load i8, i8* %11
%52 = zext i8 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = and i32 %55, 255
%57 = call i32 @SendChar(i32 %56)
br label %58
58: ; preds = %49
%59 = load i8, i8* %11
%60 = add i8 %59, 1
store i8 %60, i8* %11
br label %45
61: ; preds = %45
%62 = call i32 @SendChar(i32 255)
%63 = call i32 @SendChar(i32 252)
%64 = call i32 @SendChar(i32 255)
%65 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetTextFloat(i16 zeroext %0, i16 zeroext %1, float %2, i8 zeroext %3, i8 zeroext %4) {
%6 = tail call i32 @SendChar(i32 238)
%7 = tail call i32 @SendChar(i32 177)
%8 = tail call i32 @SendChar(i32 7)
%9 = zext i16 %0 to i32
%10 = lshr i32 %9, 8
%11 = tail call i32 @SendChar(i32 %10)
%12 = and i32 %9, 255
%13 = tail call i32 @SendChar(i32 %12)
%14 = zext i16 %1 to i32
%15 = lshr i32 %14, 8
%16 = tail call i32 @SendChar(i32 %15)
%17 = and i32 %14, 255
%18 = tail call i32 @SendChar(i32 %17)
%19 = tail call i32 @SendChar(i32 2)
%20 = and i8 %3, 15
%21 = zext i8 %20 to i32
%22 = icmp eq i8 %4, 0
%23 = select i1 %22, i32 0, i32 128
%24 = or i32 %23, %21
%25 = tail call i32 @SendChar(i32 %24)
%26 = bitcast float %2 to i32
%27 = and i32 %26, 255
%28 = tail call i32 @SendChar(i32 %27)
%29 = lshr i32 %26, 8
%30 = and i32 %29, 255
%31 = tail call i32 @SendChar(i32 %30)
%32 = lshr i32 %26, 16
%33 = and i32 %32, 255
%34 = tail call i32 @SendChar(i32 %33)
%35 = lshr i32 %26, 24
%36 = tail call i32 @SendChar(i32 %35)
%37 = tail call i32 @SendChar(i32 255)
%38 = tail call i32 @SendChar(i32 252)
%39 = tail call i32 @SendChar(i32 255)
%40 = tail call i32 @SendChar(i32 255)
ret void
}