#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*/ expand(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char concise[] = {'E', 'x', 'p', 'a', 'n', 'd', ' ', 'a', '-', 'z', ' ',
                    'a', 'n', 'd', ' ', 'A', '-', 'Z', '0', '-', '9', ' ',
                    'a', 'n', 'd', ' ', 'a', '-', 'b', '-', 'c', '\0'};
  char expanded[1000];
  printf("Before:\n%s\n", concise);
  expand(concise, expanded);
  printf("After:\n%s\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    0xece(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1040 <expand@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x410,%rsp
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <expand@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.concise = [32 x i8] c"Expand a-z and A-Z0-9 and a-b-c\00"
@.str = [12 x i8] c"Before:\0A%s\0A\00"
@.str.1 = [11 x i8] c"After:\0A%s\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca [1000 x i8]
%3 = bitcast [32 x i8]* %1 to i8*
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%8 = call i32 @expand(i8* %6, i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.concise = [32 x i8] c"Expand a-z and A-Z0-9 and a-b-c\00"
@.str = [12 x i8] c"Before:\0A%s\0A\00"
@.str.1 = [11 x i8] c"After:\0A%s\0A\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @expand(i8* %3, i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}