#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);
void testEncode(void) {
  assert(encode('a') == 'n');
  assert(encode('n') == 'a');
  assert(encode('A') == 'N');
  assert(encode('z') == 'm');
  assert(encode('M') == 'Z');
  assert(encode('7') == '7');
  assert(encode('$') == '$');
}


x86 assembly (clang, -O0):
<testEncode>:
push   %rbp
mov    %rsp,%rbp
mov    $0x61,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x6e,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x61,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x41,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x4e,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x7a,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x6d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x4d,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x5a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x37,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x37,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x24,%edi
call   1030 <encode@plt>
movsbl %al,%eax
cmp    $0x24,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testEncode>:
push   %rax
mov    $0x61,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x6e,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x6e,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x61,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x41,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x4e,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x7a,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x6d,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x4d,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x5a,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x37,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x37,%al
sete   %dil
call   1040 <assert@plt>
mov    $0x24,%edi
call   1030 <encode@plt>
xor    %edi,%edi
cmp    $0x24,%al
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @testEncode() {
%1 = call signext i8 @encode(i8 signext 97)
%2 = sext i8 %1 to i32
%3 = icmp eq i32 %2, 110
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call signext i8 @encode(i8 signext 110)
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 97
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call signext i8 @encode(i8 signext 65)
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 78
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call signext i8 @encode(i8 signext 122)
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 109
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = call signext i8 @encode(i8 signext 77)
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 90
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call signext i8 @encode(i8 signext 55)
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 55
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call signext i8 @encode(i8 signext 36)
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 36
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
ret void
}

LLVM IR (-O2):
define void @testEncode() {
%1 = tail call signext i8 @encode(i8 signext 97)
%2 = icmp eq i8 %1, 110
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call signext i8 @encode(i8 signext 110)
%6 = icmp eq i8 %5, 97
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call signext i8 @encode(i8 signext 65)
%10 = icmp eq i8 %9, 78
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call signext i8 @encode(i8 signext 122)
%14 = icmp eq i8 %13, 109
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call signext i8 @encode(i8 signext 77)
%18 = icmp eq i8 %17, 90
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call signext i8 @encode(i8 signext 55)
%22 = icmp eq i8 %21, 55
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call signext i8 @encode(i8 signext 36)
%26 = icmp eq i8 %25, 36
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
ret void
}