#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 */
scalar_t__ asprintf(char **, char *, char *, char *, char *, char *, char *,
                    char *, char *, char *);
int display_column_name(char *);
int /*<<< orphan*/ free(char *);
int regulator_print_header(void) {
  char *buf;
  int ret;
  if (asprintf(&buf, "%-11s %-11s %-11s %-11s %-11s %-11s %-11s %-12s", "Name",
               "Status", "State", "Type", "Users", "Microvolts", "Min u-volts",
               "Max u-volts") < 0)
    return -1;
  ret = display_column_name(buf);
  free(buf);
  return ret;
}


x86 assembly (clang, -O0):
<regulator_print_header>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
lea    -0x18(%rbp),%rdi
lea    0xebc(%rip),%rsi
lea    0xee5(%rip),%rdx
lea    0xee3(%rip),%rcx
lea    0xee3(%rip),%r8
lea    0xee2(%rip),%r9
lea    0xee0(%rip),%rbx
lea    0xedf(%rip),%r11
lea    0xee3(%rip),%r10
lea    0xee8(%rip),%rax
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <asprintf@plt>
cmp    $0x0,%rax
jge    11aa <regulator_print_header+0x7a>
movl   $0xffffffff,-0xc(%rbp)
jmp    11c5 <regulator_print_header+0x95>
mov    -0x18(%rbp),%rdi
call   1040 <display_column_name@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<regulator_print_header>:
push   %rbx
sub    $0x10,%rsp
lea    0xf28(%rip),%rax
lea    0xf15(%rip),%rbx
lea    0xf03(%rip),%r10
lea    0xef6(%rip),%r11
lea    0xea8(%rip),%rsi
lea    0xed1(%rip),%rdx
lea    0xecf(%rip),%rcx
lea    0xecf(%rip),%r8
lea    0xece(%rip),%r9
lea    0x8(%rsp),%rdi
push   %rax
push   %rbx
push   %r10
push   %r11
call   1050 <asprintf@plt>
add    $0x20,%rsp
test   %rax,%rax
js     11a5 <regulator_print_header+0x75>
mov    0x8(%rsp),%rdi
call   1040 <display_column_name@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
jmp    11aa <regulator_print_header+0x7a>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"%-11s %-11s %-11s %-11s %-11s %-11s %-11s %-12s\00"
@.str.1 = [5 x i8] c"Name\00"
@.str.2 = [7 x i8] c"Status\00"
@.str.3 = [6 x i8] c"State\00"
@.str.4 = [5 x i8] c"Type\00"
@.str.5 = [6 x i8] c"Users\00"
@.str.6 = [11 x i8] c"Microvolts\00"
@.str.7 = [12 x i8] c"Min u-volts\00"
@.str.8 = [12 x i8] c"Max u-volts\00"
define i32 @regulator_print_header() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = call i64 @asprintf(i8** %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %13
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @display_column_name(i8* %8)
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
%12 = load i32, i32* %3
store i32 %12, i32* %1
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [48 x i8] c"%-11s %-11s %-11s %-11s %-11s %-11s %-11s %-12s\00"
@.str.1 = [5 x i8] c"Name\00"
@.str.2 = [7 x i8] c"Status\00"
@.str.3 = [6 x i8] c"State\00"
@.str.4 = [5 x i8] c"Type\00"
@.str.5 = [6 x i8] c"Users\00"
@.str.6 = [11 x i8] c"Microvolts\00"
@.str.7 = [12 x i8] c"Min u-volts\00"
@.str.8 = [12 x i8] c"Max u-volts\00"
define i32 @regulator_print_header() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i64 @asprintf(i8** %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%4 = icmp slt i64 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %0
%6 = load i8*, i8** %1
%7 = call i32 @display_column_name(i8* %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %0, %5
%11 = phi i32 [ %7, %5 ], [ -1, %0 ]
ret i32 %11
}