#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*/ search_replace_string(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strdup(char *);
char *form_set_post_change_javascript_row_zero(char *post_change_javascript) {
  char post_change_javascript_row_zero[65536];
  if (!post_change_javascript)
    return "";
  strcpy(post_change_javascript_row_zero, post_change_javascript);
  search_replace_string(post_change_javascript_row_zero, "$row", "0");
  return strdup(post_change_javascript_row_zero);
}


x86 assembly (clang, -O0):
<form_set_post_change_javascript_row_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10010,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115a <form_set_post_change_javascript_row_zero+0x2a>
lea    0xeb5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1194 <form_set_post_change_javascript_row_zero+0x64>
lea    -0x10010(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10010(%rbp),%rdi
lea    0xe88(%rip),%rsi
lea    0xe86(%rip),%rdx
call   1040 <search_replace_string@plt>
lea    -0x10010(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_set_post_change_javascript_row_zero>:
test   %rdi,%rdi
je     1172 <form_set_post_change_javascript_row_zero+0x42>
push   %rbx
sub    $0x10000,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeae(%rip),%rsi
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
call   1040 <search_replace_string@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
add    $0x10000,%rsp
pop    %rbx
ret
lea    0xe8d(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"$row\00"
@.str.2 = [2 x i8] c"0\00"
define i8* @form_set_post_change_javascript_row_zero(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [65536 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
8: ; preds = %1
%9 = getelementptr inbounds [65536 x i8], [65536 x i8]* %4, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [65536 x i8], [65536 x i8]* %4, i64 0, i64 0
%13 = call i32 @search_replace_string(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [65536 x i8], [65536 x i8]* %4, i64 0, i64 0
%15 = call i8* @strdup(i8* %14)
store i8* %15, i8** %2
br label %16
16: ; preds = %8, %7
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"$row\00"
@.str.2 = [2 x i8] c"0\00"
define i8* @form_set_post_change_javascript_row_zero(i8* %0) {
%2 = alloca [65536 x i8]
%3 = getelementptr inbounds [65536 x i8], [65536 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = call i32 @strcpy(i8* %3, i8* %0)
%7 = call i32 @search_replace_string(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = call i8* @strdup(i8* %3)
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %10
}