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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
lea    0xebe(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x2,-0xb4(%rbp)
jge    11cc <main+0x9c>
movslq -0xb4(%rbp),%rax
lea    -0xa0(%rbp),%rcx
imul   $0x50,%rax,%rax
add    %rax,%rcx
movslq -0xb4(%rbp),%rax
mov    %rcx,-0xb0(%rbp,%rax,8)
ff
mov    -0xb4(%rbp),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xb4(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
lea    0xe70(%rip),%rdi
call   1040 <scanf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1158 <main+0x28>
lea    -0xb0(%rbp),%rdi
mov    $0x2,%esi
call   1050 <compare@plt>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x2,-0xb4(%rbp)
jge    1233 <main+0x103>
movslq -0xb4(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rsi
ff
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    11f5 <main+0xc5>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0xb0,%rsp
lea    0xead(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,(%rsp)
lea    0xea4(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea1(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,0x8(%rsp)
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rsp,%rdi
mov    $0x2,%esi
call   1060 <compare@plt>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
call   1030 <puts@plt>
add    $0xb0,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 [2 x [80 x i8]]
%2 = alloca [2 x i8*]
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
store i32 0, i32* %3
br label %5
5: ; preds = %23, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %26
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x [80 x i8]], [2 x [80 x i8]]* %1, i64 0, i64 %10
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 %14
store i8* %12, i8** %15
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %8
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
%27 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %29
29: ; preds = %38, %26
%30 = load i32, i32* %3
%31 = icmp slt i32 %30, 2
br i1 %31, label %32, label %41
32: ; preds = %29
%33 = load i32, i32* %3
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 %34
%36 = load i8*, i8** %35
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %36)
br label %38
38: ; preds = %32
%39 = load i32, i32* %3
%40 = add nsw i32 %39, 1
store i32 %40, i32* %3
br label %29
41: ; preds = %29
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 [2 x [80 x i8]]
%2 = alloca [2 x i8*]
%3 = getelementptr inbounds [2 x [80 x i8]], [2 x [80 x i8]]* %1, i64 0, i64 0, i64 0
%4 = bitcast [2 x i8*]* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 2)
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
store i8* %3, i8** %6
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 0)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%9 = getelementptr inbounds [2 x [80 x i8]], [2 x [80 x i8]]* %1, i64 0, i64 1, i64 0
%10 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
store i8* %9, i8** %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 1)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%14 = load i8*, i8** %6
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = load i8*, i8** %10
%17 = call i32 @puts(i8* dereferenceable(1) %16)
ret void
}