#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 /*<<< orphan*/ scanf(char *, int *, int *, int *, int *, int *, int *);
int main() {
  int tablica[6];
  scanf("%d %d %d %d %d %d", &tablica[0], &tablica[1], &tablica[2], &tablica[3],
        &tablica[4], &tablica[5]);
  printf("Tablica %d %d %d %d %d %d\n", tablica[0], tablica[1], tablica[2],
         tablica[3], tablica[4], tablica[5]);
  int ldod = 0;
  for (int x = 0; x < 6; x++) {
    int tab = tablica[x];
    if (tab > 0) {
      ldod++;
    }
  }
  printf("liczba dodatnich cyfr = [ %d ]\n", ldod);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x4,%rdx
lea    -0x20(%rbp),%rcx
add    $0x8,%rcx
lea    -0x20(%rbp),%r8
add    $0xc,%r8
lea    -0x20(%rbp),%r9
add    $0x10,%r9
lea    -0x20(%rbp),%rax
add    $0x14,%rax
lea    0xe9e(%rip),%rdi
mov    %rax,(%rsp)
call   1040 <scanf@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0xc(%rbp),%eax
lea    0xe8c(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x6,-0x28(%rbp)
jge    11d9 <main+0xb9>
movslq -0x28(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    11c6 <main+0xa6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cb <main+0xab>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    119e <main+0x7e>
mov    -0x24(%rbp),%esi
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x1c(%rsp),%r8
lea    0x20(%rsp),%r9
lea    0x24(%rsp),%rax
mov    %rax,(%rsp)
lea    0xeb8(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
mov    0x20(%rsp),%r9d
mov    0x24(%rsp),%eax
mov    %eax,(%rsp)
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movdqa 0x10(%rsp),%xmm0
pxor   %xmm1,%xmm1
xor    %edi,%edi
cmpl   $0x0,0x20(%rsp)
setg   %dil
xor    %ecx,%ecx
cmpl   $0x0,0x24(%rsp)
pcmpgtd %xmm1,%xmm0
setg   %cl
movmskps %xmm0,%edx
mov    %edx,%eax
shr    %al
and    $0x5,%al
sub    %al,%dl
mov    %edx,%eax
and    $0x33,%al
shr    $0x2,%dl
and    $0x33,%dl
add    %al,%dl
mov    %edx,%eax
shr    $0x4,%al
add    %dl,%al
and    $0xf,%al
movzbl %al,%esi
add    %edi,%esi
add    %ecx,%esi
lea    0xe5f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%d %d %d %d %d %d\00"
@.str.1 = [27 x i8] c"Tablica %d %d %d %d %d %d\0A\00"
@.str.2 = [32 x i8] c"liczba dodatnich cyfr = [ %d ]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 1
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
%9 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 3
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
%11 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 5
%12 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i32* %8, i32* %9, i32* %10, i32* %11)
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%14 = load i32, i32* %13
%15 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 1
%16 = load i32, i32* %15
%17 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
%18 = load i32, i32* %17
%19 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 3
%20 = load i32, i32* %19
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
%22 = load i32, i32* %21
%23 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 5
%24 = load i32, i32* %23
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %16, i32 %18, i32 %20, i32 %22, i32 %24)
store i32 0, i32* %3
store i32 0, i32* %4
br label %26
26: ; preds = %40, %0
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 6
br i1 %28, label %29, label %43
29: ; preds = %26
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 %31
%33 = load i32, i32* %32
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = icmp sgt i32 %34, 0
br i1 %35, label %36, label %39
36: ; preds = %29
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %39
39: ; preds = %36, %29
br label %40
40: ; preds = %39
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
store i32 %42, i32* %4
br label %26
43: ; preds = %26
%44 = load i32, i32* %3
%45 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %1
ret i32 %46
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d %d %d %d %d %d\00"
@.str.1 = [27 x i8] c"Tablica %d %d %d %d %d %d\0A\00"
@.str.2 = [32 x i8] c"liczba dodatnich cyfr = [ %d ]\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 1
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 2
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 3
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 4
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 5
%9 = call i32 @scanf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13, i32 %14, i32 %15)
%17 = bitcast [6 x i32]* %1 to <4 x i32>*
%18 = load <4 x i32>, <4 x i32>* %17
%19 = icmp sgt <4 x i32> %18, zeroinitializer
%20 = load i32, i32* %7
%21 = icmp sgt i32 %20, 0
%22 = zext i1 %21 to i32
%23 = load i32, i32* %8
%24 = icmp sgt i32 %23, 0
%25 = zext i1 %24 to i32
%26 = bitcast <4 x i1> %19 to i4
%27 = call i4 @llvm.ctpop.i4(i4 %26)
%28 = zext i4 %27 to i32
%29 = add nuw nsw i32 %28, %22
%30 = add nuw nsw i32 %29, %25
%31 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %30)
ret i32 0
}