#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 /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char shortened[256] = "";
  char expanded[256] = "";
  (void)strcpy(shortened, "a-z");
  expand(shortened, expanded);
  printf("Shortened: \"%s\", Expanded: \"%s\"\n", shortened, expanded);
  (void)strcpy(shortened, "az");
  expand(shortened, expanded);
  printf("Shortened: \"%s\", Expanded: \"%s\"\n", shortened, expanded);
  (void)strcpy(shortened, "-a---");
  expand(shortened, expanded);
  printf("Shortened: %s, Expanded: %s\n", shortened, expanded);
  (void)strcpy(shortened, "-");
  expand(shortened, expanded);
  printf("Shortened: %s, Expanded: %s\n", shortened, expanded);
  (void)strcpy(shortened, "");
  expand(shortened, expanded);
  printf("Shortened: %s, Expanded: %s\n", shortened, expanded);
  (void)strcpy(shortened, "-a-z0-9az");
  expand(shortened, expanded);
  printf("Shortened: %s, Expanded: %s\n", shortened, expanded);
  (void)strcpy(shortened, "a-zZ-A-");
  expand(shortened, expanded);
  printf("Shortened: %s, Expanded: %s\n", shortened, expanded);
  (void)strcpy(shortened, "a-b-c");
  expand(shortened, expanded);
  printf("Shortened: %s, Expanded: %s\n", shortened, expanded);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x210(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xe51(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xe11(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xe1f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xdf8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xde3(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xdb8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xd9e(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xd78(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xd82(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xd38(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xd4c(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xcf8(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
lea    0xd14(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x110(%rbp),%rdi
lea    -0x210(%rbp),%rsi
call   1060 <expand@plt>
lea    -0x110(%rbp),%rsi
lea    -0x210(%rbp),%rdx
lea    0xcb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x200,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xdd3(%rip),%rsi
lea    0x100(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
lea    0xdb2(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xde8(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xd96(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
lea    0xd82(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xd6b(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xd3e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xd3a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xd1c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
lea    0xcfc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <expand@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"a-z\00"
@.str.1 = [33 x i8] c"Shortened: \22%s\22, Expanded: \22%s\22\0A\00"
@.str.2 = [3 x i8] c"az\00"
@.str.3 = [6 x i8] c"-a---\00"
@.str.4 = [29 x i8] c"Shortened: %s, Expanded: %s\0A\00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [10 x i8] c"-a-z0-9az\00"
@.str.8 = [8 x i8] c"a-zZ-A-\00"
@.str.9 = [6 x i8] c"a-b-c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
store i32 0, i32* %1
%4 = bitcast [256 x i8]* %2 to i8*
%5 = bitcast [256 x i8]* %3 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @expand(i8* %8, i8* %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%18 = call i32 @expand(i8* %16, i8* %17)
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %19, i8* %20)
%22 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%23 = call i32 @strcpy(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%26 = call i32 @expand(i8* %24, i8* %25)
%27 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %27, i8* %28)
%30 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%31 = call i32 @strcpy(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%34 = call i32 @expand(i8* %32, i8* %33)
%35 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%36 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%37 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %35, i8* %36)
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%40 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%41 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%42 = call i32 @expand(i8* %40, i8* %41)
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%44 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%45 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %43, i8* %44)
%46 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%47 = call i32 @strcpy(i8* %46, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%48 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%50 = call i32 @expand(i8* %48, i8* %49)
%51 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%53 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %51, i8* %52)
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%55 = call i32 @strcpy(i8* %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%58 = call i32 @expand(i8* %56, i8* %57)
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%61 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %59, i8* %60)
%62 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%63 = call i32 @strcpy(i8* %62, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%65 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%66 = call i32 @expand(i8* %64, i8* %65)
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%68 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%69 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %67, i8* %68)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"a-z\00"
@.str.1 = [33 x i8] c"Shortened: \22%s\22, Expanded: \22%s\22\0A\00"
@.str.2 = [3 x i8] c"az\00"
@.str.3 = [6 x i8] c"-a---\00"
@.str.4 = [29 x i8] c"Shortened: %s, Expanded: %s\0A\00"
@.str.5 = [2 x i8] c"-\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [10 x i8] c"-a-z0-9az\00"
@.str.8 = [8 x i8] c"a-zZ-A-\00"
@.str.9 = [6 x i8] c"a-b-c\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @expand(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
%8 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @expand(i8* %3, i8* %4)
%10 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
%11 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @expand(i8* %3, i8* %4)
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%14 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @expand(i8* %3, i8* %4)
%16 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%17 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @expand(i8* %3, i8* %4)
%19 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%20 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0))
%21 = call i32 @expand(i8* %3, i8* %4)
%22 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%23 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 @expand(i8* %3, i8* %4)
%25 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
%26 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%27 = call i32 @expand(i8* %3, i8* %4)
%28 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}