#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*/ printf(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int main(int argc, char **argv) {
  const char string_test[] = "Hello World";
  char *p = string_test;
  printf("String: %s Length %zu\n", p, strlen(string_test));
  *p = 'Y';
  p = string_test + 1;
  *p = 'T';
  printf("String: %s Length %zu\n", string_test, strlen(string_test));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x14(%rbp)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
movb   $0x59,(%rax)
lea    -0x1c(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x54,(%rax)
lea    -0x1c(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x1c(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
lea    0xe66(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xeba(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
movw   $0x5459,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.string_test = [12 x i8] c"Hello World\00"
@.str = [23 x i8] c"String: %s Length %zu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [12 x i8]
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [12 x i8]* %5 to i8*
%8 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
%13 = load i8*, i8** %6
store i8 89, i8* %13
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8* %15, i8** %6
%16 = load i8*, i8** %6
store i8 84, i8* %16
%17 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [12 x i8], [12 x i8]* %5, i64 0, i64 0
%19 = call i32 @strlen(i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string_test = [12 x i8] c"Hello World\00"
@.str = [23 x i8] c"String: %s Length %zu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %5)
store i8 89, i8* %4
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 1
store i8 84, i8* %7
%8 = call i32 @strlen(i8* %4)
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %8)
ret i32 0
}