#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*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ string2();
void func() {
  int x3[3];
  int *px;
  int *y3;
  x3[0] = 0;
  x3[1] = 1;
  x3[2] = 2;
  px = &(x3[0]);
  px = x3;
  px++;
  y3 = malloc(3 * sizeof(int));
  y3[0] = 0;
  y3[1] = 1;
  y3[2] = 2;
  printf("%d : %d : %d\n", y3[0], y3[1], y3[2]);
  string2();
  free(y3);
  y3 = NULL;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0x4(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x20(%rbp),%rax
movl   $0x2,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%ecx
lea    0xe3e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <string2@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x20(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    $0xc,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movabs $0x100000000,%rax
mov    %rax,(%rbx)
movl   $0x2,0x8(%rbx)
lea    0xe97(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <string2@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d : %d : %d\0A\00"
define void @func() {
%1 = alloca [3 x i32]
%2 = alloca i32*
%3 = alloca i32*
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32 0, i32* %4
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 1
store i32 1, i32* %5
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
store i32 2, i32* %6
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %7, i32** %2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %2
%11 = call i32* @malloc(i32 12)
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 0, i32* %13
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 1, i32* %15
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 2, i32* %17
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = load i32*, i32** %3
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 2
%26 = load i32, i32* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %20, i32 %23, i32 %26)
%28 = call i32 (...) @string2()
%29 = load i32*, i32** %3
%30 = call i32 @free(i32* %29)
store i32* null, i32** %3
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d : %d : %d\0A\00"
define void @func() {
%1 = tail call i32* @malloc(i32 12)
store i32 0, i32* %1
%2 = getelementptr inbounds i32, i32* %1, i64 1
store i32 1, i32* %2
%3 = getelementptr inbounds i32, i32* %1, i64 2
store i32 2, i32* %3
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 1, i32 2)
%5 = tail call i32 (...) @string2()
%6 = tail call i32 @free(i32* %1)
ret void
}