#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*/ header(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int save_config() {
  header("save");
  printf("<pre>\n");
  system("/bin/save_config");
  printf("</pre>\n");
  printf("<h3><center><blink>\n");
  printf("Rebooting, takes about 60 seconds\n");
  printf("</blink></center></h3></html>\n");
  system("/sbin/reboot");
  sleep(10);
}


x86 assembly (clang, -O0):
<save_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <header@plt>
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xea5(%rip),%rdi
call   1040 <system@plt>
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
call   1050 <printf@plt>
lea    0xed9(%rip),%rdi
call   1040 <system@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_config>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <header@plt>
lea    0xecf(%rip),%rdi
call   1040 <puts@plt>
lea    0xea5(%rip),%rdi
call   1050 <system@plt>
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
lea    0xec0(%rip),%rdi
call   1040 <puts@plt>
lea    0xed6(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7a(%rip),%rdi
call   1050 <system@plt>
mov    $0xa,%edi
pop    %rax
jmp    1060 <sleep@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"save\00"
@.str.1 = [7 x i8] c"<pre>\0A\00"
@.str.2 = [17 x i8] c"/bin/save_config\00"
@.str.3 = [8 x i8] c"</pre>\0A\00"
@.str.4 = [21 x i8] c"<h3><center><blink>\0A\00"
@.str.5 = [35 x i8] c"Rebooting, takes about 60 seconds\0A\00"
@.str.6 = [31 x i8] c"</blink></center></h3></html>\0A\00"
@.str.7 = [13 x i8] c"/sbin/reboot\00"
define i32 @save_config() {
%1 = alloca i32
%2 = call i32 @header(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @sleep(i32 10)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"save\00"
@.str.2 = [17 x i8] c"/bin/save_config\00"
@.str.7 = [13 x i8] c"/sbin/reboot\00"
@str = [6 x i8] c"<pre>\00"
@str.8 = [7 x i8] c"</pre>\00"
@str.9 = [20 x i8] c"<h3><center><blink>\00"
@str.10 = [34 x i8] c"Rebooting, takes about 60 seconds\00"
@str.11 = [30 x i8] c"</blink></center></h3></html>\00"
define i32 @save_config() {
%1 = tail call i32 @header(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.9, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.10, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 10)
ret i32 undef
}