#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 */
float param_getf(char *);
int /*<<< orphan*/ *param_gets(char *);
int /*<<< orphan*/ write_port(char *);
void irc_katr_otacka_cm(void) {
  if (param_gets("irc_katr_otacka_cm") != NULL) {
    float f = 0;
    unsigned char msg[11];
    f = param_getf("irc_katr_otacka_cm");
    f = f * 10;
    msg[0] = '\x10';
    msg[1] = (unsigned char)(f / 256);
    msg[2] = (unsigned char)f % 256;
    write_port((char *)msg);
  }
}


x86 assembly (clang, -O0):
<irc_katr_otacka_cm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec9(%rip),%rdi
call   1030 <param_gets@plt>
cmp    $0x0,%rax
je     11b6 <irc_katr_otacka_cm+0x86>
movl   $0x0,-0x4(%rbp)
lea    0xeac(%rip),%rdi
call   1040 <param_getf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe8d(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movb   $0x10,-0xf(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xe77(%rip),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %al,-0xe(%rbp)
cvttss2si -0x4(%rbp),%eax
movzbl %al,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0xd(%rbp)
lea    -0xf(%rbp),%rdi
call   1050 <write_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_katr_otacka_cm>:
sub    $0x18,%rsp
lea    0xecd(%rip),%rdi
call   1030 <param_gets@plt>
test   %rax,%rax
je     1180 <irc_katr_otacka_cm+0x50>
lea    0xebc(%rip),%rdi
call   1040 <param_getf@plt>
mulss  0xea7(%rip),%xmm0
movb   $0x10,0xd(%rsp)
cvttss2si %xmm0,%eax
mulss  0xe9a(%rip),%xmm0
cvttss2si %xmm0,%ecx
mov    %cl,0xe(%rsp)
mov    %al,0xf(%rsp)
lea    0xd(%rsp),%rdi
call   1050 <write_port@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"irc_katr_otacka_cm\00"
define void @irc_katr_otacka_cm() {
%1 = alloca float
%2 = alloca [11 x i8]
%3 = call i32* @param_gets(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %22
5: ; preds = %0
store float 0.000000e+00, float* %1
%6 = call float @param_getf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store float %6, float* %1
%7 = load float, float* %1
%8 = fmul float %7, 1.000000e+01
store float %8, float* %1
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
store i8 16, i8* %9
%10 = load float, float* %1
%11 = fdiv float %10, 2.560000e+02
%12 = fptoui float %11 to i8
%13 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 1
store i8 %12, i8* %13
%14 = load float, float* %1
%15 = fptoui float %14 to i8
%16 = zext i8 %15 to i32
%17 = srem i32 %16, 256
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 2
store i8 %18, i8* %19
%20 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%21 = call i32 @write_port(i8* %20)
br label %22
22: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"irc_katr_otacka_cm\00"
define void @irc_katr_otacka_cm() {
%1 = alloca [11 x i8]
%2 = tail call i32* @param_gets(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %14, label %4
4: ; preds = %0
%5 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%6 = tail call float @param_getf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = fmul float %6, 1.000000e+01
store i8 16, i8* %5
%8 = fmul float %7, 3.906250e-03
%9 = fptoui float %8 to i8
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 1
store i8 %9, i8* %10
%11 = fptoui float %7 to i8
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 2
store i8 %11, i8* %12
%13 = call i32 @write_port(i8* %5)
br label %14
14: ; preds = %4, %0
ret void
}