#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*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void read_numbers_into_vector(char *string, int number, int *list) {
  char *ptr;
  int loop;
  ptr = string;
  loop = 0;
  while ((*ptr) != '\0') {
    switch (*(ptr++)) {
    case '0':
      list[loop++] = 0;
      break;
    case '1':
      list[loop++] = 1;
      break;
    default:
      break;
    }
  };
  if (loop != number) {
    printf("\n Error: Wrong input data in Start vector mixture!!");
    printf("\nNumber of start vectors mixture = %d   found = %d\n", number,
           loop);
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<read_numbers_into_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11cc <read_numbers_into_vector+0xac>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x28(%rbp)
sub    $0x30,%eax
je     1186 <read_numbers_into_vector+0x66>
jmp    1175 <read_numbers_into_vector+0x55>
mov    -0x28(%rbp),%eax
sub    $0x31,%eax
je     11a4 <read_numbers_into_vector+0x84>
jmp    11c2 <read_numbers_into_vector+0xa2>
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    11c7 <read_numbers_into_vector+0xa7>
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    11c7 <read_numbers_into_vector+0xa7>
jmp    11c7 <read_numbers_into_vector+0xa7>
jmp    1142 <read_numbers_into_vector+0x22>
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1204 <read_numbers_into_vector+0xe4>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_numbers_into_vector>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    (%rdi),%al
test   %al,%al
je     116d <read_numbers_into_vector+0x4d>
add    $0x1,%rdi
xor    %ebp,%ebp
jmp    1154 <read_numbers_into_vector+0x34>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movslq %ebp,%rcx
add    $0x1,%ebp
mov    %eax,(%rdx,%rcx,4)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     116f <read_numbers_into_vector+0x4f>
movsbl %al,%ecx
mov    $0x0,%eax
cmp    $0x30,%ecx
je     1140 <read_numbers_into_vector+0x20>
cmp    $0x31,%ecx
jne    1149 <read_numbers_into_vector+0x29>
mov    $0x1,%eax
jmp    1140 <read_numbers_into_vector+0x20>
xor    %ebp,%ebp
cmp    %ebx,%ebp
jne    117a <read_numbers_into_vector+0x5a>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A Error: Wrong input data in Start vector mixture!!\00"
@.str.1 = [52 x i8] c"\0ANumber of start vectors mixture = %d found = %d\0A\00"
define void @read_numbers_into_vector(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = load i8*, i8** %4
store i8* %9, i8** %7
store i32 0, i32* %8
br label %10
10: ; preds = %33, %3
%11 = load i8*, i8** %7
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %34
15: ; preds = %10
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %7
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
switch i32 %19, label %32 [
i32 48, label %20
i32 49, label %26
]
20: ; preds = %15
%21 = load i32*, i32** %6
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
%24 = sext i32 %22 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
store i32 0, i32* %25
br label %33
26: ; preds = %15
%27 = load i32*, i32** %6
%28 = load i32, i32* %8
%29 = add nsw i32 %28, 1
store i32 %29, i32* %8
%30 = sext i32 %28 to i64
%31 = getelementptr inbounds i32, i32* %27, i64 %30
store i32 1, i32* %31
br label %33
32: ; preds = %15
br label %33
33: ; preds = %32, %26, %20
br label %10
34: ; preds = %10
%35 = load i32, i32* %8
%36 = load i32, i32* %5
%37 = icmp ne i32 %35, %36
br i1 %37, label %38, label %44
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%40 = load i32, i32* %5
%41 = load i32, i32* %8
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %40, i32 %41)
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %34
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0A Error: Wrong input data in Start vector mixture!!\00"
@.str.1 = [52 x i8] c"\0ANumber of start vectors mixture = %d found = %d\0A\00"
define void @read_numbers_into_vector(i8* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %22, label %6
6: ; preds = %3, %18
%7 = phi i8 [ %20, %18 ], [ %4, %3 ]
%8 = phi i32 [ %19, %18 ], [ 0, %3 ]
%9 = phi i8* [ %11, %18 ], [ %0, %3 ]
%10 = sext i8 %7 to i32
%11 = getelementptr inbounds i8, i8* %9, i64 1
switch i32 %10, label %18 [
i32 48, label %13
i32 49, label %12
]
12: ; preds = %6
br label %13
13: ; preds = %6, %12
%14 = phi i32 [ 1, %12 ], [ 0, %6 ]
%15 = add nsw i32 %8, 1
%16 = sext i32 %8 to i64
%17 = getelementptr inbounds i32, i32* %2, i64 %16
store i32 %14, i32* %17
br label %18
18: ; preds = %13, %6
%19 = phi i32 [ %8, %6 ], [ %15, %13 ]
%20 = load i8, i8* %11
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %6
22: ; preds = %18, %3
%23 = phi i32 [ 0, %3 ], [ %19, %18 ]
%24 = icmp eq i32 %23, %1
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %23)
%28 = tail call i32 @exit(i32 1)
unreachable
29: ; preds = %22
ret void
}