int main(int argc, char *argv[]) {
  int n = 3;
  struct string {
    int len;
    char *str;
  } * p, *p2;
  p = (struct string *)malloc(sizeof(struct string) * n);
  p2 = p;
  int i, j;
  char c = 'a';
  for (i = 0; i < n; i++) {
    p[i].len = (i + 1) * n;
    p[i].str = (char *)malloc(sizeof(char) * p[i].len + 1);
    for (j = 0; j < p[i].len; j++) {
      p[i].str[j] = c++;
    }
    p[i].str[j + 1] = '\0';
  }
  for (i = 0; i < n; i++) {
    printf("[%d] len: %d, str:  %s\n", i, p[i].len, p[i].str);
  }
  printf("\np: %p, p->len: %d\n", p, p->len);
  int newlen = ++p->len;
  printf("(%s)\n\tp: %p, newlen: %d\n", "++p->len", p, newlen);
  newlen = (++p)->len;
  printf("(%s)\n\tp: %p, newlen: %d\n", "(++p)->len", p, newlen);
  newlen = (p++)->len;
  printf("(%s)\n\tp: %p, newlen: %d\n", "(p++)->len", p, newlen);
  newlen = p->len;
  printf("(%s)\n\tp: %p, newlen: %d\n", "p->len", p, newlen);
  printf("\np2: %p, p2->str: %p (%s)\n", p2, p2->str, p2->str);
  char newstr = *p2->str;
  printf("(%s)\n\tp2: %p, p2->str: %p (%s), newstr: %c\n", "*p2->str", p2,
         p2->str, p2->str, newstr);
  newstr = *p2->str++;
  printf("(%s)\n\tp2: %p, p2->str: %p (%s), newstr: %c\n", "*p2->str++", p2,
         p2->str, p2->str, newstr);
  newstr = (*p2->str)++;
  printf("(%s)\n\tp2: %p, p2->str: %p (%s), newstr: %c\n", "(*p2->str)++", p2,
         p2->str, p2->str, newstr);
  newstr = *p2++->str;
  printf("(%s)\n\tp2: %p, p2->str: %p (%s), newstr: %c\n", "*p2++->str", p2,
         p2->str, p2->str, newstr);
  newstr = *p2->str;
  printf("(%s)\n\tp2: %p, p2->str: %p (%s), newstr: %c\n", "*p2->str", p2,
         p2->str, p2->str, newstr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movslq -0x14(%rbp),%rdi
shl    $0x4,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movb   $0x61,-0x31(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    123e <main+0x11e>
mov    -0x2c(%rbp),%ecx
add    $0x1,%ecx
imul   -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq (%rax),%rdi
shl    $0x0,%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,0x8(%rax)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x2c(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rcx
cmp    (%rcx),%eax
jge    1210 <main+0xf0>
mov    -0x31(%rbp),%dl
mov    %dl,%al
add    $0x1,%al
mov    %al,-0x31(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
movslq -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11c4 <main+0xa4>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1161 <main+0x41>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1294 <main+0x174>
mov    -0x2c(%rbp),%esi
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rcx
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1245 <main+0x125>
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rax
mov    (%rax),%edx
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%ecx
lea    0xd64(%rip),%rdi
lea    0xd76(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x20(%rbp)
mov    0x10(%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%ecx
lea    0xd33(%rip),%rdi
lea    0xd4e(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%ecx
lea    0xd03(%rip),%rdi
lea    0xd29(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%ecx
lea    0xcde(%rip),%rdi
lea    0xcf2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x39(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r8
movsbl -0x39(%rbp),%r9d
lea    0xcd4(%rip),%rdi
lea    0xcf9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rcx
mov    0x8(%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,0x8(%rcx)
mov    (%rax),%al
mov    %al,-0x39(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r8
movsbl -0x39(%rbp),%r9d
lea    0xc8e(%rip),%rdi
lea    0xcbc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    (%rcx),%al
mov    %al,%dl
add    $0x1,%dl
mov    %dl,(%rcx)
mov    %al,-0x39(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r8
movsbl -0x39(%rbp),%r9d
lea    0xc4c(%rip),%rdi
lea    0xc85(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x10,%rcx
mov    %rcx,-0x28(%rbp)
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x39(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r8
movsbl -0x39(%rbp),%r9d
lea    0xc06(%rip),%rdi
lea    0xc4c(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%al
mov    %al,-0x39(%rbp)
mov    -0x28(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%r8
movsbl -0x39(%rbp),%r9d
lea    0xbcb(%rip),%rdi
lea    0xbf0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x30,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x3,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%rbx)
movb   $0x61,(%rax)
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x8(%rbx),%rax
lea    0x61(%rbp),%ecx
mov    %cl,(%rax,%rbp,1)
add    $0x1,%rbp
movslq (%rbx),%rax
cmp    %rax,%rbp
jl     1160 <main+0x40>
mov    0x8(%rbx),%rax
movb   $0x0,0x1(%rax,%rbp,1)
movl   $0x6,0x10(%rbx)
mov    $0x7,%edi
call   1040 <malloc@plt>
mov    %rax,0x18(%rbx)
lea    0x61(%rbp),%ecx
mov    %cl,(%rax)
add    $0x63,%bpl
xor    %eax,%eax
nop
mov    %rax,%rcx
lea    -0x1(%rbp),%eax
mov    0x18(%rbx),%rdx
mov    %al,0x1(%rdx,%rcx,1)
movslq 0x10(%rbx),%rdx
add    $0x1,%bpl
lea    0x1(%rcx),%rax
add    $0x2,%rcx
cmp    %rdx,%rcx
jl     11a0 <main+0x80>
mov    0x18(%rbx),%rcx
movb   $0x0,0x2(%rcx,%rax,1)
movl   $0x9,0x20(%rbx)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,0x28(%rbx)
lea    -0x1(%rbp),%ecx
mov    %cl,(%rax)
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
mov    0x28(%rbx),%rcx
mov    %bpl,(%rcx,%rax,1)
add    $0x1,%rax
movslq 0x20(%rbx),%rcx
add    $0x1,%bpl
cmp    %rcx,%rax
jl     11f0 <main+0xd0>
mov    0x28(%rbx),%rcx
movb   $0x0,0x1(%rcx,%rax,1)
mov    (%rbx),%ebp
mov    0x8(%rbx),%rcx
lea    0xde1(%rip),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rbx),%r14
mov    0x10(%rbx),%edx
mov    0x18(%rbx),%rcx
mov    %r12,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%r15
add    $0x20,%r15
mov    0x20(%rbx),%edx
mov    0x28(%rbx),%rcx
mov    %r12,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdad(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%ecx
add    $0x1,%ecx
mov    %ecx,(%rbx)
lea    0xda7(%rip),%rbp
lea    0xdb9(%rip),%rsi
mov    %rbp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rbx),%ecx
lea    0xdab(%rip),%rsi
mov    %rbp,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rbx),%ecx
lea    0xd9f(%rip),%rsi
mov    %rbp,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rbx),%ecx
lea    0xd76(%rip),%rsi
mov    %rbp,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rcx
lea    0xd7b(%rip),%rdi
mov    %rbx,%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rcx
movsbl (%rcx),%r9d
lea    0xd7a(%rip),%r15
lea    0xd9f(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,0x8(%rbx)
movsbl (%rax),%r9d
lea    0xd7e(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rax
movsbl (%rax),%r9d
lea    0x1(%r9),%ecx
mov    %cl,(%rax)
mov    0x8(%rbx),%rcx
lea    0xd60(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rbx),%rax
mov    0x18(%rbx),%rcx
movsbl (%rax),%r9d
lea    0xd4a(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rbx),%rcx
movsbl (%rcx),%r9d
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rcx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.string = type { i32, i8* }
@.str = [24 x i8] c"[%d] len: %d, str: %s\0A\00"
@.str.1 = [20 x i8] c"\0Ap: %p, p->len: %d\0A\00"
@.str.2 = [25 x i8] c"(%s)\0A\09p: %p, newlen: %d\0A\00"
@.str.3 = [9 x i8] c"++p->len\00"
@.str.4 = [11 x i8] c"(++p)->len\00"
@.str.5 = [11 x i8] c"(p++)->len\00"
@.str.6 = [7 x i8] c"p->len\00"
@.str.7 = [27 x i8] c"\0Ap2: %p, p2->str: %p (%s)\0A\00"
@.str.8 = [44 x i8] c"(%s)\0A\09p2: %p, p2->str: %p (%s), newstr: %c\0A\00"
@.str.9 = [9 x i8] c"*p2->str\00"
@.str.10 = [11 x i8] c"*p2->str++\00"
@.str.11 = [13 x i8] c"(*p2->str)++\00"
@.str.12 = [11 x i8] c"*p2++->str\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.string*
%8 = alloca %struct.string*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8
%12 = alloca i32
%13 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = mul i64 16, %15
%17 = call i8* @malloc(i64 %16)
%18 = bitcast i8* %17 to %struct.string*
store %struct.string* %18, %struct.string** %7
%19 = load %struct.string*, %struct.string** %7
store %struct.string* %19, %struct.string** %8
store i8 97, i8* %11
store i32 0, i32* %9
br label %20
20: ; preds = %84, %2
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %87
24: ; preds = %20
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %6
%28 = mul nsw i32 %26, %27
%29 = load %struct.string*, %struct.string** %7
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds %struct.string, %struct.string* %29, i64 %31
%33 = getelementptr inbounds %struct.string, %struct.string* %32, i32 0, i32 0
store i32 %28, i32* %33
%34 = load %struct.string*, %struct.string** %7
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds %struct.string, %struct.string* %34, i64 %36
%38 = getelementptr inbounds %struct.string, %struct.string* %37, i32 0, i32 0
%39 = load i32, i32* %38
%40 = sext i32 %39 to i64
%41 = mul i64 1, %40
%42 = add i64 %41, 1
%43 = call i8* @malloc(i64 %42)
%44 = load %struct.string*, %struct.string** %7
%45 = load i32, i32* %9
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds %struct.string, %struct.string* %44, i64 %46
%48 = getelementptr inbounds %struct.string, %struct.string* %47, i32 0, i32 1
store i8* %43, i8** %48
store i32 0, i32* %10
br label %49
49: ; preds = %70, %24
%50 = load i32, i32* %10
%51 = load %struct.string*, %struct.string** %7
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds %struct.string, %struct.string* %51, i64 %53
%55 = getelementptr inbounds %struct.string, %struct.string* %54, i32 0, i32 0
%56 = load i32, i32* %55
%57 = icmp slt i32 %50, %56
br i1 %57, label %58, label %73
58: ; preds = %49
%59 = load i8, i8* %11
%60 = add i8 %59, 1
store i8 %60, i8* %11
%61 = load %struct.string*, %struct.string** %7
%62 = load i32, i32* %9
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds %struct.string, %struct.string* %61, i64 %63
%65 = getelementptr inbounds %struct.string, %struct.string* %64, i32 0, i32 1
%66 = load i8*, i8** %65
%67 = load i32, i32* %10
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
store i8 %59, i8* %69
br label %70
70: ; preds = %58
%71 = load i32, i32* %10
%72 = add nsw i32 %71, 1
store i32 %72, i32* %10
br label %49
73: ; preds = %49
%74 = load %struct.string*, %struct.string** %7
%75 = load i32, i32* %9
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds %struct.string, %struct.string* %74, i64 %76
%78 = getelementptr inbounds %struct.string, %struct.string* %77, i32 0, i32 1
%79 = load i8*, i8** %78
%80 = load i32, i32* %10
%81 = add nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8, i8* %79, i64 %82
store i8 0, i8* %83
br label %84
84: ; preds = %73
%85 = load i32, i32* %9
%86 = add nsw i32 %85, 1
store i32 %86, i32* %9
br label %20
87: ; preds = %20
store i32 0, i32* %9
br label %88
88: ; preds = %107, %87
%89 = load i32, i32* %9
%90 = load i32, i32* %6
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %110
92: ; preds = %88
%93 = load i32, i32* %9
%94 = load %struct.string*, %struct.string** %7
%95 = load i32, i32* %9
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds %struct.string, %struct.string* %94, i64 %96
%98 = getelementptr inbounds %struct.string, %struct.string* %97, i32 0, i32 0
%99 = load i32, i32* %98
%100 = load %struct.string*, %struct.string** %7
%101 = load i32, i32* %9
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds %struct.string, %struct.string* %100, i64 %102
%104 = getelementptr inbounds %struct.string, %struct.string* %103, i32 0, i32 1
%105 = load i8*, i8** %104
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %93, i32 %99, i8* %105)
br label %107
107: ; preds = %92
%108 = load i32, i32* %9
%109 = add nsw i32 %108, 1
store i32 %109, i32* %9
br label %88
110: ; preds = %88
%111 = load %struct.string*, %struct.string** %7
%112 = load %struct.string*, %struct.string** %7
%113 = getelementptr inbounds %struct.string, %struct.string* %112, i32 0, i32 0
%114 = load i32, i32* %113
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), %struct.string* %111, i32 %114)
%116 = load %struct.string*, %struct.string** %7
%117 = getelementptr inbounds %struct.string, %struct.string* %116, i32 0, i32 0
%118 = load i32, i32* %117
%119 = add nsw i32 %118, 1
store i32 %119, i32* %117
store i32 %119, i32* %12
%120 = load %struct.string*, %struct.string** %7
%121 = load i32, i32* %12
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), %struct.string* %120, i32 %121)
%123 = load %struct.string*, %struct.string** %7
%124 = getelementptr inbounds %struct.string, %struct.string* %123, i32 1
store %struct.string* %124, %struct.string** %7
%125 = getelementptr inbounds %struct.string, %struct.string* %124, i32 0, i32 0
%126 = load i32, i32* %125
store i32 %126, i32* %12
%127 = load %struct.string*, %struct.string** %7
%128 = load i32, i32* %12
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %struct.string* %127, i32 %128)
%130 = load %struct.string*, %struct.string** %7
%131 = getelementptr inbounds %struct.string, %struct.string* %130, i32 1
store %struct.string* %131, %struct.string** %7
%132 = getelementptr inbounds %struct.string, %struct.string* %130, i32 0, i32 0
%133 = load i32, i32* %132
store i32 %133, i32* %12
%134 = load %struct.string*, %struct.string** %7
%135 = load i32, i32* %12
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %struct.string* %134, i32 %135)
%137 = load %struct.string*, %struct.string** %7
%138 = getelementptr inbounds %struct.string, %struct.string* %137, i32 0, i32 0
%139 = load i32, i32* %138
store i32 %139, i32* %12
%140 = load %struct.string*, %struct.string** %7
%141 = load i32, i32* %12
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %struct.string* %140, i32 %141)
%143 = load %struct.string*, %struct.string** %8
%144 = load %struct.string*, %struct.string** %8
%145 = getelementptr inbounds %struct.string, %struct.string* %144, i32 0, i32 1
%146 = load i8*, i8** %145
%147 = load %struct.string*, %struct.string** %8
%148 = getelementptr inbounds %struct.string, %struct.string* %147, i32 0, i32 1
%149 = load i8*, i8** %148
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), %struct.string* %143, i8* %146, i8* %149)
%151 = load %struct.string*, %struct.string** %8
%152 = getelementptr inbounds %struct.string, %struct.string* %151, i32 0, i32 1
%153 = load i8*, i8** %152
%154 = load i8, i8* %153
store i8 %154, i8* %13
%155 = load %struct.string*, %struct.string** %8
%156 = load %struct.string*, %struct.string** %8
%157 = getelementptr inbounds %struct.string, %struct.string* %156, i32 0, i32 1
%158 = load i8*, i8** %157
%159 = load %struct.string*, %struct.string** %8
%160 = getelementptr inbounds %struct.string, %struct.string* %159, i32 0, i32 1
%161 = load i8*, i8** %160
%162 = load i8, i8* %13
%163 = sext i8 %162 to i32
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), %struct.string* %155, i8* %158, i8* %161, i32 %163)
%165 = load %struct.string*, %struct.string** %8
%166 = getelementptr inbounds %struct.string, %struct.string* %165, i32 0, i32 1
%167 = load i8*, i8** %166
%168 = getelementptr inbounds i8, i8* %167, i32 1
store i8* %168, i8** %166
%169 = load i8, i8* %167
store i8 %169, i8* %13
%170 = load %struct.string*, %struct.string** %8
%171 = load %struct.string*, %struct.string** %8
%172 = getelementptr inbounds %struct.string, %struct.string* %171, i32 0, i32 1
%173 = load i8*, i8** %172
%174 = load %struct.string*, %struct.string** %8
%175 = getelementptr inbounds %struct.string, %struct.string* %174, i32 0, i32 1
%176 = load i8*, i8** %175
%177 = load i8, i8* %13
%178 = sext i8 %177 to i32
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), %struct.string* %170, i8* %173, i8* %176, i32 %178)
%180 = load %struct.string*, %struct.string** %8
%181 = getelementptr inbounds %struct.string, %struct.string* %180, i32 0, i32 1
%182 = load i8*, i8** %181
%183 = load i8, i8* %182
%184 = add i8 %183, 1
store i8 %184, i8* %182
store i8 %183, i8* %13
%185 = load %struct.string*, %struct.string** %8
%186 = load %struct.string*, %struct.string** %8
%187 = getelementptr inbounds %struct.string, %struct.string* %186, i32 0, i32 1
%188 = load i8*, i8** %187
%189 = load %struct.string*, %struct.string** %8
%190 = getelementptr inbounds %struct.string, %struct.string* %189, i32 0, i32 1
%191 = load i8*, i8** %190
%192 = load i8, i8* %13
%193 = sext i8 %192 to i32
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), %struct.string* %185, i8* %188, i8* %191, i32 %193)
%195 = load %struct.string*, %struct.string** %8
%196 = getelementptr inbounds %struct.string, %struct.string* %195, i32 1
store %struct.string* %196, %struct.string** %8
%197 = getelementptr inbounds %struct.string, %struct.string* %195, i32 0, i32 1
%198 = load i8*, i8** %197
%199 = load i8, i8* %198
store i8 %199, i8* %13
%200 = load %struct.string*, %struct.string** %8
%201 = load %struct.string*, %struct.string** %8
%202 = getelementptr inbounds %struct.string, %struct.string* %201, i32 0, i32 1
%203 = load i8*, i8** %202
%204 = load %struct.string*, %struct.string** %8
%205 = getelementptr inbounds %struct.string, %struct.string* %204, i32 0, i32 1
%206 = load i8*, i8** %205
%207 = load i8, i8* %13
%208 = sext i8 %207 to i32
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), %struct.string* %200, i8* %203, i8* %206, i32 %208)
%210 = load %struct.string*, %struct.string** %8
%211 = getelementptr inbounds %struct.string, %struct.string* %210, i32 0, i32 1
%212 = load i8*, i8** %211
%213 = load i8, i8* %212
store i8 %213, i8* %13
%214 = load %struct.string*, %struct.string** %8
%215 = load %struct.string*, %struct.string** %8
%216 = getelementptr inbounds %struct.string, %struct.string* %215, i32 0, i32 1
%217 = load i8*, i8** %216
%218 = load %struct.string*, %struct.string** %8
%219 = getelementptr inbounds %struct.string, %struct.string* %218, i32 0, i32 1
%220 = load i8*, i8** %219
%221 = load i8, i8* %13
%222 = sext i8 %221 to i32
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), %struct.string* %214, i8* %217, i8* %220, i32 %222)
ret i32 0
}

LLVM IR (-O2):
%struct.string = type { i32, i8* }
@.str = [24 x i8] c"[%d] len: %d, str: %s\0A\00"
@.str.1 = [20 x i8] c"\0Ap: %p, p->len: %d\0A\00"
@.str.2 = [25 x i8] c"(%s)\0A\09p: %p, newlen: %d\0A\00"
@.str.3 = [9 x i8] c"++p->len\00"
@.str.4 = [11 x i8] c"(++p)->len\00"
@.str.5 = [11 x i8] c"(p++)->len\00"
@.str.6 = [7 x i8] c"p->len\00"
@.str.7 = [27 x i8] c"\0Ap2: %p, p2->str: %p (%s)\0A\00"
@.str.8 = [44 x i8] c"(%s)\0A\09p2: %p, p2->str: %p (%s), newstr: %c\0A\00"
@.str.9 = [9 x i8] c"*p2->str\00"
@.str.10 = [11 x i8] c"*p2->str++\00"
@.str.11 = [13 x i8] c"(*p2->str)++\00"
@.str.12 = [11 x i8] c"*p2++->str\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(48) i8* @malloc(i64 48)
%4 = bitcast i8* %3 to %struct.string*
%5 = getelementptr inbounds %struct.string, %struct.string* %4, i64 0, i32 0
store i32 3, i32* %5
%6 = tail call dereferenceable_or_null(4) i8* @malloc(i64 4)
%7 = getelementptr inbounds %struct.string, %struct.string* %4, i64 0, i32 1
store i8* %6, i8** %7
store i8 97, i8* %6
br label %8
8: ; preds = %2, %8
%9 = phi i64 [ 1, %2 ], [ %14, %8 ]
%10 = phi i8 [ 98, %2 ], [ %12, %8 ]
%11 = load i8*, i8** %7
%12 = add i8 %10, 1
%13 = getelementptr inbounds i8, i8* %11, i64 %9
store i8 %10, i8* %13
%14 = add nuw nsw i64 %9, 1
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = icmp slt i64 %14, %16
br i1 %17, label %8, label %18
18: ; preds = %8
%19 = load i8*, i8** %7
%20 = add nuw i64 %9, 2
%21 = and i64 %20, 4294967295
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 0, i8* %22
%23 = getelementptr inbounds %struct.string, %struct.string* %4, i64 1, i32 0
store i32 6, i32* %23
%24 = tail call dereferenceable_or_null(7) i8* @malloc(i64 7)
%25 = getelementptr inbounds %struct.string, %struct.string* %4, i64 1, i32 1
store i8* %24, i8** %25
%26 = add i8 %10, 2
store i8 %12, i8* %24
br label %27
27: ; preds = %18, %27
%28 = phi i64 [ 1, %18 ], [ %33, %27 ]
%29 = phi i8 [ %26, %18 ], [ %31, %27 ]
%30 = load i8*, i8** %25
%31 = add i8 %29, 1
%32 = getelementptr inbounds i8, i8* %30, i64 %28
store i8 %29, i8* %32
%33 = add nuw nsw i64 %28, 1
%34 = load i32, i32* %23
%35 = sext i32 %34 to i64
%36 = icmp slt i64 %33, %35
br i1 %36, label %27, label %37
37: ; preds = %27
%38 = load i8*, i8** %25
%39 = add nuw i64 %28, 2
%40 = and i64 %39, 4294967295
%41 = getelementptr inbounds i8, i8* %38, i64 %40
store i8 0, i8* %41
%42 = getelementptr inbounds %struct.string, %struct.string* %4, i64 2, i32 0
store i32 9, i32* %42
%43 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%44 = getelementptr inbounds %struct.string, %struct.string* %4, i64 2, i32 1
store i8* %43, i8** %44
store i8 %31, i8* %43
br label %45
45: ; preds = %37, %45
%46 = phi i64 [ 1, %37 ], [ %51, %45 ]
%47 = phi i8 [ %31, %37 ], [ %48, %45 ]
%48 = add i8 %47, 1
%49 = load i8*, i8** %44
%50 = getelementptr inbounds i8, i8* %49, i64 %46
store i8 %48, i8* %50
%51 = add nuw nsw i64 %46, 1
%52 = load i32, i32* %42
%53 = sext i32 %52 to i64
%54 = icmp slt i64 %51, %53
br i1 %54, label %45, label %55
55: ; preds = %45
%56 = load i8*, i8** %44
%57 = add nuw i64 %46, 2
%58 = and i64 %57, 4294967295
%59 = getelementptr inbounds i8, i8* %56, i64 %58
store i8 0, i8* %59
%60 = load i32, i32* %5
%61 = load i8*, i8** %7
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 0, i32 %60, i8* %61)
%63 = load i32, i32* %23
%64 = load i8*, i8** %25
%65 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 %63, i8* %64)
%66 = load i32, i32* %42
%67 = load i8*, i8** %44
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 2, i32 %66, i8* %67)
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %60)
%70 = load i32, i32* %5
%71 = add nsw i32 %70, 1
store i32 %71, i32* %5
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %3, i32 %71)
%73 = getelementptr inbounds %struct.string, %struct.string* %4, i64 1
%74 = getelementptr inbounds %struct.string, %struct.string* %73, i64 0, i32 0
%75 = load i32, i32* %74
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), %struct.string* %73, i32 %75)
%77 = getelementptr inbounds %struct.string, %struct.string* %4, i64 2
%78 = load i32, i32* %74
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), %struct.string* %77, i32 %78)
%80 = getelementptr inbounds %struct.string, %struct.string* %77, i64 0, i32 0
%81 = load i32, i32* %80
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %struct.string* %77, i32 %81)
%83 = load i8*, i8** %7
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i8* %3, i8* %83, i8* %83)
%85 = load i8*, i8** %7
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), i8* %3, i8* %85, i8* %85, i32 %87)
%89 = load i8*, i8** %7
%90 = getelementptr inbounds i8, i8* %89, i64 1
store i8* %90, i8** %7
%91 = load i8, i8* %89
%92 = sext i8 %91 to i32
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i8* %3, i8* %90, i8* %90, i32 %92)
%94 = load i8*, i8** %7
%95 = load i8, i8* %94
%96 = add i8 %95, 1
store i8 %96, i8* %94
%97 = load i8*, i8** %7
%98 = sext i8 %95 to i32
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* %3, i8* %97, i8* %97, i32 %98)
%100 = load i8*, i8** %7
%101 = load i8, i8* %100
%102 = load i8*, i8** %25
%103 = sext i8 %101 to i32
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), %struct.string* %73, i8* %102, i8* %102, i32 %103)
%105 = load i8*, i8** %25
%106 = load i8, i8* %105
%107 = sext i8 %106 to i32
%108 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), %struct.string* %73, i8* %105, i8* %105, i32 %107)
ret i32 0
}