#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 *, char);
int main(int argc, char *argv[]) {
  struct point {
    int x;
    int y;
  };
  struct point my_point = {3, 7};
  struct point *p = &my_point;
  printf("(*p).x is: %d\n", (*p).x);
  printf("p->x is: %d\n", p->x);
  char char_array[] = {'a', 'b', 'c'};
  char *np = char_array;
  printf("np[0] is: %c\n", np[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
lea    0xec9(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
lea    0xec3(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    0xecf(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xec7(%rip),%al
mov    %al,-0x21(%rbp)
lea    -0x23(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
lea    0xea1(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.point = type { i32, i32 }
@__const.main.my_point = %struct.point { i32 3, i32 7 }
@.str = [15 x i8] c"(*p).x is: %d\0A\00"
@.str.1 = [13 x i8] c"p->x is: %d\0A\00"
@__const.main.char_array = [3 x i8] c"abc"
@.str.2 = [14 x i8] c"np[0] is: %c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.point
%6 = alloca %struct.point*
%7 = alloca [3 x i8]
%8 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = bitcast %struct.point* %5 to i8*
store %struct.point* %5, %struct.point** %6
%10 = load %struct.point*, %struct.point** %6
%11 = getelementptr inbounds %struct.point, %struct.point* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = trunc i32 %12 to i8
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = load %struct.point*, %struct.point** %6
%16 = getelementptr inbounds %struct.point, %struct.point* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = trunc i32 %17 to i8
%19 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext %18)
%20 = bitcast [3 x i8]* %7 to i8*
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
store i8* %21, i8** %8
%22 = load i8*, i8** %8
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8 signext %24)
ret i32 0
}

LLVM IR (-O2):
%struct.point = type { i32, i32 }
@.str = [15 x i8] c"(*p).x is: %d\0A\00"
@.str.1 = [13 x i8] c"p->x is: %d\0A\00"
@.str.2 = [14 x i8] c"np[0] is: %c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8 signext 3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8 signext 97)
ret i32 0
}