#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*/ fflush(int /*<<< orphan*/);
int get_telemetry_sequence();
int /*<<< orphan*/ printf(char *, int, float);
int /*<<< orphan*/ read_temp(float *, char *);
int /*<<< orphan*/ stdout;
void print_telemetry(char *fileName) {
  int seq;
  float temp;
  if (!read_temp(&temp, fileName)) {
    seq = get_telemetry_sequence();
    temp += 40;
    temp /= 0.16016;
    printf("T#%03d,%.0f,000,000,000,000,00000000\n", seq, temp);
    fflush(stdout);
  }
}


x86 assembly (clang, -O0):
<print_telemetry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdi
call   1060 <read_temp@plt>
cmp    $0x0,%eax
jne    11be <print_telemetry+0x7e>
mov    $0x0,%al
call   1040 <get_telemetry_sequence@plt>
mov    %eax,-0xc(%rbp)
movss  0xe94(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe71(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%esi
movss  -0x10(%rbp),%xmm0
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_telemetry>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
call   1060 <read_temp@plt>
test   %eax,%eax
je     1154 <print_telemetry+0x14>
pop    %rax
ret
xor    %eax,%eax
call   1040 <get_telemetry_sequence@plt>
movss  0x4(%rsp),%xmm0
addss  0xe97(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xe93(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0xe8a(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"T#%03d,%.0f,000,000,000,000,00000000\0A\00"
@stdout = global i32 0
define void @print_telemetry(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @read_temp(float* %4, i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %21, label %8
8: ; preds = %1
%9 = call i32 (...) @get_telemetry_sequence()
store i32 %9, i32* %3
%10 = load float, float* %4
%11 = fadd float %10, 4.000000e+01
store float %11, float* %4
%12 = load float, float* %4
%13 = fpext float %12 to double
%14 = fdiv double %13, 1.601600e-01
%15 = fptrunc double %14 to float
store float %15, float* %4
%16 = load i32, i32* %3
%17 = load float, float* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %16, float %17)
%19 = load i32, i32* @stdout
%20 = call i32 @fflush(i32 %19)
br label %21
21: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"T#%03d,%.0f,000,000,000,000,00000000\0A\00"
@stdout = global i32 0
define void @print_telemetry(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @read_temp(float* %2, i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = call i32 (...) @get_telemetry_sequence()
%8 = load float, float* %2
%9 = fadd float %8, 4.000000e+01
%10 = fpext float %9 to double
%11 = fdiv double %10, 1.601600e-01
%12 = fptrunc double %11 to float
store float %12, float* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7, float %12)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
br label %16
16: ; preds = %6, %1
ret void
}