#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 */
scalar_t__ mppenc_read_stat(float *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ usleep(int);
int main(int argc, char **argv) {
  float current = 0.0;
  printf("[P 0.00]\n");
  while (1) {
    if (mppenc_read_stat(&current) == 0)
      printf("[P %f]\n", current / 100.0);
    usleep(1 * 1000000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1040 <mppenc_read_stat@plt>
cmp    $0x0,%rax
jne    1192 <main+0x62>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe87(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0xf4240,%edi
call   1050 <usleep@plt>
jmp    115c <main+0x2c>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    0x4(%rsp),%rbx
lea    0xea4(%rip),%r14
jmp    117a <main+0x3a>
cs nopw 0x0(%rax,%rax,1)
mov    $0xf4240,%edi
call   1060 <usleep@plt>
mov    %rbx,%rdi
call   1050 <mppenc_read_stat@plt>
test   %rax,%rax
jne    1170 <main+0x30>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xe67(%rip),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [10 x i8] c"[P 0.00]\0A\00"
@.str.1 = [8 x i8] c"[P %f]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %16
%9 = call i64 @mppenc_read_stat(float* %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = fdiv double %13, 1.000000e+02
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %14)
br label %16
16: ; preds = %11, %8
%17 = call i32 @usleep(i32 1000000)
br label %8
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"[P %f]\0A\00"
@str = [9 x i8] c"[P 0.00]\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %14, %2
%7 = call i64 @mppenc_read_stat(float* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = fdiv double %11, 1.000000e+02
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %12)
br label %14
14: ; preds = %9, %6
%15 = call i32 @usleep(i32 1000000)
br label %6
}