main() {
  int x = 1, y = 2;
  int z[7] = {1, 2, 3, 4, 5, 6, 7};
  int *ip;
  int i;
  printf("addr: %X, %X\n", &x, &y);
  for (i = 0; i < 7; i++)
    printf("%X, ", &z[i]);
  printf("\n");
  ip = &x;
  y = *ip;
  *ip = 0;
  printf("ip=%X, x=%d, y=%d\n", ip, x, y);
  ip = &z[0];
  *ip = *ip + 10;
  y = *ip + 1;
  printf("ip=%X, x=%d, y=%d\n", ip, x, y);
  *ip += 1;
  x = ++*ip;
  printf("ip=%X, x=%d, y=%d\n", ip, x, y);
  x = *ip++;
  y = (*ip)++;
  printf("ip=%X, x=%d, y=%d, *ip=%d\n", ip, x, y, *ip);
  printf("\nPress any key to end...");
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb4(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    0xeae(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x7,-0x3c(%rbp)
jge    11b9 <main+0x99>
movslq -0x3c(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1184 <main+0x64>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
add    $0xa,%ecx
mov    -0x38(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x38(%rbp),%rcx
mov    (%rcx),%eax
add    $0x1,%eax
mov    %eax,(%rcx)
mov    %eax,-0x8(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xdd0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x38(%rbp)
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x38(%rbp),%rcx
mov    (%rcx),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x38(%rbp),%rax
mov    (%rax),%r8d
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
movl   $0x1,0x8(%rsp)
movl   $0x2,0xc(%rsp)
movups 0xeb8(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xea0(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x1c(%rsp),%r13
lea    0xeab(%rip),%rdi
lea    0x8(%rsp),%r15
lea    0xc(%rsp),%rdx
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9e(%rip),%rbx
lea    0x10(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe15(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%ecx
lea    0xa(%rcx),%eax
mov    %eax,0x10(%rsp)
add    $0xb,%ecx
mov    %ecx,0xc(%rsp)
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
add    $0x2,%edx
mov    %edx,0x10(%rsp)
mov    %edx,0x8(%rsp)
mov    0xc(%rsp),%ecx
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    %edx,0x8(%rsp)
lea    0x1(%rcx),%r8d
mov    %r8d,0x14(%rsp)
mov    %ecx,0xc(%rsp)
lea    0xdb6(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdc0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.z = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [14 x i8] c"addr: %X, %X\0A\00"
@.str.1 = [5 x i8] c"%X, \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [19 x i8] c"ip=%X, x=%d, y=%d\0A\00"
@.str.4 = [27 x i8] c"ip=%X, x=%d, y=%d, *ip=%d\0A\00"
@.str.5 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [7 x i32]
%5 = alloca i32*
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
%7 = bitcast [7 x i32]* %4 to i8*
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 0, i32* %6
br label %9
9: ; preds = %17, %0
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 7
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %9
20: ; preds = %9
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %2, i32** %5
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
store i32 %23, i32* %3
%24 = load i32*, i32** %5
store i32 0, i32* %24
%25 = load i32*, i32** %5
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32* %25, i32 %26, i32 %27)
%29 = getelementptr inbounds [7 x i32], [7 x i32]* %4, i64 0, i64 0
store i32* %29, i32** %5
%30 = load i32*, i32** %5
%31 = load i32, i32* %30
%32 = add nsw i32 %31, 10
%33 = load i32*, i32** %5
store i32 %32, i32* %33
%34 = load i32*, i32** %5
%35 = load i32, i32* %34
%36 = add nsw i32 %35, 1
store i32 %36, i32* %3
%37 = load i32*, i32** %5
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32* %37, i32 %38, i32 %39)
%41 = load i32*, i32** %5
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
%44 = load i32*, i32** %5
%45 = load i32, i32* %44
%46 = add nsw i32 %45, 1
store i32 %46, i32* %44
store i32 %46, i32* %2
%47 = load i32*, i32** %5
%48 = load i32, i32* %2
%49 = load i32, i32* %3
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32* %47, i32 %48, i32 %49)
%51 = load i32*, i32** %5
%52 = getelementptr inbounds i32, i32* %51, i32 1
store i32* %52, i32** %5
%53 = load i32, i32* %51
store i32 %53, i32* %2
%54 = load i32*, i32** %5
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 1
store i32 %56, i32* %54
store i32 %55, i32* %3
%57 = load i32*, i32** %5
%58 = load i32, i32* %2
%59 = load i32, i32* %3
%60 = load i32*, i32** %5
%61 = load i32, i32* %60
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32* %57, i32 %58, i32 %59, i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%64 = call i32 (...) @getchar()
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@__const.main.z = [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7]
@.str = [14 x i8] c"addr: %X, %X\0A\00"
@.str.1 = [5 x i8] c"%X, \00"
@.str.3 = [19 x i8] c"ip=%X, x=%d, y=%d\0A\00"
@.str.4 = [27 x i8] c"ip=%X, x=%d, y=%d, *ip=%d\0A\00"
@.str.5 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x i32]
%4 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%6 = bitcast [7 x i32]* %3 to i8*
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%8 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 2
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 3
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 4
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 5
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 6
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %20)
%22 = call i32 @putchar(i32 10)
%23 = load i32, i32* %1
store i32 %23, i32* %2
store i32 0, i32* %1
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32* %1, i32 0, i32 %23)
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 10
store i32 %26, i32* %8
%27 = add nsw i32 %25, 11
store i32 %27, i32* %2
%28 = load i32, i32* %1
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32* %8, i32 %28, i32 %27)
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 2
store i32 %31, i32* %8
store i32 %31, i32* %1
%32 = load i32, i32* %2
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32* %8, i32 %31, i32 %32)
%34 = load i32, i32* %8
store i32 %34, i32* %1
%35 = load i32, i32* %10
%36 = add nsw i32 %35, 1
store i32 %36, i32* %10
store i32 %35, i32* %2
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32* %10, i32 %34, i32 %35, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%39 = call i32 (...) @getchar()
ret i32 0
}