#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() {
  int c;
  printf("testing all characters...");
  for (c = 0; c < 256; c++) {
    if (c % 10 == 0)
      printf("\ntesting characters %d-%d...\n", c,
             ((c + 9) < (255) ? (c + 9) : (255)));
    printf("%c", c);
  }
  printf("\ndone.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    11ba <main+0xaa>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119b <main+0x8b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x9,%eax
cmp    $0xff,%eax
jge    117a <main+0x6a>
mov    -0x8(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x10(%rbp)
jmp    1187 <main+0x77>
mov    $0xff,%eax
mov    %eax,-0x10(%rbp)
jmp    1187 <main+0x77>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x24>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed2(%rip),%rbx
xor    %ebp,%ebp
jmp    1162 <main+0x32>
nopl   0x0(%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
je     119a <main+0x6a>
movzbl %bpl,%eax
imul   $0xcd,%eax,%ecx
shr    $0xa,%ecx
and    $0xfffffffe,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %cl,%al
jne    1150 <main+0x20>
cmp    $0xf6,%ebp
mov    $0xf6,%edx
cmovb  %ebp,%edx
add    $0x9,%edx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1150 <main+0x20>
lea    0xe97(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"testing all characters...\00"
@.str.1 = [30 x i8] c"\0Atesting characters %d-%d...\0A\00"
@str = [7 x i8] c"\0Adone.\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %12
%3 = phi i32 [ 0, %0 ], [ %14, %12 ]
%4 = trunc i32 %3 to i8
%5 = urem i8 %4, 10
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = icmp ult i32 %3, 246
%9 = select i1 %8, i32 %3, i32 246
%10 = add nuw nsw i32 %9, 9
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %10)
br label %12
12: ; preds = %7, %2
%13 = tail call i32 @putchar(i32 %3)
%14 = add nuw nsw i32 %3, 1
%15 = icmp eq i32 %14, 256
br i1 %15, label %16, label %2
16: ; preds = %12
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}