#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 scalar_t__ __u16;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ add_key_moji(scalar_t__, int);
int /*<<< orphan*/ add_left_key_moji(scalar_t__, int);
int /*<<< orphan*/ add_right_key_moji(scalar_t__, int);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ keyname_to_code(char *);
int mojiname_to_code(char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ set_char_time(int /*<<< orphan*/);
int /*<<< orphan*/ set_imtype(char *);
int /*<<< orphan*/ set_keyboardname(char *);
int /*<<< orphan*/ set_left_oyakey(scalar_t__);
int /*<<< orphan*/ set_nicola_time(int /*<<< orphan*/);
int /*<<< orphan*/ set_offkey(scalar_t__);
int /*<<< orphan*/ set_onkey(scalar_t__);
int /*<<< orphan*/ set_oya_time(int /*<<< orphan*/);
int /*<<< orphan*/ set_right_oyakey(scalar_t__);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
scalar_t__ strcasecmp(char *, char *);
scalar_t__ strcmp(char *, char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ trim(char *);
int load_config(char *path) {
  FILE *fp;
  char line[128];
  char *str;
  char key[128];
  char value[128];
  __u16 kc;
  int mc;
  char keyname[128];
  char mojiname[128];
  if ((fp = fopen(path, "r")) == NULL) {
    return 0;
  }
  while ((str = fgets(line, 128, fp)) != NULL) {
    key[0] = 0;
    value[0] = 0;
    trim(line);
    if (strcmp(line, "\n") == 0)
      continue;
    if (strncmp(line, "#", 1) == 0)
      continue;
    sscanf(line, "%[^=]=%s", key, value);
    if (strcasecmp(key, "KEYBOARDNAME") == 0) {
      printf("KEYBOARDNAME: %s\n", value);
      set_keyboardname(value);
    } else if (strcasecmp(key, "LOYAKEY") == 0) {
      kc = keyname_to_code(value);
      if (kc != 0) {
        printf("LOYAKEY: %s\n", value);
        set_left_oyakey(kc);
      }
    } else if (strcasecmp(key, "ROYAKEY") == 0) {
      kc = keyname_to_code(value);
      if (kc != 0) {
        printf("ROYAKEY: %s\n", value);
        set_right_oyakey(kc);
      }
    } else if (strcasecmp(key, "ONKEY") == 0) {
      kc = keyname_to_code(value);
      if (kc != 0) {
        printf("ONKEY: %s\n", value);
        set_onkey(kc);
      }
    } else if (strcasecmp(key, "OFFKEY") == 0) {
      kc = keyname_to_code(value);
      if (kc != 0) {
        printf("OFFKEY: %s\n", value);
        set_offkey(kc);
      }
    } else if (strcasecmp(key, "IM") == 0) {
      printf("IM: %s\n", value);
      set_imtype(value);
    } else if (strcasecmp(key, "CHARTIME") == 0) {
      printf("CHARTIME: %s\n", value);
      set_char_time(atoi(value));
    } else if (strcasecmp(key, "OYATIME") == 0) {
      printf("OYATIME: %s\n", value);
      set_oya_time(atoi(value));
    } else if (strcasecmp(key, "NICOLATIME") == 0) {
      printf("NICOLATIME: %s\n", value);
      set_nicola_time(atoi(value));
    } else if (strcasecmp(key, "KEYADD") == 0) {
      sscanf(value, "%[^:]:%s", keyname, mojiname);
      kc = keyname_to_code(keyname);
      mc = mojiname_to_code(mojiname);
      if (kc != 0) {
        printf("KEYADD: %s=%s\n", keyname, mojiname);
        add_key_moji(kc, mc);
      }
    } else if (strcasecmp(key, "LKEYADD") == 0) {
      sscanf(value, "%[^:]:%s", keyname, mojiname);
      kc = keyname_to_code(keyname);
      mc = mojiname_to_code(mojiname);
      if (kc != 0) {
        printf("LKEYADD: %s=%s\n", keyname, mojiname);
        add_left_key_moji(kc, mc);
      }
    } else if (strcasecmp(key, "RKEYADD") == 0) {
      sscanf(value, "%[^:]:%s", keyname, mojiname);
      kc = keyname_to_code(keyname);
      mc = mojiname_to_code(mojiname);
      if (kc != 0) {
        printf("RKEYADD: %s=%s\n", keyname, mojiname);
        add_right_key_moji(kc, mc);
      }
    }
  }
  fclose(fp);
  return 1;
}


x86 assembly (clang, -O0):
<load_config>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xd66(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    12b9 <load_config+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1894 <load_config+0x614>
jmp    12be <load_config+0x3e>
lea    -0xa0(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x80,%esi
call   10b0 <fgets@plt>
mov    %rax,-0xa8(%rbp)
cmp    $0x0,%rax
je     1884 <load_config+0x604>
movb   $0x0,-0x130(%rbp)
movb   $0x0,-0x1b0(%rbp)
lea    -0xa0(%rbp),%rdi
call   10a0 <trim@plt>
lea    -0xa0(%rbp),%rdi
lea    0xd1e(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    1320 <load_config+0xa0>
jmp    12be <load_config+0x3e>
lea    -0xa0(%rbp),%rdi
lea    0xcd4(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1347 <load_config+0xc7>
jmp    12be <load_config+0x3e>
lea    -0xa0(%rbp),%rdi
lea    -0x130(%rbp),%rdx
lea    -0x1b0(%rbp),%rcx
lea    0xca1(%rip),%rsi
call   1110 <sscanf@plt>
lea    -0x130(%rbp),%rdi
lea    0xc97(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    13ab <load_config+0x12b>
lea    -0x1b0(%rbp),%rsi
lea    0xc87(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   10e0 <set_keyboardname@plt>
jmp    187f <load_config+0x5ff>
lea    -0x130(%rbp),%rdi
lea    0xc73(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    140f <load_config+0x18f>
lea    -0x1b0(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     140a <load_config+0x18a>
lea    -0x1b0(%rbp),%rsi
lea    0xc3d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
call   1140 <set_left_oyakey@plt>
jmp    187a <load_config+0x5fa>
lea    -0x130(%rbp),%rdi
lea    0xc24(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1473 <load_config+0x1f3>
lea    -0x1b0(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     146e <load_config+0x1ee>
lea    -0x1b0(%rbp),%rsi
lea    0xbee(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
call   1170 <set_right_oyakey@plt>
jmp    1875 <load_config+0x5f5>
lea    -0x130(%rbp),%rdi
lea    0xbd5(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    14d7 <load_config+0x257>
lea    -0x1b0(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     14d2 <load_config+0x252>
lea    -0x1b0(%rbp),%rsi
lea    0xb9d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
call   10d0 <set_onkey@plt>
jmp    1870 <load_config+0x5f0>
lea    -0x130(%rbp),%rdi
lea    0xb82(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    153b <load_config+0x2bb>
lea    -0x1b0(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     1536 <load_config+0x2b6>
lea    -0x1b0(%rbp),%rsi
lea    0xb4b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
call   11a0 <set_offkey@plt>
jmp    186b <load_config+0x5eb>
lea    -0x130(%rbp),%rdi
lea    0xb31(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    157e <load_config+0x2fe>
lea    -0x1b0(%rbp),%rsi
lea    0xb17(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   1090 <set_imtype@plt>
jmp    1866 <load_config+0x5e6>
lea    -0x130(%rbp),%rdi
lea    0xaf9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    15c8 <load_config+0x348>
lea    -0x1b0(%rbp),%rsi
lea    0xae5(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   1150 <atoi@plt>
mov    %eax,%edi
call   1100 <set_char_time@plt>
jmp    1861 <load_config+0x5e1>
lea    -0x130(%rbp),%rdi
lea    0xac6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1612 <load_config+0x392>
lea    -0x1b0(%rbp),%rsi
lea    0xab1(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   1150 <atoi@plt>
mov    %eax,%edi
call   1050 <set_oya_time@plt>
jmp    185c <load_config+0x5dc>
lea    -0x130(%rbp),%rdi
lea    0xa91(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    165c <load_config+0x3dc>
lea    -0x1b0(%rbp),%rsi
lea    0xa7f(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   1150 <atoi@plt>
mov    %eax,%edi
call   1120 <set_nicola_time@plt>
jmp    1857 <load_config+0x5d7>
lea    -0x130(%rbp),%rdi
lea    0xa6c(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1700 <load_config+0x480>
lea    -0x1b0(%rbp),%rdi
lea    -0x240(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    0xa37(%rip),%rsi
call   1110 <sscanf@plt>
lea    -0x240(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
lea    -0x2c0(%rbp),%rdi
call   1180 <mojiname_to_code@plt>
mov    %eax,-0x1bc(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     16fb <load_config+0x47b>
lea    -0x240(%rbp),%rsi
lea    -0x2c0(%rbp),%rdx
lea    0x9fc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
mov    -0x1bc(%rbp),%esi
call   10f0 <add_key_moji@plt>
jmp    1852 <load_config+0x5d2>
lea    -0x130(%rbp),%rdi
lea    0x9c7(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    17a4 <load_config+0x524>
lea    -0x1b0(%rbp),%rdi
lea    -0x240(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    0x993(%rip),%rsi
call   1110 <sscanf@plt>
lea    -0x240(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
lea    -0x2c0(%rbp),%rdi
call   1180 <mojiname_to_code@plt>
mov    %eax,-0x1bc(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     179f <load_config+0x51f>
lea    -0x240(%rbp),%rsi
lea    -0x2c0(%rbp),%rdx
lea    0x957(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
mov    -0x1bc(%rbp),%esi
call   1160 <add_left_key_moji@plt>
jmp    184d <load_config+0x5cd>
lea    -0x130(%rbp),%rdi
lea    0x93b(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%rax
jne    1848 <load_config+0x5c8>
lea    -0x1b0(%rbp),%rdi
lea    -0x240(%rbp),%rdx
lea    -0x2c0(%rbp),%rcx
lea    0x8ef(%rip),%rsi
call   1110 <sscanf@plt>
lea    -0x240(%rbp),%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,-0x1b8(%rbp)
lea    -0x2c0(%rbp),%rdi
call   1180 <mojiname_to_code@plt>
mov    %eax,-0x1bc(%rbp)
cmpq   $0x0,-0x1b8(%rbp)
je     1843 <load_config+0x5c3>
lea    -0x240(%rbp),%rsi
lea    -0x2c0(%rbp),%rdx
lea    0x8cb(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1b8(%rbp),%rdi
mov    -0x1bc(%rbp),%esi
call   1190 <add_right_key_moji@plt>
jmp    1848 <load_config+0x5c8>
jmp    184d <load_config+0x5cd>
jmp    1852 <load_config+0x5d2>
jmp    1857 <load_config+0x5d7>
jmp    185c <load_config+0x5dc>
jmp    1861 <load_config+0x5e1>
jmp    1866 <load_config+0x5e6>
jmp    186b <load_config+0x5eb>
jmp    1870 <load_config+0x5f0>
jmp    1875 <load_config+0x5f5>
jmp    187a <load_config+0x5fa>
jmp    187f <load_config+0x5ff>
jmp    12be <load_config+0x3e>
mov    -0x18(%rbp),%rdi
call   1070 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_config>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x288,%rsp
lea    0xd68(%rip),%rsi
call   1130 <fopen@plt>
test   %rax,%rax
je     172f <load_config+0x4af>
mov    %rax,%r14
lea    0x200(%rsp),%rdi
mov    $0x80,%esi
mov    %rax,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     1720 <load_config+0x4a0>
lea    0x200(%rsp),%rbx
lea    0x180(%rsp),%r15
lea    0x100(%rsp),%r13
jmp    1319 <load_config+0x99>
lea    0xd32(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13,%rdi
call   10e0 <set_keyboardname@plt>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
call   10b0 <fgets@plt>
test   %rax,%rax
je     1720 <load_config+0x4a0>
movb   $0x0,0x180(%rsp)
movb   $0x0,0x100(%rsp)
mov    %rbx,%rdi
call   10a0 <trim@plt>
mov    %rbx,%rdi
lea    0xcef(%rip),%rsi
call   10c0 <strcmp@plt>
test   %rax,%rax
je     1300 <load_config+0x80>
mov    %rbx,%rdi
lea    0xcb3(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1300 <load_config+0x80>
mov    %rbx,%rdi
lea    0xc9c(%rip),%rsi
mov    %r15,%rdx
mov    %r13,%rcx
call   1110 <sscanf@plt>
mov    %r15,%rdi
lea    0xc90(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     12e1 <load_config+0x61>
mov    %r15,%rdi
lea    0xc97(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     14fb <load_config+0x27b>
mov    %r15,%rdi
lea    0xc94(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     152d <load_config+0x2ad>
mov    %r15,%rdi
lea    0xc91(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     155f <load_config+0x2df>
mov    %r15,%rdi
lea    0xc8a(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1591 <load_config+0x311>
mov    %r15,%rdi
lea    0xc85(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     15c3 <load_config+0x343>
mov    %r15,%rdi
lea    0xc78(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     15e1 <load_config+0x361>
mov    %r15,%rdi
lea    0xc77(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1606 <load_config+0x386>
mov    %r15,%rdi
lea    0xc74(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     162b <load_config+0x3ab>
mov    %r15,%rdi
lea    0xc81(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     1650 <load_config+0x3d0>
mov    %r15,%rdi
lea    0xc68(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
je     16b8 <load_config+0x438>
mov    %r15,%rdi
lea    0xc68(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %rax,%rax
jne    1300 <load_config+0x80>
mov    %r13,%rdi
lea    0xc2f(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdx
mov    %rsp,%r12
mov    %r12,%rcx
call   1110 <sscanf@plt>
mov    %rbp,%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1180 <mojiname_to_code@plt>
test   %rbp,%rbp
je     1300 <load_config+0x80>
mov    %eax,%r12d
lea    0xc1c(%rip),%rdi
lea    0x80(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
call   1190 <add_right_key_moji@plt>
jmp    1300 <load_config+0x80>
mov    %r13,%rdi
call   1060 <keyname_to_code@plt>
test   %rax,%rax
je     1300 <load_config+0x80>
mov    %rax,%r12
lea    0xb1e(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r12,%rdi
call   1140 <set_left_oyakey@plt>
jmp    1300 <load_config+0x80>
mov    %r13,%rdi
call   1060 <keyname_to_code@plt>
test   %rax,%rax
je     1300 <load_config+0x80>
mov    %rax,%rbp
lea    0xb01(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
call   1170 <set_right_oyakey@plt>
jmp    1300 <load_config+0x80>
mov    %r13,%rdi
call   1060 <keyname_to_code@plt>
test   %rax,%rax
je     1300 <load_config+0x80>
mov    %rax,%rbp
lea    0xae2(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
call   10d0 <set_onkey@plt>
jmp    1300 <load_config+0x80>
mov    %r13,%rdi
call   1060 <keyname_to_code@plt>
test   %rax,%rax
je     1300 <load_config+0x80>
mov    %rax,%rbp
lea    0xac2(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
call   11a0 <set_offkey@plt>
jmp    1300 <load_config+0x80>
lea    0xab3(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13,%rdi
call   1090 <set_imtype@plt>
jmp    1300 <load_config+0x80>
lea    0xaa6(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13,%rdi
call   1150 <atoi@plt>
mov    %eax,%edi
call   1100 <set_char_time@plt>
jmp    1300 <load_config+0x80>
lea    0xa97(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13,%rdi
call   1150 <atoi@plt>
mov    %eax,%edi
call   1050 <set_oya_time@plt>
jmp    1300 <load_config+0x80>
lea    0xa8a(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r13,%rdi
call   1150 <atoi@plt>
mov    %eax,%edi
call   1120 <set_nicola_time@plt>
jmp    1300 <load_config+0x80>
mov    %r13,%rdi
lea    0xa72(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdx
mov    %rsp,%r12
mov    %r12,%rcx
call   1110 <sscanf@plt>
mov    %rbp,%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1180 <mojiname_to_code@plt>
test   %rbp,%rbp
je     1300 <load_config+0x80>
mov    %eax,%r12d
lea    0xa48(%rip),%rdi
lea    0x80(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
call   10f0 <add_key_moji@plt>
jmp    1300 <load_config+0x80>
mov    %r13,%rdi
lea    0xa0a(%rip),%rsi
lea    0x80(%rsp),%rbp
mov    %rbp,%rdx
mov    %rsp,%r12
mov    %r12,%rcx
call   1110 <sscanf@plt>
mov    %rbp,%rdi
call   1060 <keyname_to_code@plt>
mov    %rax,%rbp
mov    %r12,%rdi
call   1180 <mojiname_to_code@plt>
test   %rbp,%rbp
je     1300 <load_config+0x80>
mov    %eax,%r12d
lea    0x9df(%rip),%rdi
lea    0x80(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
call   1160 <add_left_key_moji@plt>
jmp    1300 <load_config+0x80>
mov    %r14,%rdi
call   1070 <fclose@plt>
mov    $0x1,%eax
jmp    1731 <load_config+0x4b1>
xor    %eax,%eax
add    $0x288,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"#\00"
@.str.3 = [9 x i8] c"%[^=]=%s\00"
@.str.4 = [13 x i8] c"KEYBOARDNAME\00"
@.str.5 = [18 x i8] c"KEYBOARDNAME: %s\0A\00"
@.str.6 = [8 x i8] c"LOYAKEY\00"
@.str.7 = [13 x i8] c"LOYAKEY: %s\0A\00"
@.str.8 = [8 x i8] c"ROYAKEY\00"
@.str.9 = [13 x i8] c"ROYAKEY: %s\0A\00"
@.str.10 = [6 x i8] c"ONKEY\00"
@.str.11 = [11 x i8] c"ONKEY: %s\0A\00"
@.str.12 = [7 x i8] c"OFFKEY\00"
@.str.13 = [12 x i8] c"OFFKEY: %s\0A\00"
@.str.14 = [3 x i8] c"IM\00"
@.str.15 = [8 x i8] c"IM: %s\0A\00"
@.str.16 = [9 x i8] c"CHARTIME\00"
@.str.17 = [14 x i8] c"CHARTIME: %s\0A\00"
@.str.18 = [8 x i8] c"OYATIME\00"
@.str.19 = [13 x i8] c"OYATIME: %s\0A\00"
@.str.20 = [11 x i8] c"NICOLATIME\00"
@.str.21 = [16 x i8] c"NICOLATIME: %s\0A\00"
@.str.22 = [7 x i8] c"KEYADD\00"
@.str.23 = [9 x i8] c"%[^:]:%s\00"
@.str.24 = [15 x i8] c"KEYADD: %s=%s\0A\00"
@.str.25 = [8 x i8] c"LKEYADD\00"
@.str.26 = [16 x i8] c"LKEYADD: %s=%s\0A\00"
@.str.27 = [8 x i8] c"RKEYADD\00"
@.str.28 = [16 x i8] c"RKEYADD: %s=%s\0A\00"
define i32 @load_config(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [128 x i8]
%6 = alloca i8*
%7 = alloca [128 x i8]
%8 = alloca [128 x i8]
%9 = alloca i64
%10 = alloca i32
%11 = alloca [128 x i8]
%12 = alloca [128 x i8]
store i8* %0, i8** %3
%13 = load i8*, i8** %3
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %14, i32** %4
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 0, i32* %2
br label %233
17: ; preds = %1
br label %18
18: ; preds = %229, %36, %31, %17
%19 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%20 = load i32*, i32** %4
%21 = call i8* @fgets(i8* %19, i32 128, i32* %20)
store i8* %21, i8** %6
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %230
23: ; preds = %18
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
store i8 0, i8* %24
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
store i8 0, i8* %25
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%27 = call i32 @trim(i8* %26)
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %23
br label %18
32: ; preds = %23
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%34 = call i64 @strncmp(i8* %33, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %37
36: ; preds = %32
br label %18
37: ; preds = %32
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%39 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%40 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%41 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %39, i8* %40)
%42 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%43 = call i64 @strcasecmp(i8* %42, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %50
45: ; preds = %37
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%47 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %46)
%48 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%49 = call i32 @set_keyboardname(i8* %48)
br label %229
50: ; preds = %37
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%52 = call i64 @strcasecmp(i8* %51, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %65
54: ; preds = %50
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%56 = call i64 @keyname_to_code(i8* %55)
store i64 %56, i64* %9
%57 = load i64, i64* %9
%58 = icmp ne i64 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %54
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%61 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %60)
%62 = load i64, i64* %9
%63 = call i32 @set_left_oyakey(i64 %62)
br label %64
64: ; preds = %59, %54
br label %228
65: ; preds = %50
%66 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%67 = call i64 @strcasecmp(i8* %66, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %80
69: ; preds = %65
%70 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%71 = call i64 @keyname_to_code(i8* %70)
store i64 %71, i64* %9
%72 = load i64, i64* %9
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %79
74: ; preds = %69
%75 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%76 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %75)
%77 = load i64, i64* %9
%78 = call i32 @set_right_oyakey(i64 %77)
br label %79
79: ; preds = %74, %69
br label %227
80: ; preds = %65
%81 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%82 = call i64 @strcasecmp(i8* %81, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %95
84: ; preds = %80
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%86 = call i64 @keyname_to_code(i8* %85)
store i64 %86, i64* %9
%87 = load i64, i64* %9
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %94
89: ; preds = %84
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%91 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* %90)
%92 = load i64, i64* %9
%93 = call i32 @set_onkey(i64 %92)
br label %94
94: ; preds = %89, %84
br label %226
95: ; preds = %80
%96 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%97 = call i64 @strcasecmp(i8* %96, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%98 = icmp eq i64 %97, 0
br i1 %98, label %99, label %110
99: ; preds = %95
%100 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%101 = call i64 @keyname_to_code(i8* %100)
store i64 %101, i64* %9
%102 = load i64, i64* %9
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %109
104: ; preds = %99
%105 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%106 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8* %105)
%107 = load i64, i64* %9
%108 = call i32 @set_offkey(i64 %107)
br label %109
109: ; preds = %104, %99
br label %225
110: ; preds = %95
%111 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%112 = call i64 @strcasecmp(i8* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %119
114: ; preds = %110
%115 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%116 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i8* %115)
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%118 = call i32 @set_imtype(i8* %117)
br label %224
119: ; preds = %110
%120 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%121 = call i64 @strcasecmp(i8* %120, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0))
%122 = icmp eq i64 %121, 0
br i1 %122, label %123, label %129
123: ; preds = %119
%124 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%125 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8* %124)
%126 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%127 = call i32 @atoi(i8* %126)
%128 = call i32 @set_char_time(i32 %127)
br label %223
129: ; preds = %119
%130 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%131 = call i64 @strcasecmp(i8* %130, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%132 = icmp eq i64 %131, 0
br i1 %132, label %133, label %139
133: ; preds = %129
%134 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%135 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* %134)
%136 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%137 = call i32 @atoi(i8* %136)
%138 = call i32 @set_oya_time(i32 %137)
br label %222
139: ; preds = %129
%140 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%141 = call i64 @strcasecmp(i8* %140, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%142 = icmp eq i64 %141, 0
br i1 %142, label %143, label %149
143: ; preds = %139
%144 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%145 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8* %144)
%146 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%147 = call i32 @atoi(i8* %146)
%148 = call i32 @set_nicola_time(i32 %147)
br label %221
149: ; preds = %139
%150 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%151 = call i64 @strcasecmp(i8* %150, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0))
%152 = icmp eq i64 %151, 0
br i1 %152, label %153, label %172
153: ; preds = %149
%154 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%155 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%156 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%157 = call i32 @sscanf(i8* %154, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* %155, i8* %156)
%158 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%159 = call i64 @keyname_to_code(i8* %158)
store i64 %159, i64* %9
%160 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%161 = call i32 @mojiname_to_code(i8* %160)
store i32 %161, i32* %10
%162 = load i64, i64* %9
%163 = icmp ne i64 %162, 0
br i1 %163, label %164, label %171
164: ; preds = %153
%165 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%166 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%167 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), i8* %165, i8* %166)
%168 = load i64, i64* %9
%169 = load i32, i32* %10
%170 = call i32 @add_key_moji(i64 %168, i32 %169)
br label %171
171: ; preds = %164, %153
br label %220
172: ; preds = %149
%173 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%174 = call i64 @strcasecmp(i8* %173, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0))
%175 = icmp eq i64 %174, 0
br i1 %175, label %176, label %195
176: ; preds = %172
%177 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%178 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%179 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%180 = call i32 @sscanf(i8* %177, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* %178, i8* %179)
%181 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%182 = call i64 @keyname_to_code(i8* %181)
store i64 %182, i64* %9
%183 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%184 = call i32 @mojiname_to_code(i8* %183)
store i32 %184, i32* %10
%185 = load i64, i64* %9
%186 = icmp ne i64 %185, 0
br i1 %186, label %187, label %194
187: ; preds = %176
%188 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%189 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%190 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), i8* %188, i8* %189)
%191 = load i64, i64* %9
%192 = load i32, i32* %10
%193 = call i32 @add_left_key_moji(i64 %191, i32 %192)
br label %194
194: ; preds = %187, %176
br label %219
195: ; preds = %172
%196 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%197 = call i64 @strcasecmp(i8* %196, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.27, i64 0, i64 0))
%198 = icmp eq i64 %197, 0
br i1 %198, label %199, label %218
199: ; preds = %195
%200 = getelementptr inbounds [128 x i8], [128 x i8]* %8, i64 0, i64 0
%201 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%202 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%203 = call i32 @sscanf(i8* %200, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* %201, i8* %202)
%204 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%205 = call i64 @keyname_to_code(i8* %204)
store i64 %205, i64* %9
%206 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%207 = call i32 @mojiname_to_code(i8* %206)
store i32 %207, i32* %10
%208 = load i64, i64* %9
%209 = icmp ne i64 %208, 0
br i1 %209, label %210, label %217
210: ; preds = %199
%211 = getelementptr inbounds [128 x i8], [128 x i8]* %11, i64 0, i64 0
%212 = getelementptr inbounds [128 x i8], [128 x i8]* %12, i64 0, i64 0
%213 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0), i8* %211, i8* %212)
%214 = load i64, i64* %9
%215 = load i32, i32* %10
%216 = call i32 @add_right_key_moji(i64 %214, i32 %215)
br label %217
217: ; preds = %210, %199
br label %218
218: ; preds = %217, %195
br label %219
219: ; preds = %218, %194
br label %220
220: ; preds = %219, %171
br label %221
221: ; preds = %220, %143
br label %222
222: ; preds = %221, %133
br label %223
223: ; preds = %222, %123
br label %224
224: ; preds = %223, %114
br label %225
225: ; preds = %224, %109
br label %226
226: ; preds = %225, %94
br label %227
227: ; preds = %226, %79
br label %228
228: ; preds = %227, %64
br label %229
229: ; preds = %228, %45
br label %18
230: ; preds = %18
%231 = load i32*, i32** %4
%232 = call i32 @fclose(i32* %231)
store i32 1, i32* %2
br label %233
233: ; preds = %230, %16
%234 = load i32, i32* %2
ret i32 %234
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c"#\00"
@.str.3 = [9 x i8] c"%[^=]=%s\00"
@.str.4 = [13 x i8] c"KEYBOARDNAME\00"
@.str.5 = [18 x i8] c"KEYBOARDNAME: %s\0A\00"
@.str.6 = [8 x i8] c"LOYAKEY\00"
@.str.7 = [13 x i8] c"LOYAKEY: %s\0A\00"
@.str.8 = [8 x i8] c"ROYAKEY\00"
@.str.9 = [13 x i8] c"ROYAKEY: %s\0A\00"
@.str.10 = [6 x i8] c"ONKEY\00"
@.str.11 = [11 x i8] c"ONKEY: %s\0A\00"
@.str.12 = [7 x i8] c"OFFKEY\00"
@.str.13 = [12 x i8] c"OFFKEY: %s\0A\00"
@.str.14 = [3 x i8] c"IM\00"
@.str.15 = [8 x i8] c"IM: %s\0A\00"
@.str.16 = [9 x i8] c"CHARTIME\00"
@.str.17 = [14 x i8] c"CHARTIME: %s\0A\00"
@.str.18 = [8 x i8] c"OYATIME\00"
@.str.19 = [13 x i8] c"OYATIME: %s\0A\00"
@.str.20 = [11 x i8] c"NICOLATIME\00"
@.str.21 = [16 x i8] c"NICOLATIME: %s\0A\00"
@.str.22 = [7 x i8] c"KEYADD\00"
@.str.23 = [9 x i8] c"%[^:]:%s\00"
@.str.24 = [15 x i8] c"KEYADD: %s=%s\0A\00"
@.str.25 = [8 x i8] c"LKEYADD\00"
@.str.26 = [16 x i8] c"LKEYADD: %s=%s\0A\00"
@.str.27 = [8 x i8] c"RKEYADD\00"
@.str.28 = [16 x i8] c"RKEYADD: %s=%s\0A\00"
define i32 @load_config(i8* nocapture %0) {
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = alloca [128 x i8]
%6 = alloca [128 x i8]
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%12 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i32* %12, null
br i1 %13, label %132, label %14
14: ; preds = %1
%15 = call i8* @fgets(i8* %7, i32 128, i32* %12)
%16 = icmp eq i8* %15, null
br i1 %16, label %130, label %17
17: ; preds = %14, %127
store i8 0, i8* %8
store i8 0, i8* %9
%18 = call i32 @trim(i8* %7)
%19 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %127, label %21
21: ; preds = %17
%22 = call i64 @strncmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%23 = icmp eq i64 %22, 0
br i1 %23, label %127, label %24
24: ; preds = %21
%25 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %8, i8* %9)
%26 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %24
%29 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%30 = call i32 @set_keyboardname(i8* %9)
br label %127
31: ; preds = %24
%32 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %31
%35 = call i64 @keyname_to_code(i8* %9)
%36 = icmp eq i64 %35, 0
br i1 %36, label %127, label %37
37: ; preds = %34
%38 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* %9)
%39 = call i32 @set_left_oyakey(i64 %35)
br label %127
40: ; preds = %31
%41 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %49
43: ; preds = %40
%44 = call i64 @keyname_to_code(i8* %9)
%45 = icmp eq i64 %44, 0
br i1 %45, label %127, label %46
46: ; preds = %43
%47 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i8* %9)
%48 = call i32 @set_right_oyakey(i64 %44)
br label %127
49: ; preds = %40
%50 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %58
52: ; preds = %49
%53 = call i64 @keyname_to_code(i8* %9)
%54 = icmp eq i64 %53, 0
br i1 %54, label %127, label %55
55: ; preds = %52
%56 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i8* %9)
%57 = call i32 @set_onkey(i64 %53)
br label %127
58: ; preds = %49
%59 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %67
61: ; preds = %58
%62 = call i64 @keyname_to_code(i8* %9)
%63 = icmp eq i64 %62, 0
br i1 %63, label %127, label %64
64: ; preds = %61
%65 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0), i8* %9)
%66 = call i32 @set_offkey(i64 %62)
br label %127
67: ; preds = %58
%68 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), i8* %9)
%72 = call i32 @set_imtype(i8* %9)
br label %127
73: ; preds = %67
%74 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.16, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %76, label %80
76: ; preds = %73
%77 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8* %9)
%78 = call i32 @atoi(i8* %9)
%79 = call i32 @set_char_time(i32 %78)
br label %127
80: ; preds = %73
%81 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.18, i64 0, i64 0))
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %87
83: ; preds = %80
%84 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.19, i64 0, i64 0), i8* %9)
%85 = call i32 @atoi(i8* %9)
%86 = call i32 @set_oya_time(i32 %85)
br label %127
87: ; preds = %80
%88 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%89 = icmp eq i64 %88, 0
br i1 %89, label %90, label %94
90: ; preds = %87
%91 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.21, i64 0, i64 0), i8* %9)
%92 = call i32 @atoi(i8* %9)
%93 = call i32 @set_nicola_time(i32 %92)
br label %127
94: ; preds = %87
%95 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %105
97: ; preds = %94
%98 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* %10, i8* %11)
%99 = call i64 @keyname_to_code(i8* %10)
%100 = call i32 @mojiname_to_code(i8* %11)
%101 = icmp eq i64 %99, 0
br i1 %101, label %127, label %102
102: ; preds = %97
%103 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.24, i64 0, i64 0), i8* %10, i8* %11)
%104 = call i32 @add_key_moji(i64 %99, i32 %100)
br label %127
105: ; preds = %94
%106 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.25, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %116
108: ; preds = %105
%109 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* %10, i8* %11)
%110 = call i64 @keyname_to_code(i8* %10)
%111 = call i32 @mojiname_to_code(i8* %11)
%112 = icmp eq i64 %110, 0
br i1 %112, label %127, label %113
113: ; preds = %108
%114 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.26, i64 0, i64 0), i8* %10, i8* %11)
%115 = call i32 @add_left_key_moji(i64 %110, i32 %111)
br label %127
116: ; preds = %105
%117 = call i64 @strcasecmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.27, i64 0, i64 0))
%118 = icmp eq i64 %117, 0
br i1 %118, label %119, label %127
119: ; preds = %116
%120 = call i32 @sscanf(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.23, i64 0, i64 0), i8* %10, i8* %11)
%121 = call i64 @keyname_to_code(i8* %10)
%122 = call i32 @mojiname_to_code(i8* %11)
%123 = icmp eq i64 %121, 0
br i1 %123, label %127, label %124
124: ; preds = %119
%125 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.28, i64 0, i64 0), i8* %10, i8* %11)
%126 = call i32 @add_right_key_moji(i64 %121, i32 %122)
br label %127
127: ; preds = %28, %46, %43, %64, %61, %76, %90, %113, %108, %119, %124, %116, %97, %102, %83, %70, %52, %55, %34, %37, %17, %21
%128 = call i8* @fgets(i8* %7, i32 128, i32* %12)
%129 = icmp eq i8* %128, null
br i1 %129, label %130, label %17
130: ; preds = %127, %14
%131 = call i32 @fclose(i32* %12)
br label %132
132: ; preds = %1, %130
%133 = phi i32 [ 1, %130 ], [ 0, %1 ]
ret i32 %133
}