#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 c1, c2;
  c1 = 0;
  c2 = c1 + 1;
  while (c1 < c2) {
    c1++;
    c2++;
  }
  printf("max char = %d\n", c1);
  int i1, i2;
  i1 = 0;
  i2 = i1 + 1;
  while (i1 < i2) {
    i1++;
    i2++;
  }
  printf("max int = %d\n", i1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    1152 <main+0x42>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x6(%rbp),%al
add    $0x1,%al
mov    %al,-0x6(%rbp)
jmp    112d <main+0x1d>
movsbl -0x5(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1195 <main+0x85>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1172 <main+0x62>
mov    -0xc(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%esi
lea    0x1(%rsi),%eax
cmp    %al,%sil
jl     1120 <main+0x10>
push   %rax
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"max char = %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 1, %0 ], [ %5, %1 ]
%3 = phi i8 [ 0, %0 ], [ %4, %1 ]
%4 = add nuw nsw i8 %3, 1
%5 = add nuw i8 %2, 1
%6 = icmp slt i8 %4, %5
br i1 %6, label %1, label %7
7: ; preds = %1
%8 = zext i8 %4 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8)
unreachable
}