#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*/ isdigit(unsigned char);
int /*<<< orphan*/ islower(unsigned char);
scalar_t__ isprint(unsigned char);
int /*<<< orphan*/ isspace(unsigned char);
int /*<<< orphan*/ isupper(unsigned char);
char ispunct(unsigned char c) {
  if (isprint(c) && !islower(c) && !isupper(c) && !isspace(c) && !isdigit(c))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%edi
call   1070 <isprint@plt>
cmp    $0x0,%rax
je     11c2 <ispunct+0x72>
movzbl -0x2(%rbp),%edi
call   1040 <islower@plt>
cmp    $0x0,%eax
jne    11c2 <ispunct+0x72>
movzbl -0x2(%rbp),%edi
call   1060 <isupper@plt>
cmp    $0x0,%eax
jne    11c2 <ispunct+0x72>
movzbl -0x2(%rbp),%edi
call   1050 <isspace@plt>
cmp    $0x0,%eax
jne    11c2 <ispunct+0x72>
movzbl -0x2(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    11c2 <ispunct+0x72>
movb   $0x1,-0x1(%rbp)
jmp    11c6 <ispunct+0x76>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rbx
mov    %edi,%ebx
call   1070 <isprint@plt>
test   %rax,%rax
je     118c <ispunct+0x3c>
movzbl %bl,%ebx
mov    %ebx,%edi
call   1040 <islower@plt>
test   %eax,%eax
jne    118c <ispunct+0x3c>
mov    %ebx,%edi
call   1060 <isupper@plt>
test   %eax,%eax
jne    118c <ispunct+0x3c>
mov    %ebx,%edi
call   1050 <isspace@plt>
test   %eax,%eax
jne    118c <ispunct+0x3c>
mov    %ebx,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1190 <ispunct+0x40>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @ispunct(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isprint(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %24
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i32 @islower(i8 zeroext %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %24, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = call i32 @isupper(i8 zeroext %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %24, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = call i32 @isspace(i8 zeroext %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = call i32 @isdigit(i8 zeroext %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %19
store i8 1, i8* %2
br label %25
24: ; preds = %19, %15, %11, %7, %1
store i8 0, i8* %2
br label %25
25: ; preds = %24, %23
%26 = load i8, i8* %2
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @ispunct(i8 zeroext %0) {
%2 = tail call i64 @isprint(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1
%5 = tail call i32 @islower(i8 zeroext %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = tail call i32 @isupper(i8 zeroext %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = tail call i32 @isspace(i8 zeroext %0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = tail call i32 @isdigit(i8 zeroext %0)
%15 = icmp eq i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %13, %10, %7, %4, %1
br label %17
17: ; preds = %13, %16
%18 = phi i8 [ 0, %16 ], [ 1, %13 ]
ret i8 %18
}