#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 *);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int strlen(char *);
void print_enum_list(int c, int first, int last) {
  char string[80];
  int i;
  string[0] = 0;
  for (i = first; i <= last; i++) {
    if (strlen(string) > 65) {
      printf("    %s\n", string);
      string[0] = 0;
    }
    sprintf(string + strlen(string), "%c%d, ", c, i);
  }
  if (strlen(string) > 0) {
    printf("    %s\n", string);
    string[0] = 0;
  }
}


x86 assembly (clang, -O0):
<print_enum_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movb   $0x0,-0x60(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11b7 <print_enum_list+0x87>
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x41,%eax
jle    117d <print_enum_list+0x4d>
lea    -0x60(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
movb   $0x0,-0x60(%rbp)
lea    -0x60(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x70(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x4(%rbp),%edx
mov    -0x64(%rbp),%ecx
lea    0xe64(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    114b <print_enum_list+0x1b>
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jle    11dd <print_enum_list+0xad>
lea    -0x60(%rbp),%rsi
lea    0xe2c(%rip),%rdi
call   1040 <printf@plt>
movb   $0x0,-0x60(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_enum_list>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movb   $0x0,(%rsp)
cmp    %edx,%esi
jle    1170 <print_enum_list+0x40>
mov    %rsp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <print_enum_list+0x31>
lea    0xea7(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%r14d
add    $0x1,%r15d
mov    %rsp,%rbx
lea    0xe7a(%rip),%r12
lea    0xe7b(%rip),%r13
jmp    11b3 <print_enum_list+0x83>
nop
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
lea    (%rsp,%rax,1),%rdi
mov    %r13,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1050 <sprintf@plt>
add    $0x1,%ebp
cmp    %ebp,%r15d
je     1146 <print_enum_list+0x16>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    $0x42,%eax
jl     1190 <print_enum_list+0x60>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
movb   $0x0,(%rsp)
jmp    1190 <print_enum_list+0x60>

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

LLVM IR (-O2):
@.str = [8 x i8] c" %s\0A\00"
@.str.1 = [7 x i8] c"%c%d, \00"
define void @print_enum_list(i32 %0, i32 %1, i32 %2) {
%4 = alloca [80 x i8]
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
store i8 0, i8* %5
%6 = icmp sgt i32 %1, %2
br i1 %6, label %20, label %7
7: ; preds = %3, %13
%8 = phi i32 [ %18, %13 ], [ %1, %3 ]
%9 = call i32 @strlen(i8* %5)
%10 = icmp sgt i32 %9, 65
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
store i8 0, i8* %5
br label %13
13: ; preds = %11, %7
%14 = call i32 @strlen(i8* %5)
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %15
%17 = call i32 @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %8)
%18 = add i32 %8, 1
%19 = icmp eq i32 %8, %2
br i1 %19, label %20, label %7
20: ; preds = %13, %3
%21 = call i32 @strlen(i8* %5)
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %25
25: ; preds = %23, %20
ret void
}