#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*/ optval;

/* Variables and functions */
float atof(char *);
int atoi(char *);
int /*<<< orphan*/ exit(int);
scalar_t__ kgetkensopt(int, char *, int *);
scalar_t__ ksetkensopt(int, char *, int);
int /*<<< orphan*/ print_usage(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char *progname = argv[0];
  int isget;
  int optname;
  char optval[4];
  int optlen = sizeof(optval);
  if (argc < 3 || argc > 4) {
    print_usage(progname);
    exit(1);
  }
  if (strcmp(argv[1], "get") == 0)
    isget = 1;
  else if (strcmp(argv[1], "set") == 0 && argc == 4)
    isget = 0;
  else {
    print_usage(progname);
    exit(1);
  }
  if (strcmp(argv[2], "delay") == 0) {
    optname = 0;
    if (!isget)
      *(int *)optval = atoi(argv[3]);
  } else if (strcmp(argv[2], "drop_rate") == 0) {
    optname = 1;
    if (!isget)
      *(float *)optval = atof(argv[3]);
  } else if (strcmp(argv[2], "reorder_rate") == 0) {
    optname = 2;
    if (!isget)
      *(float *)optval = atof(argv[3]);
  } else if (strcmp(argv[2], "enable_seth") == 0) {
    optname = 3;
    if (argc != 4) {
      print_usage(progname);
      exit(1);
    }
    *(int *)optval = atoi(argv[3]);
  } else if (strcmp(argv[2], "disable_seth") == 0) {
    optname = 4;
    if (argc != 4) {
      print_usage(progname);
      exit(1);
    }
    *(int *)optval = atoi(argv[3]);
  } else if (strcmp(argv[2], "krip_update_interval") == 0) {
    optname = 5;
    if (!isget)
      *(int *)optval = atoi(argv[3]);
  } else if (strcmp(argv[2], "krip_timeout") == 0) {
    optname = 6;
    if (!isget)
      *(int *)optval = atoi(argv[3]);
  } else {
    print_usage(progname);
    exit(1);
  }
  if (isget) {
    if (kgetkensopt(optname, optval, &optlen) == 0) {
      switch (optname) {
      case 0:
        printf("delay: %d\n", *(int *)optval);
        break;
      case 1:
        printf("drop_rate: %f\n", *(float *)optval);
        break;
      case 2:
        printf("reorder_rate: %f\n", *(float *)optval);
        break;
      case 3:
        printf("enable_seth: %d\n", *(int *)optval);
        break;
      case 4:
        printf("disable_seth: %d\n", *(int *)optval);
        break;
      case 5:
        printf("krip_update_interval: %d\n", *(int *)optval);
        break;
      case 6:
        printf("krip_timeout: %d\n", *(int *)optval);
        break;
      }
    } else
      printf("failed\n");
  } else {
    if (ksetkensopt(optname, optval, optlen) == 0)
      printf("ok\n");
    else
      printf("failed\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,-0x28(%rbp)
cmpl   $0x3,-0x8(%rbp)
jl     11bc <main+0x3c>
cmpl   $0x4,-0x8(%rbp)
jle    11cf <main+0x4f>
mov    -0x18(%rbp),%rdi
call   10a0 <print_usage@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3e(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11f9 <main+0x79>
movl   $0x1,-0x1c(%rbp)
jmp    1245 <main+0xc5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe18(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    122d <main+0xad>
cmpl   $0x4,-0x8(%rbp)
jne    122d <main+0xad>
movl   $0x0,-0x1c(%rbp)
jmp    1240 <main+0xc0>
mov    -0x18(%rbp),%rdi
call   10a0 <print_usage@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    1245 <main+0xc5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdd0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1289 <main+0x109>
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1284 <main+0x104>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    147c <main+0x2fc>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd92(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12cf <main+0x14f>
movl   $0x1,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    12ca <main+0x14a>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x24(%rbp)
jmp    1477 <main+0x2f7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd56(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1315 <main+0x195>
movl   $0x2,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1310 <main+0x190>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x24(%rbp)
jmp    1472 <main+0x2f2>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd1d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    136c <main+0x1ec>
movl   $0x3,-0x20(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     1357 <main+0x1d7>
mov    -0x18(%rbp),%rdi
call   10a0 <print_usage@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    146d <main+0x2ed>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xcd2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    13c3 <main+0x243>
movl   $0x4,-0x20(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     13ae <main+0x22e>
mov    -0x18(%rbp),%rdi
call   10a0 <print_usage@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    1468 <main+0x2e8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc88(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1407 <main+0x287>
movl   $0x5,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1402 <main+0x282>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    1463 <main+0x2e3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xc59(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    144b <main+0x2cb>
movl   $0x6,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1446 <main+0x2c6>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    145e <main+0x2de>
mov    -0x18(%rbp),%rdi
call   10a0 <print_usage@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
jmp    1463 <main+0x2e3>
jmp    1468 <main+0x2e8>
jmp    146d <main+0x2ed>
jmp    1472 <main+0x2f2>
jmp    1477 <main+0x2f7>
jmp    147c <main+0x2fc>
cmpl   $0x0,-0x1c(%rbp)
je     157e <main+0x3fe>
mov    -0x20(%rbp),%edi
lea    -0x24(%rbp),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <kgetkensopt@plt>
cmp    $0x0,%rax
jne    156b <main+0x3eb>
mov    -0x20(%rbp),%eax
mov    %rax,-0x30(%rbp)
sub    $0x6,%rax
ja     1566 <main+0x3e6>
mov    -0x30(%rbp),%rax
lea    0xb44(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x24(%rbp),%esi
lea    0xbad(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1566 <main+0x3e6>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb9c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1566 <main+0x3e6>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xb8f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1566 <main+0x3e6>
mov    -0x24(%rbp),%esi
lea    0xb8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1566 <main+0x3e6>
mov    -0x24(%rbp),%esi
lea    0xb86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1566 <main+0x3e6>
mov    -0x24(%rbp),%esi
lea    0xb82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1566 <main+0x3e6>
mov    -0x24(%rbp),%esi
lea    0xb86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1579 <main+0x3f9>
lea    0xb85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15bd <main+0x43d>
mov    -0x20(%rbp),%edi
lea    -0x24(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1060 <ksetkensopt@plt>
cmp    $0x0,%rax
jne    15aa <main+0x42a>
lea    0xb61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15b8 <main+0x438>
lea    0xb46(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15bd <main+0x43d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%r12d
mov    (%rsi),%r14
movl   $0x4,0xc(%rsp)
lea    -0x5(%r12),%eax
cmp    $0xfffffffd,%eax
jbe    13aa <main+0x21a>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe56(%rip),%rsi
call   1080 <strcmp@plt>
mov    %rax,%r15
test   %rax,%rax
je     125e <main+0xce>
mov    0x8(%rbx),%rdi
lea    0xe3e(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x4,%r12d
jne    13aa <main+0x21a>
test   %rax,%rax
jne    13aa <main+0x21a>
mov    0x10(%rbx),%rdi
lea    0xe1f(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     132e <main+0x19e>
lea    0x10(%rbx),%rbp
mov    0x0(%rbp),%rdi
lea    0xe08(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     133f <main+0x1af>
mov    0x0(%rbp),%rdi
lea    0xdf9(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    12ad <main+0x11d>
mov    0x18(%rbx),%rdi
call   1040 <atof@plt>
movss  %xmm0,0x8(%rsp)
mov    $0x2,%ebp
jmp    1379 <main+0x1e9>
mov    0x10(%rbx),%rdi
lea    0xdbb(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1355 <main+0x1c5>
lea    0x10(%rbx),%rbp
mov    0x0(%rbp),%rdi
lea    0xda4(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1398 <main+0x208>
mov    0x0(%rbp),%rdi
lea    0xd95(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     13bc <main+0x22c>
mov    0x0(%rbp),%rdi
lea    0xd89(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     135c <main+0x1cc>
mov    0x0(%rbp),%rdi
lea    0xd7c(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     139f <main+0x20f>
mov    0x0(%rbp),%rdi
lea    0xd70(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     13c3 <main+0x233>
mov    0x0(%rbp),%rdi
lea    0xd6c(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    13aa <main+0x21a>
test   %r15,%r15
je     13dc <main+0x24c>
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,0x8(%rsp)
mov    $0x6,%ebp
jmp    1379 <main+0x1e9>
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,0x8(%rsp)
xor    %ebp,%ebp
jmp    1379 <main+0x1e9>
mov    0x18(%rbx),%rdi
call   1040 <atof@plt>
movss  %xmm0,0x8(%rsp)
mov    $0x1,%ebp
jmp    1379 <main+0x1e9>
xor    %ebp,%ebp
jmp    13e8 <main+0x258>
mov    $0x3,%ebp
cmp    $0x4,%r12d
jne    13aa <main+0x21a>
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,0x8(%rsp)
test   %r15,%r15
je     13e8 <main+0x258>
lea    0x8(%rsp),%rsi
mov    %ebp,%edi
mov    $0x4,%edx
call   1070 <ksetkensopt@plt>
test   %rax,%rax
jne    13fe <main+0x26e>
lea    0xd61(%rip),%rdi
jmp    1405 <main+0x275>
mov    $0x1,%ebp
jmp    13e8 <main+0x258>
mov    $0x4,%ebp
cmp    $0x4,%r12d
je     1367 <main+0x1d7>
mov    %r14,%rdi
call   10b0 <print_usage@plt>
mov    $0x1,%edi
call   10a0 <exit@plt>
mov    $0x2,%ebp
jmp    13e8 <main+0x258>
test   %r15,%r15
je     13e3 <main+0x253>
mov    0x18(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,0x8(%rsp)
mov    $0x5,%ebp
jmp    1379 <main+0x1e9>
mov    $0x6,%ebp
jmp    13e8 <main+0x258>
mov    $0x5,%ebp
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %ebp,%edi
call   1060 <kgetkensopt@plt>
test   %rax,%rax
je     1419 <main+0x289>
lea    0xcf5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
cmp    $0x6,%ebp
ja     140a <main+0x27a>
mov    %ebp,%eax
lea    0xbd9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%rsp),%esi
lea    0xc41(%rip),%rdi
jmp    149c <main+0x30c>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc39(%rip),%rdi
jmp    1461 <main+0x2d1>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc35(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    140a <main+0x27a>
mov    0x8(%rsp),%esi
lea    0xc33(%rip),%rdi
jmp    149c <main+0x30c>
mov    0x8(%rsp),%esi
lea    0xc37(%rip),%rdi
jmp    149c <main+0x30c>
mov    0x8(%rsp),%esi
lea    0xc3c(%rip),%rdi
jmp    149c <main+0x30c>
mov    0x8(%rsp),%esi
lea    0xc49(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    140a <main+0x27a>

LLVM IR (-O0):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [6 x i8] c"delay\00"
@.str.3 = [10 x i8] c"drop_rate\00"
@.str.4 = [13 x i8] c"reorder_rate\00"
@.str.5 = [12 x i8] c"enable_seth\00"
@.str.6 = [13 x i8] c"disable_seth\00"
@.str.7 = [21 x i8] c"krip_update_interval\00"
@.str.8 = [13 x i8] c"krip_timeout\00"
@.str.9 = [11 x i8] c"delay: %d\0A\00"
@.str.10 = [15 x i8] c"drop_rate: %f\0A\00"
@.str.11 = [18 x i8] c"reorder_rate: %f\0A\00"
@.str.12 = [17 x i8] c"enable_seth: %d\0A\00"
@.str.13 = [18 x i8] c"disable_seth: %d\0A\00"
@.str.14 = [26 x i8] c"krip_update_interval: %d\0A\00"
@.str.15 = [18 x i8] c"krip_timeout: %d\0A\00"
@.str.16 = [8 x i8] c"failed\0A\00"
@.str.17 = [4 x i8] c"ok\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i8]
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
store i8* %13, i8** %6
store i32 4, i32* %10
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 3
br i1 %15, label %19, label %16
16: ; preds = %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 4
br i1 %18, label %19, label %23
19: ; preds = %16, %2
%20 = load i8*, i8** %6
%21 = call i32 @print_usage(i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %23
store i32 1, i32* %7
br label %45
30: ; preds = %23
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i64 @strcmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %30
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 4
br i1 %38, label %39, label %40
39: ; preds = %36
store i32 0, i32* %7
br label %44
40: ; preds = %36, %30
%41 = load i8*, i8** %6
%42 = call i32 @print_usage(i8* %41)
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %39
br label %45
45: ; preds = %44, %29
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 2
%48 = load i8*, i8** %47
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %62
51: ; preds = %45
store i32 0, i32* %8
%52 = load i32, i32* %7
%53 = icmp ne i32 %52, 0
br i1 %53, label %61, label %54
54: ; preds = %51
%55 = load i8**, i8*** %5
%56 = getelementptr inbounds i8*, i8** %55, i64 3
%57 = load i8*, i8** %56
%58 = call i32 @atoi(i8* %57)
%59 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%60 = bitcast i8* %59 to i32*
store i32 %58, i32* %60
br label %61
61: ; preds = %54, %51
br label %180
62: ; preds = %45
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %79
68: ; preds = %62
store i32 1, i32* %8
%69 = load i32, i32* %7
%70 = icmp ne i32 %69, 0
br i1 %70, label %78, label %71
71: ; preds = %68
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 3
%74 = load i8*, i8** %73
%75 = call float @atof(i8* %74)
%76 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%77 = bitcast i8* %76 to float*
store float %75, float* %77
br label %78
78: ; preds = %71, %68
br label %179
79: ; preds = %62
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 2
%82 = load i8*, i8** %81
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %96
85: ; preds = %79
store i32 2, i32* %8
%86 = load i32, i32* %7
%87 = icmp ne i32 %86, 0
br i1 %87, label %95, label %88
88: ; preds = %85
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 3
%91 = load i8*, i8** %90
%92 = call float @atof(i8* %91)
%93 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%94 = bitcast i8* %93 to float*
store float %92, float* %94
br label %95
95: ; preds = %88, %85
br label %178
96: ; preds = %79
%97 = load i8**, i8*** %5
%98 = getelementptr inbounds i8*, i8** %97, i64 2
%99 = load i8*, i8** %98
%100 = call i64 @strcmp(i8* %99, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
br i1 %101, label %102, label %116
102: ; preds = %96
store i32 3, i32* %8
%103 = load i32, i32* %4
%104 = icmp ne i32 %103, 4
br i1 %104, label %105, label %109
105: ; preds = %102
%106 = load i8*, i8** %6
%107 = call i32 @print_usage(i8* %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %102
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 3
%112 = load i8*, i8** %111
%113 = call i32 @atoi(i8* %112)
%114 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%115 = bitcast i8* %114 to i32*
store i32 %113, i32* %115
br label %177
116: ; preds = %96
%117 = load i8**, i8*** %5
%118 = getelementptr inbounds i8*, i8** %117, i64 2
%119 = load i8*, i8** %118
%120 = call i64 @strcmp(i8* %119, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %136
122: ; preds = %116
store i32 4, i32* %8
%123 = load i32, i32* %4
%124 = icmp ne i32 %123, 4
br i1 %124, label %125, label %129
125: ; preds = %122
%126 = load i8*, i8** %6
%127 = call i32 @print_usage(i8* %126)
%128 = call i32 @exit(i32 1)
unreachable
129: ; preds = %122
%130 = load i8**, i8*** %5
%131 = getelementptr inbounds i8*, i8** %130, i64 3
%132 = load i8*, i8** %131
%133 = call i32 @atoi(i8* %132)
%134 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%135 = bitcast i8* %134 to i32*
store i32 %133, i32* %135
br label %176
136: ; preds = %116
%137 = load i8**, i8*** %5
%138 = getelementptr inbounds i8*, i8** %137, i64 2
%139 = load i8*, i8** %138
%140 = call i64 @strcmp(i8* %139, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%141 = icmp eq i64 %140, 0
br i1 %141, label %142, label %153
142: ; preds = %136
store i32 5, i32* %8
%143 = load i32, i32* %7
%144 = icmp ne i32 %143, 0
br i1 %144, label %152, label %145
145: ; preds = %142
%146 = load i8**, i8*** %5
%147 = getelementptr inbounds i8*, i8** %146, i64 3
%148 = load i8*, i8** %147
%149 = call i32 @atoi(i8* %148)
%150 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%151 = bitcast i8* %150 to i32*
store i32 %149, i32* %151
br label %152
152: ; preds = %145, %142
br label %175
153: ; preds = %136
%154 = load i8**, i8*** %5
%155 = getelementptr inbounds i8*, i8** %154, i64 2
%156 = load i8*, i8** %155
%157 = call i64 @strcmp(i8* %156, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%158 = icmp eq i64 %157, 0
br i1 %158, label %159, label %170
159: ; preds = %153
store i32 6, i32* %8
%160 = load i32, i32* %7
%161 = icmp ne i32 %160, 0
br i1 %161, label %169, label %162
162: ; preds = %159
%163 = load i8**, i8*** %5
%164 = getelementptr inbounds i8*, i8** %163, i64 3
%165 = load i8*, i8** %164
%166 = call i32 @atoi(i8* %165)
%167 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%168 = bitcast i8* %167 to i32*
store i32 %166, i32* %168
br label %169
169: ; preds = %162, %159
br label %174
170: ; preds = %153
%171 = load i8*, i8** %6
%172 = call i32 @print_usage(i8* %171)
%173 = call i32 @exit(i32 1)
unreachable
174: ; preds = %169
br label %175
175: ; preds = %174, %152
br label %176
176: ; preds = %175, %129
br label %177
177: ; preds = %176, %109
br label %178
178: ; preds = %177, %95
br label %179
179: ; preds = %178, %78
br label %180
180: ; preds = %179, %61
%181 = load i32, i32* %7
%182 = icmp ne i32 %181, 0
br i1 %182, label %183, label %231
183: ; preds = %180
%184 = load i32, i32* %8
%185 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%186 = call i64 @kgetkensopt(i32 %184, i8* %185, i32* %10)
%187 = icmp eq i64 %186, 0
br i1 %187, label %188, label %228
188: ; preds = %183
%189 = load i32, i32* %8
switch i32 %189, label %227 [
i32 0, label %190
i32 1, label %195
i32 2, label %201
i32 3, label %207
i32 4, label %212
i32 5, label %217
i32 6, label %222
]
190: ; preds = %188
%191 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%192 = bitcast i8* %191 to i32*
%193 = load i32, i32* %192
%194 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %193)
br label %227
195: ; preds = %188
%196 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%197 = bitcast i8* %196 to float*
%198 = load float, float* %197
%199 = fpext float %198 to double
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), double %199)
br label %227
201: ; preds = %188
%202 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%203 = bitcast i8* %202 to float*
%204 = load float, float* %203
%205 = fpext float %204 to double
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), double %205)
br label %227
207: ; preds = %188
%208 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%209 = bitcast i8* %208 to i32*
%210 = load i32, i32* %209
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 %210)
br label %227
212: ; preds = %188
%213 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%214 = bitcast i8* %213 to i32*
%215 = load i32, i32* %214
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 %215)
br label %227
217: ; preds = %188
%218 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%219 = bitcast i8* %218 to i32*
%220 = load i32, i32* %219
%221 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %220)
br label %227
222: ; preds = %188
%223 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%224 = bitcast i8* %223 to i32*
%225 = load i32, i32* %224
%226 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32 %225)
br label %227
227: ; preds = %188, %222, %217, %212, %207, %201, %195, %190
br label %230
228: ; preds = %183
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %230
230: ; preds = %228, %227
br label %242
231: ; preds = %180
%232 = load i32, i32* %8
%233 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%234 = load i32, i32* %10
%235 = call i64 @ksetkensopt(i32 %232, i8* %233, i32 %234)
%236 = icmp eq i64 %235, 0
br i1 %236, label %237, label %239
237: ; preds = %231
%238 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
br label %241
239: ; preds = %231
%240 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.16, i64 0, i64 0))
br label %241
241: ; preds = %239, %237
br label %242
242: ; preds = %241, %230
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"set\00"
@.str.2 = [6 x i8] c"delay\00"
@.str.3 = [10 x i8] c"drop_rate\00"
@.str.4 = [13 x i8] c"reorder_rate\00"
@.str.5 = [12 x i8] c"enable_seth\00"
@.str.6 = [13 x i8] c"disable_seth\00"
@.str.7 = [21 x i8] c"krip_update_interval\00"
@.str.8 = [13 x i8] c"krip_timeout\00"
@.str.9 = [11 x i8] c"delay: %d\0A\00"
@.str.10 = [15 x i8] c"drop_rate: %f\0A\00"
@.str.11 = [18 x i8] c"reorder_rate: %f\0A\00"
@.str.12 = [17 x i8] c"enable_seth: %d\0A\00"
@.str.13 = [18 x i8] c"disable_seth: %d\0A\00"
@.str.14 = [26 x i8] c"krip_update_interval: %d\0A\00"
@.str.15 = [18 x i8] c"krip_timeout: %d\0A\00"
@str.18 = [3 x i8] c"ok\00"
@str.19 = [7 x i8] c"failed\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = load i8*, i8** %1
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%8 = add i32 %0, -5
%9 = icmp ult i32 %8, -2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = tail call i32 @print_usage(i8* %5)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 1
%15 = load i8*, i8** %14
%16 = tail call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %27, label %18
18: ; preds = %13
%19 = load i8*, i8** %14
%20 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
%22 = icmp eq i32 %0, 4
%23 = and i1 %22, %21
br i1 %23, label %32, label %24
24: ; preds = %18
%25 = tail call i32 @print_usage(i8* %5)
%26 = tail call i32 @exit(i32 1)
unreachable
27: ; preds = %13
%28 = getelementptr inbounds i8*, i8** %1, i64 2
%29 = load i8*, i8** %28
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %112, label %41
32: ; preds = %18
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = tail call i64 @strcmp(i8* %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %32
%38 = getelementptr inbounds i8*, i8** %1, i64 3
%39 = load i8*, i8** %38
%40 = tail call i32 @atoi(i8* %39)
store i32 %40, i32* %3
br label %144
41: ; preds = %27
%42 = load i8*, i8** %28
%43 = tail call i64 @strcmp(i8* %42, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %112, label %54
45: ; preds = %32
%46 = load i8*, i8** %33
%47 = tail call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %58
49: ; preds = %45
%50 = getelementptr inbounds i8*, i8** %1, i64 3
%51 = load i8*, i8** %50
%52 = tail call float @atof(i8* %51)
%53 = bitcast i32* %3 to float*
store float %52, float* %53
br label %144
54: ; preds = %41
%55 = load i8*, i8** %28
%56 = tail call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %112, label %67
58: ; preds = %45
%59 = load i8*, i8** %33
%60 = tail call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %67
62: ; preds = %58
%63 = getelementptr inbounds i8*, i8** %1, i64 3
%64 = load i8*, i8** %63
%65 = tail call float @atof(i8* %64)
%66 = bitcast i32* %3 to float*
store float %65, float* %66
br label %144
67: ; preds = %58, %54
%68 = phi i8** [ %33, %58 ], [ %28, %54 ]
%69 = load i8*, i8** %68
%70 = tail call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %77
72: ; preds = %67
%73 = icmp eq i32 %0, 4
br i1 %73, label %107, label %74
74: ; preds = %72
%75 = tail call i32 @print_usage(i8* %5)
%76 = tail call i32 @exit(i32 1)
unreachable
77: ; preds = %67
%78 = load i8*, i8** %68
%79 = tail call i64 @strcmp(i8* %78, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %86
81: ; preds = %77
%82 = icmp eq i32 %0, 4
br i1 %82, label %107, label %83
83: ; preds = %81
%84 = tail call i32 @print_usage(i8* %5)
%85 = tail call i32 @exit(i32 1)
unreachable
86: ; preds = %77
%87 = load i8*, i8** %68
%88 = tail call i64 @strcmp(i8* %87, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %95
90: ; preds = %86
br i1 %17, label %112, label %91
91: ; preds = %90
%92 = getelementptr inbounds i8*, i8** %1, i64 3
%93 = load i8*, i8** %92
%94 = tail call i32 @atoi(i8* %93)
store i32 %94, i32* %3
br label %144
95: ; preds = %86
%96 = load i8*, i8** %68
%97 = tail call i64 @strcmp(i8* %96, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %104
99: ; preds = %95
br i1 %17, label %112, label %100
100: ; preds = %99
%101 = getelementptr inbounds i8*, i8** %1, i64 3
%102 = load i8*, i8** %101
%103 = tail call i32 @atoi(i8* %102)
store i32 %103, i32* %3
br label %144
104: ; preds = %95
%105 = tail call i32 @print_usage(i8* %5)
%106 = tail call i32 @exit(i32 1)
unreachable
107: ; preds = %81, %72
%108 = phi i32 [ 3, %72 ], [ 4, %81 ]
%109 = getelementptr inbounds i8*, i8** %1, i64 3
%110 = load i8*, i8** %109
%111 = tail call i32 @atoi(i8* %110)
store i32 %111, i32* %3
br i1 %17, label %112, label %144
112: ; preds = %27, %41, %54, %99, %90, %107
%113 = phi i32 [ %108, %107 ], [ 6, %99 ], [ 5, %90 ], [ 2, %54 ], [ 1, %41 ], [ 0, %27 ]
%114 = call i64 @kgetkensopt(i32 %113, i8* %6, i32* %4)
%115 = icmp eq i64 %114, 0
br i1 %115, label %116, label %142
116: ; preds = %112
switch i32 %113, label %152 [
i32 0, label %117
i32 1, label %120
i32 2, label %125
i32 3, label %130
i32 4, label %133
i32 5, label %136
i32 6, label %139
]
117: ; preds = %116
%118 = load i32, i32* %3
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i32 %118)
br label %152
120: ; preds = %116
%121 = bitcast i32* %3 to float*
%122 = load float, float* %121
%123 = fpext float %122 to double
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), double %123)
br label %152
125: ; preds = %116
%126 = bitcast i32* %3 to float*
%127 = load float, float* %126
%128 = fpext float %127 to double
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), double %128)
br label %152
130: ; preds = %116
%131 = load i32, i32* %3
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i32 %131)
br label %152
133: ; preds = %116
%134 = load i32, i32* %3
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.13, i64 0, i64 0), i32 %134)
br label %152
136: ; preds = %116
%137 = load i32, i32* %3
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %137)
br label %152
139: ; preds = %116
%140 = load i32, i32* %3
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32 %140)
br label %152
142: ; preds = %112
%143 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.19, i64 0, i64 0))
br label %152
144: ; preds = %37, %62, %100, %91, %49, %107
%145 = phi i32 [ %108, %107 ], [ 6, %100 ], [ 5, %91 ], [ 2, %62 ], [ 1, %49 ], [ 0, %37 ]
%146 = call i64 @ksetkensopt(i32 %145, i8* %6, i32 4)
%147 = icmp eq i64 %146, 0
br i1 %147, label %148, label %150
148: ; preds = %144
%149 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.18, i64 0, i64 0))
br label %152
150: ; preds = %144
%151 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.19, i64 0, i64 0))
br label %152
152: ; preds = %148, %150, %142, %116, %139, %136, %133, %130, %125, %120, %117
ret i32 0
}