int main(int argv, char **args) {
  int i = 0;
  char s[] = "asdfgh";
  char *a[] = {"qw", "ewe", "sasd", "gggg"};
  char **b = {"qw", "ewe", "sasd", "gggg"};
  char c[][5] = {"qw", "ewe", "sasd", "gggg"};
  printf("a[0]: %s\n", a[0]);
  printf("a[0]+1: %s\n", a[0] + 1);
  printf("a+1: %s\n", a + 1);
  printf("c[0]: %s\n", c[0]);
  printf("c[0]+1: %s\n", c[0] + 1);
  printf("c+1: %s\n", c + 1);
  printf("s old: %s\n", s);
  s[i] = 'g';
  printf("s new: %s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x1b(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x17(%rbp)
mov    0xebf(%rip),%al
mov    %al,-0x15(%rbp)
mov    0x2caf(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0x2cac(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0x2ca9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2ca6(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xee8(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xee5(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xee3(%rip),%eax
mov    %eax,-0x50(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rsi
add    $0x1,%rsi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rsi
add    $0x8,%rsi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
add    $0x1,%rsi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
add    $0x5,%rsi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1b(%rbp),%rsi
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
movb   $0x67,-0x1b(%rbp,%rax,1)
lea    -0x1b(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movl   $0x686766,0xb(%rsp)
movl   $0x66647361,0x8(%rsp)
66
movaps 0x2ce4(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2cc8(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0xf3d(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0xebe(%rip),%rdi
lea    0xea6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xe92(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x38(%rsp),%rsi
lea    0xea5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x11(%rsp),%rsi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x15(%rsp),%rsi
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x67,0x8(%rsp)
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [7 x i8] c"asdfgh\00"
@.str = [3 x i8] c"qw\00"
@.str.1 = [4 x i8] c"ewe\00"
@.str.2 = [5 x i8] c"sasd\00"
@.str.3 = [5 x i8] c"gggg\00"
@__const.main.a = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@__const.main.c = [4 x [5 x i8]] [[5 x i8] c"qw\00\00\00", [5 x i8] c"ewe\00\00", [5 x i8] c"sasd\00", [5 x i8] c"gggg\00"]
@.str.4 = [10 x i8] c"a[0]: %s\0A\00"
@.str.5 = [12 x i8] c"a[0]+1: %s\0A\00"
@.str.6 = [9 x i8] c"a+1: %s\0A\00"
@.str.7 = [10 x i8] c"c[0]: %s\0A\00"
@.str.8 = [12 x i8] c"c[0]+1: %s\0A\00"
@.str.9 = [9 x i8] c"c+1: %s\0A\00"
@.str.10 = [11 x i8] c"s old: %s\0A\00"
@.str.11 = [11 x i8] c"s new: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [7 x i8]
%8 = alloca [4 x i8*]
%9 = alloca i8**
%10 = alloca [4 x [5 x i8]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%11 = bitcast [7 x i8]* %7 to i8*
%12 = bitcast [4 x i8*]* %8 to i8*
store i8** bitcast ([3 x i8]* @.str to i8**), i8*** %9
%13 = bitcast [4 x [5 x i8]]* %10 to i8*
%14 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [4 x i8*], [4 x i8*]* %8, i64 0, i64 0
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %22)
%24 = getelementptr inbounds [4 x [5 x i8]], [4 x [5 x i8]]* %10, i64 0, i64 0
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %24, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [4 x [5 x i8]], [4 x [5 x i8]]* %10, i64 0, i64 0
%28 = getelementptr inbounds [5 x i8], [5 x i8]* %27, i64 0, i64 0
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %29)
%31 = getelementptr inbounds [4 x [5 x i8]], [4 x [5 x i8]]* %10, i64 0, i64 0
%32 = getelementptr inbounds [5 x i8], [5 x i8]* %31, i64 1
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), [5 x i8]* %32)
%34 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %34)
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 %37
store i8 103, i8* %38
%39 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* %39)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [7 x i8] c"asdfgh\00"
@.str = [3 x i8] c"qw\00"
@.str.1 = [4 x i8] c"ewe\00"
@.str.2 = [5 x i8] c"sasd\00"
@.str.3 = [5 x i8] c"gggg\00"
@__const.main.a = [4 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@__const.main.c = [4 x [5 x i8]] [[5 x i8] c"qw\00\00\00", [5 x i8] c"ewe\00\00", [5 x i8] c"sasd\00", [5 x i8] c"gggg\00"]
@.str.4 = [10 x i8] c"a[0]: %s\0A\00"
@.str.5 = [12 x i8] c"a[0]+1: %s\0A\00"
@.str.6 = [9 x i8] c"a+1: %s\0A\00"
@.str.7 = [10 x i8] c"c[0]: %s\0A\00"
@.str.8 = [12 x i8] c"c[0]+1: %s\0A\00"
@.str.9 = [9 x i8] c"c+1: %s\0A\00"
@.str.10 = [11 x i8] c"s old: %s\0A\00"
@.str.11 = [11 x i8] c"s new: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [7 x i8]
%4 = alloca [4 x i8*]
%5 = alloca [4 x [5 x i8]]
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%7 = bitcast [4 x i8*]* %4 to i8*
%8 = getelementptr inbounds [4 x [5 x i8]], [4 x [5 x i8]]* %5, i64 0, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 1))
%11 = getelementptr inbounds [4 x i8*], [4 x i8*]* %4, i64 0, i64 1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %8)
%14 = getelementptr inbounds [4 x [5 x i8]], [4 x [5 x i8]]* %5, i64 0, i64 0, i64 1
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [4 x [5 x i8]], [4 x [5 x i8]]* %5, i64 0, i64 1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), [5 x i8]* %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %6)
store i8 103, i8* %6
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* %6)
ret i32 0
}