#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 *, int *);
short nove() {
  short cont = 10, neg;
  int num[cont];
  for (cont = 1; cont <= 10; cont++) {
    scanf("%d", &num[cont]);
    if (num[cont] < 0)
      neg++;
  }
  return neg;
}


x86 assembly (clang, -O0):
<nove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movw   $0xa,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
mov    %edx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %edx,%ecx
lea    0xf(,%rcx,4),%edx
mov    %edx,%ecx
and    $0xfffffff0,%ecx
mov    %ecx,%edx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movw   $0x1,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0xa,%eax
jg     11b0 <nove+0xa0>
mov    -0x20(%rbp),%rsi
movswq -0x2(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe8a(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x20(%rbp),%rax
movswq -0x2(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    119a <nove+0x8a>
mov    -0x4(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x4(%rbp)
jmp    119f <nove+0x8f>
mov    -0x2(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x2(%rbp)
jmp    1152 <nove+0x42>
mov    -0x4(%rbp),%ax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
cwtl
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nove>:
push   %rbx
sub    $0x30,%rsp
lea    0x4(%rsp),%rsi
lea    0xedf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <scanf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define signext i16 @nove() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i8*
%4 = alloca i64
store i16 10, i16* %1
%5 = load i16, i16* %1
%6 = zext i16 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i32, i64 %6
store i64 %6, i64* %4
store i16 1, i16* %1
br label %9
9: ; preds = %27, %0
%10 = load i16, i16* %1
%11 = sext i16 %10 to i32
%12 = icmp sle i32 %11, 10
br i1 %12, label %13, label %30
13: ; preds = %9
%14 = load i16, i16* %1
%15 = sext i16 %14 to i64
%16 = getelementptr inbounds i32, i32* %8, i64 %15
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%18 = load i16, i16* %1
%19 = sext i16 %18 to i64
%20 = getelementptr inbounds i32, i32* %8, i64 %19
%21 = load i32, i32* %20
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %13
%24 = load i16, i16* %2
%25 = add i16 %24, 1
store i16 %25, i16* %2
br label %26
26: ; preds = %23, %13
br label %27
27: ; preds = %26
%28 = load i16, i16* %1
%29 = add i16 %28, 1
store i16 %29, i16* %1
br label %9
30: ; preds = %9
%31 = load i16, i16* %2
%32 = load i8*, i8** %3
ret i16 %31
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define signext i16 @nove() {
%1 = alloca [10 x i32]
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %10)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %12)
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %16)
%18 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %18)
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %20)
ret i16 undef
}