#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 *, char *);
int main() {
  char *a1 = "a-zA-";
  char *a2 = "-zA-G";
  char *a3 = "0-3-9";
  char *a4 = "0-9a-z";
  char s[100] = {0};
  expand(a1, s);
  printf("%s:%s\n", a1, s);
  expand(a2, s);
  printf("%s:%s\n", a2, s);
  expand(a3, s);
  printf("%s:%s\n", a3, s);
  expand(a4, s);
  printf("%s:%s\n", a4, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xead(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <expand@plt>
mov    -0x10(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <expand@plt>
mov    -0x18(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <expand@plt>
mov    -0x20(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1050 <expand@plt>
mov    -0x28(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0xea8(%rip),%r15
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <expand@plt>
lea    0xeac(%rip),%r14
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
lea    0xe84(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
lea    0xe6a(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
lea    0xe50(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"a-zA-\00"
@.str.1 = [6 x i8] c"-zA-G\00"
@.str.2 = [6 x i8] c"0-3-9\00"
@.str.3 = [7 x i8] c"0-9a-z\00"
@.str.4 = [7 x i8] c"%s:%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [100 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %5
%7 = bitcast [100 x i8]* %6 to i8*
%8 = load i8*, i8** %2
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%10 = call i32 @expand(i8* %8, i8* %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %11, i8* %12)
%14 = load i8*, i8** %3
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%16 = call i32 @expand(i8* %14, i8* %15)
%17 = load i8*, i8** %3
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %17, i8* %18)
%20 = load i8*, i8** %4
%21 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%22 = call i32 @expand(i8* %20, i8* %21)
%23 = load i8*, i8** %4
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %23, i8* %24)
%26 = load i8*, i8** %5
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%28 = call i32 @expand(i8* %26, i8* %27)
%29 = load i8*, i8** %5
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %29, i8* %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"a-zA-\00"
@.str.1 = [6 x i8] c"-zA-G\00"
@.str.2 = [6 x i8] c"0-3-9\00"
@.str.3 = [7 x i8] c"0-9a-z\00"
@.str.4 = [7 x i8] c"%s:%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @expand(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = call i32 @expand(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = call i32 @expand(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%9 = call i32 @expand(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret i32 0
}