#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 point pt;
  struct point maxpt = {320, 200};
  pt.x = 10;
  pt.y = 20;
  printf("pt: %d, %d\n", pt.x, pt.y);
  printf("maxpt: %d, %d\n", maxpt.x, maxpt.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)
mov    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%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    0xedb(%rip),%rdi
mov    $0xa,%esi
mov    $0x14,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x140,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%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.point = type { i32, i32 }
@__const.main.maxpt = %struct.point { i32 320, i32 200 }
@.str = [12 x i8] c"pt: %d, %d\0A\00"
@.str.1 = [15 x i8] c"maxpt: %d, %d\0A\00"
@.str.2 = [25 x i8] c"\0APress any key to end...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.point
%3 = alloca %struct.point
store i32 0, i32* %1
%4 = bitcast %struct.point* %3 to i8*
%5 = getelementptr inbounds %struct.point, %struct.point* %2, i32 0, i32 0
store i32 10, i32* %5
%6 = getelementptr inbounds %struct.point, %struct.point* %2, i32 0, i32 1
store i32 20, i32* %6
%7 = getelementptr inbounds %struct.point, %struct.point* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.point, %struct.point* %2, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10)
%12 = getelementptr inbounds %struct.point, %struct.point* %3, i32 0, i32 0
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.point, %struct.point* %3, i32 0, i32 1
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 (...) @getchar()
ret i32 0
}

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