#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 main(int argc, const char *argv[]) {
  int var = 20;
  int *ip;
  ip = &var;
  printf("pointer to var: %p\n", &var);
  printf("pointer ip: %p\n", ip);
  printf("value of pointer : %d\n\n", *ip);
  char str[] = "Hola #Ironhackers";
  printf("%s%c%c%c", str, str[16], str[16], str[16]);
  return 0;
}


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)
movl   $0x14,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    0xec4(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xedc(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xed9(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xed6(%rip),%ax
mov    %ax,-0x30(%rbp)
lea    -0x40(%rbp),%rsi
movsbl -0x30(%rbp),%edx
movsbl -0x30(%rbp),%ecx
movsbl -0x30(%rbp),%r8d
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movl   $0x14,0xc(%rsp)
lea    0xedc(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x73,0x20(%rsp)
lea    0xecc(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x73,%edx
mov    $0x73,%ecx
mov    $0x73,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"pointer to var: %p\0A\00"
@.str.1 = [16 x i8] c"pointer ip: %p\0A\00"
@.str.2 = [24 x i8] c"value of pointer : %d\0A\0A\00"
@__const.main.str = [18 x i8] c"Hola #Ironhackers\00"
@.str.3 = [9 x i8] c"%s%c%c%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca [18 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
store i32* %6, i32** %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %6)
%10 = load i32*, i32** %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = bitcast [18 x i8]* %8 to i8*
%16 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 0
%17 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 16
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = getelementptr inbounds [18 x i8], [18 x i8]* %8, i64 0, i64 16
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %16, i32 %19, i32 %22, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"pointer to var: %p\0A\00"
@.str.1 = [16 x i8] c"pointer ip: %p\0A\00"
@.str.2 = [24 x i8] c"value of pointer : %d\0A\0A\00"
@__const.main.str = [18 x i8] c"Hola #Ironhackers\00"
@.str.3 = [9 x i8] c"%s%c%c%c\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [18 x i8]
%5 = bitcast i32* %3 to i8*
store i32 20, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [18 x i8], [18 x i8]* %4, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32 115, i32 115, i32 115)
ret i32 0
}