#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 *, char *);
main() {
  char s1[] = "-a-z-A-Z-0-9-asd-5-5-5-9a-ZZ-A-G-N-T-Z";
  char s2[1024];
  expand(s1, s2);
  printf("%s\n", s2);
  char s[] = "-a-z 0-9 a-d-f -0-2 some text 1-1 WITH CAPITALS! 0-0 5-3 -";
  char t[1024];
  expand(s, t);
  printf("%s\n", t);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
lea    -0x30(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x27,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x430(%rbp),%rsi
call   1050 <expand@plt>
lea    -0x430(%rbp),%rsi
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x470(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x3b,%edx
call   1040 <memcpy@plt>
lea    -0x470(%rbp),%rdi
lea    -0x870(%rbp),%rsi
call   1050 <expand@plt>
lea    -0x870(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x878,%rsp
movaps 0xedf(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec3(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x5a2d542d4e2d47,%rax
mov    %rax,0x1f(%rsp)
mov    %rsp,%rdi
lea    0x470(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
lea    0xf01(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movups 0xedf(%rip),%xmm0
movups %xmm0,0x5b(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%rdi
lea    0x70(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x878,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s1 = [39 x i8] c"-a-z-A-Z-0-9-asd-5-5-5-9a-ZZ-A-G-N-T-Z\00"
@.str = [4 x i8] c"%s\0A\00"
@__const.main.s = [59 x i8] c"-a-z 0-9 a-d-f -0-2 some text 1-1 WITH CAPITALS! 0-0 5-3 -\00"
define i32 @main() {
%1 = alloca [39 x i8]
%2 = alloca [1024 x i8]
%3 = alloca [59 x i8]
%4 = alloca [1024 x i8]
%5 = bitcast [39 x i8]* %1 to i8*
%6 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%8 = call i32 @expand(i8* %6, i8* %7)
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = bitcast [59 x i8]* %3 to i8*
%12 = getelementptr inbounds [59 x i8], [59 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%14 = call i32 @expand(i8* %12, i8* %13)
%15 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [39 x i8] c"-a-z-A-Z-0-9-asd-5-5-5-9a-ZZ-A-G-N-T-Z\00"
@.str = [4 x i8] c"%s\0A\00"
@__const.main.s = [59 x i8] c"-a-z 0-9 a-d-f -0-2 some text 1-1 WITH CAPITALS! 0-0 5-3 -\00"
define i32 @main() {
%1 = alloca [39 x i8]
%2 = alloca [1024 x i8]
%3 = alloca [59 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [39 x i8], [39 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = call i32 @expand(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = getelementptr inbounds [59 x i8], [59 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%11 = call i32 @expand(i8* %9, i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}