#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*/ print_char_verb_latex(unsigned char const);
int /*<<< orphan*/ printf(char *, ...);
void report_alphabet(const unsigned char *alphabet) {
  unsigned char letter;
  while (*alphabet) {
    if (*alphabet == *(alphabet + 1)) {
      printf("'");
      print_char_verb_latex(*alphabet);
      printf("'(%d)%s", *alphabet, *(alphabet + 2) != '\0' ? ", " : ".\n");
    } else {
      printf("'");
      for (letter = *alphabet; letter <= *(alphabet + 1); letter++)
        print_char_verb_latex(letter);
      printf("'(%d-%d)%s", *alphabet, *(alphabet + 1),
             *(alphabet + 2) != '\0' ? ", " : ".\n");
    }
    alphabet += 2;
  }
}


x86 assembly (clang, -O0):
<report_alphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     122d <report_alphabet+0x10d>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jne    11a1 <report_alphabet+0x81>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <print_char_verb_latex@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
lea    0xe8d(%rip),%rdx
lea    0xe83(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121c <report_alphabet+0xfc>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jg     11e2 <report_alphabet+0xc2>
movzbl -0x9(%rbp),%edi
call   1040 <print_char_verb_latex@plt>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    11b8 <report_alphabet+0x98>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edi
lea    0xe0d(%rip),%rcx
lea    0xe03(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%rcx
lea    0xdfb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <report_alphabet+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_alphabet>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    (%rdi),%r14b
test   %r14b,%r14b
je     11ed <report_alphabet+0xbd>
mov    %rdi,%rbx
lea    0xeba(%rip),%r12
lea    0xeb0(%rip),%r13
jmp    1192 <report_alphabet+0x62>
nopw   0x0(%rax,%rax,1)
movzbl %bpl,%edi
call   1050 <print_char_verb_latex@plt>
movzbl (%rbx),%esi
cmpb   $0x0,0x2(%rbx)
mov    %r13,%rdx
cmove  %r12,%rdx
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2(%rbx),%r14b
add    $0x2,%rbx
test   %r14b,%r14b
je     11ed <report_alphabet+0xbd>
mov    0x1(%rbx),%r15b
mov    $0x27,%edi
call   1030 <putchar@plt>
mov    (%rbx),%bpl
cmp    %r15b,%r14b
je     1160 <report_alphabet+0x30>
mov    0x1(%rbx),%al
cmp    %al,%bpl
ja     11cb <report_alphabet+0x9b>
movzbl %bpl,%ebp
mov    %ebp,%edi
call   1050 <print_char_verb_latex@plt>
add    $0x1,%bpl
movzbl 0x1(%rbx),%eax
cmp    %al,%bpl
jbe    11b0 <report_alphabet+0x80>
mov    (%rbx),%bpl
movzbl %al,%edx
movzbl %bpl,%esi
cmpb   $0x0,0x2(%rbx)
mov    %r13,%rcx
cmove  %r12,%rcx
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1185 <report_alphabet+0x55>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"'\00"
@.str.1 = [8 x i8] c"'(%d)%s\00"
@.str.2 = [3 x i8] c", \00"
@.str.3 = [3 x i8] c".\0A\00"
@.str.4 = [11 x i8] c"'(%d-%d)%s\00"
define void @report_alphabet(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %67, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %70
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %11, %15
br i1 %16, label %17, label %33
17: ; preds = %8
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = call i32 @print_char_verb_latex(i8 zeroext %20)
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 2
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i64
%31 = select i1 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %24, i8* %31)
br label %67
33: ; preds = %8
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%35 = load i8*, i8** %2
%36 = load i8, i8* %35
store i8 %36, i8* %3
br label %37
37: ; preds = %48, %33
%38 = load i8, i8* %3
%39 = zext i8 %38 to i32
%40 = load i8*, i8** %2
%41 = getelementptr inbounds i8, i8* %40, i64 1
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = icmp sle i32 %39, %43
br i1 %44, label %45, label %51
45: ; preds = %37
%46 = load i8, i8* %3
%47 = call i32 @print_char_verb_latex(i8 zeroext %46)
br label %48
48: ; preds = %45
%49 = load i8, i8* %3
%50 = add i8 %49, 1
store i8 %50, i8* %3
br label %37
51: ; preds = %37
%52 = load i8*, i8** %2
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = load i8*, i8** %2
%56 = getelementptr inbounds i8, i8* %55, i64 1
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = load i8*, i8** %2
%60 = getelementptr inbounds i8, i8* %59, i64 2
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = icmp ne i32 %62, 0
%64 = zext i1 %63 to i64
%65 = select i1 %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %54, i32 %58, i8* %65)
br label %67
67: ; preds = %51, %17
%68 = load i8*, i8** %2
%69 = getelementptr inbounds i8, i8* %68, i64 2
store i8* %69, i8** %2
br label %4
70: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"'(%d)%s\00"
@.str.2 = [3 x i8] c", \00"
@.str.3 = [3 x i8] c".\0A\00"
@.str.4 = [11 x i8] c"'(%d-%d)%s\00"
define void @report_alphabet(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %46, label %4
4: ; preds = %1, %42
%5 = phi i8 [ %44, %42 ], [ %2, %1 ]
%6 = phi i8* [ %43, %42 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %5, %8
%10 = tail call i32 @putchar(i32 39)
%11 = load i8, i8* %6
br i1 %9, label %12, label %21
12: ; preds = %4
%13 = tail call i32 @print_char_verb_latex(i8 zeroext %11)
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = getelementptr inbounds i8, i8* %6, i64 2
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
%19 = select i1 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15, i8* %19)
br label %42
21: ; preds = %4
%22 = load i8, i8* %7
%23 = icmp ugt i8 %11, %22
br i1 %23, label %32, label %24
24: ; preds = %21, %24
%25 = phi i8 [ %27, %24 ], [ %11, %21 ]
%26 = tail call i32 @print_char_verb_latex(i8 zeroext %25)
%27 = add i8 %25, 1
%28 = load i8, i8* %7
%29 = icmp ugt i8 %27, %28
br i1 %29, label %30, label %24
30: ; preds = %24
%31 = load i8, i8* %6
br label %32
32: ; preds = %30, %21
%33 = phi i8 [ %11, %21 ], [ %31, %30 ]
%34 = phi i8 [ %22, %21 ], [ %28, %30 ]
%35 = zext i8 %34 to i32
%36 = zext i8 %33 to i32
%37 = getelementptr inbounds i8, i8* %6, i64 2
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 0
%40 = select i1 %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %36, i32 %35, i8* %40)
br label %42
42: ; preds = %32, %12
%43 = getelementptr inbounds i8, i8* %6, i64 2
%44 = load i8, i8* %43
%45 = icmp eq i8 %44, 0
br i1 %45, label %46, label %4
46: ; preds = %42, %1
ret void
}