#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*/ repl_ta_all(char *, char *, char *);
void chg_kata(char *str, int mode, int voidf) {
  if (voidf) {
    repl_ta_all(str, "void", "");
  } else if (mode == 1) {
    repl_ta_all(str, "void", "");
  }
  repl_ta_all(str, "const", "");
  repl_ta_all(str, "unsigned char", "char");
  repl_ta_all(str, "short int", "int");
  repl_ta_all(str, "unsigned short", "unsigned");
  repl_ta_all(str, "unsigned int", "unsigned");
  repl_ta_all(str, "short unsigned", "unsigned");
  repl_ta_all(str, "short", "int");
  repl_ta_all(str, "signed int", "int");
}


x86 assembly (clang, -O0):
<chg_kata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1148 <chg_kata+0x38>
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xf0f(%rip),%rdx
call   1030 <repl_ta_all@plt>
jmp    116e <chg_kata+0x5e>
cmpl   $0x1,-0xc(%rbp)
jne    1169 <chg_kata+0x59>
mov    -0x8(%rbp),%rdi
lea    0xea3(%rip),%rsi
lea    0xee9(%rip),%rdx
call   1030 <repl_ta_all@plt>
jmp    116e <chg_kata+0x5e>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
lea    0xecd(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe7b(%rip),%rsi
lea    0xe7d(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe72(%rip),%rsi
lea    0xe8d(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe65(%rip),%rsi
lea    0xe80(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe5d(%rip),%rsi
lea    0xe69(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe53(%rip),%rsi
lea    0xe52(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe29(%rip),%rsi
lea    0xe31(%rip),%rdx
call   1030 <repl_ta_all@plt>
mov    -0x8(%rbp),%rdi
lea    0xe1a(%rip),%rsi
lea    0xe1a(%rip),%rdx
call   1030 <repl_ta_all@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chg_kata>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %edx,%edx
jne    1121 <chg_kata+0x11>
cmp    $0x1,%esi
jne    1137 <chg_kata+0x27>
lea    0xed8(%rip),%rsi
lea    0xf1e(%rip),%rdx
mov    %rbx,%rdi
call   1030 <repl_ta_all@plt>
lea    0xec7(%rip),%rsi
lea    0xf08(%rip),%rdx
mov    %rbx,%rdi
call   1030 <repl_ta_all@plt>
lea    0xeb7(%rip),%rsi
lea    0xeb9(%rip),%rdx
mov    %rbx,%rdi
call   1030 <repl_ta_all@plt>
lea    0xeaf(%rip),%rsi
lea    0xeca(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <repl_ta_all@plt>
lea    0xea0(%rip),%rsi
lea    0xebb(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rdx
call   1030 <repl_ta_all@plt>
lea    0xe96(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
call   1030 <repl_ta_all@plt>
lea    0xe91(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
call   1030 <repl_ta_all@plt>
lea    0xe6c(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <repl_ta_all@plt>
lea    0xe62(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <repl_ta_all@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"void\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"const\00"
@.str.3 = [14 x i8] c"unsigned char\00"
@.str.4 = [5 x i8] c"char\00"
@.str.5 = [10 x i8] c"short int\00"
@.str.6 = [4 x i8] c"int\00"
@.str.7 = [15 x i8] c"unsigned short\00"
@.str.8 = [9 x i8] c"unsigned\00"
@.str.9 = [13 x i8] c"unsigned int\00"
@.str.10 = [15 x i8] c"short unsigned\00"
@.str.11 = [6 x i8] c"short\00"
@.str.12 = [11 x i8] c"signed int\00"
define void @chg_kata(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = call i32 @repl_ta_all(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %19
12: ; preds = %3
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %4
%17 = call i32 @repl_ta_all(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %15, %12
br label %19
19: ; preds = %18, %9
%20 = load i8*, i8** %4
%21 = call i32 @repl_ta_all(i8* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%22 = load i8*, i8** %4
%23 = call i32 @repl_ta_all(i8* %22, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%24 = load i8*, i8** %4
%25 = call i32 @repl_ta_all(i8* %24, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%26 = load i8*, i8** %4
%27 = call i32 @repl_ta_all(i8* %26, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%28 = load i8*, i8** %4
%29 = call i32 @repl_ta_all(i8* %28, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%30 = load i8*, i8** %4
%31 = call i32 @repl_ta_all(i8* %30, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%32 = load i8*, i8** %4
%33 = call i32 @repl_ta_all(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%34 = load i8*, i8** %4
%35 = call i32 @repl_ta_all(i8* %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"void\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [6 x i8] c"const\00"
@.str.3 = [14 x i8] c"unsigned char\00"
@.str.4 = [5 x i8] c"char\00"
@.str.5 = [10 x i8] c"short int\00"
@.str.6 = [4 x i8] c"int\00"
@.str.7 = [15 x i8] c"unsigned short\00"
@.str.8 = [9 x i8] c"unsigned\00"
@.str.9 = [13 x i8] c"unsigned int\00"
@.str.10 = [15 x i8] c"short unsigned\00"
@.str.11 = [6 x i8] c"short\00"
@.str.12 = [11 x i8] c"signed int\00"
define void @chg_kata(i8* %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %2, 0
%5 = icmp eq i32 %1, 1
%6 = or i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %3, %7
%10 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%14 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%15 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%16 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i32 @repl_ta_all(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0))
ret void
}