#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 *getLanIP();
int /*<<< orphan*/ printf(char *, ...);
void javascriptUpdate(void) {
  printf("<script language=\"JavaScript\" type=\"text/javascript\">");
  printf(" function refresh_all(){	  top.location.href = \"http://%s\"; } "
         "function update(){   self.setTimeout(\"refresh_all()\", %s);}",
         getLanIP(), "60000");
  printf("update();");
  printf("</script>");
}


x86 assembly (clang, -O0):
<javascriptUpdate>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getLanIP@plt>
mov    %rax,%rsi
lea    0xef3(%rip),%rdi
lea    0xf66(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<javascriptUpdate>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getLanIP@plt>
lea    0xef9(%rip),%rdi
lea    0xf6c(%rip),%rdx
mov    %rax,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf61(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"<script language=\22JavaScript\22 type=\22text/javascript\22>\00"
@.str.1 = [122 x i8] c" function refresh_all(){\09 top.location.href = \22http://%s\22; } function update(){ self.setTimeout(\22refresh_all()\22, %s);}\00"
@.str.2 = [6 x i8] c"60000\00"
@.str.3 = [10 x i8] c"update();\00"
@.str.4 = [10 x i8] c"</script>\00"
define void @javascriptUpdate() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = call i8* (...) @getLanIP()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, 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 = [122 x i8] c" function refresh_all(){\09 top.location.href = \22http://%s\22; } function update(){ self.setTimeout(\22refresh_all()\22, %s);}\00"
@.str.2 = [6 x i8] c"60000\00"
@.str.3 = [10 x i8] c"update();\00"
@.str.4 = [10 x i8] c"</script>\00"
define void @javascriptUpdate() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%2 = tail call i8* (...) @getLanIP()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([122 x i8], [122 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
ret void
}