#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*/ printf(char *, ...);
void form_output_submit_button(char *submit_control_string, char *button_label,
                               int form_number) {
  if (!button_label || !*button_label)
    button_label = "|    Submit    |";
  printf("<td>");
  if (submit_control_string && *submit_control_string) {
    printf("<td><input type=button value=\"%s\" "
           "onClick=\"%s document.forms[%d].submit();\">\n",
           button_label, submit_control_string, form_number);
  } else {
    printf("<td><input type=button value=\"%s\" "
           "onClick=\"document.forms[%d].submit();\">\n",
           button_label, form_number);
  }
}


x86 assembly (clang, -O0):
<form_output_submit_button>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113b <form_output_submit_button+0x2b>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1146 <form_output_submit_button+0x36>
lea    0xebe(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     118d <form_output_submit_button+0x7d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     118d <form_output_submit_button+0x7d>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a2 <form_output_submit_button+0x92>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_output_submit_button>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbp
test   %rsi,%rsi
je     1127 <form_output_submit_button+0x17>
mov    %rsi,%rbx
cmpb   $0x0,(%rsi)
jne    112e <form_output_submit_button+0x1e>
lea    0xed2(%rip),%rbx
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
test   %rbp,%rbp
je     1162 <form_output_submit_button+0x52>
cmpb   $0x0,0x0(%rbp)
je     1162 <form_output_submit_button+0x52>
lea    0xec8(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"| Submit |\00"
@.str.1 = [5 x i8] c"<td>\00"
@.str.2 = [78 x i8] c"<td><input type=button value=\22%s\22 onClick=\22%s document.forms[%d].submit();\22>\0A\00"
@.str.3 = [75 x i8] c"<td><input type=button value=\22%s\22 onClick=\22document.forms[%d].submit();\22>\0A\00"
define void @form_output_submit_button(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9, %3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8** %5
br label %14
14: ; preds = %13, %9
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8*, i8** %4
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %18
%24 = load i8*, i8** %5
%25 = load i8*, i8** %4
%26 = load i32, i32* %6
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i8* %24, i8* %25, i32 %26)
br label %32
28: ; preds = %18, %14
%29 = load i8*, i8** %5
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0), i8* %29, i32 %30)
br label %32
32: ; preds = %28, %23
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"| Submit |\00"
@.str.1 = [5 x i8] c"<td>\00"
@.str.2 = [78 x i8] c"<td><input type=button value=\22%s\22 onClick=\22%s document.forms[%d].submit();\22>\0A\00"
@.str.3 = [75 x i8] c"<td><input type=button value=\22%s\22 onClick=\22document.forms[%d].submit();\22>\0A\00"
define void @form_output_submit_button(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5, %3
br label %9
9: ; preds = %8, %5
%10 = phi i8* [ %1, %5 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), %8 ]
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i8* %0, null
br i1 %12, label %18, label %13
13: ; preds = %9
%14 = load i8, i8* %0
%15 = icmp eq i8 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), i8* %10, i8* %0, i32 %2)
br label %20
18: ; preds = %13, %9
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.3, i64 0, i64 0), i8* %10, i32 %2)
br label %20
20: ; preds = %18, %16
ret void
}