#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*/ assert(int);
char encode(char, char *);
void testEncode(void) {
  assert(encode('A', "abcdefghijklmnopqrstuvwxyz") == 'A');
  assert(encode('?', "abcdefghijklmnopqrstuvwxyz") == '?');
  assert(encode(' ', "abcdefghijklmnopqrstuvwxyz") == ' ');
  assert(encode('\n', "abcdefghijklmnopqrstuvwxyz") == '\n');
  assert(encode('a', "abcdefghijklmnopqrstuvwxyz") == 'a');
  assert(encode('m', "abcdefghijklmnopqrstuvwxyz") == 'm');
  assert(encode('z', "abcdefghijklmnopqrstuvwxyz") == 'z');
  assert(encode('a', "bcdefghijklmnopqrstuvwxyza") == 'b');
  assert(encode('m', "bcdefghijklmnopqrstuvwxyza") == 'n');
  assert(encode('z', "bcdefghijklmnopqrstuvwxyza") == 'a');
  assert(encode('a', "qwertyuiopasdfghjklzxcvbnm") == 'q');
  assert(encode('b', "qwertyuiopasdfghjklzxcvbnm") == 'w');
  assert(encode('z', "qwertyuiopasdfghjklzxcvbnm") == 'm');
}


x86 assembly (clang, -O0):
<testEncode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x41,%edi
lea    0xed0(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x41,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x3f,%edi
lea    0xeac(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x3f,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x20,%edi
lea    0xe88(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0xa,%edi
lea    0xe64(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0xa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x61,%edi
lea    0xe40(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6d,%edi
lea    0xe1c(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x6d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7a,%edi
lea    0xdf8(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x7a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x61,%edi
lea    0xdef(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x62,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6d,%edi
lea    0xdcb(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7a,%edi
lea    0xda7(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x61,%edi
lea    0xd9e(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x71,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x62,%edi
lea    0xd7a(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x77,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7a,%edi
lea    0xd56(%rip),%rsi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x6d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testEncode>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    $0x41,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x41,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x3f,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x3f,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x20,%al
sete   %dil
call   1040 <assert@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0xa,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x61,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x61,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x6d,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x6d,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x7a,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x7a,%al
sete   %dil
call   1040 <assert@plt>
lea    0xe36(%rip),%rbx
mov    $0x61,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x62,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x6d,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x6e,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x7a,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x61,%al
sete   %dil
call   1040 <assert@plt>
lea    0xdfc(%rip),%rbx
mov    $0x61,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x71,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x62,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x77,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x7a,%edi
mov    %rbx,%rsi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x6d,%al
sete   %dil
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [27 x i8] c"bcdefghijklmnopqrstuvwxyza\00"
@.str.2 = [27 x i8] c"qwertyuiopasdfghjklzxcvbnm\00"
define void @testEncode() {
%1 = call signext i8 @encode(i8 signext 65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 65
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call signext i8 @encode(i8 signext 63, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 63
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call signext i8 @encode(i8 signext 32, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 32
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call signext i8 @encode(i8 signext 10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 10
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call signext i8 @encode(i8 signext 97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 97
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call signext i8 @encode(i8 signext 109, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 109
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call signext i8 @encode(i8 signext 122, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 122
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call signext i8 @encode(i8 signext 97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 98
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call signext i8 @encode(i8 signext 109, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 110
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call signext i8 @encode(i8 signext 122, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 97
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call signext i8 @encode(i8 signext 97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 113
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = call signext i8 @encode(i8 signext 98, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 119
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
%61 = call signext i8 @encode(i8 signext 122, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%62 = sext i8 %61 to i32
%63 = icmp eq i32 %62, 109
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"abcdefghijklmnopqrstuvwxyz\00"
@.str.1 = [27 x i8] c"bcdefghijklmnopqrstuvwxyza\00"
@.str.2 = [27 x i8] c"qwertyuiopasdfghjklzxcvbnm\00"
define void @testEncode() {
%1 = tail call signext i8 @encode(i8 signext 65, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8 %1, 65
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call signext i8 @encode(i8 signext 63, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8 %5, 63
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call signext i8 @encode(i8 signext 32, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8 %9, 32
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call signext i8 @encode(i8 signext 10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8 %13, 10
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call signext i8 @encode(i8 signext 97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i8 %17, 97
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call signext i8 @encode(i8 signext 109, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i8 %21, 109
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call signext i8 @encode(i8 signext 122, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%26 = icmp eq i8 %25, 122
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call signext i8 @encode(i8 signext 97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i8 %29, 98
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call signext i8 @encode(i8 signext 109, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i8 %33, 110
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
%37 = tail call signext i8 @encode(i8 signext 122, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i8 %37, 97
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
%41 = tail call signext i8 @encode(i8 signext 97, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i8 %41, 113
%43 = zext i1 %42 to i32
%44 = tail call i32 @assert(i32 %43)
%45 = tail call signext i8 @encode(i8 signext 98, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%46 = icmp eq i8 %45, 119
%47 = zext i1 %46 to i32
%48 = tail call i32 @assert(i32 %47)
%49 = tail call signext i8 @encode(i8 signext 122, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp eq i8 %49, 109
%51 = zext i1 %50 to i32
%52 = tail call i32 @assert(i32 %51)
ret void
}