#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*/ printConvertSwitch();
int /*<<< orphan*/ printf(char *);
void printCharToByte(void) {
  printf("\tprotected override void ToBytes(char[] chars, int charIndex, int "
         "charCount,\n");
  printf("\t                                byte[] bytes, int byteIndex)\n");
  printf("\t{\n");
  printf("\t\tint ch;\n");
  printf("\t\twhile(charCount > 0)\n");
  printf("\t\t{\n");
  printf("\t\t\tch = (int)(chars[charIndex++]);\n");
  printConvertSwitch();
  printf("\t\t\tbytes[byteIndex++] = (byte)ch;\n");
  printf("\t\t\t--charCount;\n");
  printf("\t\t}\n");
  printf("\t}\n\n");
  printf("\tprotected override void ToBytes(String s, int charIndex, int "
         "charCount,\n");
  printf("\t                                byte[] bytes, int byteIndex)\n");
  printf("\t{\n");
  printf("\t\tint ch;\n");
  printf("\t\twhile(charCount > 0)\n");
  printf("\t\t{\n");
  printf("\t\t\tch = (int)(s[charIndex++]);\n");
  printConvertSwitch();
  printf("\t\t\tbytes[byteIndex++] = (byte)ch;\n");
  printf("\t\t\t--charCount;\n");
  printf("\t\t}\n");
  printf("\t}\n\n");
}


x86 assembly (clang, -O0):
<printCharToByte>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf17(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf49(%rip),%rdi
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printConvertSwitch@plt>
lea    0xf53(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6a(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf68(%rip),%rdi
call   1030 <printf@plt>
lea    0xf61(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xf63(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <printConvertSwitch@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCharToByte>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xfcf(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf9f(%rip),%r13
mov    %r13,%rdi
call   1030 <puts@plt>
lea    0xfa7(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <printConvertSwitch@plt>
lea    0xfa8(%rip),%rbp
mov    %rbp,%rdi
call   1030 <puts@plt>
lea    0xfbb(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xfbc(%rip),%r15
mov    %r15,%rdi
call   1030 <puts@plt>
lea    0xfb1(%rip),%r12
mov    %r12,%rdi
call   1030 <puts@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
lea    0xf04(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <printConvertSwitch@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [78 x i8] c"\09protected override void ToBytes(char[] chars, int charIndex, int charCount,\0A\00"
@.str.1 = [63 x i8] c"\09 byte[] bytes, int byteIndex)\0A\00"
@.str.2 = [4 x i8] c"\09{\0A\00"
@.str.3 = [11 x i8] c"\09\09int ch;\0A\00"
@.str.4 = [24 x i8] c"\09\09while(charCount > 0)\0A\00"
@.str.5 = [5 x i8] c"\09\09{\0A\00"
@.str.6 = [36 x i8] c"\09\09\09ch = (int)(chars[charIndex++]);\0A\00"
@.str.7 = [35 x i8] c"\09\09\09bytes[byteIndex++] = (byte)ch;\0A\00"
@.str.8 = [17 x i8] c"\09\09\09--charCount;\0A\00"
@.str.9 = [5 x i8] c"\09\09}\0A\00"
@.str.10 = [5 x i8] c"\09}\0A\0A\00"
@.str.11 = [74 x i8] c"\09protected override void ToBytes(String s, int charIndex, int charCount,\0A\00"
@.str.12 = [32 x i8] c"\09\09\09ch = (int)(s[charIndex++]);\0A\00"
define void @printCharToByte() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 (...) @printConvertSwitch()
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.11, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.12, i64 0, i64 0))
%20 = call i32 (...) @printConvertSwitch()
%21 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%24 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [77 x i8] c"\09protected override void ToBytes(char[] chars, int charIndex, int charCount,\00"
@str.18 = [35 x i8] c"\09\09\09ch = (int)(chars[charIndex++]);\00"
@str.23 = [73 x i8] c"\09protected override void ToBytes(String s, int charIndex, int charCount,\00"
@str.24 = [62 x i8] c"\09 byte[] bytes, int byteIndex)\00"
@str.25 = [3 x i8] c"\09{\00"
@str.26 = [10 x i8] c"\09\09int ch;\00"
@str.27 = [23 x i8] c"\09\09while(charCount > 0)\00"
@str.28 = [4 x i8] c"\09\09{\00"
@str.29 = [31 x i8] c"\09\09\09ch = (int)(s[charIndex++]);\00"
@str.30 = [34 x i8] c"\09\09\09bytes[byteIndex++] = (byte)ch;\00"
@str.31 = [16 x i8] c"\09\09\09--charCount;\00"
@str.32 = [4 x i8] c"\09\09}\00"
@str.33 = [4 x i8] c"\09}\0A\00"
define void @printCharToByte() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.24, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.25, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.26, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.27, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.28, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.18, i64 0, i64 0))
%8 = tail call i32 (...) @printConvertSwitch()
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.30, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.31, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.32, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.33, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.23, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.24, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.25, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.26, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.27, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.28, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.29, i64 0, i64 0))
%20 = tail call i32 (...) @printConvertSwitch()
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.30, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.31, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.32, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.33, i64 0, i64 0))
ret void
}