#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  struct point {
    int x;
    int y;
  };
  struct rect {
    struct point pt1;
    struct point pt2;
  };
  struct rect screen;
  screen.pt1.x = 10;
  screen.pt1.y = 20;
  screen.pt2.x = 300;
  screen.pt2.y = 180;
  printf("screen: %d, %d, %d, %d\n", screen.pt1.x, screen.pt1.y, screen.pt2.x,
         screen.pt2.y);
  printf("\nPress any key to end...");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x18(%rbp)
movl   $0x14,-0x14(%rbp)
movl   $0x12c,-0x10(%rbp)
movl   $0xb4,-0xc(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%r8d
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
mov    $0x12c,%ecx
mov    $0xb4,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rect = type { %struct.point, %struct.point }
%struct.point = type { i32, i32 }
@.str = [24 x i8] c"screen: %d, %d, %d, %d\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rect
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 0
%4 = getelementptr inbounds %struct.point, %struct.point* %3, i32 0, i32 0
store i32 10, i32* %4
%5 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 0
%6 = getelementptr inbounds %struct.point, %struct.point* %5, i32 0, i32 1
store i32 20, i32* %6
%7 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 1
%8 = getelementptr inbounds %struct.point, %struct.point* %7, i32 0, i32 0
store i32 300, i32* %8
%9 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 1
%10 = getelementptr inbounds %struct.point, %struct.point* %9, i32 0, i32 1
store i32 180, i32* %10
%11 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 0
%12 = getelementptr inbounds %struct.point, %struct.point* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 0
%15 = getelementptr inbounds %struct.point, %struct.point* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 1
%18 = getelementptr inbounds %struct.point, %struct.point* %17, i32 0, i32 0
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.rect, %struct.rect* %2, i32 0, i32 1
%21 = getelementptr inbounds %struct.point, %struct.point* %20, i32 0, i32 1
%22 = load i32, i32* %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %16, i32 %19, i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"screen: %d, %d, %d, %d\0A\00"
@.str.1 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 10, i32 20, i32 300, i32 180)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret i32 0
}