#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 EOF;
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ tolower(int);
int /*<<< orphan*/ toupper(int);
int main(int argc, char *argv[]) {
  int c;
  if (strcmp(argv[0], "./charConverterU") == 0) {
    while ((c = getchar()) != EOF)
      putchar(toupper(c));
  } else if (strcmp(argv[0], "./charConverterL") == 0) {
    while ((c = getchar()) != EOF)
      putchar(tolower(c));
  }
  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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe8c(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ba <main+0x6a>
jmp    1188 <main+0x38>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e4f(%rip),%rcx
cmp    (%rcx),%eax
je     11b5 <main+0x65>
mov    -0x14(%rbp),%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    1188 <main+0x38>
jmp    1213 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe49(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    120e <main+0xbe>
jmp    11dc <main+0x8c>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2dfb(%rip),%rcx
cmp    (%rcx),%eax
je     1209 <main+0xb9>
mov    -0x14(%rbp),%edi
call   1070 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    11dc <main+0x8c>
jmp    120e <main+0xbe>
jmp    1213 <main+0xc3>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
lea    0xea2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1180 <main+0x30>
mov    (%rbx),%rdi
lea    0xe9f(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11bb <main+0x6b>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e5a(%rip),%rbx
cmp    (%rbx),%eax
je     117c <main+0x2c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%eax
jne    11a0 <main+0x50>
jmp    117c <main+0x2c>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x2e1f(%rip),%rbx
cmp    (%rbx),%eax
je     117c <main+0x2c>
nopl   (%rax)
mov    %eax,%edi
call   1070 <tolower@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    (%rbx),%eax
jne    11d0 <main+0x80>
jmp    117c <main+0x2c>

LLVM IR (-O0):
@.str = [17 x i8] c"./charConverterU\00"
@EOF = global i32 0
@.str.1 = [17 x i8] c"./charConverterL\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
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %2
br label %13
13: ; preds = %17, %12
%14 = call i32 (...) @getchar()
store i32 %14, i32* %6
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %6
%19 = call i32 @toupper(i32 %18)
%20 = call i32 @putchar(i32 %19)
br label %13
21: ; preds = %13
br label %39
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 0
%25 = load i8*, i8** %24
%26 = call i64 @strcmp(i8* %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %38
28: ; preds = %22
br label %29
29: ; preds = %33, %28
%30 = call i32 (...) @getchar()
store i32 %30, i32* %6
%31 = load i32, i32* @EOF
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %37
33: ; preds = %29
%34 = load i32, i32* %6
%35 = call i32 @tolower(i32 %34)
%36 = call i32 @putchar(i32 %35)
br label %29
37: ; preds = %29
br label %38
38: ; preds = %37, %22
br label %39
39: ; preds = %38, %21
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"./charConverterU\00"
@EOF = global i32 0
@.str.1 = [17 x i8] c"./charConverterL\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %2
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %32, label %10
10: ; preds = %6, %10
%11 = phi i32 [ %14, %10 ], [ %7, %6 ]
%12 = tail call i32 @toupper(i32 %11)
%13 = tail call i32 @putchar(i32 %12)
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp eq i32 %14, %15
br i1 %16, label %32, label %10
17: ; preds = %2
%18 = load i8*, i8** %1
%19 = tail call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %32
21: ; preds = %17
%22 = tail call i32 (...) @getchar()
%23 = load i32, i32* @EOF
%24 = icmp eq i32 %22, %23
br i1 %24, label %32, label %25
25: ; preds = %21, %25
%26 = phi i32 [ %29, %25 ], [ %22, %21 ]
%27 = tail call i32 @tolower(i32 %26)
%28 = tail call i32 @putchar(i32 %27)
%29 = tail call i32 (...) @getchar()
%30 = load i32, i32* @EOF
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %25
32: ; preds = %25, %10, %21, %6, %17
ret i32 0
}