#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 */
char *element_data_delimiter2label_delimiter(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ search_replace_string(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void element_non_edit_text_output(FILE *output_file, char *text,
                                  int column_span, int padding_em) {
  int local_column_span;
  char output_buffer[65536];
  strcpy(output_buffer, text);
  search_replace_string(output_buffer, "%0D%0A", "<br>");
  local_column_span = (column_span) ? column_span : 1;
  fprintf(output_file, "<td colspan=%d", local_column_span);
  if (padding_em) {
    fprintf(output_file, " style=\"padding: 0 %dem 0 %dem;\"", padding_em,
            padding_em);
  }
  fprintf(output_file, ">%s</td>\n",
          element_data_delimiter2label_delimiter(output_buffer));
}


x86 assembly (clang, -O0):
<element_non_edit_text_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10030,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
lea    -0x10020(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10020(%rbp),%rdi
lea    0xe89(%rip),%rsi
lea    0xe89(%rip),%rdx
call   1040 <search_replace_string@plt>
cmpl   $0x0,-0x14(%rbp)
je     119b <element_non_edit_text_output+0x5b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10024(%rbp)
jmp    11ab <element_non_edit_text_output+0x6b>
mov    $0x1,%eax
mov    %eax,-0x10024(%rbp)
jmp    11ab <element_non_edit_text_output+0x6b>
mov    -0x10024(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
lea    0xe4a(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x0,-0x18(%rbp)
je     11eb <element_non_edit_text_output+0xab>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10030(%rbp)
lea    -0x10020(%rbp),%rdi
call   1060 <element_data_delimiter2label_delimiter@plt>
mov    -0x10030(%rbp),%rdi
mov    %rax,%rdx
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
add    $0x10030,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_non_edit_text_output>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x10008,%rsp
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rdi
call   1030 <strcpy@plt>
lea    0xe9a(%rip),%rsi
lea    0xe9a(%rip),%rdx
mov    %r15,%rdi
call   1040 <search_replace_string@plt>
test   %ebx,%ebx
mov    $0x1,%edx
cmovne %ebx,%edx
lea    0xe86(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
test   %ebp,%ebp
je     11a9 <element_non_edit_text_output+0x69>
lea    0xe80(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rsp,%rdi
call   1060 <element_data_delimiter2label_delimiter@plt>
lea    0xe84(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
add    $0x10008,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%0D%0A\00"
@.str.1 = [5 x i8] c"<br>\00"
@.str.2 = [15 x i8] c"<td colspan=%d\00"
@.str.3 = [33 x i8] c" style=\22padding: 0 %dem 0 %dem;\22\00"
@.str.4 = [10 x i8] c">%s</td>\0A\00"
define void @element_non_edit_text_output(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [65536 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 0
%12 = load i8*, i8** %6
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 0
%15 = call i32 @search_replace_string(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %4
%19 = load i32, i32* %7
br label %21
20: ; preds = %4
br label %21
21: ; preds = %20, %18
%22 = phi i32 [ %19, %18 ], [ 1, %20 ]
store i32 %22, i32* %9
%23 = load i32*, i32** %5
%24 = load i32, i32* %9
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %8
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %21
%29 = load i32*, i32** %5
%30 = load i32, i32* %8
%31 = load i32, i32* %8
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %31)
br label %33
33: ; preds = %28, %21
%34 = load i32*, i32** %5
%35 = getelementptr inbounds [65536 x i8], [65536 x i8]* %10, i64 0, i64 0
%36 = call i8* @element_data_delimiter2label_delimiter(i8* %35)
%37 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %36)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%0D%0A\00"
@.str.1 = [5 x i8] c"<br>\00"
@.str.2 = [15 x i8] c"<td colspan=%d\00"
@.str.3 = [33 x i8] c" style=\22padding: 0 %dem 0 %dem;\22\00"
@.str.4 = [10 x i8] c">%s</td>\0A\00"
define void @element_non_edit_text_output(i32* nocapture %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [65536 x i8]
%6 = getelementptr inbounds [65536 x i8], [65536 x i8]* %5, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* %1)
%8 = call i32 @search_replace_string(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %2, 0
%10 = select i1 %9, i32 1, i32 %2
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = icmp eq i32 %3, 0
br i1 %12, label %15, label %13
13: ; preds = %4
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %3, i32 %3)
br label %15
15: ; preds = %13, %4
%16 = call i8* @element_data_delimiter2label_delimiter(i8* %6)
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %16)
ret void
}