#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*/ greedy_activity_selector(int *, int *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, const char *argv[]) {
  int s[11 + 1] = {0, 1, 3, 0, 5, 3, 5, 6, 8, 8, 2, 12};
  int f[11 + 1] = {0, 4, 5, 6, 7, 9, 9, 10, 11, 12, 14, 16};
  char a[20] = "";
  greedy_activity_selector(s, f, a);
  printf("%s", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x40(%rbp),%rdi
lea    -0x70(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1060 <greedy_activity_selector@plt>
lea    -0x90(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
movaps 0xef1(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeb9(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x50(%rsp),%rdi
lea    0x20(%rsp),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <greedy_activity_selector@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%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 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [12 x i32]
%7 = alloca [12 x i32]
%8 = alloca [20 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [12 x i32]* %6 to i8*
%10 = bitcast [12 x i32]* %7 to i8*
%11 = bitcast [20 x i8]* %8 to i8*
%12 = getelementptr inbounds [12 x i32], [12 x i32]* %6, i64 0, i64 0
%13 = getelementptr inbounds [12 x i32], [12 x i32]* %7, i64 0, i64 0
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%15 = call i32 @greedy_activity_selector(i32* %12, i32* %13, i8* %14)
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %16)
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 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [12 x i32]
%4 = alloca [12 x i32]
%5 = alloca [20 x i8]
%6 = bitcast [12 x i32]* %3 to i8*
%7 = bitcast [12 x i32]* %4 to i8*
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 0
%10 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 0
%11 = call i32 @greedy_activity_selector(i32* %9, i32* %10, i8* %8)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}