#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 /*<<< orphan*/ ball;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  struct measure {
    char category;
    int width;
    int height;
  };
  struct measure ball;
  ball.category = 'C';
  ball.width = 5;
  ball.height = 3;
  printf("address of ball = %p\n", (void *)(&ball));
  printf("address of ball.category = %p\n", (void *)(&ball.category));
  printf("address of ball.width = %p\n", (void *)(&ball.width));
  printf("address of ball.height = %p\n", (void *)(&ball.height));
  printf("sizeof(ball) = %lu\n", sizeof(ball));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x43,-0x20(%rbp)
movl   $0x5,-0x1c(%rbp)
movl   $0x3,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %eax,%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movb   $0x43,(%rsp)
lea    0x4(%rsp),%r14
movabs $0x300000005,%rax
mov    %rax,0x4(%rsp)
mov    %rsp,%rbx
lea    0x8(%rbx),%ebp
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0xc,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.measure = type { i8, i32, i32 }
@.str = [22 x i8] c"address of ball = %p\0A\00"
@.str.1 = [31 x i8] c"address of ball.category = %p\0A\00"
@.str.2 = [28 x i8] c"address of ball.width = %p\0A\00"
@.str.3 = [29 x i8] c"address of ball.height = %p\0A\00"
@.str.4 = [20 x i8] c"sizeof(ball) = %lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.measure
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds %struct.measure, %struct.measure* %6, i32 0, i32 0
store i8 67, i8* %7
%8 = getelementptr inbounds %struct.measure, %struct.measure* %6, i32 0, i32 1
store i32 5, i32* %8
%9 = getelementptr inbounds %struct.measure, %struct.measure* %6, i32 0, i32 2
store i32 3, i32* %9
%10 = bitcast %struct.measure* %6 to i8*
%11 = ptrtoint i8* %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds %struct.measure, %struct.measure* %6, i32 0, i32 0
%14 = ptrtoint i8* %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds %struct.measure, %struct.measure* %6, i32 0, i32 1
%17 = bitcast i32* %16 to i8*
%18 = ptrtoint i8* %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = getelementptr inbounds %struct.measure, %struct.measure* %6, i32 0, i32 2
%21 = bitcast i32* %20 to i8*
%22 = ptrtoint i8* %21 to i32
%23 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
%struct.measure = type { i8, i32, i32 }
@.str = [22 x i8] c"address of ball = %p\0A\00"
@.str.1 = [31 x i8] c"address of ball.category = %p\0A\00"
@.str.2 = [28 x i8] c"address of ball.width = %p\0A\00"
@.str.3 = [29 x i8] c"address of ball.height = %p\0A\00"
@.str.4 = [20 x i8] c"sizeof(ball) = %lu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.measure
%4 = getelementptr inbounds %struct.measure, %struct.measure* %3, i64 0, i32 0
store i8 67, i8* %4
%5 = getelementptr inbounds %struct.measure, %struct.measure* %3, i64 0, i32 1
store i32 5, i32* %5
%6 = getelementptr inbounds %struct.measure, %struct.measure* %3, i64 0, i32 2
store i32 3, i32* %6
%7 = ptrtoint %struct.measure* %3 to i64
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%11 = ptrtoint i32* %5 to i64
%12 = trunc i64 %11 to i32
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = ptrtoint i32* %6 to i64
%15 = trunc i64 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 12)
ret i32 0
}