int main() {
  struct foobar {
    int len;
    char *str;
  };
  struct foobar moo[3] = {{2, "foobar"}, {4, "fumu"}, {6, "arche"}};
  struct foobar *ptr = moo;
  printf("%c\n", *ptr++->str++);
  printf("%c\n", *0 [moo].str);
  printf("%s\n", ptr->str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movl   $0x2,-0x30(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x4,-0x20(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x6,-0x10(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rcx
mov    %rcx,%rax
add    $0x10,%rax
mov    %rax,-0x38(%rbp)
mov    0x8(%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,0x8(%rcx)
movsbl (%rax),%esi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
movsbl (%rax),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe4d(%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
lea    0xedd(%rip),%rbx
mov    %rbx,%rdi
mov    $0x66,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x6f,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.foobar = type { i32, i8* }
@.str = [7 x i8] c"foobar\00"
@.str.1 = [5 x i8] c"fumu\00"
@.str.2 = [6 x i8] c"arche\00"
@.str.3 = [4 x i8] c"%c\0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [3 x %struct.foobar]
%2 = alloca %struct.foobar*
%3 = bitcast [3 x %struct.foobar]* %1 to i8*
%4 = bitcast i8* %3 to [3 x %struct.foobar]*
%5 = getelementptr inbounds [3 x %struct.foobar], [3 x %struct.foobar]* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.foobar, %struct.foobar* %5, i32 0, i32 0
store i32 2, i32* %6
%7 = getelementptr inbounds %struct.foobar, %struct.foobar* %5, i32 0, i32 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8** %7
%8 = getelementptr inbounds [3 x %struct.foobar], [3 x %struct.foobar]* %4, i32 0, i32 1
%9 = getelementptr inbounds %struct.foobar, %struct.foobar* %8, i32 0, i32 0
store i32 4, i32* %9
%10 = getelementptr inbounds %struct.foobar, %struct.foobar* %8, i32 0, i32 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [3 x %struct.foobar], [3 x %struct.foobar]* %4, i32 0, i32 2
%12 = getelementptr inbounds %struct.foobar, %struct.foobar* %11, i32 0, i32 0
store i32 6, i32* %12
%13 = getelementptr inbounds %struct.foobar, %struct.foobar* %11, i32 0, i32 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [3 x %struct.foobar], [3 x %struct.foobar]* %1, i64 0, i64 0
store %struct.foobar* %14, %struct.foobar** %2
%15 = load %struct.foobar*, %struct.foobar** %2
%16 = getelementptr inbounds %struct.foobar, %struct.foobar* %15, i32 1
store %struct.foobar* %16, %struct.foobar** %2
%17 = getelementptr inbounds %struct.foobar, %struct.foobar* %15, i32 0, i32 1
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %17
%20 = load i8, i8* %18
%21 = sext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [3 x %struct.foobar], [3 x %struct.foobar]* %1, i64 0, i64 0
%24 = getelementptr inbounds %struct.foobar, %struct.foobar* %23, i32 0, i32 1
%25 = load i8*, i8** %24
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %27)
%29 = load %struct.foobar*, %struct.foobar** %2
%30 = getelementptr inbounds %struct.foobar, %struct.foobar* %29, i32 0, i32 1
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %31)
ret i32 0
}

LLVM IR (-O2):
%struct.foobar = type { i32, i8* }
@.str.1 = [5 x i8] c"fumu\00"
@.str.3 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 102)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 111)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}