#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*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, unsigned char *, int);
void show_char_set(void) {
  unsigned char c;
  int i;
  int j;
  j = 0;
  for (i = 0; i < 256; i++) {
    c = i;
    write(STDOUT_FILENO, &c, 1);
    j++;
    if (j == 16) {
      c = 10;
      write(STDOUT_FILENO, &c, 1);
      j = 0;
    }
  }
}


x86 assembly (clang, -O0):
<show_char_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1198 <show_char_set+0x88>
mov    -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jne    1185 <show_char_set+0x75>
movb   $0xa,-0x1(%rbp)
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
movl   $0x0,-0xc(%rbp)
jmp    118a <show_char_set+0x7a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <show_char_set+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_char_set>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
mov    0x2ed0(%rip),%r14
lea    0x7(%rsp),%r15
xor    %ebp,%ebp
jmp    113b <show_char_set+0x2b>
nopl   0x0(%rax)
add    $0x1,%ebp
cmp    $0x100,%ebp
je     1171 <show_char_set+0x61>
mov    %bpl,0x7(%rsp)
mov    (%r14),%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x1,%ebx
cmp    $0x10,%ebx
jne    1130 <show_char_set+0x20>
movb   $0xa,0x7(%rsp)
mov    (%r14),%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ebx,%ebx
jmp    1130 <show_char_set+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @show_char_set() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %3
store i32 0, i32* %2
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i32, i32* @STDOUT_FILENO
%11 = call i32 @write(i32 %10, i8* %1, i32 1)
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 16
br i1 %15, label %16, label %19
16: ; preds = %7
store i8 10, i8* %1
%17 = load i32, i32* @STDOUT_FILENO
%18 = call i32 @write(i32 %17, i8* %1, i32 1)
store i32 0, i32* %3
br label %19
19: ; preds = %16, %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @show_char_set() {
%1 = alloca i8
br label %2
2: ; preds = %0, %13
%3 = phi i32 [ 0, %0 ], [ %14, %13 ]
%4 = phi i32 [ 0, %0 ], [ %15, %13 ]
%5 = trunc i32 %4 to i8
store i8 %5, i8* %1
%6 = load i32, i32* @STDOUT_FILENO
%7 = call i32 @write(i32 %6, i8* %1, i32 1)
%8 = add nsw i32 %3, 1
%9 = icmp eq i32 %8, 16
br i1 %9, label %10, label %13
10: ; preds = %2
store i8 10, i8* %1
%11 = load i32, i32* @STDOUT_FILENO
%12 = call i32 @write(i32 %11, i8* %1, i32 1)
br label %13
13: ; preds = %2, %10
%14 = phi i32 [ 0, %10 ], [ %8, %2 ]
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %15, 256
br i1 %16, label %17, label %2
17: ; preds = %13
ret void
}