#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 javascriptUpdate(int success) {
  printf("<script language=\"JavaScript\" type=\"text/javascript\">");
  if (success) {
    printf("function update(){ window.location.href = "
           "\"/adm/wait_reboot2.asp\";}");
  } else {
    printf("function update(){ parent.menu.setUnderFirmwareUpload(0);}");
  }
  printf("</script>");
}


x86 assembly (clang, -O0):
<javascriptUpdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1142 <javascriptUpdate+0x32>
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <javascriptUpdate+0x3e>
lea    0xf31(%rip),%rdi
call   1030 <printf@plt>
lea    0xf60(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<javascriptUpdate>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
test   %ebx,%ebx
lea    0xf52(%rip),%rax
lea    0xf07(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
lea    0xf76(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"<script language=\22JavaScript\22 type=\22text/javascript\22>\00"
@.str.1 = [68 x i8] c"function update(){ window.location.href = \22/adm/wait_reboot2.asp\22;}\00"
@.str.2 = [59 x i8] c"function update(){ parent.menu.setUnderFirmwareUpload(0);}\00"
@.str.3 = [10 x i8] c"</script>\00"
define void @javascriptUpdate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"<script language=\22JavaScript\22 type=\22text/javascript\22>\00"
@.str.1 = [68 x i8] c"function update(){ window.location.href = \22/adm/wait_reboot2.asp\22;}\00"
@.str.2 = [59 x i8] c"function update(){ parent.menu.setUnderFirmwareUpload(0);}\00"
@.str.3 = [10 x i8] c"</script>\00"
define void @javascriptUpdate(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* dereferenceable(1) %4)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret void
}