#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ xtables(int);
int main(int argc, char *argv[]) {
  char *locname;
  char *arg;
  int charset;
  int i;
  if (argc != 2) {
    fprintf(stderr, "usage: %s <ascii | 8859-x>\n", argv[0]);
    exit(1);
  }
  locname = NULL;
  arg = argv[1];
  charset = 0;
  if (!strcmp(arg, "ascii")) {
    locname = setlocale(LC_CTYPE, "C");
    charset = 0;
  } else if (!strcmp(arg, "8859-1")) {
    locname = setlocale(LC_CTYPE, "fi_FI");
    charset = 1;
  } else if (!strcmp(arg, "8859-2")) {
    locname = setlocale(LC_CTYPE, "bs_BA");
    charset = 2;
  } else if (!strcmp(arg, "8859-5")) {
    locname = setlocale(LC_CTYPE, "ru_RU");
    charset = 5;
  } else if (!strcmp(arg, "8859-6")) {
    locname = setlocale(LC_CTYPE, "ar_SA");
    charset = 6;
  } else if (!strcmp(arg, "8859-7")) {
    locname = setlocale(LC_CTYPE, "el_GR");
    charset = 7;
  } else if (!strcmp(arg, "8859-8")) {
    locname = setlocale(LC_CTYPE, "he_IL");
    charset = 8;
  } else if (!strcmp(arg, "8859-9")) {
    locname = setlocale(LC_CTYPE, "tr_TR");
    charset = 9;
  } else if (!strcmp(arg, "8859-10")) {
    locname = setlocale(LC_CTYPE, "lug_UG");
    charset = 10;
  } else if (!strcmp(arg, "8859-13")) {
    locname = setlocale(LC_CTYPE, "mi_NZ");
    charset = 13;
  } else if (!strcmp(arg, "8859-14")) {
    locname = setlocale(LC_CTYPE, "cy_GB");
    charset = 14;
  } else if (!strcmp(arg, "8859-15")) {
    locname = setlocale(LC_CTYPE, "fi_FI@euro");
    charset = 15;
  } else if (!strcmp(arg, "tis620")) {
    locname = setlocale(LC_CTYPE, "th_TH");
    charset = 33;
  } else if (!strcmp(arg, "koi8-r")) {
    locname = setlocale(LC_CTYPE, "bg_BG@KOI8-R");
    charset = 35;
  } else if (!strcmp(arg, "koi8-t")) {
    locname = setlocale(LC_CTYPE, "tg_TJ");
    charset = 36;
  } else if (!strcmp(arg, "koi8-u")) {
    locname = setlocale(LC_CTYPE, "ru_UA");
    charset = 37;
  } else {
    fprintf(stderr, "unsupported charset: %s\n", arg);
    exit(1);
  }
  if (locname) {
    xtables(charset);
    fprintf(stderr, "LOCALE: %s\n", locname);
  } else {
    fprintf(stderr, "invalid locale\n");
    exit(1);
  }
  exit(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)
cmpl   $0x2,-0x8(%rbp)
je     1198 <main+0x48>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f1 <main+0xa1>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
lea    0xe46(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    1603 <main+0x4b3>
mov    -0x20(%rbp),%rdi
lea    0xe28(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    122f <main+0xdf>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    0xe11(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
jmp    15fe <main+0x4ae>
mov    -0x20(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    126d <main+0x11d>
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
lea    0xde0(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x24(%rbp)
jmp    15f9 <main+0x4a9>
mov    -0x20(%rbp),%rdi
lea    0xdc6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12ab <main+0x15b>
mov    0x2d5b(%rip),%rax
mov    (%rax),%edi
lea    0xdaf(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x5,-0x24(%rbp)
jmp    15f4 <main+0x4a4>
mov    -0x20(%rbp),%rdi
lea    0xd95(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    12e9 <main+0x199>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xd7e(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x6,-0x24(%rbp)
jmp    15ef <main+0x49f>
mov    -0x20(%rbp),%rdi
lea    0xd64(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1327 <main+0x1d7>
mov    0x2cdf(%rip),%rax
mov    (%rax),%edi
lea    0xd4d(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x7,-0x24(%rbp)
jmp    15ea <main+0x49a>
mov    -0x20(%rbp),%rdi
lea    0xd33(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1365 <main+0x215>
mov    0x2ca1(%rip),%rax
mov    (%rax),%edi
lea    0xd1c(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x24(%rbp)
jmp    15e5 <main+0x495>
mov    -0x20(%rbp),%rdi
lea    0xd02(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13a3 <main+0x253>
mov    0x2c63(%rip),%rax
mov    (%rax),%edi
lea    0xceb(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x9,-0x24(%rbp)
jmp    15e0 <main+0x490>
mov    -0x20(%rbp),%rdi
lea    0xcd1(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    13e1 <main+0x291>
mov    0x2c25(%rip),%rax
mov    (%rax),%edi
lea    0xcbb(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0xa,-0x24(%rbp)
jmp    15db <main+0x48b>
mov    -0x20(%rbp),%rdi
lea    0xca2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    141f <main+0x2cf>
mov    0x2be7(%rip),%rax
mov    (%rax),%edi
lea    0xc8c(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0xd,-0x24(%rbp)
jmp    15d6 <main+0x486>
mov    -0x20(%rbp),%rdi
lea    0xc72(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    145d <main+0x30d>
mov    0x2ba9(%rip),%rax
mov    (%rax),%edi
lea    0xc5c(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0xe,-0x24(%rbp)
jmp    15d1 <main+0x481>
mov    -0x20(%rbp),%rdi
lea    0xc42(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    149b <main+0x34b>
mov    0x2b6b(%rip),%rax
mov    (%rax),%edi
lea    0xc2c(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0xf,-0x24(%rbp)
jmp    15cc <main+0x47c>
mov    -0x20(%rbp),%rdi
lea    0xc17(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    14d9 <main+0x389>
mov    0x2b2d(%rip),%rax
mov    (%rax),%edi
lea    0xc00(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x21,-0x24(%rbp)
jmp    15c7 <main+0x477>
mov    -0x20(%rbp),%rdi
lea    0xbe6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1517 <main+0x3c7>
mov    0x2aef(%rip),%rax
mov    (%rax),%edi
lea    0xbcf(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x23,-0x24(%rbp)
jmp    15c2 <main+0x472>
mov    -0x20(%rbp),%rdi
lea    0xbbc(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1555 <main+0x405>
mov    0x2ab1(%rip),%rax
mov    (%rax),%edi
lea    0xba5(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x24,-0x24(%rbp)
jmp    15bd <main+0x46d>
mov    -0x20(%rbp),%rdi
lea    0xb8b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1593 <main+0x443>
mov    0x2a73(%rip),%rax
mov    (%rax),%edi
lea    0xb74(%rip),%rsi
call   1060 <setlocale@plt>
mov    %rax,-0x18(%rbp)
movl   $0x25,-0x24(%rbp)
jmp    15b8 <main+0x468>
mov    0x2a3e(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xb51(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
jmp    15bd <main+0x46d>
jmp    15c2 <main+0x472>
jmp    15c7 <main+0x477>
jmp    15cc <main+0x47c>
jmp    15d1 <main+0x481>
jmp    15d6 <main+0x486>
jmp    15db <main+0x48b>
jmp    15e0 <main+0x490>
jmp    15e5 <main+0x495>
jmp    15ea <main+0x49a>
jmp    15ef <main+0x49f>
jmp    15f4 <main+0x4a4>
jmp    15f9 <main+0x4a9>
jmp    15fe <main+0x4ae>
jmp    1603 <main+0x4b3>
cmpq   $0x0,-0x18(%rbp)
je     1636 <main+0x4e6>
mov    -0x24(%rbp),%edi
call   1030 <xtables@plt>
mov    0x29bb(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xae7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1657 <main+0x507>
mov    0x299b(%rip),%rax
mov    (%rax),%edi
lea    0xad7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    117d <main+0x2d>
mov    0x8(%rsi),%rbx
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11a1 <main+0x51>
xor    %ebp,%ebp
lea    0xeaa(%rip),%rsi
jmp    13af <main+0x25f>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe70(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11c5 <main+0x75>
mov    $0x1,%ebp
lea    0xe6b(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xe65(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    11e9 <main+0x99>
mov    $0x2,%ebp
lea    0xe54(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xe4e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    120d <main+0xbd>
mov    $0x5,%ebp
lea    0xe3d(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xe37(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1231 <main+0xe1>
mov    $0x6,%ebp
lea    0xe26(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xe20(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1255 <main+0x105>
mov    $0x7,%ebp
lea    0xe0f(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xe09(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1279 <main+0x129>
mov    $0x8,%ebp
lea    0xdf8(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xdf2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    129d <main+0x14d>
mov    $0x9,%ebp
lea    0xde1(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xddb(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    12c1 <main+0x171>
mov    $0xa,%ebp
lea    0xdcb(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xdc6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    12e5 <main+0x195>
mov    $0xd,%ebp
lea    0xdb6(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xdb0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1309 <main+0x1b9>
mov    $0xe,%ebp
lea    0xda0(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xd9a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    132d <main+0x1dd>
mov    $0xf,%ebp
lea    0xd8a(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xd89(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    134e <main+0x1fe>
mov    $0x21,%ebp
lea    0xd78(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xd75(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    136f <main+0x21f>
mov    $0x23,%ebp
lea    0xd64(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xd68(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1390 <main+0x240>
mov    $0x24,%ebp
lea    0xd57(%rip),%rsi
jmp    13af <main+0x25f>
lea    0xd54(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    140e <main+0x2be>
mov    $0x25,%ebp
lea    0xd43(%rip),%rsi
mov    0x2c32(%rip),%rax
mov    (%rax),%edi
call   1060 <setlocale@plt>
test   %rax,%rax
jne    13e3 <main+0x293>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
lea    0xd4b(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <xtables@plt>
mov    0x2be4(%rip),%rax
mov    (%rax),%edi
lea    0xd14(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
xor    %edi,%edi
call   1070 <exit@plt>
mov    0x2bc3(%rip),%rax
mov    (%rax),%edi
lea    0xcda(%rip),%rsi
mov    %rbx,%rdx
jmp    1190 <main+0x40>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"usage: %s <ascii | 8859-x>\0A\00"
@.str.1 = [6 x i8] c"ascii\00"
@LC_CTYPE = global i32 0
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [7 x i8] c"8859-1\00"
@.str.4 = [6 x i8] c"fi_FI\00"
@.str.5 = [7 x i8] c"8859-2\00"
@.str.6 = [6 x i8] c"bs_BA\00"
@.str.7 = [7 x i8] c"8859-5\00"
@.str.8 = [6 x i8] c"ru_RU\00"
@.str.9 = [7 x i8] c"8859-6\00"
@.str.10 = [6 x i8] c"ar_SA\00"
@.str.11 = [7 x i8] c"8859-7\00"
@.str.12 = [6 x i8] c"el_GR\00"
@.str.13 = [7 x i8] c"8859-8\00"
@.str.14 = [6 x i8] c"he_IL\00"
@.str.15 = [7 x i8] c"8859-9\00"
@.str.16 = [6 x i8] c"tr_TR\00"
@.str.17 = [8 x i8] c"8859-10\00"
@.str.18 = [7 x i8] c"lug_UG\00"
@.str.19 = [8 x i8] c"8859-13\00"
@.str.20 = [6 x i8] c"mi_NZ\00"
@.str.21 = [8 x i8] c"8859-14\00"
@.str.22 = [6 x i8] c"cy_GB\00"
@.str.23 = [8 x i8] c"8859-15\00"
@.str.24 = [11 x i8] c"fi_FI@euro\00"
@.str.25 = [7 x i8] c"tis620\00"
@.str.26 = [6 x i8] c"th_TH\00"
@.str.27 = [7 x i8] c"koi8-r\00"
@.str.28 = [13 x i8] c"bg_BG@KOI8-R\00"
@.str.29 = [7 x i8] c"koi8-t\00"
@.str.30 = [6 x i8] c"tg_TJ\00"
@.str.31 = [7 x i8] c"koi8-u\00"
@.str.32 = [6 x i8] c"ru_UA\00"
@.str.33 = [25 x i8] c"unsupported charset: %s\0A\00"
@.str.34 = [12 x i8] c"LOCALE: %s\0A\00"
@.str.35 = [16 x i8] c"invalid locale\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 2
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %2
store i8* null, i8** %6
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
store i8* %22, i8** %7
store i32 0, i32* %8
%23 = load i8*, i8** %7
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %19
%27 = load i32, i32* @LC_CTYPE
%28 = call i8* @setlocale(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i8* %28, i8** %6
store i32 0, i32* %8
br label %154
29: ; preds = %19
%30 = load i8*, i8** %7
%31 = call i32 @strcmp(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %29
%34 = load i32, i32* @LC_CTYPE
%35 = call i8* @setlocale(i32 %34, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i8* %35, i8** %6
store i32 1, i32* %8
br label %153
36: ; preds = %29
%37 = load i8*, i8** %7
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %36
%41 = load i32, i32* @LC_CTYPE
%42 = call i8* @setlocale(i32 %41, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i8* %42, i8** %6
store i32 2, i32* %8
br label %152
43: ; preds = %36
%44 = load i8*, i8** %7
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = load i32, i32* @LC_CTYPE
%49 = call i8* @setlocale(i32 %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
store i8* %49, i8** %6
store i32 5, i32* %8
br label %151
50: ; preds = %43
%51 = load i8*, i8** %7
%52 = call i32 @strcmp(i8* %51, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %50
%55 = load i32, i32* @LC_CTYPE
%56 = call i8* @setlocale(i32 %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
store i8* %56, i8** %6
store i32 6, i32* %8
br label %150
57: ; preds = %50
%58 = load i8*, i8** %7
%59 = call i32 @strcmp(i8* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%60 = icmp ne i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %57
%62 = load i32, i32* @LC_CTYPE
%63 = call i8* @setlocale(i32 %62, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
store i8* %63, i8** %6
store i32 7, i32* %8
br label %149
64: ; preds = %57
%65 = load i8*, i8** %7
%66 = call i32 @strcmp(i8* %65, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%67 = icmp ne i32 %66, 0
br i1 %67, label %71, label %68
68: ; preds = %64
%69 = load i32, i32* @LC_CTYPE
%70 = call i8* @setlocale(i32 %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
store i8* %70, i8** %6
store i32 8, i32* %8
br label %148
71: ; preds = %64
%72 = load i8*, i8** %7
%73 = call i32 @strcmp(i8* %72, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%74 = icmp ne i32 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %71
%76 = load i32, i32* @LC_CTYPE
%77 = call i8* @setlocale(i32 %76, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
store i8* %77, i8** %6
store i32 9, i32* %8
br label %147
78: ; preds = %71
%79 = load i8*, i8** %7
%80 = call i32 @strcmp(i8* %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%81 = icmp ne i32 %80, 0
br i1 %81, label %85, label %82
82: ; preds = %78
%83 = load i32, i32* @LC_CTYPE
%84 = call i8* @setlocale(i32 %83, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
store i8* %84, i8** %6
store i32 10, i32* %8
br label %146
85: ; preds = %78
%86 = load i8*, i8** %7
%87 = call i32 @strcmp(i8* %86, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%88 = icmp ne i32 %87, 0
br i1 %88, label %92, label %89
89: ; preds = %85
%90 = load i32, i32* @LC_CTYPE
%91 = call i8* @setlocale(i32 %90, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
store i8* %91, i8** %6
store i32 13, i32* %8
br label %145
92: ; preds = %85
%93 = load i8*, i8** %7
%94 = call i32 @strcmp(i8* %93, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%95 = icmp ne i32 %94, 0
br i1 %95, label %99, label %96
96: ; preds = %92
%97 = load i32, i32* @LC_CTYPE
%98 = call i8* @setlocale(i32 %97, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
store i8* %98, i8** %6
store i32 14, i32* %8
br label %144
99: ; preds = %92
%100 = load i8*, i8** %7
%101 = call i32 @strcmp(i8* %100, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.23, i64 0, i64 0))
%102 = icmp ne i32 %101, 0
br i1 %102, label %106, label %103
103: ; preds = %99
%104 = load i32, i32* @LC_CTYPE
%105 = call i8* @setlocale(i32 %104, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
store i8* %105, i8** %6
store i32 15, i32* %8
br label %143
106: ; preds = %99
%107 = load i8*, i8** %7
%108 = call i32 @strcmp(i8* %107, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%109 = icmp ne i32 %108, 0
br i1 %109, label %113, label %110
110: ; preds = %106
%111 = load i32, i32* @LC_CTYPE
%112 = call i8* @setlocale(i32 %111, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0))
store i8* %112, i8** %6
store i32 33, i32* %8
br label %142
113: ; preds = %106
%114 = load i8*, i8** %7
%115 = call i32 @strcmp(i8* %114, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
%116 = icmp ne i32 %115, 0
br i1 %116, label %120, label %117
117: ; preds = %113
%118 = load i32, i32* @LC_CTYPE
%119 = call i8* @setlocale(i32 %118, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.28, i64 0, i64 0))
store i8* %119, i8** %6
store i32 35, i32* %8
br label %141
120: ; preds = %113
%121 = load i8*, i8** %7
%122 = call i32 @strcmp(i8* %121, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.29, i64 0, i64 0))
%123 = icmp ne i32 %122, 0
br i1 %123, label %127, label %124
124: ; preds = %120
%125 = load i32, i32* @LC_CTYPE
%126 = call i8* @setlocale(i32 %125, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0))
store i8* %126, i8** %6
store i32 36, i32* %8
br label %140
127: ; preds = %120
%128 = load i8*, i8** %7
%129 = call i32 @strcmp(i8* %128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
%130 = icmp ne i32 %129, 0
br i1 %130, label %134, label %131
131: ; preds = %127
%132 = load i32, i32* @LC_CTYPE
%133 = call i8* @setlocale(i32 %132, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0))
store i8* %133, i8** %6
store i32 37, i32* %8
br label %139
134: ; preds = %127
%135 = load i32, i32* @stderr
%136 = load i8*, i8** %7
%137 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.33, i64 0, i64 0), i8* %136)
%138 = call i32 @exit(i32 1)
unreachable
139: ; preds = %131
br label %140
140: ; preds = %139, %124
br label %141
141: ; preds = %140, %117
br label %142
142: ; preds = %141, %110
br label %143
143: ; preds = %142, %103
br label %144
144: ; preds = %143, %96
br label %145
145: ; preds = %144, %89
br label %146
146: ; preds = %145, %82
br label %147
147: ; preds = %146, %75
br label %148
148: ; preds = %147, %68
br label %149
149: ; preds = %148, %61
br label %150
150: ; preds = %149, %54
br label %151
151: ; preds = %150, %47
br label %152
152: ; preds = %151, %40
br label %153
153: ; preds = %152, %33
br label %154
154: ; preds = %153, %26
%155 = load i8*, i8** %6
%156 = icmp ne i8* %155, null
br i1 %156, label %157, label %163
157: ; preds = %154
%158 = load i32, i32* %8
%159 = call i32 @xtables(i32 %158)
%160 = load i32, i32* @stderr
%161 = load i8*, i8** %6
%162 = call i32 (i32, i8*, ...) @fprintf(i32 %160, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.34, i64 0, i64 0), i8* %161)
br label %167
163: ; preds = %154
%164 = load i32, i32* @stderr
%165 = call i32 (i32, i8*, ...) @fprintf(i32 %164, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.35, i64 0, i64 0))
%166 = call i32 @exit(i32 1)
unreachable
167: ; preds = %157
%168 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage: %s <ascii | 8859-x>\0A\00"
@.str.1 = [6 x i8] c"ascii\00"
@LC_CTYPE = global i32 0
@.str.2 = [2 x i8] c"C\00"
@.str.3 = [7 x i8] c"8859-1\00"
@.str.4 = [6 x i8] c"fi_FI\00"
@.str.5 = [7 x i8] c"8859-2\00"
@.str.6 = [6 x i8] c"bs_BA\00"
@.str.7 = [7 x i8] c"8859-5\00"
@.str.8 = [6 x i8] c"ru_RU\00"
@.str.9 = [7 x i8] c"8859-6\00"
@.str.10 = [6 x i8] c"ar_SA\00"
@.str.11 = [7 x i8] c"8859-7\00"
@.str.12 = [6 x i8] c"el_GR\00"
@.str.13 = [7 x i8] c"8859-8\00"
@.str.14 = [6 x i8] c"he_IL\00"
@.str.15 = [7 x i8] c"8859-9\00"
@.str.16 = [6 x i8] c"tr_TR\00"
@.str.17 = [8 x i8] c"8859-10\00"
@.str.18 = [7 x i8] c"lug_UG\00"
@.str.19 = [8 x i8] c"8859-13\00"
@.str.20 = [6 x i8] c"mi_NZ\00"
@.str.21 = [8 x i8] c"8859-14\00"
@.str.22 = [6 x i8] c"cy_GB\00"
@.str.23 = [8 x i8] c"8859-15\00"
@.str.24 = [11 x i8] c"fi_FI@euro\00"
@.str.25 = [7 x i8] c"tis620\00"
@.str.26 = [6 x i8] c"th_TH\00"
@.str.27 = [7 x i8] c"koi8-r\00"
@.str.28 = [13 x i8] c"bg_BG@KOI8-R\00"
@.str.29 = [7 x i8] c"koi8-t\00"
@.str.30 = [6 x i8] c"tg_TJ\00"
@.str.31 = [7 x i8] c"koi8-u\00"
@.str.32 = [6 x i8] c"ru_UA\00"
@.str.33 = [25 x i8] c"unsupported charset: %s\0A\00"
@.str.34 = [12 x i8] c"LOCALE: %s\0A\00"
@.str.35 = [16 x i8] c"invalid locale\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %63, label %14
14: ; preds = %9
%15 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %63, label %17
17: ; preds = %14
%18 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %63, label %20
20: ; preds = %17
%21 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%22 = icmp eq i32 %21, 0
br i1 %22, label %63, label %23
23: ; preds = %20
%24 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
br i1 %25, label %63, label %26
26: ; preds = %23
%27 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %63, label %29
29: ; preds = %26
%30 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%31 = icmp eq i32 %30, 0
br i1 %31, label %63, label %32
32: ; preds = %29
%33 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.15, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %63, label %35
35: ; preds = %32
%36 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %63, label %38
38: ; preds = %35
%39 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.19, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %63, label %41
41: ; preds = %38
%42 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %63, label %44
44: ; preds = %41
%45 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.23, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %63, label %47
47: ; preds = %44
%48 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%49 = icmp eq i32 %48, 0
br i1 %49, label %63, label %50
50: ; preds = %47
%51 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
%52 = icmp eq i32 %51, 0
br i1 %52, label %63, label %53
53: ; preds = %50
%54 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.29, i64 0, i64 0))
%55 = icmp eq i32 %54, 0
br i1 %55, label %63, label %56
56: ; preds = %53
%57 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0))
%58 = icmp eq i32 %57, 0
br i1 %58, label %63, label %59
59: ; preds = %56
%60 = load i32, i32* @stderr
%61 = tail call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.33, i64 0, i64 0), i8* %11)
%62 = tail call i32 @exit(i32 1)
unreachable
63: ; preds = %56, %53, %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %9
%64 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), %14 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), %17 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), %20 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), %23 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), %26 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0), %29 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), %32 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), %35 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0), %38 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0), %41 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0), %44 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.26, i64 0, i64 0), %47 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.28, i64 0, i64 0), %50 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.30, i64 0, i64 0), %53 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.32, i64 0, i64 0), %56 ]
%65 = phi i32 [ 0, %9 ], [ 1, %14 ], [ 2, %17 ], [ 5, %20 ], [ 6, %23 ], [ 7, %26 ], [ 8, %29 ], [ 9, %32 ], [ 10, %35 ], [ 13, %38 ], [ 14, %41 ], [ 15, %44 ], [ 33, %47 ], [ 35, %50 ], [ 36, %53 ], [ 37, %56 ]
%66 = load i32, i32* @LC_CTYPE
%67 = tail call i8* @setlocale(i32 %66, i8* %64)
%68 = icmp eq i8* %67, null
br i1 %68, label %74, label %69
69: ; preds = %63
%70 = tail call i32 @xtables(i32 %65)
%71 = load i32, i32* @stderr
%72 = tail call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.34, i64 0, i64 0), i8* %67)
%73 = tail call i32 @exit(i32 0)
unreachable
74: ; preds = %63
%75 = load i32, i32* @stderr
%76 = tail call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.35, i64 0, i64 0))
%77 = tail call i32 @exit(i32 1)
unreachable
}