#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 *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int main() {
  int delay = 3600;
  printf("****************************************\n");
  printf("remote_control_run : start\n");
  printf("period : 3600 seconds!\n");
  printf("****************************************\n");
  while (1) {
    sleep(delay);
    printf("remote control : start\n");
    system("/ailvgo/system/box/remote_control &");
    sleep(30);
    system("killall remote_control");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xe10,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <sleep@plt>
lea    0xed9(%rip),%rdi
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
lea    0xef3(%rip),%rdi
call   1030 <system@plt>
jmp    1176 <main+0x46>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xf31(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf2b(%rip),%r14
lea    0xe8e(%rip),%r15
lea    0xeab(%rip),%rbx
nopl   0x0(%rax)
mov    $0xe10,%edi
call   1050 <sleep@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1040 <system@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [42 x i8] c"****************************************\0A\00"
@.str.1 = [28 x i8] c"remote_control_run : start\0A\00"
@.str.2 = [24 x i8] c"period : 3600 seconds!\0A\00"
@.str.3 = [24 x i8] c"remote control : start\0A\00"
@.str.4 = [36 x i8] c"/ailvgo/system/box/remote_control &\00"
@.str.5 = [23 x i8] c"killall remote_control\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3600, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
%8 = load i32, i32* %2
%9 = call i32 @sleep(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @system(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @sleep(i32 30)
%13 = call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %7
}

LLVM IR (-O2):
@.str.4 = [36 x i8] c"/ailvgo/system/box/remote_control &\00"
@.str.5 = [23 x i8] c"killall remote_control\00"
@str.6 = [27 x i8] c"remote_control_run : start\00"
@str.7 = [23 x i8] c"period : 3600 seconds!\00"
@str.8 = [41 x i8] c"****************************************\00"
@str.9 = [23 x i8] c"remote control : start\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
br label %5
5: ; preds = %5, %0
%6 = tail call i32 @sleep(i32 3600)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.9, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @sleep(i32 30)
%10 = tail call i32 @system(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %5
}