#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 *, char, char);
int main() {
  char c = 'a';
  char to = 'z' + 1;
  for (c; c < to; c++) {
    if (c == 'z') {
      c = 'A';
      to = 'Z' + 1;
    }
    if (c == 'Z') {
      c = '1';
      to = '9' + 1;
    }
    printf("%d - %c\n", c, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x7b,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    1184 <main+0x74>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jne    114c <main+0x3c>
movb   $0x41,-0x5(%rbp)
movb   $0x5b,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jne    1161 <main+0x51>
movb   $0x31,-0x5(%rbp)
movb   $0x3a,-0x6(%rbp)
mov    -0x5(%rbp),%al
lea    0xe95(%rip),%rdi
movsbl %al,%esi
movsbl -0x5(%rbp),%edx
call   1030 <printf@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x61,%bpl
mov    $0x7b,%bl
mov    $0x5b,%r12d
mov    $0x31,%r13d
mov    $0x3a,%r15d
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
cmp    $0x7a,%bpl
movzbl %bpl,%eax
mov    $0x41,%ecx
cmove  %ecx,%eax
movzbl %bl,%ebx
cmove  %r12d,%ebx
cmp    $0x5a,%al
cmove  %r13d,%eax
cmove  %r15d,%ebx
movsbl %al,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    $0x1,%bpl
movsbl %bpl,%eax
movzbl %bl,%ecx
cmp    %ecx,%eax
jl     1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 123, i8* %3
%4 = load i8, i8* %2
br label %5
5: ; preds = %25, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %28
11: ; preds = %5
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 122
br i1 %14, label %15, label %16
15: ; preds = %11
store i8 65, i8* %2
store i8 91, i8* %3
br label %16
16: ; preds = %15, %11
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 90
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 49, i8* %2
store i8 58, i8* %3
br label %21
21: ; preds = %20, %16
%22 = load i8, i8* %2
%23 = load i8, i8* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %22, i8 signext %23)
br label %25
25: ; preds = %21
%26 = load i8, i8* %2
%27 = add i8 %26, 1
store i8 %27, i8* %2
br label %5
28: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d - %c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 123, %0 ], [ %9, %1 ]
%3 = phi i8 [ 97, %0 ], [ %11, %1 ]
%4 = icmp eq i8 %3, 122
%5 = select i1 %4, i8 65, i8 %3
%6 = select i1 %4, i8 91, i8 %2
%7 = icmp eq i8 %5, 90
%8 = select i1 %7, i8 49, i8 %5
%9 = select i1 %7, i8 58, i8 %6
%10 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %8)
%11 = add i8 %8, 1
%12 = sext i8 %11 to i32
%13 = zext i8 %9 to i32
%14 = icmp slt i32 %12, %13
br i1 %14, label %1, label %15
15: ; preds = %1
ret i32 0
}