#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*/ divname(char *, unsigned short, char *, char *);
int /*<<< orphan*/ eraser(char *, int);
int /*<<< orphan*/ parsechar(unsigned short, char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void getname(char *name, char *file, unsigned short len, char *concept,
             unsigned short num) {
  char base[50], ext[10], buff[10];
  eraser(name, len);
  eraser(base, 50);
  eraser(ext, 10);
  eraser(buff, 10);
  divname(file, len, base, ext);
  parsechar(num + 1, buff);
  strcpy(name, base);
  strcat(name, concept);
  strcat(name, buff);
  strcat(name, ext);
}


x86 assembly (clang, -O0):
<getname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %dx,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %ax,-0x22(%rbp)
mov    -0x8(%rbp),%rdi
movzwl -0x12(%rbp),%esi
call   1070 <eraser@plt>
lea    -0x60(%rbp),%rdi
mov    $0x32,%esi
call   1070 <eraser@plt>
lea    -0x6a(%rbp),%rdi
mov    $0xa,%esi
call   1070 <eraser@plt>
lea    -0x74(%rbp),%rdi
mov    $0xa,%esi
call   1070 <eraser@plt>
mov    -0x10(%rbp),%rdi
mov    -0x12(%rbp),%ax
lea    -0x60(%rbp),%rdx
lea    -0x6a(%rbp),%rcx
movzwl %ax,%esi
call   1040 <divname@plt>
movzwl -0x22(%rbp),%eax
add    $0x1,%eax
lea    -0x74(%rbp),%rsi
movzwl %ax,%edi
call   1050 <parsechar@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x74(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    -0x6a(%rbp),%rsi
call   1060 <strcat@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getname>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r8d,%ebp
mov    %rcx,(%rsp)
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %edx,%esi
call   1070 <eraser@plt>
lea    0x20(%rsp),%rdi
mov    $0x32,%esi
call   1070 <eraser@plt>
lea    0x16(%rsp),%r12
mov    %r12,%rdi
mov    $0xa,%esi
call   1070 <eraser@plt>
lea    0xc(%rsp),%r13
mov    %r13,%rdi
mov    $0xa,%esi
call   1070 <eraser@plt>
mov    %r15,%rdi
mov    %r14d,%esi
lea    0x20(%rsp),%rdx
mov    %r12,%rcx
call   1040 <divname@plt>
add    $0x1,%ebp
movzwl %bp,%edi
mov    %r13,%rsi
call   1050 <parsechar@plt>
mov    %rbx,%rdi
lea    0x20(%rsp),%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    (%rsp),%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <strcat@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @getname(i8* %0, i8* %1, i16 zeroext %2, i8* %3, i16 zeroext %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i16
%11 = alloca [50 x i8]
%12 = alloca [10 x i8]
%13 = alloca [10 x i8]
store i8* %0, i8** %6
store i8* %1, i8** %7
store i16 %2, i16* %8
store i8* %3, i8** %9
store i16 %4, i16* %10
%14 = load i8*, i8** %6
%15 = load i16, i16* %8
%16 = zext i16 %15 to i32
%17 = call i32 @eraser(i8* %14, i32 %16)
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %11, i64 0, i64 0
%19 = call i32 @eraser(i8* %18, i32 50)
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%21 = call i32 @eraser(i8* %20, i32 10)
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 0
%23 = call i32 @eraser(i8* %22, i32 10)
%24 = load i8*, i8** %7
%25 = load i16, i16* %8
%26 = getelementptr inbounds [50 x i8], [50 x i8]* %11, i64 0, i64 0
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%28 = call i32 @divname(i8* %24, i16 zeroext %25, i8* %26, i8* %27)
%29 = load i16, i16* %10
%30 = zext i16 %29 to i32
%31 = add nsw i32 %30, 1
%32 = trunc i32 %31 to i16
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 0
%34 = call i32 @parsechar(i16 zeroext %32, i8* %33)
%35 = load i8*, i8** %6
%36 = getelementptr inbounds [50 x i8], [50 x i8]* %11, i64 0, i64 0
%37 = call i32 @strcpy(i8* %35, i8* %36)
%38 = load i8*, i8** %6
%39 = load i8*, i8** %9
%40 = call i32 @strcat(i8* %38, i8* %39)
%41 = load i8*, i8** %6
%42 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 0
%43 = call i32 @strcat(i8* %41, i8* %42)
%44 = load i8*, i8** %6
%45 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%46 = call i32 @strcat(i8* %44, i8* %45)
ret void
}

LLVM IR (-O2):
define void @getname(i8* %0, i8* %1, i16 zeroext %2, i8* %3, i16 zeroext %4) {
%6 = alloca [50 x i8]
%7 = alloca [10 x i8]
%8 = alloca [10 x i8]
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%12 = zext i16 %2 to i32
%13 = tail call i32 @eraser(i8* %0, i32 %12)
%14 = call i32 @eraser(i8* %9, i32 50)
%15 = call i32 @eraser(i8* %10, i32 10)
%16 = call i32 @eraser(i8* %11, i32 10)
%17 = call i32 @divname(i8* %1, i16 zeroext %2, i8* %9, i8* %10)
%18 = add i16 %4, 1
%19 = call i32 @parsechar(i16 zeroext %18, i8* %11)
%20 = call i32 @strcpy(i8* %0, i8* %9)
%21 = call i32 @strcat(i8* %0, i8* %3)
%22 = call i32 @strcat(i8* %0, i8* %11)
%23 = call i32 @strcat(i8* %0, i8* %10)
ret void
}