#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char *argv[]) {
  for (char **arg = argv + argc - 1; arg > argv; --arg) {
    for (char *sptr = *arg + strlen(*arg) - 1; sptr >= *arg; --sptr) {
      printf("%c", *sptr);
    }
    printf("\n");
  }
  printf("\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    11dc <main+0xbc>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jb     11bd <main+0x9d>
mov    -0x20(%rbp),%rax
movsbl (%rax),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
jmp    1186 <main+0x66>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
jmp    114d <main+0x2d>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2def(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
movslq %edi,%rax
lea    (%rsi,%rax,8),%r12
add    $0xfffffffffffffff8,%r12
cmp    %rsi,%r12
jbe    1184 <main+0x64>
mov    %rsi,%r14
jmp    1153 <main+0x33>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xfffffffffffffff8,%r12
cmp    %r14,%r12
jbe    1184 <main+0x64>
mov    (%r12),%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
lea    (%r15,%rax,1),%rbx
add    $0xffffffffffffffff,%rbx
cmp    (%r12),%rbx
jb     1140 <main+0x20>
nop
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
cmp    (%r12),%rbx
jae    1170 <main+0x50>
jmp    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %8, i64 %10
%12 = getelementptr inbounds i8*, i8** %11, i64 -1
store i8** %12, i8*** %6
br label %13
13: ; preds = %41, %2
%14 = load i8**, i8*** %6
%15 = load i8**, i8*** %5
%16 = icmp ugt i8** %14, %15
br i1 %16, label %17, label %44
17: ; preds = %13
%18 = load i8**, i8*** %6
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
%22 = call i32 @strlen(i8* %21)
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %19, i64 %23
%25 = getelementptr inbounds i8, i8* %24, i64 -1
store i8* %25, i8** %7
br label %26
26: ; preds = %36, %17
%27 = load i8*, i8** %7
%28 = load i8**, i8*** %6
%29 = load i8*, i8** %28
%30 = icmp uge i8* %27, %29
br i1 %30, label %31, label %39
31: ; preds = %26
%32 = load i8*, i8** %7
%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, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %31
%37 = load i8*, i8** %7
%38 = getelementptr inbounds i8, i8* %37, i32 -1
store i8* %38, i8** %7
br label %26
39: ; preds = %26
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %41
41: ; preds = %39
%42 = load i8**, i8*** %6
%43 = getelementptr inbounds i8*, i8** %42, i32 -1
store i8** %43, i8*** %6
br label %13
44: ; preds = %13
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%46 = load i32, i32* @EXIT_SUCCESS
ret i32 %46
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i8*, i8** %1, i64 %3
%5 = getelementptr inbounds i8*, i8** %4, i64 -1
%6 = icmp ugt i8** %5, %1
br i1 %6, label %10, label %7
7: ; preds = %19, %2
%8 = tail call i32 @putchar(i32 10)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
10: ; preds = %2, %19
%11 = phi i8** [ %21, %19 ], [ %5, %2 ]
%12 = load i8*, i8** %11
%13 = tail call i32 @strlen(i8* %12)
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 -1
%16 = getelementptr inbounds i8, i8* %15, i64 %14
%17 = load i8*, i8** %11
%18 = icmp ult i8* %16, %17
br i1 %18, label %19, label %23
19: ; preds = %23, %10
%20 = tail call i32 @putchar(i32 10)
%21 = getelementptr inbounds i8*, i8** %11, i64 -1
%22 = icmp ugt i8** %21, %1
br i1 %22, label %10, label %7
23: ; preds = %10, %23
%24 = phi i8* [ %28, %23 ], [ %16, %10 ]
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = tail call i32 @putchar(i32 %26)
%28 = getelementptr inbounds i8, i8* %24, i64 -1
%29 = load i8*, i8** %11
%30 = icmp ult i8* %28, %29
br i1 %30, label %19, label %23
}