#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*/ isalpha(char);
int /*<<< orphan*/ isupper(char);
int /*<<< orphan*/ printf(char *, char, char, char *);
int requireUpperCase(char c, char *where) {
  if (!isalpha(c) || !isupper(c)) {
    printf("Error: An illegal character '%c (%d)' has been found in the %s. ",
           c, c, where);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<requireUpperCase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%eax
je     1166 <requireUpperCase+0x36>
movsbl -0x5(%rbp),%edi
call   1050 <isupper@plt>
cmp    $0x0,%eax
jne    118e <requireUpperCase+0x5e>
mov    -0x5(%rbp),%dl
mov    -0x5(%rbp),%al
mov    -0x10(%rbp),%rcx
lea    0xe89(%rip),%rdi
movsbl %dl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1195 <requireUpperCase+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<requireUpperCase>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <isalpha@plt>
movsbl %bpl,%ebp
test   %eax,%eax
je     1157 <requireUpperCase+0x27>
mov    %ebp,%edi
call   1050 <isupper@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    116c <requireUpperCase+0x3c>
lea    0xea2(%rip),%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [65 x i8] c"Error: An illegal character '%c (%d)' has been found in the %s. \00"
define i32 @requireUpperCase(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i8, i8* %4
%7 = call i32 @isalpha(i8 signext %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8, i8* %4
%11 = call i32 @isupper(i8 signext %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %9, %2
%14 = load i8, i8* %4
%15 = load i8, i8* %4
%16 = load i8*, i8** %5
%17 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8 signext %14, i8 signext %15, i8* %16)
store i32 0, i32* %3
br label %19
18: ; preds = %9
store i32 1, i32* %3
br label %19
19: ; preds = %18, %13
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [65 x i8] c"Error: An illegal character '%c (%d)' has been found in the %s. \00"
define i32 @requireUpperCase(i8 signext %0, i8* %1) {
%3 = tail call i32 @isalpha(i8 signext %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @isupper(i8 signext %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %0, i8* %1)
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %11
}