#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 *, char, char, char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  struct {
    int id;
    float height;
    char color[255];
    char material[255];
  } chair;
  scanf("%d", &chair.id);
  scanf("%f", &chair.height);
  scanf("%s", chair.color);
  scanf("%s", chair.material);
  printf("The chair have: id=%d, height=%2.5f, color=%s, material=%s\n",
         chair.id, chair.height, chair.color, chair.material);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x210(%rbp),%rsi
call   1040 <scanf@plt>
lea    -0x20c(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x208(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    %rdi,-0x218(%rbp)
call   1040 <scanf@plt>
mov    -0x218(%rbp),%rdi
lea    -0x109(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x210(%rbp),%dl
movss  -0x20c(%rbp),%xmm0
ff
cvttss2si %xmm0,%eax
lea    -0x210(%rbp),%rcx
add    $0x8,%rcx
lea    -0x210(%rbp),%r8
add    $0x107,%r8
lea    0xe52(%rip),%rdi
movsbl %dl,%esi
movsbl %al,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x210,%rsp
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
lea    0xeba(%rip),%rdi
call   1040 <scanf@plt>
lea    0x10(%rsp),%r14
lea    0xeac(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
lea    0x10f(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
movsbl 0x8(%rsp),%esi
cvttss2si 0xc(%rsp),%eax
movsbl %al,%edx
lea    0xe7c(%rip),%rdi
mov    %r14,%rcx
mov    %r15,%r8
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.anon = type { i32, float, [255 x i8], [255 x i8] }
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [60 x i8] c"The chair have: id=%d, height=%2.5f, color=%s, material=%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%7 = bitcast float* %6 to i8*
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 3
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%16 = load i32, i32* %15
%17 = trunc i32 %16 to i8
%18 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%19 = load float, float* %18
%20 = fptosi float %19 to i8
%21 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
%22 = getelementptr inbounds [255 x i8], [255 x i8]* %21, i64 0, i64 0
%23 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 3
%24 = getelementptr inbounds [255 x i8], [255 x i8]* %23, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8 signext %17, i8 signext %20, i8* %22, i8* %24)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i32, float, [255 x i8], [255 x i8] }
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [60 x i8] c"The chair have: id=%d, height=%2.5f, color=%s, material=%s\0A\00"
define i32 @main() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 1
%6 = bitcast float* %5 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 2, i64 0
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 3, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = load i32, i32* %3
%13 = trunc i32 %12 to i8
%14 = load float, float* %5
%15 = fptosi float %14 to i8
%16 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8 signext %13, i8 signext %15, i8* %8, i8* %10)
ret i32 0
}