#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ lower(char *);
int /*<<< orphan*/ lowerCamelCase(char *, char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  lower(argv[1]);
  char camel[2000];
  char *myword = malloc(200);
  strcpy(myword, argv[1]);
  lowerCamelCase(myword, camel);
  printf("%s", camel);
  free(myword);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <lower@plt>
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x7e8(%rbp)
mov    -0x7e8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
mov    -0x7e8(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1070 <lowerCamelCase@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe24(%rip),%rdi
call   1050 <printf@plt>
mov    -0x7e8(%rbp),%rdi
call   1030 <free@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7d8,%rsp
mov    %rsi,%r14
mov    0x8(%rsi),%rdi
call   1090 <lower@plt>
mov    $0xc8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    0x8(%r14),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <lowerCamelCase@plt>
lea    0xe4c(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2000 x 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 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @lower(i8* %10)
%12 = call i8* @malloc(i32 200)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strcpy(i8* %13, i8* %16)
%18 = load i8*, i8** %7
%19 = getelementptr inbounds [2000 x i8], [2000 x i8]* %6, i64 0, i64 0
%20 = call i32 @lowerCamelCase(i8* %18, i8* %19)
%21 = getelementptr inbounds [2000 x i8], [2000 x i8]* %6, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i8*, i8** %7
%24 = call i32 @free(i8* %23)
%25 = load i32, i32* @EXIT_SUCCESS
%26 = call i32 @exit(i32 %25)
unreachable
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2000 x i8]
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @lower(i8* %5)
%7 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%8 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%9 = load i8*, i8** %4
%10 = tail call i32 @strcpy(i8* %8, i8* %9)
%11 = call i32 @lowerCamelCase(i8* %8, i8* %7)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%13 = call i32 @free(i8* %8)
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
}