#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 */
typedef int /*<<< orphan*/ pointer;
typedef int /*<<< orphan*/ array2;
typedef int /*<<< orphan*/ array1;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char *pointer = "String literal";
  char array1[] = "String literal";
  char array2[32] = "String literal";
  printf("sizeof(pointer) = %ld\n", sizeof(pointer));
  printf("sizeof(array1) = %ld\n", sizeof(array1));
  printf("sizeof(array2) = %ld\n", sizeof(array2));
  array1[1] = 'p';
  printf("array1 = %s\n", array1);
  array2[1] = 'p';
  printf("array2 = %s\n", array2);
  pointer = array1;
  printf("pointer = %s\n", pointer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xed6(%rip),%rax
mov    %rax,-0x17(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0xf(%rbp)
mov    0xece(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xf2e(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xf2b(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xf28(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xf25(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe91(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0xf,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x70,-0x16(%rbp)
lea    -0x17(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x70,-0x3f(%rbp)
lea    -0x40(%rbp),%rsi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x17(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movabs $0x6c61726574696c,%rax
mov    %rax,0x7(%rsp)
movabs $0x6c20676e69727453,%rax
67 20 6c
mov    %rax,(%rsp)
movaps 0xf57(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xf3b(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xebe(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0xf,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x20,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x70,0x1(%rsp)
lea    0xec3(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x70,0x11(%rsp)
lea    0xeb7(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"String literal\00"
@__const.main.array1 = [15 x i8] c"String literal\00"
@__const.main.array2 = [32 x i8] c"String literal\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [23 x i8] c"sizeof(pointer) = %ld\0A\00"
@.str.2 = [22 x i8] c"sizeof(array1) = %ld\0A\00"
@.str.3 = [22 x i8] c"sizeof(array2) = %ld\0A\00"
@.str.4 = [13 x i8] c"array1 = %s\0A\00"
@.str.5 = [13 x i8] c"array2 = %s\0A\00"
@.str.6 = [14 x i8] c"pointer = %s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca [15 x i8]
%3 = alloca [32 x i8]
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = bitcast [32 x i8]* %3 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 8)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i64 15)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i64 32)
%9 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 1
store i8 112, i8* %9
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 1
store i8 112, i8* %12
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
store i8* %15, i8** %1
%16 = load i8*, i8** %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array1 = [15 x i8] c"String literal\00"
@__const.main.array2 = [32 x i8] c"String literal\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.1 = [23 x i8] c"sizeof(pointer) = %ld\0A\00"
@.str.2 = [22 x i8] c"sizeof(array1) = %ld\0A\00"
@.str.3 = [22 x i8] c"sizeof(array2) = %ld\0A\00"
@.str.4 = [13 x i8] c"array1 = %s\0A\00"
@.str.5 = [13 x i8] c"array2 = %s\0A\00"
@.str.6 = [14 x i8] c"pointer = %s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 8)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i64 15)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i64 32)
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
store i8 112, i8* %8
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %3)
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 1
store i8 112, i8* %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %4)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %3)
ret i32 0
}