#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 /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ usleep(int);
int main() {
  while (1) {
    putc('P', stderr);
    usleep(1000000);
    putchar(0x255);
    putchar(0x04);
    putchar(0x00);
    putchar(0x00);
    putchar(0x00);
    putchar(0x00);
    putchar(0x00);
    putchar(0x255);
    fflush(stdout);
    fflush(stderr);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    $0x50,%edi
call   1040 <putc@plt>
mov    $0xf4240,%edi
call   1060 <usleep@plt>
mov    $0x255,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0x255,%edi
call   1030 <putchar@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    114f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e95(%rip),%rbx
mov    0x2e86(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx),%esi
mov    $0x50,%edi
call   1040 <putc@plt>
mov    $0xf4240,%edi
call   1060 <usleep@plt>
mov    $0x255,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1030 <putchar@plt>
mov    $0x255,%edi
call   1030 <putchar@plt>
mov    (%r14),%edi
call   1050 <fflush@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* @stderr
%4 = call i32 @putc(i8 signext 80, i32 %3)
%5 = call i32 @usleep(i32 1000000)
%6 = call i32 @putchar(i32 597)
%7 = call i32 @putchar(i32 4)
%8 = call i32 @putchar(i32 0)
%9 = call i32 @putchar(i32 0)
%10 = call i32 @putchar(i32 0)
%11 = call i32 @putchar(i32 0)
%12 = call i32 @putchar(i32 0)
%13 = call i32 @putchar(i32 597)
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
%16 = load i32, i32* @stderr
%17 = call i32 @fflush(i32 %16)
br label %2
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = load i32, i32* @stderr
%3 = tail call i32 @putc(i8 signext 80, i32 %2)
%4 = tail call i32 @usleep(i32 1000000)
%5 = tail call i32 @putchar(i32 597)
%6 = tail call i32 @putchar(i32 4)
%7 = tail call i32 @putchar(i32 0)
%8 = tail call i32 @putchar(i32 0)
%9 = tail call i32 @putchar(i32 0)
%10 = tail call i32 @putchar(i32 0)
%11 = tail call i32 @putchar(i32 0)
%12 = tail call i32 @putchar(i32 597)
%13 = load i32, i32* @stdout
%14 = tail call i32 @fflush(i32 %13)
%15 = load i32, i32* @stderr
%16 = tail call i32 @fflush(i32 %15)
br label %1
}