#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 test1[] = "z-a";
  char test2[1000];
  char test3[] = "a-b-c";
  char test4[1000];
  char test5[] = "0-9";
  char test6[1000];
  char test7[] = "a-z0-9";
  char test8[1000];
  char test9[] = "-a-z-";
  char test0[1000];
  printf("%s\n", test1);
  expand(test1, test2);
  printf("%s\n", test2);
  printf("%s\n", test3);
  expand(test3, test4);
  printf("%s\n", test4);
  printf("%s\n", test5);
  expand(test5, test6);
  printf("%s\n", test6);
  printf("%s\n", test7);
  expand(test7, test8);
  printf("%s\n", test8);
  printf("%s\n", test9);
  expand(test9, test0);
  printf("%s\n", test0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x13b0,%rsp
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xeca(%rip),%eax
mov    %eax,-0x3f6(%rbp)
mov    0xec1(%rip),%ax
mov    %ax,-0x3f2(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x7e4(%rbp)
mov    0xeaa(%rip),%eax
mov    %eax,-0xbd7(%rbp)
mov    0xea1(%rip),%ax
mov    %ax,-0xbd3(%rbp)
mov    0xe96(%rip),%al
mov    %al,-0xbd1(%rbp)
mov    0xe8b(%rip),%eax
mov    %eax,-0xfc6(%rbp)
mov    0xe82(%rip),%ax
mov    %ax,-0xfc2(%rbp)
lea    -0x4(%rbp),%rsi
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
lea    -0x4(%rbp),%rdi
lea    -0x3f0(%rbp),%rsi
call   1040 <expand@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3f6(%rbp),%rsi
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x3f6(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1040 <expand@plt>
lea    -0x7e0(%rbp),%rsi
lea    0xe16(%rip),%rdi
call   1030 <printf@plt>
lea    -0x7e4(%rbp),%rsi
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
lea    -0x7e4(%rbp),%rdi
lea    -0xbd0(%rbp),%rsi
call   1040 <expand@plt>
lea    -0xbd0(%rbp),%rsi
lea    0xddd(%rip),%rdi
call   1030 <printf@plt>
lea    -0xbd7(%rbp),%rsi
lea    0xdca(%rip),%rdi
call   1030 <printf@plt>
lea    -0xbd7(%rbp),%rdi
lea    -0xfc0(%rbp),%rsi
call   1040 <expand@plt>
lea    -0xfc0(%rbp),%rsi
lea    0xda4(%rip),%rdi
call   1030 <printf@plt>
lea    -0xfc6(%rbp),%rsi
lea    0xd91(%rip),%rdi
call   1030 <printf@plt>
lea    -0xfc6(%rbp),%rdi
lea    -0x13b0(%rbp),%rsi
call   1040 <expand@plt>
lea    -0x13b0(%rbp),%rsi
lea    0xd6b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x13b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x13d0,%rsp
movl   $0x612d7a,0x14(%rsp)
movw   $0x63,0x10(%rsp)
movl   $0x2d622d61,0xc(%rsp)
2d
movl   $0x392d30,0x8(%rsp)
movl   $0x392d30,0x1b(%rsp)
movl   $0x307a2d61,0x18(%rsp)
30
movw   $0x2d,0x4(%rsp)
movl   $0x7a2d612d,(%rsp)
lea    0xea3(%rip),%rbx
lea    0x14(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xfe0(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <expand@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0xc(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xbf0(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <expand@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0x800(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <expand@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
lea    0x18(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0x410(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <expand@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0x20(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <expand@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x13d0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.test1 = [4 x i8] c"z-a\00"
@__const.main.test3 = [6 x i8] c"a-b-c\00"
@__const.main.test5 = [4 x i8] c"0-9\00"
@__const.main.test7 = [7 x i8] c"a-z0-9\00"
@__const.main.test9 = [6 x i8] c"-a-z-\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [4 x i8]
%2 = alloca [1000 x i8]
%3 = alloca [6 x i8]
%4 = alloca [1000 x i8]
%5 = alloca [4 x i8]
%6 = alloca [1000 x i8]
%7 = alloca [7 x i8]
%8 = alloca [1000 x i8]
%9 = alloca [6 x i8]
%10 = alloca [1000 x i8]
%11 = bitcast [4 x i8]* %1 to i8*
%12 = bitcast [6 x i8]* %3 to i8*
%13 = bitcast [4 x i8]* %5 to i8*
%14 = bitcast [7 x i8]* %7 to i8*
%15 = bitcast [6 x i8]* %9 to i8*
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%20 = call i32 @expand(i8* %18, i8* %19)
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%27 = call i32 @expand(i8* %25, i8* %26)
%28 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%31 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%34 = call i32 @expand(i8* %32, i8* %33)
%35 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%38 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %37)
%39 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%40 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%41 = call i32 @expand(i8* %39, i8* %40)
%42 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %42)
%44 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%45 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %44)
%46 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%48 = call i32 @expand(i8* %46, i8* %47)
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %49)
ret i32 0
}

LLVM IR (-O2):
@__const.main.test3 = [6 x i8] c"a-b-c\00"
@__const.main.test7 = [7 x i8] c"a-z0-9\00"
@__const.main.test9 = [6 x i8] c"-a-z-\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [6 x i8]
%4 = alloca [1000 x i8]
%5 = alloca i32
%6 = alloca [1000 x i8]
%7 = alloca [7 x i8]
%8 = alloca [1000 x i8]
%9 = alloca [6 x i8]
%10 = alloca [1000 x i8]
%11 = bitcast i32* %1 to i8*
store i32 6368634, i32* %1
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%15 = bitcast i32* %5 to i8*
store i32 3747120, i32* %5
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%19 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %10, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
%22 = call i32 @expand(i8* %11, i8* %12)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%25 = call i32 @expand(i8* %13, i8* %14)
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%28 = call i32 @expand(i8* %15, i8* %16)
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
%31 = call i32 @expand(i8* %17, i8* %18)
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %18)
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %19)
%34 = call i32 @expand(i8* %19, i8* %20)
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
ret i32 0
}