#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 */
char *add_string_to_body(char *, char *, char *, int *);
char *gettext(char *);
scalar_t__ strlen(char *);
char *__body_init(char *buffer, char **header, int *num_lines) {
  int j;
  int header_lines = 0;
  char *x_header;
  if (num_lines)
    header_lines = *num_lines;
  for (j = 0, x_header = gettext(header[j]); strlen(x_header) != 0;
       j++, x_header = gettext(header[j])) {
    if (j == 0)
      buffer = add_string_to_body(buffer, x_header, "", &header_lines);
    else
      buffer = add_string_to_body(buffer, x_header, "   ", &header_lines);
  }
  if (num_lines)
    *num_lines = header_lines;
  return buffer;
}


x86 assembly (clang, -O0):
<__body_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <__body_init+0x2f>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <gettext@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
je     11fd <__body_init+0xcd>
cmpl   $0x0,-0x1c(%rbp)
jne    11b9 <__body_init+0x89>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    0xe5c(%rip),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <add_string_to_body@plt>
mov    %rax,-0x8(%rbp)
jmp    11d5 <__body_init+0xa5>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    0xe38(%rip),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <add_string_to_body@plt>
mov    %rax,-0x8(%rbp)
jmp    11da <__body_init+0xaa>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <gettext@plt>
mov    %rax,-0x28(%rbp)
jmp    117b <__body_init+0x4b>
cmpq   $0x0,-0x18(%rbp)
je     1211 <__body_init+0xe1>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__body_init>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
movl   $0x0,0xc(%rsp)
test   %rdx,%rdx
je     114a <__body_init+0x2a>
mov    (%r14),%eax
mov    %eax,0xc(%rsp)
mov    (%rbx),%rdi
call   1040 <gettext@plt>
cmpb   $0x0,(%rax)
je     11b5 <__body_init+0x95>
lea    0xea5(%rip),%rdx
lea    0xc(%rsp),%rcx
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <add_string_to_body@plt>
mov    %rax,%r15
mov    0x8(%rbx),%rdi
call   1040 <gettext@plt>
cmpb   $0x0,(%rax)
je     11b5 <__body_init+0x95>
add    $0x10,%rbx
lea    0xe76(%rip),%r12
lea    0xc(%rsp),%r13
nop
mov    %r15,%rdi
mov    %rax,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1030 <add_string_to_body@plt>
mov    %rax,%r15
mov    (%rbx),%rdi
call   1040 <gettext@plt>
add    $0x8,%rbx
cmpb   $0x0,(%rax)
jne    1190 <__body_init+0x70>
test   %r14,%r14
je     11c1 <__body_init+0xa1>
mov    0xc(%rsp),%eax
mov    %eax,(%r14)
mov    %r15,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c" \00"
define i8* @__body_init(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
store i32 0, i32* %8
%10 = load i32*, i32** %6
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
store i32 %14, i32* %8
br label %15
15: ; preds = %12, %3
store i32 0, i32* %7
%16 = load i8**, i8*** %5
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i8* @gettext(i8* %20)
store i8* %21, i8** %9
br label %22
22: ; preds = %38, %15
%23 = load i8*, i8** %9
%24 = call i64 @strlen(i8* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %47
26: ; preds = %22
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = load i8*, i8** %4
%31 = load i8*, i8** %9
%32 = call i8* @add_string_to_body(i8* %30, i8* %31, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %8)
store i8* %32, i8** %4
br label %37
33: ; preds = %26
%34 = load i8*, i8** %4
%35 = load i8*, i8** %9
%36 = call i8* @add_string_to_body(i8* %34, i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %8)
store i8* %36, i8** %4
br label %37
37: ; preds = %33, %29
br label %38
38: ; preds = %37
%39 = load i32, i32* %7
%40 = add nsw i32 %39, 1
store i32 %40, i32* %7
%41 = load i8**, i8*** %5
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
%46 = call i8* @gettext(i8* %45)
store i8* %46, i8** %9
br label %22
47: ; preds = %22
%48 = load i32*, i32** %6
%49 = icmp ne i32* %48, null
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = load i32, i32* %8
%52 = load i32*, i32** %6
store i32 %51, i32* %52
br label %53
53: ; preds = %50, %47
%54 = load i8*, i8** %4
ret i8* %54
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c" \00"
define i8* @__body_init(i8* %0, i8** nocapture %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = icmp eq i32* %2, null
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = load i32, i32* %2
store i32 %8, i32* %4
br label %9
9: ; preds = %7, %3
%10 = load i8*, i8** %1
%11 = tail call i8* @gettext(i8* %10)
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %32, label %14
14: ; preds = %9
%15 = call i8* @add_string_to_body(i8* %0, i8* %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %4)
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = call i8* @gettext(i8* %17)
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %32, label %21
21: ; preds = %14, %21
%22 = phi i64 [ %26, %21 ], [ 1, %14 ]
%23 = phi i8* [ %29, %21 ], [ %18, %14 ]
%24 = phi i8* [ %25, %21 ], [ %15, %14 ]
%25 = call i8* @add_string_to_body(i8* %24, i8* %23, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%26 = add nuw i64 %22, 1
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = call i8* @gettext(i8* %28)
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %32, label %21
32: ; preds = %21, %14, %9
%33 = phi i8* [ %0, %9 ], [ %15, %14 ], [ %25, %21 ]
br i1 %6, label %36, label %34
34: ; preds = %32
%35 = load i32, i32* %4
store i32 %35, i32* %2
br label %36
36: ; preds = %34, %32
ret i8* %33
}