#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 UCHAR_MAX;
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ putchar(char);
int stub1(int);
void prclass(const char *name, int (*fn)(int)) {
  int c;
  printf("%s: ", name);
  for (c = 0; c <= UCHAR_MAX; c++)
    if ((*fn)(c))
      putchar(c);
  putchar('\n');
  return;
}


x86 assembly (clang, -O0):
<prclass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
jg     1189 <prclass+0x69>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
call   *%rax
cmp    $0x0,%eax
je     1176 <prclass+0x56>
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    117b <prclass+0x5b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <prclass+0x27>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prclass>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rsi
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    0x2eb2(%rip),%r15
cmpl   $0x0,(%r15)
js     116d <prclass+0x4d>
xor    %ebx,%ebx
jmp    115a <prclass+0x3a>
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
cmp    (%r15),%ebx
mov    %eax,%ebx
jge    116d <prclass+0x4d>
mov    %ebx,%edi
call   *%r14
test   %eax,%eax
je     1150 <prclass+0x30>
movsbl %bl,%edi
call   1030 <putchar@plt>
jmp    1150 <prclass+0x30>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@UCHAR_MAX = global i32 0
define void @prclass(i8* %0, i32 (i32)* %1) {
%3 = alloca i8*
%4 = alloca i32 (i32)*
%5 = alloca i32
store i8* %0, i8** %3
store i32 (i32)* %1, i32 (i32)** %4
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6)
store i32 0, i32* %5
br label %8
8: ; preds = %22, %2
%9 = load i32, i32* %5
%10 = load i32, i32* @UCHAR_MAX
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i32 (i32)*, i32 (i32)** %4
%14 = load i32, i32* %5
%15 = call i32 %13(i32 %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load i32, i32* %5
%19 = trunc i32 %18 to i8
%20 = call i32 @putchar(i8 signext %19)
br label %21
21: ; preds = %17, %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %8
25: ; preds = %8
%26 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@UCHAR_MAX = global i32 0
define void @prclass(i8* %0, i32 (i32)* nocapture %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @UCHAR_MAX
%5 = icmp slt i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %2, %13
%7 = phi i32 [ %14, %13 ], [ 0, %2 ]
%8 = tail call i32 %1(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = trunc i32 %7 to i8
%12 = tail call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %6, %10
%14 = add nuw nsw i32 %7, 1
%15 = load i32, i32* @UCHAR_MAX
%16 = icmp slt i32 %7, %15
br i1 %16, label %6, label %17
17: ; preds = %13, %2
%18 = tail call i32 @putchar(i8 signext 10)
ret void
}