#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 *);
size_t strcspn(char const *, char *);
int /*<<< orphan*/ xfwrite(char const *, size_t, int, int /*<<< orphan*/ *);
void header_print_comment(FILE *fp, const char *value, void *arg) {
  const char *p = value;
  size_t l;
  fprintf(fp, "/*\n");
  for (;;) {
    l = strcspn(p, "\n");
    fprintf(fp, " *");
    if (l) {
      fprintf(fp, " ");
      xfwrite(p, l, 1, fp);
      p += l;
    }
    fprintf(fp, "\n");
    if (*p++ == '\0')
      break;
  }
  fprintf(fp, " */\n");
}


x86 assembly (clang, -O0):
<header_print_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcspn@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
cmpq   $0x0,-0x28(%rbp)
je     11bd <header_print_comment+0x8d>
mov    -0x8(%rbp),%rdi
lea    0xe71(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1050 <xfwrite@plt>
mov    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe3a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11ed <header_print_comment+0xbd>
jmp    11f2 <header_print_comment+0xc2>
jmp    115c <header_print_comment+0x2c>
mov    -0x8(%rbp),%rdi
lea    0xe0c(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_print_comment>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xeaa(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1060 <fwrite@plt>
lea    0xe93(%rip),%r15
lea    0xe8e(%rip),%r12
jmp    1196 <header_print_comment+0x56>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
je     11e3 <header_print_comment+0xa3>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcspn@plt>
mov    %rax,%r13
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r12,%rdi
mov    %r14,%rcx
call   1060 <fwrite@plt>
test   %r13,%r13
je     1180 <header_print_comment+0x40>
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
mov    %r14,%rcx
call   1050 <xfwrite@plt>
add    %r13,%rbx
jmp    1180 <header_print_comment+0x40>
lea    0xe1d(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r14,%rcx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1060 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"/*\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c" *\00"
@.str.4 = [5 x i8] c" */\0A\00"
define void @header_print_comment(i32* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
br label %5
5: ; preds = %14, %3
%6 = phi i8* [ %1, %3 ], [ %17, %14 ]
%7 = tail call i64 @strcspn(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 2, i64 1, i32* %0)
%9 = icmp eq i64 %7, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = tail call i32 @fputc(i32 32, i32* %0)
%12 = tail call i32 @xfwrite(i8* %6, i64 %7, i32 1, i32* %0)
%13 = getelementptr inbounds i8, i8* %6, i64 %7
br label %14
14: ; preds = %10, %5
%15 = phi i8* [ %13, %10 ], [ %6, %5 ]
%16 = tail call i32 @fputc(i32 10, i32* %0)
%17 = getelementptr inbounds i8, i8* %15, i64 1
%18 = load i8, i8* %15
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %5
20: ; preds = %14
%21 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 4, i64 1, i32* %0)
ret void
}