#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void assembleName(char name[25], int hydroxy, int oxo, int gluc) {
  strcpy(name, "-M (");
  switch (oxo) {
  case 2:
    strcat(name, "di-");
    break;
  case 3:
    strcat(name, "tri-");
    break;
  case 4:
    strcat(name, "quattro-");
    break;
  case 5:
    strcat(name, "penta-");
    break;
  case 6:
    strcat(name, "hexa-");
    break;
  case 7:
    strcat(name, "hepta-");
    break;
  case 8:
    strcat(name, "octa-");
    break;
  case 9:
    strcat(name, "nona-");
    break;
  case 10:
    strcat(name, "deca-");
    break;
  }
  if (oxo > 0) {
    strcat(name, "oxo-");
  }
  switch (hydroxy) {
  case 2:
    strcat(name, "di-");
    break;
  case 3:
    strcat(name, "tri-");
    break;
  case 4:
    strcat(name, "quattro-");
    break;
  case 5:
    strcat(name, "penta-");
    break;
  case 6:
    strcat(name, "hexa-");
    break;
  case 7:
    strcat(name, "hepta-");
    break;
  case 8:
    strcat(name, "octa-");
    break;
  case 9:
    strcat(name, "nona-");
    break;
  case 10:
    strcat(name, "deca-");
    break;
  }
  if (hydroxy > 0) {
    strcat(name, "HO-");
  }
  if (gluc == 1) {
    strcat(name, ") Gluc");
  } else {
    strcat(name, ")");
  }
}


x86 assembly (clang, -O0):
<assembleName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf08(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x20(%rbp)
sub    $0x8,%eax
ja     1226 <assembleName+0x106>
mov    -0x20(%rbp),%rax
lea    0xe9b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xed4(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1040 <strcat@plt>
jmp    1226 <assembleName+0x106>
mov    -0x8(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1040 <strcat@plt>
cmpl   $0x0,-0x10(%rbp)
jle    1240 <assembleName+0x120>
mov    -0x8(%rbp),%rdi
lea    0xe4a(%rip),%rsi
call   1040 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x8,%eax
ja     1321 <assembleName+0x201>
mov    -0x28(%rbp),%rax
lea    0xdc4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rdi
lea    0xdd9(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xdc8(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xdb8(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xdac(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xd9e(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xd8f(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xd81(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xd72(%rip),%rsi
call   1040 <strcat@plt>
jmp    1321 <assembleName+0x201>
mov    -0x8(%rbp),%rdi
lea    0xd63(%rip),%rsi
call   1040 <strcat@plt>
cmpl   $0x0,-0xc(%rbp)
jle    133b <assembleName+0x21b>
mov    -0x8(%rbp),%rdi
lea    0xd54(%rip),%rsi
call   1040 <strcat@plt>
cmpl   $0x1,-0x14(%rbp)
jne    135a <assembleName+0x23a>
mov    -0x8(%rbp),%rdi
lea    0xd3e(%rip),%rsi
call   1040 <strcat@plt>
jmp    136a <assembleName+0x24a>
mov    -0x8(%rbp),%rdi
lea    0xd30(%rip),%rsi
call   1040 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assembleName>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %rdi,%rbx
lea    0xec7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x2(%rbp),%eax
cmp    $0x9,%eax
jae    115d <assembleName+0x3d>
cltq
lea    0x2c89(%rip),%rcx
mov    (%rcx,%rax,8),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
jmp    1161 <assembleName+0x41>
test   %ebp,%ebp
jle    1170 <assembleName+0x50>
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    -0x2(%r15),%eax
cmp    $0x9,%eax
jae    1190 <assembleName+0x70>
cltq
lea    0x2c56(%rip),%rcx
mov    (%rcx,%rax,8),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
jmp    1195 <assembleName+0x75>
test   %r15d,%r15d
jle    11a4 <assembleName+0x84>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
cmp    $0x1,%r14d
lea    0xe97(%rip),%rax
lea    0xe97(%rip),%rsi
cmove  %rax,%rsi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"-M (\00"
@.str.1 = [4 x i8] c"di-\00"
@.str.2 = [5 x i8] c"tri-\00"
@.str.3 = [9 x i8] c"quattro-\00"
@.str.4 = [7 x i8] c"penta-\00"
@.str.5 = [6 x i8] c"hexa-\00"
@.str.6 = [7 x i8] c"hepta-\00"
@.str.7 = [6 x i8] c"octa-\00"
@.str.8 = [6 x i8] c"nona-\00"
@.str.9 = [6 x i8] c"deca-\00"
@.str.10 = [5 x i8] c"oxo-\00"
@.str.11 = [4 x i8] c"HO-\00"
@.str.12 = [7 x i8] c") Gluc\00"
@.str.13 = [2 x i8] c")\00"
define void @assembleName(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %7
switch i32 %11, label %39 [
i32 2, label %12
i32 3, label %15
i32 4, label %18
i32 5, label %21
i32 6, label %24
i32 7, label %27
i32 8, label %30
i32 9, label %33
i32 10, label %36
]
12: ; preds = %4
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %39
15: ; preds = %4
%16 = load i8*, i8** %5
%17 = call i32 @strcat(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %39
18: ; preds = %4
%19 = load i8*, i8** %5
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %39
21: ; preds = %4
%22 = load i8*, i8** %5
%23 = call i32 @strcat(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %39
24: ; preds = %4
%25 = load i8*, i8** %5
%26 = call i32 @strcat(i8* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %39
27: ; preds = %4
%28 = load i8*, i8** %5
%29 = call i32 @strcat(i8* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %39
30: ; preds = %4
%31 = load i8*, i8** %5
%32 = call i32 @strcat(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %39
33: ; preds = %4
%34 = load i8*, i8** %5
%35 = call i32 @strcat(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %39
36: ; preds = %4
%37 = load i8*, i8** %5
%38 = call i32 @strcat(i8* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %39
39: ; preds = %4, %36, %33, %30, %27, %24, %21, %18, %15, %12
%40 = load i32, i32* %7
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i8*, i8** %5
%44 = call i32 @strcat(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %45
45: ; preds = %42, %39
%46 = load i32, i32* %6
switch i32 %46, label %74 [
i32 2, label %47
i32 3, label %50
i32 4, label %53
i32 5, label %56
i32 6, label %59
i32 7, label %62
i32 8, label %65
i32 9, label %68
i32 10, label %71
]
47: ; preds = %45
%48 = load i8*, i8** %5
%49 = call i32 @strcat(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %74
50: ; preds = %45
%51 = load i8*, i8** %5
%52 = call i32 @strcat(i8* %51, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %74
53: ; preds = %45
%54 = load i8*, i8** %5
%55 = call i32 @strcat(i8* %54, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %74
56: ; preds = %45
%57 = load i8*, i8** %5
%58 = call i32 @strcat(i8* %57, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %74
59: ; preds = %45
%60 = load i8*, i8** %5
%61 = call i32 @strcat(i8* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %74
62: ; preds = %45
%63 = load i8*, i8** %5
%64 = call i32 @strcat(i8* %63, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %74
65: ; preds = %45
%66 = load i8*, i8** %5
%67 = call i32 @strcat(i8* %66, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %74
68: ; preds = %45
%69 = load i8*, i8** %5
%70 = call i32 @strcat(i8* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
br label %74
71: ; preds = %45
%72 = load i8*, i8** %5
%73 = call i32 @strcat(i8* %72, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %74
74: ; preds = %45, %71, %68, %65, %62, %59, %56, %53, %50, %47
%75 = load i32, i32* %6
%76 = icmp sgt i32 %75, 0
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = load i8*, i8** %5
%79 = call i32 @strcat(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %80
80: ; preds = %77, %74
%81 = load i32, i32* %8
%82 = icmp eq i32 %81, 1
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = load i8*, i8** %5
%85 = call i32 @strcat(i8* %84, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
br label %89
86: ; preds = %80
%87 = load i8*, i8** %5
%88 = call i32 @strcat(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %89
89: ; preds = %86, %83
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"-M (\00"
@.str.1 = [4 x i8] c"di-\00"
@.str.2 = [5 x i8] c"tri-\00"
@.str.3 = [9 x i8] c"quattro-\00"
@.str.4 = [7 x i8] c"penta-\00"
@.str.5 = [6 x i8] c"hexa-\00"
@.str.6 = [7 x i8] c"hepta-\00"
@.str.7 = [6 x i8] c"octa-\00"
@.str.8 = [6 x i8] c"nona-\00"
@.str.9 = [6 x i8] c"deca-\00"
@.str.10 = [5 x i8] c"oxo-\00"
@.str.11 = [4 x i8] c"HO-\00"
@.str.12 = [7 x i8] c") Gluc\00"
@.str.13 = [2 x i8] c")\00"
@switch.table.assembleName.14 = [9 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), 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.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0)]
define void @assembleName(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = add i32 %2, -2
%7 = icmp ult i32 %6, 9
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = icmp sgt i32 %2, 0
br i1 %9, label %15, label %17
10: ; preds = %4
%11 = sext i32 %6 to i64
%12 = getelementptr inbounds [9 x i8*], [9 x i8*]* @switch.table.assembleName.14, i64 0, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 @strcat(i8* %0, i8* %13)
br label %15
15: ; preds = %10, %8
%16 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %17
17: ; preds = %15, %8
%18 = add i32 %1, -2
%19 = icmp ult i32 %18, 9
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = icmp sgt i32 %1, 0
br i1 %21, label %27, label %29
22: ; preds = %17
%23 = sext i32 %18 to i64
%24 = getelementptr inbounds [9 x i8*], [9 x i8*]* @switch.table.assembleName.14, i64 0, i64 %23
%25 = load i8*, i8** %24
%26 = tail call i32 @strcat(i8* %0, i8* %25)
br label %27
27: ; preds = %22, %20
%28 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
br label %29
29: ; preds = %27, %20
%30 = icmp eq i32 %3, 1
%31 = select i1 %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0)
%32 = tail call i32 @strcat(i8* %0, i8* %31)
ret void
}