#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 */
scalar_t__ verifica_parola(char *, char **, int **, int, int);
int verifica(char parola[], char schema[][5]) {
  int r, c;
  int flags[5][5] = {0};
  for (r = 0; r < 5; r++) {
    for (c = 0; c < 5; c++) {
      if (verifica_parola(parola, schema, flags, r, c)) {
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<verifica>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
jge    11bf <verifica+0x9f>
movl   $0x0,-0x20(%rbp)
cmpl   $0x5,-0x20(%rbp)
jge    11ac <verifica+0x8c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1040 <verifica_parola@plt>
cmp    $0x0,%rax
je     1199 <verifica+0x79>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <verifica+0xa6>
jmp    119e <verifica+0x7e>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115e <verifica+0x3e>
jmp    11b1 <verifica+0x91>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <verifica+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifica>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
xor    %ebp,%ebp
mov    %rsp,%r15
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
xor    %r8d,%r8d
call   1030 <verifica_parola@plt>
test   %rax,%rax
jne    11f5 <verifica+0xe5>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
mov    $0x1,%r8d
call   1030 <verifica_parola@plt>
test   %rax,%rax
jne    11fb <verifica+0xeb>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
mov    $0x2,%r8d
call   1030 <verifica_parola@plt>
test   %rax,%rax
jne    11fb <verifica+0xeb>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
mov    $0x3,%r8d
call   1030 <verifica_parola@plt>
test   %rax,%rax
jne    11fb <verifica+0xeb>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %ebp,%ecx
mov    $0x4,%r8d
call   1030 <verifica_parola@plt>
test   %rax,%rax
jne    11fb <verifica+0xeb>
add    $0x1,%ebp
cmp    $0x5,%ebp
jne    1160 <verifica+0x50>
xor    %r12d,%r12d
jmp    11fb <verifica+0xeb>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @verifica(i8* %0, [5 x i8]* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [5 x i8]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca [5 x [5 x i32]]
store i8* %0, i8** %4
store [5 x i8]* %1, [5 x i8]** %5
%9 = bitcast [5 x [5 x i32]]* %8 to i8*
store i32 0, i32* %6
br label %10
10: ; preds = %33, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %36
13: ; preds = %10
store i32 0, i32* %7
br label %14
14: ; preds = %29, %13
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %32
17: ; preds = %14
%18 = load i8*, i8** %4
%19 = load [5 x i8]*, [5 x i8]** %5
%20 = bitcast [5 x i8]* %19 to i8**
%21 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %8, i64 0, i64 0
%22 = bitcast [5 x i32]* %21 to i32**
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = call i64 @verifica_parola(i8* %18, i8** %20, i32** %22, i32 %23, i32 %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %17
store i32 1, i32* %3
br label %37
28: ; preds = %17
br label %29
29: ; preds = %28
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %14
32: ; preds = %14
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %10
36: ; preds = %10
store i32 0, i32* %3
br label %37
37: ; preds = %36, %27
%38 = load i32, i32* %3
ret i32 %38
}

LLVM IR (-O2):
define i32 @verifica(i8* %0, [5 x i8]* %1) {
%3 = alloca [5 x [5 x i32]]
%4 = bitcast [5 x [5 x i32]]* %3 to i8*
%5 = bitcast [5 x i8]* %1 to i8**
%6 = bitcast [5 x [5 x i32]]* %3 to i32**
br label %7
7: ; preds = %2, %23
%8 = phi i32 [ 0, %2 ], [ %24, %23 ]
%9 = call i64 @verifica_parola(i8* %0, i8** %5, i32** %6, i32 %8, i32 0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %7
%12 = call i64 @verifica_parola(i8* %0, i8** %5, i32** %6, i32 %8, i32 1)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %11
%15 = call i64 @verifica_parola(i8* %0, i8** %5, i32** %6, i32 %8, i32 2)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = call i64 @verifica_parola(i8* %0, i8** %5, i32** %6, i32 %8, i32 3)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %17
%21 = call i64 @verifica_parola(i8* %0, i8** %5, i32** %6, i32 %8, i32 4)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = add nuw nsw i32 %8, 1
%25 = icmp eq i32 %24, 5
br i1 %25, label %26, label %7
26: ; preds = %23, %7, %11, %14, %17, %20
%27 = phi i32 [ 1, %20 ], [ 1, %17 ], [ 1, %14 ], [ 1, %11 ], [ 1, %7 ], [ 0, %23 ]
ret i32 %27
}