#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 *);
int display_column_name(char *);
int /*<<< orphan*/ free(char *);
int gpio_print_header(void) {
  char *buf;
  int ret;
  if (asprintf(&buf, "%-20s %-10s %-10s %-10s %-10s", "Name", "Value",
               "Active_low", "Edge", "Direction") < 0)
    return -1;
  ret = display_column_name(buf);
  free(buf);
  return ret;
}


x86 assembly (clang, -O0):
<gpio_print_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    0xebd(%rip),%rsi
lea    0xed4(%rip),%rdx
lea    0xed2(%rip),%rcx
lea    0xed1(%rip),%r8
lea    0xed5(%rip),%r9
lea    0xed3(%rip),%rax
mov    %rax,(%rsp)
call   1050 <asprintf@plt>
cmp    $0x0,%rax
jge    1185 <gpio_print_header+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a0 <gpio_print_header+0x70>
mov    -0x10(%rbp),%rdi
call   1040 <display_column_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_print_header>:
push   %rbx
sub    $0x10,%rsp
lea    0xefd(%rip),%rax
mov    %rax,(%rsp)
lea    0xeb9(%rip),%rsi
lea    0xed0(%rip),%rdx
lea    0xece(%rip),%rcx
lea    0xecd(%rip),%r8
lea    0xed1(%rip),%r9
lea    0x8(%rsp),%rdi
call   1050 <asprintf@plt>
test   %rax,%rax
js     118a <gpio_print_header+0x5a>
mov    0x8(%rsp),%rdi
call   1040 <display_column_name@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
jmp    118f <gpio_print_header+0x5f>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%-20s %-10s %-10s %-10s %-10s\00"
@.str.1 = [5 x i8] c"Name\00"
@.str.2 = [6 x i8] c"Value\00"
@.str.3 = [11 x i8] c"Active_low\00"
@.str.4 = [5 x i8] c"Edge\00"
@.str.5 = [10 x i8] c"Direction\00"
define i32 @gpio_print_header() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = call i64 @asprintf(i8** %2, i8* getelementptr inbounds ([30 x i8], [30 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 ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 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 ([10 x i8], [10 x i8]* @.str.5, 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 = [30 x i8] c"%-20s %-10s %-10s %-10s %-10s\00"
@.str.1 = [5 x i8] c"Name\00"
@.str.2 = [6 x i8] c"Value\00"
@.str.3 = [11 x i8] c"Active_low\00"
@.str.4 = [5 x i8] c"Edge\00"
@.str.5 = [10 x i8] c"Direction\00"
define i32 @gpio_print_header() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
%3 = call i64 @asprintf(i8** %1, i8* getelementptr inbounds ([30 x i8], [30 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 ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 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 ([10 x i8], [10 x i8]* @.str.5, 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
}