#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 convert_intl(char *, char *, char *, char *);
int convert_rc(char *, char *, char *, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcasecmp(char *, char *);
int main(int argc, char *argv[]) {
  int result = 0;
  if (argc < 6) {
    printf("too few arguments\n");
    exit(1);
  }
  if (!strcasecmp(argv[1], "win32") && argc == 6) {
    result = convert_rc(argv[2], argv[3], argv[4], argv[5]);
  }
  if (!strcasecmp(argv[1], "intl") && argc == 6) {
    result = convert_intl(argv[2], argv[3], argv[4], argv[5]);
  }
  if (result == 0) {
    printf("error while processing file\n");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    118d <main+0x3d>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe77(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    11dc <main+0x8c>
cmpl   $0x6,-0x8(%rbp)
jne    11dc <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rcx
call   1050 <convert_rc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2e(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    122b <main+0xdb>
cmpl   $0x6,-0x8(%rbp)
jne    122b <main+0xdb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rcx
call   1060 <convert_intl@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    124b <main+0xfb>
lea    0xde2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x5,%edi
jle    11e5 <main+0x95>
mov    %rsi,%rbx
mov    %edi,%r15d
mov    0x8(%rsi),%rbp
lea    0xe8f(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
xor    %r14d,%r14d
cmp    $0x6,%r15d
jne    11a2 <main+0x52>
test   %eax,%eax
jne    11a2 <main+0x52>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
mov    0x20(%rbx),%rdx
mov    0x28(%rbx),%rcx
call   1050 <convert_rc@plt>
mov    %eax,%r14d
mov    0x8(%rbx),%rbp
lea    0xe5d(%rip),%rsi
mov    %rbp,%rdi
call   1030 <strcasecmp@plt>
cmp    $0x6,%r15d
jne    11d3 <main+0x83>
test   %eax,%eax
jne    11d3 <main+0x83>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
mov    0x20(%rbx),%rdx
mov    0x28(%rbx),%rcx
call   1060 <convert_intl@plt>
mov    %eax,%r14d
test   %r14d,%r14d
je     11ee <main+0x9e>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe3b(%rip),%rdi
jmp    11f5 <main+0xa5>
lea    0xe16(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"too few arguments\0A\00"
@.str.1 = [6 x i8] c"win32\00"
@.str.2 = [5 x i8] c"intl\00"
@.str.3 = [29 x i8] c"error while processing file\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @strcasecmp(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %35, label %18
18: ; preds = %12
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 6
br i1 %20, label %21, label %35
21: ; preds = %18
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 3
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 4
%30 = load i8*, i8** %29
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 5
%33 = load i8*, i8** %32
%34 = call i32 @convert_rc(i8* %24, i8* %27, i8* %30, i8* %33)
store i32 %34, i32* %6
br label %35
35: ; preds = %21, %18, %12
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @strcasecmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%40 = icmp ne i32 %39, 0
br i1 %40, label %58, label %41
41: ; preds = %35
%42 = load i32, i32* %4
%43 = icmp eq i32 %42, 6
br i1 %43, label %44, label %58
44: ; preds = %41
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 2
%47 = load i8*, i8** %46
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 4
%53 = load i8*, i8** %52
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 5
%56 = load i8*, i8** %55
%57 = call i32 @convert_intl(i8* %47, i8* %50, i8* %53, i8* %56)
store i32 %57, i32* %6
br label %58
58: ; preds = %44, %41, %35
%59 = load i32, i32* %6
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %58
%62 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %58
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"win32\00"
@.str.2 = [5 x i8] c"intl\00"
@str = [28 x i8] c"error while processing file\00"
@str.4 = [18 x i8] c"too few arguments\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 6
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.4, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strcasecmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
%12 = icmp eq i32 %0, 6
%13 = and i1 %12, %11
br i1 %13, label %14, label %25
14: ; preds = %7
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = getelementptr inbounds i8*, i8** %1, i64 4
%20 = load i8*, i8** %19
%21 = getelementptr inbounds i8*, i8** %1, i64 5
%22 = load i8*, i8** %21
%23 = tail call i32 @convert_rc(i8* %16, i8* %18, i8* %20, i8* %22)
%24 = load i8*, i8** %8
br label %25
25: ; preds = %14, %7
%26 = phi i8* [ %24, %14 ], [ %9, %7 ]
%27 = phi i32 [ %23, %14 ], [ 0, %7 ]
%28 = tail call i32 @strcasecmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
%30 = and i1 %12, %29
br i1 %30, label %31, label %41
31: ; preds = %25
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = getelementptr inbounds i8*, i8** %1, i64 3
%35 = load i8*, i8** %34
%36 = getelementptr inbounds i8*, i8** %1, i64 4
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8*, i8** %1, i64 5
%39 = load i8*, i8** %38
%40 = tail call i32 @convert_intl(i8* %33, i8* %35, i8* %37, i8* %39)
br label %41
41: ; preds = %31, %25
%42 = phi i32 [ %40, %31 ], [ %27, %25 ]
%43 = icmp eq i32 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%46 = tail call i32 @exit(i32 1)
unreachable
47: ; preds = %41
ret i32 0
}