#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 *form_set_post_change_javascript_row_zero(char *);
int /*<<< orphan*/ printf(char *, ...);
void form_output_reset_button(char *post_change_javascript, int form_number) {
  printf("<td><input type=\"button\" value=\"Reset\" "
         "onClick=\"form_reset(document.forms[%d], '%c')",
         form_number, '|');
  if (post_change_javascript && *post_change_javascript) {
    printf(";%s;",
           form_set_post_change_javascript_row_zero(post_change_javascript));
  }
  printf("\">\n");
}


x86 assembly (clang, -O0):
<form_output_reset_button>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x7c,%edx
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     117a <form_output_reset_button+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117a <form_output_reset_button+0x5a>
mov    -0x8(%rbp),%rdi
call   1040 <form_set_post_change_javascript_row_zero@plt>
mov    %rax,%rsi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_output_reset_button>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    $0x7c,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   %rbx,%rbx
je     116a <form_output_reset_button+0x3a>
cmpb   $0x0,(%rbx)
je     116a <form_output_reset_button+0x3a>
mov    %rbx,%rdi
call   1050 <form_set_post_change_javascript_row_zero@plt>
lea    0xef5(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee9(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [85 x i8] c"<td><input type=\22button\22 value=\22Reset\22 onClick=\22form_reset(document.forms[%d], '%c')\00"
@.str.1 = [5 x i8] c";%s;\00"
@.str.2 = [4 x i8] c"\22>\0A\00"
define void @form_output_reset_button(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %5, i32 124)
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %18
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = call i8* @form_set_post_change_javascript_row_zero(i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %14, %9, %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [85 x i8] c"<td><input type=\22button\22 value=\22Reset\22 onClick=\22form_reset(document.forms[%d], '%c')\00"
@.str.1 = [5 x i8] c";%s;\00"
@str = [3 x i8] c"\22>\00"
define void @form_output_reset_button(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), i32 %1, i32 124)
%4 = icmp eq i8* %0, null
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = tail call i8* @form_set_post_change_javascript_row_zero(i8* %0)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %5, %2
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}