#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 *, ...);
void print_component_details(int index, int size, int offset, int is_supervisor,
                             int byte64_aligned) {
  printf("Component index: %d\n", index);
  printf("Size (bytes): %d\n", size);
  if (is_supervisor) {
    printf("State component type: Supervisor\n");
  } else {
    printf("State component type: User\n");
    printf("Offset (bytes) from standard XSAVE area's base: %d\n", offset);
  }
  char *alignment;
  if (byte64_aligned) {
    alignment = "Next 64-byte boundary after previous component.";
  } else {
    alignment = "Immediately after previous component.";
  }
  printf("Compacted format alignment of component: %s\n", alignment);
}


x86 assembly (clang, -O0):
<print_component_details>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%esi
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x10(%rbp)
je     1167 <print_component_details+0x57>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1186 <print_component_details+0x76>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     11a0 <print_component_details+0x90>
lea    0xf02(%rip),%rax
mov    %rax,-0x20(%rbp)
jmp    11ab <print_component_details+0x9b>
lea    0xf22(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xf39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_component_details>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %ecx,%ebp
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%esi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
je     1163 <print_component_details+0x43>
lea    0xf9d(%rip),%rdi
call   1030 <puts@plt>
jmp    1180 <print_component_details+0x60>
lea    0xf74(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r15d,%r15d
lea    0xf01(%rip),%rax
lea    0xeca(%rip),%rsi
cmove  %rax,%rsi
lea    0xf15(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Component index: %d\0A\00"
@.str.1 = [18 x i8] c"Size (bytes): %d\0A\00"
@.str.2 = [34 x i8] c"State component type: Supervisor\0A\00"
@.str.3 = [28 x i8] c"State component type: User\0A\00"
@.str.4 = [52 x i8] c"Offset (bytes) from standard XSAVE area's base: %d\0A\00"
@.str.5 = [48 x i8] c"Next 64-byte boundary after previous component.\00"
@.str.6 = [38 x i8] c"Immediately after previous component.\00"
@.str.7 = [45 x i8] c"Compacted format alignment of component: %s\0A\00"
define void @print_component_details(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %9
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %5
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
br label %24
20: ; preds = %5
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%22 = load i32, i32* %8
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20, %18
%25 = load i32, i32* %10
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %24
store i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0), i8** %11
br label %29
28: ; preds = %24
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8** %11
br label %29
29: ; preds = %28, %27
%30 = load i8*, i8** %11
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i8* %30)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Component index: %d\0A\00"
@.str.1 = [18 x i8] c"Size (bytes): %d\0A\00"
@.str.4 = [52 x i8] c"Offset (bytes) from standard XSAVE area's base: %d\0A\00"
@.str.5 = [48 x i8] c"Next 64-byte boundary after previous component.\00"
@.str.6 = [38 x i8] c"Immediately after previous component.\00"
@.str.7 = [45 x i8] c"Compacted format alignment of component: %s\0A\00"
@str = [27 x i8] c"State component type: User\00"
@str.8 = [33 x i8] c"State component type: Supervisor\00"
define void @print_component_details(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%8 = icmp eq i32 %3, 0
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.8, i64 0, i64 0))
br label %14
11: ; preds = %5
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %14
14: ; preds = %11, %9
%15 = icmp eq i32 %4, 0
%16 = select i1 %15, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.5, i64 0, i64 0)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0), i8* %16)
ret void
}