#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*/ asprintf(char **, char *, char *);
int /*<<< orphan*/ consume_symbol(char *);
int /*<<< orphan*/ exec_kernel_doc(char **);
int /*<<< orphan*/ free(char *);
void docsect(char *filename, char *line) {
  char *vec[6];
  char *s;
  for (s = line; *s; s++)
    if (*s == '\n')
      *s = '\0';
  asprintf(&s, "DOC: %s", line);
  consume_symbol(s);
  free(s);
  vec[0] = "kernel-doc";
  vec[1] = "-docbook";
  vec[2] = "-function";
  vec[3] = line;
  vec[4] = filename;
  vec[5] = NULL;
  exec_kernel_doc(vec);
}


x86 assembly (clang, -O0):
<docsect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmpb   $0x0,(%rax)
je     1192 <docsect+0x52>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    117c <docsect+0x3c>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
jmp    1181 <docsect+0x41>
mov    -0x48(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
jmp    1158 <docsect+0x18>
mov    -0x10(%rbp),%rdx
lea    -0x48(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1060 <asprintf@plt>
mov    -0x48(%rbp),%rdi
call   1050 <consume_symbol@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
lea    0xe49(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe49(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe47(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
call   1040 <exec_kernel_doc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<docsect>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rax
jmp    116c <docsect+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rax)
mov    0x8(%rsp),%rax
add    $0x1,%rax
mov    %rax,0x8(%rsp)
movzbl (%rax),%ecx
cmp    $0xa,%cl
je     1160 <docsect+0x20>
test   %cl,%cl
jne    1168 <docsect+0x28>
lea    0xe7c(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    %rbx,%rdx
call   1060 <asprintf@plt>
mov    0x8(%rsp),%rdi
call   1050 <consume_symbol@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
lea    0xe5c(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe5b(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe58(%rip),%rax
mov    %rax,0x20(%rsp)
mov    %rbx,0x28(%rsp)
mov    %r14,0x30(%rsp)
movq   $0x0,0x38(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <exec_kernel_doc@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"DOC: %s\00"
@.str.1 = [11 x i8] c"kernel-doc\00"
@.str.2 = [9 x i8] c"-docbook\00"
@.str.3 = [10 x i8] c"-function\00"
define void @docsect(i8* %0, i8* %1) {
%3 = alloca [6 x i8*]
%4 = alloca i8*
%5 = bitcast [6 x i8*]* %3 to i8*
%6 = bitcast i8** %4 to i8*
br label %7
7: ; preds = %12, %2
%8 = phi i8* [ %1, %2 ], [ %14, %12 ]
store i8* %8, i8** %4
%9 = load i8, i8* %8
switch i8 %9, label %12 [
i8 0, label %15
i8 10, label %10
]
10: ; preds = %7
store i8 0, i8* %8
%11 = load i8*, i8** %4
br label %12
12: ; preds = %7, %10
%13 = phi i8* [ %8, %7 ], [ %11, %10 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
br label %7
15: ; preds = %7
%16 = call i32 @asprintf(i8** %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
%17 = load i8*, i8** %4
%18 = call i32 @consume_symbol(i8* %17)
%19 = load i8*, i8** %4
%20 = call i32 @free(i8* %19)
%21 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %21
%22 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %22
%23 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8** %23
%24 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
store i8* %1, i8** %24
%25 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
store i8* %0, i8** %25
%26 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 5
store i8* null, i8** %26
%27 = call i32 @exec_kernel_doc(i8** %21)
ret void
}