#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*/ scanf(char *, ...);
scalar_t__ strcmp(char *, char *);
int read_vecs(int *one, double *two, double *three) {
  char line[100];
  scanf("%s %d", line, one);
  if (strcmp(line, "dim") != 0 || *one < 1) {
    return -1;
  }
  int count = *one, count2 = *one;
  scanf("%s", line);
  int i = 0;
  while (count-- != 0) {
    scanf("%lf", (two + i++));
  }
  scanf("%s", line);
  i = 0;
  while (count2-- != 0) {
    scanf("%lf", (three + i++));
  }
}


x86 assembly (clang, -O0):
<read_vecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x90(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x90(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    117a <read_vecs+0x5a>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jge    1186 <read_vecs+0x66>
movl   $0xffffffff,-0x4(%rbp)
jmp    1272 <read_vecs+0x152>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x94(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x98(%rbp)
lea    -0x90(%rbp),%rsi
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x9c(%rbp)
mov    -0x94(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x94(%rbp)
cmp    $0x0,%eax
je     1208 <read_vecs+0xe8>
mov    -0x18(%rbp),%rsi
mov    -0x9c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x9c(%rbp)
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    11bd <read_vecs+0x9d>
lea    -0x90(%rbp),%rsi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x9c(%rbp)
mov    -0x98(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x98(%rbp)
cmp    $0x0,%eax
je     1272 <read_vecs+0x152>
mov    -0x20(%rbp),%rsi
mov    -0x9c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x9c(%rbp)
cltq
shl    $0x3,%rax
add    %rax,%rsi
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    1227 <read_vecs+0x107>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_vecs>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0xec4(%rip),%rdi
mov    %rsp,%r12
mov    %r12,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rsi
mov    %r12,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    11d7 <read_vecs+0xb7>
mov    (%r15),%r12d
test   %r12d,%r12d
jle    11d7 <read_vecs+0xb7>
lea    0xe9b(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe8d(%rip),%r15
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
jne    1190 <read_vecs+0x70>
lea    0xe5d(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe4f(%rip),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x8,%r14
add    $0xffffffff,%r12d
jne    11c0 <read_vecs+0xa0>
mov    $0xffffffff,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [4 x i8] c"dim\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%lf\00"
define i32 @read_vecs(i32* %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double*
%8 = alloca [100 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store double* %1, double** %6
store double* %2, double** %7
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%13 = load i32*, i32** %5
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12, i32* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %3
%19 = load i32*, i32** %5
%20 = load i32, i32* %19
%21 = icmp slt i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %18, %3
store i32 -1, i32* %4
br label %55
23: ; preds = %18
%24 = load i32*, i32** %5
%25 = load i32, i32* %24
store i32 %25, i32* %9
%26 = load i32*, i32** %5
%27 = load i32, i32* %26
store i32 %27, i32* %10
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %28)
store i32 0, i32* %11
br label %30
30: ; preds = %34, %23
%31 = load i32, i32* %9
%32 = add nsw i32 %31, -1
store i32 %32, i32* %9
%33 = icmp ne i32 %31, 0
br i1 %33, label %34, label %41
34: ; preds = %30
%35 = load double*, double** %6
%36 = load i32, i32* %11
%37 = add nsw i32 %36, 1
store i32 %37, i32* %11
%38 = sext i32 %36 to i64
%39 = getelementptr inbounds double, double* %35, i64 %38
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %39)
br label %30
41: ; preds = %30
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %42)
store i32 0, i32* %11
br label %44
44: ; preds = %48, %41
%45 = load i32, i32* %10
%46 = add nsw i32 %45, -1
store i32 %46, i32* %10
%47 = icmp ne i32 %45, 0
br i1 %47, label %48, label %55
48: ; preds = %44
%49 = load double*, double** %7
%50 = load i32, i32* %11
%51 = add nsw i32 %50, 1
store i32 %51, i32* %11
%52 = sext i32 %50 to i64
%53 = getelementptr inbounds double, double* %49, i64 %52
%54 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %53)
br label %44
55: ; preds = %22, %44
%56 = load i32, i32* %4
ret i32 %56
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %d\00"
@.str.1 = [4 x i8] c"dim\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%lf\00"
define i32 @read_vecs(i32* %0, double* %1, double* %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i32* %0)
%7 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %32
9: ; preds = %3
%10 = load i32, i32* %0
%11 = icmp slt i32 %10, 1
br i1 %11, label %32, label %12
12: ; preds = %9
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ 0, %12 ], [ %18, %14 ]
%16 = phi i32 [ %10, %12 ], [ %17, %14 ]
%17 = add nsw i32 %16, -1
%18 = add nuw nsw i64 %15, 1
%19 = getelementptr inbounds double, double* %1, i64 %15
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %19)
%21 = icmp eq i32 %17, 0
br i1 %21, label %22, label %14
22: ; preds = %14
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
br label %24
24: ; preds = %22, %24
%25 = phi i64 [ 0, %22 ], [ %28, %24 ]
%26 = phi i32 [ %10, %22 ], [ %27, %24 ]
%27 = add nsw i32 %26, -1
%28 = add nuw nsw i64 %25, 1
%29 = getelementptr inbounds double, double* %2, i64 %25
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %29)
%31 = icmp eq i32 %27, 0
br i1 %31, label %32, label %24
32: ; preds = %24, %3, %9
ret i32 -1
}