#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*/ printf(char *, ...);
int main() {
  char ascii[128];
  for (int i = 1; i <= 126; i++) {
    ascii[i] = i;
    if (i < 31 || i == 127) {
      printf("*");
    } else {
      printf("%c", ascii[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
cmpl   $0x7e,-0x94(%rbp)
jg     11b2 <main+0xa2>
mov    -0x94(%rbp),%eax
mov    %al,%cl
movslq -0x94(%rbp),%rax
mov    %cl,-0x90(%rbp,%rax,1)
cmpl   $0x1f,-0x94(%rbp)
jl     1169 <main+0x59>
cmpl   $0x7f,-0x94(%rbp)
jne    117c <main+0x6c>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1199 <main+0x89>
movslq -0x94(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%esi
ff
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119e <main+0x8e>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    112c <main+0x1c>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebx
mov    $0x2a,%ebp
nopl   (%rax)
cmp    $0x1f,%ebx
mov    %ebx,%edi
cmovb  %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
cmp    $0x7f,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %4
4: ; preds = %28, %0
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 126
br i1 %6, label %7, label %31
7: ; preds = %4
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %11
store i8 %9, i8* %12
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 31
br i1 %14, label %18, label %15
15: ; preds = %7
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 127
br i1 %17, label %18, label %20
18: ; preds = %15, %7
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %27
20: ; preds = %15
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %20, %18
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %4
31: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %7, %2 ]
%4 = icmp ult i32 %3, 31
%5 = select i1 %4, i32 42, i32 %3
%6 = tail call i32 @putchar(i32 %5)
%7 = add nuw nsw i32 %3, 1
%8 = icmp eq i32 %7, 127
br i1 %8, label %1, label %2
}