#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*/ IsRowSymmetric(int *);
int /*<<< orphan*/ printf(char *, ...);
void TaskB(int **PixelStorage) {
  printf("\nZadanie 6.2\n");
  printf("----------------------------------------------------\n");
  int RowCounter = 0;
  int CurrentIndex = 0;
  while (CurrentIndex < 200) {
    RowCounter = RowCounter + (!IsRowSymmetric(PixelStorage[CurrentIndex]));
    CurrentIndex++;
  }
  printf("Liczba wierszy do usuniecia: %d\n", RowCounter);
}


x86 assembly (clang, -O0):
<TaskB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xc8,-0x10(%rbp)
jge    11a1 <TaskB+0x81>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <IsRowSymmetric@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1156 <TaskB+0x36>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TaskB>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
lea    0xee4(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <IsRowSymmetric@plt>
cmp    $0x1,%eax
adc    $0x0,%ebp
add    $0x1,%rbx
cmp    $0xc8,%rbx
jne    1160 <TaskB+0x30>
lea    0xe7d(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0AZadanie 6.2\0A\00"
@.str.1 = [54 x i8] c"----------------------------------------------------\0A\00"
@.str.2 = [33 x i8] c"Liczba wierszy do usuniecia: %d\0A\00"
define void @TaskB(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32
store i32** %0, i32*** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
store i32 0, i32* %4
br label %7
7: ; preds = %10, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 200
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %3
%12 = load i32**, i32*** %2
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32*, i32** %12, i64 %14
%16 = load i32*, i32** %15
%17 = call i32 @IsRowSymmetric(i32* %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = zext i1 %19 to i32
%21 = add nsw i32 %11, %20
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %7
24: ; preds = %7
%25 = load i32, i32* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %25)
ret void
}

LLVM IR (-O2):
@.str.2 = [33 x i8] c"Liczba wierszy do usuniecia: %d\0A\00"
@str = [13 x i8] c"\0AZadanie 6.2\00"
@str.3 = [53 x i8] c"----------------------------------------------------\00"
define void @TaskB(i32** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.3, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %13, %4 ]
%6 = phi i32 [ 0, %1 ], [ %12, %4 ]
%7 = getelementptr inbounds i32*, i32** %0, i64 %5
%8 = load i32*, i32** %7
%9 = tail call i32 @IsRowSymmetric(i32* %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = add nuw nsw i32 %6, %11
%13 = add nuw nsw i64 %5, 1
%14 = icmp eq i64 %13, 200
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret void
}