#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 isupper_function(char);
int /*<<< orphan*/ printf(char *, char, int);
int main(int argc, char **argv) {
  char c = 'B';
  printf("isupper_macro(%c): %d\n", c, ((c >= 'A') && (c <= 'Z') ? 1 : 0));
  printf("isupper_function(%c): %d\n", c, isupper_function(c));
  c = 'b';
  printf("isupper_macro(%c): %d\n", c, ((c >= 'A') && (c <= 'Z') ? 1 : 0));
  printf("isupper_function(%c): %d\n", c, isupper_function(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x42,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x13(%rbp)
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x12(%rbp)
jl     115f <main+0x3f>
movsbl -0x11(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x13(%rbp),%al
mov    -0x12(%rbp),%sil
xor    %edx,%edx
mov    $0x1,%ecx
test   $0x1,%sil
cmovne %ecx,%edx
lea    0xe85(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x16(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <isupper_function@plt>
mov    %eax,%edx
mov    -0x16(%rbp),%al
lea    0xe79(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movb   $0x62,-0x11(%rbp)
mov    -0x11(%rbp),%al
mov    %al,-0x15(%rbp)
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x14(%rbp)
jl     11cf <main+0xaf>
movsbl -0x11(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x14(%rbp)
mov    -0x15(%rbp),%al
mov    -0x14(%rbp),%sil
xor    %edx,%edx
mov    $0x1,%ecx
test   $0x1,%sil
cmovne %ecx,%edx
lea    0xe15(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x11(%rbp),%al
mov    %al,-0x17(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <isupper_function@plt>
mov    %eax,%edx
mov    -0x17(%rbp),%al
lea    0xe09(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
mov    %r14,%rdi
mov    $0x42,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    $0x42,%edi
call   1040 <isupper_function@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x42,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x62,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x62,%edi
call   1040 <isupper_function@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [23 x i8] c"isupper_macro(%c): %d\0A\00"
@.str.1 = [26 x i8] c"isupper_function(%c): %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 66, i8* %6
%7 = load i8, i8* %6
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 90
br label %15
15: ; preds = %11, %2
%16 = phi i1 [ false, %2 ], [ %14, %11 ]
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
%19 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %7, i32 %18)
%20 = load i8, i8* %6
%21 = load i8, i8* %6
%22 = call i32 @isupper_function(i8 signext %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8 signext %20, i32 %22)
store i8 98, i8* %6
%24 = load i8, i8* %6
%25 = load i8, i8* %6
%26 = sext i8 %25 to i32
%27 = icmp sge i32 %26, 65
br i1 %27, label %28, label %32
28: ; preds = %15
%29 = load i8, i8* %6
%30 = sext i8 %29 to i32
%31 = icmp sle i32 %30, 90
br label %32
32: ; preds = %28, %15
%33 = phi i1 [ false, %15 ], [ %31, %28 ]
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 1, i32 0
%36 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext %24, i32 %35)
%37 = load i8, i8* %6
%38 = load i8, i8* %6
%39 = call i32 @isupper_function(i8 signext %38)
%40 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8 signext %37, i32 %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"isupper_macro(%c): %d\0A\00"
@.str.1 = [26 x i8] c"isupper_function(%c): %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext 66, i32 1)
%4 = tail call i32 @isupper_function(i8 signext 66)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8 signext 66, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8 signext 98, i32 0)
%7 = tail call i32 @isupper_function(i8 signext 98)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8 signext 98, i32 %7)
ret i32 0
}