#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 inclino_getX_value(int);
float inclino_getY_value(int);
int /*<<< orphan*/ memcpy(unsigned char *, char *, int);
int /*<<< orphan*/ printf(char *);
float rot_get_value(int);
int /*<<< orphan*/ snprintf(char *, int, char *, float, float, float, float,
                            float, float);
int /*<<< orphan*/ socket_tx(unsigned char *, int);
int strlen(char *);
void sendSensorsValues(void) {
  char to_send[64] = {'\0'};
  float fleche_value = 0;
  float levage_value = 0;
  float porte_value = 0;
  float inclinoX_value = 0;
  float inclinoY_value = 0;
  float tamis_value = 0;
  int length;
  fleche_value = rot_get_value(3);
  levage_value = rot_get_value(2);
  porte_value = rot_get_value(1);
  tamis_value = rot_get_value(6);
  inclinoX_value = inclino_getX_value(4);
  inclinoY_value = inclino_getY_value(5);
  snprintf(to_send, 64, "/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/", fleche_value,
           levage_value, porte_value, inclinoX_value, inclinoY_value,
           tamis_value);
  length = strlen(to_send);
  unsigned char toSend[256];
  if (length > 256) {
    printf("[ERROR ]: sendSensorsValues(), length > TAB_MAX_SIZE\n");
    return;
  }
  toSend[0] = 0xE1;
  memcpy(&toSend[1], to_send, length);
  socket_tx(toSend, length + 1);
}


x86 assembly (clang, -O0):
<sendSensorsValues>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1070 <memset@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x58(%rbp)
mov    $0x3,%edi
call   1030 <rot_get_value@plt>
movss  %xmm0,-0x44(%rbp)
mov    $0x2,%edi
call   1030 <rot_get_value@plt>
movss  %xmm0,-0x48(%rbp)
mov    $0x1,%edi
call   1030 <rot_get_value@plt>
movss  %xmm0,-0x4c(%rbp)
mov    $0x6,%edi
call   1030 <rot_get_value@plt>
movss  %xmm0,-0x58(%rbp)
mov    $0x4,%edi
call   10b0 <inclino_getX_value@plt>
movss  %xmm0,-0x50(%rbp)
mov    $0x5,%edi
call   1090 <inclino_getY_value@plt>
movss  %xmm0,-0x54(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x44(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
movss  -0x4c(%rbp),%xmm2
movss  -0x50(%rbp),%xmm3
movss  -0x54(%rbp),%xmm4
movss  -0x58(%rbp),%xmm5
mov    $0x40,%esi
lea    0xd9d(%rip),%rdx
call   1060 <snprintf@plt>
lea    -0x40(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x5c(%rbp)
cmpl   $0x100,-0x5c(%rbp)
jle    1292 <sendSensorsValues+0x102>
lea    0xd98(%rip),%rdi
call   1050 <printf@plt>
jmp    12c2 <sendSensorsValues+0x132>
movb   $0xe1,-0x160(%rbp)
lea    -0x160(%rbp),%rdi
add    $0x1,%rdi
lea    -0x40(%rbp),%rsi
mov    -0x5c(%rbp),%edx
call   10a0 <memcpy@plt>
lea    -0x160(%rbp),%rdi
mov    -0x5c(%rbp),%esi
add    $0x1,%esi
call   1080 <socket_tx@plt>
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendSensorsValues>:
push   %rbx
sub    $0x160,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
mov    $0x3,%edi
call   1040 <rot_get_value@plt>
movss  %xmm0,0x1c(%rsp)
mov    $0x2,%edi
call   1040 <rot_get_value@plt>
movss  %xmm0,0x18(%rsp)
mov    $0x1,%edi
call   1040 <rot_get_value@plt>
movss  %xmm0,0x14(%rsp)
mov    $0x6,%edi
call   1040 <rot_get_value@plt>
movss  %xmm0,0x10(%rsp)
mov    $0x4,%edi
call   10a0 <inclino_getX_value@plt>
movss  %xmm0,0xc(%rsp)
mov    $0x5,%edi
call   1080 <inclino_getY_value@plt>
movaps %xmm0,%xmm4
lea    0xdfd(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
movss  0x1c(%rsp),%xmm0
movss  0x18(%rsp),%xmm1
movss  0x14(%rsp),%xmm2
movss  0xc(%rsp),%xmm3
movss  0x10(%rsp),%xmm5
call   1060 <snprintf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x101,%eax
jl     1250 <sendSensorsValues+0xd0>
lea    0xdd7(%rip),%rdi
call   1030 <puts@plt>
jmp    1277 <sendSensorsValues+0xf7>
mov    %eax,%ebx
movb   $0xe1,0x60(%rsp)
lea    0x61(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %eax,%edx
call   1090 <memcpy@plt>
add    $0x1,%ebx
lea    0x60(%rsp),%rdi
mov    %ebx,%esi
call   1070 <socket_tx@plt>
add    $0x160,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/\00"
@.str.1 = [54 x i8] c"[ERROR ]: sendSensorsValues(), length > TAB_MAX_SIZE\0A\00"
define void @sendSensorsValues() {
%1 = alloca [64 x i8]
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = bitcast [64 x i8]* %1 to i8*
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %7
%11 = call float @rot_get_value(i32 3)
store float %11, float* %2
%12 = call float @rot_get_value(i32 2)
store float %12, float* %3
%13 = call float @rot_get_value(i32 1)
store float %13, float* %4
%14 = call float @rot_get_value(i32 6)
store float %14, float* %7
%15 = call float @inclino_getX_value(i32 4)
store float %15, float* %5
%16 = call float @inclino_getY_value(i32 5)
store float %16, float* %6
%17 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%18 = load float, float* %2
%19 = load float, float* %3
%20 = load float, float* %4
%21 = load float, float* %5
%22 = load float, float* %6
%23 = load float, float* %7
%24 = call i32 @snprintf(i8* %17, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), float %18, float %19, float %20, float %21, float %22, float %23)
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%26 = call i32 @strlen(i8* %25)
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = icmp sgt i32 %27, 256
br i1 %28, label %29, label %31
29: ; preds = %0
%30 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %41
31: ; preds = %0
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
store i8 -31, i8* %32
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 1
%34 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%35 = load i32, i32* %8
%36 = call i32 @memcpy(i8* %33, i8* %34, i32 %35)
%37 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%38 = load i32, i32* %8
%39 = add nsw i32 %38, 1
%40 = call i32 @socket_tx(i8* %37, i32 %39)
br label %41
41: ; preds = %31, %29
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/\00"
@str = [53 x i8] c"[ERROR ]: sendSensorsValues(), length > TAB_MAX_SIZE\00"
define void @sendSensorsValues() {
%1 = alloca [64 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%4 = tail call float @rot_get_value(i32 3)
%5 = tail call float @rot_get_value(i32 2)
%6 = tail call float @rot_get_value(i32 1)
%7 = tail call float @rot_get_value(i32 6)
%8 = tail call float @inclino_getX_value(i32 4)
%9 = tail call float @inclino_getY_value(i32 5)
%10 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), float %4, float %5, float %6, float %8, float %9, float %7)
%11 = call i32 @strlen(i8* %3)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%13 = icmp sgt i32 %11, 256
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
br label %21
16: ; preds = %0
store i8 -31, i8* %12
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 1
%18 = call i32 @memcpy(i8* %17, i8* %3, i32 %11)
%19 = add nsw i32 %11, 1
%20 = call i32 @socket_tx(i8* %12, i32 %19)
br label %21
21: ; preds = %16, %14
ret void
}