#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 EXIT_SUCCESS;
int isalnum(char);
int isalpha(char);
int isdigit(char);
int isspace(char);
int isupper(char);
int /*<<< orphan*/ printf(char *, int);
int toupper(char);
int main() {
  char a = 'a', b = 'b', s = ' ';
  char n1 = '1', n2 = '2';
  printf("a isalpha = %d\n", isalpha(a));
  printf("isalnum = %d\n", isalnum(a));
  printf("isdigit = %d\n", isdigit(a));
  printf("isspace = %d\n", isspace(s));
  printf("isupper = %d\n", isupper(a));
  printf("tolower = %c\n", toupper(a));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x5(%rbp)
movb   $0x62,-0x6(%rbp)
movb   $0x20,-0x7(%rbp)
movb   $0x31,-0x8(%rbp)
movb   $0x32,-0x9(%rbp)
movsbl -0x5(%rbp),%edi
call   1080 <isalpha@plt>
mov    %eax,%esi
lea    0xe5b(%rip),%rdi
call   1050 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1060 <isalnum@plt>
mov    %eax,%esi
lea    0xe54(%rip),%rdi
call   1050 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
call   1050 <printf@plt>
movsbl -0x7(%rbp),%edi
call   1070 <isspace@plt>
mov    %eax,%esi
lea    0xe42(%rip),%rdi
call   1050 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1090 <isupper@plt>
mov    %eax,%esi
lea    0xe39(%rip),%rdi
call   1050 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,%esi
lea    0xe30(%rip),%rdi
call   1050 <printf@plt>
mov    0x2dbc(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1080 <isalpha@plt>
lea    0xe7e(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x61,%edi
call   1060 <isalnum@plt>
lea    0xe76(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x61,%edi
call   1030 <isdigit@plt>
lea    0xe6c(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x20,%edi
call   1070 <isspace@plt>
lea    0xe62(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x61,%edi
call   1090 <isupper@plt>
lea    0xe58(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    $0x61,%edi
call   1040 <toupper@plt>
lea    0xe4e(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"a isalpha = %d\0A\00"
@.str.1 = [14 x i8] c"isalnum = %d\0A\00"
@.str.2 = [14 x i8] c"isdigit = %d\0A\00"
@.str.3 = [14 x i8] c"isspace = %d\0A\00"
@.str.4 = [14 x i8] c"isupper = %d\0A\00"
@.str.5 = [14 x i8] c"tolower = %c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i32 0, i32* %1
store i8 97, i8* %2
store i8 98, i8* %3
store i8 32, i8* %4
store i8 49, i8* %5
store i8 50, i8* %6
%7 = load i8, i8* %2
%8 = call i32 @isalpha(i8 signext %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8, i8* %2
%11 = call i32 @isalnum(i8 signext %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i8, i8* %2
%14 = call i32 @isdigit(i8 signext %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i8, i8* %4
%17 = call i32 @isspace(i8 signext %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = load i8, i8* %2
%20 = call i32 @isupper(i8 signext %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i8, i8* %2
%23 = call i32 @toupper(i8 signext %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %23)
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}

LLVM IR (-O2):
@.str = [16 x i8] c"a isalpha = %d\0A\00"
@.str.1 = [14 x i8] c"isalnum = %d\0A\00"
@.str.2 = [14 x i8] c"isdigit = %d\0A\00"
@.str.3 = [14 x i8] c"isspace = %d\0A\00"
@.str.4 = [14 x i8] c"isupper = %d\0A\00"
@.str.5 = [14 x i8] c"tolower = %c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @isalpha(i8 signext 97)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isalnum(i8 signext 97)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isdigit(i8 signext 97)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @isspace(i8 signext 32)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @isupper(i8 signext 97)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @toupper(i8 signext 97)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}