#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void main() {
  char string[20];
  char str[3][20];
  int i;
  for (i = 0; i < 3; i++)
    gets(str[i]);
  if (strcmp(str[0], str[1]) > 0)
    strcpy(string, str[0]);
  else
    strcpy(string, str[1]);
  if (strcmp(str[2], string) > 0)
    strcpy(string, str[2]);
  printf("\nthe largest string is : \n%s\n", string);
  printf("%c", str[1][1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x64(%rbp)
cmpl   $0x3,-0x64(%rbp)
jge    117b <main+0x3b>
movslq -0x64(%rbp),%rax
lea    -0x60(%rbp),%rdi
imul   $0x14,%rax,%rax
add    %rax,%rdi
call   1060 <gets@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    114f <main+0xf>
lea    -0x60(%rbp),%rdi
lea    -0x60(%rbp),%rsi
add    $0x14,%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jle    11a8 <main+0x68>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    11b9 <main+0x79>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
add    $0x14,%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
add    $0x28,%rdi
lea    -0x20(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jle    11e5 <main+0xa5>
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
add    $0x28,%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rsi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x4b(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
lea    0x20(%rsp),%r15
mov    %r15,%rdi
call   1070 <gets@plt>
lea    0x34(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <gets@plt>
lea    0x48(%rsp),%r14
mov    %r14,%rdi
call   1070 <gets@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
cmovg  %r15,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jle    11bb <main+0x6b>
mov    %rsp,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
lea    0xe3e(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x35(%rsp),%edi
call   1030 <putchar@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0Athe largest string is : \0A%s\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca [20 x i8]
%2 = alloca [3 x [20 x i8]]
%3 = alloca i32
store i32 0, i32* %3
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 3
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 %9
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%12 = call i32 @gets(i8* %11)
br label %13
13: ; preds = %7
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 0
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %17, i64 0, i64 0
%19 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 1
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %19, i64 0, i64 0
%21 = call i64 @strcmp(i8* %18, i8* %20)
%22 = icmp sgt i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %16
%24 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%25 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 0
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %25, i64 0, i64 0
%27 = call i32 @strcpy(i8* %24, i8* %26)
br label %33
28: ; preds = %16
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%30 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 1
%31 = getelementptr inbounds [20 x i8], [20 x i8]* %30, i64 0, i64 0
%32 = call i32 @strcpy(i8* %29, i8* %31)
br label %33
33: ; preds = %28, %23
%34 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 2
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %34, i64 0, i64 0
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%37 = call i64 @strcmp(i8* %35, i8* %36)
%38 = icmp sgt i64 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %33
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%41 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 2
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %41, i64 0, i64 0
%43 = call i32 @strcpy(i8* %40, i8* %42)
br label %44
44: ; preds = %39, %33
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %45)
%47 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 1
%48 = getelementptr inbounds [20 x i8], [20 x i8]* %47, i64 0, i64 1
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %50)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0Athe largest string is : \0A%s\0A\00"
define void @main() {
%1 = alloca [20 x i8]
%2 = alloca [3 x [20 x i8]]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 1, i64 0
%7 = call i32 @gets(i8* %6)
%8 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 2, i64 0
%9 = call i32 @gets(i8* %8)
%10 = call i64 @strcmp(i8* %4, i8* %6)
%11 = icmp sgt i64 %10, 0
%12 = select i1 %11, i8* %4, i8* %6
%13 = call i32 @strcpy(i8* %3, i8* %12)
%14 = call i64 @strcmp(i8* %8, i8* %3)
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 @strcpy(i8* %3, i8* %8)
br label %18
18: ; preds = %16, %0
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
%20 = getelementptr inbounds [3 x [20 x i8]], [3 x [20 x i8]]* %2, i64 0, i64 1, i64 1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 @putchar(i32 %22)
ret void
}