#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 *, ...);
int strlen(char *);
int main(int argc, const char *argv[]) {
  int j, i, ii, iii, len;
  char word[100];
  char word2[100];
  char word3[100];
  printf("Enter 3 names\n");
  gets(word);
  gets(word2);
  gets(word3);
  printf("\n");
  i = strlen(word) - 1;
  while (i > -1) {
    printf("%c", word[i--]);
  }
  ii = strlen(word2) - 1;
  while (ii > -1) {
    printf("%c", word2[ii--]);
  }
  iii = strlen(word3) - 1;
  while (iii > -1) {
    printf("%c", word3[iii--]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x100(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x170(%rbp),%rdi
call   1050 <gets@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jle    11cd <main+0x9d>
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cltq
movsbl -0x90(%rbp,%rax,1),%esi
ff
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119b <main+0x6b>
lea    -0x100(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jle    1211 <main+0xe1>
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x1c(%rbp)
cltq
movsbl -0x100(%rbp,%rax,1),%esi
ff
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11df <main+0xaf>
lea    -0x170(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0xffffffff,-0x20(%rbp)
jle    1255 <main+0x125>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x20(%rbp)
cltq
movsbl -0x170(%rbp,%rax,1),%esi
ff
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1223 <main+0xf3>
xor    %eax,%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x150,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
lea    0x70(%rsp),%rdi
call   1060 <gets@plt>
mov    %rsp,%rdi
call   1060 <gets@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    11ba <main+0x7a>
mov    %eax,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
movsbl 0xe0(%rsp,%rax,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     11a0 <main+0x60>
lea    0x70(%rsp),%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    11e7 <main+0xa7>
mov    %eax,%ebx
add    $0x1,%rbx
xchg   %ax,%ax
lea    -0x2(%rbx),%eax
movsbl 0x70(%rsp,%rax,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     11d0 <main+0x90>
mov    %rsp,%rdi
call   1050 <strlen@plt>
test   %eax,%eax
jle    1216 <main+0xd6>
mov    %eax,%ebx
add    $0x1,%rbx
nopl   0x0(%rax)
lea    -0x2(%rbx),%eax
movsbl (%rsp,%rax,1),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1200 <main+0xc0>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Enter 3 names\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [100 x i8]
%12 = alloca [100 x i8]
%13 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%16 = call i32 @gets(i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%18 = call i32 @gets(i8* %17)
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%20 = call i32 @gets(i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%23 = call i32 @strlen(i8* %22)
%24 = sub nsw i32 %23, 1
store i32 %24, i32* %7
br label %25
25: ; preds = %28, %2
%26 = load i32, i32* %7
%27 = icmp sgt i32 %26, -1
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load i32, i32* %7
%30 = add nsw i32 %29, -1
store i32 %30, i32* %7
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %34)
br label %25
36: ; preds = %25
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 0
%38 = call i32 @strlen(i8* %37)
%39 = sub nsw i32 %38, 1
store i32 %39, i32* %8
br label %40
40: ; preds = %43, %36
%41 = load i32, i32* %8
%42 = icmp sgt i32 %41, -1
br i1 %42, label %43, label %51
43: ; preds = %40
%44 = load i32, i32* %8
%45 = add nsw i32 %44, -1
store i32 %45, i32* %8
%46 = sext i32 %44 to i64
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %49)
br label %40
51: ; preds = %40
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 0
%53 = call i32 @strlen(i8* %52)
%54 = sub nsw i32 %53, 1
store i32 %54, i32* %9
br label %55
55: ; preds = %58, %51
%56 = load i32, i32* %9
%57 = icmp sgt i32 %56, -1
br i1 %57, label %58, label %66
58: ; preds = %55
%59 = load i32, i32* %9
%60 = add nsw i32 %59, -1
store i32 %60, i32* %9
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %13, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %64)
br label %55
66: ; preds = %55
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"Enter 3 names\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%10 = call i32 @gets(i8* %6)
%11 = call i32 @gets(i8* %7)
%12 = call i32 @gets(i8* %8)
%13 = call i32 @putchar(i32 10)
%14 = call i32 @strlen(i8* %6)
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %27
16: ; preds = %2
%17 = zext i32 %14 to i64
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ %17, %16 ], [ %20, %18 ]
%20 = add nsw i64 %19, -1
%21 = and i64 %20, 4294967295
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = call i32 @putchar(i32 %24)
%26 = icmp ugt i64 %19, 1
br i1 %26, label %18, label %27
27: ; preds = %18, %2
%28 = call i32 @strlen(i8* %7)
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %41
30: ; preds = %27
%31 = zext i32 %28 to i64
br label %32
32: ; preds = %30, %32
%33 = phi i64 [ %31, %30 ], [ %34, %32 ]
%34 = add nsw i64 %33, -1
%35 = and i64 %34, 4294967295
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = call i32 @putchar(i32 %38)
%40 = icmp ugt i64 %33, 1
br i1 %40, label %32, label %41
41: ; preds = %32, %27
%42 = call i32 @strlen(i8* %8)
%43 = icmp sgt i32 %42, 0
br i1 %43, label %44, label %55
44: ; preds = %41
%45 = zext i32 %42 to i64
br label %46
46: ; preds = %44, %46
%47 = phi i64 [ %45, %44 ], [ %48, %46 ]
%48 = add nsw i64 %47, -1
%49 = and i64 %48, 4294967295
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = call i32 @putchar(i32 %52)
%54 = icmp ugt i64 %47, 1
br i1 %54, label %46, label %55
55: ; preds = %46, %41
ret i32 0
}