#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*/ execv(char *, char **);
void do_reboot() {
  static char *execArgv[5];
  execArgv[0] = "shutdown";
  execArgv[1] = "-r";
  execArgv[2] = "now";
  execArgv[3] = NULL;
  execv("/sbin/shutdown", execArgv);
}


x86 assembly (clang, -O0):
<do_reboot>:
push   %rbp
mov    %rsp,%rbp
lea    0xef2(%rip),%rax
mov    %rax,0x2f1e(%rip)
lea    0xed7(%rip),%rax
mov    %rax,0x2f18(%rip)
lea    0xecc(%rip),%rax
mov    %rax,0x2f12(%rip)
movq   $0x0,0x2f0f(%rip)
lea    0xeb7(%rip),%rdi
lea    0x2ee9(%rip),%rsi
call   1030 <execv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_reboot>:
lea    0xef6(%rip),%rax
mov    %rax,0x2f22(%rip)
lea    0x2f1b(%rip),%rsi
lea    0xed4(%rip),%rax
mov    %rax,0x2f15(%rip)
lea    0xec9(%rip),%rax
mov    %rax,0x2f0f(%rip)
movq   $0x0,0x2f0c(%rip)
lea    0xeb4(%rip),%rdi
jmp    1030 <execv@plt>

LLVM IR (-O0):
@do_reboot.execArgv = internal global [5 x i8*] zeroinitializer
@.str = [9 x i8] c"shutdown\00"
@.str.1 = [3 x i8] c"-r\00"
@.str.2 = [4 x i8] c"now\00"
@.str.3 = [15 x i8] c"/sbin/shutdown\00"
define void @do_reboot() {
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 0)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 1)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 2)
store i8* null, i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 3)
%1 = call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@do_reboot.execArgv = internal global [5 x i8*] zeroinitializer
@.str = [9 x i8] c"shutdown\00"
@.str.1 = [3 x i8] c"-r\00"
@.str.2 = [4 x i8] c"now\00"
@.str.3 = [15 x i8] c"/sbin/shutdown\00"
define void @do_reboot() {
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 0)
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 1)
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 2)
store i8* null, i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 3)
%1 = tail call i32 @execv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @do_reboot.execArgv, i64 0, i64 0))
ret void
}