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


x86 assembly (clang, -O0):
<__body_init_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <gettext@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
cmp    $0x0,%rax
je     11d0 <__body_init_status+0x90>
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
lea    0xe60(%rip),%rdx
lea    -0x24(%rbp),%rcx
call   1040 <add_string_to_body@plt>
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <gettext@plt>
mov    %rax,-0x30(%rbp)
jmp    117e <__body_init_status+0x3e>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0x24(%rbp),%rsi
call   1030 <status_header@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11f8 <__body_init_status+0xb8>
mov    -0x24(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__body_init_status>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
movl   $0x0,0x4(%rsp)
mov    (%rdi),%rdi
call   1050 <gettext@plt>
cmpb   $0x0,(%rax)
je     1198 <__body_init_status+0x68>
add    $0x8,%rbp
xor    %ebx,%ebx
lea    0xe9a(%rip),%r12
lea    0x4(%rsp),%r13
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
call   1040 <add_string_to_body@plt>
mov    %rax,%rbx
mov    0x0(%rbp),%rdi
call   1050 <gettext@plt>
add    $0x8,%rbp
cmpb   $0x0,(%rax)
jne    1170 <__body_init_status+0x40>
jmp    119a <__body_init_status+0x6a>
xor    %ebx,%ebx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1030 <status_header@plt>
test   %r15,%r15
je     11b6 <__body_init_status+0x86>
mov    0x4(%rsp),%ecx
mov    %ecx,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @__body_init_status(i8** nocapture %0, i32* writeonly %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = load i8*, i8** %0
%7 = tail call i8* @gettext(i8* %6)
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %3, %10
%11 = phi i64 [ %15, %10 ], [ 0, %3 ]
%12 = phi i8* [ %18, %10 ], [ %7, %3 ]
%13 = phi i8* [ %14, %10 ], [ null, %3 ]
%14 = call i8* @add_string_to_body(i8* %13, i8* %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32* %4)
%15 = add nuw i64 %11, 1
%16 = getelementptr inbounds i8*, i8** %0, i64 %15
%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 %21, label %10
21: ; preds = %10, %3
%22 = phi i8* [ null, %3 ], [ %14, %10 ]
%23 = call i8* @status_header(i8* %22, i32* %4, i32 %2)
%24 = icmp eq i32* %1, null
br i1 %24, label %27, label %25
25: ; preds = %21
%26 = load i32, i32* %4
store i32 %26, i32* %1
br label %27
27: ; preds = %25, %21
ret i8* %23
}