#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 /*<<< orphan*/ assert(int);
char char_change_case(char);
int char_is_lower(char);
int char_is_upper(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ *string_change_case(int /*<<< orphan*/ *);
int test_string_change_case(char *, char *);
int main() {
  assert(char_is_lower('l'));
  assert(!char_is_lower('L'));
  assert(!char_is_lower('@'));
  assert(char_is_upper('U'));
  assert(!char_is_upper('u'));
  assert(!char_is_upper('%'));
  assert(char_change_case('J') == 'j');
  assert(char_change_case('c') == 'C');
  assert(char_change_case('&') == '&');
  assert(test_string_change_case("Foo+Bar!", "fOO+bAR!"));
  assert(test_string_change_case("", ""));
  assert(string_change_case(NULL) == NULL);
  puts("All tests passed!");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6c,%edi
call   1070 <char_is_lower@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x4c,%edi
call   1070 <char_is_lower@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x40,%edi
call   1070 <char_is_lower@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x55,%edi
call   1040 <char_is_upper@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x75,%edi
call   1040 <char_is_upper@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x25,%edi
call   1040 <char_is_upper@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x4a,%edi
call   1090 <char_change_case@plt>
movsbl %al,%eax
cmp    $0x6a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x63,%edi
call   1090 <char_change_case@plt>
movsbl %al,%eax
cmp    $0x43,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x26,%edi
call   1090 <char_change_case@plt>
movsbl %al,%eax
cmp    $0x26,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd91(%rip),%rdi
lea    0xd93(%rip),%rsi
call   1060 <test_string_change_case@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xd88(%rip),%rsi
mov    %rsi,%rdi
call   1060 <test_string_change_case@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1080 <string_change_case@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xd59(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d1b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6c,%edi
call   1070 <char_is_lower@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x4c,%edi
call   1070 <char_is_lower@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x40,%edi
call   1070 <char_is_lower@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x55,%edi
call   1040 <char_is_upper@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x75,%edi
call   1040 <char_is_upper@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x25,%edi
call   1040 <char_is_upper@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    $0x4a,%edi
call   1090 <char_change_case@plt>
xor    %edi,%edi
cmp    $0x6a,%al
sete   %dil
call   1050 <assert@plt>
mov    $0x63,%edi
call   1090 <char_change_case@plt>
xor    %edi,%edi
cmp    $0x43,%al
sete   %dil
call   1050 <assert@plt>
mov    $0x26,%edi
call   1090 <char_change_case@plt>
xor    %edi,%edi
cmp    $0x26,%al
sete   %dil
call   1050 <assert@plt>
lea    0xdc5(%rip),%rdi
lea    0xdc7(%rip),%rsi
call   1060 <test_string_change_case@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xdbc(%rip),%rdi
mov    %rdi,%rsi
call   1060 <test_string_change_case@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %edi,%edi
call   1080 <string_change_case@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xd92(%rip),%rdi
call   1030 <puts@plt>
mov    0x2d54(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Foo+Bar!\00"
@.str.1 = [9 x i8] c"fOO+bAR!\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [18 x i8] c"All tests passed!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @char_is_lower(i8 signext 108)
%3 = call i32 @assert(i32 %2)
%4 = call i32 @char_is_lower(i8 signext 76)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @char_is_lower(i8 signext 64)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @char_is_upper(i8 signext 85)
%15 = call i32 @assert(i32 %14)
%16 = call i32 @char_is_upper(i8 signext 117)
%17 = icmp ne i32 %16, 0
%18 = xor i1 %17, true
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call i32 @char_is_upper(i8 signext 37)
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call signext i8 @char_change_case(i8 signext 74)
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 106
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call signext i8 @char_change_case(i8 signext 99)
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 67
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call signext i8 @char_change_case(i8 signext 38)
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 38
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @test_string_change_case(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%42 = call i32 @assert(i32 %41)
%43 = call i32 @test_string_change_case(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @assert(i32 %43)
%45 = call i32* @string_change_case(i32* null)
%46 = icmp eq i32* %45, null
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%50 = load i32, i32* @EXIT_SUCCESS
ret i32 %50
}

LLVM IR (-O2):
@.str = [9 x i8] c"Foo+Bar!\00"
@.str.1 = [9 x i8] c"fOO+bAR!\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [18 x i8] c"All tests passed!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @char_is_lower(i8 signext 108)
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 @char_is_lower(i8 signext 76)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @char_is_lower(i8 signext 64)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i32 @char_is_upper(i8 signext 85)
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @char_is_upper(i8 signext 117)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @char_is_upper(i8 signext 37)
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call signext i8 @char_change_case(i8 signext 74)
%22 = icmp eq i8 %21, 106
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call signext i8 @char_change_case(i8 signext 99)
%26 = icmp eq i8 %25, 67
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call signext i8 @char_change_case(i8 signext 38)
%30 = icmp eq i8 %29, 38
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @test_string_change_case(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%34 = tail call i32 @assert(i32 %33)
%35 = tail call i32 @test_string_change_case(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%36 = tail call i32 @assert(i32 %35)
%37 = tail call i32* @string_change_case(i32* null)
%38 = icmp eq i32* %37, null
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%42 = load i32, i32* @EXIT_SUCCESS
ret i32 %42
}