#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 */
typedef int /*<<< orphan*/ uint8_t;
struct netio {
  int dummy;
};
struct atrf_dsc {
  int dummy;
};

/* Variables and functions */
scalar_t__ atrf_error(struct atrf_dsc *);
int atrf_interrupt_wait(struct atrf_dsc *, int);
int /*<<< orphan*/ atrf_reg_read(struct atrf_dsc *, int);
scalar_t__ atrf_set_clkm(struct atrf_dsc *, int);
int /*<<< orphan*/ atrf_sram_read(struct atrf_dsc *, int);
int cmd_two(struct atrf_dsc *, struct netio *, char const *);
int get_num(struct netio *, int, int *);
int netio_printf(struct netio *, char *, ...);
int /*<<< orphan*/ strcasecmp(char const *, char *);
int cmd_more(struct atrf_dsc *dsc, struct netio *netio, const char *cmd) {
  int n, ret;
  if (!strcasecmp(cmd, "set"))
    return cmd_two(dsc, netio, cmd);
  if (!strcasecmp(cmd, "setram"))
    return cmd_two(dsc, netio, cmd);
  if (!strcasecmp(cmd, "write"))
    return cmd_two(dsc, netio, cmd);
  if (!strcasecmp(cmd, "slp_tr"))
    return cmd_two(dsc, netio, cmd);
  n = get_num(netio, 1, &ret);
  if (n < 0)
    return ret;
  if (!strcasecmp(cmd, "clkm")) {
    if (n > 16)
      return netio_printf(netio, "-bad argument\n");
    if (atrf_set_clkm(dsc, n) < 0)
      return netio_printf(netio, "-error\n");
    return netio_printf(netio, "+\n");
  }
  if (!strcasecmp(cmd, "get")) {
    uint8_t res;
    if (n > 255)
      return netio_printf(netio, "-bad argument\n");
    res = atrf_reg_read(dsc, n);
    if (atrf_error(dsc))
      return netio_printf(netio, "-I/O error\n");
    return netio_printf(netio, "+0x%02x\n", res);
  }
  if (!strcasecmp(cmd, "wait")) {
    int res;
    res = atrf_interrupt_wait(dsc, n);
    if (atrf_error(dsc))
      return netio_printf(netio, "-I/O error\n");
    return netio_printf(netio, "+0x%02x\n", res);
  }
  if (!strcasecmp(cmd, "getram")) {
    uint8_t res;
    if (n > 255)
      return netio_printf(netio, "-bad argument\n");
    res = atrf_sram_read(dsc, n);
    if (atrf_error(dsc))
      return netio_printf(netio, "-I/O error\n");
    return netio_printf(netio, "+0x%02x\n", res);
  }
  return netio_printf(netio, "-unrecognized command\n");
}


x86 assembly (clang, -O0):
<cmd_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11d6 <cmd_more+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <cmd_two@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xe23(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1208 <cmd_more+0x78>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <cmd_two@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xdf8(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    123a <cmd_more+0xaa>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <cmd_two@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xdcc(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    126c <cmd_more+0xdc>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1070 <cmd_two@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
lea    -0x28(%rbp),%rdx
call   1050 <get_num@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1296 <cmd_more+0x106>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xd77(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    131d <cmd_more+0x18d>
cmpl   $0x10,-0x24(%rbp)
jle    12d3 <cmd_more+0x143>
mov    -0x18(%rbp),%rdi
lea    0xd59(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1090 <atrf_set_clkm@plt>
cmp    $0x0,%rax
jge    1303 <cmd_more+0x173>
mov    -0x18(%rbp),%rdi
lea    0xd38(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x18(%rbp),%rdi
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xd0f(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    13b6 <cmd_more+0x226>
cmpl   $0xff,-0x24(%rbp)
jle    135d <cmd_more+0x1cd>
mov    -0x18(%rbp),%rdi
lea    0xccf(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   10a0 <atrf_reg_read@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <atrf_error@plt>
cmp    $0x0,%rax
je     1399 <cmd_more+0x209>
mov    -0x18(%rbp),%rdi
lea    0xcb1(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x18(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xca0(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xc8f(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1428 <cmd_more+0x298>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <atrf_interrupt_wait@plt>
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <atrf_error@plt>
cmp    $0x0,%rax
je     140b <cmd_more+0x27b>
mov    -0x18(%rbp),%rdi
lea    0xc3f(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%edx
lea    0xc2e(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x20(%rbp),%rdi
lea    0xc22(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    14c1 <cmd_more+0x331>
cmpl   $0xff,-0x24(%rbp)
jle    1468 <cmd_more+0x2d8>
mov    -0x18(%rbp),%rdi
lea    0xbc4(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1060 <atrf_sram_read@plt>
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <atrf_error@plt>
cmp    $0x0,%rax
je     14a4 <cmd_more+0x314>
mov    -0x18(%rbp),%rdi
lea    0xba6(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x18(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xb95(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
jmp    14d6 <cmd_more+0x346>
mov    -0x18(%rbp),%rdi
lea    0xb90(%rip),%rsi
mov    $0x0,%al
call   10b0 <netio_printf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_more>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xe59(%rip),%rsi
mov    %rdx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1268 <cmd_more+0xd8>
lea    0xe46(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1268 <cmd_more+0xd8>
lea    0xe36(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1268 <cmd_more+0xd8>
lea    0xe25(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1268 <cmd_more+0xd8>
lea    0x4(%rsp),%rdx
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <get_num@plt>
test   %eax,%eax
js     1280 <cmd_more+0xf0>
mov    %eax,%ebp
lea    0xe01(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1289 <cmd_more+0xf9>
lea    0xe0d(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     12a6 <cmd_more+0x116>
lea    0xe13(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     12ba <cmd_more+0x12a>
lea    0xe05(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     12c6 <cmd_more+0x136>
lea    0xdf9(%rip),%rsi
jmp    1300 <cmd_more+0x170>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <cmd_two@plt>
mov    0x4(%rsp),%eax
jmp    130a <cmd_more+0x17a>
cmp    $0x11,%ebp
jae    12ce <cmd_more+0x13e>
mov    %r15,%rdi
mov    %ebp,%esi
call   1090 <atrf_set_clkm@plt>
test   %rax,%rax
js     12d7 <cmd_more+0x147>
lea    0xd90(%rip),%rsi
jmp    1300 <cmd_more+0x170>
cmp    $0x100,%ebp
jae    12ce <cmd_more+0x13e>
mov    %r15,%rdi
mov    %ebp,%esi
call   10a0 <atrf_reg_read@plt>
jmp    12ea <cmd_more+0x15a>
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <atrf_interrupt_wait@plt>
jmp    12ea <cmd_more+0x15a>
cmp    $0x100,%ebp
jb     12e0 <cmd_more+0x150>
lea    0xd48(%rip),%rsi
jmp    1300 <cmd_more+0x170>
lea    0xd4e(%rip),%rsi
jmp    1300 <cmd_more+0x170>
mov    %r15,%rdi
mov    %ebp,%esi
call   1060 <atrf_sram_read@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1080 <atrf_error@plt>
test   %rax,%rax
je     1315 <cmd_more+0x185>
lea    0xd3b(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   10b0 <netio_printf@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd2b(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   10b0 <netio_printf@plt>
jmp    130a <cmd_more+0x17a>

LLVM IR (-O0):
%struct.atrf_dsc = type { i32 }
%struct.netio = type { i32 }
@.str = [4 x i8] c"set\00"
@.str.1 = [7 x i8] c"setram\00"
@.str.2 = [6 x i8] c"write\00"
@.str.3 = [7 x i8] c"slp_tr\00"
@.str.4 = [5 x i8] c"clkm\00"
@.str.5 = [15 x i8] c"-bad argument\0A\00"
@.str.6 = [8 x i8] c"-error\0A\00"
@.str.7 = [3 x i8] c"+\0A\00"
@.str.8 = [4 x i8] c"get\00"
@.str.9 = [12 x i8] c"-I/O error\0A\00"
@.str.10 = [9 x i8] c"+0x%02x\0A\00"
@.str.11 = [5 x i8] c"wait\00"
@.str.12 = [7 x i8] c"getram\00"
@.str.13 = [23 x i8] c"-unrecognized command\0A\00"
define i32 @cmd_more(%struct.atrf_dsc* %0, %struct.netio* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.atrf_dsc*
%6 = alloca %struct.netio*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.atrf_dsc* %0, %struct.atrf_dsc** %5
store %struct.netio* %1, %struct.netio** %6
store i8* %2, i8** %7
%13 = load i8*, i8** %7
%14 = call i32 @strcasecmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %21, label %16
16: ; preds = %3
%17 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%18 = load %struct.netio*, %struct.netio** %6
%19 = load i8*, i8** %7
%20 = call i32 @cmd_two(%struct.atrf_dsc* %17, %struct.netio* %18, i8* %19)
store i32 %20, i32* %4
br label %145
21: ; preds = %3
%22 = load i8*, i8** %7
%23 = call i32 @strcasecmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %30, label %25
25: ; preds = %21
%26 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%27 = load %struct.netio*, %struct.netio** %6
%28 = load i8*, i8** %7
%29 = call i32 @cmd_two(%struct.atrf_dsc* %26, %struct.netio* %27, i8* %28)
store i32 %29, i32* %4
br label %145
30: ; preds = %21
%31 = load i8*, i8** %7
%32 = call i32 @strcasecmp(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %39, label %34
34: ; preds = %30
%35 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%36 = load %struct.netio*, %struct.netio** %6
%37 = load i8*, i8** %7
%38 = call i32 @cmd_two(%struct.atrf_dsc* %35, %struct.netio* %36, i8* %37)
store i32 %38, i32* %4
br label %145
39: ; preds = %30
%40 = load i8*, i8** %7
%41 = call i32 @strcasecmp(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp ne i32 %41, 0
br i1 %42, label %48, label %43
43: ; preds = %39
%44 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%45 = load %struct.netio*, %struct.netio** %6
%46 = load i8*, i8** %7
%47 = call i32 @cmd_two(%struct.atrf_dsc* %44, %struct.netio* %45, i8* %46)
store i32 %47, i32* %4
br label %145
48: ; preds = %39
%49 = load %struct.netio*, %struct.netio** %6
%50 = call i32 @get_num(%struct.netio* %49, i32 1, i32* %9)
store i32 %50, i32* %8
%51 = load i32, i32* %8
%52 = icmp slt i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %48
%54 = load i32, i32* %9
store i32 %54, i32* %4
br label %145
55: ; preds = %48
%56 = load i8*, i8** %7
%57 = call i32 @strcasecmp(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%58 = icmp ne i32 %57, 0
br i1 %58, label %76, label %59
59: ; preds = %55
%60 = load i32, i32* %8
%61 = icmp sgt i32 %60, 16
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load %struct.netio*, %struct.netio** %6
%64 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %63, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i32 %64, i32* %4
br label %145
65: ; preds = %59
%66 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%67 = load i32, i32* %8
%68 = call i64 @atrf_set_clkm(%struct.atrf_dsc* %66, i32 %67)
%69 = icmp slt i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = load %struct.netio*, %struct.netio** %6
%72 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %71, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
store i32 %72, i32* %4
br label %145
73: ; preds = %65
%74 = load %struct.netio*, %struct.netio** %6
%75 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %74, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
store i32 %75, i32* %4
br label %145
76: ; preds = %55
%77 = load i8*, i8** %7
%78 = call i32 @strcasecmp(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
br i1 %79, label %100, label %80
80: ; preds = %76
%81 = load i32, i32* %8
%82 = icmp sgt i32 %81, 255
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = load %struct.netio*, %struct.netio** %6
%85 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %84, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i32 %85, i32* %4
br label %145
86: ; preds = %80
%87 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%88 = load i32, i32* %8
%89 = call i32 @atrf_reg_read(%struct.atrf_dsc* %87, i32 %88)
store i32 %89, i32* %10
%90 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%91 = call i64 @atrf_error(%struct.atrf_dsc* %90)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %86
%94 = load %struct.netio*, %struct.netio** %6
%95 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %94, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
store i32 %95, i32* %4
br label %145
96: ; preds = %86
%97 = load %struct.netio*, %struct.netio** %6
%98 = load i32, i32* %10
%99 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %97, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %98)
store i32 %99, i32* %4
br label %145
100: ; preds = %76
%101 = load i8*, i8** %7
%102 = call i32 @strcasecmp(i8* %101, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%103 = icmp ne i32 %102, 0
br i1 %103, label %118, label %104
104: ; preds = %100
%105 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%106 = load i32, i32* %8
%107 = call i32 @atrf_interrupt_wait(%struct.atrf_dsc* %105, i32 %106)
store i32 %107, i32* %11
%108 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%109 = call i64 @atrf_error(%struct.atrf_dsc* %108)
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %114
111: ; preds = %104
%112 = load %struct.netio*, %struct.netio** %6
%113 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %112, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
store i32 %113, i32* %4
br label %145
114: ; preds = %104
%115 = load %struct.netio*, %struct.netio** %6
%116 = load i32, i32* %11
%117 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %115, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %116)
store i32 %117, i32* %4
br label %145
118: ; preds = %100
%119 = load i8*, i8** %7
%120 = call i32 @strcasecmp(i8* %119, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%121 = icmp ne i32 %120, 0
br i1 %121, label %142, label %122
122: ; preds = %118
%123 = load i32, i32* %8
%124 = icmp sgt i32 %123, 255
br i1 %124, label %125, label %128
125: ; preds = %122
%126 = load %struct.netio*, %struct.netio** %6
%127 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %126, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
store i32 %127, i32* %4
br label %145
128: ; preds = %122
%129 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%130 = load i32, i32* %8
%131 = call i32 @atrf_sram_read(%struct.atrf_dsc* %129, i32 %130)
store i32 %131, i32* %12
%132 = load %struct.atrf_dsc*, %struct.atrf_dsc** %5
%133 = call i64 @atrf_error(%struct.atrf_dsc* %132)
%134 = icmp ne i64 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %128
%136 = load %struct.netio*, %struct.netio** %6
%137 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %136, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
store i32 %137, i32* %4
br label %145
138: ; preds = %128
%139 = load %struct.netio*, %struct.netio** %6
%140 = load i32, i32* %12
%141 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %139, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %140)
store i32 %141, i32* %4
br label %145
142: ; preds = %118
%143 = load %struct.netio*, %struct.netio** %6
%144 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %143, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
store i32 %144, i32* %4
br label %145
145: ; preds = %142, %138, %135, %125, %114, %111, %96, %93, %83, %73, %70, %62, %53, %43, %34, %25, %16
%146 = load i32, i32* %4
ret i32 %146
}

LLVM IR (-O2):
%struct.atrf_dsc = type { i32 }
%struct.netio = type { i32 }
@.str = [4 x i8] c"set\00"
@.str.1 = [7 x i8] c"setram\00"
@.str.2 = [6 x i8] c"write\00"
@.str.3 = [7 x i8] c"slp_tr\00"
@.str.4 = [5 x i8] c"clkm\00"
@.str.5 = [15 x i8] c"-bad argument\0A\00"
@.str.6 = [8 x i8] c"-error\0A\00"
@.str.7 = [3 x i8] c"+\0A\00"
@.str.8 = [4 x i8] c"get\00"
@.str.9 = [12 x i8] c"-I/O error\0A\00"
@.str.10 = [9 x i8] c"+0x%02x\0A\00"
@.str.11 = [5 x i8] c"wait\00"
@.str.12 = [7 x i8] c"getram\00"
@.str.13 = [23 x i8] c"-unrecognized command\0A\00"
define i32 @cmd_more(%struct.atrf_dsc* %0, %struct.netio* %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @cmd_two(%struct.atrf_dsc* %0, %struct.netio* %1, i8* %2)
br label %87
10: ; preds = %3
%11 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @cmd_two(%struct.atrf_dsc* %0, %struct.netio* %1, i8* %2)
br label %87
15: ; preds = %10
%16 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @cmd_two(%struct.atrf_dsc* %0, %struct.netio* %1, i8* %2)
br label %87
20: ; preds = %15
%21 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 @cmd_two(%struct.atrf_dsc* %0, %struct.netio* %1, i8* %2)
br label %87
25: ; preds = %20
%26 = call i32 @get_num(%struct.netio* %1, i32 1, i32* %4)
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = load i32, i32* %4
br label %87
30: ; preds = %25
%31 = call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %44
33: ; preds = %30
%34 = icmp ugt i32 %26, 16
br i1 %34, label %35, label %37
35: ; preds = %33
%36 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %87
37: ; preds = %33
%38 = call i64 @atrf_set_clkm(%struct.atrf_dsc* %0, i32 %26)
%39 = icmp slt i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %87
42: ; preds = %37
%43 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %87
44: ; preds = %30
%45 = call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %59
47: ; preds = %44
%48 = icmp ugt i32 %26, 255
br i1 %48, label %49, label %51
49: ; preds = %47
%50 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %87
51: ; preds = %47
%52 = call i32 @atrf_reg_read(%struct.atrf_dsc* %0, i32 %26)
%53 = call i64 @atrf_error(%struct.atrf_dsc* %0)
%54 = icmp eq i64 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %51
%56 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %87
57: ; preds = %51
%58 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %52)
br label %87
59: ; preds = %44
%60 = call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %70
62: ; preds = %59
%63 = call i32 @atrf_interrupt_wait(%struct.atrf_dsc* %0, i32 %26)
%64 = call i64 @atrf_error(%struct.atrf_dsc* %0)
%65 = icmp eq i64 %64, 0
br i1 %65, label %68, label %66
66: ; preds = %62
%67 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %87
68: ; preds = %62
%69 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %63)
br label %87
70: ; preds = %59
%71 = call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %85
73: ; preds = %70
%74 = icmp ugt i32 %26, 255
br i1 %74, label %75, label %77
75: ; preds = %73
%76 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
br label %87
77: ; preds = %73
%78 = call i32 @atrf_sram_read(%struct.atrf_dsc* %0, i32 %26)
%79 = call i64 @atrf_error(%struct.atrf_dsc* %0)
%80 = icmp eq i64 %79, 0
br i1 %80, label %83, label %81
81: ; preds = %77
%82 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
br label %87
83: ; preds = %77
%84 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %78)
br label %87
85: ; preds = %70
%86 = call i32 (%struct.netio*, i8*, ...) @netio_printf(%struct.netio* %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0))
br label %87
87: ; preds = %75, %81, %83, %66, %68, %49, %55, %57, %85, %42, %40, %35, %28, %23, %18, %13, %8
%88 = phi i32 [ %29, %28 ], [ %86, %85 ], [ %36, %35 ], [ %41, %40 ], [ %43, %42 ], [ %24, %23 ], [ %19, %18 ], [ %14, %13 ], [ %9, %8 ], [ %50, %49 ], [ %56, %55 ], [ %58, %57 ], [ %67, %66 ], [ %69, %68 ], [ %76, %75 ], [ %82, %81 ], [ %84, %83 ]
ret i32 %88
}