#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);
void pointerSample() {
  int yy = 10;
  int *a = &yy;
  int xx = yy;
  printf("valor yy: %d, valor pointer *a: %d\n", yy, *a);
  printf("valor xx: %d, valor pointer *a: %d\n\n", xx, *a);
  *a += 8;
  printf("valor yy: %d, valor pointer *a: %d\n", yy, *a);
  printf("valor xx: %d, valor pointer *a: %d\n\n", xx, *a);
}


x86 assembly (clang, -O0):
<pointerSample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x8,%ecx
mov    %ecx,(%rax)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointerSample>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    %r14,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
lea    0xef0(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x12,%esi
mov    $0x12,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x12,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"valor yy: %d, valor pointer *a: %d\0A\00"
@.str.1 = [37 x i8] c"valor xx: %d, valor pointer *a: %d\0A\0A\00"
define void @pointerSample() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 10, i32* %1
store i32* %1, i32** %2
%4 = load i32, i32* %1
store i32 %4, i32* %3
%5 = load i32, i32* %1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11)
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 8
store i32 %15, i32* %13
%16 = load i32, i32* %1
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %18)
%20 = load i32, i32* %3
%21 = load i32*, i32** %2
%22 = load i32, i32* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %20, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"valor yy: %d, valor pointer *a: %d\0A\00"
@.str.1 = [37 x i8] c"valor xx: %d, valor pointer *a: %d\0A\0A\00"
define void @pointerSample() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 10, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 10)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 18, i32 18)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 10, i32 18)
ret void
}