#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 *);
int main() {
  char s1[] = "a-z";
  char s2[100];
  expand(s1, s2);
  printf("%s\n\n", s2);
  char s3[] = "a-b-c";
  char s4[100];
  expand(s3, s4);
  printf("%s\n\n", s4);
  char s5[] = "A-Z0-9";
  char s6[100];
  expand(s5, s6);
  printf("%s\n\n", s6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1040 <expand@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0xeab(%rip),%eax
mov    %eax,-0x76(%rbp)
mov    0xea5(%rip),%ax
mov    %ax,-0x72(%rbp)
lea    -0x76(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <expand@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    0xe7a(%rip),%eax
mov    %eax,-0xe7(%rbp)
mov    0xe71(%rip),%ax
mov    %ax,-0xe3(%rbp)
mov    0xe66(%rip),%al
mov    %al,-0xe1(%rbp)
lea    -0xe7(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1040 <expand@plt>
lea    -0x150(%rbp),%rsi
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x168,%rsp
movl   $0x7a2d61,0x14(%rsp)
lea    0x14(%rsp),%rdi
lea    0x100(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
lea    0xeb2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movw   $0x63,0x10(%rsp)
movl   $0x2d622d61,0xc(%rsp)
2d
lea    0xc(%rsp),%rdi
lea    0x90(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
movl   $0x392d30,0x1b(%rsp)
movl   $0x305a2d41,0x18(%rsp)
30
lea    0x18(%rsp),%rdi
lea    0x20(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <expand@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x168,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0A\0A\00"
@__const.main.s3 = [6 x i8] c"a-b-c\00"
@__const.main.s5 = [7 x i8] c"A-Z0-9\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [6 x i8]
%4 = alloca [100 x i8]
%5 = alloca [7 x i8]
%6 = alloca [100 x i8]
%7 = bitcast i32* %1 to i8*
store i32 8007009, i32* %1
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = call i32 @expand(i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i32 @expand(i8* %11, i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12)
%15 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%17 = call i32 @expand(i8* %15, i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %16)
ret i32 0
}