#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 stub1(int);
int stub2(int);
void test_isxxx(const char *name, int (*fcn)(int)) {
  int k;
  (void)printf("\n");
  (void)printf("Test of %s: ", name);
  for (k = 0; k <= 255; ++k) {
    if ((*fcn)(k))
      (void)printf(" %d", k);
  }
  (void)printf("\n");
  (void)printf("Test of %s: ", name);
  for (k = 0; k <= 255; ++k) {
    if ((*fcn)(k))
      (void)printf("%c", k);
  }
  (void)printf("\n");
}


x86 assembly (clang, -O0):
<test_isxxx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jg     118a <test_isxxx+0x7a>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
call   *%rax
cmp    $0x0,%eax
je     1177 <test_isxxx+0x67>
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117c <test_isxxx+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <test_isxxx+0x37>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
jg     11f4 <test_isxxx+0xe4>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
call   *%rax
cmp    $0x0,%eax
je     11e1 <test_isxxx+0xd1>
mov    -0x14(%rbp),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e6 <test_isxxx+0xd6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b1 <test_isxxx+0xa1>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isxxx>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec2(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%r15
xor    %ebp,%ebp
jmp    116b <test_isxxx+0x4b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%ebp
cmp    $0x100,%ebp
je     1181 <test_isxxx+0x61>
mov    %ebp,%edi
call   *%rbx
test   %eax,%eax
je     1160 <test_isxxx+0x40>
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <test_isxxx+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe6e(%rip),%rdi
xor    %ebp,%ebp
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ab <test_isxxx+0x8b>
add    $0x1,%ebp
cmp    $0x100,%ebp
je     11bc <test_isxxx+0x9c>
mov    %ebp,%edi
call   *%rbx
test   %eax,%eax
je     11a0 <test_isxxx+0x80>
mov    %ebp,%edi
call   1030 <putchar@plt>
jmp    11a0 <test_isxxx+0x80>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [13 x i8] c"Test of %s: \00"
@.str.2 = [4 x i8] c" %d\00"
@.str.3 = [3 x i8] c"%c\00"
define void @test_isxxx(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %7)
store i32 0, i32* %5
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 255
br i1 %11, label %12, label %24
12: ; preds = %9
%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 %20
17: ; preds = %12
%18 = load i32, i32* %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %17, %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %9
24: ; preds = %9
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = load i8*, i8** %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %26)
store i32 0, i32* %5
br label %28
28: ; preds = %40, %24
%29 = load i32, i32* %5
%30 = icmp sle i32 %29, 255
br i1 %30, label %31, label %43
31: ; preds = %28
%32 = load i32 (i32)*, i32 (i32)** %4
%33 = load i32, i32* %5
%34 = call i32 %32(i32 %33)
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %31
%37 = load i32, i32* %5
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %36, %31
br label %40
40: ; preds = %39
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %28
43: ; preds = %28
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"Test of %s: \00"
@.str.2 = [4 x i8] c" %d\00"
define void @test_isxxx(i8* %0, i32 (i32)* nocapture %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %2, %11
%6 = phi i32 [ 0, %2 ], [ %12, %11 ]
%7 = tail call i32 %1(i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
br label %11
11: ; preds = %5, %9
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, 256
br i1 %13, label %14, label %5
14: ; preds = %11
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %17
17: ; preds = %14, %23
%18 = phi i32 [ 0, %14 ], [ %24, %23 ]
%19 = tail call i32 %1(i32 %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = tail call i32 @putchar(i32 %18)
br label %23
23: ; preds = %17, %21
%24 = add nuw nsw i32 %18, 1
%25 = icmp eq i32 %24, 256
br i1 %25, label %26, label %17
26: ; preds = %23
%27 = tail call i32 @putchar(i32 10)
ret void
}