#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, char *, char, double);
int /*<<< orphan*/ strcpy(char *, char *);
void main() {
  struct student {
    long num;
    char name[20];
    char sex;
    float score;
  };
  struct student stu_1;
  struct student *p;
  p = &stu_1;
  stu_1.num = 89101;
  strcpy(stu_1.name, "Li Min");
  stu_1.sex = 'M';
  stu_1.score = 89.5;
  printf("No.:%ld\nname:%s\nsex:%c\nscore:%f\n\n", stu_1.num, stu_1.name,
         stu_1.sex, stu_1.score);
  printf("No.:%ld\nname:%s\nsex:%c\nscore:%f\n\n", (*p).num, (*p).name,
         (*p).sex, (*p).score);
  printf("No.:%ld\nname:%s\nsex:%c\nscore:%f\n", p->num, p->name, p->sex,
         p->score);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x15c0d,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
add    $0x8,%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
movb   $0x4d,-0xc(%rbp)
movss  0xea8(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,%esi
lea    -0x28(%rbp),%rdx
add    $0x8,%rdx
mov    -0xc(%rbp),%al
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe8d(%rip),%rdi
movsbl %al,%ecx
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%esi
mov    -0x30(%rbp),%rdx
add    $0x8,%rdx
mov    -0x30(%rbp),%rax
mov    0x1c(%rax),%al
mov    -0x30(%rbp),%rcx
movss  0x20(%rcx),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe59(%rip),%rdi
movsbl %al,%ecx
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%esi
mov    -0x30(%rbp),%rdx
add    $0x8,%rdx
mov    -0x30(%rbp),%rax
mov    0x1c(%rax),%al
mov    -0x30(%rbp),%rcx
movss  0x20(%rcx),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe47(%rip),%rdi
movsbl %al,%ecx
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movq   $0x15c0d,(%rsp)
lea    0x8(%rsp),%rbx
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
movb   $0x4d,0x1c(%rsp)
movl   $0x42b30000,0x20(%rsp)
42
mov    (%rsp),%esi
lea    0xeb5(%rip),%r14
movsd  0xe9e(%rip),%xmm0
mov    %r14,%rdi
mov    %rbx,%rdx
mov    $0x4d,%ecx
call   1040 <printf@plt>
mov    (%rsp),%esi
movsbl 0x1c(%rsp),%ecx
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    (%rsp),%esi
movsbl 0x1c(%rsp),%ecx
movss  0x20(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe89(%rip),%rdi
mov    %rbx,%rdx
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.student = type { i64, [20 x i8], i8, float }
@.str = [7 x i8] c"Li Min\00"
@.str.1 = [34 x i8] c"No.:%ld\0Aname:%s\0Asex:%c\0Ascore:%f\0A\0A\00"
@.str.2 = [33 x i8] c"No.:%ld\0Aname:%s\0Asex:%c\0Ascore:%f\0A\00"
define void @main() {
%1 = alloca %struct.student
%2 = alloca %struct.student*
store %struct.student* %1, %struct.student** %2
%3 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 0
store i64 89101, i64* %3
%4 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 1
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 2
store i8 77, i8* %7
%8 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 3
store float 8.950000e+01, float* %8
%9 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 1
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%14 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 2
%15 = load i8, i8* %14
%16 = getelementptr inbounds %struct.student, %struct.student* %1, i32 0, i32 3
%17 = load float, float* %16
%18 = fpext float %17 to double
%19 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8* %13, i8 signext %15, double %18)
%20 = load %struct.student*, %struct.student** %2
%21 = getelementptr inbounds %struct.student, %struct.student* %20, i32 0, i32 0
%22 = load i64, i64* %21
%23 = trunc i64 %22 to i32
%24 = load %struct.student*, %struct.student** %2
%25 = getelementptr inbounds %struct.student, %struct.student* %24, i32 0, i32 1
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%27 = load %struct.student*, %struct.student** %2
%28 = getelementptr inbounds %struct.student, %struct.student* %27, i32 0, i32 2
%29 = load i8, i8* %28
%30 = load %struct.student*, %struct.student** %2
%31 = getelementptr inbounds %struct.student, %struct.student* %30, i32 0, i32 3
%32 = load float, float* %31
%33 = fpext float %32 to double
%34 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %23, i8* %26, i8 signext %29, double %33)
%35 = load %struct.student*, %struct.student** %2
%36 = getelementptr inbounds %struct.student, %struct.student* %35, i32 0, i32 0
%37 = load i64, i64* %36
%38 = trunc i64 %37 to i32
%39 = load %struct.student*, %struct.student** %2
%40 = getelementptr inbounds %struct.student, %struct.student* %39, i32 0, i32 1
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %40, i64 0, i64 0
%42 = load %struct.student*, %struct.student** %2
%43 = getelementptr inbounds %struct.student, %struct.student* %42, i32 0, i32 2
%44 = load i8, i8* %43
%45 = load %struct.student*, %struct.student** %2
%46 = getelementptr inbounds %struct.student, %struct.student* %45, i32 0, i32 3
%47 = load float, float* %46
%48 = fpext float %47 to double
%49 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %38, i8* %41, i8 signext %44, double %48)
ret void
}

LLVM IR (-O2):
%struct.student = type { i64, [20 x i8], i8, float }
@.str = [7 x i8] c"Li Min\00"
@.str.1 = [34 x i8] c"No.:%ld\0Aname:%s\0Asex:%c\0Ascore:%f\0A\0A\00"
@.str.2 = [33 x i8] c"No.:%ld\0Aname:%s\0Asex:%c\0Ascore:%f\0A\00"
define void @main() {
%1 = alloca %struct.student
%2 = bitcast %struct.student* %1 to i8*
%3 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 0
store i64 89101, i64* %3
%4 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 1, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 2
store i8 77, i8* %6
%7 = getelementptr inbounds %struct.student, %struct.student* %1, i64 0, i32 3
store float 8.950000e+01, float* %7
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %9, i8* %4, i8 signext 77, double 8.950000e+01)
%11 = load i64, i64* %3
%12 = trunc i64 %11 to i32
%13 = load i8, i8* %6
%14 = load float, float* %7
%15 = fpext float %14 to double
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %4, i8 signext %13, double %15)
%17 = load i64, i64* %3
%18 = trunc i64 %17 to i32
%19 = load i8, i8* %6
%20 = load float, float* %7
%21 = fpext float %20 to double
%22 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %18, i8* %4, i8 signext %19, double %21)
ret void
}