#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*/ lower(char *);
int /*<<< orphan*/ printf(char *, ...);
char *realloc(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  int i;
  char *tmp = NULL;
  for (i = 1; i < argc; ++i) {
    tmp = realloc(tmp, strlen(argv[i] + 1));
    strcpy(tmp, argv[i]);
    lower(tmp);
    printf("%s ", tmp);
  }
  printf("\n");
  return 0;
}


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)
movq   $0x0,-0x20(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11eb <main+0x9b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x1,%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1060 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
call   1070 <lower@plt>
mov    -0x20(%rbp),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1175 <main+0x25>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
cmp    $0x2,%edi
jl     11d4 <main+0x74>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xe80(%rip),%r14
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbx,8),%rdi
add    $0x1,%rdi
call   1050 <strlen@plt>
mov    %r13,%rdi
mov    %eax,%esi
call   1070 <realloc@plt>
mov    %rax,%r13
mov    (%r15,%rbx,8),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   1080 <lower@plt>
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1190 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %18, %6 ]
%8 = phi i8* [ null, %4 ], [ %13, %6 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = tail call i32 @strlen(i8* %11)
%13 = tail call i8* @realloc(i8* %8, i32 %12)
%14 = load i8*, i8** %9
%15 = tail call i32 @strcpy(i8* %13, i8* %14)
%16 = tail call i32 @lower(i8* %13)
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%18 = add nuw nsw i64 %7, 1
%19 = icmp eq i64 %18, %5
br i1 %19, label %20, label %6
20: ; preds = %6, %2
%21 = tail call i32 @putchar(i32 10)
ret i32 0
}