#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*/ recursiveActivitySelector(int *, int *, int /*<<< orphan*/,
                                             int, int *, int);
int main(void) {
  int s[12] = {0, 1, 3, 0, 5, 3, 5, 6, 8, 8, 2, 12};
  int f[12] = {0, 4, 5, 6, 7, 9, 9, 10, 11, 12, 14, 16};
  int optSize = -1;
  int opt[11] = {-1};
  recursiveActivitySelector(s, f, 0, 12, opt, optSize);
  for (int i = 0; i < 12; i++) {
    printf("%d ", opt[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x30,%edx
call   1060 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x30,%edx
call   1060 <memcpy@plt>
movl   $0xffffffff,-0x74(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x2c,%edx
call   1050 <memset@plt>
movl   $0xffffffff,-0xa0(%rbp)
ff ff ff
lea    -0x40(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0xa0(%rbp),%r8
mov    -0x74(%rbp),%r9d
xor    %edx,%edx
mov    $0xc,%ecx
call   1030 <recursiveActivitySelector@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0xc,-0xa4(%rbp)
jge    1206 <main+0xc6>
movslq -0xa4(%rbp),%rax
mov    -0xa0(%rbp,%rax,4),%esi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    11c9 <main+0x89>
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movups %xmm0,0x1c(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0xffffffff,(%rsp)
lea    0x60(%rsp),%rdi
lea    0x30(%rsp),%rsi
mov    %rsp,%r8
xor    %edx,%edx
mov    $0xc,%ecx
mov    $0xffffffff,%r9d
call   1040 <recursiveActivitySelector@plt>
mov    (%rsp),%esi
lea    0xe9c(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [12 x i32] [i32 0, i32 1, i32 3, i32 0, i32 5, i32 3, i32 5, i32 6, i32 8, i32 8, i32 2, i32 12]
@__const.main.f = [12 x i32] [i32 0, i32 4, i32 5, i32 6, i32 7, i32 9, i32 9, i32 10, i32 11, i32 12, i32 14, i32 16]
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i32]
%3 = alloca [12 x i32]
%4 = alloca i32
%5 = alloca [11 x i32]
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [12 x i32]* %2 to i8*
%8 = bitcast [12 x i32]* %3 to i8*
store i32 -1, i32* %4
%9 = bitcast [11 x i32]* %5 to i8*
%10 = bitcast i8* %9 to <{ i32, [10 x i32] }>*
%11 = getelementptr inbounds <{ i32, [10 x i32] }>, <{ i32, [10 x i32] }>* %10, i32 0, i32 0
store i32 -1, i32* %11
%12 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%13 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%14 = getelementptr inbounds [11 x i32], [11 x i32]* %5, i64 0, i64 0
%15 = load i32, i32* %4
%16 = call i32 @recursiveActivitySelector(i32* %12, i32* %13, i32 0, i32 12, i32* %14, i32 %15)
store i32 0, i32* %6
br label %17
17: ; preds = %26, %0
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 12
br i1 %19, label %20, label %29
20: ; preds = %17
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [11 x i32], [11 x i32]* %5, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %26
26: ; preds = %20
%27 = load i32, i32* %6
%28 = add nsw i32 %27, 1
store i32 %28, i32* %6
br label %17
29: ; preds = %17
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [12 x i32] [i32 0, i32 1, i32 3, i32 0, i32 5, i32 3, i32 5, i32 6, i32 8, i32 8, i32 2, i32 12]
@__const.main.f = [12 x i32] [i32 0, i32 4, i32 5, i32 6, i32 7, i32 9, i32 9, i32 10, i32 11, i32 12, i32 14, i32 16]
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [12 x i32]
%2 = alloca [12 x i32]
%3 = alloca [11 x i32]
%4 = bitcast [12 x i32]* %1 to i8*
%5 = bitcast [12 x i32]* %2 to i8*
%6 = bitcast [11 x i32]* %3 to i8*
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 0
store i32 -1, i32* %7
%8 = getelementptr inbounds [12 x i32], [12 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 0
%10 = call i32 @recursiveActivitySelector(i32* %8, i32* %9, i32 0, i32 12, i32* %7, i32 -1)
%11 = load i32, i32* %7
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 1
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 2
%17 = load i32, i32* %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 3
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 4
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 5
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 6
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 7
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 8
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 9
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 10
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [11 x i32], [11 x i32]* %3, i64 0, i64 11
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %44)
%46 = call i32 @putchar(i32 10)
ret i32 0
}