#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 */
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(double);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  double wait_time = 1.0;
  char *link = "https://www.youtube.com/watch?v=6GggY4TEYbk";
  for (int i = 1; i < argc; i += 2) {
    if (strncmp(argv[i], "in", 2) == 0)
      wait_time = atof(argv[i + 1]);
    else if (strncmp(argv[i], "with", 4) == 0)
      link = argv[i + 1];
    else if (strncmp(argv[i], "help", 4) == 0) {
      printf("remindme help:\nA simple script to open a http link after a "
             "designated time limit.\n\nin <minutes>\tsets the time limit to "
             "wait in minutes(can be a float value).\nwith <ink>\tsets the "
             "link to open after the sleep.\n");
      return 0;
    }
  }
  char buf[256];
  char *open = "open ";
  strcpy(buf, open);
  strcat(buf, link);
  printf("I will remind you in %f minutes.\n", wait_time);
  printf("Link: %s\n", buf);
  sleep(wait_time * 60.0);
  system(buf);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe6f(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xe73(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    129a <main+0x12a>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe75(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11fb <main+0x8b>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1287 <main+0x117>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe31(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    123c <main+0xcc>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
jmp    1282 <main+0x112>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdf5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    127d <main+0x10d>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1318 <main+0x1a8>
jmp    1282 <main+0x112>
jmp    1287 <main+0x117>
jmp    128c <main+0x11c>
mov    -0x24(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x24(%rbp)
jmp    11a8 <main+0x38>
lea    0xe79(%rip),%rax
mov    %rax,-0x138(%rbp)
lea    -0x130(%rbp),%rdi
mov    -0x138(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0x130(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1080 <strcat@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe49(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
lea    -0x130(%rbp),%rsi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movsd  0xd0d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1090 <sleep@plt>
lea    -0x130(%rbp),%rdi
call   1060 <system@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
cmp    $0x2,%edi
jl     1247 <main+0xc7>
mov    %rsi,%rbx
mov    %edi,%ebp
movsd  0xe59(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xe5c(%rip),%r14
mov    $0x1,%r13d
lea    0xe7b(%rip),%r15
lea    0xe77(%rip),%r12
jmp    11e9 <main+0x69>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rbx,%r13,8),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x8(%rsp)
add    $0x2,%r13
cmp    %ebp,%r13d
jge    125c <main+0xdc>
mov    (%rbx,%r13,8),%rdi
mov    %r15,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11d0 <main+0x50>
mov    (%rbx,%r13,8),%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1240 <main+0xc0>
mov    (%rbx,%r13,8),%rdi
lea    0xe24(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    11e0 <main+0x60>
jmp    12d2 <main+0x152>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rbx,%r13,8),%r14
jmp    11e0 <main+0x60>
lea    0xdc2(%rip),%r14
movsd  0xdaa(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0xde6(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <strcat@plt>
lea    0xdcd(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1080 <printf@plt>
lea    0xddb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
movsd  0x8(%rsp),%xmm0
mulsd  0xd5a(%rip),%xmm0
call   10a0 <sleep@plt>
mov    %rbx,%rdi
call   1070 <system@plt>
mov    $0x1,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xda2(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
jmp    12c0 <main+0x140>

LLVM IR (-O0):
@.str = [44 x i8] c"https://www.youtube.com/watch?v=6GggY4TEYbk\00"
@.str.1 = [3 x i8] c"in\00"
@.str.2 = [5 x i8] c"with\00"
@.str.3 = [5 x i8] c"help\00"
@.str.4 = [209 x i8] c"remindme help:\0AA simple script to open a http link after a designated time limit.\0A\0Ain <minutes>\09sets the time limit to wait in minutes(can be a float value).\0Awith <ink>\09sets the link to open after the sleep.\0A\00"
@.str.5 = [6 x i8] c"open \00"
@.str.6 = [34 x i8] c"I will remind you in %f minutes.\0A\00"
@.str.7 = [10 x i8] c"Link: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i8*
%8 = alloca i32
%9 = alloca [256 x i8]
%10 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e+00, double* %6
store i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8** %7
store i32 1, i32* %8
br label %11
11: ; preds = %59, %2
%12 = load i32, i32* %8
%13 = load i32, i32* %4
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %62
15: ; preds = %11
%16 = load i8**, i8*** %5
%17 = load i32, i32* %8
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i64 @strncmp(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %31
23: ; preds = %15
%24 = load i8**, i8*** %5
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %24, i64 %27
%29 = load i8*, i8** %28
%30 = call double @atof(i8* %29)
store double %30, double* %6
br label %58
31: ; preds = %15
%32 = load i8**, i8*** %5
%33 = load i32, i32* %8
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %46
39: ; preds = %31
%40 = load i8**, i8*** %5
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %40, i64 %43
%45 = load i8*, i8** %44
store i8* %45, i8** %7
br label %57
46: ; preds = %31
%47 = load i8**, i8*** %5
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8*, i8** %47, i64 %49
%51 = load i8*, i8** %50
%52 = call i64 @strncmp(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %46
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %78
56: ; preds = %46
br label %57
57: ; preds = %56, %39
br label %58
58: ; preds = %57, %23
br label %59
59: ; preds = %58
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 2
store i32 %61, i32* %8
br label %11
62: ; preds = %11
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %10
%63 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%64 = load i8*, i8** %10
%65 = call i32 @strcpy(i8* %63, i8* %64)
%66 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%67 = load i8*, i8** %7
%68 = call i32 @strcat(i8* %66, i8* %67)
%69 = load double, double* %6
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), double %69)
%71 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %71)
%73 = load double, double* %6
%74 = fmul double %73, 6.000000e+01
%75 = call i32 @sleep(double %74)
%76 = getelementptr inbounds [256 x i8], [256 x i8]* %9, i64 0, i64 0
%77 = call i32 @system(i8* %76)
store i32 1, i32* %3
br label %78
78: ; preds = %62, %54
%79 = load i32, i32* %3
ret i32 %79
}

LLVM IR (-O2):
@.str = [44 x i8] c"https://www.youtube.com/watch?v=6GggY4TEYbk\00"
@.str.1 = [3 x i8] c"in\00"
@.str.2 = [5 x i8] c"with\00"
@.str.3 = [5 x i8] c"help\00"
@.str.5 = [6 x i8] c"open \00"
@.str.6 = [34 x i8] c"I will remind you in %f minutes.\0A\00"
@.str.7 = [10 x i8] c"Link: %s\0A\00"
@str = [208 x i8] c"remindme help:\0AA simple script to open a http link after a designated time limit.\0A\0Ain <minutes>\09sets the time limit to wait in minutes(can be a float value).\0Awith <ink>\09sets the link to open after the sleep.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %38
5: ; preds = %2, %32
%6 = phi i64 [ %35, %32 ], [ 1, %2 ]
%7 = phi i8* [ %34, %32 ], [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), %2 ]
%8 = phi double [ %33, %32 ], [ 1.000000e+00, %2 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %6
%10 = load i8*, i8** %9
%11 = tail call i64 @strncmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = add nuw nsw i64 %6, 1
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = tail call double @atof(i8* %16)
br label %32
18: ; preds = %5
%19 = load i8*, i8** %9
%20 = tail call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = add nuw nsw i64 %6, 1
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = load i8*, i8** %24
br label %32
26: ; preds = %18
%27 = load i8*, i8** %9
%28 = tail call i64 @strncmp(i8* %27, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 4)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([208 x i8], [208 x i8]* @str, i64 0, i64 0))
br label %49
32: ; preds = %13, %26, %22
%33 = phi double [ %17, %13 ], [ %8, %22 ], [ %8, %26 ]
%34 = phi i8* [ %7, %13 ], [ %25, %22 ], [ %7, %26 ]
%35 = add nuw i64 %6, 2
%36 = trunc i64 %35 to i32
%37 = icmp slt i32 %36, %0
br i1 %37, label %5, label %38
38: ; preds = %32, %2
%39 = phi double [ 1.000000e+00, %2 ], [ %33, %32 ]
%40 = phi i8* [ getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), %2 ], [ %34, %32 ]
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%42 = call i32 @strcpy(i8* %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%43 = call i32 @strcat(i8* %41, i8* %40)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), double %39)
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* %41)
%46 = fmul double %39, 6.000000e+01
%47 = call i32 @sleep(double %46)
%48 = call i32 @system(i8* %41)
br label %49
49: ; preds = %30, %38
%50 = phi i32 [ 1, %38 ], [ 0, %30 ]
ret i32 %50
}