#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*/ strcpy(char *, char *);
int sputtype(char *foo, int m) {
  switch (m) {
  case 5:
    strcpy(foo, "unsigned ");
    break;
  case 1:
    strcpy(foo, "bit   ");
    break;
  case 8:
    strcpy(foo, "byte  ");
    break;
  case 64:
    strcpy(foo, "chan  ");
    break;
  case 16:
    strcpy(foo, "short ");
    break;
  case 32:
    strcpy(foo, "int   ");
    break;
  case 275:
    strcpy(foo, "mtype ");
    break;
  case 128:
    strcpy(foo, "struct");
    break;
  case 301:
    strcpy(foo, "proctype");
    break;
  case 278:
    strcpy(foo, "label ");
    return 0;
  default:
    strcpy(foo, "value ");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<sputtype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     11e9 <sputtype+0xd9>
jmp    1133 <sputtype+0x23>
mov    -0x18(%rbp),%eax
sub    $0x5,%eax
je     11d4 <sputtype+0xc4>
jmp    1144 <sputtype+0x34>
mov    -0x18(%rbp),%eax
sub    $0x8,%eax
je     11fe <sputtype+0xee>
jmp    1155 <sputtype+0x45>
mov    -0x18(%rbp),%eax
sub    $0x10,%eax
je     1228 <sputtype+0x118>
jmp    1166 <sputtype+0x56>
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
je     123d <sputtype+0x12d>
jmp    1177 <sputtype+0x67>
mov    -0x18(%rbp),%eax
sub    $0x40,%eax
je     1213 <sputtype+0x103>
jmp    1188 <sputtype+0x78>
mov    -0x18(%rbp),%eax
sub    $0x80,%eax
je     1267 <sputtype+0x157>
jmp    119b <sputtype+0x8b>
mov    -0x18(%rbp),%eax
sub    $0x113,%eax
je     1252 <sputtype+0x142>
jmp    11ae <sputtype+0x9e>
mov    -0x18(%rbp),%eax
sub    $0x116,%eax
je     1291 <sputtype+0x181>
jmp    11c1 <sputtype+0xb1>
mov    -0x18(%rbp),%eax
sub    $0x12d,%eax
je     127c <sputtype+0x16c>
jmp    12ad <sputtype+0x19d>
mov    -0x10(%rbp),%rdi
lea    0xe21(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xe16(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xdde(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xdd0(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xdc2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xdb4(%rip),%rsi
call   1030 <strcpy@plt>
jmp    12c9 <sputtype+0x1b9>
mov    -0x10(%rbp),%rdi
lea    0xda8(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    12d0 <sputtype+0x1c0>
mov    -0x10(%rbp),%rdi
lea    0xd93(%rip),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    12d0 <sputtype+0x1c0>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sputtype>:
push   %rbx
mov    %esi,%eax
mov    $0x1,%ebx
cmp    $0x3f,%esi
jg     1149 <sputtype+0x39>
add    $0xffffffff,%eax
cmp    $0x1f,%eax
ja     11bb <sputtype+0xab>
lea    0xf50(%rip),%rsi
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf43(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
cmp    $0x112,%eax
jle    116e <sputtype+0x5e>
cmp    $0x113,%eax
je     119e <sputtype+0x8e>
cmp    $0x116,%eax
je     11a7 <sputtype+0x97>
cmp    $0x12d,%eax
jne    11bb <sputtype+0xab>
lea    0xf4f(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
cmp    $0x40,%eax
je     11b2 <sputtype+0xa2>
cmp    $0x80,%eax
jne    11bb <sputtype+0xab>
lea    0xf33(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
lea    0xf07(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
lea    0xf0c(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
lea    0xf0a(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
lea    0xf08(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
xor    %ebx,%ebx
lea    0xf14(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
lea    0xedf(%rip),%rsi
jmp    11c4 <sputtype+0xb4>
xor    %ebx,%ebx
lea    0xf07(%rip),%rsi
call   1030 <strcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"unsigned \00"
@.str.1 = [7 x i8] c"bit \00"
@.str.2 = [7 x i8] c"byte \00"
@.str.3 = [7 x i8] c"chan \00"
@.str.4 = [7 x i8] c"short \00"
@.str.5 = [7 x i8] c"int \00"
@.str.6 = [7 x i8] c"mtype \00"
@.str.7 = [7 x i8] c"struct\00"
@.str.8 = [9 x i8] c"proctype\00"
@.str.9 = [7 x i8] c"label \00"
@.str.10 = [7 x i8] c"value \00"
define i32 @sputtype(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %37 [
i32 5, label %7
i32 1, label %10
i32 8, label %13
i32 64, label %16
i32 16, label %19
i32 32, label %22
i32 275, label %25
i32 128, label %28
i32 301, label %31
i32 278, label %34
]
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %40
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %40
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %40
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = call i32 @strcpy(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %40
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = call i32 @strcpy(i8* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %40
22: ; preds = %2
%23 = load i8*, i8** %4
%24 = call i32 @strcpy(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %40
25: ; preds = %2
%26 = load i8*, i8** %4
%27 = call i32 @strcpy(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %40
28: ; preds = %2
%29 = load i8*, i8** %4
%30 = call i32 @strcpy(i8* %29, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %40
31: ; preds = %2
%32 = load i8*, i8** %4
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %40
34: ; preds = %2
%35 = load i8*, i8** %4
%36 = call i32 @strcpy(i8* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %3
br label %41
37: ; preds = %2
%38 = load i8*, i8** %4
%39 = call i32 @strcpy(i8* %38, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %3
br label %41
40: ; preds = %31, %28, %25, %22, %19, %16, %13, %10, %7
store i32 1, i32* %3
br label %41
41: ; preds = %40, %37, %34
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [10 x i8] c"unsigned \00"
@.str.1 = [7 x i8] c"bit \00"
@.str.2 = [7 x i8] c"byte \00"
@.str.3 = [7 x i8] c"chan \00"
@.str.4 = [7 x i8] c"short \00"
@.str.5 = [7 x i8] c"int \00"
@.str.6 = [7 x i8] c"mtype \00"
@.str.7 = [7 x i8] c"struct\00"
@.str.8 = [9 x i8] c"proctype\00"
@.str.9 = [7 x i8] c"label \00"
@.str.10 = [7 x i8] c"value \00"
define i32 @sputtype(i8* %0, i32 %1) {
switch i32 %1, label %12 [
i32 5, label %13
i32 1, label %3
i32 8, label %4
i32 64, label %5
i32 16, label %6
i32 32, label %7
i32 275, label %8
i32 128, label %9
i32 301, label %10
i32 278, label %11
]
3: ; preds = %2
br label %13
4: ; preds = %2
br label %13
5: ; preds = %2
br label %13
6: ; preds = %2
br label %13
7: ; preds = %2
br label %13
8: ; preds = %2
br label %13
9: ; preds = %2
br label %13
10: ; preds = %2
br label %13
11: ; preds = %2
br label %13
12: ; preds = %2
br label %13
13: ; preds = %2, %3, %4, %5, %6, %7, %8, %9, %10, %12, %11
%14 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %5 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), %6 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), %7 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), %8 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), %9 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), %12 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), %11 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %2 ]
%15 = phi i32 [ 1, %3 ], [ 1, %4 ], [ 1, %5 ], [ 1, %6 ], [ 1, %7 ], [ 1, %8 ], [ 1, %9 ], [ 1, %10 ], [ 0, %12 ], [ 0, %11 ], [ 1, %2 ]
%16 = tail call i32 @strcpy(i8* %0, i8* %14)
ret i32 %15
}