#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int data[2] = {100, 200};
  int data2[2] = {300, 300};
  int *p1, *p2, *p3;
  p1 = p2 = data;
  p3 = data2;
  printf("*p1 = %d, *p2 = %d, *p3 = %d\n", *p1, *p2, *p3);
  printf("*p1++ = %d, *++p2 = %d, (*p3)++ = %d\n", *p1++, *++p2, (*p3)++);
  printf("*p1 = %d, *p2 = %d, *p3 = %d\n", *p1, *p2, *p3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x14(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    %rax,-0x20(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x28(%rbp)
mov    0x4(%rax),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
mov    %ecx,%edi
add    $0x1,%edi
mov    %edi,(%rax)
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x64,%edx
mov    $0x12c,%ecx
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x64,%esi
mov    $0xc8,%edx
mov    $0x12c,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
mov    $0x12d,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.data = [2 x i32] [i32 100, i32 200]
@__const.main.data2 = [2 x i32] [i32 300, i32 300]
@.str = [30 x i8] c"*p1 = %d, *p2 = %d, *p3 = %d\0A\00"
@.str.1 = [38 x i8] c"*p1++ = %d, *++p2 = %d, (*p3)++ = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32 0, i32* %1
%7 = bitcast [2 x i32]* %2 to i8*
%8 = bitcast [2 x i32]* %3 to i8*
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32* %9, i32** %5
store i32* %9, i32** %4
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %10, i32** %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %14, i32 %16)
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i32 1
store i32* %19, i32** %4
%20 = load i32, i32* %18
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %5
%23 = load i32, i32* %22
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 1
store i32 %26, i32* %24
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %23, i32 %25)
%28 = load i32*, i32** %4
%29 = load i32, i32* %28
%30 = load i32*, i32** %5
%31 = load i32, i32* %30
%32 = load i32*, i32** %6
%33 = load i32, i32* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %29, i32 %31, i32 %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"*p1 = %d, *p2 = %d, *p3 = %d\0A\00"
@.str.1 = [38 x i8] c"*p1++ = %d, *++p2 = %d, (*p3)++ = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 100, i32 100, i32 300)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 100, i32 200, i32 300)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 200, i32 200, i32 301)
ret i32 0
}