void func(void) {
  char a[7] = ("wat");
  char b[3] = {"Hello"[1], 46};
  char c[] = {"World"
              "hello"};
  printf("b = {%c, %c, %c}, size = %lu\n", b[0], b[1], b[2], sizeof(b));
  printf("a = %s, size = %lu\n", a, sizeof(a));
  printf("c = %s, size = %lu\n", c, sizeof(c));
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x8(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x15(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0xd(%rbp)
mov    0xeaf(%rip),%al
mov    %al,-0xb(%rbp)
movsbl -0xa(%rbp),%esi
movsbl -0x9(%rbp),%edx
movsbl -0x8(%rbp),%ecx
lea    0xe9a(%rip),%rdi
mov    $0x3,%r8d
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x7(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x7,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x15(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0xb,%edx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
sub    $0x18,%rsp
movl   $0x0,0x3(%rsp)
movl   $0x746177,(%rsp)
movabs $0x6c6568646c726f57,%rax
68 65 6c
mov    %rax,0x8(%rsp)
movl   $0x6f6c6c,0xf(%rsp)
lea    0xed1(%rip),%rdi
mov    $0x3,%r8d
mov    $0x65,%esi
mov    $0x2e,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    %rsp,%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    $0xb,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.func.a = [7 x i8] c"wat\00\00\00\00"
@__const.func.b = [3 x i8] c"e.\00"
@__const.func.c = [11 x i8] c"Worldhello\00"
@.str = [30 x i8] c"b = {%c, %c, %c}, size = %lu\0A\00"
@.str.1 = [20 x i8] c"a = %s, size = %lu\0A\00"
@.str.2 = [20 x i8] c"c = %s, size = %lu\0A\00"
define void @func() {
%1 = alloca [7 x i8]
%2 = alloca [3 x i8]
%3 = alloca [11 x i8]
%4 = bitcast [7 x i8]* %1 to i8*
%5 = bitcast [3 x i8]* %2 to i8*
%6 = bitcast [11 x i8]* %3 to i8*
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12, i32 %15, i64 3)
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %17, i64 7)
%19 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %19, i64 11)
ret void
}

LLVM IR (-O2):
@__const.func.a = [7 x i8] c"wat\00\00\00\00"
@__const.func.c = [11 x i8] c"Worldhello\00"
@.str = [30 x i8] c"b = {%c, %c, %c}, size = %lu\0A\00"
@.str.1 = [20 x i8] c"a = %s, size = %lu\0A\00"
@.str.2 = [20 x i8] c"c = %s, size = %lu\0A\00"
define void @func() {
%1 = alloca [7 x i8]
%2 = alloca [11 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 101, i32 46, i32 0, i64 3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %3, i64 7)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %4, i64 11)
ret void
}