#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*/ atoi(char *);
int /*<<< orphan*/ free(char **);
int getopt(int, char **, char *);
char *optarg;
scalar_t__ opterr;
char **parse_command(char *);
int /*<<< orphan*/ print_error(int);
int run_command(char **);
int /*<<< orphan*/ set_limits(int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int opt = 0;
  int exit_code = 0;
  char *time_value = NULL;
  char *mem_value = NULL;
  char *command = NULL;
  char **split_command;
  opterr = 0;
  while ((opt = getopt(argc, argv, "t:m:c:")) != -1) {
    switch (opt) {
    case 't':
      time_value = optarg;
      break;
    case 'm':
      mem_value = optarg;
      break;
    case 'c':
      command = optarg;
      break;
    case '?':
      print_error(opt);
      break;
    default:
      break;
    }
  }
  set_limits(atoi(time_value), atoi(mem_value));
  split_command = parse_command(command);
  exit_code = run_command(split_command);
  free(split_command);
  return exit_code;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    0x2e25(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe38(%rip),%rdx
call   1070 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1270 <main+0x100>
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x3f,%eax
je     1259 <main+0xe9>
jmp    11ed <main+0x7d>
mov    -0x3c(%rbp),%eax
sub    $0x63,%eax
je     1246 <main+0xd6>
jmp    11fe <main+0x8e>
mov    -0x3c(%rbp),%eax
sub    $0x6d,%eax
je     1233 <main+0xc3>
jmp    120f <main+0x9f>
mov    -0x3c(%rbp),%eax
sub    $0x74,%eax
jne    1266 <main+0xf6>
jmp    1220 <main+0xb0>
mov    0x2dd1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    126b <main+0xfb>
mov    0x2dbe(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    126b <main+0xfb>
mov    0x2dab(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
jmp    126b <main+0xfb>
mov    -0x14(%rbp),%edi
call   1040 <print_error@plt>
jmp    126b <main+0xfb>
jmp    126b <main+0xfb>
jmp    11ba <main+0x4a>
mov    -0x20(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
call   1080 <atoi@plt>
mov    -0x40(%rbp),%edi
mov    %eax,%esi
call   1090 <set_limits@plt>
mov    -0x30(%rbp),%rdi
call   1060 <parse_command@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <run_command@plt>
mov    %eax,-0x18(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e51(%rip),%rax
movq   $0x0,(%rax)
xor    %r15d,%r15d
lea    0xe68(%rip),%r13
xor    %r12d,%r12d
xor    %r14d,%r14d
jmp    11aa <main+0x3a>
mov    $0x3f,%edi
call   1040 <print_error@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1070 <getopt@plt>
cmp    $0x62,%eax
jg     11d0 <main+0x60>
cmp    $0x3f,%eax
je     11a0 <main+0x30>
cmp    $0xffffffff,%eax
jne    11aa <main+0x3a>
jmp    1203 <main+0x93>
nopl   0x0(%rax,%rax,1)
cmp    $0x63,%eax
je     11eb <main+0x7b>
cmp    $0x6d,%eax
je     11f7 <main+0x87>
cmp    $0x74,%eax
jne    11aa <main+0x3a>
mov    0x2e12(%rip),%rax
mov    (%rax),%r15
jmp    11aa <main+0x3a>
mov    0x2e06(%rip),%rax
mov    (%rax),%r14
jmp    11aa <main+0x3a>
mov    0x2dfa(%rip),%rax
mov    (%rax),%r12
jmp    11aa <main+0x3a>
mov    %r15,%rdi
call   1080 <atoi@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1080 <atoi@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1090 <set_limits@plt>
mov    %r14,%rdi
call   1060 <parse_command@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <run_command@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@opterr = global i64 0
@.str = [7 x i8] c"t:m:c:\00"
@optarg = global i8* null
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
store i64 0, i64* @opterr
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @getopt(i32 %13, i8** %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 %15, i32* %6
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %30
17: ; preds = %12
%18 = load i32, i32* %6
switch i32 %18, label %28 [
i32 116, label %19
i32 109, label %21
i32 99, label %23
i32 63, label %25
]
19: ; preds = %17
%20 = load i8*, i8** @optarg
store i8* %20, i8** %8
br label %29
21: ; preds = %17
%22 = load i8*, i8** @optarg
store i8* %22, i8** %9
br label %29
23: ; preds = %17
%24 = load i8*, i8** @optarg
store i8* %24, i8** %10
br label %29
25: ; preds = %17
%26 = load i32, i32* %6
%27 = call i32 @print_error(i32 %26)
br label %29
28: ; preds = %17
br label %29
29: ; preds = %28, %25, %23, %21, %19
br label %12
30: ; preds = %12
%31 = load i8*, i8** %8
%32 = call i32 @atoi(i8* %31)
%33 = load i8*, i8** %9
%34 = call i32 @atoi(i8* %33)
%35 = call i32 @set_limits(i32 %32, i32 %34)
%36 = load i8*, i8** %10
%37 = call i8** @parse_command(i8* %36)
store i8** %37, i8*** %11
%38 = load i8**, i8*** %11
%39 = call i32 @run_command(i8** %38)
store i32 %39, i32* %7
%40 = load i8**, i8*** %11
%41 = call i32 @free(i8** %40)
%42 = load i32, i32* %7
ret i32 %42
}

LLVM IR (-O2):
@opterr = global i64 0
@.str = [7 x i8] c"t:m:c:\00"
@optarg = global i8* null
define i32 @main(i32 %0, i8** %1) {
store i64 0, i64* @opterr
br label %3
3: ; preds = %15, %2
%4 = phi i8* [ %16, %15 ], [ null, %2 ]
%5 = phi i8* [ %8, %15 ], [ null, %2 ]
%6 = phi i8* [ %11, %15 ], [ null, %2 ]
br label %7
7: ; preds = %3, %17
%8 = phi i8* [ %5, %3 ], [ %18, %17 ]
%9 = phi i8* [ %6, %3 ], [ %11, %17 ]
br label %10
10: ; preds = %7, %19
%11 = phi i8* [ %9, %7 ], [ %20, %19 ]
br label %12
12: ; preds = %14, %10
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
switch i32 %13, label %14 [
i32 -1, label %23
i32 116, label %15
i32 109, label %17
i32 99, label %19
i32 63, label %21
]
14: ; preds = %12, %21
br label %12
15: ; preds = %12
%16 = load i8*, i8** @optarg
br label %3
17: ; preds = %12
%18 = load i8*, i8** @optarg
br label %7
19: ; preds = %12
%20 = load i8*, i8** @optarg
br label %10
21: ; preds = %12
%22 = tail call i32 @print_error(i32 63)
br label %14
23: ; preds = %12
%24 = tail call i32 @atoi(i8* %4)
%25 = tail call i32 @atoi(i8* %8)
%26 = tail call i32 @set_limits(i32 %24, i32 %25)
%27 = tail call i8** @parse_command(i8* %11)
%28 = tail call i32 @run_command(i8** %27)
%29 = tail call i32 @free(i8** %27)
ret i32 %28
}