#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*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  char x = 0xff;
  unsigned char y = 0xff;
  printf("x = %02hx, %02hx\n", x, y);
  printf("x = %02hx, %02hx\n", x & 0xff, y);
  printf("x = %hhx, %hhx\n", x, y);
  char c = '\a';
  printf("char is %%c\t\t:value=%c\n", '\a');
  long unsigned int lu = 999999999;
  printf("long unsigned int %%lu: value=%lu\n", lu);
  int percent = 0;
  do {
    printf("Rceiving %d%%\r", percent);
    fflush(stdout);
    percent++;
    sleep(1);
  } while (percent < 100);
  const int NUM = 50;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0xff,-0x11(%rbp)
movb   $0xff,-0x12(%rbp)
movsbl -0x11(%rbp),%esi
movzbl -0x12(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x11(%rbp),%esi
and    $0xff,%esi
movzbl -0x12(%rbp),%edx
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x11(%rbp),%esi
movzbl -0x12(%rbp),%edx
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x7,-0x13(%rbp)
lea    0xe81(%rip),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x3b9ac9ff,-0x20(%rbp)
3b
mov    -0x20(%rbp),%rax
mov    %eax,%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    $0x1,%edi
call   1050 <sleep@plt>
cmpl   $0x64,-0x24(%rbp)
jl     11d0 <main+0xa0>
movl   $0x32,-0x28(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xec5(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    $0xff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
mov    $0xff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea8(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0xff,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x3b9ac9ff,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb5(%rip),%r14
mov    0x2e31(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
add    $0x1,%ebp
mov    $0x1,%edi
call   1050 <sleep@plt>
cmp    $0x64,%ebp
jne    11c0 <main+0x90>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"x = %02hx, %02hx\0A\00"
@.str.1 = [16 x i8] c"x = %hhx, %hhx\0A\00"
@.str.2 = [24 x i8] c"char is %%c\09\09:value=%c\0A\00"
@.str.3 = [35 x i8] c"long unsigned int %%lu: value=%lu\0A\00"
@.str.4 = [15 x i8] c"Rceiving %d%%\0D\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 -1, i8* %6
store i8 -1, i8* %7
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = load i8, i8* %7
%15 = zext i8 %14 to i32
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15)
%17 = load i8, i8* %6
%18 = sext i8 %17 to i32
%19 = and i32 %18, 255
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %21)
%23 = load i8, i8* %6
%24 = sext i8 %23 to i32
%25 = load i8, i8* %7
%26 = zext i8 %25 to i32
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %26)
store i8 7, i8* %8
%28 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 7)
store i64 999999999, i64* %9
%29 = load i64, i64* %9
%30 = trunc i64 %29 to i32
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %30)
store i32 0, i32* %10
br label %32
32: ; preds = %40, %2
%33 = load i32, i32* %10
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %33)
%35 = load i32, i32* @stdout
%36 = call i32 @fflush(i32 %35)
%37 = load i32, i32* %10
%38 = add nsw i32 %37, 1
store i32 %38, i32* %10
%39 = call i32 @sleep(i32 1)
br label %40
40: ; preds = %32
%41 = load i32, i32* %10
%42 = icmp slt i32 %41, 100
br i1 %42, label %32, label %43
43: ; preds = %40
store i32 50, i32* %11
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [18 x i8] c"x = %02hx, %02hx\0A\00"
@.str.1 = [16 x i8] c"x = %hhx, %hhx\0A\00"
@.str.2 = [24 x i8] c"char is %%c\09\09:value=%c\0A\00"
@.str.3 = [35 x i8] c"long unsigned int %%lu: value=%lu\0A\00"
@.str.4 = [15 x i8] c"Rceiving %d%%\0D\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 -1, i32 255)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 255, i32 255)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 -1, i32 255)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 7)
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 999999999)
br label %8
8: ; preds = %8, %2
%9 = phi i32 [ 0, %2 ], [ %13, %8 ]
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fflush(i32 %11)
%13 = add nuw nsw i32 %9, 1
%14 = tail call i32 @sleep(i32 1)
%15 = icmp eq i32 %13, 100
br i1 %15, label %16, label %8
16: ; preds = %8
ret i32 0
}