#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*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char **argv) {
  struct people {
    unsigned int id;
    char *name;
    char sex;
    unsigned short age;
  };
  struct people xiaomin = {1, "小明", 'M', 9};
  struct people mary;
  mary.id = 2;
  mary.name = "玛丽";
  mary.sex = 'F';
  mary.age = 10;
  printf("编号：%d，姓名：%s，性别：%c，年龄：%d\n", xiaomin.id, xiaomin.name,
         xiaomin.sex, xiaomin.age);
  printf("编号：%d，姓名：%s，性别：%c，年龄：%d\n", mary.id, mary.name,
         mary.sex, mary.age);
  union ticket {
    char src_str[11];
    struct {
      char sys_flag;
      char cluster_name[2];
      char cluster_num;
      char other[6];
    } part;
  };
  union ticket t1;
  strcpy(t1.src_str, "csh1abcde9");
  printf("src_str:%s, sys_flag:%c, cluster_name:%s, cluster_num:%c, other:%s\n",
         t1.src_str, t1.part.sys_flag, t1.part.cluster_name,
         t1.part.cluster_num, t1.part.other);
  t1.part.cluster_num = '8';
  printf("src_str:%s, sys_flag:%c, cluster_name:%s, cluster_num:%c, other:%s\n",
         t1.src_str, t1.part.sys_flag, t1.part.cluster_name,
         t1.part.cluster_num, t1.part.other);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ccf(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ccc(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x40(%rbp)
lea    0xea9(%rip),%rax
mov    %rax,-0x38(%rbp)
movb   $0x46,-0x30(%rbp)
movw   $0xa,-0x2e(%rbp)
mov    -0x28(%rbp),%esi
mov    -0x20(%rbp),%rdx
movsbl -0x18(%rbp),%ecx
movzwl -0x16(%rbp),%r8d
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%esi
mov    -0x38(%rbp),%rdx
movsbl -0x30(%rbp),%ecx
movzwl -0x2e(%rbp),%r8d
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rsi
movsbl -0x50(%rbp),%edx
lea    -0x50(%rbp),%rcx
add    $0x1,%rcx
movsbl -0x4d(%rbp),%r8d
lea    -0x50(%rbp),%r9
add    $0x4,%r9
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x38,-0x4d(%rbp)
lea    -0x50(%rbp),%rsi
movsbl -0x50(%rbp),%edx
lea    -0x50(%rbp),%rcx
add    $0x1,%rcx
movsbl -0x4d(%rbp),%r8d
lea    -0x50(%rbp),%r9
add    $0x4,%r9
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xedc(%rip),%rbx
lea    0xec7(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x4d,%ecx
mov    $0x9,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xead(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x46,%ecx
mov    $0xa,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
movsbl 0x8(%rsp),%edx
lea    0x9(%rsp),%r14
movsbl 0xb(%rsp),%r8d
lea    0xc(%rsp),%r15
lea    0xeac(%rip),%r12
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
mov    %r15,%r9
xor    %eax,%eax
call   1040 <printf@plt>
movb   $0x38,0xb(%rsp)
movsbl 0x8(%rsp),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
mov    $0x38,%r8d
mov    %r15,%r9
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.people = type { i32, i8*, i8, i16 }
%union.ticket = type { [11 x i8] }
%struct.anon = type { i8, [2 x i8], i8, [6 x i8] }
@.str = [7 x i8] c"\E5\B0\8F\E6\98\8E\00"
@__const.main.xiaomin = %struct.people { i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8 77, i16 9 }
@.str.1 = [7 x i8] c"\E7\8E\9B\E4\B8\BD\00"
@.str.2 = [55 x i8] c"\E7\BC\96\E5\8F\B7\EF\BC\9A%d\EF\BC\8C\E5\A7\93\E5\90\8D\EF\BC\9A%s\EF\BC\8C\E6\80\A7\E5\88\AB\EF\BC\9A%c\EF\BC\8C\E5\B9\B4\E9\BE\84\EF\BC\9A%d\0A\00"
@.str.3 = [11 x i8] c"csh1abcde9\00"
@.str.4 = [68 x i8] c"src_str:%s, sys_flag:%c, cluster_name:%s, cluster_num:%c, other:%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca %struct.people
%6 = alloca %struct.people
%7 = alloca %union.ticket
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = bitcast %struct.people* %5 to i8*
%9 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 0
store i32 2, i32* %9
%10 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 2
store i8 70, i8* %11
%12 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 3
store i16 10, i16* %12
%13 = getelementptr inbounds %struct.people, %struct.people* %5, i32 0, i32 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.people, %struct.people* %5, i32 0, i32 1
%16 = load i8*, i8** %15
%17 = getelementptr inbounds %struct.people, %struct.people* %5, i32 0, i32 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = getelementptr inbounds %struct.people, %struct.people* %5, i32 0, i32 3
%21 = load i16, i16* %20
%22 = zext i16 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 %14, i8* %16, i32 %19, i32 %22)
%24 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 1
%27 = load i8*, i8** %26
%28 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 2
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = getelementptr inbounds %struct.people, %struct.people* %6, i32 0, i32 3
%32 = load i16, i16* %31
%33 = zext i16 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 %25, i8* %27, i32 %30, i32 %33)
%35 = bitcast %union.ticket* %7 to [11 x i8]*
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %35, i64 0, i64 0
%37 = call i32 @strcpy(i8* %36, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%38 = bitcast %union.ticket* %7 to [11 x i8]*
%39 = getelementptr inbounds [11 x i8], [11 x i8]* %38, i64 0, i64 0
%40 = bitcast %union.ticket* %7 to %struct.anon*
%41 = getelementptr inbounds %struct.anon, %struct.anon* %40, i32 0, i32 0
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = bitcast %union.ticket* %7 to %struct.anon*
%45 = getelementptr inbounds %struct.anon, %struct.anon* %44, i32 0, i32 1
%46 = getelementptr inbounds [2 x i8], [2 x i8]* %45, i64 0, i64 0
%47 = bitcast %union.ticket* %7 to %struct.anon*
%48 = getelementptr inbounds %struct.anon, %struct.anon* %47, i32 0, i32 2
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = bitcast %union.ticket* %7 to %struct.anon*
%52 = getelementptr inbounds %struct.anon, %struct.anon* %51, i32 0, i32 3
%53 = getelementptr inbounds [6 x i8], [6 x i8]* %52, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0), i8* %39, i32 %43, i8* %46, i32 %50, i8* %53)
%55 = bitcast %union.ticket* %7 to %struct.anon*
%56 = getelementptr inbounds %struct.anon, %struct.anon* %55, i32 0, i32 2
store i8 56, i8* %56
%57 = bitcast %union.ticket* %7 to [11 x i8]*
%58 = getelementptr inbounds [11 x i8], [11 x i8]* %57, i64 0, i64 0
%59 = bitcast %union.ticket* %7 to %struct.anon*
%60 = getelementptr inbounds %struct.anon, %struct.anon* %59, i32 0, i32 0
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = bitcast %union.ticket* %7 to %struct.anon*
%64 = getelementptr inbounds %struct.anon, %struct.anon* %63, i32 0, i32 1
%65 = getelementptr inbounds [2 x i8], [2 x i8]* %64, i64 0, i64 0
%66 = bitcast %union.ticket* %7 to %struct.anon*
%67 = getelementptr inbounds %struct.anon, %struct.anon* %66, i32 0, i32 2
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = bitcast %union.ticket* %7 to %struct.anon*
%71 = getelementptr inbounds %struct.anon, %struct.anon* %70, i32 0, i32 3
%72 = getelementptr inbounds [6 x i8], [6 x i8]* %71, i64 0, i64 0
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0), i8* %58, i32 %62, i8* %65, i32 %69, i8* %72)
ret i32 0
}

LLVM IR (-O2):
%union.ticket = type { [11 x i8] }
@.str = [7 x i8] c"\E5\B0\8F\E6\98\8E\00"
@.str.1 = [7 x i8] c"\E7\8E\9B\E4\B8\BD\00"
@.str.2 = [55 x i8] c"\E7\BC\96\E5\8F\B7\EF\BC\9A%d\EF\BC\8C\E5\A7\93\E5\90\8D\EF\BC\9A%s\EF\BC\8C\E6\80\A7\E5\88\AB\EF\BC\9A%c\EF\BC\8C\E5\B9\B4\E9\BE\84\EF\BC\9A%d\0A\00"
@.str.3 = [11 x i8] c"csh1abcde9\00"
@.str.4 = [68 x i8] c"src_str:%s, sys_flag:%c, cluster_name:%s, cluster_num:%c, other:%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %union.ticket
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 77, i32 9)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 70, i32 10)
%6 = getelementptr inbounds %union.ticket, %union.ticket* %3, i64 0, i32 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = getelementptr inbounds %union.ticket, %union.ticket* %3, i64 0, i32 0, i64 1
%11 = getelementptr inbounds %union.ticket, %union.ticket* %3, i64 0, i32 0, i64 3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = getelementptr inbounds %union.ticket, %union.ticket* %3, i64 0, i32 0, i64 4
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0), i8* %6, i32 %9, i8* %10, i32 %13, i8* %14)
store i8 56, i8* %11
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.4, i64 0, i64 0), i8* %6, i32 %17, i8* %10, i32 56, i8* %14)
ret i32 0
}