#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);
int main() {
  int v[100];
  v[0] = 1, v[1] = 3, v[2] = 5;
  int vn = 3;
  int s = 11;
  int i, j;
  int c[100];
  for (i = 0; i < 100; i++) {
    c[i] = 1000000000;
  }
  c[0] = 0;
  for (i = 1; i <= s; i++) {
    for (j = 0; j < vn; j++) {
      if (v[j] <= i && c[i - v[j]] + 1 < c[i]) {
        c[i] = c[i - v[j]] + 1;
      }
    }
  }
  printf("%d\n", c[s]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x1a0(%rbp)
movl   $0x3,-0x19c(%rbp)
movl   $0x5,-0x198(%rbp)
movl   $0x3,-0x1a4(%rbp)
movl   $0xb,-0x1a8(%rbp)
movl   $0x0,-0x1ac(%rbp)
cmpl   $0x64,-0x1ac(%rbp)
jge    1191 <main+0x81>
movslq -0x1ac(%rbp),%rax
movl   $0x3b9aca00,-0x340(%rbp,%rax,4)
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    115e <main+0x4e>
movl   $0x0,-0x340(%rbp)
movl   $0x1,-0x1ac(%rbp)
mov    -0x1ac(%rbp),%eax
cmp    -0x1a8(%rbp),%eax
jg     1281 <main+0x171>
movl   $0x0,-0x1b0(%rbp)
mov    -0x1b0(%rbp),%eax
cmp    -0x1a4(%rbp),%eax
jge    1268 <main+0x158>
movslq -0x1b0(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%eax
cmp    -0x1ac(%rbp),%eax
jg     124f <main+0x13f>
mov    -0x1ac(%rbp),%eax
movslq -0x1b0(%rbp),%rcx
sub    -0x1a0(%rbp,%rcx,4),%eax
cltq
mov    -0x340(%rbp,%rax,4),%eax
add    $0x1,%eax
movslq -0x1ac(%rbp),%rcx
cmp    -0x340(%rbp,%rcx,4),%eax
jge    124f <main+0x13f>
mov    -0x1ac(%rbp),%eax
movslq -0x1b0(%rbp),%rcx
sub    -0x1a0(%rbp,%rcx,4),%eax
cltq
mov    -0x340(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movslq -0x1ac(%rbp),%rax
mov    %ecx,-0x340(%rbp,%rax,4)
jmp    1254 <main+0x144>
mov    -0x1b0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b0(%rbp)
jmp    11c1 <main+0xb1>
jmp    126d <main+0x15d>
mov    -0x1ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ac(%rbp)
jmp    11a5 <main+0x95>
movslq -0x1a8(%rbp),%rax
mov    -0x340(%rbp,%rax,4),%esi
lea    0xd6a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x198,%rsp
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x180(%rsp)
movl   $0x0,(%rsp)
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
mov    $0x1,%ecx
cmovl  %eax,%ecx
mov    0x8(%rsp),%eax
mov    %ecx,0x4(%rsp)
add    $0x1,%ecx
cmp    %eax,%ecx
cmovge %eax,%ecx
mov    %ecx,0x8(%rsp)
mov    $0x3,%eax
xor    %ecx,%ecx
movabs $0x200000000,%r9
movabs $0x100000000,%rsi
movabs $0xfffffffe00000000,%r8
ff ff ff
jmp    122d <main+0x11d>
xchg   %ax,%ax
add    $0x1,%rax
add    %rsi,%rcx
cmp    $0xc,%rax
je     127c <main+0x16c>
lea    (%rcx,%r9,1),%rdi
sar    $0x1e,%rdi
mov    (%rsp,%rdi,1),%edi
add    $0x1,%edi
mov    (%rsp,%rax,4),%edx
cmp    %edx,%edi
cmovge %edx,%edi
mov    %edi,(%rsp,%rax,4)
mov    %rcx,%rdx
sar    $0x1e,%rdx
mov    (%rsp,%rdx,1),%edx
add    $0x1,%edx
cmp    %edi,%edx
cmovge %edi,%edx
mov    %edx,(%rsp,%rax,4)
cmp    $0x5,%rax
jb     1220 <main+0x110>
lea    (%rcx,%r8,1),%rdx
sar    $0x1e,%rdx
mov    (%rsp,%rdx,1),%edx
add    $0x1,%edx
mov    (%rsp,%rax,4),%edi
cmp    %edi,%edx
cmovge %edi,%edx
mov    %edx,(%rsp,%rax,4)
jmp    1220 <main+0x110>
mov    0x2c(%rsp),%esi
lea    0xd89(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x198,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x i32]
store i32 0, i32* %1
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
store i32 1, i32* %8
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 1
store i32 3, i32* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 2
store i32 5, i32* %10
store i32 3, i32* %3
store i32 11, i32* %4
store i32 0, i32* %5
br label %11
11: ; preds = %18, %0
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %16
store i32 1000000000, i32* %17
br label %18
18: ; preds = %14
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %11
21: ; preds = %11
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 0
store i32 0, i32* %22
store i32 1, i32* %5
br label %23
23: ; preds = %74, %21
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = icmp sle i32 %24, %25
br i1 %26, label %27, label %77
27: ; preds = %23
store i32 0, i32* %6
br label %28
28: ; preds = %70, %27
%29 = load i32, i32* %6
%30 = load i32, i32* %3
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %73
32: ; preds = %28
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = load i32, i32* %5
%38 = icmp sle i32 %36, %37
br i1 %38, label %39, label %69
39: ; preds = %32
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = sub nsw i32 %40, %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = add nsw i32 %48, 1
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = icmp slt i32 %49, %53
br i1 %54, label %55, label %69
55: ; preds = %39
%56 = load i32, i32* %5
%57 = load i32, i32* %6
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %58
%60 = load i32, i32* %59
%61 = sub nsw i32 %56, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %62
%64 = load i32, i32* %63
%65 = add nsw i32 %64, 1
%66 = load i32, i32* %5
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %67
store i32 %65, i32* %68
br label %69
69: ; preds = %55, %39, %32
br label %70
70: ; preds = %69
%71 = load i32, i32* %6
%72 = add nsw i32 %71, 1
store i32 %72, i32* %6
br label %28
73: ; preds = %28
br label %74
74: ; preds = %73
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %5
br label %23
77: ; preds = %23
%78 = load i32, i32* %4
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [100 x i32], [100 x i32]* %7, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %81)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = bitcast [100 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %3
%4 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 4
%5 = bitcast i32* %4 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %5
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 8
%7 = bitcast i32* %6 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %7
%8 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 12
%9 = bitcast i32* %8 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %9
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 16
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %11
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 20
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %13
%14 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 24
%15 = bitcast i32* %14 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %15
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 28
%17 = bitcast i32* %16 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %17
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 32
%19 = bitcast i32* %18 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %19
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 36
%21 = bitcast i32* %20 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %21
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 40
%23 = bitcast i32* %22 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %23
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 44
%25 = bitcast i32* %24 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %25
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 48
%27 = bitcast i32* %26 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %27
%28 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 52
%29 = bitcast i32* %28 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %29
%30 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 56
%31 = bitcast i32* %30 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %31
%32 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 60
%33 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %33
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 64
%35 = bitcast i32* %34 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %35
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 68
%37 = bitcast i32* %36 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %37
%38 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 72
%39 = bitcast i32* %38 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %39
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 76
%41 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %41
%42 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 80
%43 = bitcast i32* %42 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %43
%44 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 84
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %45
%46 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 88
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %47
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 92
%49 = bitcast i32* %48 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %49
%50 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 96
%51 = bitcast i32* %50 to <4 x i32>*
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, <4 x i32>* %51
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
store i32 0, i32* %52
%53 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 1
%54 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
%55 = load i32, i32* %54
%56 = add nsw i32 %55, 1
%57 = load i32, i32* %53
%58 = icmp slt i32 %56, %57
%59 = select i1 %58, i32 %56, i32 %57
store i32 %59, i32* %53
%60 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 2
%61 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 1
%62 = load i32, i32* %61
%63 = add nsw i32 %62, 1
%64 = load i32, i32* %60
%65 = icmp slt i32 %63, %64
%66 = select i1 %65, i32 %63, i32 %64
store i32 %66, i32* %60
br label %67
67: ; preds = %0, %99
%68 = phi i64 [ 3, %0 ], [ %100, %99 ]
%69 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %68
%70 = shl i64 %68, 32
%71 = add nsw i64 %70, -4294967296
%72 = ashr exact i64 %71, 32
%73 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %72
%74 = load i32, i32* %73
%75 = add nsw i32 %74, 1
%76 = load i32, i32* %69
%77 = icmp slt i32 %75, %76
%78 = select i1 %77, i32 %75, i32 %76
store i32 %78, i32* %69
%79 = shl i64 %68, 32
%80 = add nsw i64 %79, -12884901888
%81 = ashr exact i64 %80, 32
%82 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %81
%83 = load i32, i32* %82
%84 = add nsw i32 %83, 1
%85 = load i32, i32* %69
%86 = icmp slt i32 %84, %85
%87 = select i1 %86, i32 %84, i32 %85
store i32 %87, i32* %69
%88 = icmp ult i64 %68, 5
br i1 %88, label %99, label %89
89: ; preds = %67
%90 = shl i64 %68, 32
%91 = add nsw i64 %90, -21474836480
%92 = ashr exact i64 %91, 32
%93 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = add nsw i32 %94, 1
%96 = load i32, i32* %69
%97 = icmp slt i32 %95, %96
%98 = select i1 %97, i32 %95, i32 %96
store i32 %98, i32* %69
br label %99
99: ; preds = %89, %67
%100 = add nuw nsw i64 %68, 1
%101 = icmp eq i64 %100, 12
br i1 %101, label %102, label %67
102: ; preds = %99
%103 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 11
%104 = load i32, i32* %103
%105 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %104)
ret i32 0
}