#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*/ B;
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct {
    int a;
    char b;
    double c;
    short d;
    float e;
    int f;
    char g;
  } A;
  struct {
    char a;
    short b;
    char c;
  } B;
  char array[] = {1, 2, 3, 4, 5};
  char *p = array;
  printf("sizeof(A.a) = %d\n", sizeof(A.a));
  printf("sizeof(A.b) = %d\n", sizeof(A.b));
  printf("sizeof(A.c) = %d\n", sizeof(A.c));
  printf("sizeof(A.d) = %d\n", sizeof(A.d));
  printf("sizeof(A.e) = %d\n", sizeof(A.e));
  printf("sizeof(A.f) = %d\n", sizeof(A.f));
  printf("sizeof(A) = %d\n", sizeof(A));
  printf("sizeof(B) = %d\n", sizeof(B));
  printf("*p++ = %d\n", *p++);
  printf("*++p = %d\n", *++p);
  printf("*(p++) = %d\n", *(p++));
  printf("(*p)++ = %d\n", (*p)++);
  printf("*p = %d\n", *p);
  int range = atoi("123");
  printf("range = %d\n", range);
  range = atoi(NULL);
  printf("range = %d\n", range);
  printf("range = %d\n", range);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x2d(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x29(%rbp)
lea    -0x2d(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    0xebc(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl (%rax),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl 0x1(%rax),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x38(%rbp)
movsbl (%rax),%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rcx
mov    (%rcx),%al
mov    %al,%dl
add    $0x1,%dl
mov    %dl,(%rcx)
movsbl %al,%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rax
movsbl (%rax),%esi
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
lea    0xe6f(%rip),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%esi
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x20,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xebe(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7b,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.anon = type { i32, i8, double, i16, float, i32, i8 }
%struct.anon.0 = type { i8, i16, i8 }
@__const.main.array = [5 x i8] c"\01\02\03\04\05"
@.str = [18 x i8] c"sizeof(A.a) = %d\0A\00"
@.str.1 = [18 x i8] c"sizeof(A.b) = %d\0A\00"
@.str.2 = [18 x i8] c"sizeof(A.c) = %d\0A\00"
@.str.3 = [18 x i8] c"sizeof(A.d) = %d\0A\00"
@.str.4 = [18 x i8] c"sizeof(A.e) = %d\0A\00"
@.str.5 = [18 x i8] c"sizeof(A.f) = %d\0A\00"
@.str.6 = [16 x i8] c"sizeof(A) = %d\0A\00"
@.str.7 = [16 x i8] c"sizeof(B) = %d\0A\00"
@.str.8 = [11 x i8] c"*p++ = %d\0A\00"
@.str.9 = [11 x i8] c"*++p = %d\0A\00"
@.str.10 = [13 x i8] c"*(p++) = %d\0A\00"
@.str.11 = [13 x i8] c"(*p)++ = %d\0A\00"
@.str.12 = [9 x i8] c"*p = %d\0A\00"
@.str.13 = [4 x i8] c"123\00"
@.str.14 = [12 x i8] c"range = %d\0A\00"
define i32 @main() {
%1 = alloca %struct.anon
%2 = alloca %struct.anon.0
%3 = alloca [5 x i8]
%4 = alloca i8*
%5 = alloca i32
%6 = bitcast [5 x i8]* %3 to i8*
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
store i8* %7, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 8)
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 2)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 4)
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 4)
%14 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 32)
%15 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 6)
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %19)
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %24)
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
%28 = load i8, i8* %26
%29 = sext i8 %28 to i32
%30 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %29)
%31 = load i8*, i8** %4
%32 = load i8, i8* %31
%33 = add i8 %32, 1
store i8 %33, i8* %31
%34 = sext i8 %32 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %34)
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %38)
%40 = call i32 @atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
store i32 %40, i32* %5
%41 = load i32, i32* %5
%42 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 %41)
%43 = call i32 @atoi(i8* null)
store i32 %43, i32* %5
%44 = load i32, i32* %5
%45 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %5
%47 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 %46)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i32, i8, double, i16, float, i32, i8 }
%struct.anon.0 = type { i8, i16, i8 }
@.str = [18 x i8] c"sizeof(A.a) = %d\0A\00"
@.str.1 = [18 x i8] c"sizeof(A.b) = %d\0A\00"
@.str.2 = [18 x i8] c"sizeof(A.c) = %d\0A\00"
@.str.3 = [18 x i8] c"sizeof(A.d) = %d\0A\00"
@.str.4 = [18 x i8] c"sizeof(A.e) = %d\0A\00"
@.str.5 = [18 x i8] c"sizeof(A.f) = %d\0A\00"
@.str.6 = [16 x i8] c"sizeof(A) = %d\0A\00"
@.str.7 = [16 x i8] c"sizeof(B) = %d\0A\00"
@.str.8 = [11 x i8] c"*p++ = %d\0A\00"
@.str.9 = [11 x i8] c"*++p = %d\0A\00"
@.str.10 = [13 x i8] c"*(p++) = %d\0A\00"
@.str.11 = [13 x i8] c"(*p)++ = %d\0A\00"
@.str.12 = [9 x i8] c"*p = %d\0A\00"
@.str.14 = [12 x i8] c"range = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 2)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i32 32)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0), i32 6)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 1)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 3)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 3)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 4)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 5)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 123)
%15 = tail call i32 @atoi(i8* null)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 %15)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 %15)
ret i32 0
}