#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  const int list[] = {0xFFFE00FC, 1, 1, 1, 555};
  typedef struct {
    uint8_t first;
    uint8_t second;
    uint8_t third;
    uint8_t fourth;
  } byt_t;
  printf("basics: \n");
  byt_t oa = {1, 2};
  printf("deref struct: %d\n", oa.first);
  printf("same with arrow: %d\n", (&oa)->first);
  byt_t *ARR = ((byt_t *)&list);
  printf("first byte of first array element: %d\n", ARR->first);
  printf("second byte of first array element: %d\n", ARR->second);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xf3a(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xf37(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x40(%rbp),%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    (%rax),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0xfffe00fc,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.byt_t = type { i32, i32, i32, i32 }
@__const.main.list = [5 x i32] [i32 -130820, i32 1, i32 1, i32 1, i32 555]
@.str = [10 x i8] c"basics: \0A\00"
@__const.main.oa = %struct.byt_t { i32 1, i32 2, i32 0, i32 0 }
@.str.1 = [18 x i8] c"deref struct: %d\0A\00"
@.str.2 = [21 x i8] c"same with arrow: %d\0A\00"
@.str.3 = [39 x i8] c"first byte of first array element: %d\0A\00"
@.str.4 = [40 x i8] c"second byte of first array element: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i32]
%7 = alloca %struct.byt_t
%8 = alloca %struct.byt_t*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [5 x i32]* %6 to i8*
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = bitcast %struct.byt_t* %7 to i8*
%12 = getelementptr inbounds %struct.byt_t, %struct.byt_t* %7, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds %struct.byt_t, %struct.byt_t* %7, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = bitcast [5 x i32]* %6 to %struct.byt_t*
store %struct.byt_t* %18, %struct.byt_t** %8
%19 = load %struct.byt_t*, %struct.byt_t** %8
%20 = getelementptr inbounds %struct.byt_t, %struct.byt_t* %19, i32 0, i32 0
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 %21)
%23 = load %struct.byt_t*, %struct.byt_t** %8
%24 = getelementptr inbounds %struct.byt_t, %struct.byt_t* %23, i32 0, i32 1
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %25)
ret i32 0
}

LLVM IR (-O2):
%struct.byt_t = type { i32, i32, i32, i32 }
@.str.1 = [18 x i8] c"deref struct: %d\0A\00"
@.str.2 = [21 x i8] c"same with arrow: %d\0A\00"
@.str.3 = [39 x i8] c"first byte of first array element: %d\0A\00"
@.str.4 = [40 x i8] c"second byte of first array element: %d\0A\00"
@str = [9 x i8] c"basics: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 1)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), i32 -130820)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 1)
ret i32 0
}