#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 *, ...);
void element_notepad_output(FILE *output_file, int attribute_width,
                            char *element_name, char *data, int row,
                            int number_rows, char onchange_null2slash_yn,
                            int tab_index) {
  int display_width;
  if (attribute_width > 30)
    display_width = 30;
  else
    display_width = attribute_width;
  if (!data)
    data = "";
  if (number_rows == 1) {
    fprintf(output_file,
            "<td><input name=\"%s_%d\" type=\"text\" size=\"%d\" value=\"%s\"",
            element_name, row, display_width, data);
    fprintf(output_file, " maxlength=\"%d\"", attribute_width);
    fprintf(output_file, " onkeyup=\"timlib_prevent_carrot(event,this)\"");
    if (onchange_null2slash_yn == 'y') {
      fprintf(output_file, " onChange=\"null2slash(this)\"");
    }
    if (tab_index) {
      fprintf(output_file, " tabindex=%d", tab_index);
    }
    fprintf(output_file, ">\n");
  } else {
    if (attribute_width >= 10000) {
      display_width = 70;
      number_rows = 12;
    }
    fprintf(output_file, "<td><textarea name=\"%s_%d\" cols=%d rows=%d",
            element_name, row, display_width, number_rows);
    if (onchange_null2slash_yn == 'y') {
      fprintf(output_file, " onChange=\"null2slash(this)\"");
    }
    fprintf(output_file, " onblur=\"timlib_check_notepad_size(this, %d);\"",
            attribute_width);
    fprintf(output_file, " onkeyup=\"timlib_prevent_carrot(event,this)\"");
    if (tab_index) {
      fprintf(output_file, " tabindex=%d", tab_index);
    }
    fprintf(output_file, " wrap=%s>%s</textarea>\n", "soft", data);
  }
  fprintf(output_file, "</td>\n");
}


x86 assembly (clang, -O0):
<element_notepad_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
cmpl   $0x1e,-0xc(%rbp)
jle    114b <element_notepad_output+0x3b>
movl   $0x1e,-0x2c(%rbp)
jmp    1151 <element_notepad_output+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1167 <element_notepad_output+0x57>
lea    0xfae(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x1,-0x28(%rbp)
jne    120e <element_notepad_output+0xfe>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    -0x20(%rbp),%r9
lea    0xe75(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe99(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movsbl 0x10(%rbp),%eax
cmp    $0x79,%eax
jne    11d8 <element_notepad_output+0xc8>
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,0x18(%rbp)
je     11f7 <element_notepad_output+0xe7>
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%edx
lea    0xea3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xf0d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    12cc <element_notepad_output+0x1bc>
cmpl   $0x2710,-0xc(%rbp)
jl     1229 <element_notepad_output+0x119>
movl   $0x46,-0x2c(%rbp)
movl   $0xc,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    -0x28(%rbp),%r9d
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movsbl 0x10(%rbp),%eax
cmp    $0x79,%eax
jne    1269 <element_notepad_output+0x159>
mov    -0x8(%rbp),%rdi
lea    0xe14(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe54(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xdc0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmpl   $0x0,0x18(%rbp)
je     12af <element_notepad_output+0x19f>
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%edx
lea    0xdeb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rcx
lea    0xe3c(%rip),%rsi
lea    0xe4d(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe40(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<element_notepad_output>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%eax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x38(%rsp),%r14d
mov    0x30(%rsp),%r12b
cmp    $0x1e,%esi
mov    $0x1e,%r8d
cmovl  %esi,%r8d
test   %rcx,%rcx
lea    0xfc0(%rip),%r15
cmovne %rcx,%r15
cmp    $0x1,%r9d
jne    11f7 <element_notepad_output+0xd7>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%ecx
mov    %r15,%r9
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeba(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
cmp    $0x79,%r12b
jne    11c0 <element_notepad_output+0xa0>
lea    0xec8(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %r14d,%r14d
je     11d9 <element_notepad_output+0xb9>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xf2f(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
jmp    12a1 <element_notepad_output+0x181>
cmp    $0x2710,%ebp
mov    $0xc,%ecx
cmovge %ecx,%r9d
mov    $0x46,%ecx
cmovge %ecx,%r8d
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
cmp    $0x79,%r12b
jne    1241 <element_notepad_output+0x121>
lea    0xe47(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xdee(%rip),%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %r14d,%r14d
je     1286 <element_notepad_output+0x166>
lea    0xe1a(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xe6d(%rip),%rsi
lea    0xe7e(%rip),%rdx
mov    %rbx,%rdi
mov    %r15,%rcx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xe6f(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [57 x i8] c"<td><input name=\22%s_%d\22 type=\22text\22 size=\22%d\22 value=\22%s\22\00"
@.str.2 = [16 x i8] c" maxlength=\22%d\22\00"
@.str.3 = [45 x i8] c" onkeyup=\22timlib_prevent_carrot(event,this)\22\00"
@.str.4 = [29 x i8] c" onChange=\22null2slash(this)\22\00"
@.str.5 = [13 x i8] c" tabindex=%d\00"
@.str.6 = [3 x i8] c">\0A\00"
@.str.7 = [43 x i8] c"<td><textarea name=\22%s_%d\22 cols=%d rows=%d\00"
@.str.8 = [47 x i8] c" onblur=\22timlib_check_notepad_size(this, %d);\22\00"
@.str.9 = [24 x i8] c" wrap=%s>%s</textarea>\0A\00"
@.str.10 = [5 x i8] c"soft\00"
@.str.11 = [7 x i8] c"</td>\0A\00"
define void @element_notepad_output(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i8 signext %6, i32 %7) {
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8
%16 = alloca i32
%17 = alloca i32
store i32* %0, i32** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8 %6, i8* %15
store i32 %7, i32* %16
%18 = load i32, i32* %10
%19 = icmp sgt i32 %18, 30
br i1 %19, label %20, label %21
20: ; preds = %8
store i32 30, i32* %17
br label %23
21: ; preds = %8
%22 = load i32, i32* %10
store i32 %22, i32* %17
br label %23
23: ; preds = %21, %20
%24 = load i8*, i8** %12
%25 = icmp ne i8* %24, null
br i1 %25, label %27, label %26
26: ; preds = %23
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %12
br label %27
27: ; preds = %26, %23
%28 = load i32, i32* %14
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %58
30: ; preds = %27
%31 = load i32*, i32** %9
%32 = load i8*, i8** %11
%33 = load i32, i32* %13
%34 = load i32, i32* %17
%35 = load i8*, i8** %12
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i8* %32, i32 %33, i32 %34, i8* %35)
%37 = load i32*, i32** %9
%38 = load i32, i32* %10
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = load i32*, i32** %9
%41 = call i32 (i32*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%42 = load i8, i8* %15
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 121
br i1 %44, label %45, label %48
45: ; preds = %30
%46 = load i32*, i32** %9
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %46, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %45, %30
%49 = load i32, i32* %16
%50 = icmp ne i32 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %48
%52 = load i32*, i32** %9
%53 = load i32, i32* %16
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %51, %48
%56 = load i32*, i32** %9
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %91
58: ; preds = %27
%59 = load i32, i32* %10
%60 = icmp sge i32 %59, 10000
br i1 %60, label %61, label %62
61: ; preds = %58
store i32 70, i32* %17
store i32 12, i32* %14
br label %62
62: ; preds = %61, %58
%63 = load i32*, i32** %9
%64 = load i8*, i8** %11
%65 = load i32, i32* %13
%66 = load i32, i32* %17
%67 = load i32, i32* %14
%68 = call i32 (i32*, i8*, ...) @fprintf(i32* %63, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %64, i32 %65, i32 %66, i32 %67)
%69 = load i8, i8* %15
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 121
br i1 %71, label %72, label %75
72: ; preds = %62
%73 = load i32*, i32** %9
%74 = call i32 (i32*, i8*, ...) @fprintf(i32* %73, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %75
75: ; preds = %72, %62
%76 = load i32*, i32** %9
%77 = load i32, i32* %10
%78 = call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 %77)
%79 = load i32*, i32** %9
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %79, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%81 = load i32, i32* %16
%82 = icmp ne i32 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %75
%84 = load i32*, i32** %9
%85 = load i32, i32* %16
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %84, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %83, %75
%88 = load i32*, i32** %9
%89 = load i8*, i8** %12
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %88, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %89)
br label %91
91: ; preds = %87, %55
%92 = load i32*, i32** %9
%93 = call i32 (i32*, i8*, ...) @fprintf(i32* %92, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [57 x i8] c"<td><input name=\22%s_%d\22 type=\22text\22 size=\22%d\22 value=\22%s\22\00"
@.str.2 = [16 x i8] c" maxlength=\22%d\22\00"
@.str.3 = [45 x i8] c" onkeyup=\22timlib_prevent_carrot(event,this)\22\00"
@.str.4 = [29 x i8] c" onChange=\22null2slash(this)\22\00"
@.str.5 = [13 x i8] c" tabindex=%d\00"
@.str.6 = [3 x i8] c">\0A\00"
@.str.7 = [43 x i8] c"<td><textarea name=\22%s_%d\22 cols=%d rows=%d\00"
@.str.8 = [47 x i8] c" onblur=\22timlib_check_notepad_size(this, %d);\22\00"
@.str.9 = [24 x i8] c" wrap=%s>%s</textarea>\0A\00"
@.str.10 = [5 x i8] c"soft\00"
@.str.11 = [7 x i8] c"</td>\0A\00"
define void @element_notepad_output(i32* nocapture %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5, i8 signext %6, i32 %7) {
%9 = icmp slt i32 %1, 30
%10 = select i1 %9, i32 %1, i32 30
%11 = icmp eq i8* %3, null
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %3
%13 = icmp eq i32 %5, 1
br i1 %13, label %14, label %27
14: ; preds = %8
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %4, i32 %10, i8* %12)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%17 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i64 44, i64 1, i32* %0)
%18 = icmp eq i8 %6, 121
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i64 28, i64 1, i32* %0)
br label %21
21: ; preds = %19, %14
%22 = icmp eq i32 %7, 0
br i1 %22, label %25, label %23
23: ; preds = %21
%24 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %7)
br label %25
25: ; preds = %23, %21
%26 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 2, i64 1, i32* %0)
br label %43
27: ; preds = %8
%28 = icmp sgt i32 %1, 9999
%29 = select i1 %28, i32 12, i32 %5
%30 = select i1 %28, i32 70, i32 %10
%31 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0), i8* %2, i32 %4, i32 %30, i32 %29)
%32 = icmp eq i8 %6, 121
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i64 28, i64 1, i32* %0)
br label %35
35: ; preds = %33, %27
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0), i32 %1)
%37 = tail call i64 @fwrite(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0), i64 44, i64 1, i32* %0)
%38 = icmp eq i32 %7, 0
br i1 %38, label %41, label %39
39: ; preds = %35
%40 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %7)
br label %41
41: ; preds = %39, %35
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* %12)
br label %43
43: ; preds = %41, %25
%44 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i64 6, i64 1, i32* %0)
ret void
}