#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char str[5][80];
  int i;
  printf("Enter %d strings:\n", 5);
  for (i = 0; i < 5; i++) {
    printf("The %d string:\n", i);
    scanf("%s", str[i]);
  }
  void compare(char str[][80], int);
  compare(str, 5);
  printf("\nComared string:\n");
  for (i = 0; i < 5; i++) {
    printf("%s\n", str[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x5,-0x194(%rbp)
jge    11ae <main+0x7e>
mov    -0x194(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x194(%rbp),%rax
lea    -0x190(%rbp),%rsi
imul   $0x50,%rax,%rax
add    %rax,%rsi
lea    0xe8e(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1158 <main+0x28>
lea    -0x190(%rbp),%rdi
mov    $0x5,%esi
call   1050 <compare@plt>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x5,-0x194(%rbp)
jge    121b <main+0xeb>
movslq -0x194(%rbp),%rax
lea    -0x190(%rbp),%rsi
imul   $0x50,%rax,%rax
add    %rax,%rsi
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    11d7 <main+0xa7>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
lea    0xea8(%rip),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea5(%rip),%r12
mov    %rsp,%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x50(%rsp),%r14
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xa0(%rsp),%r13
mov    %r12,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0(%rsp),%rbp
mov    %r12,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x140(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    $0x5,%esi
call   1060 <compare@plt>
lea    0xe01(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Enter %d strings:\0A\00"
@.str.1 = [16 x i8] c"The %d string:\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@str = [17 x i8] c"\0AComared string:\00"
define void @main() {
%1 = alloca [5 x [80 x i8]]
%2 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 5)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1)
%7 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 1, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 2)
%10 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 2, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 3)
%13 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 3, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 4)
%16 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 4, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 0
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%20 = call i32 @puts(i8* %2)
%21 = call i32 @puts(i8* %7)
%22 = call i32 @puts(i8* %10)
%23 = call i32 @puts(i8* %13)
%24 = call i32 @puts(i8* %16)
ret void
}