#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*/ convert_string(char *);
int /*<<< orphan*/ printf(char *);
void test_string_convert(void) {
  convert_string("A23B45C32");
  printf("\n-----------------------------\n");
  convert_string("A23B");
  convert_string("45C32");
  printf("\n-----------------------------\n");
  convert_string("A23B4");
  convert_string("5C32");
  printf("\n-----------------------------\n");
  convert_string("A23");
  convert_string("B45C32");
  printf("\n-----------------------------\n");
  convert_string("A23B45C");
  convert_string("32");
  printf("\n-----------------------------\n");
  convert_string("A23B45C3");
  convert_string("2");
  printf("\n-----------------------------\n");
  convert_string("A");
  convert_string("23B45C32");
  printf("\n-----------------------------\n");
  convert_string("A2");
  convert_string("3B45C32");
  printf("\n-----------------------------\n");
}


x86 assembly (clang, -O0):
<test_string_convert>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xed3(%rip),%rdi
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xeb5(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe92(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe6c(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe4c(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
lea    0xe6e(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe29(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xe1f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe53(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xdfe(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xdfb(%rip),%rdi
call   1040 <printf@plt>
lea    0xe31(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xddb(%rip),%rdi
call   1030 <convert_string@plt>
lea    0xdd7(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string_convert>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xefb(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xec7(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xeb5(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xe96(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe92(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xe74(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe76(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xe58(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe5e(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xe39(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe47(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xe12(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe29(%rip),%rdi
call   1040 <convert_string@plt>
lea    0xdf3(%rip),%rdi
call   1040 <convert_string@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"A23B45C32\00"
@.str.1 = [32 x i8] c"\0A-----------------------------\0A\00"
@.str.2 = [5 x i8] c"A23B\00"
@.str.3 = [6 x i8] c"45C32\00"
@.str.4 = [6 x i8] c"A23B4\00"
@.str.5 = [5 x i8] c"5C32\00"
@.str.6 = [4 x i8] c"A23\00"
@.str.7 = [7 x i8] c"B45C32\00"
@.str.8 = [8 x i8] c"A23B45C\00"
@.str.9 = [3 x i8] c"32\00"
@.str.10 = [9 x i8] c"A23B45C3\00"
@.str.11 = [2 x i8] c"2\00"
@.str.12 = [2 x i8] c"A\00"
@.str.13 = [9 x i8] c"23B45C32\00"
@.str.14 = [3 x i8] c"A2\00"
@.str.15 = [8 x i8] c"3B45C32\00"
define void @test_string_convert() {
%1 = call i32 @convert_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @convert_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @convert_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @convert_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @convert_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @convert_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%10 = call i32 @convert_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @convert_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 @convert_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @convert_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 @convert_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @convert_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%19 = call i32 @convert_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @convert_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%22 = call i32 @convert_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"A23B45C32\00"
@.str.2 = [5 x i8] c"A23B\00"
@.str.3 = [6 x i8] c"45C32\00"
@.str.4 = [6 x i8] c"A23B4\00"
@.str.5 = [5 x i8] c"5C32\00"
@.str.6 = [4 x i8] c"A23\00"
@.str.7 = [7 x i8] c"B45C32\00"
@.str.8 = [8 x i8] c"A23B45C\00"
@.str.9 = [3 x i8] c"32\00"
@.str.10 = [9 x i8] c"A23B45C3\00"
@.str.11 = [2 x i8] c"2\00"
@.str.12 = [2 x i8] c"A\00"
@.str.13 = [9 x i8] c"23B45C32\00"
@.str.14 = [3 x i8] c"A2\00"
@.str.15 = [8 x i8] c"3B45C32\00"
@str.22 = [31 x i8] c"\0A-----------------------------\00"
define void @test_string_convert() {
%1 = tail call i32 @convert_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%3 = tail call i32 @convert_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @convert_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%6 = tail call i32 @convert_string(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @convert_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%9 = tail call i32 @convert_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%10 = tail call i32 @convert_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @convert_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%13 = tail call i32 @convert_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%15 = tail call i32 @convert_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%16 = tail call i32 @convert_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%18 = tail call i32 @convert_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%19 = tail call i32 @convert_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
%21 = tail call i32 @convert_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%22 = tail call i32 @convert_string(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.22, i64 0, i64 0))
ret void
}