#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 */
typedef int /*<<< orphan*/ type_tables;

/* Variables and functions */
int isupper_save_space(int);
int isupper_save_time(int *, int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int type_tables[256];
  int c = 'A';
  int i;
  memset(type_tables, 0, sizeof(type_tables));
  for (i = 'A'; i <= 'Z'; i++) {
    type_tables[i] = 1;
  }
  printf("%c is upper %d\n", c, isupper_save_space(c));
  printf("%c is upper %d\n", c, isupper_save_time(type_tables, c));
  c = 'b';
  printf("%c is upper %d\n", c, isupper_save_space(c));
  printf("%c is upper %d\n", c, isupper_save_time(type_tables, c));
  c = '5';
  printf("%c is upper %d\n", c, isupper_save_space(c));
  printf("%c is upper %d\n", c, isupper_save_time(type_tables, c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x41,-0x414(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movl   $0x41,-0x418(%rbp)
cmpl   $0x5a,-0x418(%rbp)
jg     11ac <main+0x6c>
movslq -0x418(%rbp),%rax
movl   $0x1,-0x410(%rbp,%rax,4)
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    1179 <main+0x39>
mov    -0x414(%rbp),%eax
mov    %eax,-0x430(%rbp)
mov    -0x414(%rbp),%edi
call   1050 <isupper_save_space@plt>
mov    -0x430(%rbp),%esi
mov    %eax,%edx
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
mov    %eax,-0x42c(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x414(%rbp),%esi
call   1060 <isupper_save_time@plt>
mov    -0x42c(%rbp),%esi
mov    %eax,%edx
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
movl   $0x62,-0x414(%rbp)
mov    -0x414(%rbp),%eax
mov    %eax,-0x428(%rbp)
mov    -0x414(%rbp),%edi
call   1050 <isupper_save_space@plt>
mov    -0x428(%rbp),%esi
mov    %eax,%edx
lea    0xdc7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
mov    %eax,-0x424(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x414(%rbp),%esi
call   1060 <isupper_save_time@plt>
mov    -0x424(%rbp),%esi
mov    %eax,%edx
lea    0xd95(%rip),%rdi
call   1030 <printf@plt>
movl   $0x35,-0x414(%rbp)
mov    -0x414(%rbp),%eax
mov    %eax,-0x420(%rbp)
mov    -0x414(%rbp),%edi
call   1050 <isupper_save_space@plt>
mov    -0x420(%rbp),%esi
mov    %eax,%edx
lea    0xd60(%rip),%rdi
call   1030 <printf@plt>
mov    -0x414(%rbp),%eax
mov    %eax,-0x41c(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x414(%rbp),%esi
call   1060 <isupper_save_time@plt>
mov    -0x41c(%rbp),%esi
mov    %eax,%edx
lea    0xd2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1040 <memset@plt>
movaps 0xe9d(%rip),%xmm0
movups %xmm0,0x104(%rsp)
movups %xmm0,0x114(%rsp)
movups %xmm0,0x124(%rsp)
movups %xmm0,0x134(%rsp)
movups %xmm0,0x144(%rsp)
movups %xmm0,0x154(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x164(%rsp)
mov    $0x41,%edi
call   1050 <isupper_save_space@plt>
lea    0xe5a(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x41,%esi
call   1060 <isupper_save_time@plt>
mov    %rbx,%rdi
mov    $0x41,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x62,%edi
call   1050 <isupper_save_space@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x62,%esi
call   1060 <isupper_save_time@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x35,%edi
call   1050 <isupper_save_space@plt>
mov    %rbx,%rdi
mov    $0x35,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x35,%esi
call   1060 <isupper_save_time@plt>
mov    %rbx,%rdi
mov    $0x35,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"%c is upper %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 65, i32* %3
%5 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%6 = call i32 @memset(i32* %5, i32 0, i32 1024)
store i32 65, i32* %4
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 90
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 %12
store i32 1, i32* %13
br label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %7
17: ; preds = %7
%18 = load i32, i32* %3
%19 = load i32, i32* %3
%20 = call i32 @isupper_save_space(i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %20)
%22 = load i32, i32* %3
%23 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%24 = load i32, i32* %3
%25 = call i32 @isupper_save_time(i32* %23, i32 %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %25)
store i32 98, i32* %3
%27 = load i32, i32* %3
%28 = load i32, i32* %3
%29 = call i32 @isupper_save_space(i32 %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %27, i32 %29)
%31 = load i32, i32* %3
%32 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%33 = load i32, i32* %3
%34 = call i32 @isupper_save_time(i32* %32, i32 %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %34)
store i32 53, i32* %3
%36 = load i32, i32* %3
%37 = load i32, i32* %3
%38 = call i32 @isupper_save_space(i32 %37)
%39 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %36, i32 %38)
%40 = load i32, i32* %3
%41 = getelementptr inbounds [256 x i32], [256 x i32]* %2, i64 0, i64 0
%42 = load i32, i32* %3
%43 = call i32 @isupper_save_time(i32* %41, i32 %42)
%44 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %40, i32 %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"%c is upper %d\0A\00"
define i32 @main() {
%1 = alloca [256 x i32]
%2 = bitcast [256 x i32]* %1 to i8*
%3 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 0
%4 = call i32 @memset(i32* %3, i32 0, i32 1024)
%5 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 65
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %6
%7 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 69
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %8
%9 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 73
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %10
%11 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 77
%12 = bitcast i32* %11 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %12
%13 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 81
%14 = bitcast i32* %13 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %14
%15 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 85
%16 = bitcast i32* %15 to <4 x i32>*
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32>* %16
%17 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 89
store i32 1, i32* %17
%18 = getelementptr inbounds [256 x i32], [256 x i32]* %1, i64 0, i64 90
store i32 1, i32* %18
%19 = call i32 @isupper_save_space(i32 65)
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 65, i32 %19)
%21 = call i32 @isupper_save_time(i32* %3, i32 65)
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 65, i32 %21)
%23 = call i32 @isupper_save_space(i32 98)
%24 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 98, i32 %23)
%25 = call i32 @isupper_save_time(i32* %3, i32 98)
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 98, i32 %25)
%27 = call i32 @isupper_save_space(i32 53)
%28 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 53, i32 %27)
%29 = call i32 @isupper_save_time(i32* %3, i32 53)
%30 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 53, i32 %29)
ret i32 0
}