#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*/ innerText(char *, char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char xml[] = "<people name=\"³¯Áé¸Û\" sex=\"¨k\">"
               "<age>43</age>"
               "<hometown>ª÷ªù¿¤</hometown>"
               "</people>";
  char name[30], sex[10], age[10], hometown[30];
  innerText(name, xml, "name=\"", "\"");
  printf("name=%s\n", name);
  innerText(sex, xml, "sex=\"", "\"");
  printf("sex=%s\n", sex);
  innerText(age, xml, "<age>", "</age>");
  printf("age=%s\n", age);
  innerText(hometown, xml, "<hometown>", "</hometown>");
  printf("hometown=%s\n", hometown);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    -0x60(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x5e,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    0xeff(%rip),%rdx
lea    0xefd(%rip),%rcx
call   1050 <innerText@plt>
lea    -0x80(%rbp),%rsi
lea    0xeef(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8a(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    0xee1(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1050 <innerText@plt>
lea    -0x8a(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x94(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    0xebe(%rip),%rdx
lea    0xebd(%rip),%rcx
call   1050 <innerText@plt>
lea    -0x94(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x60(%rbp),%rsi
lea    0xea2(%rip),%rdx
lea    0xea6(%rip),%rcx
call   1050 <innerText@plt>
lea    -0xc0(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xc0,%rsp
movups 0xf1b(%rip),%xmm0
movups %xmm0,0x6e(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe91(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xee3(%rip),%rdx
lea    0xee1(%rip),%r14
lea    0xa0(%rsp),%rbx
lea    0x20(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
call   1040 <innerText@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdx
lea    0x16(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
call   1040 <innerText@plt>
lea    0xea7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdx
lea    0xe9f(%rip),%rcx
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <innerText@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xe88(%rip),%rdx
lea    0xe8c(%rip),%rcx
lea    0x80(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <innerText@plt>
lea    0xe7e(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.xml = [94 x i8] c"<people name=\22\C2\B3\C2\AF\C3\81\C3\A9\C2\B8\C3\9B\22 sex=\22\C2\A8k\22><age>43</age><hometown>\C2\AA\C3\B7\C2\AA\C3\B9\C2\BF\C2\A4</hometown></people>\00"
@.str = [7 x i8] c"name=\22\00"
@.str.1 = [2 x i8] c"\22\00"
@.str.2 = [9 x i8] c"name=%s\0A\00"
@.str.3 = [6 x i8] c"sex=\22\00"
@.str.4 = [8 x i8] c"sex=%s\0A\00"
@.str.5 = [6 x i8] c"<age>\00"
@.str.6 = [7 x i8] c"</age>\00"
@.str.7 = [8 x i8] c"age=%s\0A\00"
@.str.8 = [11 x i8] c"<hometown>\00"
@.str.9 = [12 x i8] c"</hometown>\00"
@.str.10 = [13 x i8] c"hometown=%s\0A\00"
define i32 @main() {
%1 = alloca [94 x i8]
%2 = alloca [30 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [30 x i8]
%6 = bitcast [94 x i8]* %1 to i8*
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [94 x i8], [94 x i8]* %1, i64 0, i64 0
%9 = call i32 @innerText(i8* %7, i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [94 x i8], [94 x i8]* %1, i64 0, i64 0
%14 = call i32 @innerText(i8* %12, i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%18 = getelementptr inbounds [94 x i8], [94 x i8]* %1, i64 0, i64 0
%19 = call i32 @innerText(i8* %17, i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%23 = getelementptr inbounds [94 x i8], [94 x i8]* %1, i64 0, i64 0
%24 = call i32 @innerText(i8* %22, i8* %23, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%25 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%26 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %25)
ret i32 0
}

LLVM IR (-O2):
@__const.main.xml = [94 x i8] c"<people name=\22\C2\B3\C2\AF\C3\81\C3\A9\C2\B8\C3\9B\22 sex=\22\C2\A8k\22><age>43</age><hometown>\C2\AA\C3\B7\C2\AA\C3\B9\C2\BF\C2\A4</hometown></people>\00"
@.str = [7 x i8] c"name=\22\00"
@.str.1 = [2 x i8] c"\22\00"
@.str.2 = [9 x i8] c"name=%s\0A\00"
@.str.3 = [6 x i8] c"sex=\22\00"
@.str.4 = [8 x i8] c"sex=%s\0A\00"
@.str.5 = [6 x i8] c"<age>\00"
@.str.6 = [7 x i8] c"</age>\00"
@.str.7 = [8 x i8] c"age=%s\0A\00"
@.str.8 = [11 x i8] c"<hometown>\00"
@.str.9 = [12 x i8] c"</hometown>\00"
@.str.10 = [13 x i8] c"hometown=%s\0A\00"
define i32 @main() {
%1 = alloca [94 x i8]
%2 = alloca [30 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [30 x i8]
%6 = getelementptr inbounds [94 x i8], [94 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%11 = call i32 @innerText(i8* %7, i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%13 = call i32 @innerText(i8* %8, i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%15 = call i32 @innerText(i8* %9, i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%17 = call i32 @innerText(i8* %10, i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i8* %10)
ret i32 0
}