#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*/ doSomethingWithACharPointer(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int aNumber = 3;
  int *aPointer = &aNumber;
  printf("aPointer: %p\n", aPointer);
  printf("*aPointer: %d\n", *aPointer);
  char aChar = 'n';
  char *aCharPointer = &aChar;
  printf("aChar: %c\n", aChar);
  doSomethingWithACharPointer(aCharPointer);
  printf("aChar: %c\n", aChar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x6e,-0x11(%rbp)
lea    -0x11(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsbl -0x11(%rbp),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <doSomethingWithACharPointer@plt>
movsbl -0x11(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x3,0xc(%rsp)
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x6e,0xb(%rsp)
lea    0xebf(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6e,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xb(%rsp),%rdi
call   1040 <doSomethingWithACharPointer@plt>
movsbl 0xb(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"aPointer: %p\0A\00"
@.str.1 = [15 x i8] c"*aPointer: %d\0A\00"
@.str.2 = [11 x i8] c"aChar: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i8*
store i32 0, i32* %1
store i32 3, i32* %2
store i32* %2, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %9)
store i8 110, i8* %4
store i8* %4, i8** %5
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = load i8*, i8** %5
%15 = call i32 @doSomethingWithACharPointer(i8* %14)
%16 = load i8, i8* %4
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"aPointer: %p\0A\00"
@.str.1 = [15 x i8] c"*aPointer: %d\0A\00"
@.str.2 = [11 x i8] c"aChar: %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
store i8 110, i8* %2
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 110)
%8 = call i32 @doSomethingWithACharPointer(i8* %2)
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret i32 0
}