#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__ comparacao(char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  char s1_m[5] = {'a', 'b', 'c', 'd', 'e'}, s2_m[5] = {'a', 'b', 'c', 'D', 'E'};
  int n_m;
  printf("quantos caracteres serao verificados(max 5)\n> ");
  scanf("%d", &n_m);
  printf("os %d primeiros caracteres dos dois vetores %ssao iguais", n_m,
         comparacao(s1_m, s2_m, n_m) ? "" : "nao ");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeb0(%rip),%al
mov    %al,-0x6(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x5(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1050 <comparacao@plt>
mov    -0x14(%rbp),%esi
mov    %rax,%rcx
lea    0xed8(%rip),%rdx
lea    0xe94(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movb   $0x65,0x18(%rsp)
movl   $0x64636261,0x14(%rsp)
64
movb   $0x45,0x10(%rsp)
movl   $0x44636261,0xc(%rsp)
44
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    0x1c(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x1c(%rsp),%ebx
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %ebx,%edx
call   1050 <comparacao@plt>
test   %rax,%rax
lea    0xee8(%rip),%rax
lea    0xea4(%rip),%rdx
cmove  %rax,%rdx
lea    0xe9d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1_m = [5 x i8] c"abcde"
@__const.main.s2_m = [5 x i8] c"abcDE"
@.str = [47 x i8] c"quantos caracteres serao verificados(max 5)\0A> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [57 x i8] c"os %d primeiros caracteres dos dois vetores %ssao iguais\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [5 x i8] c"nao \00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = bitcast [5 x i8]* %1 to i8*
%5 = bitcast [5 x i8]* %2 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i64 @comparacao(i8* %9, i8* %10, i32 %11)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %8, i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1_m = [5 x i8] c"abcde"
@__const.main.s2_m = [5 x i8] c"abcDE"
@.str = [47 x i8] c"quantos caracteres serao verificados(max 5)\0A> \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [57 x i8] c"os %d primeiros caracteres dos dois vetores %ssao iguais\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [5 x i8] c"nao \00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = call i64 @comparacao(i8* %4, i8* %5, i32 %9)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0), i32 %9, i8* %12)
ret i32 0
}