#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 cantBien(int *, int *, int);
int cantRegular(int *, int *, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int coincideNumero(int incognita[], int numero[], int dim) {
  int bien, regular;
  bien = cantBien(incognita, numero, dim);
  if (bien == dim) {
    return 1;
  } else {
    regular = cantRegular(incognita, numero, dim);
    printf("Tienes %d BIEN, %d REGULAR y %d ERRORES!\n", bien, regular,
           (dim - bien - regular));
    return 0;
  }
}


x86 assembly (clang, -O0):
<coincideNumero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <cantBien@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    116e <coincideNumero+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <coincideNumero+0x73>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <cantRegular@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
sub    -0x20(%rbp),%ecx
sub    -0x24(%rbp),%ecx
lea    0xe69(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coincideNumero>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <cantBien@plt>
mov    %eax,%ebp
mov    $0x1,%eax
cmp    %ebx,%ebp
je     1176 <coincideNumero+0x46>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <cantRegular@plt>
mov    %ebp,%ecx
add    %eax,%ecx
sub    %ecx,%ebx
lea    0xe97(%rip),%rdi
mov    %ebp,%esi
mov    %eax,%edx
mov    %ebx,%ecx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Tienes %d BIEN, %d REGULAR y %d ERRORES!\0A\00"
define i32 @coincideNumero(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @cantBien(i32* %10, i32* %11, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = load i32, i32* %7
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %3
store i32 1, i32* %4
br label %31
18: ; preds = %3
%19 = load i32*, i32** %5
%20 = load i32*, i32** %6
%21 = load i32, i32* %7
%22 = call i32 @cantRegular(i32* %19, i32* %20, i32 %21)
store i32 %22, i32* %9
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = sub nsw i32 %25, %26
%28 = load i32, i32* %9
%29 = sub nsw i32 %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24, i32 %29)
store i32 0, i32* %4
br label %31
31: ; preds = %18, %17
%32 = load i32, i32* %4
ret i32 %32
}

LLVM IR (-O2):
@.str = [42 x i8] c"Tienes %d BIEN, %d REGULAR y %d ERRORES!\0A\00"
define i32 @coincideNumero(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @cantBien(i32* %0, i32* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i32 @cantRegular(i32* %0, i32* %1, i32 %2)
%8 = add i32 %4, %7
%9 = sub i32 %2, %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7, i32 %9)
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %12
}