int main() {
  char apellido[10][20], buscar;
  int i;
  for (i = 0; i < 10; i++) {
    printf("Apellido del estudiante [%d]\n", i + 1);
    gets(apellido);
  }
  printf("Que Apellido desea buscar?\n");
  scanf("%s", &buscar);
  if (buscar == apellido[i]) {
    printf("Apellido Encontrado\n");
  } else {
    printf("Apellido no Encontrado\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xd8(%rbp)
cmpl   $0xa,-0xd8(%rbp)
jge    1192 <main+0x62>
mov    -0xd8(%rbp),%esi
add    $0x1,%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xd0(%rbp),%rdi
mov    $0x0,%al
call   1040 <gets@plt>
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    114c <main+0x1c>
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0xd1(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movsbq -0xd1(%rbp),%rax
ff
movslq -0xd8(%rbp),%rdx
lea    -0xd0(%rbp),%rcx
imul   $0x14,%rdx,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    11ee <main+0xbe>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <main+0xcc>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xeaf(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0x9,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %r14,%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
lea    0xdca(%rip),%rdi
call   1030 <puts@plt>
lea    0xdbb(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movsbq 0xf(%rsp),%rax
lea    0xd8(%rsp),%rcx
cmp    %rax,%rcx
lea    0xdcc(%rip),%rax
lea    0xdae(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Apellido del estudiante [%d]\0A\00"
@.str.1 = [28 x i8] c"Que Apellido desea buscar?\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [21 x i8] c"Apellido Encontrado\0A\00"
@.str.4 = [24 x i8] c"Apellido no Encontrado\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x [20 x i8]]
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %14, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %2, i64 0, i64 0
%13 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %12)
br label %14
14: ; preds = %8
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%20 = load i8, i8* %3
%21 = sext i8 %20 to i64
%22 = inttoptr i64 %21 to i8*
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %2, i64 0, i64 %24
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%27 = icmp eq i8* %22, %26
br i1 %27, label %28, label %30
28: ; preds = %17
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %32
30: ; preds = %17
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [30 x i8] c"Apellido del estudiante [%d]\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@str = [27 x i8] c"Que Apellido desea buscar?\00"
@str.5 = [23 x i8] c"Apellido no Encontrado\00"
@str.6 = [20 x i8] c"Apellido Encontrado\00"
define i32 @main() {
%1 = alloca [10 x [20 x i8]]
%2 = alloca i8
%3 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%4 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 2)
%8 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 3)
%10 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 4)
%12 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 5)
%14 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 6)
%16 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 7)
%18 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 8)
%20 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 9)
%22 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 10)
%24 = call i32 ([20 x i8]*, ...) bitcast (i32 (...)* @gets to i32 ([20 x i8]*, ...)*)([20 x i8]* %4)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%27 = load i8, i8* %2
%28 = sext i8 %27 to i64
%29 = inttoptr i64 %28 to i8*
%30 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 10, i64 0
%31 = icmp eq i8* %30, %29
%32 = select i1 %31, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.5, i64 0, i64 0)
%33 = call i32 @puts(i8* dereferenceable(1) %32)
ret i32 0
}