#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*/ alarm(int);
int /*<<< orphan*/ assert(int);
int atoi(char *);
int spawn_and_wait(int, char **);
int main(int argc, char **argv) {
  int naptime = 0;
  assert(argc > 2);
  naptime = atoi(argv[1]);
  assert(naptime > 0 && naptime < 1800);
  alarm(naptime);
  return spawn_and_wait(argc + 2, argv + 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    119a <main+0x5a>
cmpl   $0x708,-0x14(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x14(%rbp),%edi
call   1030 <alarm@plt>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
mov    -0x10(%rbp),%rsi
add    $0x10,%rsi
call   1060 <spawn_and_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x3,%ebp
setge  %dil
call   1040 <assert@plt>
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
lea    -0x1(%r14),%eax
xor    %edi,%edi
cmp    $0x707,%eax
setb   %dil
call   1040 <assert@plt>
mov    %r14d,%edi
call   1030 <alarm@plt>
add    $0x2,%ebp
add    $0x10,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <spawn_and_wait@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %2
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 1800
br label %20
20: ; preds = %17, %2
%21 = phi i1 [ false, %2 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i32, i32* %6
%25 = call i32 @alarm(i32 %24)
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 2
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = call i32 @spawn_and_wait(i32 %27, i8** %29)
ret i32 %30
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = add i32 %8, -1
%10 = icmp ult i32 %9, 1799
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @alarm(i32 %8)
%14 = add nsw i32 %0, 2
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = tail call i32 @spawn_and_wait(i32 %14, i8** %15)
ret i32 %16
}