#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ pad_blanks(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void hdr_line(FILE *f, char var[], char val[], char comment[]) {
  char line[256];
  strcpy(line, var);
  pad_blanks(line, 8);
  strcat(line, "= ");
  strcat(line, val);
  if (*comment != '\0') {
    pad_blanks(line, 32);
    strcat(line, "/ ");
    strcat(line, comment);
  }
  fprintf(f, "%s\n", line);
}


x86 assembly (clang, -O0):
<hdr_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x120(%rbp),%rdi
mov    $0x8,%esi
call   1050 <pad_blanks@plt>
lea    -0x120(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11e3 <hdr_line+0xa3>
lea    -0x120(%rbp),%rdi
mov    $0x20,%esi
call   1050 <pad_blanks@plt>
lea    -0x120(%rbp),%rdi
lea    0xe35(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x120(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x120(%rbp),%rdx
lea    0xe11(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdr_line>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <pad_blanks@plt>
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
cmpb   $0x0,(%r15)
je     11b9 <hdr_line+0x79>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1050 <pad_blanks@plt>
lea    0xe5d(%rip),%rsi
mov    %rbx,%rdi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
lea    0xe46(%rip),%rsi
mov    %rsp,%rdx
mov    %r14,%rdi
call   1040 <fprintf@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"= \00"
@.str.1 = [3 x i8] c"/ \00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @hdr_line(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [256 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%14 = call i32 @pad_blanks(i8* %13, i32 8)
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%16 = call i32 @strcat(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%18 = load i8*, i8** %7
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %8
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %32
24: ; preds = %4
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%26 = call i32 @pad_blanks(i8* %25, i32 32)
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%28 = call i32 @strcat(i8* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%30 = load i8*, i8** %8
%31 = call i32 @strcat(i8* %29, i8* %30)
br label %32
32: ; preds = %24, %4
%33 = load i32*, i32** %5
%34 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%35 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %34)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"= \00"
@.str.1 = [3 x i8] c"/ \00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @hdr_line(i32* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca [256 x i8]
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* %1)
%8 = call i32 @pad_blanks(i8* %6, i32 8)
%9 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @strcat(i8* %6, i8* %2)
%11 = load i8, i8* %3
%12 = icmp eq i8 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %4
%14 = call i32 @pad_blanks(i8* %6, i32 32)
%15 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%16 = call i32 @strcat(i8* %6, i8* %3)
br label %17
17: ; preds = %13, %4
%18 = call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}