#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*/ printf(char *, char *, int);
char t_toupper(char);
int test_toupper(void) {
  do {
    if (!(t_toupper('a') == 'A')) {
      printf("expression '%s' untrue at %d\n", "t_toupper('a') == 'A'", 71);
      return 0;
    }
  } while (0);
  do {
    if (!(t_toupper('A') == 'A')) {
      printf("expression '%s' untrue at %d\n", "t_toupper('A') == 'A'", 72);
      return 0;
    }
  } while (0);
  do {
    if (!(t_toupper('0') == '0')) {
      printf("expression '%s' untrue at %d\n", "t_toupper('0') == '0'", 73);
      return 0;
    }
  } while (0);
  do {
    if (!(t_toupper('z') == 'Z')) {
      printf("expression '%s' untrue at %d\n", "t_toupper('z') == 'Z'", 74);
      return 0;
    }
  } while (0);
  do {
    if (!(t_toupper(' ') == ' ')) {
      printf("expression '%s' untrue at %d\n", "t_toupper(' ') == ' '", 75);
      return 0;
    }
  } while (0);
  return 1;
}


x86 assembly (clang, -O0):
<test_toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x61,%edi
call   1030 <t_toupper@plt>
movsbl %al,%eax
cmp    $0x41,%eax
je     1162 <test_toupper+0x42>
lea    0xebb(%rip),%rdi
lea    0xed2(%rip),%rsi
mov    $0x47,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    127e <test_toupper+0x15e>
jmp    1167 <test_toupper+0x47>
jmp    116c <test_toupper+0x4c>
mov    $0x41,%edi
call   1030 <t_toupper@plt>
movsbl %al,%eax
cmp    $0x41,%eax
je     11a6 <test_toupper+0x86>
lea    0xe77(%rip),%rdi
lea    0xea4(%rip),%rsi
mov    $0x48,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    127e <test_toupper+0x15e>
jmp    11ab <test_toupper+0x8b>
jmp    11b0 <test_toupper+0x90>
mov    $0x30,%edi
call   1030 <t_toupper@plt>
movsbl %al,%eax
cmp    $0x30,%eax
je     11ea <test_toupper+0xca>
lea    0xe33(%rip),%rdi
lea    0xe76(%rip),%rsi
mov    $0x49,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    127e <test_toupper+0x15e>
jmp    11ef <test_toupper+0xcf>
jmp    11f4 <test_toupper+0xd4>
mov    $0x7a,%edi
call   1030 <t_toupper@plt>
movsbl %al,%eax
cmp    $0x5a,%eax
je     122e <test_toupper+0x10e>
lea    0xdef(%rip),%rdi
lea    0xe48(%rip),%rsi
mov    $0x4a,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    127e <test_toupper+0x15e>
jmp    1233 <test_toupper+0x113>
jmp    1238 <test_toupper+0x118>
mov    $0x20,%edi
call   1030 <t_toupper@plt>
movsbl %al,%eax
cmp    $0x20,%eax
je     1272 <test_toupper+0x152>
lea    0xdab(%rip),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x4b,%edx
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    127e <test_toupper+0x15e>
jmp    1277 <test_toupper+0x157>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_toupper>:
push   %rax
mov    $0x61,%edi
call   1030 <t_toupper@plt>
cmp    $0x41,%al
jne    1184 <test_toupper+0x64>
mov    $0x41,%edi
call   1030 <t_toupper@plt>
cmp    $0x41,%al
jne    1199 <test_toupper+0x79>
mov    $0x30,%edi
call   1030 <t_toupper@plt>
cmp    $0x30,%al
jne    11ae <test_toupper+0x8e>
mov    $0x7a,%edi
call   1030 <t_toupper@plt>
cmp    $0x5a,%al
jne    11c3 <test_toupper+0xa3>
mov    $0x20,%edi
call   1030 <t_toupper@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x20,%cl
je     11dd <test_toupper+0xbd>
lea    0xe8a(%rip),%rdi
lea    0xef9(%rip),%rsi
mov    $0x4b,%edx
jmp    11d6 <test_toupper+0xb6>
lea    0xe75(%rip),%rdi
lea    0xe8c(%rip),%rsi
mov    $0x47,%edx
jmp    11d6 <test_toupper+0xb6>
lea    0xe60(%rip),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x48,%edx
jmp    11d6 <test_toupper+0xb6>
lea    0xe4b(%rip),%rdi
lea    0xe8e(%rip),%rsi
mov    $0x49,%edx
jmp    11d6 <test_toupper+0xb6>
lea    0xe36(%rip),%rdi
lea    0xe8f(%rip),%rsi
mov    $0x4a,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.1 = [22 x i8] c"t_toupper('a') == 'A'\00"
@.str.2 = [22 x i8] c"t_toupper('A') == 'A'\00"
@.str.3 = [22 x i8] c"t_toupper('0') == '0'\00"
@.str.4 = [22 x i8] c"t_toupper('z') == 'Z'\00"
@.str.5 = [22 x i8] c"t_toupper(' ') == ' '\00"
define i32 @test_toupper() {
%1 = alloca i32
br label %2
2: ; preds = %0
%3 = call signext i8 @t_toupper(i8 signext 97)
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 65
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 71)
store i32 0, i32* %1
br label %42
8: ; preds = %2
br label %9
9: ; preds = %8
br label %10
10: ; preds = %9
%11 = call signext i8 @t_toupper(i8 signext 65)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 65
br i1 %13, label %16, label %14
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 72)
store i32 0, i32* %1
br label %42
16: ; preds = %10
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17
%19 = call signext i8 @t_toupper(i8 signext 48)
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 48
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 73)
store i32 0, i32* %1
br label %42
24: ; preds = %18
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25
%27 = call signext i8 @t_toupper(i8 signext 122)
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 90
br i1 %29, label %32, label %30
30: ; preds = %26
%31 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 74)
store i32 0, i32* %1
br label %42
32: ; preds = %26
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
%35 = call signext i8 @t_toupper(i8 signext 32)
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 32
br i1 %37, label %40, label %38
38: ; preds = %34
%39 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 75)
store i32 0, i32* %1
br label %42
40: ; preds = %34
br label %41
41: ; preds = %40
store i32 1, i32* %1
br label %42
42: ; preds = %41, %38, %30, %22, %14, %6
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@.str = [30 x i8] c"expression '%s' untrue at %d\0A\00"
@.str.1 = [22 x i8] c"t_toupper('a') == 'A'\00"
@.str.2 = [22 x i8] c"t_toupper('A') == 'A'\00"
@.str.3 = [22 x i8] c"t_toupper('0') == '0'\00"
@.str.4 = [22 x i8] c"t_toupper('z') == 'Z'\00"
@.str.5 = [22 x i8] c"t_toupper(' ') == ' '\00"
define i32 @test_toupper() {
%1 = tail call signext i8 @t_toupper(i8 signext 97)
%2 = icmp eq i8 %1, 65
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 71)
br label %25
5: ; preds = %0
%6 = tail call signext i8 @t_toupper(i8 signext 65)
%7 = icmp eq i8 %6, 65
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 72)
br label %25
10: ; preds = %5
%11 = tail call signext i8 @t_toupper(i8 signext 48)
%12 = icmp eq i8 %11, 48
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 73)
br label %25
15: ; preds = %10
%16 = tail call signext i8 @t_toupper(i8 signext 122)
%17 = icmp eq i8 %16, 90
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 74)
br label %25
20: ; preds = %15
%21 = tail call signext i8 @t_toupper(i8 signext 32)
%22 = icmp eq i8 %21, 32
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 75)
br label %25
25: ; preds = %20, %23, %18, %13, %8, %3
%26 = phi i32 [ 0, %23 ], [ 0, %18 ], [ 0, %13 ], [ 0, %8 ], [ 0, %3 ], [ 1, %20 ]
ret i32 %26
}