#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 EXIT_SUCCESS;
int *add(int *, int);
int /*<<< orphan*/ multiply(int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  printf("================================\n");
  printf("POINTERS #2\n");
  printf("================================\n");
  int a = 10, b = 20, multiplier = 2, adder = 12;
  int *x = &(a), *y = &(b), *z = add(y, adder);
  multiply(x, multiplier);
  printf("Valor de 'a': %i\n", a);
  printf("Valor de 'b': %i\n", *z);
  return EXIT_SUCCESS;
}


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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xa,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0xc,-0x20(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%esi
call   1030 <add@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <multiply@plt>
mov    -0x14(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2dfc(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee4(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xec9(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
movl   $0xa,0x8(%rsp)
movl   $0x14,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0xc,%esi
call   1030 <add@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1040 <multiply@plt>
mov    0x8(%rsp),%esi
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rbx),%esi
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e1e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"================================\0A\00"
@.str.1 = [13 x i8] c"POINTERS\0A\00"
@.str.2 = [18 x i8] c"Valor de 'a': %i\0A\00"
@.str.3 = [18 x i8] c"Valor de 'b': %i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 10, i32* %6
store i32 20, i32* %7
store i32 2, i32* %8
store i32 12, i32* %9
store i32* %6, i32** %10
store i32* %7, i32** %11
%16 = load i32*, i32** %11
%17 = load i32, i32* %9
%18 = call i32* @add(i32* %16, i32 %17)
store i32* %18, i32** %12
%19 = load i32*, i32** %10
%20 = load i32, i32* %8
%21 = call i32 @multiply(i32* %19, i32 %20)
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32*, i32** %12
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i32, i32* @EXIT_SUCCESS
ret i32 %27
}

LLVM IR (-O2):
@.str.2 = [18 x i8] c"Valor de 'a': %i\0A\00"
@.str.3 = [18 x i8] c"Valor de 'b': %i\0A\00"
@EXIT_SUCCESS = global i32 0
@str.4 = [12 x i8] c"POINTERS\00"
@str.5 = [33 x i8] c"================================\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.5, i64 0, i64 0))
%8 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 20, i32* %4
%10 = call i32* @add(i32* %4, i32 12)
%11 = call i32 @multiply(i32* %3, i32 2)
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %10
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %14)
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}