#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, double, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  struct {
    int id;
    float height;
    char color[255];
    char material[255];
  } chair;
  chair.id = 42;
  chair.height = 2.54;
  strcpy(chair.color, "green");
  strcpy(chair.material, "wood");
  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    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x210(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x20c(%rbp)
ff
lea    -0x210(%rbp),%rdi
add    $0x8,%rdi
lea    0xea6(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
add    $0x107,%rdi
lea    0xe92(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x210(%rbp),%esi
movss  -0x20c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    -0x210(%rbp),%rdx
add    $0x8,%rdx
lea    -0x210(%rbp),%rcx
add    $0x107,%rcx
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
movabs $0x40228f5c0000002a,%rax
8f 22 40
mov    %rax,(%rsp)
lea    0x8(%rsp),%r14
lea    0xebc(%rip),%rsi
mov    %r14,%rdi
call   1030 <strcpy@plt>
lea    0x107(%rsp),%rbx
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    (%rsp),%esi
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.anon = type { i32, float, [255 x i8], [255 x i8] }
@.str = [6 x i8] c"green\00"
@.str.1 = [5 x i8] c"wood\00"
@.str.2 = [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
store i32 42, i32* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
store float 0x400451EB80000000, float* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 3
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %8, i64 0, i64 0
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%12 = load i32, i32* %11
%13 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%14 = load float, float* %13
%15 = fpext float %14 to double
%16 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 2
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %16, i64 0, i64 0
%18 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 3
%19 = getelementptr inbounds [255 x i8], [255 x i8]* %18, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 %12, double %15, i8* %17, i8* %19)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i32, float, [255 x i8], [255 x i8] }
@.str = [6 x i8] c"green\00"
@.str.1 = [5 x i8] c"wood\00"
@.str.2 = [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
store i32 42, i32* %3
%4 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 1
store float 0x400451EB80000000, float* %4
%5 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 2, i64 0
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds %struct.anon, %struct.anon* %1, i64 0, i32 3, i64 0
%8 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0), i32 %9, double %11, i8* %5, i8* %7)
ret i32 0
}