#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 *);
int 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 Lin");
  stu_1.sex = 'M';
  stu_1.score = 89.5;
  printf("No.:%ld\tname:%s\tsex:%c\tscore:%f\n", stu_1.num, stu_1.name,
         stu_1.sex, stu_1.score);
  printf("No.:%ld\tname:%s\tsex:%c\tscore:%f\n", (*p).num, (*p).name, p->sex,
         (*p).score);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
movq   $0x15c0d,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x8,%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcpy@plt>
movb   $0x4d,-0x14(%rbp)
movss  0xea1(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x30(%rbp),%rax
mov    %eax,%esi
lea    -0x30(%rbp),%rdx
add    $0x8,%rdx
mov    -0x14(%rbp),%al
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe86(%rip),%rdi
movsbl %al,%ecx
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%esi
mov    -0x38(%rbp),%rdx
add    $0x8,%rdx
mov    -0x38(%rbp),%rax
mov    0x1c(%rax),%al
mov    -0x38(%rbp),%rcx
movss  0x20(%rcx),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe52(%rip),%rdi
movsbl %al,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%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>
xor    %eax,%eax
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 Lin\00"
@.str.1 = [33 x i8] c"No.:%ld\09name:%s\09sex:%c\09score:%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.student
%3 = alloca %struct.student*
store i32 0, i32* %1
store %struct.student* %2, %struct.student** %3
%4 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 0
store i64 89101, i64* %4
%5 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 1
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 2
store i8 77, i8* %8
%9 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 3
store float 8.950000e+01, float* %9
%10 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 0
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 1
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %13, i64 0, i64 0
%15 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 2
%16 = load i8, i8* %15
%17 = getelementptr inbounds %struct.student, %struct.student* %2, i32 0, i32 3
%18 = load float, float* %17
%19 = fpext float %18 to double
%20 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %14, i8 signext %16, double %19)
%21 = load %struct.student*, %struct.student** %3
%22 = getelementptr inbounds %struct.student, %struct.student* %21, i32 0, i32 0
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = load %struct.student*, %struct.student** %3
%26 = getelementptr inbounds %struct.student, %struct.student* %25, i32 0, i32 1
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %26, i64 0, i64 0
%28 = load %struct.student*, %struct.student** %3
%29 = getelementptr inbounds %struct.student, %struct.student* %28, i32 0, i32 2
%30 = load i8, i8* %29
%31 = load %struct.student*, %struct.student** %3
%32 = getelementptr inbounds %struct.student, %struct.student* %31, i32 0, i32 3
%33 = load float, float* %32
%34 = fpext float %33 to double
%35 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %24, i8* %27, i8 signext %30, double %34)
ret i32 0
}

LLVM IR (-O2):
%struct.student = type { i64, [20 x i8], i8, float }
@.str = [7 x i8] c"Li Lin\00"
@.str.1 = [33 x i8] c"No.:%ld\09name:%s\09sex:%c\09score:%f\0A\00"
define i32 @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 ([33 x i8], [33 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 ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %4, i8 signext %13, double %15)
ret i32 0
}